agentdeps 0.2.0 → 0.3.0

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 (3) hide show
  1. package/README.md +1 -1
  2. package/dist/index.js +138 -138
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,113 +1,113 @@
1
1
  #!/usr/bin/env node
2
- import{createRequire as S6}from"node:module";var F6=Object.create;var{getPrototypeOf:O6,defineProperty:u4,getOwnPropertyNames:N6}=Object;var A6=Object.prototype.hasOwnProperty;var h1=(q,Z,X)=>{X=q!=null?F6(O6(q)):{};let J=Z||!q||!q.__esModule?u4(X,"default",{value:q,enumerable:!0}):X;for(let $ of N6(q))if(!A6.call(J,$))u4(J,$,{get:()=>q[$],enumerable:!0});return J};var D=(q,Z)=>()=>(Z||q((Z={exports:{}}).exports,Z),Z.exports);var r=S6(import.meta.url);var u1=D((w6)=>{class uq extends Error{constructor(q,Z,X){super(X);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=Z,this.exitCode=q,this.nestedError=void 0}}class m4 extends uq{constructor(q){super(1,"commander.invalidArgument",q);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}w6.CommanderError=uq;w6.InvalidArgumentError=m4});var D0=D((f6)=>{var{InvalidArgumentError:C6}=u1();class d4{constructor(q,Z){switch(this.description=Z||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,q[0]){case"<":this.required=!0,this._name=q.slice(1,-1);break;case"[":this.required=!1,this._name=q.slice(1,-1);break;default:this.required=!0,this._name=q;break}if(this._name.endsWith("..."))this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_collectValue(q,Z){if(Z===this.defaultValue||!Array.isArray(Z))return[q];return Z.push(q),Z}default(q,Z){return this.defaultValue=q,this.defaultValueDescription=Z,this}argParser(q){return this.parseArg=q,this}choices(q){return this.argChoices=q.slice(),this.parseArg=(Z,X)=>{if(!this.argChoices.includes(Z))throw new C6(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(Z,X);return Z},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function E6(q){let Z=q.name()+(q.variadic===!0?"...":"");return q.required?"<"+Z+">":"["+Z+"]"}f6.Argument=d4;f6.humanReadableArgName=E6});var mq=D((v6)=>{var{humanReadableArgName:k6}=D0();class l4{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(q){this.helpWidth=this.helpWidth??q.helpWidth??80}visibleCommands(q){let Z=q.commands.filter((J)=>!J._hidden),X=q._getHelpCommand();if(X&&!X._hidden)Z.push(X);if(this.sortSubcommands)Z.sort((J,$)=>{return J.name().localeCompare($.name())});return Z}compareOptions(q,Z){let X=(J)=>{return J.short?J.short.replace(/^-/,""):J.long.replace(/^--/,"")};return X(q).localeCompare(X(Z))}visibleOptions(q){let Z=q.options.filter((J)=>!J.hidden),X=q._getHelpOption();if(X&&!X.hidden){let J=X.short&&q._findOption(X.short),$=X.long&&q._findOption(X.long);if(!J&&!$)Z.push(X);else if(X.long&&!$)Z.push(q.createOption(X.long,X.description));else if(X.short&&!J)Z.push(q.createOption(X.short,X.description))}if(this.sortOptions)Z.sort(this.compareOptions);return Z}visibleGlobalOptions(q){if(!this.showGlobalOptions)return[];let Z=[];for(let X=q.parent;X;X=X.parent){let J=X.options.filter(($)=>!$.hidden);Z.push(...J)}if(this.sortOptions)Z.sort(this.compareOptions);return Z}visibleArguments(q){if(q._argsDescription)q.registeredArguments.forEach((Z)=>{Z.description=Z.description||q._argsDescription[Z.name()]||""});if(q.registeredArguments.find((Z)=>Z.description))return q.registeredArguments;return[]}subcommandTerm(q){let Z=q.registeredArguments.map((X)=>k6(X)).join(" ");return q._name+(q._aliases[0]?"|"+q._aliases[0]:"")+(q.options.length?" [options]":"")+(Z?" "+Z:"")}optionTerm(q){return q.flags}argumentTerm(q){return q.name()}longestSubcommandTermLength(q,Z){return Z.visibleCommands(q).reduce((X,J)=>{return Math.max(X,this.displayWidth(Z.styleSubcommandTerm(Z.subcommandTerm(J))))},0)}longestOptionTermLength(q,Z){return Z.visibleOptions(q).reduce((X,J)=>{return Math.max(X,this.displayWidth(Z.styleOptionTerm(Z.optionTerm(J))))},0)}longestGlobalOptionTermLength(q,Z){return Z.visibleGlobalOptions(q).reduce((X,J)=>{return Math.max(X,this.displayWidth(Z.styleOptionTerm(Z.optionTerm(J))))},0)}longestArgumentTermLength(q,Z){return Z.visibleArguments(q).reduce((X,J)=>{return Math.max(X,this.displayWidth(Z.styleArgumentTerm(Z.argumentTerm(J))))},0)}commandUsage(q){let Z=q._name;if(q._aliases[0])Z=Z+"|"+q._aliases[0];let X="";for(let J=q.parent;J;J=J.parent)X=J.name()+" "+X;return X+Z+" "+q.usage()}commandDescription(q){return q.description()}subcommandDescription(q){return q.summary()||q.description()}optionDescription(q){let Z=[];if(q.argChoices)Z.push(`choices: ${q.argChoices.map((X)=>JSON.stringify(X)).join(", ")}`);if(q.defaultValue!==void 0){if(q.required||q.optional||q.isBoolean()&&typeof q.defaultValue==="boolean")Z.push(`default: ${q.defaultValueDescription||JSON.stringify(q.defaultValue)}`)}if(q.presetArg!==void 0&&q.optional)Z.push(`preset: ${JSON.stringify(q.presetArg)}`);if(q.envVar!==void 0)Z.push(`env: ${q.envVar}`);if(Z.length>0){let X=`(${Z.join(", ")})`;if(q.description)return`${q.description} ${X}`;return X}return q.description}argumentDescription(q){let Z=[];if(q.argChoices)Z.push(`choices: ${q.argChoices.map((X)=>JSON.stringify(X)).join(", ")}`);if(q.defaultValue!==void 0)Z.push(`default: ${q.defaultValueDescription||JSON.stringify(q.defaultValue)}`);if(Z.length>0){let X=`(${Z.join(", ")})`;if(q.description)return`${q.description} ${X}`;return X}return q.description}formatItemList(q,Z,X){if(Z.length===0)return[];return[X.styleTitle(q),...Z,""]}groupItems(q,Z,X){let J=new Map;return q.forEach(($)=>{let Q=X($);if(!J.has(Q))J.set(Q,[])}),Z.forEach(($)=>{let Q=X($);if(!J.has(Q))J.set(Q,[]);J.get(Q).push($)}),J}formatHelp(q,Z){let X=Z.padWidth(q,Z),J=Z.helpWidth??80;function $(Y,B){return Z.formatItem(Y,X,B,Z)}let Q=[`${Z.styleTitle("Usage:")} ${Z.styleUsage(Z.commandUsage(q))}`,""],z=Z.commandDescription(q);if(z.length>0)Q=Q.concat([Z.boxWrap(Z.styleCommandDescription(z),J),""]);let H=Z.visibleArguments(q).map((Y)=>{return $(Z.styleArgumentTerm(Z.argumentTerm(Y)),Z.styleArgumentDescription(Z.argumentDescription(Y)))});if(Q=Q.concat(this.formatItemList("Arguments:",H,Z)),this.groupItems(q.options,Z.visibleOptions(q),(Y)=>Y.helpGroupHeading??"Options:").forEach((Y,B)=>{let _=Y.map((V)=>{return $(Z.styleOptionTerm(Z.optionTerm(V)),Z.styleOptionDescription(Z.optionDescription(V)))});Q=Q.concat(this.formatItemList(B,_,Z))}),Z.showGlobalOptions){let Y=Z.visibleGlobalOptions(q).map((B)=>{return $(Z.styleOptionTerm(Z.optionTerm(B)),Z.styleOptionDescription(Z.optionDescription(B)))});Q=Q.concat(this.formatItemList("Global Options:",Y,Z))}return this.groupItems(q.commands,Z.visibleCommands(q),(Y)=>Y.helpGroup()||"Commands:").forEach((Y,B)=>{let _=Y.map((V)=>{return $(Z.styleSubcommandTerm(Z.subcommandTerm(V)),Z.styleSubcommandDescription(Z.subcommandDescription(V)))});Q=Q.concat(this.formatItemList(B,_,Z))}),Q.join(`
3
- `)}displayWidth(q){return p4(q).length}styleTitle(q){return q}styleUsage(q){return q.split(" ").map((Z)=>{if(Z==="[options]")return this.styleOptionText(Z);if(Z==="[command]")return this.styleSubcommandText(Z);if(Z[0]==="["||Z[0]==="<")return this.styleArgumentText(Z);return this.styleCommandText(Z)}).join(" ")}styleCommandDescription(q){return this.styleDescriptionText(q)}styleOptionDescription(q){return this.styleDescriptionText(q)}styleSubcommandDescription(q){return this.styleDescriptionText(q)}styleArgumentDescription(q){return this.styleDescriptionText(q)}styleDescriptionText(q){return q}styleOptionTerm(q){return this.styleOptionText(q)}styleSubcommandTerm(q){return q.split(" ").map((Z)=>{if(Z==="[options]")return this.styleOptionText(Z);if(Z[0]==="["||Z[0]==="<")return this.styleArgumentText(Z);return this.styleSubcommandText(Z)}).join(" ")}styleArgumentTerm(q){return this.styleArgumentText(q)}styleOptionText(q){return q}styleArgumentText(q){return q}styleSubcommandText(q){return q}styleCommandText(q){return q}padWidth(q,Z){return Math.max(Z.longestOptionTermLength(q,Z),Z.longestGlobalOptionTermLength(q,Z),Z.longestSubcommandTermLength(q,Z),Z.longestArgumentTermLength(q,Z))}preformatted(q){return/\n[^\S\r\n]/.test(q)}formatItem(q,Z,X,J){let Q=" ".repeat(2);if(!X)return Q+q;let z=q.padEnd(Z+q.length-J.displayWidth(q)),H=2,G=(this.helpWidth??80)-Z-H-2,Y;if(G<this.minWidthToWrap||J.preformatted(X))Y=X;else Y=J.boxWrap(X,G).replace(/\n/g,`
4
- `+" ".repeat(Z+H));return Q+z+" ".repeat(H)+Y.replace(/\n/g,`
5
- ${Q}`)}boxWrap(q,Z){if(Z<this.minWidthToWrap)return q;let X=q.split(/\r\n|\n/),J=/[\s]*[^\s]+/g,$=[];return X.forEach((Q)=>{let z=Q.match(J);if(z===null){$.push("");return}let H=[z.shift()],U=this.displayWidth(H[0]);z.forEach((G)=>{let Y=this.displayWidth(G);if(U+Y<=Z){H.push(G),U+=Y;return}$.push(H.join(""));let B=G.trimStart();H=[B],U=this.displayWidth(B)}),$.push(H.join(""))}),$.join(`
6
- `)}}function p4(q){let Z=/\x1b\[\d*(;\d*)*m/g;return q.replace(Z,"")}v6.Help=l4;v6.stripColor=p4});var dq=D((d6)=>{var{InvalidArgumentError:u6}=u1();class i4{constructor(q,Z){this.flags=q,this.description=Z||"",this.required=q.includes("<"),this.optional=q.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(q),this.mandatory=!1;let X=m6(q);if(this.short=X.shortFlag,this.long=X.longFlag,this.negate=!1,this.long)this.negate=this.long.startsWith("--no-");this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(q,Z){return this.defaultValue=q,this.defaultValueDescription=Z,this}preset(q){return this.presetArg=q,this}conflicts(q){return this.conflictsWith=this.conflictsWith.concat(q),this}implies(q){let Z=q;if(typeof q==="string")Z={[q]:!0};return this.implied=Object.assign(this.implied||{},Z),this}env(q){return this.envVar=q,this}argParser(q){return this.parseArg=q,this}makeOptionMandatory(q=!0){return this.mandatory=!!q,this}hideHelp(q=!0){return this.hidden=!!q,this}_collectValue(q,Z){if(Z===this.defaultValue||!Array.isArray(Z))return[q];return Z.push(q),Z}choices(q){return this.argChoices=q.slice(),this.parseArg=(Z,X)=>{if(!this.argChoices.includes(Z))throw new u6(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(Z,X);return Z},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return c4(this.name().replace(/^no-/,""));return c4(this.name())}helpGroup(q){return this.helpGroupHeading=q,this}is(q){return this.short===q||this.long===q}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class a4{constructor(q){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,q.forEach((Z)=>{if(Z.negate)this.negativeOptions.set(Z.attributeName(),Z);else this.positiveOptions.set(Z.attributeName(),Z)}),this.negativeOptions.forEach((Z,X)=>{if(this.positiveOptions.has(X))this.dualOptions.add(X)})}valueFromOption(q,Z){let X=Z.attributeName();if(!this.dualOptions.has(X))return!0;let J=this.negativeOptions.get(X).presetArg,$=J!==void 0?J:!1;return Z.negate===($===q)}}function c4(q){return q.split("-").reduce((Z,X)=>{return Z+X[0].toUpperCase()+X.slice(1)})}function m6(q){let Z,X,J=/^-[^-]$/,$=/^--[^-]/,Q=q.split(/[ |,]+/).concat("guard");if(J.test(Q[0]))Z=Q.shift();if($.test(Q[0]))X=Q.shift();if(!Z&&J.test(Q[0]))Z=Q.shift();if(!Z&&$.test(Q[0]))Z=X,X=Q.shift();if(Q[0].startsWith("-")){let z=Q[0],H=`option creation failed due to '${z}' in option flags '${q}'`;if(/^-[^-][^-]/.test(z))throw Error(`${H}
2
+ import{createRequire as S6}from"node:module";var F6=Object.create;var{getPrototypeOf:O6,defineProperty:h4,getOwnPropertyNames:N6}=Object;var A6=Object.prototype.hasOwnProperty;var u1=(q,Z,X)=>{X=q!=null?F6(O6(q)):{};let J=Z||!q||!q.__esModule?h4(X,"default",{value:q,enumerable:!0}):X;for(let $ of N6(q))if(!A6.call(J,$))h4(J,$,{get:()=>q[$],enumerable:!0});return J};var P=(q,Z)=>()=>(Z||q((Z={exports:{}}).exports,Z),Z.exports);var r=S6(import.meta.url);var m1=P((w6)=>{class hq extends Error{constructor(q,Z,X){super(X);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=Z,this.exitCode=q,this.nestedError=void 0}}class u4 extends hq{constructor(q){super(1,"commander.invalidArgument",q);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}w6.CommanderError=hq;w6.InvalidArgumentError=u4});var F0=P((f6)=>{var{InvalidArgumentError:E6}=m1();class m4{constructor(q,Z){switch(this.description=Z||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,q[0]){case"<":this.required=!0,this._name=q.slice(1,-1);break;case"[":this.required=!1,this._name=q.slice(1,-1);break;default:this.required=!0,this._name=q;break}if(this._name.endsWith("..."))this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_collectValue(q,Z){if(Z===this.defaultValue||!Array.isArray(Z))return[q];return Z.push(q),Z}default(q,Z){return this.defaultValue=q,this.defaultValueDescription=Z,this}argParser(q){return this.parseArg=q,this}choices(q){return this.argChoices=q.slice(),this.parseArg=(Z,X)=>{if(!this.argChoices.includes(Z))throw new E6(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(Z,X);return Z},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function C6(q){let Z=q.name()+(q.variadic===!0?"...":"");return q.required?"<"+Z+">":"["+Z+"]"}f6.Argument=m4;f6.humanReadableArgName=C6});var uq=P((v6)=>{var{humanReadableArgName:k6}=F0();class d4{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(q){this.helpWidth=this.helpWidth??q.helpWidth??80}visibleCommands(q){let Z=q.commands.filter((J)=>!J._hidden),X=q._getHelpCommand();if(X&&!X._hidden)Z.push(X);if(this.sortSubcommands)Z.sort((J,$)=>{return J.name().localeCompare($.name())});return Z}compareOptions(q,Z){let X=(J)=>{return J.short?J.short.replace(/^-/,""):J.long.replace(/^--/,"")};return X(q).localeCompare(X(Z))}visibleOptions(q){let Z=q.options.filter((J)=>!J.hidden),X=q._getHelpOption();if(X&&!X.hidden){let J=X.short&&q._findOption(X.short),$=X.long&&q._findOption(X.long);if(!J&&!$)Z.push(X);else if(X.long&&!$)Z.push(q.createOption(X.long,X.description));else if(X.short&&!J)Z.push(q.createOption(X.short,X.description))}if(this.sortOptions)Z.sort(this.compareOptions);return Z}visibleGlobalOptions(q){if(!this.showGlobalOptions)return[];let Z=[];for(let X=q.parent;X;X=X.parent){let J=X.options.filter(($)=>!$.hidden);Z.push(...J)}if(this.sortOptions)Z.sort(this.compareOptions);return Z}visibleArguments(q){if(q._argsDescription)q.registeredArguments.forEach((Z)=>{Z.description=Z.description||q._argsDescription[Z.name()]||""});if(q.registeredArguments.find((Z)=>Z.description))return q.registeredArguments;return[]}subcommandTerm(q){let Z=q.registeredArguments.map((X)=>k6(X)).join(" ");return q._name+(q._aliases[0]?"|"+q._aliases[0]:"")+(q.options.length?" [options]":"")+(Z?" "+Z:"")}optionTerm(q){return q.flags}argumentTerm(q){return q.name()}longestSubcommandTermLength(q,Z){return Z.visibleCommands(q).reduce((X,J)=>{return Math.max(X,this.displayWidth(Z.styleSubcommandTerm(Z.subcommandTerm(J))))},0)}longestOptionTermLength(q,Z){return Z.visibleOptions(q).reduce((X,J)=>{return Math.max(X,this.displayWidth(Z.styleOptionTerm(Z.optionTerm(J))))},0)}longestGlobalOptionTermLength(q,Z){return Z.visibleGlobalOptions(q).reduce((X,J)=>{return Math.max(X,this.displayWidth(Z.styleOptionTerm(Z.optionTerm(J))))},0)}longestArgumentTermLength(q,Z){return Z.visibleArguments(q).reduce((X,J)=>{return Math.max(X,this.displayWidth(Z.styleArgumentTerm(Z.argumentTerm(J))))},0)}commandUsage(q){let Z=q._name;if(q._aliases[0])Z=Z+"|"+q._aliases[0];let X="";for(let J=q.parent;J;J=J.parent)X=J.name()+" "+X;return X+Z+" "+q.usage()}commandDescription(q){return q.description()}subcommandDescription(q){return q.summary()||q.description()}optionDescription(q){let Z=[];if(q.argChoices)Z.push(`choices: ${q.argChoices.map((X)=>JSON.stringify(X)).join(", ")}`);if(q.defaultValue!==void 0){if(q.required||q.optional||q.isBoolean()&&typeof q.defaultValue==="boolean")Z.push(`default: ${q.defaultValueDescription||JSON.stringify(q.defaultValue)}`)}if(q.presetArg!==void 0&&q.optional)Z.push(`preset: ${JSON.stringify(q.presetArg)}`);if(q.envVar!==void 0)Z.push(`env: ${q.envVar}`);if(Z.length>0){let X=`(${Z.join(", ")})`;if(q.description)return`${q.description} ${X}`;return X}return q.description}argumentDescription(q){let Z=[];if(q.argChoices)Z.push(`choices: ${q.argChoices.map((X)=>JSON.stringify(X)).join(", ")}`);if(q.defaultValue!==void 0)Z.push(`default: ${q.defaultValueDescription||JSON.stringify(q.defaultValue)}`);if(Z.length>0){let X=`(${Z.join(", ")})`;if(q.description)return`${q.description} ${X}`;return X}return q.description}formatItemList(q,Z,X){if(Z.length===0)return[];return[X.styleTitle(q),...Z,""]}groupItems(q,Z,X){let J=new Map;return q.forEach(($)=>{let Q=X($);if(!J.has(Q))J.set(Q,[])}),Z.forEach(($)=>{let Q=X($);if(!J.has(Q))J.set(Q,[]);J.get(Q).push($)}),J}formatHelp(q,Z){let X=Z.padWidth(q,Z),J=Z.helpWidth??80;function $(B,Y){return Z.formatItem(B,X,Y,Z)}let Q=[`${Z.styleTitle("Usage:")} ${Z.styleUsage(Z.commandUsage(q))}`,""],z=Z.commandDescription(q);if(z.length>0)Q=Q.concat([Z.boxWrap(Z.styleCommandDescription(z),J),""]);let H=Z.visibleArguments(q).map((B)=>{return $(Z.styleArgumentTerm(Z.argumentTerm(B)),Z.styleArgumentDescription(Z.argumentDescription(B)))});if(Q=Q.concat(this.formatItemList("Arguments:",H,Z)),this.groupItems(q.options,Z.visibleOptions(q),(B)=>B.helpGroupHeading??"Options:").forEach((B,Y)=>{let _=B.map((R)=>{return $(Z.styleOptionTerm(Z.optionTerm(R)),Z.styleOptionDescription(Z.optionDescription(R)))});Q=Q.concat(this.formatItemList(Y,_,Z))}),Z.showGlobalOptions){let B=Z.visibleGlobalOptions(q).map((Y)=>{return $(Z.styleOptionTerm(Z.optionTerm(Y)),Z.styleOptionDescription(Z.optionDescription(Y)))});Q=Q.concat(this.formatItemList("Global Options:",B,Z))}return this.groupItems(q.commands,Z.visibleCommands(q),(B)=>B.helpGroup()||"Commands:").forEach((B,Y)=>{let _=B.map((R)=>{return $(Z.styleSubcommandTerm(Z.subcommandTerm(R)),Z.styleSubcommandDescription(Z.subcommandDescription(R)))});Q=Q.concat(this.formatItemList(Y,_,Z))}),Q.join(`
3
+ `)}displayWidth(q){return l4(q).length}styleTitle(q){return q}styleUsage(q){return q.split(" ").map((Z)=>{if(Z==="[options]")return this.styleOptionText(Z);if(Z==="[command]")return this.styleSubcommandText(Z);if(Z[0]==="["||Z[0]==="<")return this.styleArgumentText(Z);return this.styleCommandText(Z)}).join(" ")}styleCommandDescription(q){return this.styleDescriptionText(q)}styleOptionDescription(q){return this.styleDescriptionText(q)}styleSubcommandDescription(q){return this.styleDescriptionText(q)}styleArgumentDescription(q){return this.styleDescriptionText(q)}styleDescriptionText(q){return q}styleOptionTerm(q){return this.styleOptionText(q)}styleSubcommandTerm(q){return q.split(" ").map((Z)=>{if(Z==="[options]")return this.styleOptionText(Z);if(Z[0]==="["||Z[0]==="<")return this.styleArgumentText(Z);return this.styleSubcommandText(Z)}).join(" ")}styleArgumentTerm(q){return this.styleArgumentText(q)}styleOptionText(q){return q}styleArgumentText(q){return q}styleSubcommandText(q){return q}styleCommandText(q){return q}padWidth(q,Z){return Math.max(Z.longestOptionTermLength(q,Z),Z.longestGlobalOptionTermLength(q,Z),Z.longestSubcommandTermLength(q,Z),Z.longestArgumentTermLength(q,Z))}preformatted(q){return/\n[^\S\r\n]/.test(q)}formatItem(q,Z,X,J){let Q=" ".repeat(2);if(!X)return Q+q;let z=q.padEnd(Z+q.length-J.displayWidth(q)),H=2,G=(this.helpWidth??80)-Z-H-2,B;if(G<this.minWidthToWrap||J.preformatted(X))B=X;else B=J.boxWrap(X,G).replace(/\n/g,`
4
+ `+" ".repeat(Z+H));return Q+z+" ".repeat(H)+B.replace(/\n/g,`
5
+ ${Q}`)}boxWrap(q,Z){if(Z<this.minWidthToWrap)return q;let X=q.split(/\r\n|\n/),J=/[\s]*[^\s]+/g,$=[];return X.forEach((Q)=>{let z=Q.match(J);if(z===null){$.push("");return}let H=[z.shift()],U=this.displayWidth(H[0]);z.forEach((G)=>{let B=this.displayWidth(G);if(U+B<=Z){H.push(G),U+=B;return}$.push(H.join(""));let Y=G.trimStart();H=[Y],U=this.displayWidth(Y)}),$.push(H.join(""))}),$.join(`
6
+ `)}}function l4(q){let Z=/\x1b\[\d*(;\d*)*m/g;return q.replace(Z,"")}v6.Help=d4;v6.stripColor=l4});var mq=P((d6)=>{var{InvalidArgumentError:u6}=m1();class c4{constructor(q,Z){this.flags=q,this.description=Z||"",this.required=q.includes("<"),this.optional=q.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(q),this.mandatory=!1;let X=m6(q);if(this.short=X.shortFlag,this.long=X.longFlag,this.negate=!1,this.long)this.negate=this.long.startsWith("--no-");this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(q,Z){return this.defaultValue=q,this.defaultValueDescription=Z,this}preset(q){return this.presetArg=q,this}conflicts(q){return this.conflictsWith=this.conflictsWith.concat(q),this}implies(q){let Z=q;if(typeof q==="string")Z={[q]:!0};return this.implied=Object.assign(this.implied||{},Z),this}env(q){return this.envVar=q,this}argParser(q){return this.parseArg=q,this}makeOptionMandatory(q=!0){return this.mandatory=!!q,this}hideHelp(q=!0){return this.hidden=!!q,this}_collectValue(q,Z){if(Z===this.defaultValue||!Array.isArray(Z))return[q];return Z.push(q),Z}choices(q){return this.argChoices=q.slice(),this.parseArg=(Z,X)=>{if(!this.argChoices.includes(Z))throw new u6(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(Z,X);return Z},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return p4(this.name().replace(/^no-/,""));return p4(this.name())}helpGroup(q){return this.helpGroupHeading=q,this}is(q){return this.short===q||this.long===q}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class i4{constructor(q){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,q.forEach((Z)=>{if(Z.negate)this.negativeOptions.set(Z.attributeName(),Z);else this.positiveOptions.set(Z.attributeName(),Z)}),this.negativeOptions.forEach((Z,X)=>{if(this.positiveOptions.has(X))this.dualOptions.add(X)})}valueFromOption(q,Z){let X=Z.attributeName();if(!this.dualOptions.has(X))return!0;let J=this.negativeOptions.get(X).presetArg,$=J!==void 0?J:!1;return Z.negate===($===q)}}function p4(q){return q.split("-").reduce((Z,X)=>{return Z+X[0].toUpperCase()+X.slice(1)})}function m6(q){let Z,X,J=/^-[^-]$/,$=/^--[^-]/,Q=q.split(/[ |,]+/).concat("guard");if(J.test(Q[0]))Z=Q.shift();if($.test(Q[0]))X=Q.shift();if(!Z&&J.test(Q[0]))Z=Q.shift();if(!Z&&$.test(Q[0]))Z=X,X=Q.shift();if(Q[0].startsWith("-")){let z=Q[0],H=`option creation failed due to '${z}' in option flags '${q}'`;if(/^-[^-][^-]/.test(z))throw Error(`${H}
7
7
  - a short flag is a single dash and a single character
8
8
  - either use a single dash and a single character (for a short flag)
9
9
  - or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(J.test(z))throw Error(`${H}
10
10
  - too many short flags`);if($.test(z))throw Error(`${H}
11
11
  - too many long flags`);throw Error(`${H}
12
- - unrecognised flag format`)}if(Z===void 0&&X===void 0)throw Error(`option creation failed due to no flags found in '${q}'.`);return{shortFlag:Z,longFlag:X}}d6.Option=i4;d6.DualOptions=a4});var s4=D((a6)=>{function c6(q,Z){if(Math.abs(q.length-Z.length)>3)return Math.max(q.length,Z.length);let X=[];for(let J=0;J<=q.length;J++)X[J]=[J];for(let J=0;J<=Z.length;J++)X[0][J]=J;for(let J=1;J<=Z.length;J++)for(let $=1;$<=q.length;$++){let Q=1;if(q[$-1]===Z[J-1])Q=0;else Q=1;if(X[$][J]=Math.min(X[$-1][J]+1,X[$][J-1]+1,X[$-1][J-1]+Q),$>1&&J>1&&q[$-1]===Z[J-2]&&q[$-2]===Z[J-1])X[$][J]=Math.min(X[$][J],X[$-2][J-2]+1)}return X[q.length][Z.length]}function i6(q,Z){if(!Z||Z.length===0)return"";Z=Array.from(new Set(Z));let X=q.startsWith("--");if(X)q=q.slice(2),Z=Z.map((z)=>z.slice(2));let J=[],$=3,Q=0.4;if(Z.forEach((z)=>{if(z.length<=1)return;let H=c6(q,z),U=Math.max(q.length,z.length);if((U-H)/U>Q){if(H<$)$=H,J=[z];else if(H===$)J.push(z)}}),J.sort((z,H)=>z.localeCompare(H)),X)J=J.map((z)=>`--${z}`);if(J.length>1)return`
12
+ - unrecognised flag format`)}if(Z===void 0&&X===void 0)throw Error(`option creation failed due to no flags found in '${q}'.`);return{shortFlag:Z,longFlag:X}}d6.Option=c4;d6.DualOptions=i4});var a4=P((a6)=>{function c6(q,Z){if(Math.abs(q.length-Z.length)>3)return Math.max(q.length,Z.length);let X=[];for(let J=0;J<=q.length;J++)X[J]=[J];for(let J=0;J<=Z.length;J++)X[0][J]=J;for(let J=1;J<=Z.length;J++)for(let $=1;$<=q.length;$++){let Q=1;if(q[$-1]===Z[J-1])Q=0;else Q=1;if(X[$][J]=Math.min(X[$-1][J]+1,X[$][J-1]+1,X[$-1][J-1]+Q),$>1&&J>1&&q[$-1]===Z[J-2]&&q[$-2]===Z[J-1])X[$][J]=Math.min(X[$][J],X[$-2][J-2]+1)}return X[q.length][Z.length]}function i6(q,Z){if(!Z||Z.length===0)return"";Z=Array.from(new Set(Z));let X=q.startsWith("--");if(X)q=q.slice(2),Z=Z.map((z)=>z.slice(2));let J=[],$=3,Q=0.4;if(Z.forEach((z)=>{if(z.length<=1)return;let H=c6(q,z),U=Math.max(q.length,z.length);if((U-H)/U>Q){if(H<$)$=H,J=[z];else if(H===$)J.push(z)}}),J.sort((z,H)=>z.localeCompare(H)),X)J=J.map((z)=>`--${z}`);if(J.length>1)return`
13
13
  (Did you mean one of ${J.join(", ")}?)`;if(J.length===1)return`
14
- (Did you mean ${J[0]}?)`;return""}a6.suggestSimilar=i6});var t4=D((Z7)=>{var r6=r("node:events").EventEmitter,lq=r("node:child_process"),n=r("node:path"),F0=r("node:fs"),b=r("node:process"),{Argument:n6,humanReadableArgName:o6}=D0(),{CommanderError:pq}=u1(),{Help:t6,stripColor:e6}=mq(),{Option:r4,DualOptions:q7}=dq(),{suggestSimilar:n4}=s4();class iq extends r6{constructor(q){super();this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=q||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:(Z)=>b.stdout.write(Z),writeErr:(Z)=>b.stderr.write(Z),outputError:(Z,X)=>X(Z),getOutHelpWidth:()=>b.stdout.isTTY?b.stdout.columns:void 0,getErrHelpWidth:()=>b.stderr.isTTY?b.stderr.columns:void 0,getOutHasColors:()=>cq()??(b.stdout.isTTY&&b.stdout.hasColors?.()),getErrHasColors:()=>cq()??(b.stderr.isTTY&&b.stderr.hasColors?.()),stripColor:(Z)=>e6(Z)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(q){return this._outputConfiguration=q._outputConfiguration,this._helpOption=q._helpOption,this._helpCommand=q._helpCommand,this._helpConfiguration=q._helpConfiguration,this._exitCallback=q._exitCallback,this._storeOptionsAsProperties=q._storeOptionsAsProperties,this._combineFlagAndOptionalValue=q._combineFlagAndOptionalValue,this._allowExcessArguments=q._allowExcessArguments,this._enablePositionalOptions=q._enablePositionalOptions,this._showHelpAfterError=q._showHelpAfterError,this._showSuggestionAfterError=q._showSuggestionAfterError,this}_getCommandAndAncestors(){let q=[];for(let Z=this;Z;Z=Z.parent)q.push(Z);return q}command(q,Z,X){let J=Z,$=X;if(typeof J==="object"&&J!==null)$=J,J=null;$=$||{};let[,Q,z]=q.match(/([^ ]+) *(.*)/),H=this.createCommand(Q);if(J)H.description(J),H._executableHandler=!0;if($.isDefault)this._defaultCommandName=H._name;if(H._hidden=!!($.noHelp||$.hidden),H._executableFile=$.executableFile||null,z)H.arguments(z);if(this._registerCommand(H),H.parent=this,H.copyInheritedSettings(this),J)return this;return H}createCommand(q){return new iq(q)}createHelp(){return Object.assign(new t6,this.configureHelp())}configureHelp(q){if(q===void 0)return this._helpConfiguration;return this._helpConfiguration=q,this}configureOutput(q){if(q===void 0)return this._outputConfiguration;return this._outputConfiguration={...this._outputConfiguration,...q},this}showHelpAfterError(q=!0){if(typeof q!=="string")q=!!q;return this._showHelpAfterError=q,this}showSuggestionAfterError(q=!0){return this._showSuggestionAfterError=!!q,this}addCommand(q,Z){if(!q._name)throw Error(`Command passed to .addCommand() must have a name
14
+ (Did you mean ${J[0]}?)`;return""}a6.suggestSimilar=i6});var o4=P((Z7)=>{var r6=r("node:events").EventEmitter,dq=r("node:child_process"),n=r("node:path"),O0=r("node:fs"),b=r("node:process"),{Argument:n6,humanReadableArgName:o6}=F0(),{CommanderError:lq}=m1(),{Help:t6,stripColor:e6}=uq(),{Option:s4,DualOptions:q7}=mq(),{suggestSimilar:r4}=a4();class cq extends r6{constructor(q){super();this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=q||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:(Z)=>b.stdout.write(Z),writeErr:(Z)=>b.stderr.write(Z),outputError:(Z,X)=>X(Z),getOutHelpWidth:()=>b.stdout.isTTY?b.stdout.columns:void 0,getErrHelpWidth:()=>b.stderr.isTTY?b.stderr.columns:void 0,getOutHasColors:()=>pq()??(b.stdout.isTTY&&b.stdout.hasColors?.()),getErrHasColors:()=>pq()??(b.stderr.isTTY&&b.stderr.hasColors?.()),stripColor:(Z)=>e6(Z)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(q){return this._outputConfiguration=q._outputConfiguration,this._helpOption=q._helpOption,this._helpCommand=q._helpCommand,this._helpConfiguration=q._helpConfiguration,this._exitCallback=q._exitCallback,this._storeOptionsAsProperties=q._storeOptionsAsProperties,this._combineFlagAndOptionalValue=q._combineFlagAndOptionalValue,this._allowExcessArguments=q._allowExcessArguments,this._enablePositionalOptions=q._enablePositionalOptions,this._showHelpAfterError=q._showHelpAfterError,this._showSuggestionAfterError=q._showSuggestionAfterError,this}_getCommandAndAncestors(){let q=[];for(let Z=this;Z;Z=Z.parent)q.push(Z);return q}command(q,Z,X){let J=Z,$=X;if(typeof J==="object"&&J!==null)$=J,J=null;$=$||{};let[,Q,z]=q.match(/([^ ]+) *(.*)/),H=this.createCommand(Q);if(J)H.description(J),H._executableHandler=!0;if($.isDefault)this._defaultCommandName=H._name;if(H._hidden=!!($.noHelp||$.hidden),H._executableFile=$.executableFile||null,z)H.arguments(z);if(this._registerCommand(H),H.parent=this,H.copyInheritedSettings(this),J)return this;return H}createCommand(q){return new cq(q)}createHelp(){return Object.assign(new t6,this.configureHelp())}configureHelp(q){if(q===void 0)return this._helpConfiguration;return this._helpConfiguration=q,this}configureOutput(q){if(q===void 0)return this._outputConfiguration;return this._outputConfiguration={...this._outputConfiguration,...q},this}showHelpAfterError(q=!0){if(typeof q!=="string")q=!!q;return this._showHelpAfterError=q,this}showSuggestionAfterError(q=!0){return this._showSuggestionAfterError=!!q,this}addCommand(q,Z){if(!q._name)throw Error(`Command passed to .addCommand() must have a name
15
15
  - specify the name in Command constructor or using .name()`);if(Z=Z||{},Z.isDefault)this._defaultCommandName=q._name;if(Z.noHelp||Z.hidden)q._hidden=!0;return this._registerCommand(q),q.parent=this,q._checkForBrokenPassThrough(),this}createArgument(q,Z){return new n6(q,Z)}argument(q,Z,X,J){let $=this.createArgument(q,Z);if(typeof X==="function")$.default(J).argParser(X);else $.default(X);return this.addArgument($),this}arguments(q){return q.trim().split(/ +/).forEach((Z)=>{this.argument(Z)}),this}addArgument(q){let Z=this.registeredArguments.slice(-1)[0];if(Z?.variadic)throw Error(`only the last argument can be variadic '${Z.name()}'`);if(q.required&&q.defaultValue!==void 0&&q.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${q.name()}'`);return this.registeredArguments.push(q),this}helpCommand(q,Z){if(typeof q==="boolean"){if(this._addImplicitHelpCommand=q,q&&this._defaultCommandGroup)this._initCommandGroup(this._getHelpCommand());return this}let X=q??"help [command]",[,J,$]=X.match(/([^ ]+) *(.*)/),Q=Z??"display help for command",z=this.createCommand(J);if(z.helpOption(!1),$)z.arguments($);if(Q)z.description(Q);if(this._addImplicitHelpCommand=!0,this._helpCommand=z,q||Z)this._initCommandGroup(z);return this}addHelpCommand(q,Z){if(typeof q!=="object")return this.helpCommand(q,Z),this;return this._addImplicitHelpCommand=!0,this._helpCommand=q,this._initCommandGroup(q),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(q,Z){let X=["preSubcommand","preAction","postAction"];if(!X.includes(q))throw Error(`Unexpected value for event passed to hook : '${q}'.
16
- Expecting one of '${X.join("', '")}'`);if(this._lifeCycleHooks[q])this._lifeCycleHooks[q].push(Z);else this._lifeCycleHooks[q]=[Z];return this}exitOverride(q){if(q)this._exitCallback=q;else this._exitCallback=(Z)=>{if(Z.code!=="commander.executeSubCommandAsync")throw Z};return this}_exit(q,Z,X){if(this._exitCallback)this._exitCallback(new pq(q,Z,X));b.exit(q)}action(q){let Z=(X)=>{let J=this.registeredArguments.length,$=X.slice(0,J);if(this._storeOptionsAsProperties)$[J]=this;else $[J]=this.opts();return $.push(this),q.apply(this,$)};return this._actionHandler=Z,this}createOption(q,Z){return new r4(q,Z)}_callParseArg(q,Z,X,J){try{return q.parseArg(Z,X)}catch($){if($.code==="commander.invalidArgument"){let Q=`${J} ${$.message}`;this.error(Q,{exitCode:$.exitCode,code:$.code})}throw $}}_registerOption(q){let Z=q.short&&this._findOption(q.short)||q.long&&this._findOption(q.long);if(Z){let X=q.long&&this._findOption(q.long)?q.long:q.short;throw Error(`Cannot add option '${q.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${X}'
17
- - already used by option '${Z.flags}'`)}this._initOptionGroup(q),this.options.push(q)}_registerCommand(q){let Z=(J)=>{return[J.name()].concat(J.aliases())},X=Z(q).find((J)=>this._findCommand(J));if(X){let J=Z(this._findCommand(X)).join("|"),$=Z(q).join("|");throw Error(`cannot add command '${$}' as already have command '${J}'`)}this._initCommandGroup(q),this.commands.push(q)}addOption(q){this._registerOption(q);let Z=q.name(),X=q.attributeName();if(q.negate){let $=q.long.replace(/^--no-/,"--");if(!this._findOption($))this.setOptionValueWithSource(X,q.defaultValue===void 0?!0:q.defaultValue,"default")}else if(q.defaultValue!==void 0)this.setOptionValueWithSource(X,q.defaultValue,"default");let J=($,Q,z)=>{if($==null&&q.presetArg!==void 0)$=q.presetArg;let H=this.getOptionValue(X);if($!==null&&q.parseArg)$=this._callParseArg(q,$,H,Q);else if($!==null&&q.variadic)$=q._collectValue($,H);if($==null)if(q.negate)$=!1;else if(q.isBoolean()||q.optional)$=!0;else $="";this.setOptionValueWithSource(X,$,z)};if(this.on("option:"+Z,($)=>{let Q=`error: option '${q.flags}' argument '${$}' is invalid.`;J($,Q,"cli")}),q.envVar)this.on("optionEnv:"+Z,($)=>{let Q=`error: option '${q.flags}' value '${$}' from env '${q.envVar}' is invalid.`;J($,Q,"env")});return this}_optionEx(q,Z,X,J,$){if(typeof Z==="object"&&Z instanceof r4)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let Q=this.createOption(Z,X);if(Q.makeOptionMandatory(!!q.mandatory),typeof J==="function")Q.default($).argParser(J);else if(J instanceof RegExp){let z=J;J=(H,U)=>{let G=z.exec(H);return G?G[0]:U},Q.default($).argParser(J)}else Q.default(J);return this.addOption(Q)}option(q,Z,X,J){return this._optionEx({},q,Z,X,J)}requiredOption(q,Z,X,J){return this._optionEx({mandatory:!0},q,Z,X,J)}combineFlagAndOptionalValue(q=!0){return this._combineFlagAndOptionalValue=!!q,this}allowUnknownOption(q=!0){return this._allowUnknownOption=!!q,this}allowExcessArguments(q=!0){return this._allowExcessArguments=!!q,this}enablePositionalOptions(q=!0){return this._enablePositionalOptions=!!q,this}passThroughOptions(q=!0){return this._passThroughOptions=!!q,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(q=!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=!!q,this}getOptionValue(q){if(this._storeOptionsAsProperties)return this[q];return this._optionValues[q]}setOptionValue(q,Z){return this.setOptionValueWithSource(q,Z,void 0)}setOptionValueWithSource(q,Z,X){if(this._storeOptionsAsProperties)this[q]=Z;else this._optionValues[q]=Z;return this._optionValueSources[q]=X,this}getOptionValueSource(q){return this._optionValueSources[q]}getOptionValueSourceWithGlobals(q){let Z;return this._getCommandAndAncestors().forEach((X)=>{if(X.getOptionValueSource(q)!==void 0)Z=X.getOptionValueSource(q)}),Z}_prepareUserArgs(q,Z){if(q!==void 0&&!Array.isArray(q))throw Error("first parameter to parse must be array or undefined");if(Z=Z||{},q===void 0&&Z.from===void 0){if(b.versions?.electron)Z.from="electron";let J=b.execArgv??[];if(J.includes("-e")||J.includes("--eval")||J.includes("-p")||J.includes("--print"))Z.from="eval"}if(q===void 0)q=b.argv;this.rawArgs=q.slice();let X;switch(Z.from){case void 0:case"node":this._scriptPath=q[1],X=q.slice(2);break;case"electron":if(b.defaultApp)this._scriptPath=q[1],X=q.slice(2);else X=q.slice(1);break;case"user":X=q.slice(0);break;case"eval":X=q.slice(1);break;default:throw Error(`unexpected parse option { from: '${Z.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",X}parse(q,Z){this._prepareForParse();let X=this._prepareUserArgs(q,Z);return this._parseCommand([],X),this}async parseAsync(q,Z){this._prepareForParse();let X=this._prepareUserArgs(q,Z);return await this._parseCommand([],X),this}_prepareForParse(){if(this._savedState===null)this.saveStateBeforeParse();else this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw Error(`Can not call parse again when storeOptionsAsProperties is true.
18
- - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(q,Z,X){if(F0.existsSync(q))return;let J=Z?`searched for local subcommand relative to directory '${Z}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",$=`'${q}' does not exist
16
+ Expecting one of '${X.join("', '")}'`);if(this._lifeCycleHooks[q])this._lifeCycleHooks[q].push(Z);else this._lifeCycleHooks[q]=[Z];return this}exitOverride(q){if(q)this._exitCallback=q;else this._exitCallback=(Z)=>{if(Z.code!=="commander.executeSubCommandAsync")throw Z};return this}_exit(q,Z,X){if(this._exitCallback)this._exitCallback(new lq(q,Z,X));b.exit(q)}action(q){let Z=(X)=>{let J=this.registeredArguments.length,$=X.slice(0,J);if(this._storeOptionsAsProperties)$[J]=this;else $[J]=this.opts();return $.push(this),q.apply(this,$)};return this._actionHandler=Z,this}createOption(q,Z){return new s4(q,Z)}_callParseArg(q,Z,X,J){try{return q.parseArg(Z,X)}catch($){if($.code==="commander.invalidArgument"){let Q=`${J} ${$.message}`;this.error(Q,{exitCode:$.exitCode,code:$.code})}throw $}}_registerOption(q){let Z=q.short&&this._findOption(q.short)||q.long&&this._findOption(q.long);if(Z){let X=q.long&&this._findOption(q.long)?q.long:q.short;throw Error(`Cannot add option '${q.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${X}'
17
+ - already used by option '${Z.flags}'`)}this._initOptionGroup(q),this.options.push(q)}_registerCommand(q){let Z=(J)=>{return[J.name()].concat(J.aliases())},X=Z(q).find((J)=>this._findCommand(J));if(X){let J=Z(this._findCommand(X)).join("|"),$=Z(q).join("|");throw Error(`cannot add command '${$}' as already have command '${J}'`)}this._initCommandGroup(q),this.commands.push(q)}addOption(q){this._registerOption(q);let Z=q.name(),X=q.attributeName();if(q.negate){let $=q.long.replace(/^--no-/,"--");if(!this._findOption($))this.setOptionValueWithSource(X,q.defaultValue===void 0?!0:q.defaultValue,"default")}else if(q.defaultValue!==void 0)this.setOptionValueWithSource(X,q.defaultValue,"default");let J=($,Q,z)=>{if($==null&&q.presetArg!==void 0)$=q.presetArg;let H=this.getOptionValue(X);if($!==null&&q.parseArg)$=this._callParseArg(q,$,H,Q);else if($!==null&&q.variadic)$=q._collectValue($,H);if($==null)if(q.negate)$=!1;else if(q.isBoolean()||q.optional)$=!0;else $="";this.setOptionValueWithSource(X,$,z)};if(this.on("option:"+Z,($)=>{let Q=`error: option '${q.flags}' argument '${$}' is invalid.`;J($,Q,"cli")}),q.envVar)this.on("optionEnv:"+Z,($)=>{let Q=`error: option '${q.flags}' value '${$}' from env '${q.envVar}' is invalid.`;J($,Q,"env")});return this}_optionEx(q,Z,X,J,$){if(typeof Z==="object"&&Z instanceof s4)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let Q=this.createOption(Z,X);if(Q.makeOptionMandatory(!!q.mandatory),typeof J==="function")Q.default($).argParser(J);else if(J instanceof RegExp){let z=J;J=(H,U)=>{let G=z.exec(H);return G?G[0]:U},Q.default($).argParser(J)}else Q.default(J);return this.addOption(Q)}option(q,Z,X,J){return this._optionEx({},q,Z,X,J)}requiredOption(q,Z,X,J){return this._optionEx({mandatory:!0},q,Z,X,J)}combineFlagAndOptionalValue(q=!0){return this._combineFlagAndOptionalValue=!!q,this}allowUnknownOption(q=!0){return this._allowUnknownOption=!!q,this}allowExcessArguments(q=!0){return this._allowExcessArguments=!!q,this}enablePositionalOptions(q=!0){return this._enablePositionalOptions=!!q,this}passThroughOptions(q=!0){return this._passThroughOptions=!!q,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(q=!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=!!q,this}getOptionValue(q){if(this._storeOptionsAsProperties)return this[q];return this._optionValues[q]}setOptionValue(q,Z){return this.setOptionValueWithSource(q,Z,void 0)}setOptionValueWithSource(q,Z,X){if(this._storeOptionsAsProperties)this[q]=Z;else this._optionValues[q]=Z;return this._optionValueSources[q]=X,this}getOptionValueSource(q){return this._optionValueSources[q]}getOptionValueSourceWithGlobals(q){let Z;return this._getCommandAndAncestors().forEach((X)=>{if(X.getOptionValueSource(q)!==void 0)Z=X.getOptionValueSource(q)}),Z}_prepareUserArgs(q,Z){if(q!==void 0&&!Array.isArray(q))throw Error("first parameter to parse must be array or undefined");if(Z=Z||{},q===void 0&&Z.from===void 0){if(b.versions?.electron)Z.from="electron";let J=b.execArgv??[];if(J.includes("-e")||J.includes("--eval")||J.includes("-p")||J.includes("--print"))Z.from="eval"}if(q===void 0)q=b.argv;this.rawArgs=q.slice();let X;switch(Z.from){case void 0:case"node":this._scriptPath=q[1],X=q.slice(2);break;case"electron":if(b.defaultApp)this._scriptPath=q[1],X=q.slice(2);else X=q.slice(1);break;case"user":X=q.slice(0);break;case"eval":X=q.slice(1);break;default:throw Error(`unexpected parse option { from: '${Z.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",X}parse(q,Z){this._prepareForParse();let X=this._prepareUserArgs(q,Z);return this._parseCommand([],X),this}async parseAsync(q,Z){this._prepareForParse();let X=this._prepareUserArgs(q,Z);return await this._parseCommand([],X),this}_prepareForParse(){if(this._savedState===null)this.saveStateBeforeParse();else this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw Error(`Can not call parse again when storeOptionsAsProperties is true.
18
+ - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(q,Z,X){if(O0.existsSync(q))return;let J=Z?`searched for local subcommand relative to directory '${Z}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",$=`'${q}' does not exist
19
19
  - if '${X}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
20
20
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
21
- - ${J}`;throw Error($)}_executeSubCommand(q,Z){Z=Z.slice();let X=!1,J=[".js",".ts",".tsx",".mjs",".cjs"];function $(G,Y){let B=n.resolve(G,Y);if(F0.existsSync(B))return B;if(J.includes(n.extname(Y)))return;let _=J.find((V)=>F0.existsSync(`${B}${V}`));if(_)return`${B}${_}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let Q=q._executableFile||`${this._name}-${q._name}`,z=this._executableDir||"";if(this._scriptPath){let G;try{G=F0.realpathSync(this._scriptPath)}catch{G=this._scriptPath}z=n.resolve(n.dirname(G),z)}if(z){let G=$(z,Q);if(!G&&!q._executableFile&&this._scriptPath){let Y=n.basename(this._scriptPath,n.extname(this._scriptPath));if(Y!==this._name)G=$(z,`${Y}-${q._name}`)}Q=G||Q}X=J.includes(n.extname(Q));let H;if(b.platform!=="win32")if(X)Z.unshift(Q),Z=o4(b.execArgv).concat(Z),H=lq.spawn(b.argv[0],Z,{stdio:"inherit"});else H=lq.spawn(Q,Z,{stdio:"inherit"});else this._checkForMissingExecutable(Q,z,q._name),Z.unshift(Q),Z=o4(b.execArgv).concat(Z),H=lq.spawn(b.execPath,Z,{stdio:"inherit"});if(!H.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((Y)=>{b.on(Y,()=>{if(H.killed===!1&&H.exitCode===null)H.kill(Y)})});let U=this._exitCallback;H.on("close",(G)=>{if(G=G??1,!U)b.exit(G);else U(new pq(G,"commander.executeSubCommandAsync","(close)"))}),H.on("error",(G)=>{if(G.code==="ENOENT")this._checkForMissingExecutable(Q,z,q._name);else if(G.code==="EACCES")throw Error(`'${Q}' not executable`);if(!U)b.exit(1);else{let Y=new pq(1,"commander.executeSubCommandAsync","(error)");Y.nestedError=G,U(Y)}}),this.runningCommand=H}_dispatchSubcommand(q,Z,X){let J=this._findCommand(q);if(!J)this.help({error:!0});J._prepareForParse();let $;return $=this._chainOrCallSubCommandHook($,J,"preSubcommand"),$=this._chainOrCall($,()=>{if(J._executableHandler)this._executeSubCommand(J,Z.concat(X));else return J._parseCommand(Z,X)}),$}_dispatchHelpCommand(q){if(!q)this.help();let Z=this._findCommand(q);if(Z&&!Z._executableHandler)Z.help();return this._dispatchSubcommand(q,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach((q,Z)=>{if(q.required&&this.args[Z]==null)this.missingArgument(q.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 q=(X,J,$)=>{let Q=J;if(J!==null&&X.parseArg){let z=`error: command-argument value '${J}' is invalid for argument '${X.name()}'.`;Q=this._callParseArg(X,J,$,z)}return Q};this._checkNumberOfArguments();let Z=[];this.registeredArguments.forEach((X,J)=>{let $=X.defaultValue;if(X.variadic){if(J<this.args.length){if($=this.args.slice(J),X.parseArg)$=$.reduce((Q,z)=>{return q(X,z,Q)},X.defaultValue)}else if($===void 0)$=[]}else if(J<this.args.length){if($=this.args[J],X.parseArg)$=q(X,$,X.defaultValue)}Z[J]=$}),this.processedArgs=Z}_chainOrCall(q,Z){if(q?.then&&typeof q.then==="function")return q.then(()=>Z());return Z()}_chainOrCallHooks(q,Z){let X=q,J=[];if(this._getCommandAndAncestors().reverse().filter(($)=>$._lifeCycleHooks[Z]!==void 0).forEach(($)=>{$._lifeCycleHooks[Z].forEach((Q)=>{J.push({hookedCommand:$,callback:Q})})}),Z==="postAction")J.reverse();return J.forEach(($)=>{X=this._chainOrCall(X,()=>{return $.callback($.hookedCommand,this)})}),X}_chainOrCallSubCommandHook(q,Z,X){let J=q;if(this._lifeCycleHooks[X]!==void 0)this._lifeCycleHooks[X].forEach(($)=>{J=this._chainOrCall(J,()=>{return $(this,Z)})});return J}_parseCommand(q,Z){let X=this.parseOptions(Z);if(this._parseOptionsEnv(),this._parseOptionsImplied(),q=q.concat(X.operands),Z=X.unknown,this.args=q.concat(Z),q&&this._findCommand(q[0]))return this._dispatchSubcommand(q[0],q.slice(1),Z);if(this._getHelpCommand()&&q[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(q[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(Z),this._dispatchSubcommand(this._defaultCommandName,q,Z);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(X.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let J=()=>{if(X.unknown.length>0)this.unknownOption(X.unknown[0])},$=`command:${this.name()}`;if(this._actionHandler){J(),this._processArguments();let Q;if(Q=this._chainOrCallHooks(Q,"preAction"),Q=this._chainOrCall(Q,()=>this._actionHandler(this.processedArgs)),this.parent)Q=this._chainOrCall(Q,()=>{this.parent.emit($,q,Z)});return Q=this._chainOrCallHooks(Q,"postAction"),Q}if(this.parent?.listenerCount($))J(),this._processArguments(),this.parent.emit($,q,Z);else if(q.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",q,Z);if(this.listenerCount("command:*"))this.emit("command:*",q,Z);else if(this.commands.length)this.unknownCommand();else J(),this._processArguments()}else if(this.commands.length)J(),this.help({error:!0});else J(),this._processArguments()}_findCommand(q){if(!q)return;return this.commands.find((Z)=>Z._name===q||Z._aliases.includes(q))}_findOption(q){return this.options.find((Z)=>Z.is(q))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach((q)=>{q.options.forEach((Z)=>{if(Z.mandatory&&q.getOptionValue(Z.attributeName())===void 0)q.missingMandatoryOptionValue(Z)})})}_checkForConflictingLocalOptions(){let q=this.options.filter((X)=>{let J=X.attributeName();if(this.getOptionValue(J)===void 0)return!1;return this.getOptionValueSource(J)!=="default"});q.filter((X)=>X.conflictsWith.length>0).forEach((X)=>{let J=q.find(($)=>X.conflictsWith.includes($.attributeName()));if(J)this._conflictingOption(X,J)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((q)=>{q._checkForConflictingLocalOptions()})}parseOptions(q){let Z=[],X=[],J=Z;function $(G){return G.length>1&&G[0]==="-"}let Q=(G)=>{if(!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(G))return!1;return!this._getCommandAndAncestors().some((Y)=>Y.options.map((B)=>B.short).some((B)=>/^-\d$/.test(B)))},z=null,H=null,U=0;while(U<q.length||H){let G=H??q[U++];if(H=null,G==="--"){if(J===X)J.push(G);J.push(...q.slice(U));break}if(z&&(!$(G)||Q(G))){this.emit(`option:${z.name()}`,G);continue}if(z=null,$(G)){let Y=this._findOption(G);if(Y){if(Y.required){let B=q[U++];if(B===void 0)this.optionMissingArgument(Y);this.emit(`option:${Y.name()}`,B)}else if(Y.optional){let B=null;if(U<q.length&&(!$(q[U])||Q(q[U])))B=q[U++];this.emit(`option:${Y.name()}`,B)}else this.emit(`option:${Y.name()}`);z=Y.variadic?Y:null;continue}}if(G.length>2&&G[0]==="-"&&G[1]!=="-"){let Y=this._findOption(`-${G[1]}`);if(Y){if(Y.required||Y.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${Y.name()}`,G.slice(2));else this.emit(`option:${Y.name()}`),H=`-${G.slice(2)}`;continue}}if(/^--[^=]+=/.test(G)){let Y=G.indexOf("="),B=this._findOption(G.slice(0,Y));if(B&&(B.required||B.optional)){this.emit(`option:${B.name()}`,G.slice(Y+1));continue}}if(J===Z&&$(G)&&!(this.commands.length===0&&Q(G)))J=X;if((this._enablePositionalOptions||this._passThroughOptions)&&Z.length===0&&X.length===0){if(this._findCommand(G)){Z.push(G),X.push(...q.slice(U));break}else if(this._getHelpCommand()&&G===this._getHelpCommand().name()){Z.push(G,...q.slice(U));break}else if(this._defaultCommandName){X.push(G,...q.slice(U));break}}if(this._passThroughOptions){J.push(G,...q.slice(U));break}J.push(G)}return{operands:Z,unknown:X}}opts(){if(this._storeOptionsAsProperties){let q={},Z=this.options.length;for(let X=0;X<Z;X++){let J=this.options[X].attributeName();q[J]=J===this._versionOptionName?this._version:this[J]}return q}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((q,Z)=>Object.assign(q,Z.opts()),{})}error(q,Z){if(this._outputConfiguration.outputError(`${q}
21
+ - ${J}`;throw Error($)}_executeSubCommand(q,Z){Z=Z.slice();let X=!1,J=[".js",".ts",".tsx",".mjs",".cjs"];function $(G,B){let Y=n.resolve(G,B);if(O0.existsSync(Y))return Y;if(J.includes(n.extname(B)))return;let _=J.find((R)=>O0.existsSync(`${Y}${R}`));if(_)return`${Y}${_}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let Q=q._executableFile||`${this._name}-${q._name}`,z=this._executableDir||"";if(this._scriptPath){let G;try{G=O0.realpathSync(this._scriptPath)}catch{G=this._scriptPath}z=n.resolve(n.dirname(G),z)}if(z){let G=$(z,Q);if(!G&&!q._executableFile&&this._scriptPath){let B=n.basename(this._scriptPath,n.extname(this._scriptPath));if(B!==this._name)G=$(z,`${B}-${q._name}`)}Q=G||Q}X=J.includes(n.extname(Q));let H;if(b.platform!=="win32")if(X)Z.unshift(Q),Z=n4(b.execArgv).concat(Z),H=dq.spawn(b.argv[0],Z,{stdio:"inherit"});else H=dq.spawn(Q,Z,{stdio:"inherit"});else this._checkForMissingExecutable(Q,z,q._name),Z.unshift(Q),Z=n4(b.execArgv).concat(Z),H=dq.spawn(b.execPath,Z,{stdio:"inherit"});if(!H.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((B)=>{b.on(B,()=>{if(H.killed===!1&&H.exitCode===null)H.kill(B)})});let U=this._exitCallback;H.on("close",(G)=>{if(G=G??1,!U)b.exit(G);else U(new lq(G,"commander.executeSubCommandAsync","(close)"))}),H.on("error",(G)=>{if(G.code==="ENOENT")this._checkForMissingExecutable(Q,z,q._name);else if(G.code==="EACCES")throw Error(`'${Q}' not executable`);if(!U)b.exit(1);else{let B=new lq(1,"commander.executeSubCommandAsync","(error)");B.nestedError=G,U(B)}}),this.runningCommand=H}_dispatchSubcommand(q,Z,X){let J=this._findCommand(q);if(!J)this.help({error:!0});J._prepareForParse();let $;return $=this._chainOrCallSubCommandHook($,J,"preSubcommand"),$=this._chainOrCall($,()=>{if(J._executableHandler)this._executeSubCommand(J,Z.concat(X));else return J._parseCommand(Z,X)}),$}_dispatchHelpCommand(q){if(!q)this.help();let Z=this._findCommand(q);if(Z&&!Z._executableHandler)Z.help();return this._dispatchSubcommand(q,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach((q,Z)=>{if(q.required&&this.args[Z]==null)this.missingArgument(q.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 q=(X,J,$)=>{let Q=J;if(J!==null&&X.parseArg){let z=`error: command-argument value '${J}' is invalid for argument '${X.name()}'.`;Q=this._callParseArg(X,J,$,z)}return Q};this._checkNumberOfArguments();let Z=[];this.registeredArguments.forEach((X,J)=>{let $=X.defaultValue;if(X.variadic){if(J<this.args.length){if($=this.args.slice(J),X.parseArg)$=$.reduce((Q,z)=>{return q(X,z,Q)},X.defaultValue)}else if($===void 0)$=[]}else if(J<this.args.length){if($=this.args[J],X.parseArg)$=q(X,$,X.defaultValue)}Z[J]=$}),this.processedArgs=Z}_chainOrCall(q,Z){if(q?.then&&typeof q.then==="function")return q.then(()=>Z());return Z()}_chainOrCallHooks(q,Z){let X=q,J=[];if(this._getCommandAndAncestors().reverse().filter(($)=>$._lifeCycleHooks[Z]!==void 0).forEach(($)=>{$._lifeCycleHooks[Z].forEach((Q)=>{J.push({hookedCommand:$,callback:Q})})}),Z==="postAction")J.reverse();return J.forEach(($)=>{X=this._chainOrCall(X,()=>{return $.callback($.hookedCommand,this)})}),X}_chainOrCallSubCommandHook(q,Z,X){let J=q;if(this._lifeCycleHooks[X]!==void 0)this._lifeCycleHooks[X].forEach(($)=>{J=this._chainOrCall(J,()=>{return $(this,Z)})});return J}_parseCommand(q,Z){let X=this.parseOptions(Z);if(this._parseOptionsEnv(),this._parseOptionsImplied(),q=q.concat(X.operands),Z=X.unknown,this.args=q.concat(Z),q&&this._findCommand(q[0]))return this._dispatchSubcommand(q[0],q.slice(1),Z);if(this._getHelpCommand()&&q[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(q[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(Z),this._dispatchSubcommand(this._defaultCommandName,q,Z);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(X.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let J=()=>{if(X.unknown.length>0)this.unknownOption(X.unknown[0])},$=`command:${this.name()}`;if(this._actionHandler){J(),this._processArguments();let Q;if(Q=this._chainOrCallHooks(Q,"preAction"),Q=this._chainOrCall(Q,()=>this._actionHandler(this.processedArgs)),this.parent)Q=this._chainOrCall(Q,()=>{this.parent.emit($,q,Z)});return Q=this._chainOrCallHooks(Q,"postAction"),Q}if(this.parent?.listenerCount($))J(),this._processArguments(),this.parent.emit($,q,Z);else if(q.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",q,Z);if(this.listenerCount("command:*"))this.emit("command:*",q,Z);else if(this.commands.length)this.unknownCommand();else J(),this._processArguments()}else if(this.commands.length)J(),this.help({error:!0});else J(),this._processArguments()}_findCommand(q){if(!q)return;return this.commands.find((Z)=>Z._name===q||Z._aliases.includes(q))}_findOption(q){return this.options.find((Z)=>Z.is(q))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach((q)=>{q.options.forEach((Z)=>{if(Z.mandatory&&q.getOptionValue(Z.attributeName())===void 0)q.missingMandatoryOptionValue(Z)})})}_checkForConflictingLocalOptions(){let q=this.options.filter((X)=>{let J=X.attributeName();if(this.getOptionValue(J)===void 0)return!1;return this.getOptionValueSource(J)!=="default"});q.filter((X)=>X.conflictsWith.length>0).forEach((X)=>{let J=q.find(($)=>X.conflictsWith.includes($.attributeName()));if(J)this._conflictingOption(X,J)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((q)=>{q._checkForConflictingLocalOptions()})}parseOptions(q){let Z=[],X=[],J=Z;function $(G){return G.length>1&&G[0]==="-"}let Q=(G)=>{if(!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(G))return!1;return!this._getCommandAndAncestors().some((B)=>B.options.map((Y)=>Y.short).some((Y)=>/^-\d$/.test(Y)))},z=null,H=null,U=0;while(U<q.length||H){let G=H??q[U++];if(H=null,G==="--"){if(J===X)J.push(G);J.push(...q.slice(U));break}if(z&&(!$(G)||Q(G))){this.emit(`option:${z.name()}`,G);continue}if(z=null,$(G)){let B=this._findOption(G);if(B){if(B.required){let Y=q[U++];if(Y===void 0)this.optionMissingArgument(B);this.emit(`option:${B.name()}`,Y)}else if(B.optional){let Y=null;if(U<q.length&&(!$(q[U])||Q(q[U])))Y=q[U++];this.emit(`option:${B.name()}`,Y)}else this.emit(`option:${B.name()}`);z=B.variadic?B:null;continue}}if(G.length>2&&G[0]==="-"&&G[1]!=="-"){let B=this._findOption(`-${G[1]}`);if(B){if(B.required||B.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${B.name()}`,G.slice(2));else this.emit(`option:${B.name()}`),H=`-${G.slice(2)}`;continue}}if(/^--[^=]+=/.test(G)){let B=G.indexOf("="),Y=this._findOption(G.slice(0,B));if(Y&&(Y.required||Y.optional)){this.emit(`option:${Y.name()}`,G.slice(B+1));continue}}if(J===Z&&$(G)&&!(this.commands.length===0&&Q(G)))J=X;if((this._enablePositionalOptions||this._passThroughOptions)&&Z.length===0&&X.length===0){if(this._findCommand(G)){Z.push(G),X.push(...q.slice(U));break}else if(this._getHelpCommand()&&G===this._getHelpCommand().name()){Z.push(G,...q.slice(U));break}else if(this._defaultCommandName){X.push(G,...q.slice(U));break}}if(this._passThroughOptions){J.push(G,...q.slice(U));break}J.push(G)}return{operands:Z,unknown:X}}opts(){if(this._storeOptionsAsProperties){let q={},Z=this.options.length;for(let X=0;X<Z;X++){let J=this.options[X].attributeName();q[J]=J===this._versionOptionName?this._version:this[J]}return q}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((q,Z)=>Object.assign(q,Z.opts()),{})}error(q,Z){if(this._outputConfiguration.outputError(`${q}
22
22
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==="string")this._outputConfiguration.writeErr(`${this._showHelpAfterError}
23
23
  `);else if(this._showHelpAfterError)this._outputConfiguration.writeErr(`
24
- `),this.outputHelp({error:!0});let X=Z||{},J=X.exitCode||1,$=X.code||"commander.error";this._exit(J,$,q)}_parseOptionsEnv(){this.options.forEach((q)=>{if(q.envVar&&q.envVar in b.env){let Z=q.attributeName();if(this.getOptionValue(Z)===void 0||["default","config","env"].includes(this.getOptionValueSource(Z)))if(q.required||q.optional)this.emit(`optionEnv:${q.name()}`,b.env[q.envVar]);else this.emit(`optionEnv:${q.name()}`)}})}_parseOptionsImplied(){let q=new q7(this.options),Z=(X)=>{return this.getOptionValue(X)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(X))};this.options.filter((X)=>X.implied!==void 0&&Z(X.attributeName())&&q.valueFromOption(this.getOptionValue(X.attributeName()),X)).forEach((X)=>{Object.keys(X.implied).filter((J)=>!Z(J)).forEach((J)=>{this.setOptionValueWithSource(J,X.implied[J],"implied")})})}missingArgument(q){let Z=`error: missing required argument '${q}'`;this.error(Z,{code:"commander.missingArgument"})}optionMissingArgument(q){let Z=`error: option '${q.flags}' argument missing`;this.error(Z,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(q){let Z=`error: required option '${q.flags}' not specified`;this.error(Z,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(q,Z){let X=(Q)=>{let z=Q.attributeName(),H=this.getOptionValue(z),U=this.options.find((Y)=>Y.negate&&z===Y.attributeName()),G=this.options.find((Y)=>!Y.negate&&z===Y.attributeName());if(U&&(U.presetArg===void 0&&H===!1||U.presetArg!==void 0&&H===U.presetArg))return U;return G||Q},J=(Q)=>{let z=X(Q),H=z.attributeName();if(this.getOptionValueSource(H)==="env")return`environment variable '${z.envVar}'`;return`option '${z.flags}'`},$=`error: ${J(q)} cannot be used with ${J(Z)}`;this.error($,{code:"commander.conflictingOption"})}unknownOption(q){if(this._allowUnknownOption)return;let Z="";if(q.startsWith("--")&&this._showSuggestionAfterError){let J=[],$=this;do{let Q=$.createHelp().visibleOptions($).filter((z)=>z.long).map((z)=>z.long);J=J.concat(Q),$=$.parent}while($&&!$._enablePositionalOptions);Z=n4(q,J)}let X=`error: unknown option '${q}'${Z}`;this.error(X,{code:"commander.unknownOption"})}_excessArguments(q){if(this._allowExcessArguments)return;let Z=this.registeredArguments.length,X=Z===1?"":"s",$=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${Z} argument${X} but got ${q.length}.`;this.error($,{code:"commander.excessArguments"})}unknownCommand(){let q=this.args[0],Z="";if(this._showSuggestionAfterError){let J=[];this.createHelp().visibleCommands(this).forEach(($)=>{if(J.push($.name()),$.alias())J.push($.alias())}),Z=n4(q,J)}let X=`error: unknown command '${q}'${Z}`;this.error(X,{code:"commander.unknownCommand"})}version(q,Z,X){if(q===void 0)return this._version;this._version=q,Z=Z||"-V, --version",X=X||"output the version number";let J=this.createOption(Z,X);return this._versionOptionName=J.attributeName(),this._registerOption(J),this.on("option:"+J.name(),()=>{this._outputConfiguration.writeOut(`${q}
24
+ `),this.outputHelp({error:!0});let X=Z||{},J=X.exitCode||1,$=X.code||"commander.error";this._exit(J,$,q)}_parseOptionsEnv(){this.options.forEach((q)=>{if(q.envVar&&q.envVar in b.env){let Z=q.attributeName();if(this.getOptionValue(Z)===void 0||["default","config","env"].includes(this.getOptionValueSource(Z)))if(q.required||q.optional)this.emit(`optionEnv:${q.name()}`,b.env[q.envVar]);else this.emit(`optionEnv:${q.name()}`)}})}_parseOptionsImplied(){let q=new q7(this.options),Z=(X)=>{return this.getOptionValue(X)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(X))};this.options.filter((X)=>X.implied!==void 0&&Z(X.attributeName())&&q.valueFromOption(this.getOptionValue(X.attributeName()),X)).forEach((X)=>{Object.keys(X.implied).filter((J)=>!Z(J)).forEach((J)=>{this.setOptionValueWithSource(J,X.implied[J],"implied")})})}missingArgument(q){let Z=`error: missing required argument '${q}'`;this.error(Z,{code:"commander.missingArgument"})}optionMissingArgument(q){let Z=`error: option '${q.flags}' argument missing`;this.error(Z,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(q){let Z=`error: required option '${q.flags}' not specified`;this.error(Z,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(q,Z){let X=(Q)=>{let z=Q.attributeName(),H=this.getOptionValue(z),U=this.options.find((B)=>B.negate&&z===B.attributeName()),G=this.options.find((B)=>!B.negate&&z===B.attributeName());if(U&&(U.presetArg===void 0&&H===!1||U.presetArg!==void 0&&H===U.presetArg))return U;return G||Q},J=(Q)=>{let z=X(Q),H=z.attributeName();if(this.getOptionValueSource(H)==="env")return`environment variable '${z.envVar}'`;return`option '${z.flags}'`},$=`error: ${J(q)} cannot be used with ${J(Z)}`;this.error($,{code:"commander.conflictingOption"})}unknownOption(q){if(this._allowUnknownOption)return;let Z="";if(q.startsWith("--")&&this._showSuggestionAfterError){let J=[],$=this;do{let Q=$.createHelp().visibleOptions($).filter((z)=>z.long).map((z)=>z.long);J=J.concat(Q),$=$.parent}while($&&!$._enablePositionalOptions);Z=r4(q,J)}let X=`error: unknown option '${q}'${Z}`;this.error(X,{code:"commander.unknownOption"})}_excessArguments(q){if(this._allowExcessArguments)return;let Z=this.registeredArguments.length,X=Z===1?"":"s",$=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${Z} argument${X} but got ${q.length}.`;this.error($,{code:"commander.excessArguments"})}unknownCommand(){let q=this.args[0],Z="";if(this._showSuggestionAfterError){let J=[];this.createHelp().visibleCommands(this).forEach(($)=>{if(J.push($.name()),$.alias())J.push($.alias())}),Z=r4(q,J)}let X=`error: unknown command '${q}'${Z}`;this.error(X,{code:"commander.unknownCommand"})}version(q,Z,X){if(q===void 0)return this._version;this._version=q,Z=Z||"-V, --version",X=X||"output the version number";let J=this.createOption(Z,X);return this._versionOptionName=J.attributeName(),this._registerOption(J),this.on("option:"+J.name(),()=>{this._outputConfiguration.writeOut(`${q}
25
25
  `),this._exit(0,"commander.version",q)}),this}description(q,Z){if(q===void 0&&Z===void 0)return this._description;if(this._description=q,Z)this._argsDescription=Z;return this}summary(q){if(q===void 0)return this._summary;return this._summary=q,this}alias(q){if(q===void 0)return this._aliases[0];let Z=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)Z=this.commands[this.commands.length-1];if(q===Z._name)throw Error("Command alias can't be the same as its name");let X=this.parent?._findCommand(q);if(X){let J=[X.name()].concat(X.aliases()).join("|");throw Error(`cannot add alias '${q}' to command '${this.name()}' as already have command '${J}'`)}return Z._aliases.push(q),this}aliases(q){if(q===void 0)return this._aliases;return q.forEach((Z)=>this.alias(Z)),this}usage(q){if(q===void 0){if(this._usage)return this._usage;let Z=this.registeredArguments.map((X)=>{return o6(X)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?Z:[]).join(" ")}return this._usage=q,this}name(q){if(q===void 0)return this._name;return this._name=q,this}helpGroup(q){if(q===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=q,this}commandsGroup(q){if(q===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=q,this}optionsGroup(q){if(q===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=q,this}_initOptionGroup(q){if(this._defaultOptionGroup&&!q.helpGroupHeading)q.helpGroup(this._defaultOptionGroup)}_initCommandGroup(q){if(this._defaultCommandGroup&&!q.helpGroup())q.helpGroup(this._defaultCommandGroup)}nameFromFilename(q){return this._name=n.basename(q,n.extname(q)),this}executableDir(q){if(q===void 0)return this._executableDir;return this._executableDir=q,this}helpInformation(q){let Z=this.createHelp(),X=this._getOutputContext(q);Z.prepareContext({error:X.error,helpWidth:X.helpWidth,outputHasColors:X.hasColors});let J=Z.formatHelp(this,Z);if(X.hasColors)return J;return this._outputConfiguration.stripColor(J)}_getOutputContext(q){q=q||{};let Z=!!q.error,X,J,$;if(Z)X=(z)=>this._outputConfiguration.writeErr(z),J=this._outputConfiguration.getErrHasColors(),$=this._outputConfiguration.getErrHelpWidth();else X=(z)=>this._outputConfiguration.writeOut(z),J=this._outputConfiguration.getOutHasColors(),$=this._outputConfiguration.getOutHelpWidth();return{error:Z,write:(z)=>{if(!J)z=this._outputConfiguration.stripColor(z);return X(z)},hasColors:J,helpWidth:$}}outputHelp(q){let Z;if(typeof q==="function")Z=q,q=void 0;let X=this._getOutputContext(q),J={error:X.error,write:X.write,command:this};this._getCommandAndAncestors().reverse().forEach((Q)=>Q.emit("beforeAllHelp",J)),this.emit("beforeHelp",J);let $=this.helpInformation({error:X.error});if(Z){if($=Z($),typeof $!=="string"&&!Buffer.isBuffer($))throw Error("outputHelp callback must return a string or a Buffer")}if(X.write($),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",J),this._getCommandAndAncestors().forEach((Q)=>Q.emit("afterAllHelp",J))}helpOption(q,Z){if(typeof q==="boolean"){if(q){if(this._helpOption===null)this._helpOption=void 0;if(this._defaultOptionGroup)this._initOptionGroup(this._getHelpOption())}else this._helpOption=null;return this}if(this._helpOption=this.createOption(q??"-h, --help",Z??"display help for command"),q||Z)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption(q){return this._helpOption=q,this._initOptionGroup(q),this}help(q){this.outputHelp(q);let Z=Number(b.exitCode??0);if(Z===0&&q&&typeof q!=="function"&&q.error)Z=1;this._exit(Z,"commander.help","(outputHelp)")}addHelpText(q,Z){let X=["beforeAll","before","after","afterAll"];if(!X.includes(q))throw Error(`Unexpected value for position to addHelpText.
26
26
  Expecting one of '${X.join("', '")}'`);let J=`${q}Help`;return this.on(J,($)=>{let Q;if(typeof Z==="function")Q=Z({error:$.error,command:$.command});else Q=Z;if(Q)$.write(`${Q}
27
- `)}),this}_outputHelpIfRequested(q){let Z=this._getHelpOption();if(Z&&q.find((J)=>Z.is(J)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function o4(q){return q.map((Z)=>{if(!Z.startsWith("--inspect"))return Z;let X,J="127.0.0.1",$="9229",Q;if((Q=Z.match(/^(--inspect(-brk)?)$/))!==null)X=Q[1];else if((Q=Z.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(X=Q[1],/^\d+$/.test(Q[3]))$=Q[3];else J=Q[3];else if((Q=Z.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)X=Q[1],J=Q[3],$=Q[4];if(X&&$!=="0")return`${X}=${J}:${parseInt($)+1}`;return Z})}function cq(){if(b.env.NO_COLOR||b.env.FORCE_COLOR==="0"||b.env.FORCE_COLOR==="false")return!1;if(b.env.FORCE_COLOR||b.env.CLICOLOR_FORCE!==void 0)return!0;return}Z7.Command=iq;Z7.useColor=cq});var X2=D((z7)=>{var{Argument:e4}=D0(),{Command:aq}=t4(),{CommanderError:$7,InvalidArgumentError:q2}=u1(),{Help:Q7}=mq(),{Option:Z2}=dq();z7.program=new aq;z7.createCommand=(q)=>new aq(q);z7.createOption=(q,Z)=>new Z2(q,Z);z7.createArgument=(q,Z)=>new e4(q,Z);z7.Command=aq;z7.Option=Z2;z7.Argument=e4;z7.Help=Q7;z7.CommanderError=$7;z7.InvalidArgumentError=q2;z7.InvalidOptionArgumentError=q2});var S=D((g7)=>{var nq=Symbol.for("yaml.alias"),B2=Symbol.for("yaml.document"),S0=Symbol.for("yaml.map"),T2=Symbol.for("yaml.pair"),oq=Symbol.for("yaml.scalar"),w0=Symbol.for("yaml.seq"),t=Symbol.for("yaml.node.type"),C7=(q)=>!!q&&typeof q==="object"&&q[t]===nq,E7=(q)=>!!q&&typeof q==="object"&&q[t]===B2,f7=(q)=>!!q&&typeof q==="object"&&q[t]===S0,y7=(q)=>!!q&&typeof q==="object"&&q[t]===T2,_2=(q)=>!!q&&typeof q==="object"&&q[t]===oq,x7=(q)=>!!q&&typeof q==="object"&&q[t]===w0;function W2(q){if(q&&typeof q==="object")switch(q[t]){case S0:case w0:return!0}return!1}function k7(q){if(q&&typeof q==="object")switch(q[t]){case nq:case S0:case oq:case w0:return!0}return!1}var v7=(q)=>(_2(q)||W2(q))&&!!q.anchor;g7.ALIAS=nq;g7.DOC=B2;g7.MAP=S0;g7.NODE_TYPE=t;g7.PAIR=T2;g7.SCALAR=oq;g7.SEQ=w0;g7.hasAnchor=v7;g7.isAlias=C7;g7.isCollection=W2;g7.isDocument=E7;g7.isMap=f7;g7.isNode=k7;g7.isPair=y7;g7.isScalar=_2;g7.isSeq=x7});var m1=D((Z8)=>{var k=S(),v=Symbol("break visit"),R2=Symbol("skip children"),a=Symbol("remove node");function b0(q,Z){let X=V2(Z);if(k.isDocument(q)){if(A1(null,q.contents,X,Object.freeze([q]))===a)q.contents=null}else A1(null,q,X,Object.freeze([]))}b0.BREAK=v;b0.SKIP=R2;b0.REMOVE=a;function A1(q,Z,X,J){let $=L2(q,Z,X,J);if(k.isNode($)||k.isPair($))return I2(q,J,$),A1(q,$,X,J);if(typeof $!=="symbol"){if(k.isCollection(Z)){J=Object.freeze(J.concat(Z));for(let Q=0;Q<Z.items.length;++Q){let z=A1(Q,Z.items[Q],X,J);if(typeof z==="number")Q=z-1;else if(z===v)return v;else if(z===a)Z.items.splice(Q,1),Q-=1}}else if(k.isPair(Z)){J=Object.freeze(J.concat(Z));let Q=A1("key",Z.key,X,J);if(Q===v)return v;else if(Q===a)Z.key=null;let z=A1("value",Z.value,X,J);if(z===v)return v;else if(z===a)Z.value=null}}return $}async function j0(q,Z){let X=V2(Z);if(k.isDocument(q)){if(await S1(null,q.contents,X,Object.freeze([q]))===a)q.contents=null}else await S1(null,q,X,Object.freeze([]))}j0.BREAK=v;j0.SKIP=R2;j0.REMOVE=a;async function S1(q,Z,X,J){let $=await L2(q,Z,X,J);if(k.isNode($)||k.isPair($))return I2(q,J,$),S1(q,$,X,J);if(typeof $!=="symbol"){if(k.isCollection(Z)){J=Object.freeze(J.concat(Z));for(let Q=0;Q<Z.items.length;++Q){let z=await S1(Q,Z.items[Q],X,J);if(typeof z==="number")Q=z-1;else if(z===v)return v;else if(z===a)Z.items.splice(Q,1),Q-=1}}else if(k.isPair(Z)){J=Object.freeze(J.concat(Z));let Q=await S1("key",Z.key,X,J);if(Q===v)return v;else if(Q===a)Z.key=null;let z=await S1("value",Z.value,X,J);if(z===v)return v;else if(z===a)Z.value=null}}return $}function V2(q){if(typeof q==="object"&&(q.Collection||q.Node||q.Value))return Object.assign({Alias:q.Node,Map:q.Node,Scalar:q.Node,Seq:q.Node},q.Value&&{Map:q.Value,Scalar:q.Value,Seq:q.Value},q.Collection&&{Map:q.Collection,Seq:q.Collection},q);return q}function L2(q,Z,X,J){if(typeof X==="function")return X(q,Z,J);if(k.isMap(Z))return X.Map?.(q,Z,J);if(k.isSeq(Z))return X.Seq?.(q,Z,J);if(k.isPair(Z))return X.Pair?.(q,Z,J);if(k.isScalar(Z))return X.Scalar?.(q,Z,J);if(k.isAlias(Z))return X.Alias?.(q,Z,J);return}function I2(q,Z,X){let J=Z[Z.length-1];if(k.isCollection(J))J.items[q]=X;else if(k.isPair(J))if(q==="key")J.key=X;else J.value=X;else if(k.isDocument(J))J.contents=X;else{let $=k.isAlias(J)?"alias":"scalar";throw Error(`Cannot replace node with ${$} parent`)}}Z8.visit=b0;Z8.visitAsync=j0});var tq=D((H8)=>{var M2=S(),$8=m1(),Q8={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},z8=(q)=>q.replace(/[!,[\]{}]/g,(Z)=>Q8[Z]);class h{constructor(q,Z){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},h.defaultYaml,q),this.tags=Object.assign({},h.defaultTags,Z)}clone(){let q=new h(this.yaml,this.tags);return q.docStart=this.docStart,q}atDocument(){let q=new h(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:h.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},h.defaultTags);break}return q}add(q,Z){if(this.atNextDocument)this.yaml={explicit:h.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},h.defaultTags),this.atNextDocument=!1;let X=q.trim().split(/[ \t]+/),J=X.shift();switch(J){case"%TAG":{if(X.length!==2){if(Z(0,"%TAG directive should contain exactly two parts"),X.length<2)return!1}let[$,Q]=X;return this.tags[$]=Q,!0}case"%YAML":{if(this.yaml.explicit=!0,X.length!==1)return Z(0,"%YAML directive should contain exactly one part"),!1;let[$]=X;if($==="1.1"||$==="1.2")return this.yaml.version=$,!0;else{let Q=/^\d+\.\d+$/.test($);return Z(6,`Unsupported YAML version ${$}`,Q),!1}}default:return Z(0,`Unknown directive ${J}`,!0),!1}}tagName(q,Z){if(q==="!")return"!";if(q[0]!=="!")return Z(`Not a valid tag: ${q}`),null;if(q[1]==="<"){let Q=q.slice(2,-1);if(Q==="!"||Q==="!!")return Z(`Verbatim tags aren't resolved, so ${q} is invalid.`),null;if(q[q.length-1]!==">")Z("Verbatim tags must end with a >");return Q}let[,X,J]=q.match(/^(.*!)([^!]*)$/s);if(!J)Z(`The ${q} tag has no suffix`);let $=this.tags[X];if($)try{return $+decodeURIComponent(J)}catch(Q){return Z(String(Q)),null}if(X==="!")return q;return Z(`Could not resolve tag: ${q}`),null}tagString(q){for(let[Z,X]of Object.entries(this.tags))if(q.startsWith(X))return Z+z8(q.substring(X.length));return q[0]==="!"?q:`!<${q}>`}toString(q){let Z=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],X=Object.entries(this.tags),J;if(q&&X.length>0&&M2.isNode(q.contents)){let $={};$8.visit(q.contents,(Q,z)=>{if(M2.isNode(z)&&z.tag)$[z.tag]=!0}),J=Object.keys($)}else J=[];for(let[$,Q]of X){if($==="!!"&&Q==="tag:yaml.org,2002:")continue;if(!q||J.some((z)=>z.startsWith(Q)))Z.push(`%TAG ${$} ${Q}`)}return Z.join(`
28
- `)}}h.defaultYaml={explicit:!1,version:"1.2"};h.defaultTags={"!!":"tag:yaml.org,2002:"};H8.Directives=h});var C0=D((T8)=>{var K2=S(),G8=m1();function Y8(q){if(/[\x00-\x19\s,[\]{}]/.test(q)){let X=`Anchor must not contain whitespace or control characters: ${JSON.stringify(q)}`;throw Error(X)}return!0}function P2(q){let Z=new Set;return G8.visit(q,{Value(X,J){if(J.anchor)Z.add(J.anchor)}}),Z}function D2(q,Z){for(let X=1;;++X){let J=`${q}${X}`;if(!Z.has(J))return J}}function B8(q,Z){let X=[],J=new Map,$=null;return{onAnchor:(Q)=>{X.push(Q),$??($=P2(q));let z=D2(Z,$);return $.add(z),z},setAnchors:()=>{for(let Q of X){let z=J.get(Q);if(typeof z==="object"&&z.anchor&&(K2.isScalar(z.node)||K2.isCollection(z.node)))z.node.anchor=z.anchor;else{let H=Error("Failed to resolve repeated object (this should not happen)");throw H.source=Q,H}}},sourceObjects:J}}T8.anchorIsValid=Y8;T8.anchorNames=P2;T8.createNodeAnchors=B8;T8.findNewAnchor=D2});var eq=D((L8)=>{function d1(q,Z,X,J){if(J&&typeof J==="object")if(Array.isArray(J))for(let $=0,Q=J.length;$<Q;++$){let z=J[$],H=d1(q,J,String($),z);if(H===void 0)delete J[$];else if(H!==z)J[$]=H}else if(J instanceof Map)for(let $ of Array.from(J.keys())){let Q=J.get($),z=d1(q,J,$,Q);if(z===void 0)J.delete($);else if(z!==Q)J.set($,z)}else if(J instanceof Set)for(let $ of Array.from(J)){let Q=d1(q,J,$,$);if(Q===void 0)J.delete($);else if(Q!==$)J.delete($),J.add(Q)}else for(let[$,Q]of Object.entries(J)){let z=d1(q,J,$,Q);if(z===void 0)delete J[$];else if(z!==Q)J[$]=z}return q.call(Z,X,J)}L8.applyReviver=d1});var q1=D((K8)=>{var M8=S();function F2(q,Z,X){if(Array.isArray(q))return q.map((J,$)=>F2(J,String($),X));if(q&&typeof q.toJSON==="function"){if(!X||!M8.hasAnchor(q))return q.toJSON(Z,X);let J={aliasCount:0,count:1,res:void 0};X.anchors.set(q,J),X.onCreate=(Q)=>{J.res=Q,delete X.onCreate};let $=q.toJSON(Z,X);if(X.onCreate)X.onCreate($);return $}if(typeof q==="bigint"&&!X?.keep)return Number(q);return q}K8.toJS=F2});var E0=D((O8)=>{var D8=eq(),O2=S(),F8=q1();class N2{constructor(q){Object.defineProperty(this,O2.NODE_TYPE,{value:q})}clone(){let q=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)q.range=this.range.slice();return q}toJS(q,{mapAsMap:Z,maxAliasCount:X,onAnchor:J,reviver:$}={}){if(!O2.isDocument(q))throw TypeError("A document argument is required");let Q={anchors:new Map,doc:q,keep:!0,mapAsMap:Z===!0,mapKeyWarned:!1,maxAliasCount:typeof X==="number"?X:100},z=F8.toJS(this,"",Q);if(typeof J==="function")for(let{count:H,res:U}of Q.anchors.values())J(U,H);return typeof $==="function"?D8.applyReviver($,{"":z},"",z):z}}O8.NodeBase=N2});var l1=D((j8)=>{var A8=C0(),S8=m1(),w1=S(),w8=E0(),b8=q1();class A2 extends w8.NodeBase{constructor(q){super(w1.ALIAS);this.source=q,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(q,Z){let X;if(Z?.aliasResolveCache)X=Z.aliasResolveCache;else if(X=[],S8.visit(q,{Node:($,Q)=>{if(w1.isAlias(Q)||w1.hasAnchor(Q))X.push(Q)}}),Z)Z.aliasResolveCache=X;let J=void 0;for(let $ of X){if($===this)break;if($.anchor===this.source)J=$}return J}toJSON(q,Z){if(!Z)return{source:this.source};let{anchors:X,doc:J,maxAliasCount:$}=Z,Q=this.resolve(J,Z);if(!Q){let H=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(H)}let z=X.get(Q);if(!z)b8.toJS(Q,null,Z),z=X.get(Q);if(z?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if($>=0){if(z.count+=1,z.aliasCount===0)z.aliasCount=f0(J,Q,X);if(z.count*z.aliasCount>$)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return z.res}toString(q,Z,X){let J=`*${this.source}`;if(q){if(A8.anchorIsValid(this.source),q.options.verifyAliasOrder&&!q.anchors.has(this.source)){let $=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error($)}if(q.implicitKey)return`${J} `}return J}}function f0(q,Z,X){if(w1.isAlias(Z)){let J=Z.resolve(q),$=X&&J&&X.get(J);return $?$.count*$.aliasCount:0}else if(w1.isCollection(Z)){let J=0;for(let $ of Z.items){let Q=f0(q,$,X);if(Q>J)J=Q}return J}else if(w1.isPair(Z)){let J=f0(q,Z.key,X),$=f0(q,Z.value,X);return Math.max(J,$)}return 1}j8.Alias=A2});var E=D((k8)=>{var E8=S(),f8=E0(),y8=q1(),x8=(q)=>!q||typeof q!=="function"&&typeof q!=="object";class V1 extends f8.NodeBase{constructor(q){super(E8.SCALAR);this.value=q}toJSON(q,Z){return Z?.keep?this.value:y8.toJS(this.value,q,Z)}toString(){return String(this.value)}}V1.BLOCK_FOLDED="BLOCK_FOLDED";V1.BLOCK_LITERAL="BLOCK_LITERAL";V1.PLAIN="PLAIN";V1.QUOTE_DOUBLE="QUOTE_DOUBLE";V1.QUOTE_SINGLE="QUOTE_SINGLE";k8.Scalar=V1;k8.isScalarValue=x8});var p1=D((l8)=>{var h8=l1(),L1=S(),S2=E(),u8="tag:yaml.org,2002:";function m8(q,Z,X){if(Z){let J=X.filter((Q)=>Q.tag===Z),$=J.find((Q)=>!Q.format)??J[0];if(!$)throw Error(`Tag ${Z} not found`);return $}return X.find((J)=>J.identify?.(q)&&!J.format)}function d8(q,Z,X){if(L1.isDocument(q))q=q.contents;if(L1.isNode(q))return q;if(L1.isPair(q)){let B=X.schema[L1.MAP].createNode?.(X.schema,null,X);return B.items.push(q),B}if(q instanceof String||q instanceof Number||q instanceof Boolean||typeof BigInt<"u"&&q instanceof BigInt)q=q.valueOf();let{aliasDuplicateObjects:J,onAnchor:$,onTagObj:Q,schema:z,sourceObjects:H}=X,U=void 0;if(J&&q&&typeof q==="object")if(U=H.get(q),U)return U.anchor??(U.anchor=$(q)),new h8.Alias(U.anchor);else U={anchor:null,node:null},H.set(q,U);if(Z?.startsWith("!!"))Z=u8+Z.slice(2);let G=m8(q,Z,z.tags);if(!G){if(q&&typeof q.toJSON==="function")q=q.toJSON();if(!q||typeof q!=="object"){let B=new S2.Scalar(q);if(U)U.node=B;return B}G=q instanceof Map?z[L1.MAP]:(Symbol.iterator in Object(q))?z[L1.SEQ]:z[L1.MAP]}if(Q)Q(G),delete X.onTagObj;let Y=G?.createNode?G.createNode(X.schema,q,X):typeof G?.nodeClass?.from==="function"?G.nodeClass.from(X.schema,q,X):new S2.Scalar(q);if(Z)Y.tag=Z;else if(!G.default)Y.tag=G.tag;if(U)U.node=Y;return Y}l8.createNode=d8});var y0=D((a8)=>{var c8=p1(),s=S(),i8=E0();function q9(q,Z,X){let J=X;for(let $=Z.length-1;$>=0;--$){let Q=Z[$];if(typeof Q==="number"&&Number.isInteger(Q)&&Q>=0){let z=[];z[Q]=J,J=z}else J=new Map([[Q,J]])}return c8.createNode(J,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:q,sourceObjects:new Map})}var w2=(q)=>q==null||typeof q==="object"&&!!q[Symbol.iterator]().next().done;class b2 extends i8.NodeBase{constructor(q,Z){super(q);Object.defineProperty(this,"schema",{value:Z,configurable:!0,enumerable:!1,writable:!0})}clone(q){let Z=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(q)Z.schema=q;if(Z.items=Z.items.map((X)=>s.isNode(X)||s.isPair(X)?X.clone(q):X),this.range)Z.range=this.range.slice();return Z}addIn(q,Z){if(w2(q))this.add(Z);else{let[X,...J]=q,$=this.get(X,!0);if(s.isCollection($))$.addIn(J,Z);else if($===void 0&&this.schema)this.set(X,q9(this.schema,J,Z));else throw Error(`Expected YAML collection at ${X}. Remaining path: ${J}`)}}deleteIn(q){let[Z,...X]=q;if(X.length===0)return this.delete(Z);let J=this.get(Z,!0);if(s.isCollection(J))return J.deleteIn(X);else throw Error(`Expected YAML collection at ${Z}. Remaining path: ${X}`)}getIn(q,Z){let[X,...J]=q,$=this.get(X,!0);if(J.length===0)return!Z&&s.isScalar($)?$.value:$;else return s.isCollection($)?$.getIn(J,Z):void 0}hasAllNullValues(q){return this.items.every((Z)=>{if(!s.isPair(Z))return!1;let X=Z.value;return X==null||q&&s.isScalar(X)&&X.value==null&&!X.commentBefore&&!X.comment&&!X.tag})}hasIn(q){let[Z,...X]=q;if(X.length===0)return this.has(Z);let J=this.get(Z,!0);return s.isCollection(J)?J.hasIn(X):!1}setIn(q,Z){let[X,...J]=q;if(J.length===0)this.set(X,Z);else{let $=this.get(X,!0);if(s.isCollection($))$.setIn(J,Z);else if($===void 0&&this.schema)this.set(X,q9(this.schema,J,Z));else throw Error(`Expected YAML collection at ${X}. Remaining path: ${J}`)}}}a8.Collection=b2;a8.collectionFromPath=q9;a8.isEmptyPath=w2});var c1=D((e8)=>{var o8=(q)=>q.replace(/^(?!$)(?: $)?/gm,"#");function Z9(q,Z){if(/^\n+$/.test(q))return q.substring(1);return Z?q.replace(/^(?! *$)/gm,Z):q}var t8=(q,Z,X)=>q.endsWith(`
29
- `)?Z9(X,Z):X.includes(`
27
+ `)}),this}_outputHelpIfRequested(q){let Z=this._getHelpOption();if(Z&&q.find((J)=>Z.is(J)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function n4(q){return q.map((Z)=>{if(!Z.startsWith("--inspect"))return Z;let X,J="127.0.0.1",$="9229",Q;if((Q=Z.match(/^(--inspect(-brk)?)$/))!==null)X=Q[1];else if((Q=Z.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(X=Q[1],/^\d+$/.test(Q[3]))$=Q[3];else J=Q[3];else if((Q=Z.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)X=Q[1],J=Q[3],$=Q[4];if(X&&$!=="0")return`${X}=${J}:${parseInt($)+1}`;return Z})}function pq(){if(b.env.NO_COLOR||b.env.FORCE_COLOR==="0"||b.env.FORCE_COLOR==="false")return!1;if(b.env.FORCE_COLOR||b.env.CLICOLOR_FORCE!==void 0)return!0;return}Z7.Command=cq;Z7.useColor=pq});var Z2=P((z7)=>{var{Argument:t4}=F0(),{Command:iq}=o4(),{CommanderError:$7,InvalidArgumentError:e4}=m1(),{Help:Q7}=uq(),{Option:q2}=mq();z7.program=new iq;z7.createCommand=(q)=>new iq(q);z7.createOption=(q,Z)=>new q2(q,Z);z7.createArgument=(q,Z)=>new t4(q,Z);z7.Command=iq;z7.Option=q2;z7.Argument=t4;z7.Help=Q7;z7.CommanderError=$7;z7.InvalidArgumentError=e4;z7.InvalidOptionArgumentError=e4});var S=P((g7)=>{var rq=Symbol.for("yaml.alias"),Y2=Symbol.for("yaml.document"),w0=Symbol.for("yaml.map"),B2=Symbol.for("yaml.pair"),nq=Symbol.for("yaml.scalar"),b0=Symbol.for("yaml.seq"),t=Symbol.for("yaml.node.type"),E7=(q)=>!!q&&typeof q==="object"&&q[t]===rq,C7=(q)=>!!q&&typeof q==="object"&&q[t]===Y2,f7=(q)=>!!q&&typeof q==="object"&&q[t]===w0,x7=(q)=>!!q&&typeof q==="object"&&q[t]===B2,T2=(q)=>!!q&&typeof q==="object"&&q[t]===nq,y7=(q)=>!!q&&typeof q==="object"&&q[t]===b0;function _2(q){if(q&&typeof q==="object")switch(q[t]){case w0:case b0:return!0}return!1}function k7(q){if(q&&typeof q==="object")switch(q[t]){case rq:case w0:case nq:case b0:return!0}return!1}var v7=(q)=>(T2(q)||_2(q))&&!!q.anchor;g7.ALIAS=rq;g7.DOC=Y2;g7.MAP=w0;g7.NODE_TYPE=t;g7.PAIR=B2;g7.SCALAR=nq;g7.SEQ=b0;g7.hasAnchor=v7;g7.isAlias=E7;g7.isCollection=_2;g7.isDocument=C7;g7.isMap=f7;g7.isNode=k7;g7.isPair=x7;g7.isScalar=T2;g7.isSeq=y7});var d1=P((Z8)=>{var k=S(),v=Symbol("break visit"),L2=Symbol("skip children"),a=Symbol("remove node");function j0(q,Z){let X=W2(Z);if(k.isDocument(q)){if(A1(null,q.contents,X,Object.freeze([q]))===a)q.contents=null}else A1(null,q,X,Object.freeze([]))}j0.BREAK=v;j0.SKIP=L2;j0.REMOVE=a;function A1(q,Z,X,J){let $=R2(q,Z,X,J);if(k.isNode($)||k.isPair($))return V2(q,J,$),A1(q,$,X,J);if(typeof $!=="symbol"){if(k.isCollection(Z)){J=Object.freeze(J.concat(Z));for(let Q=0;Q<Z.items.length;++Q){let z=A1(Q,Z.items[Q],X,J);if(typeof z==="number")Q=z-1;else if(z===v)return v;else if(z===a)Z.items.splice(Q,1),Q-=1}}else if(k.isPair(Z)){J=Object.freeze(J.concat(Z));let Q=A1("key",Z.key,X,J);if(Q===v)return v;else if(Q===a)Z.key=null;let z=A1("value",Z.value,X,J);if(z===v)return v;else if(z===a)Z.value=null}}return $}async function E0(q,Z){let X=W2(Z);if(k.isDocument(q)){if(await S1(null,q.contents,X,Object.freeze([q]))===a)q.contents=null}else await S1(null,q,X,Object.freeze([]))}E0.BREAK=v;E0.SKIP=L2;E0.REMOVE=a;async function S1(q,Z,X,J){let $=await R2(q,Z,X,J);if(k.isNode($)||k.isPair($))return V2(q,J,$),S1(q,$,X,J);if(typeof $!=="symbol"){if(k.isCollection(Z)){J=Object.freeze(J.concat(Z));for(let Q=0;Q<Z.items.length;++Q){let z=await S1(Q,Z.items[Q],X,J);if(typeof z==="number")Q=z-1;else if(z===v)return v;else if(z===a)Z.items.splice(Q,1),Q-=1}}else if(k.isPair(Z)){J=Object.freeze(J.concat(Z));let Q=await S1("key",Z.key,X,J);if(Q===v)return v;else if(Q===a)Z.key=null;let z=await S1("value",Z.value,X,J);if(z===v)return v;else if(z===a)Z.value=null}}return $}function W2(q){if(typeof q==="object"&&(q.Collection||q.Node||q.Value))return Object.assign({Alias:q.Node,Map:q.Node,Scalar:q.Node,Seq:q.Node},q.Value&&{Map:q.Value,Scalar:q.Value,Seq:q.Value},q.Collection&&{Map:q.Collection,Seq:q.Collection},q);return q}function R2(q,Z,X,J){if(typeof X==="function")return X(q,Z,J);if(k.isMap(Z))return X.Map?.(q,Z,J);if(k.isSeq(Z))return X.Seq?.(q,Z,J);if(k.isPair(Z))return X.Pair?.(q,Z,J);if(k.isScalar(Z))return X.Scalar?.(q,Z,J);if(k.isAlias(Z))return X.Alias?.(q,Z,J);return}function V2(q,Z,X){let J=Z[Z.length-1];if(k.isCollection(J))J.items[q]=X;else if(k.isPair(J))if(q==="key")J.key=X;else J.value=X;else if(k.isDocument(J))J.contents=X;else{let $=k.isAlias(J)?"alias":"scalar";throw Error(`Cannot replace node with ${$} parent`)}}Z8.visit=j0;Z8.visitAsync=E0});var oq=P((H8)=>{var I2=S(),$8=d1(),Q8={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},z8=(q)=>q.replace(/[!,[\]{}]/g,(Z)=>Q8[Z]);class h{constructor(q,Z){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},h.defaultYaml,q),this.tags=Object.assign({},h.defaultTags,Z)}clone(){let q=new h(this.yaml,this.tags);return q.docStart=this.docStart,q}atDocument(){let q=new h(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:h.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},h.defaultTags);break}return q}add(q,Z){if(this.atNextDocument)this.yaml={explicit:h.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},h.defaultTags),this.atNextDocument=!1;let X=q.trim().split(/[ \t]+/),J=X.shift();switch(J){case"%TAG":{if(X.length!==2){if(Z(0,"%TAG directive should contain exactly two parts"),X.length<2)return!1}let[$,Q]=X;return this.tags[$]=Q,!0}case"%YAML":{if(this.yaml.explicit=!0,X.length!==1)return Z(0,"%YAML directive should contain exactly one part"),!1;let[$]=X;if($==="1.1"||$==="1.2")return this.yaml.version=$,!0;else{let Q=/^\d+\.\d+$/.test($);return Z(6,`Unsupported YAML version ${$}`,Q),!1}}default:return Z(0,`Unknown directive ${J}`,!0),!1}}tagName(q,Z){if(q==="!")return"!";if(q[0]!=="!")return Z(`Not a valid tag: ${q}`),null;if(q[1]==="<"){let Q=q.slice(2,-1);if(Q==="!"||Q==="!!")return Z(`Verbatim tags aren't resolved, so ${q} is invalid.`),null;if(q[q.length-1]!==">")Z("Verbatim tags must end with a >");return Q}let[,X,J]=q.match(/^(.*!)([^!]*)$/s);if(!J)Z(`The ${q} tag has no suffix`);let $=this.tags[X];if($)try{return $+decodeURIComponent(J)}catch(Q){return Z(String(Q)),null}if(X==="!")return q;return Z(`Could not resolve tag: ${q}`),null}tagString(q){for(let[Z,X]of Object.entries(this.tags))if(q.startsWith(X))return Z+z8(q.substring(X.length));return q[0]==="!"?q:`!<${q}>`}toString(q){let Z=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],X=Object.entries(this.tags),J;if(q&&X.length>0&&I2.isNode(q.contents)){let $={};$8.visit(q.contents,(Q,z)=>{if(I2.isNode(z)&&z.tag)$[z.tag]=!0}),J=Object.keys($)}else J=[];for(let[$,Q]of X){if($==="!!"&&Q==="tag:yaml.org,2002:")continue;if(!q||J.some((z)=>z.startsWith(Q)))Z.push(`%TAG ${$} ${Q}`)}return Z.join(`
28
+ `)}}h.defaultYaml={explicit:!1,version:"1.2"};h.defaultTags={"!!":"tag:yaml.org,2002:"};H8.Directives=h});var C0=P((T8)=>{var M2=S(),G8=d1();function Y8(q){if(/[\x00-\x19\s,[\]{}]/.test(q)){let X=`Anchor must not contain whitespace or control characters: ${JSON.stringify(q)}`;throw Error(X)}return!0}function K2(q){let Z=new Set;return G8.visit(q,{Value(X,J){if(J.anchor)Z.add(J.anchor)}}),Z}function D2(q,Z){for(let X=1;;++X){let J=`${q}${X}`;if(!Z.has(J))return J}}function B8(q,Z){let X=[],J=new Map,$=null;return{onAnchor:(Q)=>{X.push(Q),$??($=K2(q));let z=D2(Z,$);return $.add(z),z},setAnchors:()=>{for(let Q of X){let z=J.get(Q);if(typeof z==="object"&&z.anchor&&(M2.isScalar(z.node)||M2.isCollection(z.node)))z.node.anchor=z.anchor;else{let H=Error("Failed to resolve repeated object (this should not happen)");throw H.source=Q,H}}},sourceObjects:J}}T8.anchorIsValid=Y8;T8.anchorNames=K2;T8.createNodeAnchors=B8;T8.findNewAnchor=D2});var tq=P((V8)=>{function l1(q,Z,X,J){if(J&&typeof J==="object")if(Array.isArray(J))for(let $=0,Q=J.length;$<Q;++$){let z=J[$],H=l1(q,J,String($),z);if(H===void 0)delete J[$];else if(H!==z)J[$]=H}else if(J instanceof Map)for(let $ of Array.from(J.keys())){let Q=J.get($),z=l1(q,J,$,Q);if(z===void 0)J.delete($);else if(z!==Q)J.set($,z)}else if(J instanceof Set)for(let $ of Array.from(J)){let Q=l1(q,J,$,$);if(Q===void 0)J.delete($);else if(Q!==$)J.delete($),J.add(Q)}else for(let[$,Q]of Object.entries(J)){let z=l1(q,J,$,Q);if(z===void 0)delete J[$];else if(z!==Q)J[$]=z}return q.call(Z,X,J)}V8.applyReviver=l1});var Z1=P((K8)=>{var M8=S();function P2(q,Z,X){if(Array.isArray(q))return q.map((J,$)=>P2(J,String($),X));if(q&&typeof q.toJSON==="function"){if(!X||!M8.hasAnchor(q))return q.toJSON(Z,X);let J={aliasCount:0,count:1,res:void 0};X.anchors.set(q,J),X.onCreate=(Q)=>{J.res=Q,delete X.onCreate};let $=q.toJSON(Z,X);if(X.onCreate)X.onCreate($);return $}if(typeof q==="bigint"&&!X?.keep)return Number(q);return q}K8.toJS=P2});var f0=P((O8)=>{var P8=tq(),F2=S(),F8=Z1();class O2{constructor(q){Object.defineProperty(this,F2.NODE_TYPE,{value:q})}clone(){let q=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)q.range=this.range.slice();return q}toJS(q,{mapAsMap:Z,maxAliasCount:X,onAnchor:J,reviver:$}={}){if(!F2.isDocument(q))throw TypeError("A document argument is required");let Q={anchors:new Map,doc:q,keep:!0,mapAsMap:Z===!0,mapKeyWarned:!1,maxAliasCount:typeof X==="number"?X:100},z=F8.toJS(this,"",Q);if(typeof J==="function")for(let{count:H,res:U}of Q.anchors.values())J(U,H);return typeof $==="function"?P8.applyReviver($,{"":z},"",z):z}}O8.NodeBase=O2});var p1=P((j8)=>{var A8=C0(),S8=d1(),w1=S(),w8=f0(),b8=Z1();class N2 extends w8.NodeBase{constructor(q){super(w1.ALIAS);this.source=q,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(q,Z){let X;if(Z?.aliasResolveCache)X=Z.aliasResolveCache;else if(X=[],S8.visit(q,{Node:($,Q)=>{if(w1.isAlias(Q)||w1.hasAnchor(Q))X.push(Q)}}),Z)Z.aliasResolveCache=X;let J=void 0;for(let $ of X){if($===this)break;if($.anchor===this.source)J=$}return J}toJSON(q,Z){if(!Z)return{source:this.source};let{anchors:X,doc:J,maxAliasCount:$}=Z,Q=this.resolve(J,Z);if(!Q){let H=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(H)}let z=X.get(Q);if(!z)b8.toJS(Q,null,Z),z=X.get(Q);if(z?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if($>=0){if(z.count+=1,z.aliasCount===0)z.aliasCount=x0(J,Q,X);if(z.count*z.aliasCount>$)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return z.res}toString(q,Z,X){let J=`*${this.source}`;if(q){if(A8.anchorIsValid(this.source),q.options.verifyAliasOrder&&!q.anchors.has(this.source)){let $=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error($)}if(q.implicitKey)return`${J} `}return J}}function x0(q,Z,X){if(w1.isAlias(Z)){let J=Z.resolve(q),$=X&&J&&X.get(J);return $?$.count*$.aliasCount:0}else if(w1.isCollection(Z)){let J=0;for(let $ of Z.items){let Q=x0(q,$,X);if(Q>J)J=Q}return J}else if(w1.isPair(Z)){let J=x0(q,Z.key,X),$=x0(q,Z.value,X);return Math.max(J,$)}return 1}j8.Alias=N2});var C=P((k8)=>{var C8=S(),f8=f0(),x8=Z1(),y8=(q)=>!q||typeof q!=="function"&&typeof q!=="object";class R1 extends f8.NodeBase{constructor(q){super(C8.SCALAR);this.value=q}toJSON(q,Z){return Z?.keep?this.value:x8.toJS(this.value,q,Z)}toString(){return String(this.value)}}R1.BLOCK_FOLDED="BLOCK_FOLDED";R1.BLOCK_LITERAL="BLOCK_LITERAL";R1.PLAIN="PLAIN";R1.QUOTE_DOUBLE="QUOTE_DOUBLE";R1.QUOTE_SINGLE="QUOTE_SINGLE";k8.Scalar=R1;k8.isScalarValue=y8});var c1=P((l8)=>{var h8=p1(),V1=S(),A2=C(),u8="tag:yaml.org,2002:";function m8(q,Z,X){if(Z){let J=X.filter((Q)=>Q.tag===Z),$=J.find((Q)=>!Q.format)??J[0];if(!$)throw Error(`Tag ${Z} not found`);return $}return X.find((J)=>J.identify?.(q)&&!J.format)}function d8(q,Z,X){if(V1.isDocument(q))q=q.contents;if(V1.isNode(q))return q;if(V1.isPair(q)){let Y=X.schema[V1.MAP].createNode?.(X.schema,null,X);return Y.items.push(q),Y}if(q instanceof String||q instanceof Number||q instanceof Boolean||typeof BigInt<"u"&&q instanceof BigInt)q=q.valueOf();let{aliasDuplicateObjects:J,onAnchor:$,onTagObj:Q,schema:z,sourceObjects:H}=X,U=void 0;if(J&&q&&typeof q==="object")if(U=H.get(q),U)return U.anchor??(U.anchor=$(q)),new h8.Alias(U.anchor);else U={anchor:null,node:null},H.set(q,U);if(Z?.startsWith("!!"))Z=u8+Z.slice(2);let G=m8(q,Z,z.tags);if(!G){if(q&&typeof q.toJSON==="function")q=q.toJSON();if(!q||typeof q!=="object"){let Y=new A2.Scalar(q);if(U)U.node=Y;return Y}G=q instanceof Map?z[V1.MAP]:(Symbol.iterator in Object(q))?z[V1.SEQ]:z[V1.MAP]}if(Q)Q(G),delete X.onTagObj;let B=G?.createNode?G.createNode(X.schema,q,X):typeof G?.nodeClass?.from==="function"?G.nodeClass.from(X.schema,q,X):new A2.Scalar(q);if(Z)B.tag=Z;else if(!G.default)B.tag=G.tag;if(U)U.node=B;return B}l8.createNode=d8});var y0=P((a8)=>{var c8=c1(),s=S(),i8=f0();function eq(q,Z,X){let J=X;for(let $=Z.length-1;$>=0;--$){let Q=Z[$];if(typeof Q==="number"&&Number.isInteger(Q)&&Q>=0){let z=[];z[Q]=J,J=z}else J=new Map([[Q,J]])}return c8.createNode(J,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:q,sourceObjects:new Map})}var S2=(q)=>q==null||typeof q==="object"&&!!q[Symbol.iterator]().next().done;class w2 extends i8.NodeBase{constructor(q,Z){super(q);Object.defineProperty(this,"schema",{value:Z,configurable:!0,enumerable:!1,writable:!0})}clone(q){let Z=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(q)Z.schema=q;if(Z.items=Z.items.map((X)=>s.isNode(X)||s.isPair(X)?X.clone(q):X),this.range)Z.range=this.range.slice();return Z}addIn(q,Z){if(S2(q))this.add(Z);else{let[X,...J]=q,$=this.get(X,!0);if(s.isCollection($))$.addIn(J,Z);else if($===void 0&&this.schema)this.set(X,eq(this.schema,J,Z));else throw Error(`Expected YAML collection at ${X}. Remaining path: ${J}`)}}deleteIn(q){let[Z,...X]=q;if(X.length===0)return this.delete(Z);let J=this.get(Z,!0);if(s.isCollection(J))return J.deleteIn(X);else throw Error(`Expected YAML collection at ${Z}. Remaining path: ${X}`)}getIn(q,Z){let[X,...J]=q,$=this.get(X,!0);if(J.length===0)return!Z&&s.isScalar($)?$.value:$;else return s.isCollection($)?$.getIn(J,Z):void 0}hasAllNullValues(q){return this.items.every((Z)=>{if(!s.isPair(Z))return!1;let X=Z.value;return X==null||q&&s.isScalar(X)&&X.value==null&&!X.commentBefore&&!X.comment&&!X.tag})}hasIn(q){let[Z,...X]=q;if(X.length===0)return this.has(Z);let J=this.get(Z,!0);return s.isCollection(J)?J.hasIn(X):!1}setIn(q,Z){let[X,...J]=q;if(J.length===0)this.set(X,Z);else{let $=this.get(X,!0);if(s.isCollection($))$.setIn(J,Z);else if($===void 0&&this.schema)this.set(X,eq(this.schema,J,Z));else throw Error(`Expected YAML collection at ${X}. Remaining path: ${J}`)}}}a8.Collection=w2;a8.collectionFromPath=eq;a8.isEmptyPath=S2});var i1=P((e8)=>{var o8=(q)=>q.replace(/^(?!$)(?: $)?/gm,"#");function q9(q,Z){if(/^\n+$/.test(q))return q.substring(1);return Z?q.replace(/^(?! *$)/gm,Z):q}var t8=(q,Z,X)=>q.endsWith(`
29
+ `)?q9(X,Z):X.includes(`
30
30
  `)?`
31
- `+Z9(X,Z):(q.endsWith(" ")?"":" ")+X;e8.indentComment=Z9;e8.lineComment=t8;e8.stringifyComment=o8});var C2=D(($Z)=>{function JZ(q,Z,X="flow",{indentAtStart:J,lineWidth:$=80,minContentWidth:Q=20,onFold:z,onOverflow:H}={}){if(!$||$<0)return q;if($<Q)Q=0;let U=Math.max(1+Q,1+$-Z.length);if(q.length<=U)return q;let G=[],Y={},B=$-Z.length;if(typeof J==="number")if(J>$-Math.max(2,Q))G.push(0);else B=$-J;let _=void 0,V=void 0,R=!1,T=-1,W=-1,I=-1;if(X==="block"){if(T=j2(q,T,Z.length),T!==-1)B=T+U}for(let P;P=q[T+=1];){if(X==="quoted"&&P==="\\"){switch(W=T,q[T+1]){case"x":T+=3;break;case"u":T+=5;break;case"U":T+=9;break;default:T+=1}I=T}if(P===`
32
- `){if(X==="block")T=j2(q,T,Z.length);B=T+Z.length+U,_=void 0}else{if(P===" "&&V&&V!==" "&&V!==`
33
- `&&V!=="\t"){let O=q[T+1];if(O&&O!==" "&&O!==`
34
- `&&O!=="\t")_=T}if(T>=B)if(_)G.push(_),B=_+U,_=void 0;else if(X==="quoted"){while(V===" "||V==="\t")V=P,P=q[T+=1],R=!0;let O=T>I+1?T-2:W-1;if(Y[O])return q;G.push(O),Y[O]=!0,B=O+U,_=void 0}else R=!0}V=P}if(R&&H)H();if(G.length===0)return q;if(z)z();let M=q.slice(0,G[0]);for(let P=0;P<G.length;++P){let O=G[P],N=G[P+1]||q.length;if(O===0)M=`
35
- ${Z}${q.slice(0,N)}`;else{if(X==="quoted"&&Y[O])M+=`${q[O]}\\`;M+=`
36
- ${Z}${q.slice(O+1,N)}`}}return M}function j2(q,Z,X){let J=Z,$=Z+1,Q=q[$];while(Q===" "||Q==="\t")if(Z<$+X)Q=q[++Z];else{do Q=q[++Z];while(Q&&Q!==`
37
- `);J=Z,$=Z+1,Q=q[$]}return J}$Z.FOLD_BLOCK="block";$Z.FOLD_FLOW="flow";$Z.FOLD_QUOTED="quoted";$Z.foldFlowLines=JZ});var a1=D((TZ)=>{var d=E(),Z1=C2(),k0=(q,Z)=>({indentAtStart:Z?q.indent.length:q.indentAtStart,lineWidth:q.options.lineWidth,minContentWidth:q.options.minContentWidth}),v0=(q)=>/^(%|---|\.\.\.)/m.test(q);function GZ(q,Z,X){if(!Z||Z<0)return!1;let J=Z-X,$=q.length;if($<=J)return!1;for(let Q=0,z=0;Q<$;++Q)if(q[Q]===`
38
- `){if(Q-z>J)return!0;if(z=Q+1,$-z<=J)return!1}return!0}function i1(q,Z){let X=JSON.stringify(q);if(Z.options.doubleQuotedAsJSON)return X;let{implicitKey:J}=Z,$=Z.options.doubleQuotedMinMultiLineLength,Q=Z.indent||(v0(q)?" ":""),z="",H=0;for(let U=0,G=X[U];G;G=X[++U]){if(G===" "&&X[U+1]==="\\"&&X[U+2]==="n")z+=X.slice(H,U)+"\\ ",U+=1,H=U,G="\\";if(G==="\\")switch(X[U+1]){case"u":{z+=X.slice(H,U);let Y=X.substr(U+2,4);switch(Y){case"0000":z+="\\0";break;case"0007":z+="\\a";break;case"000b":z+="\\v";break;case"001b":z+="\\e";break;case"0085":z+="\\N";break;case"00a0":z+="\\_";break;case"2028":z+="\\L";break;case"2029":z+="\\P";break;default:if(Y.substr(0,2)==="00")z+="\\x"+Y.substr(2);else z+=X.substr(U,6)}U+=5,H=U+1}break;case"n":if(J||X[U+2]==='"'||X.length<$)U+=1;else{z+=X.slice(H,U)+`
31
+ `+q9(X,Z):(q.endsWith(" ")?"":" ")+X;e8.indentComment=q9;e8.lineComment=t8;e8.stringifyComment=o8});var j2=P(($Z)=>{function JZ(q,Z,X="flow",{indentAtStart:J,lineWidth:$=80,minContentWidth:Q=20,onFold:z,onOverflow:H}={}){if(!$||$<0)return q;if($<Q)Q=0;let U=Math.max(1+Q,1+$-Z.length);if(q.length<=U)return q;let G=[],B={},Y=$-Z.length;if(typeof J==="number")if(J>$-Math.max(2,Q))G.push(0);else Y=$-J;let _=void 0,R=void 0,W=!1,T=-1,L=-1,I=-1;if(X==="block"){if(T=b2(q,T,Z.length),T!==-1)Y=T+U}for(let D;D=q[T+=1];){if(X==="quoted"&&D==="\\"){switch(L=T,q[T+1]){case"x":T+=3;break;case"u":T+=5;break;case"U":T+=9;break;default:T+=1}I=T}if(D===`
32
+ `){if(X==="block")T=b2(q,T,Z.length);Y=T+Z.length+U,_=void 0}else{if(D===" "&&R&&R!==" "&&R!==`
33
+ `&&R!=="\t"){let O=q[T+1];if(O&&O!==" "&&O!==`
34
+ `&&O!=="\t")_=T}if(T>=Y)if(_)G.push(_),Y=_+U,_=void 0;else if(X==="quoted"){while(R===" "||R==="\t")R=D,D=q[T+=1],W=!0;let O=T>I+1?T-2:L-1;if(B[O])return q;G.push(O),B[O]=!0,Y=O+U,_=void 0}else W=!0}R=D}if(W&&H)H();if(G.length===0)return q;if(z)z();let M=q.slice(0,G[0]);for(let D=0;D<G.length;++D){let O=G[D],N=G[D+1]||q.length;if(O===0)M=`
35
+ ${Z}${q.slice(0,N)}`;else{if(X==="quoted"&&B[O])M+=`${q[O]}\\`;M+=`
36
+ ${Z}${q.slice(O+1,N)}`}}return M}function b2(q,Z,X){let J=Z,$=Z+1,Q=q[$];while(Q===" "||Q==="\t")if(Z<$+X)Q=q[++Z];else{do Q=q[++Z];while(Q&&Q!==`
37
+ `);J=Z,$=Z+1,Q=q[$]}return J}$Z.FOLD_BLOCK="block";$Z.FOLD_FLOW="flow";$Z.FOLD_QUOTED="quoted";$Z.foldFlowLines=JZ});var s1=P((TZ)=>{var d=C(),X1=j2(),v0=(q,Z)=>({indentAtStart:Z?q.indent.length:q.indentAtStart,lineWidth:q.options.lineWidth,minContentWidth:q.options.minContentWidth}),g0=(q)=>/^(%|---|\.\.\.)/m.test(q);function GZ(q,Z,X){if(!Z||Z<0)return!1;let J=Z-X,$=q.length;if($<=J)return!1;for(let Q=0,z=0;Q<$;++Q)if(q[Q]===`
38
+ `){if(Q-z>J)return!0;if(z=Q+1,$-z<=J)return!1}return!0}function a1(q,Z){let X=JSON.stringify(q);if(Z.options.doubleQuotedAsJSON)return X;let{implicitKey:J}=Z,$=Z.options.doubleQuotedMinMultiLineLength,Q=Z.indent||(g0(q)?" ":""),z="",H=0;for(let U=0,G=X[U];G;G=X[++U]){if(G===" "&&X[U+1]==="\\"&&X[U+2]==="n")z+=X.slice(H,U)+"\\ ",U+=1,H=U,G="\\";if(G==="\\")switch(X[U+1]){case"u":{z+=X.slice(H,U);let B=X.substr(U+2,4);switch(B){case"0000":z+="\\0";break;case"0007":z+="\\a";break;case"000b":z+="\\v";break;case"001b":z+="\\e";break;case"0085":z+="\\N";break;case"00a0":z+="\\_";break;case"2028":z+="\\L";break;case"2029":z+="\\P";break;default:if(B.substr(0,2)==="00")z+="\\x"+B.substr(2);else z+=X.substr(U,6)}U+=5,H=U+1}break;case"n":if(J||X[U+2]==='"'||X.length<$)U+=1;else{z+=X.slice(H,U)+`
39
39
 
40
40
  `;while(X[U+2]==="\\"&&X[U+3]==="n"&&X[U+4]!=='"')z+=`
41
- `,U+=2;if(z+=Q,X[U+2]===" ")z+="\\";U+=1,H=U+1}break;default:U+=1}}return z=H?z+X.slice(H):X,J?z:Z1.foldFlowLines(z,Q,Z1.FOLD_QUOTED,k0(Z,!1))}function X9(q,Z){if(Z.options.singleQuote===!1||Z.implicitKey&&q.includes(`
42
- `)||/[ \t]\n|\n[ \t]/.test(q))return i1(q,Z);let X=Z.indent||(v0(q)?" ":""),J="'"+q.replace(/'/g,"''").replace(/\n+/g,`$&
43
- ${X}`)+"'";return Z.implicitKey?J:Z1.foldFlowLines(J,X,Z1.FOLD_FLOW,k0(Z,!1))}function b1(q,Z){let{singleQuote:X}=Z.options,J;if(X===!1)J=i1;else{let $=q.includes('"'),Q=q.includes("'");if($&&!Q)J=X9;else if(Q&&!$)J=i1;else J=X?X9:i1}return J(q,Z)}var J9;try{J9=new RegExp(`(^|(?<!
41
+ `,U+=2;if(z+=Q,X[U+2]===" ")z+="\\";U+=1,H=U+1}break;default:U+=1}}return z=H?z+X.slice(H):X,J?z:X1.foldFlowLines(z,Q,X1.FOLD_QUOTED,v0(Z,!1))}function Z9(q,Z){if(Z.options.singleQuote===!1||Z.implicitKey&&q.includes(`
42
+ `)||/[ \t]\n|\n[ \t]/.test(q))return a1(q,Z);let X=Z.indent||(g0(q)?" ":""),J="'"+q.replace(/'/g,"''").replace(/\n+/g,`$&
43
+ ${X}`)+"'";return Z.implicitKey?J:X1.foldFlowLines(J,X,X1.FOLD_FLOW,v0(Z,!1))}function b1(q,Z){let{singleQuote:X}=Z.options,J;if(X===!1)J=a1;else{let $=q.includes('"'),Q=q.includes("'");if($&&!Q)J=Z9;else if(Q&&!$)J=a1;else J=X?Z9:a1}return J(q,Z)}var X9;try{X9=new RegExp(`(^|(?<!
44
44
  ))
45
45
  +(?!
46
- |$)`,"g")}catch{J9=/\n+(?!\n|$)/g}function x0({comment:q,type:Z,value:X},J,$,Q){let{blockQuote:z,commentString:H,lineWidth:U}=J.options;if(!z||/\n[\t ]+$/.test(X))return b1(X,J);let G=J.indent||(J.forceBlockIndent||v0(X)?" ":""),Y=z==="literal"?!0:z==="folded"||Z===d.Scalar.BLOCK_FOLDED?!1:Z===d.Scalar.BLOCK_LITERAL?!0:!GZ(X,U,G.length);if(!X)return Y?`|
46
+ |$)`,"g")}catch{X9=/\n+(?!\n|$)/g}function k0({comment:q,type:Z,value:X},J,$,Q){let{blockQuote:z,commentString:H,lineWidth:U}=J.options;if(!z||/\n[\t ]+$/.test(X))return b1(X,J);let G=J.indent||(J.forceBlockIndent||g0(X)?" ":""),B=z==="literal"?!0:z==="folded"||Z===d.Scalar.BLOCK_FOLDED?!1:Z===d.Scalar.BLOCK_LITERAL?!0:!GZ(X,U,G.length);if(!X)return B?`|
47
47
  `:`>
48
- `;let B,_;for(_=X.length;_>0;--_){let N=X[_-1];if(N!==`
49
- `&&N!=="\t"&&N!==" ")break}let V=X.substring(_),R=V.indexOf(`
50
- `);if(R===-1)B="-";else if(X===V||R!==V.length-1){if(B="+",Q)Q()}else B="";if(V){if(X=X.slice(0,-V.length),V[V.length-1]===`
51
- `)V=V.slice(0,-1);V=V.replace(J9,`$&${G}`)}let T=!1,W,I=-1;for(W=0;W<X.length;++W){let N=X[W];if(N===" ")T=!0;else if(N===`
52
- `)I=W;else break}let M=X.substring(0,I<W?I+1:W);if(M)X=X.substring(M.length),M=M.replace(/\n+/g,`$&${G}`);let O=(T?G?"2":"1":"")+B;if(q){if(O+=" "+H(q.replace(/ ?[\r\n]+/g," ")),$)$()}if(!Y){let N=X.replace(/\n+/g,`
53
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${G}`),A=!1,K=k0(J,!0);if(z!=="folded"&&Z!==d.Scalar.BLOCK_FOLDED)K.onOverflow=()=>{A=!0};let L=Z1.foldFlowLines(`${M}${N}${V}`,G,Z1.FOLD_BLOCK,K);if(!A)return`>${O}
54
- ${G}${L}`}return X=X.replace(/\n+/g,`$&${G}`),`|${O}
55
- ${G}${M}${X}${V}`}function YZ(q,Z,X,J){let{type:$,value:Q}=q,{actualString:z,implicitKey:H,indent:U,indentStep:G,inFlow:Y}=Z;if(H&&Q.includes(`
56
- `)||Y&&/[[\]{},]/.test(Q))return b1(Q,Z);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(Q))return H||Y||!Q.includes(`
57
- `)?b1(Q,Z):x0(q,Z,X,J);if(!H&&!Y&&$!==d.Scalar.PLAIN&&Q.includes(`
58
- `))return x0(q,Z,X,J);if(v0(Q)){if(U==="")return Z.forceBlockIndent=!0,x0(q,Z,X,J);else if(H&&U===G)return b1(Q,Z)}let B=Q.replace(/\n+/g,`$&
59
- ${U}`);if(z){let _=(T)=>T.default&&T.tag!=="tag:yaml.org,2002:str"&&T.test?.test(B),{compat:V,tags:R}=Z.doc.schema;if(R.some(_)||V?.some(_))return b1(Q,Z)}return H?B:Z1.foldFlowLines(B,U,Z1.FOLD_FLOW,k0(Z,!1))}function BZ(q,Z,X,J){let{implicitKey:$,inFlow:Q}=Z,z=typeof q.value==="string"?q:Object.assign({},q,{value:String(q.value)}),{type:H}=q;if(H!==d.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(z.value))H=d.Scalar.QUOTE_DOUBLE}let U=(Y)=>{switch(Y){case d.Scalar.BLOCK_FOLDED:case d.Scalar.BLOCK_LITERAL:return $||Q?b1(z.value,Z):x0(z,Z,X,J);case d.Scalar.QUOTE_DOUBLE:return i1(z.value,Z);case d.Scalar.QUOTE_SINGLE:return X9(z.value,Z);case d.Scalar.PLAIN:return YZ(z,Z,X,J);default:return null}},G=U(H);if(G===null){let{defaultKeyType:Y,defaultStringType:B}=Z.options,_=$&&Y||B;if(G=U(_),G===null)throw Error(`Unsupported default string type ${_}`)}return G}TZ.stringifyString=BZ});var s1=D((PZ)=>{var WZ=C0(),X1=S(),RZ=c1(),VZ=a1();function LZ(q,Z){let X=Object.assign({blockQuote:!0,commentString:RZ.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},q.schema.toStringOptions,Z),J;switch(X.collectionStyle){case"block":J=!1;break;case"flow":J=!0;break;default:J=null}return{anchors:new Set,doc:q,flowCollectionPadding:X.flowCollectionPadding?" ":"",indent:"",indentStep:typeof X.indent==="number"?" ".repeat(X.indent):" ",inFlow:J,options:X}}function IZ(q,Z){if(Z.tag){let $=q.filter((Q)=>Q.tag===Z.tag);if($.length>0)return $.find((Q)=>Q.format===Z.format)??$[0]}let X=void 0,J;if(X1.isScalar(Z)){J=Z.value;let $=q.filter((Q)=>Q.identify?.(J));if($.length>1){let Q=$.filter((z)=>z.test);if(Q.length>0)$=Q}X=$.find((Q)=>Q.format===Z.format)??$.find((Q)=>!Q.format)}else J=Z,X=q.find(($)=>$.nodeClass&&J instanceof $.nodeClass);if(!X){let $=J?.constructor?.name??(J===null?"null":typeof J);throw Error(`Tag not resolved for ${$} value`)}return X}function MZ(q,Z,{anchors:X,doc:J}){if(!J.directives)return"";let $=[],Q=(X1.isScalar(q)||X1.isCollection(q))&&q.anchor;if(Q&&WZ.anchorIsValid(Q))X.add(Q),$.push(`&${Q}`);let z=q.tag??(Z.default?null:Z.tag);if(z)$.push(J.directives.tagString(z));return $.join(" ")}function KZ(q,Z,X,J){if(X1.isPair(q))return q.toString(Z,X,J);if(X1.isAlias(q)){if(Z.doc.directives)return q.toString(Z);if(Z.resolvedAliases?.has(q))throw TypeError("Cannot stringify circular structure without alias nodes");else{if(Z.resolvedAliases)Z.resolvedAliases.add(q);else Z.resolvedAliases=new Set([q]);q=q.resolve(Z.doc)}}let $=void 0,Q=X1.isNode(q)?q:Z.doc.createNode(q,{onTagObj:(U)=>$=U});$??($=IZ(Z.doc.schema.tags,Q));let z=MZ(Q,$,Z);if(z.length>0)Z.indentAtStart=(Z.indentAtStart??0)+z.length+1;let H=typeof $.stringify==="function"?$.stringify(Q,Z,X,J):X1.isScalar(Q)?VZ.stringifyString(Q,Z,X,J):Q.toString(Z,X,J);if(!z)return H;return X1.isScalar(Q)||H[0]==="{"||H[0]==="["?`${z} ${H}`:`${z}
60
- ${Z.indent}${H}`}PZ.createStringifyContext=LZ;PZ.stringify=KZ});var y2=D((NZ)=>{var e=S(),E2=E(),f2=s1(),r1=c1();function OZ({key:q,value:Z},X,J,$){let{allNullValues:Q,doc:z,indent:H,indentStep:U,options:{commentString:G,indentSeq:Y,simpleKeys:B}}=X,_=e.isNode(q)&&q.comment||null;if(B){if(_)throw Error("With simple keys, key nodes cannot have comments");if(e.isCollection(q)||!e.isNode(q)&&typeof q==="object")throw Error("With simple keys, collection cannot be used as a key value")}let V=!B&&(!q||_&&Z==null&&!X.inFlow||e.isCollection(q)||(e.isScalar(q)?q.type===E2.Scalar.BLOCK_FOLDED||q.type===E2.Scalar.BLOCK_LITERAL:typeof q==="object"));X=Object.assign({},X,{allNullValues:!1,implicitKey:!V&&(B||!Q),indent:H+U});let R=!1,T=!1,W=f2.stringify(q,X,()=>R=!0,()=>T=!0);if(!V&&!X.inFlow&&W.length>1024){if(B)throw Error("With simple keys, single line scalar must not span more than 1024 characters");V=!0}if(X.inFlow){if(Q||Z==null){if(R&&J)J();return W===""?"?":V?`? ${W}`:W}}else if(Q&&!B||Z==null&&V){if(W=`? ${W}`,_&&!R)W+=r1.lineComment(W,X.indent,G(_));else if(T&&$)$();return W}if(R)_=null;if(V){if(_)W+=r1.lineComment(W,X.indent,G(_));W=`? ${W}
61
- ${H}:`}else if(W=`${W}:`,_)W+=r1.lineComment(W,X.indent,G(_));let I,M,P;if(e.isNode(Z))I=!!Z.spaceBefore,M=Z.commentBefore,P=Z.comment;else if(I=!1,M=null,P=null,Z&&typeof Z==="object")Z=z.createNode(Z);if(X.implicitKey=!1,!V&&!_&&e.isScalar(Z))X.indentAtStart=W.length+1;if(T=!1,!Y&&U.length>=2&&!X.inFlow&&!V&&e.isSeq(Z)&&!Z.flow&&!Z.tag&&!Z.anchor)X.indent=X.indent.substring(2);let O=!1,N=f2.stringify(Z,X,()=>O=!0,()=>T=!0),A=" ";if(_||I||M){if(A=I?`
48
+ `;let Y,_;for(_=X.length;_>0;--_){let N=X[_-1];if(N!==`
49
+ `&&N!=="\t"&&N!==" ")break}let R=X.substring(_),W=R.indexOf(`
50
+ `);if(W===-1)Y="-";else if(X===R||W!==R.length-1){if(Y="+",Q)Q()}else Y="";if(R){if(X=X.slice(0,-R.length),R[R.length-1]===`
51
+ `)R=R.slice(0,-1);R=R.replace(X9,`$&${G}`)}let T=!1,L,I=-1;for(L=0;L<X.length;++L){let N=X[L];if(N===" ")T=!0;else if(N===`
52
+ `)I=L;else break}let M=X.substring(0,I<L?I+1:L);if(M)X=X.substring(M.length),M=M.replace(/\n+/g,`$&${G}`);let O=(T?G?"2":"1":"")+Y;if(q){if(O+=" "+H(q.replace(/ ?[\r\n]+/g," ")),$)$()}if(!B){let N=X.replace(/\n+/g,`
53
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${G}`),A=!1,K=v0(J,!0);if(z!=="folded"&&Z!==d.Scalar.BLOCK_FOLDED)K.onOverflow=()=>{A=!0};let V=X1.foldFlowLines(`${M}${N}${R}`,G,X1.FOLD_BLOCK,K);if(!A)return`>${O}
54
+ ${G}${V}`}return X=X.replace(/\n+/g,`$&${G}`),`|${O}
55
+ ${G}${M}${X}${R}`}function YZ(q,Z,X,J){let{type:$,value:Q}=q,{actualString:z,implicitKey:H,indent:U,indentStep:G,inFlow:B}=Z;if(H&&Q.includes(`
56
+ `)||B&&/[[\]{},]/.test(Q))return b1(Q,Z);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(Q))return H||B||!Q.includes(`
57
+ `)?b1(Q,Z):k0(q,Z,X,J);if(!H&&!B&&$!==d.Scalar.PLAIN&&Q.includes(`
58
+ `))return k0(q,Z,X,J);if(g0(Q)){if(U==="")return Z.forceBlockIndent=!0,k0(q,Z,X,J);else if(H&&U===G)return b1(Q,Z)}let Y=Q.replace(/\n+/g,`$&
59
+ ${U}`);if(z){let _=(T)=>T.default&&T.tag!=="tag:yaml.org,2002:str"&&T.test?.test(Y),{compat:R,tags:W}=Z.doc.schema;if(W.some(_)||R?.some(_))return b1(Q,Z)}return H?Y:X1.foldFlowLines(Y,U,X1.FOLD_FLOW,v0(Z,!1))}function BZ(q,Z,X,J){let{implicitKey:$,inFlow:Q}=Z,z=typeof q.value==="string"?q:Object.assign({},q,{value:String(q.value)}),{type:H}=q;if(H!==d.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(z.value))H=d.Scalar.QUOTE_DOUBLE}let U=(B)=>{switch(B){case d.Scalar.BLOCK_FOLDED:case d.Scalar.BLOCK_LITERAL:return $||Q?b1(z.value,Z):k0(z,Z,X,J);case d.Scalar.QUOTE_DOUBLE:return a1(z.value,Z);case d.Scalar.QUOTE_SINGLE:return Z9(z.value,Z);case d.Scalar.PLAIN:return YZ(z,Z,X,J);default:return null}},G=U(H);if(G===null){let{defaultKeyType:B,defaultStringType:Y}=Z.options,_=$&&B||Y;if(G=U(_),G===null)throw Error(`Unsupported default string type ${_}`)}return G}TZ.stringifyString=BZ});var r1=P((DZ)=>{var LZ=C0(),J1=S(),WZ=i1(),RZ=s1();function VZ(q,Z){let X=Object.assign({blockQuote:!0,commentString:WZ.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},q.schema.toStringOptions,Z),J;switch(X.collectionStyle){case"block":J=!1;break;case"flow":J=!0;break;default:J=null}return{anchors:new Set,doc:q,flowCollectionPadding:X.flowCollectionPadding?" ":"",indent:"",indentStep:typeof X.indent==="number"?" ".repeat(X.indent):" ",inFlow:J,options:X}}function IZ(q,Z){if(Z.tag){let $=q.filter((Q)=>Q.tag===Z.tag);if($.length>0)return $.find((Q)=>Q.format===Z.format)??$[0]}let X=void 0,J;if(J1.isScalar(Z)){J=Z.value;let $=q.filter((Q)=>Q.identify?.(J));if($.length>1){let Q=$.filter((z)=>z.test);if(Q.length>0)$=Q}X=$.find((Q)=>Q.format===Z.format)??$.find((Q)=>!Q.format)}else J=Z,X=q.find(($)=>$.nodeClass&&J instanceof $.nodeClass);if(!X){let $=J?.constructor?.name??(J===null?"null":typeof J);throw Error(`Tag not resolved for ${$} value`)}return X}function MZ(q,Z,{anchors:X,doc:J}){if(!J.directives)return"";let $=[],Q=(J1.isScalar(q)||J1.isCollection(q))&&q.anchor;if(Q&&LZ.anchorIsValid(Q))X.add(Q),$.push(`&${Q}`);let z=q.tag??(Z.default?null:Z.tag);if(z)$.push(J.directives.tagString(z));return $.join(" ")}function KZ(q,Z,X,J){if(J1.isPair(q))return q.toString(Z,X,J);if(J1.isAlias(q)){if(Z.doc.directives)return q.toString(Z);if(Z.resolvedAliases?.has(q))throw TypeError("Cannot stringify circular structure without alias nodes");else{if(Z.resolvedAliases)Z.resolvedAliases.add(q);else Z.resolvedAliases=new Set([q]);q=q.resolve(Z.doc)}}let $=void 0,Q=J1.isNode(q)?q:Z.doc.createNode(q,{onTagObj:(U)=>$=U});$??($=IZ(Z.doc.schema.tags,Q));let z=MZ(Q,$,Z);if(z.length>0)Z.indentAtStart=(Z.indentAtStart??0)+z.length+1;let H=typeof $.stringify==="function"?$.stringify(Q,Z,X,J):J1.isScalar(Q)?RZ.stringifyString(Q,Z,X,J):Q.toString(Z,X,J);if(!z)return H;return J1.isScalar(Q)||H[0]==="{"||H[0]==="["?`${z} ${H}`:`${z}
60
+ ${Z.indent}${H}`}DZ.createStringifyContext=VZ;DZ.stringify=KZ});var f2=P((NZ)=>{var e=S(),E2=C(),C2=r1(),n1=i1();function OZ({key:q,value:Z},X,J,$){let{allNullValues:Q,doc:z,indent:H,indentStep:U,options:{commentString:G,indentSeq:B,simpleKeys:Y}}=X,_=e.isNode(q)&&q.comment||null;if(Y){if(_)throw Error("With simple keys, key nodes cannot have comments");if(e.isCollection(q)||!e.isNode(q)&&typeof q==="object")throw Error("With simple keys, collection cannot be used as a key value")}let R=!Y&&(!q||_&&Z==null&&!X.inFlow||e.isCollection(q)||(e.isScalar(q)?q.type===E2.Scalar.BLOCK_FOLDED||q.type===E2.Scalar.BLOCK_LITERAL:typeof q==="object"));X=Object.assign({},X,{allNullValues:!1,implicitKey:!R&&(Y||!Q),indent:H+U});let W=!1,T=!1,L=C2.stringify(q,X,()=>W=!0,()=>T=!0);if(!R&&!X.inFlow&&L.length>1024){if(Y)throw Error("With simple keys, single line scalar must not span more than 1024 characters");R=!0}if(X.inFlow){if(Q||Z==null){if(W&&J)J();return L===""?"?":R?`? ${L}`:L}}else if(Q&&!Y||Z==null&&R){if(L=`? ${L}`,_&&!W)L+=n1.lineComment(L,X.indent,G(_));else if(T&&$)$();return L}if(W)_=null;if(R){if(_)L+=n1.lineComment(L,X.indent,G(_));L=`? ${L}
61
+ ${H}:`}else if(L=`${L}:`,_)L+=n1.lineComment(L,X.indent,G(_));let I,M,D;if(e.isNode(Z))I=!!Z.spaceBefore,M=Z.commentBefore,D=Z.comment;else if(I=!1,M=null,D=null,Z&&typeof Z==="object")Z=z.createNode(Z);if(X.implicitKey=!1,!R&&!_&&e.isScalar(Z))X.indentAtStart=L.length+1;if(T=!1,!B&&U.length>=2&&!X.inFlow&&!R&&e.isSeq(Z)&&!Z.flow&&!Z.tag&&!Z.anchor)X.indent=X.indent.substring(2);let O=!1,N=C2.stringify(Z,X,()=>O=!0,()=>T=!0),A=" ";if(_||I||M){if(A=I?`
62
62
  `:"",M){let K=G(M);A+=`
63
- ${r1.indentComment(K,X.indent)}`}if(N===""&&!X.inFlow){if(A===`
64
- `&&P)A=`
63
+ ${n1.indentComment(K,X.indent)}`}if(N===""&&!X.inFlow){if(A===`
64
+ `&&D)A=`
65
65
 
66
66
  `}else A+=`
67
- ${X.indent}`}else if(!V&&e.isCollection(Z)){let K=N[0],L=N.indexOf(`
68
- `),w=L!==-1,y=X.inFlow??Z.flow??Z.items.length===0;if(w||!y){let x=!1;if(w&&(K==="&"||K==="!")){let C=N.indexOf(" ");if(K==="&"&&C!==-1&&C<L&&N[C+1]==="!")C=N.indexOf(" ",C+1);if(C===-1||L<C)x=!0}if(!x)A=`
67
+ ${X.indent}`}else if(!R&&e.isCollection(Z)){let K=N[0],V=N.indexOf(`
68
+ `),w=V!==-1,x=X.inFlow??Z.flow??Z.items.length===0;if(w||!x){let y=!1;if(w&&(K==="&"||K==="!")){let E=N.indexOf(" ");if(K==="&"&&E!==-1&&E<V&&N[E+1]==="!")E=N.indexOf(" ",E+1);if(E===-1||V<E)y=!0}if(!y)A=`
69
69
  ${X.indent}`}}else if(N===""||N[0]===`
70
- `)A="";if(W+=A+N,X.inFlow){if(O&&J)J()}else if(P&&!O)W+=r1.lineComment(W,X.indent,G(P));else if(T&&$)$();return W}NZ.stringifyPair=OZ});var $9=D((bZ)=>{var x2=r("process");function SZ(q,...Z){if(q==="debug")console.log(...Z)}function wZ(q,Z){if(q==="debug"||q==="warn")if(typeof x2.emitWarning==="function")x2.emitWarning(Z);else console.warn(Z)}bZ.debug=SZ;bZ.warn=wZ});var u0=D((fZ)=>{var n1=S(),k2=E(),g0="<<",h0={identify:(q)=>q===g0||typeof q==="symbol"&&q.description===g0,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new k2.Scalar(Symbol(g0)),{addToJSMap:v2}),stringify:()=>g0},EZ=(q,Z)=>(h0.identify(Z)||n1.isScalar(Z)&&(!Z.type||Z.type===k2.Scalar.PLAIN)&&h0.identify(Z.value))&&q?.doc.schema.tags.some((X)=>X.tag===h0.tag&&X.default);function v2(q,Z,X){if(X=q&&n1.isAlias(X)?X.resolve(q.doc):X,n1.isSeq(X))for(let J of X.items)Q9(q,Z,J);else if(Array.isArray(X))for(let J of X)Q9(q,Z,J);else Q9(q,Z,X)}function Q9(q,Z,X){let J=q&&n1.isAlias(X)?X.resolve(q.doc):X;if(!n1.isMap(J))throw Error("Merge sources must be maps or map aliases");let $=J.toJSON(null,q,Map);for(let[Q,z]of $)if(Z instanceof Map){if(!Z.has(Q))Z.set(Q,z)}else if(Z instanceof Set)Z.add(Q);else if(!Object.prototype.hasOwnProperty.call(Z,Q))Object.defineProperty(Z,Q,{value:z,writable:!0,enumerable:!0,configurable:!0});return Z}fZ.addMergeToJSMap=v2;fZ.isMergeKey=EZ;fZ.merge=h0});var H9=D((mZ)=>{var vZ=$9(),g2=u0(),gZ=s1(),h2=S(),z9=q1();function hZ(q,Z,{key:X,value:J}){if(h2.isNode(X)&&X.addToJSMap)X.addToJSMap(q,Z,J);else if(g2.isMergeKey(q,X))g2.addMergeToJSMap(q,Z,J);else{let $=z9.toJS(X,"",q);if(Z instanceof Map)Z.set($,z9.toJS(J,$,q));else if(Z instanceof Set)Z.add($);else{let Q=uZ(X,$,q),z=z9.toJS(J,Q,q);if(Q in Z)Object.defineProperty(Z,Q,{value:z,writable:!0,enumerable:!0,configurable:!0});else Z[Q]=z}}return Z}function uZ(q,Z,X){if(Z===null)return"";if(typeof Z!=="object")return String(Z);if(h2.isNode(q)&&X?.doc){let J=gZ.createStringifyContext(X.doc,{});J.anchors=new Set;for(let Q of X.anchors.keys())J.anchors.add(Q.anchor);J.inFlow=!0,J.inStringifyKey=!0;let $=q.toString(J);if(!X.mapKeyWarned){let Q=JSON.stringify($);if(Q.length>40)Q=Q.substring(0,36)+'..."';vZ.warn(X.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${Q}. Set mapAsMap: true to use object keys.`),X.mapKeyWarned=!0}return $}return JSON.stringify(Z)}mZ.addPairToJSMap=hZ});var J1=D((iZ)=>{var u2=p1(),lZ=y2(),pZ=H9(),m0=S();function cZ(q,Z,X){let J=u2.createNode(q,void 0,X),$=u2.createNode(Z,void 0,X);return new d0(J,$)}class d0{constructor(q,Z=null){Object.defineProperty(this,m0.NODE_TYPE,{value:m0.PAIR}),this.key=q,this.value=Z}clone(q){let{key:Z,value:X}=this;if(m0.isNode(Z))Z=Z.clone(q);if(m0.isNode(X))X=X.clone(q);return new d0(Z,X)}toJSON(q,Z){let X=Z?.mapAsMap?new Map:{};return pZ.addPairToJSMap(Z,X,this)}toString(q,Z,X){return q?.doc?lZ.stringifyPair(this,q,Z,X):JSON.stringify(this)}}iZ.Pair=d0;iZ.createPair=cZ});var U9=D((tZ)=>{var I1=S(),m2=s1(),l0=c1();function rZ(q,Z,X){return(Z.inFlow??q.flow?oZ:nZ)(q,Z,X)}function nZ({comment:q,items:Z},X,{blockItemPrefix:J,flowChars:$,itemIndent:Q,onChompKeep:z,onComment:H}){let{indent:U,options:{commentString:G}}=X,Y=Object.assign({},X,{indent:Q,type:null}),B=!1,_=[];for(let R=0;R<Z.length;++R){let T=Z[R],W=null;if(I1.isNode(T)){if(!B&&T.spaceBefore)_.push("");if(p0(X,_,T.commentBefore,B),T.comment)W=T.comment}else if(I1.isPair(T)){let M=I1.isNode(T.key)?T.key:null;if(M){if(!B&&M.spaceBefore)_.push("");p0(X,_,M.commentBefore,B)}}B=!1;let I=m2.stringify(T,Y,()=>W=null,()=>B=!0);if(W)I+=l0.lineComment(I,Q,G(W));if(B&&W)B=!1;_.push(J+I)}let V;if(_.length===0)V=$.start+$.end;else{V=_[0];for(let R=1;R<_.length;++R){let T=_[R];V+=T?`
70
+ `)A="";if(L+=A+N,X.inFlow){if(O&&J)J()}else if(D&&!O)L+=n1.lineComment(L,X.indent,G(D));else if(T&&$)$();return L}NZ.stringifyPair=OZ});var J9=P((bZ)=>{var x2=r("process");function SZ(q,...Z){if(q==="debug")console.log(...Z)}function wZ(q,Z){if(q==="debug"||q==="warn")if(typeof x2.emitWarning==="function")x2.emitWarning(Z);else console.warn(Z)}bZ.debug=SZ;bZ.warn=wZ});var m0=P((fZ)=>{var o1=S(),y2=C(),h0="<<",u0={identify:(q)=>q===h0||typeof q==="symbol"&&q.description===h0,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new y2.Scalar(Symbol(h0)),{addToJSMap:k2}),stringify:()=>h0},CZ=(q,Z)=>(u0.identify(Z)||o1.isScalar(Z)&&(!Z.type||Z.type===y2.Scalar.PLAIN)&&u0.identify(Z.value))&&q?.doc.schema.tags.some((X)=>X.tag===u0.tag&&X.default);function k2(q,Z,X){if(X=q&&o1.isAlias(X)?X.resolve(q.doc):X,o1.isSeq(X))for(let J of X.items)$9(q,Z,J);else if(Array.isArray(X))for(let J of X)$9(q,Z,J);else $9(q,Z,X)}function $9(q,Z,X){let J=q&&o1.isAlias(X)?X.resolve(q.doc):X;if(!o1.isMap(J))throw Error("Merge sources must be maps or map aliases");let $=J.toJSON(null,q,Map);for(let[Q,z]of $)if(Z instanceof Map){if(!Z.has(Q))Z.set(Q,z)}else if(Z instanceof Set)Z.add(Q);else if(!Object.prototype.hasOwnProperty.call(Z,Q))Object.defineProperty(Z,Q,{value:z,writable:!0,enumerable:!0,configurable:!0});return Z}fZ.addMergeToJSMap=k2;fZ.isMergeKey=CZ;fZ.merge=u0});var z9=P((mZ)=>{var vZ=J9(),v2=m0(),gZ=r1(),g2=S(),Q9=Z1();function hZ(q,Z,{key:X,value:J}){if(g2.isNode(X)&&X.addToJSMap)X.addToJSMap(q,Z,J);else if(v2.isMergeKey(q,X))v2.addMergeToJSMap(q,Z,J);else{let $=Q9.toJS(X,"",q);if(Z instanceof Map)Z.set($,Q9.toJS(J,$,q));else if(Z instanceof Set)Z.add($);else{let Q=uZ(X,$,q),z=Q9.toJS(J,Q,q);if(Q in Z)Object.defineProperty(Z,Q,{value:z,writable:!0,enumerable:!0,configurable:!0});else Z[Q]=z}}return Z}function uZ(q,Z,X){if(Z===null)return"";if(typeof Z!=="object")return String(Z);if(g2.isNode(q)&&X?.doc){let J=gZ.createStringifyContext(X.doc,{});J.anchors=new Set;for(let Q of X.anchors.keys())J.anchors.add(Q.anchor);J.inFlow=!0,J.inStringifyKey=!0;let $=q.toString(J);if(!X.mapKeyWarned){let Q=JSON.stringify($);if(Q.length>40)Q=Q.substring(0,36)+'..."';vZ.warn(X.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${Q}. Set mapAsMap: true to use object keys.`),X.mapKeyWarned=!0}return $}return JSON.stringify(Z)}mZ.addPairToJSMap=hZ});var $1=P((iZ)=>{var h2=c1(),lZ=f2(),pZ=z9(),d0=S();function cZ(q,Z,X){let J=h2.createNode(q,void 0,X),$=h2.createNode(Z,void 0,X);return new l0(J,$)}class l0{constructor(q,Z=null){Object.defineProperty(this,d0.NODE_TYPE,{value:d0.PAIR}),this.key=q,this.value=Z}clone(q){let{key:Z,value:X}=this;if(d0.isNode(Z))Z=Z.clone(q);if(d0.isNode(X))X=X.clone(q);return new l0(Z,X)}toJSON(q,Z){let X=Z?.mapAsMap?new Map:{};return pZ.addPairToJSMap(Z,X,this)}toString(q,Z,X){return q?.doc?lZ.stringifyPair(this,q,Z,X):JSON.stringify(this)}}iZ.Pair=l0;iZ.createPair=cZ});var H9=P((tZ)=>{var I1=S(),u2=r1(),p0=i1();function rZ(q,Z,X){return(Z.inFlow??q.flow?oZ:nZ)(q,Z,X)}function nZ({comment:q,items:Z},X,{blockItemPrefix:J,flowChars:$,itemIndent:Q,onChompKeep:z,onComment:H}){let{indent:U,options:{commentString:G}}=X,B=Object.assign({},X,{indent:Q,type:null}),Y=!1,_=[];for(let W=0;W<Z.length;++W){let T=Z[W],L=null;if(I1.isNode(T)){if(!Y&&T.spaceBefore)_.push("");if(c0(X,_,T.commentBefore,Y),T.comment)L=T.comment}else if(I1.isPair(T)){let M=I1.isNode(T.key)?T.key:null;if(M){if(!Y&&M.spaceBefore)_.push("");c0(X,_,M.commentBefore,Y)}}Y=!1;let I=u2.stringify(T,B,()=>L=null,()=>Y=!0);if(L)I+=p0.lineComment(I,Q,G(L));if(Y&&L)Y=!1;_.push(J+I)}let R;if(_.length===0)R=$.start+$.end;else{R=_[0];for(let W=1;W<_.length;++W){let T=_[W];R+=T?`
71
71
  ${U}${T}`:`
72
- `}}if(q){if(V+=`
73
- `+l0.indentComment(G(q),U),H)H()}else if(B&&z)z();return V}function oZ({items:q},Z,{flowChars:X,itemIndent:J}){let{indent:$,indentStep:Q,flowCollectionPadding:z,options:{commentString:H}}=Z;J+=Q;let U=Object.assign({},Z,{indent:J,inFlow:!0,type:null}),G=!1,Y=0,B=[];for(let R=0;R<q.length;++R){let T=q[R],W=null;if(I1.isNode(T)){if(T.spaceBefore)B.push("");if(p0(Z,B,T.commentBefore,!1),T.comment)W=T.comment}else if(I1.isPair(T)){let M=I1.isNode(T.key)?T.key:null;if(M){if(M.spaceBefore)B.push("");if(p0(Z,B,M.commentBefore,!1),M.comment)G=!0}let P=I1.isNode(T.value)?T.value:null;if(P){if(P.comment)W=P.comment;if(P.commentBefore)G=!0}else if(T.value==null&&M?.comment)W=M.comment}if(W)G=!0;let I=m2.stringify(T,U,()=>W=null);if(R<q.length-1)I+=",";if(W)I+=l0.lineComment(I,J,H(W));if(!G&&(B.length>Y||I.includes(`
74
- `)))G=!0;B.push(I),Y=B.length}let{start:_,end:V}=X;if(B.length===0)return _+V;else{if(!G){let R=B.reduce((T,W)=>T+W.length+2,2);G=Z.options.lineWidth>0&&R>Z.options.lineWidth}if(G){let R=_;for(let T of B)R+=T?`
72
+ `}}if(q){if(R+=`
73
+ `+p0.indentComment(G(q),U),H)H()}else if(Y&&z)z();return R}function oZ({items:q},Z,{flowChars:X,itemIndent:J}){let{indent:$,indentStep:Q,flowCollectionPadding:z,options:{commentString:H}}=Z;J+=Q;let U=Object.assign({},Z,{indent:J,inFlow:!0,type:null}),G=!1,B=0,Y=[];for(let W=0;W<q.length;++W){let T=q[W],L=null;if(I1.isNode(T)){if(T.spaceBefore)Y.push("");if(c0(Z,Y,T.commentBefore,!1),T.comment)L=T.comment}else if(I1.isPair(T)){let M=I1.isNode(T.key)?T.key:null;if(M){if(M.spaceBefore)Y.push("");if(c0(Z,Y,M.commentBefore,!1),M.comment)G=!0}let D=I1.isNode(T.value)?T.value:null;if(D){if(D.comment)L=D.comment;if(D.commentBefore)G=!0}else if(T.value==null&&M?.comment)L=M.comment}if(L)G=!0;let I=u2.stringify(T,U,()=>L=null);if(W<q.length-1)I+=",";if(L)I+=p0.lineComment(I,J,H(L));if(!G&&(Y.length>B||I.includes(`
74
+ `)))G=!0;Y.push(I),B=Y.length}let{start:_,end:R}=X;if(Y.length===0)return _+R;else{if(!G){let W=Y.reduce((T,L)=>T+L.length+2,2);G=Z.options.lineWidth>0&&W>Z.options.lineWidth}if(G){let W=_;for(let T of Y)W+=T?`
75
75
  ${Q}${$}${T}`:`
76
- `;return`${R}
77
- ${$}${V}`}else return`${_}${z}${B.join(" ")}${z}${V}`}}function p0({indent:q,options:{commentString:Z}},X,J,$){if(J&&$)J=J.replace(/^\n+/,"");if(J){let Q=l0.indentComment(Z(J),q);X.push(Q.trimStart())}}tZ.stringifyCollection=rZ});var Q1=D(($X)=>{var qX=U9(),ZX=H9(),XX=y0(),$1=S(),c0=J1(),JX=E();function o1(q,Z){let X=$1.isScalar(Z)?Z.value:Z;for(let J of q)if($1.isPair(J)){if(J.key===Z||J.key===X)return J;if($1.isScalar(J.key)&&J.key.value===X)return J}return}class d2 extends XX.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(q){super($1.MAP,q);this.items=[]}static from(q,Z,X){let{keepUndefined:J,replacer:$}=X,Q=new this(q),z=(H,U)=>{if(typeof $==="function")U=$.call(Z,H,U);else if(Array.isArray($)&&!$.includes(H))return;if(U!==void 0||J)Q.items.push(c0.createPair(H,U,X))};if(Z instanceof Map)for(let[H,U]of Z)z(H,U);else if(Z&&typeof Z==="object")for(let H of Object.keys(Z))z(H,Z[H]);if(typeof q.sortMapEntries==="function")Q.items.sort(q.sortMapEntries);return Q}add(q,Z){let X;if($1.isPair(q))X=q;else if(!q||typeof q!=="object"||!("key"in q))X=new c0.Pair(q,q?.value);else X=new c0.Pair(q.key,q.value);let J=o1(this.items,X.key),$=this.schema?.sortMapEntries;if(J){if(!Z)throw Error(`Key ${X.key} already set`);if($1.isScalar(J.value)&&JX.isScalarValue(X.value))J.value.value=X.value;else J.value=X.value}else if($){let Q=this.items.findIndex((z)=>$(X,z)<0);if(Q===-1)this.items.push(X);else this.items.splice(Q,0,X)}else this.items.push(X)}delete(q){let Z=o1(this.items,q);if(!Z)return!1;return this.items.splice(this.items.indexOf(Z),1).length>0}get(q,Z){let J=o1(this.items,q)?.value;return(!Z&&$1.isScalar(J)?J.value:J)??void 0}has(q){return!!o1(this.items,q)}set(q,Z){this.add(new c0.Pair(q,Z),!0)}toJSON(q,Z,X){let J=X?new X:Z?.mapAsMap?new Map:{};if(Z?.onCreate)Z.onCreate(J);for(let $ of this.items)ZX.addPairToJSMap(Z,J,$);return J}toString(q,Z,X){if(!q)return JSON.stringify(this);for(let J of this.items)if(!$1.isPair(J))throw Error(`Map items must all be pairs; found ${JSON.stringify(J)} instead`);if(!q.allNullValues&&this.hasAllNullValues(!1))q=Object.assign({},q,{allNullValues:!0});return qX.stringifyCollection(this,q,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:q.indent||"",onChompKeep:X,onComment:Z})}}$X.YAMLMap=d2;$X.findPair=o1});var j1=D((GX)=>{var HX=S(),l2=Q1(),UX={collection:"map",default:!0,nodeClass:l2.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(q,Z){if(!HX.isMap(q))Z("Expected a mapping for this tag");return q},createNode:(q,Z,X)=>l2.YAMLMap.from(q,Z,X)};GX.map=UX});var z1=D((VX)=>{var BX=p1(),TX=U9(),_X=y0(),a0=S(),WX=E(),RX=q1();class p2 extends _X.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(q){super(a0.SEQ,q);this.items=[]}add(q){this.items.push(q)}delete(q){let Z=i0(q);if(typeof Z!=="number")return!1;return this.items.splice(Z,1).length>0}get(q,Z){let X=i0(q);if(typeof X!=="number")return;let J=this.items[X];return!Z&&a0.isScalar(J)?J.value:J}has(q){let Z=i0(q);return typeof Z==="number"&&Z<this.items.length}set(q,Z){let X=i0(q);if(typeof X!=="number")throw Error(`Expected a valid index, not ${q}.`);let J=this.items[X];if(a0.isScalar(J)&&WX.isScalarValue(Z))J.value=Z;else this.items[X]=Z}toJSON(q,Z){let X=[];if(Z?.onCreate)Z.onCreate(X);let J=0;for(let $ of this.items)X.push(RX.toJS($,String(J++),Z));return X}toString(q,Z,X){if(!q)return JSON.stringify(this);return TX.stringifyCollection(this,q,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(q.indent||"")+" ",onChompKeep:X,onComment:Z})}static from(q,Z,X){let{replacer:J}=X,$=new this(q);if(Z&&Symbol.iterator in Object(Z)){let Q=0;for(let z of Z){if(typeof J==="function"){let H=Z instanceof Set?z:String(Q++);z=J.call(Z,H,z)}$.items.push(BX.createNode(z,void 0,X))}}return $}}function i0(q){let Z=a0.isScalar(q)?q.value:q;if(Z&&typeof Z==="string")Z=Number(Z);return typeof Z==="number"&&Number.isInteger(Z)&&Z>=0?Z:null}VX.YAMLSeq=p2});var C1=D((KX)=>{var IX=S(),c2=z1(),MX={collection:"seq",default:!0,nodeClass:c2.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(q,Z){if(!IX.isSeq(q))Z("Expected a sequence for this tag");return q},createNode:(q,Z,X)=>c2.YAMLSeq.from(q,Z,X)};KX.seq=MX});var t1=D((OX)=>{var DX=a1(),FX={identify:(q)=>typeof q==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(q)=>q,stringify(q,Z,X,J){return Z=Object.assign({actualString:!0},Z),DX.stringifyString(q,Z,X,J)}};OX.string=FX});var s0=D((AX)=>{var i2=E(),a2={identify:(q)=>q==null,createNode:()=>new i2.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new i2.Scalar(null),stringify:({source:q},Z)=>typeof q==="string"&&a2.test.test(q)?q:Z.options.nullStr};AX.nullTag=a2});var G9=D((bX)=>{var wX=E(),s2={identify:(q)=>typeof q==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:(q)=>new wX.Scalar(q[0]==="t"||q[0]==="T"),stringify({source:q,value:Z},X){if(q&&s2.test.test(q)){let J=q[0]==="t"||q[0]==="T";if(Z===J)return q}return Z?X.options.trueStr:X.options.falseStr}};bX.boolTag=s2});var E1=D((EX)=>{function CX({format:q,minFractionDigits:Z,tag:X,value:J}){if(typeof J==="bigint")return String(J);let $=typeof J==="number"?J:Number(J);if(!isFinite($))return isNaN($)?".nan":$<0?"-.inf":".inf";let Q=Object.is(J,-0)?"-0":JSON.stringify(J);if(!q&&Z&&(!X||X==="tag:yaml.org,2002:float")&&/^\d/.test(Q)){let z=Q.indexOf(".");if(z<0)z=Q.length,Q+=".";let H=Z-(Q.length-z-1);while(H-- >0)Q+="0"}return Q}EX.stringifyNumber=CX});var B9=D((gX)=>{var yX=E(),Y9=E1(),xX={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(q)=>q.slice(-3).toLowerCase()==="nan"?NaN:q[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Y9.stringifyNumber},kX={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:(q)=>parseFloat(q),stringify(q){let Z=Number(q.value);return isFinite(Z)?Z.toExponential():Y9.stringifyNumber(q)}},vX={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(q){let Z=new yX.Scalar(parseFloat(q)),X=q.indexOf(".");if(X!==-1&&q[q.length-1]==="0")Z.minFractionDigits=q.length-X-1;return Z},stringify:Y9.stringifyNumber};gX.float=vX;gX.floatExp=kX;gX.floatNaN=xX});var _9=D((cX)=>{var r2=E1(),r0=(q)=>typeof q==="bigint"||Number.isInteger(q),T9=(q,Z,X,{intAsBigInt:J})=>J?BigInt(q):parseInt(q.substring(Z),X);function n2(q,Z,X){let{value:J}=q;if(r0(J)&&J>=0)return X+J.toString(Z);return r2.stringifyNumber(q)}var dX={identify:(q)=>r0(q)&&q>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(q,Z,X)=>T9(q,2,8,X),stringify:(q)=>n2(q,8,"0o")},lX={identify:r0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(q,Z,X)=>T9(q,0,10,X),stringify:r2.stringifyNumber},pX={identify:(q)=>r0(q)&&q>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(q,Z,X)=>T9(q,2,16,X),stringify:(q)=>n2(q,16,"0x")};cX.int=lX;cX.intHex=pX;cX.intOct=dX});var o2=D((ZJ)=>{var rX=j1(),nX=s0(),oX=C1(),tX=t1(),eX=G9(),W9=B9(),R9=_9(),qJ=[rX.map,oX.seq,tX.string,nX.nullTag,eX.boolTag,R9.intOct,R9.int,R9.intHex,W9.floatNaN,W9.floatExp,W9.float];ZJ.schema=qJ});var e2=D((GJ)=>{var JJ=E(),$J=j1(),QJ=C1();function t2(q){return typeof q==="bigint"||Number.isInteger(q)}var n0=({value:q})=>JSON.stringify(q),zJ=[{identify:(q)=>typeof q==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(q)=>q,stringify:n0},{identify:(q)=>q==null,createNode:()=>new JJ.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:n0},{identify:(q)=>typeof q==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:(q)=>q==="true",stringify:n0},{identify:t2,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(q,Z,{intAsBigInt:X})=>X?BigInt(q):parseInt(q,10),stringify:({value:q})=>t2(q)?q.toString():JSON.stringify(q)},{identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:(q)=>parseFloat(q),stringify:n0}],HJ={default:!0,tag:"",test:/^/,resolve(q,Z){return Z(`Unresolved plain scalar ${JSON.stringify(q)}`),q}},UJ=[$J.map,QJ.seq].concat(zJ,HJ);GJ.schema=UJ});var L9=D((_J)=>{var e1=r("buffer"),V9=E(),BJ=a1(),TJ={identify:(q)=>q instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(q,Z){if(typeof e1.Buffer==="function")return e1.Buffer.from(q,"base64");else if(typeof atob==="function"){let X=atob(q.replace(/[\n\r]/g,"")),J=new Uint8Array(X.length);for(let $=0;$<X.length;++$)J[$]=X.charCodeAt($);return J}else return Z("This environment does not support reading binary tags; either Buffer or atob is required"),q},stringify({comment:q,type:Z,value:X},J,$,Q){if(!X)return"";let z=X,H;if(typeof e1.Buffer==="function")H=z instanceof e1.Buffer?z.toString("base64"):e1.Buffer.from(z.buffer).toString("base64");else if(typeof btoa==="function"){let U="";for(let G=0;G<z.length;++G)U+=String.fromCharCode(z[G]);H=btoa(U)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(Z??(Z=V9.Scalar.BLOCK_LITERAL),Z!==V9.Scalar.QUOTE_DOUBLE){let U=Math.max(J.options.lineWidth-J.indent.length,J.options.minContentWidth),G=Math.ceil(H.length/U),Y=Array(G);for(let B=0,_=0;B<G;++B,_+=U)Y[B]=H.substr(_,U);H=Y.join(Z===V9.Scalar.BLOCK_LITERAL?`
78
- `:" ")}return BJ.stringifyString({comment:q,type:Z,value:H},J,$,Q)}};_J.binary=TJ});var t0=D((IJ)=>{var o0=S(),I9=J1(),RJ=E(),VJ=z1();function q3(q,Z){if(o0.isSeq(q))for(let X=0;X<q.items.length;++X){let J=q.items[X];if(o0.isPair(J))continue;else if(o0.isMap(J)){if(J.items.length>1)Z("Each pair must have its own sequence indicator");let $=J.items[0]||new I9.Pair(new RJ.Scalar(null));if(J.commentBefore)$.key.commentBefore=$.key.commentBefore?`${J.commentBefore}
76
+ `;return`${W}
77
+ ${$}${R}`}else return`${_}${z}${Y.join(" ")}${z}${R}`}}function c0({indent:q,options:{commentString:Z}},X,J,$){if(J&&$)J=J.replace(/^\n+/,"");if(J){let Q=p0.indentComment(Z(J),q);X.push(Q.trimStart())}}tZ.stringifyCollection=rZ});var z1=P(($X)=>{var qX=H9(),ZX=z9(),XX=y0(),Q1=S(),i0=$1(),JX=C();function t1(q,Z){let X=Q1.isScalar(Z)?Z.value:Z;for(let J of q)if(Q1.isPair(J)){if(J.key===Z||J.key===X)return J;if(Q1.isScalar(J.key)&&J.key.value===X)return J}return}class m2 extends XX.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(q){super(Q1.MAP,q);this.items=[]}static from(q,Z,X){let{keepUndefined:J,replacer:$}=X,Q=new this(q),z=(H,U)=>{if(typeof $==="function")U=$.call(Z,H,U);else if(Array.isArray($)&&!$.includes(H))return;if(U!==void 0||J)Q.items.push(i0.createPair(H,U,X))};if(Z instanceof Map)for(let[H,U]of Z)z(H,U);else if(Z&&typeof Z==="object")for(let H of Object.keys(Z))z(H,Z[H]);if(typeof q.sortMapEntries==="function")Q.items.sort(q.sortMapEntries);return Q}add(q,Z){let X;if(Q1.isPair(q))X=q;else if(!q||typeof q!=="object"||!("key"in q))X=new i0.Pair(q,q?.value);else X=new i0.Pair(q.key,q.value);let J=t1(this.items,X.key),$=this.schema?.sortMapEntries;if(J){if(!Z)throw Error(`Key ${X.key} already set`);if(Q1.isScalar(J.value)&&JX.isScalarValue(X.value))J.value.value=X.value;else J.value=X.value}else if($){let Q=this.items.findIndex((z)=>$(X,z)<0);if(Q===-1)this.items.push(X);else this.items.splice(Q,0,X)}else this.items.push(X)}delete(q){let Z=t1(this.items,q);if(!Z)return!1;return this.items.splice(this.items.indexOf(Z),1).length>0}get(q,Z){let J=t1(this.items,q)?.value;return(!Z&&Q1.isScalar(J)?J.value:J)??void 0}has(q){return!!t1(this.items,q)}set(q,Z){this.add(new i0.Pair(q,Z),!0)}toJSON(q,Z,X){let J=X?new X:Z?.mapAsMap?new Map:{};if(Z?.onCreate)Z.onCreate(J);for(let $ of this.items)ZX.addPairToJSMap(Z,J,$);return J}toString(q,Z,X){if(!q)return JSON.stringify(this);for(let J of this.items)if(!Q1.isPair(J))throw Error(`Map items must all be pairs; found ${JSON.stringify(J)} instead`);if(!q.allNullValues&&this.hasAllNullValues(!1))q=Object.assign({},q,{allNullValues:!0});return qX.stringifyCollection(this,q,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:q.indent||"",onChompKeep:X,onComment:Z})}}$X.YAMLMap=m2;$X.findPair=t1});var j1=P((GX)=>{var HX=S(),d2=z1(),UX={collection:"map",default:!0,nodeClass:d2.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(q,Z){if(!HX.isMap(q))Z("Expected a mapping for this tag");return q},createNode:(q,Z,X)=>d2.YAMLMap.from(q,Z,X)};GX.map=UX});var H1=P((RX)=>{var BX=c1(),TX=H9(),_X=y0(),s0=S(),LX=C(),WX=Z1();class l2 extends _X.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(q){super(s0.SEQ,q);this.items=[]}add(q){this.items.push(q)}delete(q){let Z=a0(q);if(typeof Z!=="number")return!1;return this.items.splice(Z,1).length>0}get(q,Z){let X=a0(q);if(typeof X!=="number")return;let J=this.items[X];return!Z&&s0.isScalar(J)?J.value:J}has(q){let Z=a0(q);return typeof Z==="number"&&Z<this.items.length}set(q,Z){let X=a0(q);if(typeof X!=="number")throw Error(`Expected a valid index, not ${q}.`);let J=this.items[X];if(s0.isScalar(J)&&LX.isScalarValue(Z))J.value=Z;else this.items[X]=Z}toJSON(q,Z){let X=[];if(Z?.onCreate)Z.onCreate(X);let J=0;for(let $ of this.items)X.push(WX.toJS($,String(J++),Z));return X}toString(q,Z,X){if(!q)return JSON.stringify(this);return TX.stringifyCollection(this,q,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(q.indent||"")+" ",onChompKeep:X,onComment:Z})}static from(q,Z,X){let{replacer:J}=X,$=new this(q);if(Z&&Symbol.iterator in Object(Z)){let Q=0;for(let z of Z){if(typeof J==="function"){let H=Z instanceof Set?z:String(Q++);z=J.call(Z,H,z)}$.items.push(BX.createNode(z,void 0,X))}}return $}}function a0(q){let Z=s0.isScalar(q)?q.value:q;if(Z&&typeof Z==="string")Z=Number(Z);return typeof Z==="number"&&Number.isInteger(Z)&&Z>=0?Z:null}RX.YAMLSeq=l2});var E1=P((KX)=>{var IX=S(),p2=H1(),MX={collection:"seq",default:!0,nodeClass:p2.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(q,Z){if(!IX.isSeq(q))Z("Expected a sequence for this tag");return q},createNode:(q,Z,X)=>p2.YAMLSeq.from(q,Z,X)};KX.seq=MX});var e1=P((OX)=>{var PX=s1(),FX={identify:(q)=>typeof q==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(q)=>q,stringify(q,Z,X,J){return Z=Object.assign({actualString:!0},Z),PX.stringifyString(q,Z,X,J)}};OX.string=FX});var r0=P((AX)=>{var c2=C(),i2={identify:(q)=>q==null,createNode:()=>new c2.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new c2.Scalar(null),stringify:({source:q},Z)=>typeof q==="string"&&i2.test.test(q)?q:Z.options.nullStr};AX.nullTag=i2});var U9=P((bX)=>{var wX=C(),a2={identify:(q)=>typeof q==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:(q)=>new wX.Scalar(q[0]==="t"||q[0]==="T"),stringify({source:q,value:Z},X){if(q&&a2.test.test(q)){let J=q[0]==="t"||q[0]==="T";if(Z===J)return q}return Z?X.options.trueStr:X.options.falseStr}};bX.boolTag=a2});var C1=P((CX)=>{function EX({format:q,minFractionDigits:Z,tag:X,value:J}){if(typeof J==="bigint")return String(J);let $=typeof J==="number"?J:Number(J);if(!isFinite($))return isNaN($)?".nan":$<0?"-.inf":".inf";let Q=Object.is(J,-0)?"-0":JSON.stringify(J);if(!q&&Z&&(!X||X==="tag:yaml.org,2002:float")&&/^\d/.test(Q)){let z=Q.indexOf(".");if(z<0)z=Q.length,Q+=".";let H=Z-(Q.length-z-1);while(H-- >0)Q+="0"}return Q}CX.stringifyNumber=EX});var Y9=P((gX)=>{var xX=C(),G9=C1(),yX={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(q)=>q.slice(-3).toLowerCase()==="nan"?NaN:q[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:G9.stringifyNumber},kX={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:(q)=>parseFloat(q),stringify(q){let Z=Number(q.value);return isFinite(Z)?Z.toExponential():G9.stringifyNumber(q)}},vX={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(q){let Z=new xX.Scalar(parseFloat(q)),X=q.indexOf(".");if(X!==-1&&q[q.length-1]==="0")Z.minFractionDigits=q.length-X-1;return Z},stringify:G9.stringifyNumber};gX.float=vX;gX.floatExp=kX;gX.floatNaN=yX});var T9=P((cX)=>{var s2=C1(),n0=(q)=>typeof q==="bigint"||Number.isInteger(q),B9=(q,Z,X,{intAsBigInt:J})=>J?BigInt(q):parseInt(q.substring(Z),X);function r2(q,Z,X){let{value:J}=q;if(n0(J)&&J>=0)return X+J.toString(Z);return s2.stringifyNumber(q)}var dX={identify:(q)=>n0(q)&&q>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(q,Z,X)=>B9(q,2,8,X),stringify:(q)=>r2(q,8,"0o")},lX={identify:n0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(q,Z,X)=>B9(q,0,10,X),stringify:s2.stringifyNumber},pX={identify:(q)=>n0(q)&&q>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(q,Z,X)=>B9(q,2,16,X),stringify:(q)=>r2(q,16,"0x")};cX.int=lX;cX.intHex=pX;cX.intOct=dX});var n2=P((ZJ)=>{var rX=j1(),nX=r0(),oX=E1(),tX=e1(),eX=U9(),_9=Y9(),L9=T9(),qJ=[rX.map,oX.seq,tX.string,nX.nullTag,eX.boolTag,L9.intOct,L9.int,L9.intHex,_9.floatNaN,_9.floatExp,_9.float];ZJ.schema=qJ});var t2=P((GJ)=>{var JJ=C(),$J=j1(),QJ=E1();function o2(q){return typeof q==="bigint"||Number.isInteger(q)}var o0=({value:q})=>JSON.stringify(q),zJ=[{identify:(q)=>typeof q==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(q)=>q,stringify:o0},{identify:(q)=>q==null,createNode:()=>new JJ.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:o0},{identify:(q)=>typeof q==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:(q)=>q==="true",stringify:o0},{identify:o2,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(q,Z,{intAsBigInt:X})=>X?BigInt(q):parseInt(q,10),stringify:({value:q})=>o2(q)?q.toString():JSON.stringify(q)},{identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:(q)=>parseFloat(q),stringify:o0}],HJ={default:!0,tag:"",test:/^/,resolve(q,Z){return Z(`Unresolved plain scalar ${JSON.stringify(q)}`),q}},UJ=[$J.map,QJ.seq].concat(zJ,HJ);GJ.schema=UJ});var R9=P((_J)=>{var q0=r("buffer"),W9=C(),BJ=s1(),TJ={identify:(q)=>q instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(q,Z){if(typeof q0.Buffer==="function")return q0.Buffer.from(q,"base64");else if(typeof atob==="function"){let X=atob(q.replace(/[\n\r]/g,"")),J=new Uint8Array(X.length);for(let $=0;$<X.length;++$)J[$]=X.charCodeAt($);return J}else return Z("This environment does not support reading binary tags; either Buffer or atob is required"),q},stringify({comment:q,type:Z,value:X},J,$,Q){if(!X)return"";let z=X,H;if(typeof q0.Buffer==="function")H=z instanceof q0.Buffer?z.toString("base64"):q0.Buffer.from(z.buffer).toString("base64");else if(typeof btoa==="function"){let U="";for(let G=0;G<z.length;++G)U+=String.fromCharCode(z[G]);H=btoa(U)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(Z??(Z=W9.Scalar.BLOCK_LITERAL),Z!==W9.Scalar.QUOTE_DOUBLE){let U=Math.max(J.options.lineWidth-J.indent.length,J.options.minContentWidth),G=Math.ceil(H.length/U),B=Array(G);for(let Y=0,_=0;Y<G;++Y,_+=U)B[Y]=H.substr(_,U);H=B.join(Z===W9.Scalar.BLOCK_LITERAL?`
78
+ `:" ")}return BJ.stringifyString({comment:q,type:Z,value:H},J,$,Q)}};_J.binary=TJ});var e0=P((IJ)=>{var t0=S(),V9=$1(),WJ=C(),RJ=H1();function e2(q,Z){if(t0.isSeq(q))for(let X=0;X<q.items.length;++X){let J=q.items[X];if(t0.isPair(J))continue;else if(t0.isMap(J)){if(J.items.length>1)Z("Each pair must have its own sequence indicator");let $=J.items[0]||new V9.Pair(new WJ.Scalar(null));if(J.commentBefore)$.key.commentBefore=$.key.commentBefore?`${J.commentBefore}
79
79
  ${$.key.commentBefore}`:J.commentBefore;if(J.comment){let Q=$.value??$.key;Q.comment=Q.comment?`${J.comment}
80
- ${Q.comment}`:J.comment}J=$}q.items[X]=o0.isPair(J)?J:new I9.Pair(J)}else Z("Expected a sequence for this tag");return q}function Z3(q,Z,X){let{replacer:J}=X,$=new VJ.YAMLSeq(q);$.tag="tag:yaml.org,2002:pairs";let Q=0;if(Z&&Symbol.iterator in Object(Z))for(let z of Z){if(typeof J==="function")z=J.call(Z,String(Q++),z);let H,U;if(Array.isArray(z))if(z.length===2)H=z[0],U=z[1];else throw TypeError(`Expected [key, value] tuple: ${z}`);else if(z&&z instanceof Object){let G=Object.keys(z);if(G.length===1)H=G[0],U=z[H];else throw TypeError(`Expected tuple with one key, not ${G.length} keys`)}else H=z;$.items.push(I9.createPair(H,U,X))}return $}var LJ={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:q3,createNode:Z3};IJ.createPairs=Z3;IJ.pairs=LJ;IJ.resolvePairs=q3});var K9=D((OJ)=>{var X3=S(),M9=q1(),q0=Q1(),DJ=z1(),J3=t0();class M1 extends DJ.YAMLSeq{constructor(){super();this.add=q0.YAMLMap.prototype.add.bind(this),this.delete=q0.YAMLMap.prototype.delete.bind(this),this.get=q0.YAMLMap.prototype.get.bind(this),this.has=q0.YAMLMap.prototype.has.bind(this),this.set=q0.YAMLMap.prototype.set.bind(this),this.tag=M1.tag}toJSON(q,Z){if(!Z)return super.toJSON(q);let X=new Map;if(Z?.onCreate)Z.onCreate(X);for(let J of this.items){let $,Q;if(X3.isPair(J))$=M9.toJS(J.key,"",Z),Q=M9.toJS(J.value,$,Z);else $=M9.toJS(J,"",Z);if(X.has($))throw Error("Ordered maps must not include duplicate keys");X.set($,Q)}return X}static from(q,Z,X){let J=J3.createPairs(q,Z,X),$=new this;return $.items=J.items,$}}M1.tag="tag:yaml.org,2002:omap";var FJ={collection:"seq",identify:(q)=>q instanceof Map,nodeClass:M1,default:!1,tag:"tag:yaml.org,2002:omap",resolve(q,Z){let X=J3.resolvePairs(q,Z),J=[];for(let{key:$}of X.items)if(X3.isScalar($))if(J.includes($.value))Z(`Ordered maps must not include duplicate keys: ${$.value}`);else J.push($.value);return Object.assign(new M1,X)},createNode:(q,Z,X)=>M1.from(q,Z,X)};OJ.YAMLOMap=M1;OJ.omap=FJ});var U3=D((SJ)=>{var $3=E();function Q3({value:q,source:Z},X){if(Z&&(q?z3:H3).test.test(Z))return Z;return q?X.options.trueStr:X.options.falseStr}var z3={identify:(q)=>q===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new $3.Scalar(!0),stringify:Q3},H3={identify:(q)=>q===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new $3.Scalar(!1),stringify:Q3};SJ.falseTag=H3;SJ.trueTag=z3});var G3=D((yJ)=>{var jJ=E(),P9=E1(),CJ={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(q)=>q.slice(-3).toLowerCase()==="nan"?NaN:q[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:P9.stringifyNumber},EJ={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:(q)=>parseFloat(q.replace(/_/g,"")),stringify(q){let Z=Number(q.value);return isFinite(Z)?Z.toExponential():P9.stringifyNumber(q)}},fJ={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(q){let Z=new jJ.Scalar(parseFloat(q.replace(/_/g,""))),X=q.indexOf(".");if(X!==-1){let J=q.substring(X+1).replace(/_/g,"");if(J[J.length-1]==="0")Z.minFractionDigits=J.length}return Z},stringify:P9.stringifyNumber};yJ.float=fJ;yJ.floatExp=EJ;yJ.floatNaN=CJ});var B3=D((dJ)=>{var Y3=E1(),Z0=(q)=>typeof q==="bigint"||Number.isInteger(q);function e0(q,Z,X,{intAsBigInt:J}){let $=q[0];if($==="-"||$==="+")Z+=1;if(q=q.substring(Z).replace(/_/g,""),J){switch(X){case 2:q=`0b${q}`;break;case 8:q=`0o${q}`;break;case 16:q=`0x${q}`;break}let z=BigInt(q);return $==="-"?BigInt(-1)*z:z}let Q=parseInt(q,X);return $==="-"?-1*Q:Q}function D9(q,Z,X){let{value:J}=q;if(Z0(J)){let $=J.toString(Z);return J<0?"-"+X+$.substr(1):X+$}return Y3.stringifyNumber(q)}var gJ={identify:Z0,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(q,Z,X)=>e0(q,2,2,X),stringify:(q)=>D9(q,2,"0b")},hJ={identify:Z0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(q,Z,X)=>e0(q,1,8,X),stringify:(q)=>D9(q,8,"0")},uJ={identify:Z0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(q,Z,X)=>e0(q,0,10,X),stringify:Y3.stringifyNumber},mJ={identify:Z0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(q,Z,X)=>e0(q,2,16,X),stringify:(q)=>D9(q,16,"0x")};dJ.int=uJ;dJ.intBin=gJ;dJ.intHex=mJ;dJ.intOct=hJ});var F9=D((sJ)=>{var Xq=S(),qq=J1(),Zq=Q1();class K1 extends Zq.YAMLMap{constructor(q){super(q);this.tag=K1.tag}add(q){let Z;if(Xq.isPair(q))Z=q;else if(q&&typeof q==="object"&&"key"in q&&"value"in q&&q.value===null)Z=new qq.Pair(q.key,null);else Z=new qq.Pair(q,null);if(!Zq.findPair(this.items,Z.key))this.items.push(Z)}get(q,Z){let X=Zq.findPair(this.items,q);return!Z&&Xq.isPair(X)?Xq.isScalar(X.key)?X.key.value:X.key:X}set(q,Z){if(typeof Z!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof Z}`);let X=Zq.findPair(this.items,q);if(X&&!Z)this.items.splice(this.items.indexOf(X),1);else if(!X&&Z)this.items.push(new qq.Pair(q))}toJSON(q,Z){return super.toJSON(q,Z,Set)}toString(q,Z,X){if(!q)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},q,{allNullValues:!0}),Z,X);else throw Error("Set items must all have null values")}static from(q,Z,X){let{replacer:J}=X,$=new this(q);if(Z&&Symbol.iterator in Object(Z))for(let Q of Z){if(typeof J==="function")Q=J.call(Z,Q,Q);$.items.push(qq.createPair(Q,null,X))}return $}}K1.tag="tag:yaml.org,2002:set";var aJ={collection:"map",identify:(q)=>q instanceof Set,nodeClass:K1,default:!1,tag:"tag:yaml.org,2002:set",createNode:(q,Z,X)=>K1.from(q,Z,X),resolve(q,Z){if(Xq.isMap(q))if(q.hasAllNullValues(!0))return Object.assign(new K1,q);else Z("Set items must all have null values");else Z("Expected a mapping for this tag");return q}};sJ.YAMLSet=K1;sJ.set=aJ});var N9=D((q$)=>{var oJ=E1();function O9(q,Z){let X=q[0],J=X==="-"||X==="+"?q.substring(1):q,$=(z)=>Z?BigInt(z):Number(z),Q=J.replace(/_/g,"").split(":").reduce((z,H)=>z*$(60)+$(H),$(0));return X==="-"?$(-1)*Q:Q}function T3(q){let{value:Z}=q,X=(z)=>z;if(typeof Z==="bigint")X=(z)=>BigInt(z);else if(isNaN(Z)||!isFinite(Z))return oJ.stringifyNumber(q);let J="";if(Z<0)J="-",Z*=X(-1);let $=X(60),Q=[Z%$];if(Z<60)Q.unshift(0);else if(Z=(Z-Q[0])/$,Q.unshift(Z%$),Z>=60)Z=(Z-Q[0])/$,Q.unshift(Z);return J+Q.map((z)=>String(z).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var tJ={identify:(q)=>typeof q==="bigint"||Number.isInteger(q),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(q,Z,{intAsBigInt:X})=>O9(q,X),stringify:T3},eJ={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:(q)=>O9(q,!1),stringify:T3},_3={identify:(q)=>q instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(q){let Z=q.match(_3.test);if(!Z)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,X,J,$,Q,z,H]=Z.map(Number),U=Z[7]?Number((Z[7]+"00").substr(1,3)):0,G=Date.UTC(X,J-1,$,Q||0,z||0,H||0,U),Y=Z[8];if(Y&&Y!=="Z"){let B=O9(Y,!1);if(Math.abs(B)<30)B*=60;G-=60000*B}return new Date(G)},stringify:({value:q})=>q?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};q$.floatTime=eJ;q$.intTime=tJ;q$.timestamp=_3});var R3=D((W$)=>{var $$=j1(),Q$=s0(),z$=C1(),H$=t1(),U$=L9(),W3=U3(),A9=G3(),Jq=B3(),G$=u0(),Y$=K9(),B$=t0(),T$=F9(),S9=N9(),_$=[$$.map,z$.seq,H$.string,Q$.nullTag,W3.trueTag,W3.falseTag,Jq.intBin,Jq.intOct,Jq.int,Jq.intHex,A9.floatNaN,A9.floatExp,A9.float,U$.binary,G$.merge,Y$.omap,B$.pairs,T$.set,S9.intTime,S9.floatTime,S9.timestamp];W$.schema=_$});var N3=D((F$)=>{var M3=j1(),V$=s0(),K3=C1(),L$=t1(),I$=G9(),w9=B9(),b9=_9(),M$=o2(),K$=e2(),P3=L9(),X0=u0(),D3=K9(),F3=t0(),V3=R3(),O3=F9(),$q=N9(),L3=new Map([["core",M$.schema],["failsafe",[M3.map,K3.seq,L$.string]],["json",K$.schema],["yaml11",V3.schema],["yaml-1.1",V3.schema]]),I3={binary:P3.binary,bool:I$.boolTag,float:w9.float,floatExp:w9.floatExp,floatNaN:w9.floatNaN,floatTime:$q.floatTime,int:b9.int,intHex:b9.intHex,intOct:b9.intOct,intTime:$q.intTime,map:M3.map,merge:X0.merge,null:V$.nullTag,omap:D3.omap,pairs:F3.pairs,seq:K3.seq,set:O3.set,timestamp:$q.timestamp},P$={"tag:yaml.org,2002:binary":P3.binary,"tag:yaml.org,2002:merge":X0.merge,"tag:yaml.org,2002:omap":D3.omap,"tag:yaml.org,2002:pairs":F3.pairs,"tag:yaml.org,2002:set":O3.set,"tag:yaml.org,2002:timestamp":$q.timestamp};function D$(q,Z,X){let J=L3.get(Z);if(J&&!q)return X&&!J.includes(X0.merge)?J.concat(X0.merge):J.slice();let $=J;if(!$)if(Array.isArray(q))$=[];else{let Q=Array.from(L3.keys()).filter((z)=>z!=="yaml11").map((z)=>JSON.stringify(z)).join(", ");throw Error(`Unknown schema "${Z}"; use one of ${Q} or define customTags array`)}if(Array.isArray(q))for(let Q of q)$=$.concat(Q);else if(typeof q==="function")$=q($.slice());if(X)$=$.concat(X0.merge);return $.reduce((Q,z)=>{let H=typeof z==="string"?I3[z]:z;if(!H){let U=JSON.stringify(z),G=Object.keys(I3).map((Y)=>JSON.stringify(Y)).join(", ");throw Error(`Unknown custom tag ${U}; use one of ${G}`)}if(!Q.includes(H))Q.push(H);return Q},[])}F$.coreKnownTags=P$;F$.getTags=D$});var E9=D((j$)=>{var j9=S(),A$=j1(),S$=C1(),w$=t1(),Qq=N3(),b$=(q,Z)=>q.key<Z.key?-1:q.key>Z.key?1:0;class C9{constructor({compat:q,customTags:Z,merge:X,resolveKnownTags:J,schema:$,sortMapEntries:Q,toStringDefaults:z}){this.compat=Array.isArray(q)?Qq.getTags(q,"compat"):q?Qq.getTags(null,q):null,this.name=typeof $==="string"&&$||"core",this.knownTags=J?Qq.coreKnownTags:{},this.tags=Qq.getTags(Z,this.name,X),this.toStringOptions=z??null,Object.defineProperty(this,j9.MAP,{value:A$.map}),Object.defineProperty(this,j9.SCALAR,{value:w$.string}),Object.defineProperty(this,j9.SEQ,{value:S$.seq}),this.sortMapEntries=typeof Q==="function"?Q:Q===!0?b$:null}clone(){let q=Object.create(C9.prototype,Object.getOwnPropertyDescriptors(this));return q.tags=this.tags.slice(),q}}j$.Schema=C9});var A3=D((y$)=>{var E$=S(),f9=s1(),J0=c1();function f$(q,Z){let X=[],J=Z.directives===!0;if(Z.directives!==!1&&q.directives){let U=q.directives.toString(q);if(U)X.push(U),J=!0;else if(q.directives.docStart)J=!0}if(J)X.push("---");let $=f9.createStringifyContext(q,Z),{commentString:Q}=$.options;if(q.commentBefore){if(X.length!==1)X.unshift("");let U=Q(q.commentBefore);X.unshift(J0.indentComment(U,""))}let z=!1,H=null;if(q.contents){if(E$.isNode(q.contents)){if(q.contents.spaceBefore&&J)X.push("");if(q.contents.commentBefore){let Y=Q(q.contents.commentBefore);X.push(J0.indentComment(Y,""))}$.forceBlockIndent=!!q.comment,H=q.contents.comment}let U=H?void 0:()=>z=!0,G=f9.stringify(q.contents,$,()=>H=null,U);if(H)G+=J0.lineComment(G,"",Q(H));if((G[0]==="|"||G[0]===">")&&X[X.length-1]==="---")X[X.length-1]=`--- ${G}`;else X.push(G)}else X.push(f9.stringify(q.contents,$));if(q.directives?.docEnd)if(q.comment){let U=Q(q.comment);if(U.includes(`
81
- `))X.push("..."),X.push(J0.indentComment(U,""));else X.push(`... ${U}`)}else X.push("...");else{let U=q.comment;if(U&&z)U=U.replace(/^\n+/,"");if(U){if((!z||H)&&X[X.length-1]!=="")X.push("");X.push(J0.indentComment(Q(U),""))}}return X.join(`
80
+ ${Q.comment}`:J.comment}J=$}q.items[X]=t0.isPair(J)?J:new V9.Pair(J)}else Z("Expected a sequence for this tag");return q}function q3(q,Z,X){let{replacer:J}=X,$=new RJ.YAMLSeq(q);$.tag="tag:yaml.org,2002:pairs";let Q=0;if(Z&&Symbol.iterator in Object(Z))for(let z of Z){if(typeof J==="function")z=J.call(Z,String(Q++),z);let H,U;if(Array.isArray(z))if(z.length===2)H=z[0],U=z[1];else throw TypeError(`Expected [key, value] tuple: ${z}`);else if(z&&z instanceof Object){let G=Object.keys(z);if(G.length===1)H=G[0],U=z[H];else throw TypeError(`Expected tuple with one key, not ${G.length} keys`)}else H=z;$.items.push(V9.createPair(H,U,X))}return $}var VJ={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:e2,createNode:q3};IJ.createPairs=q3;IJ.pairs=VJ;IJ.resolvePairs=e2});var M9=P((OJ)=>{var Z3=S(),I9=Z1(),Z0=z1(),PJ=H1(),X3=e0();class M1 extends PJ.YAMLSeq{constructor(){super();this.add=Z0.YAMLMap.prototype.add.bind(this),this.delete=Z0.YAMLMap.prototype.delete.bind(this),this.get=Z0.YAMLMap.prototype.get.bind(this),this.has=Z0.YAMLMap.prototype.has.bind(this),this.set=Z0.YAMLMap.prototype.set.bind(this),this.tag=M1.tag}toJSON(q,Z){if(!Z)return super.toJSON(q);let X=new Map;if(Z?.onCreate)Z.onCreate(X);for(let J of this.items){let $,Q;if(Z3.isPair(J))$=I9.toJS(J.key,"",Z),Q=I9.toJS(J.value,$,Z);else $=I9.toJS(J,"",Z);if(X.has($))throw Error("Ordered maps must not include duplicate keys");X.set($,Q)}return X}static from(q,Z,X){let J=X3.createPairs(q,Z,X),$=new this;return $.items=J.items,$}}M1.tag="tag:yaml.org,2002:omap";var FJ={collection:"seq",identify:(q)=>q instanceof Map,nodeClass:M1,default:!1,tag:"tag:yaml.org,2002:omap",resolve(q,Z){let X=X3.resolvePairs(q,Z),J=[];for(let{key:$}of X.items)if(Z3.isScalar($))if(J.includes($.value))Z(`Ordered maps must not include duplicate keys: ${$.value}`);else J.push($.value);return Object.assign(new M1,X)},createNode:(q,Z,X)=>M1.from(q,Z,X)};OJ.YAMLOMap=M1;OJ.omap=FJ});var H3=P((SJ)=>{var J3=C();function $3({value:q,source:Z},X){if(Z&&(q?Q3:z3).test.test(Z))return Z;return q?X.options.trueStr:X.options.falseStr}var Q3={identify:(q)=>q===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new J3.Scalar(!0),stringify:$3},z3={identify:(q)=>q===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new J3.Scalar(!1),stringify:$3};SJ.falseTag=z3;SJ.trueTag=Q3});var U3=P((xJ)=>{var jJ=C(),K9=C1(),EJ={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(q)=>q.slice(-3).toLowerCase()==="nan"?NaN:q[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:K9.stringifyNumber},CJ={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:(q)=>parseFloat(q.replace(/_/g,"")),stringify(q){let Z=Number(q.value);return isFinite(Z)?Z.toExponential():K9.stringifyNumber(q)}},fJ={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(q){let Z=new jJ.Scalar(parseFloat(q.replace(/_/g,""))),X=q.indexOf(".");if(X!==-1){let J=q.substring(X+1).replace(/_/g,"");if(J[J.length-1]==="0")Z.minFractionDigits=J.length}return Z},stringify:K9.stringifyNumber};xJ.float=fJ;xJ.floatExp=CJ;xJ.floatNaN=EJ});var Y3=P((dJ)=>{var G3=C1(),X0=(q)=>typeof q==="bigint"||Number.isInteger(q);function qq(q,Z,X,{intAsBigInt:J}){let $=q[0];if($==="-"||$==="+")Z+=1;if(q=q.substring(Z).replace(/_/g,""),J){switch(X){case 2:q=`0b${q}`;break;case 8:q=`0o${q}`;break;case 16:q=`0x${q}`;break}let z=BigInt(q);return $==="-"?BigInt(-1)*z:z}let Q=parseInt(q,X);return $==="-"?-1*Q:Q}function D9(q,Z,X){let{value:J}=q;if(X0(J)){let $=J.toString(Z);return J<0?"-"+X+$.substr(1):X+$}return G3.stringifyNumber(q)}var gJ={identify:X0,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(q,Z,X)=>qq(q,2,2,X),stringify:(q)=>D9(q,2,"0b")},hJ={identify:X0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(q,Z,X)=>qq(q,1,8,X),stringify:(q)=>D9(q,8,"0")},uJ={identify:X0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(q,Z,X)=>qq(q,0,10,X),stringify:G3.stringifyNumber},mJ={identify:X0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(q,Z,X)=>qq(q,2,16,X),stringify:(q)=>D9(q,16,"0x")};dJ.int=uJ;dJ.intBin=gJ;dJ.intHex=mJ;dJ.intOct=hJ});var P9=P((sJ)=>{var Jq=S(),Zq=$1(),Xq=z1();class K1 extends Xq.YAMLMap{constructor(q){super(q);this.tag=K1.tag}add(q){let Z;if(Jq.isPair(q))Z=q;else if(q&&typeof q==="object"&&"key"in q&&"value"in q&&q.value===null)Z=new Zq.Pair(q.key,null);else Z=new Zq.Pair(q,null);if(!Xq.findPair(this.items,Z.key))this.items.push(Z)}get(q,Z){let X=Xq.findPair(this.items,q);return!Z&&Jq.isPair(X)?Jq.isScalar(X.key)?X.key.value:X.key:X}set(q,Z){if(typeof Z!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof Z}`);let X=Xq.findPair(this.items,q);if(X&&!Z)this.items.splice(this.items.indexOf(X),1);else if(!X&&Z)this.items.push(new Zq.Pair(q))}toJSON(q,Z){return super.toJSON(q,Z,Set)}toString(q,Z,X){if(!q)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},q,{allNullValues:!0}),Z,X);else throw Error("Set items must all have null values")}static from(q,Z,X){let{replacer:J}=X,$=new this(q);if(Z&&Symbol.iterator in Object(Z))for(let Q of Z){if(typeof J==="function")Q=J.call(Z,Q,Q);$.items.push(Zq.createPair(Q,null,X))}return $}}K1.tag="tag:yaml.org,2002:set";var aJ={collection:"map",identify:(q)=>q instanceof Set,nodeClass:K1,default:!1,tag:"tag:yaml.org,2002:set",createNode:(q,Z,X)=>K1.from(q,Z,X),resolve(q,Z){if(Jq.isMap(q))if(q.hasAllNullValues(!0))return Object.assign(new K1,q);else Z("Set items must all have null values");else Z("Expected a mapping for this tag");return q}};sJ.YAMLSet=K1;sJ.set=aJ});var O9=P((q$)=>{var oJ=C1();function F9(q,Z){let X=q[0],J=X==="-"||X==="+"?q.substring(1):q,$=(z)=>Z?BigInt(z):Number(z),Q=J.replace(/_/g,"").split(":").reduce((z,H)=>z*$(60)+$(H),$(0));return X==="-"?$(-1)*Q:Q}function B3(q){let{value:Z}=q,X=(z)=>z;if(typeof Z==="bigint")X=(z)=>BigInt(z);else if(isNaN(Z)||!isFinite(Z))return oJ.stringifyNumber(q);let J="";if(Z<0)J="-",Z*=X(-1);let $=X(60),Q=[Z%$];if(Z<60)Q.unshift(0);else if(Z=(Z-Q[0])/$,Q.unshift(Z%$),Z>=60)Z=(Z-Q[0])/$,Q.unshift(Z);return J+Q.map((z)=>String(z).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var tJ={identify:(q)=>typeof q==="bigint"||Number.isInteger(q),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(q,Z,{intAsBigInt:X})=>F9(q,X),stringify:B3},eJ={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:(q)=>F9(q,!1),stringify:B3},T3={identify:(q)=>q instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(q){let Z=q.match(T3.test);if(!Z)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,X,J,$,Q,z,H]=Z.map(Number),U=Z[7]?Number((Z[7]+"00").substr(1,3)):0,G=Date.UTC(X,J-1,$,Q||0,z||0,H||0,U),B=Z[8];if(B&&B!=="Z"){let Y=F9(B,!1);if(Math.abs(Y)<30)Y*=60;G-=60000*Y}return new Date(G)},stringify:({value:q})=>q?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};q$.floatTime=eJ;q$.intTime=tJ;q$.timestamp=T3});var L3=P((L$)=>{var $$=j1(),Q$=r0(),z$=E1(),H$=e1(),U$=R9(),_3=H3(),N9=U3(),$q=Y3(),G$=m0(),Y$=M9(),B$=e0(),T$=P9(),A9=O9(),_$=[$$.map,z$.seq,H$.string,Q$.nullTag,_3.trueTag,_3.falseTag,$q.intBin,$q.intOct,$q.int,$q.intHex,N9.floatNaN,N9.floatExp,N9.float,U$.binary,G$.merge,Y$.omap,B$.pairs,T$.set,A9.intTime,A9.floatTime,A9.timestamp];L$.schema=_$});var O3=P((F$)=>{var I3=j1(),R$=r0(),M3=E1(),V$=e1(),I$=U9(),S9=Y9(),w9=T9(),M$=n2(),K$=t2(),K3=R9(),J0=m0(),D3=M9(),P3=e0(),W3=L3(),F3=P9(),Qq=O9(),R3=new Map([["core",M$.schema],["failsafe",[I3.map,M3.seq,V$.string]],["json",K$.schema],["yaml11",W3.schema],["yaml-1.1",W3.schema]]),V3={binary:K3.binary,bool:I$.boolTag,float:S9.float,floatExp:S9.floatExp,floatNaN:S9.floatNaN,floatTime:Qq.floatTime,int:w9.int,intHex:w9.intHex,intOct:w9.intOct,intTime:Qq.intTime,map:I3.map,merge:J0.merge,null:R$.nullTag,omap:D3.omap,pairs:P3.pairs,seq:M3.seq,set:F3.set,timestamp:Qq.timestamp},D$={"tag:yaml.org,2002:binary":K3.binary,"tag:yaml.org,2002:merge":J0.merge,"tag:yaml.org,2002:omap":D3.omap,"tag:yaml.org,2002:pairs":P3.pairs,"tag:yaml.org,2002:set":F3.set,"tag:yaml.org,2002:timestamp":Qq.timestamp};function P$(q,Z,X){let J=R3.get(Z);if(J&&!q)return X&&!J.includes(J0.merge)?J.concat(J0.merge):J.slice();let $=J;if(!$)if(Array.isArray(q))$=[];else{let Q=Array.from(R3.keys()).filter((z)=>z!=="yaml11").map((z)=>JSON.stringify(z)).join(", ");throw Error(`Unknown schema "${Z}"; use one of ${Q} or define customTags array`)}if(Array.isArray(q))for(let Q of q)$=$.concat(Q);else if(typeof q==="function")$=q($.slice());if(X)$=$.concat(J0.merge);return $.reduce((Q,z)=>{let H=typeof z==="string"?V3[z]:z;if(!H){let U=JSON.stringify(z),G=Object.keys(V3).map((B)=>JSON.stringify(B)).join(", ");throw Error(`Unknown custom tag ${U}; use one of ${G}`)}if(!Q.includes(H))Q.push(H);return Q},[])}F$.coreKnownTags=D$;F$.getTags=P$});var E9=P((j$)=>{var b9=S(),A$=j1(),S$=E1(),w$=e1(),zq=O3(),b$=(q,Z)=>q.key<Z.key?-1:q.key>Z.key?1:0;class j9{constructor({compat:q,customTags:Z,merge:X,resolveKnownTags:J,schema:$,sortMapEntries:Q,toStringDefaults:z}){this.compat=Array.isArray(q)?zq.getTags(q,"compat"):q?zq.getTags(null,q):null,this.name=typeof $==="string"&&$||"core",this.knownTags=J?zq.coreKnownTags:{},this.tags=zq.getTags(Z,this.name,X),this.toStringOptions=z??null,Object.defineProperty(this,b9.MAP,{value:A$.map}),Object.defineProperty(this,b9.SCALAR,{value:w$.string}),Object.defineProperty(this,b9.SEQ,{value:S$.seq}),this.sortMapEntries=typeof Q==="function"?Q:Q===!0?b$:null}clone(){let q=Object.create(j9.prototype,Object.getOwnPropertyDescriptors(this));return q.tags=this.tags.slice(),q}}j$.Schema=j9});var N3=P((x$)=>{var C$=S(),C9=r1(),$0=i1();function f$(q,Z){let X=[],J=Z.directives===!0;if(Z.directives!==!1&&q.directives){let U=q.directives.toString(q);if(U)X.push(U),J=!0;else if(q.directives.docStart)J=!0}if(J)X.push("---");let $=C9.createStringifyContext(q,Z),{commentString:Q}=$.options;if(q.commentBefore){if(X.length!==1)X.unshift("");let U=Q(q.commentBefore);X.unshift($0.indentComment(U,""))}let z=!1,H=null;if(q.contents){if(C$.isNode(q.contents)){if(q.contents.spaceBefore&&J)X.push("");if(q.contents.commentBefore){let B=Q(q.contents.commentBefore);X.push($0.indentComment(B,""))}$.forceBlockIndent=!!q.comment,H=q.contents.comment}let U=H?void 0:()=>z=!0,G=C9.stringify(q.contents,$,()=>H=null,U);if(H)G+=$0.lineComment(G,"",Q(H));if((G[0]==="|"||G[0]===">")&&X[X.length-1]==="---")X[X.length-1]=`--- ${G}`;else X.push(G)}else X.push(C9.stringify(q.contents,$));if(q.directives?.docEnd)if(q.comment){let U=Q(q.comment);if(U.includes(`
81
+ `))X.push("..."),X.push($0.indentComment(U,""));else X.push(`... ${U}`)}else X.push("...");else{let U=q.comment;if(U&&z)U=U.replace(/^\n+/,"");if(U){if((!z||H)&&X[X.length-1]!=="")X.push("");X.push($0.indentComment(Q(U),""))}}return X.join(`
82
82
  `)+`
83
- `}y$.stringifyDocument=f$});var $0=D((l$)=>{var k$=l1(),f1=y0(),u=S(),v$=J1(),g$=q1(),h$=E9(),u$=A3(),y9=C0(),m$=eq(),d$=p1(),x9=tq();class k9{constructor(q,Z,X){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,u.NODE_TYPE,{value:u.DOC});let J=null;if(typeof Z==="function"||Array.isArray(Z))J=Z;else if(X===void 0&&Z)X=Z,Z=void 0;let $=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},X);this.options=$;let{version:Q}=$;if(X?._directives){if(this.directives=X._directives.atDocument(),this.directives.yaml.explicit)Q=this.directives.yaml.version}else this.directives=new x9.Directives({version:Q});this.setSchema(Q,X),this.contents=q===void 0?null:this.createNode(q,J,X)}clone(){let q=Object.create(k9.prototype,{[u.NODE_TYPE]:{value:u.DOC}});if(q.commentBefore=this.commentBefore,q.comment=this.comment,q.errors=this.errors.slice(),q.warnings=this.warnings.slice(),q.options=Object.assign({},this.options),this.directives)q.directives=this.directives.clone();if(q.schema=this.schema.clone(),q.contents=u.isNode(this.contents)?this.contents.clone(q.schema):this.contents,this.range)q.range=this.range.slice();return q}add(q){if(y1(this.contents))this.contents.add(q)}addIn(q,Z){if(y1(this.contents))this.contents.addIn(q,Z)}createAlias(q,Z){if(!q.anchor){let X=y9.anchorNames(this);q.anchor=!Z||X.has(Z)?y9.findNewAnchor(Z||"a",X):Z}return new k$.Alias(q.anchor)}createNode(q,Z,X){let J=void 0;if(typeof Z==="function")q=Z.call({"":q},"",q),J=Z;else if(Array.isArray(Z)){let T=(I)=>typeof I==="number"||I instanceof String||I instanceof Number,W=Z.filter(T).map(String);if(W.length>0)Z=Z.concat(W);J=Z}else if(X===void 0&&Z)X=Z,Z=void 0;let{aliasDuplicateObjects:$,anchorPrefix:Q,flow:z,keepUndefined:H,onTagObj:U,tag:G}=X??{},{onAnchor:Y,setAnchors:B,sourceObjects:_}=y9.createNodeAnchors(this,Q||"a"),V={aliasDuplicateObjects:$??!0,keepUndefined:H??!1,onAnchor:Y,onTagObj:U,replacer:J,schema:this.schema,sourceObjects:_},R=d$.createNode(q,G,V);if(z&&u.isCollection(R))R.flow=!0;return B(),R}createPair(q,Z,X={}){let J=this.createNode(q,null,X),$=this.createNode(Z,null,X);return new v$.Pair(J,$)}delete(q){return y1(this.contents)?this.contents.delete(q):!1}deleteIn(q){if(f1.isEmptyPath(q)){if(this.contents==null)return!1;return this.contents=null,!0}return y1(this.contents)?this.contents.deleteIn(q):!1}get(q,Z){return u.isCollection(this.contents)?this.contents.get(q,Z):void 0}getIn(q,Z){if(f1.isEmptyPath(q))return!Z&&u.isScalar(this.contents)?this.contents.value:this.contents;return u.isCollection(this.contents)?this.contents.getIn(q,Z):void 0}has(q){return u.isCollection(this.contents)?this.contents.has(q):!1}hasIn(q){if(f1.isEmptyPath(q))return this.contents!==void 0;return u.isCollection(this.contents)?this.contents.hasIn(q):!1}set(q,Z){if(this.contents==null)this.contents=f1.collectionFromPath(this.schema,[q],Z);else if(y1(this.contents))this.contents.set(q,Z)}setIn(q,Z){if(f1.isEmptyPath(q))this.contents=Z;else if(this.contents==null)this.contents=f1.collectionFromPath(this.schema,Array.from(q),Z);else if(y1(this.contents))this.contents.setIn(q,Z)}setSchema(q,Z={}){if(typeof q==="number")q=String(q);let X;switch(q){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new x9.Directives({version:"1.1"});X={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=q;else this.directives=new x9.Directives({version:q});X={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;X=null;break;default:{let J=JSON.stringify(q);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${J}`)}}if(Z.schema instanceof Object)this.schema=Z.schema;else if(X)this.schema=new h$.Schema(Object.assign(X,Z));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:q,jsonArg:Z,mapAsMap:X,maxAliasCount:J,onAnchor:$,reviver:Q}={}){let z={anchors:new Map,doc:this,keep:!q,mapAsMap:X===!0,mapKeyWarned:!1,maxAliasCount:typeof J==="number"?J:100},H=g$.toJS(this.contents,Z??"",z);if(typeof $==="function")for(let{count:U,res:G}of z.anchors.values())$(G,U);return typeof Q==="function"?m$.applyReviver(Q,{"":H},"",H):H}toJSON(q,Z){return this.toJS({json:!0,jsonArg:q,mapAsMap:!1,onAnchor:Z})}toString(q={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in q&&(!Number.isInteger(q.indent)||Number(q.indent)<=0)){let Z=JSON.stringify(q.indent);throw Error(`"indent" option must be a positive integer, not ${Z}`)}return u$.stringifyDocument(this,q)}}function y1(q){if(u.isCollection(q))return!0;throw Error("Expected a YAML collection as document contents")}l$.Document=k9});var Q0=D((i$)=>{class zq extends Error{constructor(q,Z,X,J){super();this.name=q,this.code=X,this.message=J,this.pos=Z}}class S3 extends zq{constructor(q,Z,X){super("YAMLParseError",q,Z,X)}}class w3 extends zq{constructor(q,Z,X){super("YAMLWarning",q,Z,X)}}var c$=(q,Z)=>(X)=>{if(X.pos[0]===-1)return;X.linePos=X.pos.map((H)=>Z.linePos(H));let{line:J,col:$}=X.linePos[0];X.message+=` at line ${J}, column ${$}`;let Q=$-1,z=q.substring(Z.lineStarts[J-1],Z.lineStarts[J]).replace(/[\n\r]+$/,"");if(Q>=60&&z.length>80){let H=Math.min(Q-39,z.length-79);z="…"+z.substring(H),Q-=H-1}if(z.length>80)z=z.substring(0,79)+"…";if(J>1&&/^ *$/.test(z.substring(0,Q))){let H=q.substring(Z.lineStarts[J-2],Z.lineStarts[J-1]);if(H.length>80)H=H.substring(0,79)+`…
83
+ `}x$.stringifyDocument=f$});var Q0=P((l$)=>{var k$=p1(),f1=y0(),u=S(),v$=$1(),g$=Z1(),h$=E9(),u$=N3(),f9=C0(),m$=tq(),d$=c1(),x9=oq();class y9{constructor(q,Z,X){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,u.NODE_TYPE,{value:u.DOC});let J=null;if(typeof Z==="function"||Array.isArray(Z))J=Z;else if(X===void 0&&Z)X=Z,Z=void 0;let $=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},X);this.options=$;let{version:Q}=$;if(X?._directives){if(this.directives=X._directives.atDocument(),this.directives.yaml.explicit)Q=this.directives.yaml.version}else this.directives=new x9.Directives({version:Q});this.setSchema(Q,X),this.contents=q===void 0?null:this.createNode(q,J,X)}clone(){let q=Object.create(y9.prototype,{[u.NODE_TYPE]:{value:u.DOC}});if(q.commentBefore=this.commentBefore,q.comment=this.comment,q.errors=this.errors.slice(),q.warnings=this.warnings.slice(),q.options=Object.assign({},this.options),this.directives)q.directives=this.directives.clone();if(q.schema=this.schema.clone(),q.contents=u.isNode(this.contents)?this.contents.clone(q.schema):this.contents,this.range)q.range=this.range.slice();return q}add(q){if(x1(this.contents))this.contents.add(q)}addIn(q,Z){if(x1(this.contents))this.contents.addIn(q,Z)}createAlias(q,Z){if(!q.anchor){let X=f9.anchorNames(this);q.anchor=!Z||X.has(Z)?f9.findNewAnchor(Z||"a",X):Z}return new k$.Alias(q.anchor)}createNode(q,Z,X){let J=void 0;if(typeof Z==="function")q=Z.call({"":q},"",q),J=Z;else if(Array.isArray(Z)){let T=(I)=>typeof I==="number"||I instanceof String||I instanceof Number,L=Z.filter(T).map(String);if(L.length>0)Z=Z.concat(L);J=Z}else if(X===void 0&&Z)X=Z,Z=void 0;let{aliasDuplicateObjects:$,anchorPrefix:Q,flow:z,keepUndefined:H,onTagObj:U,tag:G}=X??{},{onAnchor:B,setAnchors:Y,sourceObjects:_}=f9.createNodeAnchors(this,Q||"a"),R={aliasDuplicateObjects:$??!0,keepUndefined:H??!1,onAnchor:B,onTagObj:U,replacer:J,schema:this.schema,sourceObjects:_},W=d$.createNode(q,G,R);if(z&&u.isCollection(W))W.flow=!0;return Y(),W}createPair(q,Z,X={}){let J=this.createNode(q,null,X),$=this.createNode(Z,null,X);return new v$.Pair(J,$)}delete(q){return x1(this.contents)?this.contents.delete(q):!1}deleteIn(q){if(f1.isEmptyPath(q)){if(this.contents==null)return!1;return this.contents=null,!0}return x1(this.contents)?this.contents.deleteIn(q):!1}get(q,Z){return u.isCollection(this.contents)?this.contents.get(q,Z):void 0}getIn(q,Z){if(f1.isEmptyPath(q))return!Z&&u.isScalar(this.contents)?this.contents.value:this.contents;return u.isCollection(this.contents)?this.contents.getIn(q,Z):void 0}has(q){return u.isCollection(this.contents)?this.contents.has(q):!1}hasIn(q){if(f1.isEmptyPath(q))return this.contents!==void 0;return u.isCollection(this.contents)?this.contents.hasIn(q):!1}set(q,Z){if(this.contents==null)this.contents=f1.collectionFromPath(this.schema,[q],Z);else if(x1(this.contents))this.contents.set(q,Z)}setIn(q,Z){if(f1.isEmptyPath(q))this.contents=Z;else if(this.contents==null)this.contents=f1.collectionFromPath(this.schema,Array.from(q),Z);else if(x1(this.contents))this.contents.setIn(q,Z)}setSchema(q,Z={}){if(typeof q==="number")q=String(q);let X;switch(q){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new x9.Directives({version:"1.1"});X={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=q;else this.directives=new x9.Directives({version:q});X={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;X=null;break;default:{let J=JSON.stringify(q);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${J}`)}}if(Z.schema instanceof Object)this.schema=Z.schema;else if(X)this.schema=new h$.Schema(Object.assign(X,Z));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:q,jsonArg:Z,mapAsMap:X,maxAliasCount:J,onAnchor:$,reviver:Q}={}){let z={anchors:new Map,doc:this,keep:!q,mapAsMap:X===!0,mapKeyWarned:!1,maxAliasCount:typeof J==="number"?J:100},H=g$.toJS(this.contents,Z??"",z);if(typeof $==="function")for(let{count:U,res:G}of z.anchors.values())$(G,U);return typeof Q==="function"?m$.applyReviver(Q,{"":H},"",H):H}toJSON(q,Z){return this.toJS({json:!0,jsonArg:q,mapAsMap:!1,onAnchor:Z})}toString(q={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in q&&(!Number.isInteger(q.indent)||Number(q.indent)<=0)){let Z=JSON.stringify(q.indent);throw Error(`"indent" option must be a positive integer, not ${Z}`)}return u$.stringifyDocument(this,q)}}function x1(q){if(u.isCollection(q))return!0;throw Error("Expected a YAML collection as document contents")}l$.Document=y9});var z0=P((i$)=>{class Hq extends Error{constructor(q,Z,X,J){super();this.name=q,this.code=X,this.message=J,this.pos=Z}}class A3 extends Hq{constructor(q,Z,X){super("YAMLParseError",q,Z,X)}}class S3 extends Hq{constructor(q,Z,X){super("YAMLWarning",q,Z,X)}}var c$=(q,Z)=>(X)=>{if(X.pos[0]===-1)return;X.linePos=X.pos.map((H)=>Z.linePos(H));let{line:J,col:$}=X.linePos[0];X.message+=` at line ${J}, column ${$}`;let Q=$-1,z=q.substring(Z.lineStarts[J-1],Z.lineStarts[J]).replace(/[\n\r]+$/,"");if(Q>=60&&z.length>80){let H=Math.min(Q-39,z.length-79);z="…"+z.substring(H),Q-=H-1}if(z.length>80)z=z.substring(0,79)+"…";if(J>1&&/^ *$/.test(z.substring(0,Q))){let H=q.substring(Z.lineStarts[J-2],Z.lineStarts[J-1]);if(H.length>80)H=H.substring(0,79)+`…
84
84
  `;z=H+z}if(/[^ ]/.test(z)){let H=1,U=X.linePos[1];if(U?.line===J&&U.col>$)H=Math.max(1,Math.min(U.col-$,80-Q));let G=" ".repeat(Q)+"^".repeat(H);X.message+=`:
85
85
 
86
86
  ${z}
87
87
  ${G}
88
- `}};i$.YAMLError=zq;i$.YAMLParseError=S3;i$.YAMLWarning=w3;i$.prettifyError=c$});var z0=D((t$)=>{function o$(q,{flow:Z,indicator:X,next:J,offset:$,onError:Q,parentIndent:z,startOnNewline:H}){let U=!1,G=H,Y=H,B="",_="",V=!1,R=!1,T=null,W=null,I=null,M=null,P=null,O=null,N=null;for(let L of q){if(R){if(L.type!=="space"&&L.type!=="newline"&&L.type!=="comma")Q(L.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");R=!1}if(T){if(G&&L.type!=="comment"&&L.type!=="newline")Q(T,"TAB_AS_INDENT","Tabs are not allowed as indentation");T=null}switch(L.type){case"space":if(!Z&&(X!=="doc-start"||J?.type!=="flow-collection")&&L.source.includes("\t"))T=L;Y=!0;break;case"comment":{if(!Y)Q(L,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let w=L.source.substring(1)||" ";if(!B)B=w;else B+=_+w;_="",G=!1;break}case"newline":if(G){if(B)B+=L.source;else if(!O||X!=="seq-item-ind")U=!0}else _+=L.source;if(G=!0,V=!0,W||I)M=L;Y=!0;break;case"anchor":if(W)Q(L,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(L.source.endsWith(":"))Q(L.offset+L.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);W=L,N??(N=L.offset),G=!1,Y=!1,R=!0;break;case"tag":{if(I)Q(L,"MULTIPLE_TAGS","A node can have at most one tag");I=L,N??(N=L.offset),G=!1,Y=!1,R=!0;break}case X:if(W||I)Q(L,"BAD_PROP_ORDER",`Anchors and tags must be after the ${L.source} indicator`);if(O)Q(L,"UNEXPECTED_TOKEN",`Unexpected ${L.source} in ${Z??"collection"}`);O=L,G=X==="seq-item-ind"||X==="explicit-key-ind",Y=!1;break;case"comma":if(Z){if(P)Q(L,"UNEXPECTED_TOKEN",`Unexpected , in ${Z}`);P=L,G=!1,Y=!1;break}default:Q(L,"UNEXPECTED_TOKEN",`Unexpected ${L.type} token`),G=!1,Y=!1}}let A=q[q.length-1],K=A?A.offset+A.source.length:$;if(R&&J&&J.type!=="space"&&J.type!=="newline"&&J.type!=="comma"&&(J.type!=="scalar"||J.source!==""))Q(J.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(T&&(G&&T.indent<=z||J?.type==="block-map"||J?.type==="block-seq"))Q(T,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:P,found:O,spaceBefore:U,comment:B,hasNewline:V,anchor:W,tag:I,newlineAfterProp:M,end:K,start:N??K}}t$.resolveProps=o$});var Hq=D((qQ)=>{function v9(q){if(!q)return null;switch(q.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(q.source.includes(`
89
- `))return!0;if(q.end){for(let Z of q.end)if(Z.type==="newline")return!0}return!1;case"flow-collection":for(let Z of q.items){for(let X of Z.start)if(X.type==="newline")return!0;if(Z.sep){for(let X of Z.sep)if(X.type==="newline")return!0}if(v9(Z.key)||v9(Z.value))return!0}return!1;default:return!0}}qQ.containsNewline=v9});var g9=D(($Q)=>{var XQ=Hq();function JQ(q,Z,X){if(Z?.type==="flow-collection"){let J=Z.end[0];if(J.indent===q&&(J.source==="]"||J.source==="}")&&XQ.containsNewline(Z))X(J,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}$Q.flowIndentCheck=JQ});var h9=D((HQ)=>{var b3=S();function zQ(q,Z,X){let{uniqueKeys:J}=q.options;if(J===!1)return!1;let $=typeof J==="function"?J:(Q,z)=>Q===z||b3.isScalar(Q)&&b3.isScalar(z)&&Q.value===z.value;return Z.some((Q)=>$(Q.key,X))}HQ.mapIncludes=zQ});var y3=D((_Q)=>{var j3=J1(),GQ=Q1(),C3=z0(),YQ=Hq(),E3=g9(),BQ=h9(),f3="All mapping items must start at the same column";function TQ({composeNode:q,composeEmptyNode:Z},X,J,$,Q){let H=new(Q?.nodeClass??GQ.YAMLMap)(X.schema);if(X.atRoot)X.atRoot=!1;let U=J.offset,G=null;for(let Y of J.items){let{start:B,key:_,sep:V,value:R}=Y,T=C3.resolveProps(B,{indicator:"explicit-key-ind",next:_??V?.[0],offset:U,onError:$,parentIndent:J.indent,startOnNewline:!0}),W=!T.found;if(W){if(_){if(_.type==="block-seq")$(U,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in _&&_.indent!==J.indent)$(U,"BAD_INDENT",f3)}if(!T.anchor&&!T.tag&&!V){if(G=T.end,T.comment)if(H.comment)H.comment+=`
90
- `+T.comment;else H.comment=T.comment;continue}if(T.newlineAfterProp||YQ.containsNewline(_))$(_??B[B.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(T.found?.indent!==J.indent)$(U,"BAD_INDENT",f3);X.atKey=!0;let I=T.end,M=_?q(X,_,T,$):Z(X,I,B,null,T,$);if(X.schema.compat)E3.flowIndentCheck(J.indent,_,$);if(X.atKey=!1,BQ.mapIncludes(X,H.items,M))$(I,"DUPLICATE_KEY","Map keys must be unique");let P=C3.resolveProps(V??[],{indicator:"map-value-ind",next:R,offset:M.range[2],onError:$,parentIndent:J.indent,startOnNewline:!_||_.type==="block-scalar"});if(U=P.end,P.found){if(W){if(R?.type==="block-map"&&!P.hasNewline)$(U,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(X.options.strict&&T.start<P.found.offset-1024)$(M.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let O=R?q(X,R,P,$):Z(X,U,V,null,P,$);if(X.schema.compat)E3.flowIndentCheck(J.indent,R,$);U=O.range[2];let N=new j3.Pair(M,O);if(X.options.keepSourceTokens)N.srcToken=Y;H.items.push(N)}else{if(W)$(M.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(P.comment)if(M.comment)M.comment+=`
91
- `+P.comment;else M.comment=P.comment;let O=new j3.Pair(M);if(X.options.keepSourceTokens)O.srcToken=Y;H.items.push(O)}}if(G&&G<U)$(G,"IMPOSSIBLE","Map comment with trailing content");return H.range=[J.offset,U,G??U],H}_Q.resolveBlockMap=TQ});var x3=D((MQ)=>{var RQ=z1(),VQ=z0(),LQ=g9();function IQ({composeNode:q,composeEmptyNode:Z},X,J,$,Q){let H=new(Q?.nodeClass??RQ.YAMLSeq)(X.schema);if(X.atRoot)X.atRoot=!1;if(X.atKey)X.atKey=!1;let U=J.offset,G=null;for(let{start:Y,value:B}of J.items){let _=VQ.resolveProps(Y,{indicator:"seq-item-ind",next:B,offset:U,onError:$,parentIndent:J.indent,startOnNewline:!0});if(!_.found)if(_.anchor||_.tag||B)if(B?.type==="block-seq")$(_.end,"BAD_INDENT","All sequence items must start at the same column");else $(U,"MISSING_CHAR","Sequence item without - indicator");else{if(G=_.end,_.comment)H.comment=_.comment;continue}let V=B?q(X,B,_,$):Z(X,_.end,Y,null,_,$);if(X.schema.compat)LQ.flowIndentCheck(J.indent,B,$);U=V.range[2],H.items.push(V)}return H.range=[J.offset,U,G??U],H}MQ.resolveBlockSeq=IQ});var x1=D((DQ)=>{function PQ(q,Z,X,J){let $="";if(q){let Q=!1,z="";for(let H of q){let{source:U,type:G}=H;switch(G){case"space":Q=!0;break;case"comment":{if(X&&!Q)J(H,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let Y=U.substring(1)||" ";if(!$)$=Y;else $+=z+Y;z="";break}case"newline":if($)z+=U;Q=!0;break;default:J(H,"UNEXPECTED_TOKEN",`Unexpected ${G} at node end`)}Z+=U.length}}return{comment:$,offset:Z}}DQ.resolveEnd=PQ});var g3=D((CQ)=>{var OQ=S(),NQ=J1(),k3=Q1(),AQ=z1(),SQ=x1(),v3=z0(),wQ=Hq(),bQ=h9(),u9="Block collections are not allowed within flow collections",m9=(q)=>q&&(q.type==="block-map"||q.type==="block-seq");function jQ({composeNode:q,composeEmptyNode:Z},X,J,$,Q){let z=J.start.source==="{",H=z?"flow map":"flow sequence",G=new(Q?.nodeClass??(z?k3.YAMLMap:AQ.YAMLSeq))(X.schema);G.flow=!0;let Y=X.atRoot;if(Y)X.atRoot=!1;if(X.atKey)X.atKey=!1;let B=J.offset+J.start.source.length;for(let W=0;W<J.items.length;++W){let I=J.items[W],{start:M,key:P,sep:O,value:N}=I,A=v3.resolveProps(M,{flow:H,indicator:"explicit-key-ind",next:P??O?.[0],offset:B,onError:$,parentIndent:J.indent,startOnNewline:!1});if(!A.found){if(!A.anchor&&!A.tag&&!O&&!N){if(W===0&&A.comma)$(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${H}`);else if(W<J.items.length-1)$(A.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${H}`);if(A.comment)if(G.comment)G.comment+=`
92
- `+A.comment;else G.comment=A.comment;B=A.end;continue}if(!z&&X.options.strict&&wQ.containsNewline(P))$(P,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(W===0){if(A.comma)$(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${H}`)}else{if(!A.comma)$(A.start,"MISSING_CHAR",`Missing , between ${H} items`);if(A.comment){let K="";q:for(let L of M)switch(L.type){case"comma":case"space":break;case"comment":K=L.source.substring(1);break q;default:break q}if(K){let L=G.items[G.items.length-1];if(OQ.isPair(L))L=L.value??L.key;if(L.comment)L.comment+=`
93
- `+K;else L.comment=K;A.comment=A.comment.substring(K.length+1)}}}if(!z&&!O&&!A.found){let K=N?q(X,N,A,$):Z(X,A.end,O,null,A,$);if(G.items.push(K),B=K.range[2],m9(N))$(K.range,"BLOCK_IN_FLOW",u9)}else{X.atKey=!0;let K=A.end,L=P?q(X,P,A,$):Z(X,K,M,null,A,$);if(m9(P))$(L.range,"BLOCK_IN_FLOW",u9);X.atKey=!1;let w=v3.resolveProps(O??[],{flow:H,indicator:"map-value-ind",next:N,offset:L.range[2],onError:$,parentIndent:J.indent,startOnNewline:!1});if(w.found){if(!z&&!A.found&&X.options.strict){if(O)for(let C of O){if(C===w.found)break;if(C.type==="newline"){$(C,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(A.start<w.found.offset-1024)$(w.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(N)if("source"in N&&N.source?.[0]===":")$(N,"MISSING_CHAR",`Missing space after : in ${H}`);else $(w.start,"MISSING_CHAR",`Missing , or : between ${H} items`);let y=N?q(X,N,w,$):w.found?Z(X,w.end,O,null,w,$):null;if(y){if(m9(N))$(y.range,"BLOCK_IN_FLOW",u9)}else if(w.comment)if(L.comment)L.comment+=`
94
- `+w.comment;else L.comment=w.comment;let x=new NQ.Pair(L,y);if(X.options.keepSourceTokens)x.srcToken=I;if(z){let C=G;if(bQ.mapIncludes(X,C.items,L))$(K,"DUPLICATE_KEY","Map keys must be unique");C.items.push(x)}else{let C=new k3.YAMLMap(X.schema);C.flow=!0,C.items.push(x);let P0=(y??L).range;C.range=[L.range[0],P0[1],P0[2]],G.items.push(C)}B=y?y.range[2]:w.end}}let _=z?"}":"]",[V,...R]=J.end,T=B;if(V?.source===_)T=V.offset+V.source.length;else{let W=H[0].toUpperCase()+H.substring(1),I=Y?`${W} must end with a ${_}`:`${W} in block collection must be sufficiently indented and end with a ${_}`;if($(B,Y?"MISSING_CHAR":"BAD_INDENT",I),V&&V.source.length!==1)R.unshift(V)}if(R.length>0){let W=SQ.resolveEnd(R,T,X.options.strict,$);if(W.comment)if(G.comment)G.comment+=`
95
- `+W.comment;else G.comment=W.comment;G.range=[J.offset,T,W.offset]}else G.range=[J.offset,T,T];return G}CQ.resolveFlowCollection=jQ});var h3=D((mQ)=>{var fQ=S(),yQ=E(),xQ=Q1(),kQ=z1(),vQ=y3(),gQ=x3(),hQ=g3();function d9(q,Z,X,J,$,Q){let z=X.type==="block-map"?vQ.resolveBlockMap(q,Z,X,J,Q):X.type==="block-seq"?gQ.resolveBlockSeq(q,Z,X,J,Q):hQ.resolveFlowCollection(q,Z,X,J,Q),H=z.constructor;if($==="!"||$===H.tagName)return z.tag=H.tagName,z;if($)z.tag=$;return z}function uQ(q,Z,X,J,$){let Q=J.tag,z=!Q?null:Z.directives.tagName(Q.source,(_)=>$(Q,"TAG_RESOLVE_FAILED",_));if(X.type==="block-seq"){let{anchor:_,newlineAfterProp:V}=J,R=_&&Q?_.offset>Q.offset?_:Q:_??Q;if(R&&(!V||V.offset<R.offset))$(R,"MISSING_CHAR","Missing newline after block sequence props")}let H=X.type==="block-map"?"map":X.type==="block-seq"?"seq":X.start.source==="{"?"map":"seq";if(!Q||!z||z==="!"||z===xQ.YAMLMap.tagName&&H==="map"||z===kQ.YAMLSeq.tagName&&H==="seq")return d9(q,Z,X,$,z);let U=Z.schema.tags.find((_)=>_.tag===z&&_.collection===H);if(!U){let _=Z.schema.knownTags[z];if(_?.collection===H)Z.schema.tags.push(Object.assign({},_,{default:!1})),U=_;else{if(_)$(Q,"BAD_COLLECTION_TYPE",`${_.tag} used for ${H} collection, but expects ${_.collection??"scalar"}`,!0);else $(Q,"TAG_RESOLVE_FAILED",`Unresolved tag: ${z}`,!0);return d9(q,Z,X,$,z)}}let G=d9(q,Z,X,$,z,U),Y=U.resolve?.(G,(_)=>$(Q,"TAG_RESOLVE_FAILED",_),Z.options)??G,B=fQ.isNode(Y)?Y:new yQ.Scalar(Y);if(B.range=G.range,B.tag=z,U?.format)B.format=U.format;return B}mQ.composeCollection=uQ});var p9=D((iQ)=>{var l9=E();function lQ(q,Z,X){let J=Z.offset,$=pQ(Z,q.options.strict,X);if(!$)return{value:"",type:null,comment:"",range:[J,J,J]};let Q=$.mode===">"?l9.Scalar.BLOCK_FOLDED:l9.Scalar.BLOCK_LITERAL,z=Z.source?cQ(Z.source):[],H=z.length;for(let T=z.length-1;T>=0;--T){let W=z[T][1];if(W===""||W==="\r")H=T;else break}if(H===0){let T=$.chomp==="+"&&z.length>0?`
96
- `.repeat(Math.max(1,z.length-1)):"",W=J+$.length;if(Z.source)W+=Z.source.length;return{value:T,type:Q,comment:$.comment,range:[J,W,W]}}let U=Z.indent+$.indent,G=Z.offset+$.length,Y=0;for(let T=0;T<H;++T){let[W,I]=z[T];if(I===""||I==="\r"){if($.indent===0&&W.length>U)U=W.length}else{if(W.length<U)X(G+W.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if($.indent===0)U=W.length;if(Y=T,U===0&&!q.atRoot)X(G,"BAD_INDENT","Block scalar values in collections must be indented");break}G+=W.length+I.length+1}for(let T=z.length-1;T>=H;--T)if(z[T][0].length>U)H=T+1;let B="",_="",V=!1;for(let T=0;T<Y;++T)B+=z[T][0].slice(U)+`
97
- `;for(let T=Y;T<H;++T){let[W,I]=z[T];G+=W.length+I.length+1;let M=I[I.length-1]==="\r";if(M)I=I.slice(0,-1);if(I&&W.length<U){let O=`Block scalar lines must not be less indented than their ${$.indent?"explicit indentation indicator":"first line"}`;X(G-I.length-(M?2:1),"BAD_INDENT",O),W=""}if(Q===l9.Scalar.BLOCK_LITERAL)B+=_+W.slice(U)+I,_=`
98
- `;else if(W.length>U||I[0]==="\t"){if(_===" ")_=`
99
- `;else if(!V&&_===`
88
+ `}};i$.YAMLError=Hq;i$.YAMLParseError=A3;i$.YAMLWarning=S3;i$.prettifyError=c$});var H0=P((t$)=>{function o$(q,{flow:Z,indicator:X,next:J,offset:$,onError:Q,parentIndent:z,startOnNewline:H}){let U=!1,G=H,B=H,Y="",_="",R=!1,W=!1,T=null,L=null,I=null,M=null,D=null,O=null,N=null;for(let V of q){if(W){if(V.type!=="space"&&V.type!=="newline"&&V.type!=="comma")Q(V.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");W=!1}if(T){if(G&&V.type!=="comment"&&V.type!=="newline")Q(T,"TAB_AS_INDENT","Tabs are not allowed as indentation");T=null}switch(V.type){case"space":if(!Z&&(X!=="doc-start"||J?.type!=="flow-collection")&&V.source.includes("\t"))T=V;B=!0;break;case"comment":{if(!B)Q(V,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let w=V.source.substring(1)||" ";if(!Y)Y=w;else Y+=_+w;_="",G=!1;break}case"newline":if(G){if(Y)Y+=V.source;else if(!O||X!=="seq-item-ind")U=!0}else _+=V.source;if(G=!0,R=!0,L||I)M=V;B=!0;break;case"anchor":if(L)Q(V,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(V.source.endsWith(":"))Q(V.offset+V.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);L=V,N??(N=V.offset),G=!1,B=!1,W=!0;break;case"tag":{if(I)Q(V,"MULTIPLE_TAGS","A node can have at most one tag");I=V,N??(N=V.offset),G=!1,B=!1,W=!0;break}case X:if(L||I)Q(V,"BAD_PROP_ORDER",`Anchors and tags must be after the ${V.source} indicator`);if(O)Q(V,"UNEXPECTED_TOKEN",`Unexpected ${V.source} in ${Z??"collection"}`);O=V,G=X==="seq-item-ind"||X==="explicit-key-ind",B=!1;break;case"comma":if(Z){if(D)Q(V,"UNEXPECTED_TOKEN",`Unexpected , in ${Z}`);D=V,G=!1,B=!1;break}default:Q(V,"UNEXPECTED_TOKEN",`Unexpected ${V.type} token`),G=!1,B=!1}}let A=q[q.length-1],K=A?A.offset+A.source.length:$;if(W&&J&&J.type!=="space"&&J.type!=="newline"&&J.type!=="comma"&&(J.type!=="scalar"||J.source!==""))Q(J.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(T&&(G&&T.indent<=z||J?.type==="block-map"||J?.type==="block-seq"))Q(T,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:D,found:O,spaceBefore:U,comment:Y,hasNewline:R,anchor:L,tag:I,newlineAfterProp:M,end:K,start:N??K}}t$.resolveProps=o$});var Uq=P((qQ)=>{function k9(q){if(!q)return null;switch(q.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(q.source.includes(`
89
+ `))return!0;if(q.end){for(let Z of q.end)if(Z.type==="newline")return!0}return!1;case"flow-collection":for(let Z of q.items){for(let X of Z.start)if(X.type==="newline")return!0;if(Z.sep){for(let X of Z.sep)if(X.type==="newline")return!0}if(k9(Z.key)||k9(Z.value))return!0}return!1;default:return!0}}qQ.containsNewline=k9});var v9=P(($Q)=>{var XQ=Uq();function JQ(q,Z,X){if(Z?.type==="flow-collection"){let J=Z.end[0];if(J.indent===q&&(J.source==="]"||J.source==="}")&&XQ.containsNewline(Z))X(J,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}$Q.flowIndentCheck=JQ});var g9=P((HQ)=>{var w3=S();function zQ(q,Z,X){let{uniqueKeys:J}=q.options;if(J===!1)return!1;let $=typeof J==="function"?J:(Q,z)=>Q===z||w3.isScalar(Q)&&w3.isScalar(z)&&Q.value===z.value;return Z.some((Q)=>$(Q.key,X))}HQ.mapIncludes=zQ});var f3=P((_Q)=>{var b3=$1(),GQ=z1(),j3=H0(),YQ=Uq(),E3=v9(),BQ=g9(),C3="All mapping items must start at the same column";function TQ({composeNode:q,composeEmptyNode:Z},X,J,$,Q){let H=new(Q?.nodeClass??GQ.YAMLMap)(X.schema);if(X.atRoot)X.atRoot=!1;let U=J.offset,G=null;for(let B of J.items){let{start:Y,key:_,sep:R,value:W}=B,T=j3.resolveProps(Y,{indicator:"explicit-key-ind",next:_??R?.[0],offset:U,onError:$,parentIndent:J.indent,startOnNewline:!0}),L=!T.found;if(L){if(_){if(_.type==="block-seq")$(U,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in _&&_.indent!==J.indent)$(U,"BAD_INDENT",C3)}if(!T.anchor&&!T.tag&&!R){if(G=T.end,T.comment)if(H.comment)H.comment+=`
90
+ `+T.comment;else H.comment=T.comment;continue}if(T.newlineAfterProp||YQ.containsNewline(_))$(_??Y[Y.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(T.found?.indent!==J.indent)$(U,"BAD_INDENT",C3);X.atKey=!0;let I=T.end,M=_?q(X,_,T,$):Z(X,I,Y,null,T,$);if(X.schema.compat)E3.flowIndentCheck(J.indent,_,$);if(X.atKey=!1,BQ.mapIncludes(X,H.items,M))$(I,"DUPLICATE_KEY","Map keys must be unique");let D=j3.resolveProps(R??[],{indicator:"map-value-ind",next:W,offset:M.range[2],onError:$,parentIndent:J.indent,startOnNewline:!_||_.type==="block-scalar"});if(U=D.end,D.found){if(L){if(W?.type==="block-map"&&!D.hasNewline)$(U,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(X.options.strict&&T.start<D.found.offset-1024)$(M.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let O=W?q(X,W,D,$):Z(X,U,R,null,D,$);if(X.schema.compat)E3.flowIndentCheck(J.indent,W,$);U=O.range[2];let N=new b3.Pair(M,O);if(X.options.keepSourceTokens)N.srcToken=B;H.items.push(N)}else{if(L)$(M.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(D.comment)if(M.comment)M.comment+=`
91
+ `+D.comment;else M.comment=D.comment;let O=new b3.Pair(M);if(X.options.keepSourceTokens)O.srcToken=B;H.items.push(O)}}if(G&&G<U)$(G,"IMPOSSIBLE","Map comment with trailing content");return H.range=[J.offset,U,G??U],H}_Q.resolveBlockMap=TQ});var x3=P((MQ)=>{var WQ=H1(),RQ=H0(),VQ=v9();function IQ({composeNode:q,composeEmptyNode:Z},X,J,$,Q){let H=new(Q?.nodeClass??WQ.YAMLSeq)(X.schema);if(X.atRoot)X.atRoot=!1;if(X.atKey)X.atKey=!1;let U=J.offset,G=null;for(let{start:B,value:Y}of J.items){let _=RQ.resolveProps(B,{indicator:"seq-item-ind",next:Y,offset:U,onError:$,parentIndent:J.indent,startOnNewline:!0});if(!_.found)if(_.anchor||_.tag||Y)if(Y?.type==="block-seq")$(_.end,"BAD_INDENT","All sequence items must start at the same column");else $(U,"MISSING_CHAR","Sequence item without - indicator");else{if(G=_.end,_.comment)H.comment=_.comment;continue}let R=Y?q(X,Y,_,$):Z(X,_.end,B,null,_,$);if(X.schema.compat)VQ.flowIndentCheck(J.indent,Y,$);U=R.range[2],H.items.push(R)}return H.range=[J.offset,U,G??U],H}MQ.resolveBlockSeq=IQ});var y1=P((PQ)=>{function DQ(q,Z,X,J){let $="";if(q){let Q=!1,z="";for(let H of q){let{source:U,type:G}=H;switch(G){case"space":Q=!0;break;case"comment":{if(X&&!Q)J(H,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let B=U.substring(1)||" ";if(!$)$=B;else $+=z+B;z="";break}case"newline":if($)z+=U;Q=!0;break;default:J(H,"UNEXPECTED_TOKEN",`Unexpected ${G} at node end`)}Z+=U.length}}return{comment:$,offset:Z}}PQ.resolveEnd=DQ});var v3=P((EQ)=>{var OQ=S(),NQ=$1(),y3=z1(),AQ=H1(),SQ=y1(),k3=H0(),wQ=Uq(),bQ=g9(),h9="Block collections are not allowed within flow collections",u9=(q)=>q&&(q.type==="block-map"||q.type==="block-seq");function jQ({composeNode:q,composeEmptyNode:Z},X,J,$,Q){let z=J.start.source==="{",H=z?"flow map":"flow sequence",G=new(Q?.nodeClass??(z?y3.YAMLMap:AQ.YAMLSeq))(X.schema);G.flow=!0;let B=X.atRoot;if(B)X.atRoot=!1;if(X.atKey)X.atKey=!1;let Y=J.offset+J.start.source.length;for(let L=0;L<J.items.length;++L){let I=J.items[L],{start:M,key:D,sep:O,value:N}=I,A=k3.resolveProps(M,{flow:H,indicator:"explicit-key-ind",next:D??O?.[0],offset:Y,onError:$,parentIndent:J.indent,startOnNewline:!1});if(!A.found){if(!A.anchor&&!A.tag&&!O&&!N){if(L===0&&A.comma)$(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${H}`);else if(L<J.items.length-1)$(A.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${H}`);if(A.comment)if(G.comment)G.comment+=`
92
+ `+A.comment;else G.comment=A.comment;Y=A.end;continue}if(!z&&X.options.strict&&wQ.containsNewline(D))$(D,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(L===0){if(A.comma)$(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${H}`)}else{if(!A.comma)$(A.start,"MISSING_CHAR",`Missing , between ${H} items`);if(A.comment){let K="";q:for(let V of M)switch(V.type){case"comma":case"space":break;case"comment":K=V.source.substring(1);break q;default:break q}if(K){let V=G.items[G.items.length-1];if(OQ.isPair(V))V=V.value??V.key;if(V.comment)V.comment+=`
93
+ `+K;else V.comment=K;A.comment=A.comment.substring(K.length+1)}}}if(!z&&!O&&!A.found){let K=N?q(X,N,A,$):Z(X,A.end,O,null,A,$);if(G.items.push(K),Y=K.range[2],u9(N))$(K.range,"BLOCK_IN_FLOW",h9)}else{X.atKey=!0;let K=A.end,V=D?q(X,D,A,$):Z(X,K,M,null,A,$);if(u9(D))$(V.range,"BLOCK_IN_FLOW",h9);X.atKey=!1;let w=k3.resolveProps(O??[],{flow:H,indicator:"map-value-ind",next:N,offset:V.range[2],onError:$,parentIndent:J.indent,startOnNewline:!1});if(w.found){if(!z&&!A.found&&X.options.strict){if(O)for(let E of O){if(E===w.found)break;if(E.type==="newline"){$(E,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(A.start<w.found.offset-1024)$(w.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(N)if("source"in N&&N.source?.[0]===":")$(N,"MISSING_CHAR",`Missing space after : in ${H}`);else $(w.start,"MISSING_CHAR",`Missing , or : between ${H} items`);let x=N?q(X,N,w,$):w.found?Z(X,w.end,O,null,w,$):null;if(x){if(u9(N))$(x.range,"BLOCK_IN_FLOW",h9)}else if(w.comment)if(V.comment)V.comment+=`
94
+ `+w.comment;else V.comment=w.comment;let y=new NQ.Pair(V,x);if(X.options.keepSourceTokens)y.srcToken=I;if(z){let E=G;if(bQ.mapIncludes(X,E.items,V))$(K,"DUPLICATE_KEY","Map keys must be unique");E.items.push(y)}else{let E=new y3.YAMLMap(X.schema);E.flow=!0,E.items.push(y);let P0=(x??V).range;E.range=[V.range[0],P0[1],P0[2]],G.items.push(E)}Y=x?x.range[2]:w.end}}let _=z?"}":"]",[R,...W]=J.end,T=Y;if(R?.source===_)T=R.offset+R.source.length;else{let L=H[0].toUpperCase()+H.substring(1),I=B?`${L} must end with a ${_}`:`${L} in block collection must be sufficiently indented and end with a ${_}`;if($(Y,B?"MISSING_CHAR":"BAD_INDENT",I),R&&R.source.length!==1)W.unshift(R)}if(W.length>0){let L=SQ.resolveEnd(W,T,X.options.strict,$);if(L.comment)if(G.comment)G.comment+=`
95
+ `+L.comment;else G.comment=L.comment;G.range=[J.offset,T,L.offset]}else G.range=[J.offset,T,T];return G}EQ.resolveFlowCollection=jQ});var g3=P((mQ)=>{var fQ=S(),xQ=C(),yQ=z1(),kQ=H1(),vQ=f3(),gQ=x3(),hQ=v3();function m9(q,Z,X,J,$,Q){let z=X.type==="block-map"?vQ.resolveBlockMap(q,Z,X,J,Q):X.type==="block-seq"?gQ.resolveBlockSeq(q,Z,X,J,Q):hQ.resolveFlowCollection(q,Z,X,J,Q),H=z.constructor;if($==="!"||$===H.tagName)return z.tag=H.tagName,z;if($)z.tag=$;return z}function uQ(q,Z,X,J,$){let Q=J.tag,z=!Q?null:Z.directives.tagName(Q.source,(_)=>$(Q,"TAG_RESOLVE_FAILED",_));if(X.type==="block-seq"){let{anchor:_,newlineAfterProp:R}=J,W=_&&Q?_.offset>Q.offset?_:Q:_??Q;if(W&&(!R||R.offset<W.offset))$(W,"MISSING_CHAR","Missing newline after block sequence props")}let H=X.type==="block-map"?"map":X.type==="block-seq"?"seq":X.start.source==="{"?"map":"seq";if(!Q||!z||z==="!"||z===yQ.YAMLMap.tagName&&H==="map"||z===kQ.YAMLSeq.tagName&&H==="seq")return m9(q,Z,X,$,z);let U=Z.schema.tags.find((_)=>_.tag===z&&_.collection===H);if(!U){let _=Z.schema.knownTags[z];if(_?.collection===H)Z.schema.tags.push(Object.assign({},_,{default:!1})),U=_;else{if(_)$(Q,"BAD_COLLECTION_TYPE",`${_.tag} used for ${H} collection, but expects ${_.collection??"scalar"}`,!0);else $(Q,"TAG_RESOLVE_FAILED",`Unresolved tag: ${z}`,!0);return m9(q,Z,X,$,z)}}let G=m9(q,Z,X,$,z,U),B=U.resolve?.(G,(_)=>$(Q,"TAG_RESOLVE_FAILED",_),Z.options)??G,Y=fQ.isNode(B)?B:new xQ.Scalar(B);if(Y.range=G.range,Y.tag=z,U?.format)Y.format=U.format;return Y}mQ.composeCollection=uQ});var l9=P((iQ)=>{var d9=C();function lQ(q,Z,X){let J=Z.offset,$=pQ(Z,q.options.strict,X);if(!$)return{value:"",type:null,comment:"",range:[J,J,J]};let Q=$.mode===">"?d9.Scalar.BLOCK_FOLDED:d9.Scalar.BLOCK_LITERAL,z=Z.source?cQ(Z.source):[],H=z.length;for(let T=z.length-1;T>=0;--T){let L=z[T][1];if(L===""||L==="\r")H=T;else break}if(H===0){let T=$.chomp==="+"&&z.length>0?`
96
+ `.repeat(Math.max(1,z.length-1)):"",L=J+$.length;if(Z.source)L+=Z.source.length;return{value:T,type:Q,comment:$.comment,range:[J,L,L]}}let U=Z.indent+$.indent,G=Z.offset+$.length,B=0;for(let T=0;T<H;++T){let[L,I]=z[T];if(I===""||I==="\r"){if($.indent===0&&L.length>U)U=L.length}else{if(L.length<U)X(G+L.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if($.indent===0)U=L.length;if(B=T,U===0&&!q.atRoot)X(G,"BAD_INDENT","Block scalar values in collections must be indented");break}G+=L.length+I.length+1}for(let T=z.length-1;T>=H;--T)if(z[T][0].length>U)H=T+1;let Y="",_="",R=!1;for(let T=0;T<B;++T)Y+=z[T][0].slice(U)+`
97
+ `;for(let T=B;T<H;++T){let[L,I]=z[T];G+=L.length+I.length+1;let M=I[I.length-1]==="\r";if(M)I=I.slice(0,-1);if(I&&L.length<U){let O=`Block scalar lines must not be less indented than their ${$.indent?"explicit indentation indicator":"first line"}`;X(G-I.length-(M?2:1),"BAD_INDENT",O),L=""}if(Q===d9.Scalar.BLOCK_LITERAL)Y+=_+L.slice(U)+I,_=`
98
+ `;else if(L.length>U||I[0]==="\t"){if(_===" ")_=`
99
+ `;else if(!R&&_===`
100
100
  `)_=`
101
101
 
102
- `;B+=_+W.slice(U)+I,_=`
103
- `,V=!0}else if(I==="")if(_===`
104
- `)B+=`
102
+ `;Y+=_+L.slice(U)+I,_=`
103
+ `,R=!0}else if(I==="")if(_===`
104
+ `)Y+=`
105
105
  `;else _=`
106
- `;else B+=_+I,_=" ",V=!1}switch($.chomp){case"-":break;case"+":for(let T=H;T<z.length;++T)B+=`
107
- `+z[T][0].slice(U);if(B[B.length-1]!==`
108
- `)B+=`
109
- `;break;default:B+=`
110
- `}let R=J+$.length+Z.source.length;return{value:B,type:Q,comment:$.comment,range:[J,R,R]}}function pQ({offset:q,props:Z},X,J){if(Z[0].type!=="block-scalar-header")return J(Z[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:$}=Z[0],Q=$[0],z=0,H="",U=-1;for(let _=1;_<$.length;++_){let V=$[_];if(!H&&(V==="-"||V==="+"))H=V;else{let R=Number(V);if(!z&&R)z=R;else if(U===-1)U=q+_}}if(U!==-1)J(U,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${$}`);let G=!1,Y="",B=$.length;for(let _=1;_<Z.length;++_){let V=Z[_];switch(V.type){case"space":G=!0;case"newline":B+=V.source.length;break;case"comment":if(X&&!G)J(V,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");B+=V.source.length,Y=V.source.substring(1);break;case"error":J(V,"UNEXPECTED_TOKEN",V.message),B+=V.source.length;break;default:{let R=`Unexpected token in block scalar header: ${V.type}`;J(V,"UNEXPECTED_TOKEN",R);let T=V.source;if(T&&typeof T==="string")B+=T.length}}}return{mode:Q,indent:z,chomp:H,comment:Y,length:B}}function cQ(q){let Z=q.split(/\n( *)/),X=Z[0],J=X.match(/^( *)/),Q=[J?.[1]?[J[1],X.slice(J[1].length)]:["",X]];for(let z=1;z<Z.length;z+=2)Q.push([Z[z],Z[z+1]]);return Q}iQ.resolveBlockScalar=lQ});var i9=D((Xz)=>{var c9=E(),sQ=x1();function rQ(q,Z,X){let{offset:J,type:$,source:Q,end:z}=q,H,U,G=(_,V,R)=>X(J+_,V,R);switch($){case"scalar":H=c9.Scalar.PLAIN,U=nQ(Q,G);break;case"single-quoted-scalar":H=c9.Scalar.QUOTE_SINGLE,U=oQ(Q,G);break;case"double-quoted-scalar":H=c9.Scalar.QUOTE_DOUBLE,U=tQ(Q,G);break;default:return X(q,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${$}`),{value:"",type:null,comment:"",range:[J,J+Q.length,J+Q.length]}}let Y=J+Q.length,B=sQ.resolveEnd(z,Y,Z,X);return{value:U,type:H,comment:B.comment,range:[J,Y,B.offset]}}function nQ(q,Z){let X="";switch(q[0]){case"\t":X="a tab character";break;case",":X="flow indicator character ,";break;case"%":X="directive indicator character %";break;case"|":case">":{X=`block scalar indicator ${q[0]}`;break}case"@":case"`":{X=`reserved character ${q[0]}`;break}}if(X)Z(0,"BAD_SCALAR_START",`Plain value cannot start with ${X}`);return u3(q)}function oQ(q,Z){if(q[q.length-1]!=="'"||q.length===1)Z(q.length,"MISSING_CHAR","Missing closing 'quote");return u3(q.slice(1,-1)).replace(/''/g,"'")}function u3(q){let Z,X;try{Z=new RegExp(`(.*?)(?<![ ])[ ]*\r?
106
+ `;else Y+=_+I,_=" ",R=!1}switch($.chomp){case"-":break;case"+":for(let T=H;T<z.length;++T)Y+=`
107
+ `+z[T][0].slice(U);if(Y[Y.length-1]!==`
108
+ `)Y+=`
109
+ `;break;default:Y+=`
110
+ `}let W=J+$.length+Z.source.length;return{value:Y,type:Q,comment:$.comment,range:[J,W,W]}}function pQ({offset:q,props:Z},X,J){if(Z[0].type!=="block-scalar-header")return J(Z[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:$}=Z[0],Q=$[0],z=0,H="",U=-1;for(let _=1;_<$.length;++_){let R=$[_];if(!H&&(R==="-"||R==="+"))H=R;else{let W=Number(R);if(!z&&W)z=W;else if(U===-1)U=q+_}}if(U!==-1)J(U,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${$}`);let G=!1,B="",Y=$.length;for(let _=1;_<Z.length;++_){let R=Z[_];switch(R.type){case"space":G=!0;case"newline":Y+=R.source.length;break;case"comment":if(X&&!G)J(R,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");Y+=R.source.length,B=R.source.substring(1);break;case"error":J(R,"UNEXPECTED_TOKEN",R.message),Y+=R.source.length;break;default:{let W=`Unexpected token in block scalar header: ${R.type}`;J(R,"UNEXPECTED_TOKEN",W);let T=R.source;if(T&&typeof T==="string")Y+=T.length}}}return{mode:Q,indent:z,chomp:H,comment:B,length:Y}}function cQ(q){let Z=q.split(/\n( *)/),X=Z[0],J=X.match(/^( *)/),Q=[J?.[1]?[J[1],X.slice(J[1].length)]:["",X]];for(let z=1;z<Z.length;z+=2)Q.push([Z[z],Z[z+1]]);return Q}iQ.resolveBlockScalar=lQ});var c9=P((Xz)=>{var p9=C(),sQ=y1();function rQ(q,Z,X){let{offset:J,type:$,source:Q,end:z}=q,H,U,G=(_,R,W)=>X(J+_,R,W);switch($){case"scalar":H=p9.Scalar.PLAIN,U=nQ(Q,G);break;case"single-quoted-scalar":H=p9.Scalar.QUOTE_SINGLE,U=oQ(Q,G);break;case"double-quoted-scalar":H=p9.Scalar.QUOTE_DOUBLE,U=tQ(Q,G);break;default:return X(q,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${$}`),{value:"",type:null,comment:"",range:[J,J+Q.length,J+Q.length]}}let B=J+Q.length,Y=sQ.resolveEnd(z,B,Z,X);return{value:U,type:H,comment:Y.comment,range:[J,B,Y.offset]}}function nQ(q,Z){let X="";switch(q[0]){case"\t":X="a tab character";break;case",":X="flow indicator character ,";break;case"%":X="directive indicator character %";break;case"|":case">":{X=`block scalar indicator ${q[0]}`;break}case"@":case"`":{X=`reserved character ${q[0]}`;break}}if(X)Z(0,"BAD_SCALAR_START",`Plain value cannot start with ${X}`);return h3(q)}function oQ(q,Z){if(q[q.length-1]!=="'"||q.length===1)Z(q.length,"MISSING_CHAR","Missing closing 'quote");return h3(q.slice(1,-1)).replace(/''/g,"'")}function h3(q){let Z,X;try{Z=new RegExp(`(.*?)(?<![ ])[ ]*\r?
111
111
  `,"sy"),X=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
112
112
  `,"sy")}catch{Z=/(.*?)[ \t]*\r?\n/sy,X=/[ \t]*(.*?)[ \t]*\r?\n/sy}let J=Z.exec(q);if(!J)return q;let $=J[1],Q=" ",z=Z.lastIndex;X.lastIndex=z;while(J=X.exec(q)){if(J[1]==="")if(Q===`
113
113
  `)$+=Q;else Q=`
@@ -122,129 +122,129 @@ ${G}
122
122
  `)break;if(J===`
123
123
  `)X+=`
124
124
  `;Z+=1,J=q[Z+1]}if(!X)X=" ";return{fold:X,offset:Z}}var qz={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
125
- `,r:"\r",t:"\t",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function Zz(q,Z,X,J){let $=q.substr(Z,X),z=$.length===X&&/^[0-9a-fA-F]+$/.test($)?parseInt($,16):NaN;if(isNaN(z)){let H=q.substr(Z-2,X+2);return J(Z-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${H}`),H}return String.fromCodePoint(z)}Xz.resolveFlowScalar=rQ});var d3=D((Gz)=>{var P1=S(),m3=E(),$z=p9(),Qz=i9();function zz(q,Z,X,J){let{value:$,type:Q,comment:z,range:H}=Z.type==="block-scalar"?$z.resolveBlockScalar(q,Z,J):Qz.resolveFlowScalar(Z,q.options.strict,J),U=X?q.directives.tagName(X.source,(B)=>J(X,"TAG_RESOLVE_FAILED",B)):null,G;if(q.options.stringKeys&&q.atKey)G=q.schema[P1.SCALAR];else if(U)G=Hz(q.schema,$,U,X,J);else if(Z.type==="scalar")G=Uz(q,$,Z,J);else G=q.schema[P1.SCALAR];let Y;try{let B=G.resolve($,(_)=>J(X??Z,"TAG_RESOLVE_FAILED",_),q.options);Y=P1.isScalar(B)?B:new m3.Scalar(B)}catch(B){let _=B instanceof Error?B.message:String(B);J(X??Z,"TAG_RESOLVE_FAILED",_),Y=new m3.Scalar($)}if(Y.range=H,Y.source=$,Q)Y.type=Q;if(U)Y.tag=U;if(G.format)Y.format=G.format;if(z)Y.comment=z;return Y}function Hz(q,Z,X,J,$){if(X==="!")return q[P1.SCALAR];let Q=[];for(let H of q.tags)if(!H.collection&&H.tag===X)if(H.default&&H.test)Q.push(H);else return H;for(let H of Q)if(H.test?.test(Z))return H;let z=q.knownTags[X];if(z&&!z.collection)return q.tags.push(Object.assign({},z,{default:!1,test:void 0})),z;return $(J,"TAG_RESOLVE_FAILED",`Unresolved tag: ${X}`,X!=="tag:yaml.org,2002:str"),q[P1.SCALAR]}function Uz({atKey:q,directives:Z,schema:X},J,$,Q){let z=X.tags.find((H)=>(H.default===!0||q&&H.default==="key")&&H.test?.test(J))||X[P1.SCALAR];if(X.compat){let H=X.compat.find((U)=>U.default&&U.test?.test(J))??X[P1.SCALAR];if(z.tag!==H.tag){let U=Z.tagString(z.tag),G=Z.tagString(H.tag),Y=`Value may be parsed as either ${U} or ${G}`;Q($,"TAG_RESOLVE_FAILED",Y,!0)}}return z}Gz.composeScalar=zz});var l3=D((Tz)=>{function Bz(q,Z,X){if(Z){X??(X=Z.length);for(let J=X-1;J>=0;--J){let $=Z[J];switch($.type){case"space":case"comment":case"newline":q-=$.source.length;continue}$=Z[++J];while($?.type==="space")q+=$.source.length,$=Z[++J];break}}return q}Tz.emptyScalarPosition=Bz});var i3=D((Pz)=>{var Wz=l1(),Rz=S(),Vz=h3(),p3=d3(),Lz=x1(),Iz=l3(),Mz={composeNode:c3,composeEmptyNode:a9};function c3(q,Z,X,J){let $=q.atKey,{spaceBefore:Q,comment:z,anchor:H,tag:U}=X,G,Y=!0;switch(Z.type){case"alias":if(G=Kz(q,Z,J),H||U)J(Z,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(G=p3.composeScalar(q,Z,U,J),H)G.anchor=H.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":if(G=Vz.composeCollection(Mz,q,Z,X,J),H)G.anchor=H.source.substring(1);break;default:{let B=Z.type==="error"?Z.message:`Unsupported token (type: ${Z.type})`;J(Z,"UNEXPECTED_TOKEN",B),G=a9(q,Z.offset,void 0,null,X,J),Y=!1}}if(H&&G.anchor==="")J(H,"BAD_ALIAS","Anchor cannot be an empty string");if($&&q.options.stringKeys&&(!Rz.isScalar(G)||typeof G.value!=="string"||G.tag&&G.tag!=="tag:yaml.org,2002:str"))J(U??Z,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(Q)G.spaceBefore=!0;if(z)if(Z.type==="scalar"&&Z.source==="")G.comment=z;else G.commentBefore=z;if(q.options.keepSourceTokens&&Y)G.srcToken=Z;return G}function a9(q,Z,X,J,{spaceBefore:$,comment:Q,anchor:z,tag:H,end:U},G){let Y={type:"scalar",offset:Iz.emptyScalarPosition(Z,X,J),indent:-1,source:""},B=p3.composeScalar(q,Y,H,G);if(z){if(B.anchor=z.source.substring(1),B.anchor==="")G(z,"BAD_ALIAS","Anchor cannot be an empty string")}if($)B.spaceBefore=!0;if(Q)B.comment=Q,B.range[2]=U;return B}function Kz({options:q},{offset:Z,source:X,end:J},$){let Q=new Wz.Alias(X.substring(1));if(Q.source==="")$(Z,"BAD_ALIAS","Alias cannot be an empty string");if(Q.source.endsWith(":"))$(Z+X.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let z=Z+X.length,H=Lz.resolveEnd(J,z,q.strict,$);if(Q.range=[Z,z,H.offset],H.comment)Q.comment=H.comment;return Q}Pz.composeEmptyNode=a9;Pz.composeNode=c3});var s3=D((wz)=>{var Oz=$0(),a3=i3(),Nz=x1(),Az=z0();function Sz(q,Z,{offset:X,start:J,value:$,end:Q},z){let H=Object.assign({_directives:Z},q),U=new Oz.Document(void 0,H),G={atKey:!1,atRoot:!0,directives:U.directives,options:U.options,schema:U.schema},Y=Az.resolveProps(J,{indicator:"doc-start",next:$??Q?.[0],offset:X,onError:z,parentIndent:0,startOnNewline:!0});if(Y.found){if(U.directives.docStart=!0,$&&($.type==="block-map"||$.type==="block-seq")&&!Y.hasNewline)z(Y.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}U.contents=$?a3.composeNode(G,$,Y,z):a3.composeEmptyNode(G,Y.end,J,null,Y,z);let B=U.contents.range[2],_=Nz.resolveEnd(Q,B,!1,z);if(_.comment)U.comment=_.comment;return U.range=[X,B,_.offset],U}wz.composeDoc=Sz});var s9=D((xz)=>{var jz=r("process"),Cz=tq(),Ez=$0(),H0=Q0(),r3=S(),fz=s3(),yz=x1();function U0(q){if(typeof q==="number")return[q,q+1];if(Array.isArray(q))return q.length===2?q:[q[0],q[1]];let{offset:Z,source:X}=q;return[Z,Z+(typeof X==="string"?X.length:1)]}function n3(q){let Z="",X=!1,J=!1;for(let $=0;$<q.length;++$){let Q=q[$];switch(Q[0]){case"#":Z+=(Z===""?"":J?`
125
+ `,r:"\r",t:"\t",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function Zz(q,Z,X,J){let $=q.substr(Z,X),z=$.length===X&&/^[0-9a-fA-F]+$/.test($)?parseInt($,16):NaN;if(isNaN(z)){let H=q.substr(Z-2,X+2);return J(Z-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${H}`),H}return String.fromCodePoint(z)}Xz.resolveFlowScalar=rQ});var m3=P((Gz)=>{var D1=S(),u3=C(),$z=l9(),Qz=c9();function zz(q,Z,X,J){let{value:$,type:Q,comment:z,range:H}=Z.type==="block-scalar"?$z.resolveBlockScalar(q,Z,J):Qz.resolveFlowScalar(Z,q.options.strict,J),U=X?q.directives.tagName(X.source,(Y)=>J(X,"TAG_RESOLVE_FAILED",Y)):null,G;if(q.options.stringKeys&&q.atKey)G=q.schema[D1.SCALAR];else if(U)G=Hz(q.schema,$,U,X,J);else if(Z.type==="scalar")G=Uz(q,$,Z,J);else G=q.schema[D1.SCALAR];let B;try{let Y=G.resolve($,(_)=>J(X??Z,"TAG_RESOLVE_FAILED",_),q.options);B=D1.isScalar(Y)?Y:new u3.Scalar(Y)}catch(Y){let _=Y instanceof Error?Y.message:String(Y);J(X??Z,"TAG_RESOLVE_FAILED",_),B=new u3.Scalar($)}if(B.range=H,B.source=$,Q)B.type=Q;if(U)B.tag=U;if(G.format)B.format=G.format;if(z)B.comment=z;return B}function Hz(q,Z,X,J,$){if(X==="!")return q[D1.SCALAR];let Q=[];for(let H of q.tags)if(!H.collection&&H.tag===X)if(H.default&&H.test)Q.push(H);else return H;for(let H of Q)if(H.test?.test(Z))return H;let z=q.knownTags[X];if(z&&!z.collection)return q.tags.push(Object.assign({},z,{default:!1,test:void 0})),z;return $(J,"TAG_RESOLVE_FAILED",`Unresolved tag: ${X}`,X!=="tag:yaml.org,2002:str"),q[D1.SCALAR]}function Uz({atKey:q,directives:Z,schema:X},J,$,Q){let z=X.tags.find((H)=>(H.default===!0||q&&H.default==="key")&&H.test?.test(J))||X[D1.SCALAR];if(X.compat){let H=X.compat.find((U)=>U.default&&U.test?.test(J))??X[D1.SCALAR];if(z.tag!==H.tag){let U=Z.tagString(z.tag),G=Z.tagString(H.tag),B=`Value may be parsed as either ${U} or ${G}`;Q($,"TAG_RESOLVE_FAILED",B,!0)}}return z}Gz.composeScalar=zz});var d3=P((Tz)=>{function Bz(q,Z,X){if(Z){X??(X=Z.length);for(let J=X-1;J>=0;--J){let $=Z[J];switch($.type){case"space":case"comment":case"newline":q-=$.source.length;continue}$=Z[++J];while($?.type==="space")q+=$.source.length,$=Z[++J];break}}return q}Tz.emptyScalarPosition=Bz});var c3=P((Dz)=>{var Lz=p1(),Wz=S(),Rz=g3(),l3=m3(),Vz=y1(),Iz=d3(),Mz={composeNode:p3,composeEmptyNode:i9};function p3(q,Z,X,J){let $=q.atKey,{spaceBefore:Q,comment:z,anchor:H,tag:U}=X,G,B=!0;switch(Z.type){case"alias":if(G=Kz(q,Z,J),H||U)J(Z,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(G=l3.composeScalar(q,Z,U,J),H)G.anchor=H.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":if(G=Rz.composeCollection(Mz,q,Z,X,J),H)G.anchor=H.source.substring(1);break;default:{let Y=Z.type==="error"?Z.message:`Unsupported token (type: ${Z.type})`;J(Z,"UNEXPECTED_TOKEN",Y),G=i9(q,Z.offset,void 0,null,X,J),B=!1}}if(H&&G.anchor==="")J(H,"BAD_ALIAS","Anchor cannot be an empty string");if($&&q.options.stringKeys&&(!Wz.isScalar(G)||typeof G.value!=="string"||G.tag&&G.tag!=="tag:yaml.org,2002:str"))J(U??Z,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(Q)G.spaceBefore=!0;if(z)if(Z.type==="scalar"&&Z.source==="")G.comment=z;else G.commentBefore=z;if(q.options.keepSourceTokens&&B)G.srcToken=Z;return G}function i9(q,Z,X,J,{spaceBefore:$,comment:Q,anchor:z,tag:H,end:U},G){let B={type:"scalar",offset:Iz.emptyScalarPosition(Z,X,J),indent:-1,source:""},Y=l3.composeScalar(q,B,H,G);if(z){if(Y.anchor=z.source.substring(1),Y.anchor==="")G(z,"BAD_ALIAS","Anchor cannot be an empty string")}if($)Y.spaceBefore=!0;if(Q)Y.comment=Q,Y.range[2]=U;return Y}function Kz({options:q},{offset:Z,source:X,end:J},$){let Q=new Lz.Alias(X.substring(1));if(Q.source==="")$(Z,"BAD_ALIAS","Alias cannot be an empty string");if(Q.source.endsWith(":"))$(Z+X.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let z=Z+X.length,H=Vz.resolveEnd(J,z,q.strict,$);if(Q.range=[Z,z,H.offset],H.comment)Q.comment=H.comment;return Q}Dz.composeEmptyNode=i9;Dz.composeNode=p3});var a3=P((wz)=>{var Oz=Q0(),i3=c3(),Nz=y1(),Az=H0();function Sz(q,Z,{offset:X,start:J,value:$,end:Q},z){let H=Object.assign({_directives:Z},q),U=new Oz.Document(void 0,H),G={atKey:!1,atRoot:!0,directives:U.directives,options:U.options,schema:U.schema},B=Az.resolveProps(J,{indicator:"doc-start",next:$??Q?.[0],offset:X,onError:z,parentIndent:0,startOnNewline:!0});if(B.found){if(U.directives.docStart=!0,$&&($.type==="block-map"||$.type==="block-seq")&&!B.hasNewline)z(B.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}U.contents=$?i3.composeNode(G,$,B,z):i3.composeEmptyNode(G,B.end,J,null,B,z);let Y=U.contents.range[2],_=Nz.resolveEnd(Q,Y,!1,z);if(_.comment)U.comment=_.comment;return U.range=[X,Y,_.offset],U}wz.composeDoc=Sz});var a9=P((yz)=>{var jz=r("process"),Ez=oq(),Cz=Q0(),U0=z0(),s3=S(),fz=a3(),xz=y1();function G0(q){if(typeof q==="number")return[q,q+1];if(Array.isArray(q))return q.length===2?q:[q[0],q[1]];let{offset:Z,source:X}=q;return[Z,Z+(typeof X==="string"?X.length:1)]}function r3(q){let Z="",X=!1,J=!1;for(let $=0;$<q.length;++$){let Q=q[$];switch(Q[0]){case"#":Z+=(Z===""?"":J?`
126
126
 
127
127
  `:`
128
- `)+(Q.substring(1)||" "),X=!0,J=!1;break;case"%":if(q[$+1]?.[0]!=="#")$+=1;X=!1;break;default:if(!X)J=!0;X=!1}}return{comment:Z,afterEmptyLine:J}}class o3{constructor(q={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(Z,X,J,$)=>{let Q=U0(Z);if($)this.warnings.push(new H0.YAMLWarning(Q,X,J));else this.errors.push(new H0.YAMLParseError(Q,X,J))},this.directives=new Cz.Directives({version:q.version||"1.2"}),this.options=q}decorate(q,Z){let{comment:X,afterEmptyLine:J}=n3(this.prelude);if(X){let $=q.contents;if(Z)q.comment=q.comment?`${q.comment}
129
- ${X}`:X;else if(J||q.directives.docStart||!$)q.commentBefore=X;else if(r3.isCollection($)&&!$.flow&&$.items.length>0){let Q=$.items[0];if(r3.isPair(Q))Q=Q.key;let z=Q.commentBefore;Q.commentBefore=z?`${X}
128
+ `)+(Q.substring(1)||" "),X=!0,J=!1;break;case"%":if(q[$+1]?.[0]!=="#")$+=1;X=!1;break;default:if(!X)J=!0;X=!1}}return{comment:Z,afterEmptyLine:J}}class n3{constructor(q={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(Z,X,J,$)=>{let Q=G0(Z);if($)this.warnings.push(new U0.YAMLWarning(Q,X,J));else this.errors.push(new U0.YAMLParseError(Q,X,J))},this.directives=new Ez.Directives({version:q.version||"1.2"}),this.options=q}decorate(q,Z){let{comment:X,afterEmptyLine:J}=r3(this.prelude);if(X){let $=q.contents;if(Z)q.comment=q.comment?`${q.comment}
129
+ ${X}`:X;else if(J||q.directives.docStart||!$)q.commentBefore=X;else if(s3.isCollection($)&&!$.flow&&$.items.length>0){let Q=$.items[0];if(s3.isPair(Q))Q=Q.key;let z=Q.commentBefore;Q.commentBefore=z?`${X}
130
130
  ${z}`:X}else{let Q=$.commentBefore;$.commentBefore=Q?`${X}
131
- ${Q}`:X}}if(Z)Array.prototype.push.apply(q.errors,this.errors),Array.prototype.push.apply(q.warnings,this.warnings);else q.errors=this.errors,q.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:n3(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(q,Z=!1,X=-1){for(let J of q)yield*this.next(J);yield*this.end(Z,X)}*next(q){if(jz.env.LOG_STREAM)console.dir(q,{depth:null});switch(q.type){case"directive":this.directives.add(q.source,(Z,X,J)=>{let $=U0(q);$[0]+=Z,this.onError($,"BAD_DIRECTIVE",X,J)}),this.prelude.push(q.source),this.atDirectives=!0;break;case"document":{let Z=fz.composeDoc(this.options,this.directives,q,this.onError);if(this.atDirectives&&!Z.directives.docStart)this.onError(q,"MISSING_CHAR","Missing directives-end/doc-start indicator line");if(this.decorate(Z,!1),this.doc)yield this.doc;this.doc=Z,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(q.source);break;case"error":{let Z=q.source?`${q.message}: ${JSON.stringify(q.source)}`:q.message,X=new H0.YAMLParseError(U0(q),"UNEXPECTED_TOKEN",Z);if(this.atDirectives||!this.doc)this.errors.push(X);else this.doc.errors.push(X);break}case"doc-end":{if(!this.doc){this.errors.push(new H0.YAMLParseError(U0(q),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let Z=yz.resolveEnd(q.end,q.offset+q.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),Z.comment){let X=this.doc.comment;this.doc.comment=X?`${X}
132
- ${Z.comment}`:Z.comment}this.doc.range[2]=Z.offset;break}default:this.errors.push(new H0.YAMLParseError(U0(q),"UNEXPECTED_TOKEN",`Unsupported token ${q.type}`))}}*end(q=!1,Z=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(q){let X=Object.assign({_directives:this.directives},this.options),J=new Ez.Document(void 0,X);if(this.atDirectives)this.onError(Z,"MISSING_CHAR","Missing directives-end indicator line");J.range=[0,Z,Z],this.decorate(J,!1),yield J}}}xz.Composer=o3});var q5=D((pz)=>{var vz=p9(),gz=i9(),hz=Q0(),t3=a1();function uz(q,Z=!0,X){if(q){let J=($,Q,z)=>{let H=typeof $==="number"?$:Array.isArray($)?$[0]:$.offset;if(X)X(H,Q,z);else throw new hz.YAMLParseError([H,H+1],Q,z)};switch(q.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return gz.resolveFlowScalar(q,Z,J);case"block-scalar":return vz.resolveBlockScalar({options:{strict:Z}},q,J)}}return null}function mz(q,Z){let{implicitKey:X=!1,indent:J,inFlow:$=!1,offset:Q=-1,type:z="PLAIN"}=Z,H=t3.stringifyString({type:z,value:q},{implicitKey:X,indent:J>0?" ".repeat(J):"",inFlow:$,options:{blockQuote:!0,lineWidth:-1}}),U=Z.end??[{type:"newline",offset:-1,indent:J,source:`
131
+ ${Q}`:X}}if(Z)Array.prototype.push.apply(q.errors,this.errors),Array.prototype.push.apply(q.warnings,this.warnings);else q.errors=this.errors,q.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:r3(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(q,Z=!1,X=-1){for(let J of q)yield*this.next(J);yield*this.end(Z,X)}*next(q){if(jz.env.LOG_STREAM)console.dir(q,{depth:null});switch(q.type){case"directive":this.directives.add(q.source,(Z,X,J)=>{let $=G0(q);$[0]+=Z,this.onError($,"BAD_DIRECTIVE",X,J)}),this.prelude.push(q.source),this.atDirectives=!0;break;case"document":{let Z=fz.composeDoc(this.options,this.directives,q,this.onError);if(this.atDirectives&&!Z.directives.docStart)this.onError(q,"MISSING_CHAR","Missing directives-end/doc-start indicator line");if(this.decorate(Z,!1),this.doc)yield this.doc;this.doc=Z,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(q.source);break;case"error":{let Z=q.source?`${q.message}: ${JSON.stringify(q.source)}`:q.message,X=new U0.YAMLParseError(G0(q),"UNEXPECTED_TOKEN",Z);if(this.atDirectives||!this.doc)this.errors.push(X);else this.doc.errors.push(X);break}case"doc-end":{if(!this.doc){this.errors.push(new U0.YAMLParseError(G0(q),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let Z=xz.resolveEnd(q.end,q.offset+q.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),Z.comment){let X=this.doc.comment;this.doc.comment=X?`${X}
132
+ ${Z.comment}`:Z.comment}this.doc.range[2]=Z.offset;break}default:this.errors.push(new U0.YAMLParseError(G0(q),"UNEXPECTED_TOKEN",`Unsupported token ${q.type}`))}}*end(q=!1,Z=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(q){let X=Object.assign({_directives:this.directives},this.options),J=new Cz.Document(void 0,X);if(this.atDirectives)this.onError(Z,"MISSING_CHAR","Missing directives-end indicator line");J.range=[0,Z,Z],this.decorate(J,!1),yield J}}}yz.Composer=n3});var e3=P((pz)=>{var vz=l9(),gz=c9(),hz=z0(),o3=s1();function uz(q,Z=!0,X){if(q){let J=($,Q,z)=>{let H=typeof $==="number"?$:Array.isArray($)?$[0]:$.offset;if(X)X(H,Q,z);else throw new hz.YAMLParseError([H,H+1],Q,z)};switch(q.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return gz.resolveFlowScalar(q,Z,J);case"block-scalar":return vz.resolveBlockScalar({options:{strict:Z}},q,J)}}return null}function mz(q,Z){let{implicitKey:X=!1,indent:J,inFlow:$=!1,offset:Q=-1,type:z="PLAIN"}=Z,H=o3.stringifyString({type:z,value:q},{implicitKey:X,indent:J>0?" ".repeat(J):"",inFlow:$,options:{blockQuote:!0,lineWidth:-1}}),U=Z.end??[{type:"newline",offset:-1,indent:J,source:`
133
133
  `}];switch(H[0]){case"|":case">":{let G=H.indexOf(`
134
- `),Y=H.substring(0,G),B=H.substring(G+1)+`
135
- `,_=[{type:"block-scalar-header",offset:Q,indent:J,source:Y}];if(!e3(_,U))_.push({type:"newline",offset:-1,indent:J,source:`
136
- `});return{type:"block-scalar",offset:Q,indent:J,props:_,source:B}}case'"':return{type:"double-quoted-scalar",offset:Q,indent:J,source:H,end:U};case"'":return{type:"single-quoted-scalar",offset:Q,indent:J,source:H,end:U};default:return{type:"scalar",offset:Q,indent:J,source:H,end:U}}}function dz(q,Z,X={}){let{afterKey:J=!1,implicitKey:$=!1,inFlow:Q=!1,type:z}=X,H="indent"in q?q.indent:null;if(J&&typeof H==="number")H+=2;if(!z)switch(q.type){case"single-quoted-scalar":z="QUOTE_SINGLE";break;case"double-quoted-scalar":z="QUOTE_DOUBLE";break;case"block-scalar":{let G=q.props[0];if(G.type!=="block-scalar-header")throw Error("Invalid block scalar header");z=G.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:z="PLAIN"}let U=t3.stringifyString({type:z,value:Z},{implicitKey:$||H===null,indent:H!==null&&H>0?" ".repeat(H):"",inFlow:Q,options:{blockQuote:!0,lineWidth:-1}});switch(U[0]){case"|":case">":lz(q,U);break;case'"':r9(q,U,"double-quoted-scalar");break;case"'":r9(q,U,"single-quoted-scalar");break;default:r9(q,U,"scalar")}}function lz(q,Z){let X=Z.indexOf(`
134
+ `),B=H.substring(0,G),Y=H.substring(G+1)+`
135
+ `,_=[{type:"block-scalar-header",offset:Q,indent:J,source:B}];if(!t3(_,U))_.push({type:"newline",offset:-1,indent:J,source:`
136
+ `});return{type:"block-scalar",offset:Q,indent:J,props:_,source:Y}}case'"':return{type:"double-quoted-scalar",offset:Q,indent:J,source:H,end:U};case"'":return{type:"single-quoted-scalar",offset:Q,indent:J,source:H,end:U};default:return{type:"scalar",offset:Q,indent:J,source:H,end:U}}}function dz(q,Z,X={}){let{afterKey:J=!1,implicitKey:$=!1,inFlow:Q=!1,type:z}=X,H="indent"in q?q.indent:null;if(J&&typeof H==="number")H+=2;if(!z)switch(q.type){case"single-quoted-scalar":z="QUOTE_SINGLE";break;case"double-quoted-scalar":z="QUOTE_DOUBLE";break;case"block-scalar":{let G=q.props[0];if(G.type!=="block-scalar-header")throw Error("Invalid block scalar header");z=G.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:z="PLAIN"}let U=o3.stringifyString({type:z,value:Z},{implicitKey:$||H===null,indent:H!==null&&H>0?" ".repeat(H):"",inFlow:Q,options:{blockQuote:!0,lineWidth:-1}});switch(U[0]){case"|":case">":lz(q,U);break;case'"':s9(q,U,"double-quoted-scalar");break;case"'":s9(q,U,"single-quoted-scalar");break;default:s9(q,U,"scalar")}}function lz(q,Z){let X=Z.indexOf(`
137
137
  `),J=Z.substring(0,X),$=Z.substring(X+1)+`
138
- `;if(q.type==="block-scalar"){let Q=q.props[0];if(Q.type!=="block-scalar-header")throw Error("Invalid block scalar header");Q.source=J,q.source=$}else{let{offset:Q}=q,z="indent"in q?q.indent:-1,H=[{type:"block-scalar-header",offset:Q,indent:z,source:J}];if(!e3(H,"end"in q?q.end:void 0))H.push({type:"newline",offset:-1,indent:z,source:`
139
- `});for(let U of Object.keys(q))if(U!=="type"&&U!=="offset")delete q[U];Object.assign(q,{type:"block-scalar",indent:z,props:H,source:$})}}function e3(q,Z){if(Z)for(let X of Z)switch(X.type){case"space":case"comment":q.push(X);break;case"newline":return q.push(X),!0}return!1}function r9(q,Z,X){switch(q.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":q.type=X,q.source=Z;break;case"block-scalar":{let J=q.props.slice(1),$=Z.length;if(q.props[0].type==="block-scalar-header")$-=q.props[0].source.length;for(let Q of J)Q.offset+=$;delete q.props,Object.assign(q,{type:X,source:Z,end:J});break}case"block-map":case"block-seq":{let $={type:"newline",offset:q.offset+Z.length,indent:q.indent,source:`
140
- `};delete q.items,Object.assign(q,{type:X,source:Z,end:[$]});break}default:{let J="indent"in q?q.indent:-1,$="end"in q&&Array.isArray(q.end)?q.end.filter((Q)=>Q.type==="space"||Q.type==="comment"||Q.type==="newline"):[];for(let Q of Object.keys(q))if(Q!=="type"&&Q!=="offset")delete q[Q];Object.assign(q,{type:X,indent:J,source:Z,end:$})}}}pz.createScalarToken=mz;pz.resolveAsScalar=uz;pz.setScalarValue=dz});var Z5=D((rz)=>{var sz=(q)=>("type"in q)?Gq(q):Uq(q);function Gq(q){switch(q.type){case"block-scalar":{let Z="";for(let X of q.props)Z+=Gq(X);return Z+q.source}case"block-map":case"block-seq":{let Z="";for(let X of q.items)Z+=Uq(X);return Z}case"flow-collection":{let Z=q.start.source;for(let X of q.items)Z+=Uq(X);for(let X of q.end)Z+=X.source;return Z}case"document":{let Z=Uq(q);if(q.end)for(let X of q.end)Z+=X.source;return Z}default:{let Z=q.source;if("end"in q&&q.end)for(let X of q.end)Z+=X.source;return Z}}}function Uq({start:q,key:Z,sep:X,value:J}){let $="";for(let Q of q)$+=Q.source;if(Z)$+=Gq(Z);if(X)for(let Q of X)$+=Q.source;if(J)$+=Gq(J);return $}rz.stringify=sz});var $5=D((tz)=>{var n9=Symbol("break visit"),oz=Symbol("skip children"),X5=Symbol("remove item");function D1(q,Z){if("type"in q&&q.type==="document")q={start:q.start,value:q.value};J5(Object.freeze([]),q,Z)}D1.BREAK=n9;D1.SKIP=oz;D1.REMOVE=X5;D1.itemAtPath=(q,Z)=>{let X=q;for(let[J,$]of Z){let Q=X?.[J];if(Q&&"items"in Q)X=Q.items[$];else return}return X};D1.parentCollection=(q,Z)=>{let X=D1.itemAtPath(q,Z.slice(0,-1)),J=Z[Z.length-1][0],$=X?.[J];if($&&"items"in $)return $;throw Error("Parent collection not found")};function J5(q,Z,X){let J=X(Z,q);if(typeof J==="symbol")return J;for(let $ of["key","value"]){let Q=Z[$];if(Q&&"items"in Q){for(let z=0;z<Q.items.length;++z){let H=J5(Object.freeze(q.concat([[$,z]])),Q.items[z],X);if(typeof H==="number")z=H-1;else if(H===n9)return n9;else if(H===X5)Q.items.splice(z,1),z-=1}if(typeof J==="function"&&$==="key")J=J(Z,q)}}return typeof J==="function"?J(Z,q):J}tz.visit=D1});var Yq=D((zH)=>{var o9=q5(),qH=Z5(),ZH=$5(),t9="\uFEFF",e9="\x02",q4="\x18",Z4="\x1F",XH=(q)=>!!q&&("items"in q),JH=(q)=>!!q&&(q.type==="scalar"||q.type==="single-quoted-scalar"||q.type==="double-quoted-scalar"||q.type==="block-scalar");function $H(q){switch(q){case t9:return"<BOM>";case e9:return"<DOC>";case q4:return"<FLOW_END>";case Z4:return"<SCALAR>";default:return JSON.stringify(q)}}function QH(q){switch(q){case t9:return"byte-order-mark";case e9:return"doc-mode";case q4:return"flow-error-end";case Z4:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
138
+ `;if(q.type==="block-scalar"){let Q=q.props[0];if(Q.type!=="block-scalar-header")throw Error("Invalid block scalar header");Q.source=J,q.source=$}else{let{offset:Q}=q,z="indent"in q?q.indent:-1,H=[{type:"block-scalar-header",offset:Q,indent:z,source:J}];if(!t3(H,"end"in q?q.end:void 0))H.push({type:"newline",offset:-1,indent:z,source:`
139
+ `});for(let U of Object.keys(q))if(U!=="type"&&U!=="offset")delete q[U];Object.assign(q,{type:"block-scalar",indent:z,props:H,source:$})}}function t3(q,Z){if(Z)for(let X of Z)switch(X.type){case"space":case"comment":q.push(X);break;case"newline":return q.push(X),!0}return!1}function s9(q,Z,X){switch(q.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":q.type=X,q.source=Z;break;case"block-scalar":{let J=q.props.slice(1),$=Z.length;if(q.props[0].type==="block-scalar-header")$-=q.props[0].source.length;for(let Q of J)Q.offset+=$;delete q.props,Object.assign(q,{type:X,source:Z,end:J});break}case"block-map":case"block-seq":{let $={type:"newline",offset:q.offset+Z.length,indent:q.indent,source:`
140
+ `};delete q.items,Object.assign(q,{type:X,source:Z,end:[$]});break}default:{let J="indent"in q?q.indent:-1,$="end"in q&&Array.isArray(q.end)?q.end.filter((Q)=>Q.type==="space"||Q.type==="comment"||Q.type==="newline"):[];for(let Q of Object.keys(q))if(Q!=="type"&&Q!=="offset")delete q[Q];Object.assign(q,{type:X,indent:J,source:Z,end:$})}}}pz.createScalarToken=mz;pz.resolveAsScalar=uz;pz.setScalarValue=dz});var q5=P((rz)=>{var sz=(q)=>("type"in q)?Yq(q):Gq(q);function Yq(q){switch(q.type){case"block-scalar":{let Z="";for(let X of q.props)Z+=Yq(X);return Z+q.source}case"block-map":case"block-seq":{let Z="";for(let X of q.items)Z+=Gq(X);return Z}case"flow-collection":{let Z=q.start.source;for(let X of q.items)Z+=Gq(X);for(let X of q.end)Z+=X.source;return Z}case"document":{let Z=Gq(q);if(q.end)for(let X of q.end)Z+=X.source;return Z}default:{let Z=q.source;if("end"in q&&q.end)for(let X of q.end)Z+=X.source;return Z}}}function Gq({start:q,key:Z,sep:X,value:J}){let $="";for(let Q of q)$+=Q.source;if(Z)$+=Yq(Z);if(X)for(let Q of X)$+=Q.source;if(J)$+=Yq(J);return $}rz.stringify=sz});var J5=P((tz)=>{var r9=Symbol("break visit"),oz=Symbol("skip children"),Z5=Symbol("remove item");function P1(q,Z){if("type"in q&&q.type==="document")q={start:q.start,value:q.value};X5(Object.freeze([]),q,Z)}P1.BREAK=r9;P1.SKIP=oz;P1.REMOVE=Z5;P1.itemAtPath=(q,Z)=>{let X=q;for(let[J,$]of Z){let Q=X?.[J];if(Q&&"items"in Q)X=Q.items[$];else return}return X};P1.parentCollection=(q,Z)=>{let X=P1.itemAtPath(q,Z.slice(0,-1)),J=Z[Z.length-1][0],$=X?.[J];if($&&"items"in $)return $;throw Error("Parent collection not found")};function X5(q,Z,X){let J=X(Z,q);if(typeof J==="symbol")return J;for(let $ of["key","value"]){let Q=Z[$];if(Q&&"items"in Q){for(let z=0;z<Q.items.length;++z){let H=X5(Object.freeze(q.concat([[$,z]])),Q.items[z],X);if(typeof H==="number")z=H-1;else if(H===r9)return r9;else if(H===Z5)Q.items.splice(z,1),z-=1}if(typeof J==="function"&&$==="key")J=J(Z,q)}}return typeof J==="function"?J(Z,q):J}tz.visit=P1});var Bq=P((zH)=>{var n9=e3(),qH=q5(),ZH=J5(),o9="\uFEFF",t9="\x02",e9="\x18",q4="\x1F",XH=(q)=>!!q&&("items"in q),JH=(q)=>!!q&&(q.type==="scalar"||q.type==="single-quoted-scalar"||q.type==="double-quoted-scalar"||q.type==="block-scalar");function $H(q){switch(q){case o9:return"<BOM>";case t9:return"<DOC>";case e9:return"<FLOW_END>";case q4:return"<SCALAR>";default:return JSON.stringify(q)}}function QH(q){switch(q){case o9:return"byte-order-mark";case t9:return"doc-mode";case e9:return"flow-error-end";case q4:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
141
141
  `:case`\r
142
- `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(q[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}zH.createScalarToken=o9.createScalarToken;zH.resolveAsScalar=o9.resolveAsScalar;zH.setScalarValue=o9.setScalarValue;zH.stringify=qH.stringify;zH.visit=ZH.visit;zH.BOM=t9;zH.DOCUMENT=e9;zH.FLOW_END=q4;zH.SCALAR=Z4;zH.isCollection=XH;zH.isScalar=JH;zH.prettyToken=$H;zH.tokenType=QH});var J4=D((DH)=>{var G0=Yq();function l(q){switch(q){case void 0:case" ":case`
143
- `:case"\r":case"\t":return!0;default:return!1}}var Q5=new Set("0123456789ABCDEFabcdef"),KH=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Bq=new Set(",[]{}"),PH=new Set(` ,[]{}
144
- \r `),X4=(q)=>!q||PH.has(q);class z5{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(q,Z=!1){if(q){if(typeof q!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+q:q,this.lineEndPos=null}this.atEnd=!Z;let X=this.next??"stream";while(X&&(Z||this.hasChars(1)))X=yield*this.parseNext(X)}atLineEnd(){let q=this.pos,Z=this.buffer[q];while(Z===" "||Z==="\t")Z=this.buffer[++q];if(!Z||Z==="#"||Z===`
142
+ `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(q[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}zH.createScalarToken=n9.createScalarToken;zH.resolveAsScalar=n9.resolveAsScalar;zH.setScalarValue=n9.setScalarValue;zH.stringify=qH.stringify;zH.visit=ZH.visit;zH.BOM=o9;zH.DOCUMENT=t9;zH.FLOW_END=e9;zH.SCALAR=q4;zH.isCollection=XH;zH.isScalar=JH;zH.prettyToken=$H;zH.tokenType=QH});var X4=P((PH)=>{var Y0=Bq();function l(q){switch(q){case void 0:case" ":case`
143
+ `:case"\r":case"\t":return!0;default:return!1}}var $5=new Set("0123456789ABCDEFabcdef"),KH=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Tq=new Set(",[]{}"),DH=new Set(` ,[]{}
144
+ \r `),Z4=(q)=>!q||DH.has(q);class Q5{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(q,Z=!1){if(q){if(typeof q!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+q:q,this.lineEndPos=null}this.atEnd=!Z;let X=this.next??"stream";while(X&&(Z||this.hasChars(1)))X=yield*this.parseNext(X)}atLineEnd(){let q=this.pos,Z=this.buffer[q];while(Z===" "||Z==="\t")Z=this.buffer[++q];if(!Z||Z==="#"||Z===`
145
145
  `)return!0;if(Z==="\r")return this.buffer[q+1]===`
146
146
  `;return!1}charAt(q){return this.buffer[this.pos+q]}continueScalar(q){let Z=this.buffer[q];if(this.indentNext>0){let X=0;while(Z===" ")Z=this.buffer[++X+q];if(Z==="\r"){let J=this.buffer[X+q+1];if(J===`
147
147
  `||!J&&!this.atEnd)return q+X+1}return Z===`
148
148
  `||X>=this.indentNext||!Z&&!this.atEnd?q+X:-1}if(Z==="-"||Z==="."){let X=this.buffer.substr(q,3);if((X==="---"||X==="...")&&l(this.buffer[q+3]))return-1}return q}getLine(){let q=this.lineEndPos;if(typeof q!=="number"||q!==-1&&q<this.pos)q=this.buffer.indexOf(`
149
- `,this.pos),this.lineEndPos=q;if(q===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[q-1]==="\r")q-=1;return this.buffer.substring(this.pos,q)}hasChars(q){return this.pos+q<=this.buffer.length}setNext(q){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=q,null}peek(q){return this.buffer.substr(this.pos,q)}*parseNext(q){switch(q){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let q=this.getLine();if(q===null)return this.setNext("stream");if(q[0]===G0.BOM)yield*this.pushCount(1),q=q.substring(1);if(q[0]==="%"){let Z=q.length,X=q.indexOf("#");while(X!==-1){let $=q[X-1];if($===" "||$==="\t"){Z=X-1;break}else X=q.indexOf("#",X+1)}while(!0){let $=q[Z-1];if($===" "||$==="\t")Z-=1;else break}let J=(yield*this.pushCount(Z))+(yield*this.pushSpaces(!0));return yield*this.pushCount(q.length-J),this.pushNewline(),"stream"}if(this.atLineEnd()){let Z=yield*this.pushSpaces(!0);return yield*this.pushCount(q.length-Z),yield*this.pushNewline(),"stream"}return yield G0.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let q=this.charAt(0);if(!q&&!this.atEnd)return this.setNext("line-start");if(q==="-"||q==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let Z=this.peek(3);if((Z==="---"||Z==="...")&&l(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,Z==="---"?"doc":"stream"}if(this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!l(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){let[q,Z]=this.peek(2);if(!Z&&!this.atEnd)return this.setNext("block-start");if((q==="-"||q==="?"||q===":")&&l(Z)){let X=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=X,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let q=this.getLine();if(q===null)return this.setNext("doc");let Z=yield*this.pushIndicators();switch(q[Z]){case"#":yield*this.pushCount(q.length-Z);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(X4),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return Z+=yield*this.parseBlockScalarHeader(),Z+=yield*this.pushSpaces(!0),yield*this.pushCount(q.length-Z),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let q,Z,X=-1;do{if(q=yield*this.pushNewline(),q>0)Z=yield*this.pushSpaces(!1),this.indentValue=X=Z;else Z=0;Z+=yield*this.pushSpaces(!0)}while(q+Z>0);let J=this.getLine();if(J===null)return this.setNext("flow");if(X!==-1&&X<this.indentNext&&J[0]!=="#"||X===0&&(J.startsWith("---")||J.startsWith("..."))&&l(J[3])){if(!(X===this.indentNext-1&&this.flowLevel===1&&(J[0]==="]"||J[0]==="}")))return this.flowLevel=0,yield G0.FLOW_END,yield*this.parseLineStart()}let $=0;while(J[$]===",")$+=yield*this.pushCount(1),$+=yield*this.pushSpaces(!0),this.flowKey=!1;switch($+=yield*this.pushIndicators(),J[$]){case void 0:return"flow";case"#":return yield*this.pushCount(J.length-$),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(X4),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let Q=this.charAt(1);if(this.flowKey||l(Q)||Q===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let q=this.charAt(0),Z=this.buffer.indexOf(q,this.pos+1);if(q==="'")while(Z!==-1&&this.buffer[Z+1]==="'")Z=this.buffer.indexOf("'",Z+2);else while(Z!==-1){let $=0;while(this.buffer[Z-1-$]==="\\")$+=1;if($%2===0)break;Z=this.buffer.indexOf('"',Z+1)}let X=this.buffer.substring(0,Z),J=X.indexOf(`
149
+ `,this.pos),this.lineEndPos=q;if(q===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[q-1]==="\r")q-=1;return this.buffer.substring(this.pos,q)}hasChars(q){return this.pos+q<=this.buffer.length}setNext(q){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=q,null}peek(q){return this.buffer.substr(this.pos,q)}*parseNext(q){switch(q){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let q=this.getLine();if(q===null)return this.setNext("stream");if(q[0]===Y0.BOM)yield*this.pushCount(1),q=q.substring(1);if(q[0]==="%"){let Z=q.length,X=q.indexOf("#");while(X!==-1){let $=q[X-1];if($===" "||$==="\t"){Z=X-1;break}else X=q.indexOf("#",X+1)}while(!0){let $=q[Z-1];if($===" "||$==="\t")Z-=1;else break}let J=(yield*this.pushCount(Z))+(yield*this.pushSpaces(!0));return yield*this.pushCount(q.length-J),this.pushNewline(),"stream"}if(this.atLineEnd()){let Z=yield*this.pushSpaces(!0);return yield*this.pushCount(q.length-Z),yield*this.pushNewline(),"stream"}return yield Y0.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let q=this.charAt(0);if(!q&&!this.atEnd)return this.setNext("line-start");if(q==="-"||q==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let Z=this.peek(3);if((Z==="---"||Z==="...")&&l(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,Z==="---"?"doc":"stream"}if(this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!l(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){let[q,Z]=this.peek(2);if(!Z&&!this.atEnd)return this.setNext("block-start");if((q==="-"||q==="?"||q===":")&&l(Z)){let X=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=X,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let q=this.getLine();if(q===null)return this.setNext("doc");let Z=yield*this.pushIndicators();switch(q[Z]){case"#":yield*this.pushCount(q.length-Z);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Z4),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return Z+=yield*this.parseBlockScalarHeader(),Z+=yield*this.pushSpaces(!0),yield*this.pushCount(q.length-Z),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let q,Z,X=-1;do{if(q=yield*this.pushNewline(),q>0)Z=yield*this.pushSpaces(!1),this.indentValue=X=Z;else Z=0;Z+=yield*this.pushSpaces(!0)}while(q+Z>0);let J=this.getLine();if(J===null)return this.setNext("flow");if(X!==-1&&X<this.indentNext&&J[0]!=="#"||X===0&&(J.startsWith("---")||J.startsWith("..."))&&l(J[3])){if(!(X===this.indentNext-1&&this.flowLevel===1&&(J[0]==="]"||J[0]==="}")))return this.flowLevel=0,yield Y0.FLOW_END,yield*this.parseLineStart()}let $=0;while(J[$]===",")$+=yield*this.pushCount(1),$+=yield*this.pushSpaces(!0),this.flowKey=!1;switch($+=yield*this.pushIndicators(),J[$]){case void 0:return"flow";case"#":return yield*this.pushCount(J.length-$),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Z4),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let Q=this.charAt(1);if(this.flowKey||l(Q)||Q===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let q=this.charAt(0),Z=this.buffer.indexOf(q,this.pos+1);if(q==="'")while(Z!==-1&&this.buffer[Z+1]==="'")Z=this.buffer.indexOf("'",Z+2);else while(Z!==-1){let $=0;while(this.buffer[Z-1-$]==="\\")$+=1;if($%2===0)break;Z=this.buffer.indexOf('"',Z+1)}let X=this.buffer.substring(0,Z),J=X.indexOf(`
150
150
  `,this.pos);if(J!==-1){while(J!==-1){let $=this.continueScalar(J+1);if($===-1)break;J=X.indexOf(`
151
151
  `,$)}if(J!==-1)Z=J-(X[J-1]==="\r"?2:1)}if(Z===-1){if(!this.atEnd)return this.setNext("quoted-scalar");Z=this.buffer.length}return yield*this.pushToIndex(Z+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let q=this.pos;while(!0){let Z=this.buffer[++q];if(Z==="+")this.blockScalarKeep=!0;else if(Z>"0"&&Z<="9")this.blockScalarIndent=Number(Z)-1;else if(Z!=="-")break}return yield*this.pushUntil((Z)=>l(Z)||Z==="#")}*parseBlockScalar(){let q=this.pos-1,Z=0,X;q:for(let $=this.pos;X=this.buffer[$];++$)switch(X){case" ":Z+=1;break;case`
152
152
  `:q=$,Z=0;break;case"\r":{let Q=this.buffer[$+1];if(!Q&&!this.atEnd)return this.setNext("block-scalar");if(Q===`
153
153
  `)break}default:break q}if(!X&&!this.atEnd)return this.setNext("block-scalar");if(Z>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=Z;else this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let $=this.continueScalar(q+1);if($===-1)break;q=this.buffer.indexOf(`
154
154
  `,$)}while(q!==-1);if(q===-1){if(!this.atEnd)return this.setNext("block-scalar");q=this.buffer.length}}let J=q+1;X=this.buffer[J];while(X===" ")X=this.buffer[++J];if(X==="\t"){while(X==="\t"||X===" "||X==="\r"||X===`
155
155
  `)X=this.buffer[++J];q=J-1}else if(!this.blockScalarKeep)do{let $=q-1,Q=this.buffer[$];if(Q==="\r")Q=this.buffer[--$];let z=$;while(Q===" ")Q=this.buffer[--$];if(Q===`
156
- `&&$>=this.pos&&$+1+Z>z)q=$;else break}while(!0);return yield G0.SCALAR,yield*this.pushToIndex(q+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let q=this.flowLevel>0,Z=this.pos-1,X=this.pos-1,J;while(J=this.buffer[++X])if(J===":"){let $=this.buffer[X+1];if(l($)||q&&Bq.has($))break;Z=X}else if(l(J)){let $=this.buffer[X+1];if(J==="\r")if($===`
156
+ `&&$>=this.pos&&$+1+Z>z)q=$;else break}while(!0);return yield Y0.SCALAR,yield*this.pushToIndex(q+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let q=this.flowLevel>0,Z=this.pos-1,X=this.pos-1,J;while(J=this.buffer[++X])if(J===":"){let $=this.buffer[X+1];if(l($)||q&&Tq.has($))break;Z=X}else if(l(J)){let $=this.buffer[X+1];if(J==="\r")if($===`
157
157
  `)X+=1,J=`
158
- `,$=this.buffer[X+1];else Z=X;if($==="#"||q&&Bq.has($))break;if(J===`
159
- `){let Q=this.continueScalar(X+1);if(Q===-1)break;X=Math.max(X,Q-2)}}else{if(q&&Bq.has(J))break;Z=X}if(!J&&!this.atEnd)return this.setNext("plain-scalar");return yield G0.SCALAR,yield*this.pushToIndex(Z+1,!0),q?"flow":"doc"}*pushCount(q){if(q>0)return yield this.buffer.substr(this.pos,q),this.pos+=q,q;return 0}*pushToIndex(q,Z){let X=this.buffer.slice(this.pos,q);if(X)return yield X,this.pos+=X.length,X.length;else if(Z)yield"";return 0}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(X4))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let q=this.flowLevel>0,Z=this.charAt(1);if(l(Z)||q&&Bq.has(Z)){if(!q)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=!1;return(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}}return 0}*pushTag(){if(this.charAt(1)==="<"){let q=this.pos+2,Z=this.buffer[q];while(!l(Z)&&Z!==">")Z=this.buffer[++q];return yield*this.pushToIndex(Z===">"?q+1:q,!1)}else{let q=this.pos+1,Z=this.buffer[q];while(Z)if(KH.has(Z))Z=this.buffer[++q];else if(Z==="%"&&Q5.has(this.buffer[q+1])&&Q5.has(this.buffer[q+2]))Z=this.buffer[q+=3];else break;return yield*this.pushToIndex(q,!1)}}*pushNewline(){let q=this.buffer[this.pos];if(q===`
158
+ `,$=this.buffer[X+1];else Z=X;if($==="#"||q&&Tq.has($))break;if(J===`
159
+ `){let Q=this.continueScalar(X+1);if(Q===-1)break;X=Math.max(X,Q-2)}}else{if(q&&Tq.has(J))break;Z=X}if(!J&&!this.atEnd)return this.setNext("plain-scalar");return yield Y0.SCALAR,yield*this.pushToIndex(Z+1,!0),q?"flow":"doc"}*pushCount(q){if(q>0)return yield this.buffer.substr(this.pos,q),this.pos+=q,q;return 0}*pushToIndex(q,Z){let X=this.buffer.slice(this.pos,q);if(X)return yield X,this.pos+=X.length,X.length;else if(Z)yield"";return 0}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(Z4))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let q=this.flowLevel>0,Z=this.charAt(1);if(l(Z)||q&&Tq.has(Z)){if(!q)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=!1;return(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}}return 0}*pushTag(){if(this.charAt(1)==="<"){let q=this.pos+2,Z=this.buffer[q];while(!l(Z)&&Z!==">")Z=this.buffer[++q];return yield*this.pushToIndex(Z===">"?q+1:q,!1)}else{let q=this.pos+1,Z=this.buffer[q];while(Z)if(KH.has(Z))Z=this.buffer[++q];else if(Z==="%"&&$5.has(this.buffer[q+1])&&$5.has(this.buffer[q+2]))Z=this.buffer[q+=3];else break;return yield*this.pushToIndex(q,!1)}}*pushNewline(){let q=this.buffer[this.pos];if(q===`
160
160
  `)return yield*this.pushCount(1);else if(q==="\r"&&this.charAt(1)===`
161
- `)return yield*this.pushCount(2);else return 0}*pushSpaces(q){let Z=this.pos-1,X;do X=this.buffer[++Z];while(X===" "||q&&X==="\t");let J=Z-this.pos;if(J>0)yield this.buffer.substr(this.pos,J),this.pos=Z;return J}*pushUntil(q){let Z=this.pos,X=this.buffer[Z];while(!q(X))X=this.buffer[++Z];return yield*this.pushToIndex(Z,!1)}}DH.Lexer=z5});var $4=D((OH)=>{class H5{constructor(){this.lineStarts=[],this.addNewLine=(q)=>this.lineStarts.push(q),this.linePos=(q)=>{let Z=0,X=this.lineStarts.length;while(Z<X){let $=Z+X>>1;if(this.lineStarts[$]<q)Z=$+1;else X=$}if(this.lineStarts[Z]===q)return{line:Z+1,col:1};if(Z===0)return{line:0,col:q};let J=this.lineStarts[Z-1];return{line:Z,col:q-J+1}}}}OH.LineCounter=H5});var Q4=D((wH)=>{var AH=r("process"),U5=Yq(),SH=J4();function H1(q,Z){for(let X=0;X<q.length;++X)if(q[X].type===Z)return!0;return!1}function G5(q){for(let Z=0;Z<q.length;++Z)switch(q[Z].type){case"space":case"comment":case"newline":break;default:return Z}return-1}function B5(q){switch(q?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Tq(q){switch(q.type){case"document":return q.start;case"block-map":{let Z=q.items[q.items.length-1];return Z.sep??Z.start}case"block-seq":return q.items[q.items.length-1].start;default:return[]}}function k1(q){if(q.length===0)return[];let Z=q.length;q:while(--Z>=0)switch(q[Z].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break q}while(q[++Z]?.type==="space");return q.splice(Z,q.length)}function Y5(q){if(q.start.type==="flow-seq-start"){for(let Z of q.items)if(Z.sep&&!Z.value&&!H1(Z.start,"explicit-key-ind")&&!H1(Z.sep,"map-value-ind")){if(Z.key)Z.value=Z.key;if(delete Z.key,B5(Z.value))if(Z.value.end)Array.prototype.push.apply(Z.value.end,Z.sep);else Z.value.end=Z.sep;else Array.prototype.push.apply(Z.start,Z.sep);delete Z.sep}}}class T5{constructor(q){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new SH.Lexer,this.onNewLine=q}*parse(q,Z=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let X of this.lexer.lex(q,Z))yield*this.next(X);if(!Z)yield*this.end()}*next(q){if(this.source=q,AH.env.LOG_TOKENS)console.log("|",U5.prettyToken(q));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=q.length;return}let Z=U5.tokenType(q);if(!Z){let X=`Not a YAML token: ${q}`;yield*this.pop({type:"error",offset:this.offset,message:X,source:q}),this.offset+=q.length}else if(Z==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=Z,yield*this.step(),Z){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+q.length);break;case"space":if(this.atNewLine&&q[0]===" ")this.indent+=q.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=q.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=q.length}}*end(){while(this.stack.length>0)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let q=this.peek(1);if(this.type==="doc-end"&&q?.type!=="doc-end"){while(this.stack.length>0)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!q)return yield*this.stream();switch(q.type){case"document":return yield*this.document(q);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(q);case"block-scalar":return yield*this.blockScalar(q);case"block-map":return yield*this.blockMap(q);case"block-seq":return yield*this.blockSequence(q);case"flow-collection":return yield*this.flowCollection(q);case"doc-end":return yield*this.documentEnd(q)}yield*this.pop()}peek(q){return this.stack[this.stack.length-q]}*pop(q){let Z=q??this.stack.pop();if(!Z)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield Z;else{let X=this.peek(1);if(Z.type==="block-scalar")Z.indent="indent"in X?X.indent:0;else if(Z.type==="flow-collection"&&X.type==="document")Z.indent=0;if(Z.type==="flow-collection")Y5(Z);switch(X.type){case"document":X.value=Z;break;case"block-scalar":X.props.push(Z);break;case"block-map":{let J=X.items[X.items.length-1];if(J.value){X.items.push({start:[],key:Z,sep:[]}),this.onKeyLine=!0;return}else if(J.sep)J.value=Z;else{Object.assign(J,{key:Z,sep:[]}),this.onKeyLine=!J.explicitKey;return}break}case"block-seq":{let J=X.items[X.items.length-1];if(J.value)X.items.push({start:[],value:Z});else J.value=Z;break}case"flow-collection":{let J=X.items[X.items.length-1];if(!J||J.value)X.items.push({start:[],key:Z,sep:[]});else if(J.sep)J.value=Z;else Object.assign(J,{key:Z,sep:[]});return}default:yield*this.pop(),yield*this.pop(Z)}if((X.type==="document"||X.type==="block-map"||X.type==="block-seq")&&(Z.type==="block-map"||Z.type==="block-seq")){let J=Z.items[Z.items.length-1];if(J&&!J.sep&&!J.value&&J.start.length>0&&G5(J.start)===-1&&(Z.indent===0||J.start.every(($)=>$.type!=="comment"||$.indent<Z.indent))){if(X.type==="document")X.end=J.start;else X.items.push({start:J.start});Z.items.splice(-1,1)}}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let q={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")q.start.push(this.sourceToken);this.stack.push(q);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(q){if(q.value)return yield*this.lineEnd(q);switch(this.type){case"doc-start":{if(G5(q.start)!==-1)yield*this.pop(),yield*this.step();else q.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":q.start.push(this.sourceToken);return}let Z=this.startBlockValue(q);if(Z)this.stack.push(Z);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(q){if(this.type==="map-value-ind"){let Z=Tq(this.peek(2)),X=k1(Z),J;if(q.end)J=q.end,J.push(this.sourceToken),delete q.end;else J=[this.sourceToken];let $={type:"block-map",offset:q.offset,indent:q.indent,items:[{start:X,key:q,sep:J}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=$}else yield*this.lineEnd(q)}*blockScalar(q){switch(this.type){case"space":case"comment":case"newline":q.props.push(this.sourceToken);return;case"scalar":if(q.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let Z=this.source.indexOf(`
161
+ `)return yield*this.pushCount(2);else return 0}*pushSpaces(q){let Z=this.pos-1,X;do X=this.buffer[++Z];while(X===" "||q&&X==="\t");let J=Z-this.pos;if(J>0)yield this.buffer.substr(this.pos,J),this.pos=Z;return J}*pushUntil(q){let Z=this.pos,X=this.buffer[Z];while(!q(X))X=this.buffer[++Z];return yield*this.pushToIndex(Z,!1)}}PH.Lexer=Q5});var J4=P((OH)=>{class z5{constructor(){this.lineStarts=[],this.addNewLine=(q)=>this.lineStarts.push(q),this.linePos=(q)=>{let Z=0,X=this.lineStarts.length;while(Z<X){let $=Z+X>>1;if(this.lineStarts[$]<q)Z=$+1;else X=$}if(this.lineStarts[Z]===q)return{line:Z+1,col:1};if(Z===0)return{line:0,col:q};let J=this.lineStarts[Z-1];return{line:Z,col:q-J+1}}}}OH.LineCounter=z5});var $4=P((wH)=>{var AH=r("process"),H5=Bq(),SH=X4();function U1(q,Z){for(let X=0;X<q.length;++X)if(q[X].type===Z)return!0;return!1}function U5(q){for(let Z=0;Z<q.length;++Z)switch(q[Z].type){case"space":case"comment":case"newline":break;default:return Z}return-1}function Y5(q){switch(q?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function _q(q){switch(q.type){case"document":return q.start;case"block-map":{let Z=q.items[q.items.length-1];return Z.sep??Z.start}case"block-seq":return q.items[q.items.length-1].start;default:return[]}}function k1(q){if(q.length===0)return[];let Z=q.length;q:while(--Z>=0)switch(q[Z].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break q}while(q[++Z]?.type==="space");return q.splice(Z,q.length)}function G5(q){if(q.start.type==="flow-seq-start"){for(let Z of q.items)if(Z.sep&&!Z.value&&!U1(Z.start,"explicit-key-ind")&&!U1(Z.sep,"map-value-ind")){if(Z.key)Z.value=Z.key;if(delete Z.key,Y5(Z.value))if(Z.value.end)Array.prototype.push.apply(Z.value.end,Z.sep);else Z.value.end=Z.sep;else Array.prototype.push.apply(Z.start,Z.sep);delete Z.sep}}}class B5{constructor(q){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new SH.Lexer,this.onNewLine=q}*parse(q,Z=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let X of this.lexer.lex(q,Z))yield*this.next(X);if(!Z)yield*this.end()}*next(q){if(this.source=q,AH.env.LOG_TOKENS)console.log("|",H5.prettyToken(q));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=q.length;return}let Z=H5.tokenType(q);if(!Z){let X=`Not a YAML token: ${q}`;yield*this.pop({type:"error",offset:this.offset,message:X,source:q}),this.offset+=q.length}else if(Z==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=Z,yield*this.step(),Z){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+q.length);break;case"space":if(this.atNewLine&&q[0]===" ")this.indent+=q.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=q.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=q.length}}*end(){while(this.stack.length>0)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let q=this.peek(1);if(this.type==="doc-end"&&q?.type!=="doc-end"){while(this.stack.length>0)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!q)return yield*this.stream();switch(q.type){case"document":return yield*this.document(q);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(q);case"block-scalar":return yield*this.blockScalar(q);case"block-map":return yield*this.blockMap(q);case"block-seq":return yield*this.blockSequence(q);case"flow-collection":return yield*this.flowCollection(q);case"doc-end":return yield*this.documentEnd(q)}yield*this.pop()}peek(q){return this.stack[this.stack.length-q]}*pop(q){let Z=q??this.stack.pop();if(!Z)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield Z;else{let X=this.peek(1);if(Z.type==="block-scalar")Z.indent="indent"in X?X.indent:0;else if(Z.type==="flow-collection"&&X.type==="document")Z.indent=0;if(Z.type==="flow-collection")G5(Z);switch(X.type){case"document":X.value=Z;break;case"block-scalar":X.props.push(Z);break;case"block-map":{let J=X.items[X.items.length-1];if(J.value){X.items.push({start:[],key:Z,sep:[]}),this.onKeyLine=!0;return}else if(J.sep)J.value=Z;else{Object.assign(J,{key:Z,sep:[]}),this.onKeyLine=!J.explicitKey;return}break}case"block-seq":{let J=X.items[X.items.length-1];if(J.value)X.items.push({start:[],value:Z});else J.value=Z;break}case"flow-collection":{let J=X.items[X.items.length-1];if(!J||J.value)X.items.push({start:[],key:Z,sep:[]});else if(J.sep)J.value=Z;else Object.assign(J,{key:Z,sep:[]});return}default:yield*this.pop(),yield*this.pop(Z)}if((X.type==="document"||X.type==="block-map"||X.type==="block-seq")&&(Z.type==="block-map"||Z.type==="block-seq")){let J=Z.items[Z.items.length-1];if(J&&!J.sep&&!J.value&&J.start.length>0&&U5(J.start)===-1&&(Z.indent===0||J.start.every(($)=>$.type!=="comment"||$.indent<Z.indent))){if(X.type==="document")X.end=J.start;else X.items.push({start:J.start});Z.items.splice(-1,1)}}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let q={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")q.start.push(this.sourceToken);this.stack.push(q);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(q){if(q.value)return yield*this.lineEnd(q);switch(this.type){case"doc-start":{if(U5(q.start)!==-1)yield*this.pop(),yield*this.step();else q.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":q.start.push(this.sourceToken);return}let Z=this.startBlockValue(q);if(Z)this.stack.push(Z);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(q){if(this.type==="map-value-ind"){let Z=_q(this.peek(2)),X=k1(Z),J;if(q.end)J=q.end,J.push(this.sourceToken),delete q.end;else J=[this.sourceToken];let $={type:"block-map",offset:q.offset,indent:q.indent,items:[{start:X,key:q,sep:J}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=$}else yield*this.lineEnd(q)}*blockScalar(q){switch(this.type){case"space":case"comment":case"newline":q.props.push(this.sourceToken);return;case"scalar":if(q.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let Z=this.source.indexOf(`
162
162
  `)+1;while(Z!==0)this.onNewLine(this.offset+Z),Z=this.source.indexOf(`
163
- `,Z)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(q){let Z=q.items[q.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,Z.value){let X="end"in Z.value?Z.value.end:void 0;if((Array.isArray(X)?X[X.length-1]:void 0)?.type==="comment")X?.push(this.sourceToken);else q.items.push({start:[this.sourceToken]})}else if(Z.sep)Z.sep.push(this.sourceToken);else Z.start.push(this.sourceToken);return;case"space":case"comment":if(Z.value)q.items.push({start:[this.sourceToken]});else if(Z.sep)Z.sep.push(this.sourceToken);else{if(this.atIndentedComment(Z.start,q.indent)){let J=q.items[q.items.length-2]?.value?.end;if(Array.isArray(J)){Array.prototype.push.apply(J,Z.start),J.push(this.sourceToken),q.items.pop();return}}Z.start.push(this.sourceToken)}return}if(this.indent>=q.indent){let X=!this.onKeyLine&&this.indent===q.indent,J=X&&(Z.sep||Z.explicitKey)&&this.type!=="seq-item-ind",$=[];if(J&&Z.sep&&!Z.value){let Q=[];for(let z=0;z<Z.sep.length;++z){let H=Z.sep[z];switch(H.type){case"newline":Q.push(z);break;case"space":break;case"comment":if(H.indent>q.indent)Q.length=0;break;default:Q.length=0}}if(Q.length>=2)$=Z.sep.splice(Q[1])}switch(this.type){case"anchor":case"tag":if(J||Z.value)$.push(this.sourceToken),q.items.push({start:$}),this.onKeyLine=!0;else if(Z.sep)Z.sep.push(this.sourceToken);else Z.start.push(this.sourceToken);return;case"explicit-key-ind":if(!Z.sep&&!Z.explicitKey)Z.start.push(this.sourceToken),Z.explicitKey=!0;else if(J||Z.value)$.push(this.sourceToken),q.items.push({start:$,explicitKey:!0});else this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]});this.onKeyLine=!0;return;case"map-value-ind":if(Z.explicitKey)if(!Z.sep)if(H1(Z.start,"newline"))Object.assign(Z,{key:null,sep:[this.sourceToken]});else{let Q=k1(Z.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Q,key:null,sep:[this.sourceToken]}]})}else if(Z.value)q.items.push({start:[],key:null,sep:[this.sourceToken]});else if(H1(Z.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:$,key:null,sep:[this.sourceToken]}]});else if(B5(Z.key)&&!H1(Z.sep,"newline")){let Q=k1(Z.start),z=Z.key,H=Z.sep;H.push(this.sourceToken),delete Z.key,delete Z.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Q,key:z,sep:H}]})}else if($.length>0)Z.sep=Z.sep.concat($,this.sourceToken);else Z.sep.push(this.sourceToken);else if(!Z.sep)Object.assign(Z,{key:null,sep:[this.sourceToken]});else if(Z.value||J)q.items.push({start:$,key:null,sep:[this.sourceToken]});else if(H1(Z.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else Z.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let Q=this.flowScalar(this.type);if(J||Z.value)q.items.push({start:$,key:Q,sep:[]}),this.onKeyLine=!0;else if(Z.sep)this.stack.push(Q);else Object.assign(Z,{key:Q,sep:[]}),this.onKeyLine=!0;return}default:{let Q=this.startBlockValue(q);if(Q){if(Q.type==="block-seq"){if(!Z.explicitKey&&Z.sep&&!H1(Z.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else if(X)q.items.push({start:$});this.stack.push(Q);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(q){let Z=q.items[q.items.length-1];switch(this.type){case"newline":if(Z.value){let X="end"in Z.value?Z.value.end:void 0;if((Array.isArray(X)?X[X.length-1]:void 0)?.type==="comment")X?.push(this.sourceToken);else q.items.push({start:[this.sourceToken]})}else Z.start.push(this.sourceToken);return;case"space":case"comment":if(Z.value)q.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(Z.start,q.indent)){let J=q.items[q.items.length-2]?.value?.end;if(Array.isArray(J)){Array.prototype.push.apply(J,Z.start),J.push(this.sourceToken),q.items.pop();return}}Z.start.push(this.sourceToken)}return;case"anchor":case"tag":if(Z.value||this.indent<=q.indent)break;Z.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==q.indent)break;if(Z.value||H1(Z.start,"seq-item-ind"))q.items.push({start:[this.sourceToken]});else Z.start.push(this.sourceToken);return}if(this.indent>q.indent){let X=this.startBlockValue(q);if(X){this.stack.push(X);return}}yield*this.pop(),yield*this.step()}*flowCollection(q){let Z=q.items[q.items.length-1];if(this.type==="flow-error-end"){let X;do yield*this.pop(),X=this.peek(1);while(X?.type==="flow-collection")}else if(q.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!Z||Z.sep)q.items.push({start:[this.sourceToken]});else Z.start.push(this.sourceToken);return;case"map-value-ind":if(!Z||Z.value)q.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Z.sep)Z.sep.push(this.sourceToken);else Object.assign(Z,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!Z||Z.value)q.items.push({start:[this.sourceToken]});else if(Z.sep)Z.sep.push(this.sourceToken);else Z.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let J=this.flowScalar(this.type);if(!Z||Z.value)q.items.push({start:[],key:J,sep:[]});else if(Z.sep)this.stack.push(J);else Object.assign(Z,{key:J,sep:[]});return}case"flow-map-end":case"flow-seq-end":q.end.push(this.sourceToken);return}let X=this.startBlockValue(q);if(X)this.stack.push(X);else yield*this.pop(),yield*this.step()}else{let X=this.peek(2);if(X.type==="block-map"&&(this.type==="map-value-ind"&&X.indent===q.indent||this.type==="newline"&&!X.items[X.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&X.type!=="flow-collection"){let J=Tq(X),$=k1(J);Y5(q);let Q=q.end.splice(1,q.end.length);Q.push(this.sourceToken);let z={type:"block-map",offset:q.offset,indent:q.indent,items:[{start:$,key:q,sep:Q}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=z}else yield*this.lineEnd(q)}}flowScalar(q){if(this.onNewLine){let Z=this.source.indexOf(`
163
+ `,Z)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(q){let Z=q.items[q.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,Z.value){let X="end"in Z.value?Z.value.end:void 0;if((Array.isArray(X)?X[X.length-1]:void 0)?.type==="comment")X?.push(this.sourceToken);else q.items.push({start:[this.sourceToken]})}else if(Z.sep)Z.sep.push(this.sourceToken);else Z.start.push(this.sourceToken);return;case"space":case"comment":if(Z.value)q.items.push({start:[this.sourceToken]});else if(Z.sep)Z.sep.push(this.sourceToken);else{if(this.atIndentedComment(Z.start,q.indent)){let J=q.items[q.items.length-2]?.value?.end;if(Array.isArray(J)){Array.prototype.push.apply(J,Z.start),J.push(this.sourceToken),q.items.pop();return}}Z.start.push(this.sourceToken)}return}if(this.indent>=q.indent){let X=!this.onKeyLine&&this.indent===q.indent,J=X&&(Z.sep||Z.explicitKey)&&this.type!=="seq-item-ind",$=[];if(J&&Z.sep&&!Z.value){let Q=[];for(let z=0;z<Z.sep.length;++z){let H=Z.sep[z];switch(H.type){case"newline":Q.push(z);break;case"space":break;case"comment":if(H.indent>q.indent)Q.length=0;break;default:Q.length=0}}if(Q.length>=2)$=Z.sep.splice(Q[1])}switch(this.type){case"anchor":case"tag":if(J||Z.value)$.push(this.sourceToken),q.items.push({start:$}),this.onKeyLine=!0;else if(Z.sep)Z.sep.push(this.sourceToken);else Z.start.push(this.sourceToken);return;case"explicit-key-ind":if(!Z.sep&&!Z.explicitKey)Z.start.push(this.sourceToken),Z.explicitKey=!0;else if(J||Z.value)$.push(this.sourceToken),q.items.push({start:$,explicitKey:!0});else this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]});this.onKeyLine=!0;return;case"map-value-ind":if(Z.explicitKey)if(!Z.sep)if(U1(Z.start,"newline"))Object.assign(Z,{key:null,sep:[this.sourceToken]});else{let Q=k1(Z.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Q,key:null,sep:[this.sourceToken]}]})}else if(Z.value)q.items.push({start:[],key:null,sep:[this.sourceToken]});else if(U1(Z.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:$,key:null,sep:[this.sourceToken]}]});else if(Y5(Z.key)&&!U1(Z.sep,"newline")){let Q=k1(Z.start),z=Z.key,H=Z.sep;H.push(this.sourceToken),delete Z.key,delete Z.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Q,key:z,sep:H}]})}else if($.length>0)Z.sep=Z.sep.concat($,this.sourceToken);else Z.sep.push(this.sourceToken);else if(!Z.sep)Object.assign(Z,{key:null,sep:[this.sourceToken]});else if(Z.value||J)q.items.push({start:$,key:null,sep:[this.sourceToken]});else if(U1(Z.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else Z.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let Q=this.flowScalar(this.type);if(J||Z.value)q.items.push({start:$,key:Q,sep:[]}),this.onKeyLine=!0;else if(Z.sep)this.stack.push(Q);else Object.assign(Z,{key:Q,sep:[]}),this.onKeyLine=!0;return}default:{let Q=this.startBlockValue(q);if(Q){if(Q.type==="block-seq"){if(!Z.explicitKey&&Z.sep&&!U1(Z.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else if(X)q.items.push({start:$});this.stack.push(Q);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(q){let Z=q.items[q.items.length-1];switch(this.type){case"newline":if(Z.value){let X="end"in Z.value?Z.value.end:void 0;if((Array.isArray(X)?X[X.length-1]:void 0)?.type==="comment")X?.push(this.sourceToken);else q.items.push({start:[this.sourceToken]})}else Z.start.push(this.sourceToken);return;case"space":case"comment":if(Z.value)q.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(Z.start,q.indent)){let J=q.items[q.items.length-2]?.value?.end;if(Array.isArray(J)){Array.prototype.push.apply(J,Z.start),J.push(this.sourceToken),q.items.pop();return}}Z.start.push(this.sourceToken)}return;case"anchor":case"tag":if(Z.value||this.indent<=q.indent)break;Z.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==q.indent)break;if(Z.value||U1(Z.start,"seq-item-ind"))q.items.push({start:[this.sourceToken]});else Z.start.push(this.sourceToken);return}if(this.indent>q.indent){let X=this.startBlockValue(q);if(X){this.stack.push(X);return}}yield*this.pop(),yield*this.step()}*flowCollection(q){let Z=q.items[q.items.length-1];if(this.type==="flow-error-end"){let X;do yield*this.pop(),X=this.peek(1);while(X?.type==="flow-collection")}else if(q.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!Z||Z.sep)q.items.push({start:[this.sourceToken]});else Z.start.push(this.sourceToken);return;case"map-value-ind":if(!Z||Z.value)q.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Z.sep)Z.sep.push(this.sourceToken);else Object.assign(Z,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!Z||Z.value)q.items.push({start:[this.sourceToken]});else if(Z.sep)Z.sep.push(this.sourceToken);else Z.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let J=this.flowScalar(this.type);if(!Z||Z.value)q.items.push({start:[],key:J,sep:[]});else if(Z.sep)this.stack.push(J);else Object.assign(Z,{key:J,sep:[]});return}case"flow-map-end":case"flow-seq-end":q.end.push(this.sourceToken);return}let X=this.startBlockValue(q);if(X)this.stack.push(X);else yield*this.pop(),yield*this.step()}else{let X=this.peek(2);if(X.type==="block-map"&&(this.type==="map-value-ind"&&X.indent===q.indent||this.type==="newline"&&!X.items[X.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&X.type!=="flow-collection"){let J=_q(X),$=k1(J);G5(q);let Q=q.end.splice(1,q.end.length);Q.push(this.sourceToken);let z={type:"block-map",offset:q.offset,indent:q.indent,items:[{start:$,key:q,sep:Q}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=z}else yield*this.lineEnd(q)}}flowScalar(q){if(this.onNewLine){let Z=this.source.indexOf(`
164
164
  `)+1;while(Z!==0)this.onNewLine(this.offset+Z),Z=this.source.indexOf(`
165
- `,Z)+1}return{type:q,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(q){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let Z=Tq(q),X=k1(Z);return X.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:X,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let Z=Tq(q),X=k1(Z);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:X,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(q,Z){if(this.type!=="comment")return!1;if(this.indent<=Z)return!1;return q.every((X)=>X.type==="newline"||X.type==="space")}*documentEnd(q){if(this.type!=="doc-mode"){if(q.end)q.end.push(this.sourceToken);else q.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd(q){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:if(q.end)q.end.push(this.sourceToken);else q.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}wH.Parser=T5});var L5=D((vH)=>{var _5=s9(),jH=$0(),Y0=Q0(),CH=$9(),EH=S(),fH=$4(),W5=Q4();function R5(q){let Z=q.prettyErrors!==!1;return{lineCounter:q.lineCounter||Z&&new fH.LineCounter||null,prettyErrors:Z}}function yH(q,Z={}){let{lineCounter:X,prettyErrors:J}=R5(Z),$=new W5.Parser(X?.addNewLine),Q=new _5.Composer(Z),z=Array.from(Q.compose($.parse(q)));if(J&&X)for(let H of z)H.errors.forEach(Y0.prettifyError(q,X)),H.warnings.forEach(Y0.prettifyError(q,X));if(z.length>0)return z;return Object.assign([],{empty:!0},Q.streamInfo())}function V5(q,Z={}){let{lineCounter:X,prettyErrors:J}=R5(Z),$=new W5.Parser(X?.addNewLine),Q=new _5.Composer(Z),z=null;for(let H of Q.compose($.parse(q),!0,q.length))if(!z)z=H;else if(z.options.logLevel!=="silent"){z.errors.push(new Y0.YAMLParseError(H.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(J&&X)z.errors.forEach(Y0.prettifyError(q,X)),z.warnings.forEach(Y0.prettifyError(q,X));return z}function xH(q,Z,X){let J=void 0;if(typeof Z==="function")J=Z;else if(X===void 0&&Z&&typeof Z==="object")X=Z;let $=V5(q,X);if(!$)return null;if($.warnings.forEach((Q)=>CH.warn($.options.logLevel,Q)),$.errors.length>0)if($.options.logLevel!=="silent")throw $.errors[0];else $.errors=[];return $.toJS(Object.assign({reviver:J},X))}function kH(q,Z,X){let J=null;if(typeof Z==="function"||Array.isArray(Z))J=Z;else if(X===void 0&&Z)X=Z;if(typeof X==="string")X=X.length;if(typeof X==="number"){let $=Math.round(X);X=$<1?void 0:$>8?{indent:8}:{indent:$}}if(q===void 0){let{keepUndefined:$}=X??Z??{};if(!$)return}if(EH.isDocument(q)&&!J)return q.toString(X);return new jH.Document(q,J,X).toString(X)}vH.parse=xH;vH.parseAllDocuments=yH;vH.parseDocument=V5;vH.stringify=kH});var Y4=D(($T,G4)=>{var Iq=process||{},P5=Iq.argv||[],Lq=Iq.env||{},jU=!(!!Lq.NO_COLOR||P5.includes("--no-color"))&&(!!Lq.FORCE_COLOR||P5.includes("--color")||Iq.platform==="win32"||(Iq.stdout||{}).isTTY&&Lq.TERM!=="dumb"||!!Lq.CI),CU=(q,Z,X=q)=>(J)=>{let $=""+J,Q=$.indexOf(Z,q.length);return~Q?q+EU($,Z,X,Q)+Z:q+$+Z},EU=(q,Z,X,J)=>{let $="",Q=0;do $+=q.substring(Q,J)+X,Q=J+Z.length,J=q.indexOf(Z,Q);while(~J);return $+q.substring(Q)},D5=(q=jU)=>{let Z=q?CU:()=>String;return{isColorSupported:q,reset:Z("\x1B[0m","\x1B[0m"),bold:Z("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:Z("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:Z("\x1B[3m","\x1B[23m"),underline:Z("\x1B[4m","\x1B[24m"),inverse:Z("\x1B[7m","\x1B[27m"),hidden:Z("\x1B[8m","\x1B[28m"),strikethrough:Z("\x1B[9m","\x1B[29m"),black:Z("\x1B[30m","\x1B[39m"),red:Z("\x1B[31m","\x1B[39m"),green:Z("\x1B[32m","\x1B[39m"),yellow:Z("\x1B[33m","\x1B[39m"),blue:Z("\x1B[34m","\x1B[39m"),magenta:Z("\x1B[35m","\x1B[39m"),cyan:Z("\x1B[36m","\x1B[39m"),white:Z("\x1B[37m","\x1B[39m"),gray:Z("\x1B[90m","\x1B[39m"),bgBlack:Z("\x1B[40m","\x1B[49m"),bgRed:Z("\x1B[41m","\x1B[49m"),bgGreen:Z("\x1B[42m","\x1B[49m"),bgYellow:Z("\x1B[43m","\x1B[49m"),bgBlue:Z("\x1B[44m","\x1B[49m"),bgMagenta:Z("\x1B[45m","\x1B[49m"),bgCyan:Z("\x1B[46m","\x1B[49m"),bgWhite:Z("\x1B[47m","\x1B[49m"),blackBright:Z("\x1B[90m","\x1B[39m"),redBright:Z("\x1B[91m","\x1B[39m"),greenBright:Z("\x1B[92m","\x1B[39m"),yellowBright:Z("\x1B[93m","\x1B[39m"),blueBright:Z("\x1B[94m","\x1B[39m"),magentaBright:Z("\x1B[95m","\x1B[39m"),cyanBright:Z("\x1B[96m","\x1B[39m"),whiteBright:Z("\x1B[97m","\x1B[39m"),bgBlackBright:Z("\x1B[100m","\x1B[49m"),bgRedBright:Z("\x1B[101m","\x1B[49m"),bgGreenBright:Z("\x1B[102m","\x1B[49m"),bgYellowBright:Z("\x1B[103m","\x1B[49m"),bgBlueBright:Z("\x1B[104m","\x1B[49m"),bgMagentaBright:Z("\x1B[105m","\x1B[49m"),bgCyanBright:Z("\x1B[106m","\x1B[49m"),bgWhiteBright:Z("\x1B[107m","\x1B[49m")}};G4.exports=D5();G4.exports.createColors=D5});var T4=D((QT,F5)=>{var B4={to(q,Z){if(!Z)return`\x1B[${q+1}G`;return`\x1B[${Z+1};${q+1}H`},move(q,Z){let X="";if(q<0)X+=`\x1B[${-q}D`;else if(q>0)X+=`\x1B[${q}C`;if(Z<0)X+=`\x1B[${-Z}A`;else if(Z>0)X+=`\x1B[${Z}B`;return X},up:(q=1)=>`\x1B[${q}A`,down:(q=1)=>`\x1B[${q}B`,forward:(q=1)=>`\x1B[${q}C`,backward:(q=1)=>`\x1B[${q}D`,nextLine:(q=1)=>"\x1B[E".repeat(q),prevLine:(q=1)=>"\x1B[F".repeat(q),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},fU={up:(q=1)=>"\x1B[S".repeat(q),down:(q=1)=>"\x1B[T".repeat(q)},yU={screen:"\x1B[2J",up:(q=1)=>"\x1B[1J".repeat(q),down:(q=1)=>"\x1B[J".repeat(q),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(q){let Z="";for(let X=0;X<q;X++)Z+=this.line+(X<q-1?B4.up():"");if(q)Z+=B4.left;return Z}};F5.exports={cursor:B4,scroll:fU,erase:yU,beep:"\x07"}});var J2=h1(X2(),1),{program:TY,createCommand:_Y,createArgument:WY,createOption:RY,CommanderError:VY,InvalidArgumentError:LY,InvalidOptionArgumentError:IY,Command:g,Argument:MY,Option:KY,Help:PY}=J2.default;import{join as W1}from"node:path";import{homedir as F7,platform as O7}from"node:os";import{mkdir as N7,stat as A7}from"node:fs/promises";import{spawn as S7}from"node:child_process";import{join as _1}from"node:path";import{homedir as I7,platform as M7}from"node:os";import{appendFileSync as Q2,mkdirSync as K7}from"node:fs";function z2(){let q=I7(),Z=M7();if(Z==="darwin")return _1(q,"Library","Logs","agentdeps");if(Z==="win32"){let $=process.env.LOCALAPPDATA??_1(q,"AppData","Local");return _1($,"agentdeps","logs")}let X=process.env.XDG_STATE_HOME;if(X)return _1(X,"agentdeps","logs");let J=process.env.XDG_CACHE_HOME;return _1(J??_1(q,".cache"),"agentdeps","logs")}function sq(){return _1(z2(),"agentdeps.log")}var O0=0,P7=0,$2=!1;function H2(){if($2)return!0;try{return K7(z2(),{recursive:!0}),$2=!0,!0}catch{return!1}}function D7(q){if(q instanceof Error)return q.stack??`${q.name}: ${q.message}`;if(typeof q==="object"&&q!==null)return JSON.stringify(q,null,2);return String(q)}function U2(){return new Date().toISOString()}function o(q,Z){if(!H2())return;let X=`[${U2()}] ERROR [${q}]
166
- ${D7(Z)}
165
+ `,Z)+1}return{type:q,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(q){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let Z=_q(q),X=k1(Z);return X.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:X,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let Z=_q(q),X=k1(Z);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:X,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(q,Z){if(this.type!=="comment")return!1;if(this.indent<=Z)return!1;return q.every((X)=>X.type==="newline"||X.type==="space")}*documentEnd(q){if(this.type!=="doc-mode"){if(q.end)q.end.push(this.sourceToken);else q.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd(q){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:if(q.end)q.end.push(this.sourceToken);else q.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}wH.Parser=B5});var R5=P((vH)=>{var T5=a9(),jH=Q0(),B0=z0(),EH=J9(),CH=S(),fH=J4(),_5=$4();function L5(q){let Z=q.prettyErrors!==!1;return{lineCounter:q.lineCounter||Z&&new fH.LineCounter||null,prettyErrors:Z}}function xH(q,Z={}){let{lineCounter:X,prettyErrors:J}=L5(Z),$=new _5.Parser(X?.addNewLine),Q=new T5.Composer(Z),z=Array.from(Q.compose($.parse(q)));if(J&&X)for(let H of z)H.errors.forEach(B0.prettifyError(q,X)),H.warnings.forEach(B0.prettifyError(q,X));if(z.length>0)return z;return Object.assign([],{empty:!0},Q.streamInfo())}function W5(q,Z={}){let{lineCounter:X,prettyErrors:J}=L5(Z),$=new _5.Parser(X?.addNewLine),Q=new T5.Composer(Z),z=null;for(let H of Q.compose($.parse(q),!0,q.length))if(!z)z=H;else if(z.options.logLevel!=="silent"){z.errors.push(new B0.YAMLParseError(H.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(J&&X)z.errors.forEach(B0.prettifyError(q,X)),z.warnings.forEach(B0.prettifyError(q,X));return z}function yH(q,Z,X){let J=void 0;if(typeof Z==="function")J=Z;else if(X===void 0&&Z&&typeof Z==="object")X=Z;let $=W5(q,X);if(!$)return null;if($.warnings.forEach((Q)=>EH.warn($.options.logLevel,Q)),$.errors.length>0)if($.options.logLevel!=="silent")throw $.errors[0];else $.errors=[];return $.toJS(Object.assign({reviver:J},X))}function kH(q,Z,X){let J=null;if(typeof Z==="function"||Array.isArray(Z))J=Z;else if(X===void 0&&Z)X=Z;if(typeof X==="string")X=X.length;if(typeof X==="number"){let $=Math.round(X);X=$<1?void 0:$>8?{indent:8}:{indent:$}}if(q===void 0){let{keepUndefined:$}=X??Z??{};if(!$)return}if(CH.isDocument(q)&&!J)return q.toString(X);return new jH.Document(q,J,X).toString(X)}vH.parse=yH;vH.parseAllDocuments=xH;vH.parseDocument=W5;vH.stringify=kH});var G4=P((JT,U4)=>{var Mq=process||{},K5=Mq.argv||[],Iq=Mq.env||{},jU=!(!!Iq.NO_COLOR||K5.includes("--no-color"))&&(!!Iq.FORCE_COLOR||K5.includes("--color")||Mq.platform==="win32"||(Mq.stdout||{}).isTTY&&Iq.TERM!=="dumb"||!!Iq.CI),EU=(q,Z,X=q)=>(J)=>{let $=""+J,Q=$.indexOf(Z,q.length);return~Q?q+CU($,Z,X,Q)+Z:q+$+Z},CU=(q,Z,X,J)=>{let $="",Q=0;do $+=q.substring(Q,J)+X,Q=J+Z.length,J=q.indexOf(Z,Q);while(~J);return $+q.substring(Q)},D5=(q=jU)=>{let Z=q?EU:()=>String;return{isColorSupported:q,reset:Z("\x1B[0m","\x1B[0m"),bold:Z("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:Z("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:Z("\x1B[3m","\x1B[23m"),underline:Z("\x1B[4m","\x1B[24m"),inverse:Z("\x1B[7m","\x1B[27m"),hidden:Z("\x1B[8m","\x1B[28m"),strikethrough:Z("\x1B[9m","\x1B[29m"),black:Z("\x1B[30m","\x1B[39m"),red:Z("\x1B[31m","\x1B[39m"),green:Z("\x1B[32m","\x1B[39m"),yellow:Z("\x1B[33m","\x1B[39m"),blue:Z("\x1B[34m","\x1B[39m"),magenta:Z("\x1B[35m","\x1B[39m"),cyan:Z("\x1B[36m","\x1B[39m"),white:Z("\x1B[37m","\x1B[39m"),gray:Z("\x1B[90m","\x1B[39m"),bgBlack:Z("\x1B[40m","\x1B[49m"),bgRed:Z("\x1B[41m","\x1B[49m"),bgGreen:Z("\x1B[42m","\x1B[49m"),bgYellow:Z("\x1B[43m","\x1B[49m"),bgBlue:Z("\x1B[44m","\x1B[49m"),bgMagenta:Z("\x1B[45m","\x1B[49m"),bgCyan:Z("\x1B[46m","\x1B[49m"),bgWhite:Z("\x1B[47m","\x1B[49m"),blackBright:Z("\x1B[90m","\x1B[39m"),redBright:Z("\x1B[91m","\x1B[39m"),greenBright:Z("\x1B[92m","\x1B[39m"),yellowBright:Z("\x1B[93m","\x1B[39m"),blueBright:Z("\x1B[94m","\x1B[39m"),magentaBright:Z("\x1B[95m","\x1B[39m"),cyanBright:Z("\x1B[96m","\x1B[39m"),whiteBright:Z("\x1B[97m","\x1B[39m"),bgBlackBright:Z("\x1B[100m","\x1B[49m"),bgRedBright:Z("\x1B[101m","\x1B[49m"),bgGreenBright:Z("\x1B[102m","\x1B[49m"),bgYellowBright:Z("\x1B[103m","\x1B[49m"),bgBlueBright:Z("\x1B[104m","\x1B[49m"),bgMagentaBright:Z("\x1B[105m","\x1B[49m"),bgCyanBright:Z("\x1B[106m","\x1B[49m"),bgWhiteBright:Z("\x1B[107m","\x1B[49m")}};U4.exports=D5();U4.exports.createColors=D5});var B4=P(($T,P5)=>{var Y4={to(q,Z){if(!Z)return`\x1B[${q+1}G`;return`\x1B[${Z+1};${q+1}H`},move(q,Z){let X="";if(q<0)X+=`\x1B[${-q}D`;else if(q>0)X+=`\x1B[${q}C`;if(Z<0)X+=`\x1B[${-Z}A`;else if(Z>0)X+=`\x1B[${Z}B`;return X},up:(q=1)=>`\x1B[${q}A`,down:(q=1)=>`\x1B[${q}B`,forward:(q=1)=>`\x1B[${q}C`,backward:(q=1)=>`\x1B[${q}D`,nextLine:(q=1)=>"\x1B[E".repeat(q),prevLine:(q=1)=>"\x1B[F".repeat(q),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},fU={up:(q=1)=>"\x1B[S".repeat(q),down:(q=1)=>"\x1B[T".repeat(q)},xU={screen:"\x1B[2J",up:(q=1)=>"\x1B[1J".repeat(q),down:(q=1)=>"\x1B[J".repeat(q),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(q){let Z="";for(let X=0;X<q;X++)Z+=this.line+(X<q-1?Y4.up():"");if(q)Z+=Y4.left;return Z}};P5.exports={cursor:Y4,scroll:fU,erase:xU,beep:"\x07"}});var X2=u1(Z2(),1),{program:BY,createCommand:TY,createArgument:_Y,createOption:LY,CommanderError:WY,InvalidArgumentError:RY,InvalidOptionArgumentError:VY,Command:g,Argument:IY,Option:MY,Help:KY}=X2.default;import{join as L1}from"node:path";import{homedir as F7,platform as O7}from"node:os";import{mkdir as N7,stat as A7}from"node:fs/promises";import{spawn as S7}from"node:child_process";import{join as _1}from"node:path";import{homedir as I7,platform as M7}from"node:os";import{appendFileSync as $2,mkdirSync as K7}from"node:fs";function Q2(){let q=I7(),Z=M7();if(Z==="darwin")return _1(q,"Library","Logs","agentdeps");if(Z==="win32"){let $=process.env.LOCALAPPDATA??_1(q,"AppData","Local");return _1($,"agentdeps","logs")}let X=process.env.XDG_STATE_HOME;if(X)return _1(X,"agentdeps","logs");let J=process.env.XDG_CACHE_HOME;return _1(J??_1(q,".cache"),"agentdeps","logs")}function aq(){return _1(Q2(),"agentdeps.log")}var N0=0,D7=0,J2=!1;function z2(){if(J2)return!0;try{return K7(Q2(),{recursive:!0}),J2=!0,!0}catch{return!1}}function P7(q){if(q instanceof Error)return q.stack??`${q.name}: ${q.message}`;if(typeof q==="object"&&q!==null)return JSON.stringify(q,null,2);return String(q)}function H2(){return new Date().toISOString()}function o(q,Z){if(!z2())return;let X=`[${H2()}] ERROR [${q}]
166
+ ${P7(Z)}
167
167
 
168
- `;try{Q2(sq(),X)}catch{}O0++}function rq(q,Z){if(!H2())return;let X=`[${U2()}] WARN [${q}] ${Z}
169
- `;try{Q2(sq(),X)}catch{}P7++}function N0(){if(O0===0)return;console.error(`
170
- ⚠ ${O0} error${O0===1?"":"s"} occurred. See log for details:
171
- ${sq()}`)}function G2(){let q=F7(),Z=O7();if(Z==="darwin")return W1(q,"Library","Caches","agentdeps","repos");if(Z==="win32"){let J=process.env.LOCALAPPDATA??W1(q,"AppData","Local");return W1(J,"agentdeps","repos")}let X=process.env.XDG_CACHE_HOME;return W1(X??W1(q,".cache"),"agentdeps","repos")}async function R1(q,Z){return new Promise((X)=>{let J=S7("git",q,{cwd:Z,stdio:["ignore","pipe","pipe"]}),$=[],Q=[];J.stdout.on("data",(z)=>$.push(z)),J.stderr.on("data",(z)=>Q.push(z)),J.on("close",(z)=>{X({success:z===0,stdout:Buffer.concat($).toString().trim(),stderr:Buffer.concat(Q).toString().trim()})}),J.on("error",()=>{X({success:!1,stdout:"",stderr:"Failed to spawn git process"})})})}async function Y2(){try{return(await R1(["--version"])).success}catch{return!1}}async function w7(q){try{return(await A7(q)).isDirectory()}catch{return!1}}async function b7(q,Z,X){let J=G2();await N7(J,{recursive:!0});let $=W1(J,X),Q=await R1(["clone","--branch",Z,"--single-branch",q,$]);if(!Q.success){if((await R1(["clone",q,$])).success){let H=await R1(["checkout",Z],$);if(!H.success)return{success:!1,path:$,error:H.stderr};return{success:!0,path:$}}return{success:!1,path:$,error:Q.stderr}}return{success:!0,path:$}}async function j7(q,Z){let X=await R1(["fetch","origin"],q);if(!X.success)return{success:!1,error:X.stderr};if((await R1(["reset","--hard",`origin/${Z}`],q)).success)return{success:!0};let $=await R1(["checkout",Z],q);if(!$.success)return{success:!1,error:$.stderr};return{success:!0}}async function A0(q,Z,X){let J=G2(),$=W1(J,X);if(await w7($)){let z=await j7($,Z);if(!z.success)o("cache.update",Error(`Failed to update ${X}: ${z.error}`)),console.warn(`⚠ Failed to update ${X} (using cached version)`);return{success:!0,path:$}}let Q=await b7(q,Z,X);if(!Q.success)o("cache.clone",Error(`Failed to clone ${q}: ${Q.error}`)),console.warn(`⚠ Failed to clone ${q}`);return Q}var dH=s9(),lH=$0(),pH=E9(),z4=Q0(),cH=l1(),U1=S(),iH=J1(),aH=E(),sH=Q1(),rH=z1(),nB=Yq(),nH=J4(),oH=$4(),tH=Q4(),_q=L5(),I5=m1();var eH=dH.Composer,qU=lH.Document,ZU=pH.Schema,XU=z4.YAMLError,JU=z4.YAMLParseError,$U=z4.YAMLWarning,QU=cH.Alias,zU=U1.isAlias,HU=U1.isCollection,UU=U1.isDocument,GU=U1.isMap,YU=U1.isNode,BU=U1.isPair,TU=U1.isScalar,_U=U1.isSeq,WU=iH.Pair,RU=aH.Scalar,VU=sH.YAMLMap,LU=rH.YAMLSeq;var IU=nH.Lexer,MU=oH.LineCounter,KU=tH.Parser,B0=_q.parse,PU=_q.parseAllDocuments,DU=_q.parseDocument,T0=_q.stringify,FU=I5.visit,OU=I5.visitAsync;import{mkdir as NU,readFile as AU,writeFile as SU,access as M5}from"node:fs/promises";import{join as v1}from"node:path";import{homedir as wU,platform as bU}from"node:os";function H4(){let q=wU();if(bU()==="win32"){let J=process.env.APPDATA??v1(q,"AppData","Roaming");return v1(J,"agentdeps")}let X=process.env.XDG_CONFIG_HOME;return v1(X??v1(q,".config"),"agentdeps")}function Wq(){return v1(H4(),"config.yaml")}function Rq(){return v1(H4(),"agents.yaml")}async function K5(){try{return await M5(Wq()),!0}catch{return!1}}async function U4(){let q=Wq();try{await M5(q)}catch{return}let Z=await AU(q,"utf-8"),X=B0(Z),J=X.clone_method??"ssh";if(J!=="ssh"&&J!=="https")throw Error(`Invalid clone_method: "${J}". Must be "ssh" or "https".`);let $=X.install_method??"link";if($!=="link"&&$!=="copy")throw Error(`Invalid install_method: "${$}". Must be "link" or "copy".`);let Q=X.agents??[];if(!Array.isArray(Q))throw Error(`Invalid agents: expected an array, got ${typeof Q}.`);return{clone_method:J,agents:Q,install_method:$,custom_agents:X.custom_agents}}async function G1(){try{let q=await U4();if(!q)console.error("✗ No global config found. Run `agentdeps config` first."),process.exit(1);return q}catch(q){o("config",q);let Z=q instanceof Error?q.message:String(q);console.error(`✗ Invalid config at ${Wq()}: ${Z}`),console.error(" Run `agentdeps config` to fix it."),N0(),process.exit(1)}}async function Vq(q){let Z=H4();await NU(Z,{recursive:!0});let X=T0(q,{lineWidth:0});await SU(Wq(),X,"utf-8")}var Fq=h1(Y4(),1);import{stdout as S5,stdin as xU}from"node:process";var m=h1(T4(),1);import kU from"node:readline";var vU=(q)=>q===161||q===164||q===167||q===168||q===170||q===173||q===174||q>=176&&q<=180||q>=182&&q<=186||q>=188&&q<=191||q===198||q===208||q===215||q===216||q>=222&&q<=225||q===230||q>=232&&q<=234||q===236||q===237||q===240||q===242||q===243||q>=247&&q<=250||q===252||q===254||q===257||q===273||q===275||q===283||q===294||q===295||q===299||q>=305&&q<=307||q===312||q>=319&&q<=322||q===324||q>=328&&q<=331||q===333||q===338||q===339||q===358||q===359||q===363||q===462||q===464||q===466||q===468||q===470||q===472||q===474||q===476||q===593||q===609||q===708||q===711||q>=713&&q<=715||q===717||q===720||q>=728&&q<=731||q===733||q===735||q>=768&&q<=879||q>=913&&q<=929||q>=931&&q<=937||q>=945&&q<=961||q>=963&&q<=969||q===1025||q>=1040&&q<=1103||q===1105||q===8208||q>=8211&&q<=8214||q===8216||q===8217||q===8220||q===8221||q>=8224&&q<=8226||q>=8228&&q<=8231||q===8240||q===8242||q===8243||q===8245||q===8251||q===8254||q===8308||q===8319||q>=8321&&q<=8324||q===8364||q===8451||q===8453||q===8457||q===8467||q===8470||q===8481||q===8482||q===8486||q===8491||q===8531||q===8532||q>=8539&&q<=8542||q>=8544&&q<=8555||q>=8560&&q<=8569||q===8585||q>=8592&&q<=8601||q===8632||q===8633||q===8658||q===8660||q===8679||q===8704||q===8706||q===8707||q===8711||q===8712||q===8715||q===8719||q===8721||q===8725||q===8730||q>=8733&&q<=8736||q===8739||q===8741||q>=8743&&q<=8748||q===8750||q>=8756&&q<=8759||q===8764||q===8765||q===8776||q===8780||q===8786||q===8800||q===8801||q>=8804&&q<=8807||q===8810||q===8811||q===8814||q===8815||q===8834||q===8835||q===8838||q===8839||q===8853||q===8857||q===8869||q===8895||q===8978||q>=9312&&q<=9449||q>=9451&&q<=9547||q>=9552&&q<=9587||q>=9600&&q<=9615||q>=9618&&q<=9621||q===9632||q===9633||q>=9635&&q<=9641||q===9650||q===9651||q===9654||q===9655||q===9660||q===9661||q===9664||q===9665||q>=9670&&q<=9672||q===9675||q>=9678&&q<=9681||q>=9698&&q<=9701||q===9711||q===9733||q===9734||q===9737||q===9742||q===9743||q===9756||q===9758||q===9792||q===9794||q===9824||q===9825||q>=9827&&q<=9829||q>=9831&&q<=9834||q===9836||q===9837||q===9839||q===9886||q===9887||q===9919||q>=9926&&q<=9933||q>=9935&&q<=9939||q>=9941&&q<=9953||q===9955||q===9960||q===9961||q>=9963&&q<=9969||q===9972||q>=9974&&q<=9977||q===9979||q===9980||q===9982||q===9983||q===10045||q>=10102&&q<=10111||q>=11094&&q<=11097||q>=12872&&q<=12879||q>=57344&&q<=63743||q>=65024&&q<=65039||q===65533||q>=127232&&q<=127242||q>=127248&&q<=127277||q>=127280&&q<=127337||q>=127344&&q<=127373||q===127375||q===127376||q>=127387&&q<=127404||q>=917760&&q<=917999||q>=983040&&q<=1048573||q>=1048576&&q<=1114109,gU=(q)=>q===12288||q>=65281&&q<=65376||q>=65504&&q<=65510,hU=(q)=>q>=4352&&q<=4447||q===8986||q===8987||q===9001||q===9002||q>=9193&&q<=9196||q===9200||q===9203||q===9725||q===9726||q===9748||q===9749||q>=9800&&q<=9811||q===9855||q===9875||q===9889||q===9898||q===9899||q===9917||q===9918||q===9924||q===9925||q===9934||q===9940||q===9962||q===9970||q===9971||q===9973||q===9978||q===9981||q===9989||q===9994||q===9995||q===10024||q===10060||q===10062||q>=10067&&q<=10069||q===10071||q>=10133&&q<=10135||q===10160||q===10175||q===11035||q===11036||q===11088||q===11093||q>=11904&&q<=11929||q>=11931&&q<=12019||q>=12032&&q<=12245||q>=12272&&q<=12287||q>=12289&&q<=12350||q>=12353&&q<=12438||q>=12441&&q<=12543||q>=12549&&q<=12591||q>=12593&&q<=12686||q>=12688&&q<=12771||q>=12783&&q<=12830||q>=12832&&q<=12871||q>=12880&&q<=19903||q>=19968&&q<=42124||q>=42128&&q<=42182||q>=43360&&q<=43388||q>=44032&&q<=55203||q>=63744&&q<=64255||q>=65040&&q<=65049||q>=65072&&q<=65106||q>=65108&&q<=65126||q>=65128&&q<=65131||q>=94176&&q<=94180||q===94192||q===94193||q>=94208&&q<=100343||q>=100352&&q<=101589||q>=101632&&q<=101640||q>=110576&&q<=110579||q>=110581&&q<=110587||q===110589||q===110590||q>=110592&&q<=110882||q===110898||q>=110928&&q<=110930||q===110933||q>=110948&&q<=110951||q>=110960&&q<=111355||q===126980||q===127183||q===127374||q>=127377&&q<=127386||q>=127488&&q<=127490||q>=127504&&q<=127547||q>=127552&&q<=127560||q===127568||q===127569||q>=127584&&q<=127589||q>=127744&&q<=127776||q>=127789&&q<=127797||q>=127799&&q<=127868||q>=127870&&q<=127891||q>=127904&&q<=127946||q>=127951&&q<=127955||q>=127968&&q<=127984||q===127988||q>=127992&&q<=128062||q===128064||q>=128066&&q<=128252||q>=128255&&q<=128317||q>=128331&&q<=128334||q>=128336&&q<=128359||q===128378||q===128405||q===128406||q===128420||q>=128507&&q<=128591||q>=128640&&q<=128709||q===128716||q>=128720&&q<=128722||q>=128725&&q<=128727||q>=128732&&q<=128735||q===128747||q===128748||q>=128756&&q<=128764||q>=128992&&q<=129003||q===129008||q>=129292&&q<=129338||q>=129340&&q<=129349||q>=129351&&q<=129535||q>=129648&&q<=129660||q>=129664&&q<=129672||q>=129680&&q<=129725||q>=129727&&q<=129733||q>=129742&&q<=129755||q>=129760&&q<=129768||q>=129776&&q<=129784||q>=131072&&q<=196605||q>=196608&&q<=262141,_4=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,Mq=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Kq=/\t{1,1000}/y,W4=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,Pq=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,uU=/\p{M}+/gu,mU={limit:1/0,ellipsis:""},w5=(q,Z={},X={})=>{let J=Z.limit??1/0,$=Z.ellipsis??"",Q=Z?.ellipsisWidth??($?w5($,mU,X).width:0),z=X.ansiWidth??0,H=X.controlWidth??0,U=X.tabWidth??8,G=X.ambiguousWidth??1,Y=X.emojiWidth??2,B=X.fullWidthWidth??2,_=X.regularWidth??1,V=X.wideWidth??2,R=0,T=0,W=q.length,I=0,M=!1,P=W,O=Math.max(0,J-Q),N=0,A=0,K=0,L=0;q:for(;;){if(A>N||T>=W&&T>R){let w=q.slice(N,A)||q.slice(R,T);I=0;for(let y of w.replaceAll(uU,"")){let x=y.codePointAt(0)||0;if(gU(x)?L=B:hU(x)?L=V:G!==_&&vU(x)?L=G:L=_,K+L>O&&(P=Math.min(P,Math.max(N,R)+I)),K+L>J){M=!0;break q}I+=y.length,K+=L}N=A=0}if(T>=W)break;if(Pq.lastIndex=T,Pq.test(q)){if(I=Pq.lastIndex-T,L=I*_,K+L>O&&(P=Math.min(P,T+Math.floor((O-K)/_))),K+L>J){M=!0;break}K+=L,N=R,A=T,T=R=Pq.lastIndex;continue}if(_4.lastIndex=T,_4.test(q)){if(K+z>O&&(P=Math.min(P,T)),K+z>J){M=!0;break}K+=z,N=R,A=T,T=R=_4.lastIndex;continue}if(Mq.lastIndex=T,Mq.test(q)){if(I=Mq.lastIndex-T,L=I*H,K+L>O&&(P=Math.min(P,T+Math.floor((O-K)/H))),K+L>J){M=!0;break}K+=L,N=R,A=T,T=R=Mq.lastIndex;continue}if(Kq.lastIndex=T,Kq.test(q)){if(I=Kq.lastIndex-T,L=I*U,K+L>O&&(P=Math.min(P,T+Math.floor((O-K)/U))),K+L>J){M=!0;break}K+=L,N=R,A=T,T=R=Kq.lastIndex;continue}if(W4.lastIndex=T,W4.test(q)){if(K+Y>O&&(P=Math.min(P,T)),K+Y>J){M=!0;break}K+=Y,N=R,A=T,T=R=W4.lastIndex;continue}T+=1}return{width:M?O:K,index:M?P:W,truncated:M,ellipsed:M&&J>=Q}},dU={limit:1/0,ellipsis:"",ellipsisWidth:0},_0=(q,Z={})=>w5(q,dU,Z).width,Oq="\x1B",b5="›",lU=39,I4="\x07",j5="[",pU="]",C5="m",M4=`${pU}8;;`,O5=new RegExp(`(?:\\${j5}(?<code>\\d+)m|\\${M4}(?<uri>.*)${I4})`,"y"),cU=(q)=>{if(q>=30&&q<=37||q>=90&&q<=97)return 39;if(q>=40&&q<=47||q>=100&&q<=107)return 49;if(q===1||q===2)return 22;if(q===3)return 23;if(q===4)return 24;if(q===7)return 27;if(q===8)return 28;if(q===9)return 29;if(q===0)return 0},N5=(q)=>`${Oq}${j5}${q}${C5}`,A5=(q)=>`${Oq}${M4}${q}${I4}`,iU=(q)=>q.map((Z)=>_0(Z)),R4=(q,Z,X)=>{let J=Z[Symbol.iterator](),$=!1,Q=!1,z=q.at(-1),H=z===void 0?0:_0(z),U=J.next(),G=J.next(),Y=0;for(;!U.done;){let B=U.value,_=_0(B);H+_<=X?q[q.length-1]+=B:(q.push(B),H=0),(B===Oq||B===b5)&&($=!0,Q=Z.startsWith(M4,Y+1)),$?Q?B===I4&&($=!1,Q=!1):B===C5&&($=!1):(H+=_,H===X&&!G.done&&(q.push(""),H=0)),U=G,G=J.next(),Y+=B.length}z=q.at(-1),!H&&z!==void 0&&z.length>0&&q.length>1&&(q[q.length-2]+=q.pop())},aU=(q)=>{let Z=q.split(" "),X=Z.length;for(;X>0&&!(_0(Z[X-1])>0);)X--;return X===Z.length?q:Z.slice(0,X).join(" ")+Z.slice(X).join("")},sU=(q,Z,X={})=>{if(X.trim!==!1&&q.trim()==="")return"";let J="",$,Q,z=q.split(" "),H=iU(z),U=[""];for(let[R,T]of z.entries()){X.trim!==!1&&(U[U.length-1]=(U.at(-1)??"").trimStart());let W=_0(U.at(-1)??"");if(R!==0&&(W>=Z&&(X.wordWrap===!1||X.trim===!1)&&(U.push(""),W=0),(W>0||X.trim===!1)&&(U[U.length-1]+=" ",W++)),X.hard&&H[R]>Z){let I=Z-W,M=1+Math.floor((H[R]-I-1)/Z);Math.floor((H[R]-1)/Z)<M&&U.push(""),R4(U,T,Z);continue}if(W+H[R]>Z&&W>0&&H[R]>0){if(X.wordWrap===!1&&W<Z){R4(U,T,Z);continue}U.push("")}if(W+H[R]>Z&&X.wordWrap===!1){R4(U,T,Z);continue}U[U.length-1]+=T}X.trim!==!1&&(U=U.map((R)=>aU(R)));let G=U.join(`
172
- `),Y=G[Symbol.iterator](),B=Y.next(),_=Y.next(),V=0;for(;!B.done;){let R=B.value,T=_.value;if(J+=R,R===Oq||R===b5){O5.lastIndex=V+1;let I=O5.exec(G)?.groups;if(I?.code!==void 0){let M=Number.parseFloat(I.code);$=M===lU?void 0:M}else I?.uri!==void 0&&(Q=I.uri.length===0?void 0:I.uri)}let W=$?cU($):void 0;T===`
173
- `?(Q&&(J+=A5("")),$&&W&&(J+=N5(W))):R===`
174
- `&&($&&W&&(J+=N5($)),Q&&(J+=A5(Q))),V+=R.length,B=_,_=Y.next()}return J};function V4(q,Z,X){return String(q).normalize().replaceAll(`\r
168
+ `;try{$2(aq(),X)}catch{}N0++}function sq(q,Z){if(!z2())return;let X=`[${H2()}] WARN [${q}] ${Z}
169
+ `;try{$2(aq(),X)}catch{}D7++}function A0(){if(N0===0)return;console.error(`
170
+ ⚠ ${N0} error${N0===1?"":"s"} occurred. See log for details:
171
+ ${aq()}`)}function U2(){let q=F7(),Z=O7();if(Z==="darwin")return L1(q,"Library","Caches","agentdeps","repos");if(Z==="win32"){let J=process.env.LOCALAPPDATA??L1(q,"AppData","Local");return L1(J,"agentdeps","repos")}let X=process.env.XDG_CACHE_HOME;return L1(X??L1(q,".cache"),"agentdeps","repos")}async function W1(q,Z){return new Promise((X)=>{let J=S7("git",q,{cwd:Z,stdio:["ignore","pipe","pipe"]}),$=[],Q=[];J.stdout.on("data",(z)=>$.push(z)),J.stderr.on("data",(z)=>Q.push(z)),J.on("close",(z)=>{X({success:z===0,stdout:Buffer.concat($).toString().trim(),stderr:Buffer.concat(Q).toString().trim()})}),J.on("error",()=>{X({success:!1,stdout:"",stderr:"Failed to spawn git process"})})})}async function G2(){try{return(await W1(["--version"])).success}catch{return!1}}async function w7(q){try{return(await A7(q)).isDirectory()}catch{return!1}}async function b7(q,Z,X){let J=U2();await N7(J,{recursive:!0});let $=L1(J,X),Q=await W1(["clone","--branch",Z,"--single-branch",q,$]);if(!Q.success){if((await W1(["clone",q,$])).success){let H=await W1(["checkout",Z],$);if(!H.success)return{success:!1,path:$,error:H.stderr};return{success:!0,path:$}}return{success:!1,path:$,error:Q.stderr}}return{success:!0,path:$}}async function j7(q,Z){let X=await W1(["fetch","origin"],q);if(!X.success)return{success:!1,error:X.stderr};if((await W1(["reset","--hard",`origin/${Z}`],q)).success)return{success:!0};let $=await W1(["checkout",Z],q);if(!$.success)return{success:!1,error:$.stderr};return{success:!0}}async function S0(q,Z,X){let J=U2(),$=L1(J,X);if(await w7($)){let z=await j7($,Z);if(!z.success)o("cache.update",Error(`Failed to update ${X}: ${z.error}`)),console.warn(`⚠ Failed to update ${X} (using cached version)`);return{success:!0,path:$}}let Q=await b7(q,Z,X);if(!Q.success)o("cache.clone",Error(`Failed to clone ${q}: ${Q.error}`)),console.warn(`⚠ Failed to clone ${q}`);return Q}var dH=a9(),lH=Q0(),pH=E9(),Q4=z0(),cH=p1(),G1=S(),iH=$1(),aH=C(),sH=z1(),rH=H1(),rB=Bq(),nH=X4(),oH=J4(),tH=$4(),Lq=R5(),V5=d1();var eH=dH.Composer,qU=lH.Document,ZU=pH.Schema,XU=Q4.YAMLError,JU=Q4.YAMLParseError,$U=Q4.YAMLWarning,QU=cH.Alias,zU=G1.isAlias,HU=G1.isCollection,UU=G1.isDocument,GU=G1.isMap,YU=G1.isNode,BU=G1.isPair,TU=G1.isScalar,_U=G1.isSeq,LU=iH.Pair,WU=aH.Scalar,RU=sH.YAMLMap,VU=rH.YAMLSeq;var IU=nH.Lexer,MU=oH.LineCounter,KU=tH.Parser,T0=Lq.parse,DU=Lq.parseAllDocuments,PU=Lq.parseDocument,_0=Lq.stringify,FU=V5.visit,OU=V5.visitAsync;import{mkdir as NU,readFile as AU,writeFile as SU,access as I5}from"node:fs/promises";import{join as v1}from"node:path";import{homedir as wU,platform as bU}from"node:os";function z4(){let q=wU();if(bU()==="win32"){let J=process.env.APPDATA??v1(q,"AppData","Roaming");return v1(J,"agentdeps")}let X=process.env.XDG_CONFIG_HOME;return v1(X??v1(q,".config"),"agentdeps")}function Wq(){return v1(z4(),"config.yaml")}function Rq(){return v1(z4(),"agents.yaml")}async function M5(){try{return await I5(Wq()),!0}catch{return!1}}async function H4(){let q=Wq();try{await I5(q)}catch{return}let Z=await AU(q,"utf-8"),X=T0(Z),J=X.clone_method??"ssh";if(J!=="ssh"&&J!=="https")throw Error(`Invalid clone_method: "${J}". Must be "ssh" or "https".`);let $=X.install_method??"link";if($!=="link"&&$!=="copy")throw Error(`Invalid install_method: "${$}". Must be "link" or "copy".`);let Q=X.agents??[];if(!Array.isArray(Q))throw Error(`Invalid agents: expected an array, got ${typeof Q}.`);return{clone_method:J,agents:Q,install_method:$,custom_agents:X.custom_agents}}async function Y1(){try{let q=await H4();if(!q)console.error("✗ No global config found. Run `agentdeps config` first."),process.exit(1);return q}catch(q){o("config",q);let Z=q instanceof Error?q.message:String(q);console.error(`✗ Invalid config at ${Wq()}: ${Z}`),console.error(" Run `agentdeps config` to fix it."),A0(),process.exit(1)}}async function Vq(q){let Z=z4();await NU(Z,{recursive:!0});let X=_0(q,{lineWidth:0});await SU(Wq(),X,"utf-8")}var Oq=u1(G4(),1);import{stdout as A5,stdin as yU}from"node:process";var m=u1(B4(),1);import kU from"node:readline";var vU=(q)=>q===161||q===164||q===167||q===168||q===170||q===173||q===174||q>=176&&q<=180||q>=182&&q<=186||q>=188&&q<=191||q===198||q===208||q===215||q===216||q>=222&&q<=225||q===230||q>=232&&q<=234||q===236||q===237||q===240||q===242||q===243||q>=247&&q<=250||q===252||q===254||q===257||q===273||q===275||q===283||q===294||q===295||q===299||q>=305&&q<=307||q===312||q>=319&&q<=322||q===324||q>=328&&q<=331||q===333||q===338||q===339||q===358||q===359||q===363||q===462||q===464||q===466||q===468||q===470||q===472||q===474||q===476||q===593||q===609||q===708||q===711||q>=713&&q<=715||q===717||q===720||q>=728&&q<=731||q===733||q===735||q>=768&&q<=879||q>=913&&q<=929||q>=931&&q<=937||q>=945&&q<=961||q>=963&&q<=969||q===1025||q>=1040&&q<=1103||q===1105||q===8208||q>=8211&&q<=8214||q===8216||q===8217||q===8220||q===8221||q>=8224&&q<=8226||q>=8228&&q<=8231||q===8240||q===8242||q===8243||q===8245||q===8251||q===8254||q===8308||q===8319||q>=8321&&q<=8324||q===8364||q===8451||q===8453||q===8457||q===8467||q===8470||q===8481||q===8482||q===8486||q===8491||q===8531||q===8532||q>=8539&&q<=8542||q>=8544&&q<=8555||q>=8560&&q<=8569||q===8585||q>=8592&&q<=8601||q===8632||q===8633||q===8658||q===8660||q===8679||q===8704||q===8706||q===8707||q===8711||q===8712||q===8715||q===8719||q===8721||q===8725||q===8730||q>=8733&&q<=8736||q===8739||q===8741||q>=8743&&q<=8748||q===8750||q>=8756&&q<=8759||q===8764||q===8765||q===8776||q===8780||q===8786||q===8800||q===8801||q>=8804&&q<=8807||q===8810||q===8811||q===8814||q===8815||q===8834||q===8835||q===8838||q===8839||q===8853||q===8857||q===8869||q===8895||q===8978||q>=9312&&q<=9449||q>=9451&&q<=9547||q>=9552&&q<=9587||q>=9600&&q<=9615||q>=9618&&q<=9621||q===9632||q===9633||q>=9635&&q<=9641||q===9650||q===9651||q===9654||q===9655||q===9660||q===9661||q===9664||q===9665||q>=9670&&q<=9672||q===9675||q>=9678&&q<=9681||q>=9698&&q<=9701||q===9711||q===9733||q===9734||q===9737||q===9742||q===9743||q===9756||q===9758||q===9792||q===9794||q===9824||q===9825||q>=9827&&q<=9829||q>=9831&&q<=9834||q===9836||q===9837||q===9839||q===9886||q===9887||q===9919||q>=9926&&q<=9933||q>=9935&&q<=9939||q>=9941&&q<=9953||q===9955||q===9960||q===9961||q>=9963&&q<=9969||q===9972||q>=9974&&q<=9977||q===9979||q===9980||q===9982||q===9983||q===10045||q>=10102&&q<=10111||q>=11094&&q<=11097||q>=12872&&q<=12879||q>=57344&&q<=63743||q>=65024&&q<=65039||q===65533||q>=127232&&q<=127242||q>=127248&&q<=127277||q>=127280&&q<=127337||q>=127344&&q<=127373||q===127375||q===127376||q>=127387&&q<=127404||q>=917760&&q<=917999||q>=983040&&q<=1048573||q>=1048576&&q<=1114109,gU=(q)=>q===12288||q>=65281&&q<=65376||q>=65504&&q<=65510,hU=(q)=>q>=4352&&q<=4447||q===8986||q===8987||q===9001||q===9002||q>=9193&&q<=9196||q===9200||q===9203||q===9725||q===9726||q===9748||q===9749||q>=9800&&q<=9811||q===9855||q===9875||q===9889||q===9898||q===9899||q===9917||q===9918||q===9924||q===9925||q===9934||q===9940||q===9962||q===9970||q===9971||q===9973||q===9978||q===9981||q===9989||q===9994||q===9995||q===10024||q===10060||q===10062||q>=10067&&q<=10069||q===10071||q>=10133&&q<=10135||q===10160||q===10175||q===11035||q===11036||q===11088||q===11093||q>=11904&&q<=11929||q>=11931&&q<=12019||q>=12032&&q<=12245||q>=12272&&q<=12287||q>=12289&&q<=12350||q>=12353&&q<=12438||q>=12441&&q<=12543||q>=12549&&q<=12591||q>=12593&&q<=12686||q>=12688&&q<=12771||q>=12783&&q<=12830||q>=12832&&q<=12871||q>=12880&&q<=19903||q>=19968&&q<=42124||q>=42128&&q<=42182||q>=43360&&q<=43388||q>=44032&&q<=55203||q>=63744&&q<=64255||q>=65040&&q<=65049||q>=65072&&q<=65106||q>=65108&&q<=65126||q>=65128&&q<=65131||q>=94176&&q<=94180||q===94192||q===94193||q>=94208&&q<=100343||q>=100352&&q<=101589||q>=101632&&q<=101640||q>=110576&&q<=110579||q>=110581&&q<=110587||q===110589||q===110590||q>=110592&&q<=110882||q===110898||q>=110928&&q<=110930||q===110933||q>=110948&&q<=110951||q>=110960&&q<=111355||q===126980||q===127183||q===127374||q>=127377&&q<=127386||q>=127488&&q<=127490||q>=127504&&q<=127547||q>=127552&&q<=127560||q===127568||q===127569||q>=127584&&q<=127589||q>=127744&&q<=127776||q>=127789&&q<=127797||q>=127799&&q<=127868||q>=127870&&q<=127891||q>=127904&&q<=127946||q>=127951&&q<=127955||q>=127968&&q<=127984||q===127988||q>=127992&&q<=128062||q===128064||q>=128066&&q<=128252||q>=128255&&q<=128317||q>=128331&&q<=128334||q>=128336&&q<=128359||q===128378||q===128405||q===128406||q===128420||q>=128507&&q<=128591||q>=128640&&q<=128709||q===128716||q>=128720&&q<=128722||q>=128725&&q<=128727||q>=128732&&q<=128735||q===128747||q===128748||q>=128756&&q<=128764||q>=128992&&q<=129003||q===129008||q>=129292&&q<=129338||q>=129340&&q<=129349||q>=129351&&q<=129535||q>=129648&&q<=129660||q>=129664&&q<=129672||q>=129680&&q<=129725||q>=129727&&q<=129733||q>=129742&&q<=129755||q>=129760&&q<=129768||q>=129776&&q<=129784||q>=131072&&q<=196605||q>=196608&&q<=262141,T4=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,Kq=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Dq=/\t{1,1000}/y,_4=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,Pq=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,uU=/\p{M}+/gu,mU={limit:1/0,ellipsis:""},S5=(q,Z={},X={})=>{let J=Z.limit??1/0,$=Z.ellipsis??"",Q=Z?.ellipsisWidth??($?S5($,mU,X).width:0),z=X.ansiWidth??0,H=X.controlWidth??0,U=X.tabWidth??8,G=X.ambiguousWidth??1,B=X.emojiWidth??2,Y=X.fullWidthWidth??2,_=X.regularWidth??1,R=X.wideWidth??2,W=0,T=0,L=q.length,I=0,M=!1,D=L,O=Math.max(0,J-Q),N=0,A=0,K=0,V=0;q:for(;;){if(A>N||T>=L&&T>W){let w=q.slice(N,A)||q.slice(W,T);I=0;for(let x of w.replaceAll(uU,"")){let y=x.codePointAt(0)||0;if(gU(y)?V=Y:hU(y)?V=R:G!==_&&vU(y)?V=G:V=_,K+V>O&&(D=Math.min(D,Math.max(N,W)+I)),K+V>J){M=!0;break q}I+=x.length,K+=V}N=A=0}if(T>=L)break;if(Pq.lastIndex=T,Pq.test(q)){if(I=Pq.lastIndex-T,V=I*_,K+V>O&&(D=Math.min(D,T+Math.floor((O-K)/_))),K+V>J){M=!0;break}K+=V,N=W,A=T,T=W=Pq.lastIndex;continue}if(T4.lastIndex=T,T4.test(q)){if(K+z>O&&(D=Math.min(D,T)),K+z>J){M=!0;break}K+=z,N=W,A=T,T=W=T4.lastIndex;continue}if(Kq.lastIndex=T,Kq.test(q)){if(I=Kq.lastIndex-T,V=I*H,K+V>O&&(D=Math.min(D,T+Math.floor((O-K)/H))),K+V>J){M=!0;break}K+=V,N=W,A=T,T=W=Kq.lastIndex;continue}if(Dq.lastIndex=T,Dq.test(q)){if(I=Dq.lastIndex-T,V=I*U,K+V>O&&(D=Math.min(D,T+Math.floor((O-K)/U))),K+V>J){M=!0;break}K+=V,N=W,A=T,T=W=Dq.lastIndex;continue}if(_4.lastIndex=T,_4.test(q)){if(K+B>O&&(D=Math.min(D,T)),K+B>J){M=!0;break}K+=B,N=W,A=T,T=W=_4.lastIndex;continue}T+=1}return{width:M?O:K,index:M?D:L,truncated:M,ellipsed:M&&J>=Q}},dU={limit:1/0,ellipsis:"",ellipsisWidth:0},L0=(q,Z={})=>S5(q,dU,Z).width,Nq="\x1B",w5="›",lU=39,V4="\x07",b5="[",pU="]",j5="m",I4=`${pU}8;;`,F5=new RegExp(`(?:\\${b5}(?<code>\\d+)m|\\${I4}(?<uri>.*)${V4})`,"y"),cU=(q)=>{if(q>=30&&q<=37||q>=90&&q<=97)return 39;if(q>=40&&q<=47||q>=100&&q<=107)return 49;if(q===1||q===2)return 22;if(q===3)return 23;if(q===4)return 24;if(q===7)return 27;if(q===8)return 28;if(q===9)return 29;if(q===0)return 0},O5=(q)=>`${Nq}${b5}${q}${j5}`,N5=(q)=>`${Nq}${I4}${q}${V4}`,iU=(q)=>q.map((Z)=>L0(Z)),L4=(q,Z,X)=>{let J=Z[Symbol.iterator](),$=!1,Q=!1,z=q.at(-1),H=z===void 0?0:L0(z),U=J.next(),G=J.next(),B=0;for(;!U.done;){let Y=U.value,_=L0(Y);H+_<=X?q[q.length-1]+=Y:(q.push(Y),H=0),(Y===Nq||Y===w5)&&($=!0,Q=Z.startsWith(I4,B+1)),$?Q?Y===V4&&($=!1,Q=!1):Y===j5&&($=!1):(H+=_,H===X&&!G.done&&(q.push(""),H=0)),U=G,G=J.next(),B+=Y.length}z=q.at(-1),!H&&z!==void 0&&z.length>0&&q.length>1&&(q[q.length-2]+=q.pop())},aU=(q)=>{let Z=q.split(" "),X=Z.length;for(;X>0&&!(L0(Z[X-1])>0);)X--;return X===Z.length?q:Z.slice(0,X).join(" ")+Z.slice(X).join("")},sU=(q,Z,X={})=>{if(X.trim!==!1&&q.trim()==="")return"";let J="",$,Q,z=q.split(" "),H=iU(z),U=[""];for(let[W,T]of z.entries()){X.trim!==!1&&(U[U.length-1]=(U.at(-1)??"").trimStart());let L=L0(U.at(-1)??"");if(W!==0&&(L>=Z&&(X.wordWrap===!1||X.trim===!1)&&(U.push(""),L=0),(L>0||X.trim===!1)&&(U[U.length-1]+=" ",L++)),X.hard&&H[W]>Z){let I=Z-L,M=1+Math.floor((H[W]-I-1)/Z);Math.floor((H[W]-1)/Z)<M&&U.push(""),L4(U,T,Z);continue}if(L+H[W]>Z&&L>0&&H[W]>0){if(X.wordWrap===!1&&L<Z){L4(U,T,Z);continue}U.push("")}if(L+H[W]>Z&&X.wordWrap===!1){L4(U,T,Z);continue}U[U.length-1]+=T}X.trim!==!1&&(U=U.map((W)=>aU(W)));let G=U.join(`
172
+ `),B=G[Symbol.iterator](),Y=B.next(),_=B.next(),R=0;for(;!Y.done;){let W=Y.value,T=_.value;if(J+=W,W===Nq||W===w5){F5.lastIndex=R+1;let I=F5.exec(G)?.groups;if(I?.code!==void 0){let M=Number.parseFloat(I.code);$=M===lU?void 0:M}else I?.uri!==void 0&&(Q=I.uri.length===0?void 0:I.uri)}let L=$?cU($):void 0;T===`
173
+ `?(Q&&(J+=N5("")),$&&L&&(J+=O5(L))):W===`
174
+ `&&($&&L&&(J+=O5($)),Q&&(J+=N5(Q))),R+=W.length,Y=_,_=B.next()}return J};function W4(q,Z,X){return String(q).normalize().replaceAll(`\r
175
175
  `,`
176
176
  `).split(`
177
177
  `).map((J)=>sU(J,Z,X)).join(`
178
178
  `)}var rU=["up","down","left","right","space","enter","cancel"],F1={actions:new Set(rU),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"},withGuide:!0};function E5(q,Z){if(typeof q=="string")return F1.aliases.get(q)===Z;for(let X of q)if(X!==void 0&&E5(X,Z))return!0;return!1}function nU(q,Z){if(q===Z)return;let X=q.split(`
179
179
  `),J=Z.split(`
180
- `),$=Math.max(X.length,J.length),Q=[];for(let z=0;z<$;z++)X[z]!==J[z]&&Q.push(z);return{lines:Q,numLinesBefore:X.length,numLinesAfter:J.length,numLines:$}}var UT=globalThis.process.platform.startsWith("win"),L4=Symbol("clack:cancel");function Y1(q){return q===L4}function Dq(q,Z){let X=q;X.isTTY&&X.setRawMode(Z)}var K4=(q)=>("columns"in q)&&typeof q.columns=="number"?q.columns:80,P4=(q)=>("rows"in q)&&typeof q.rows=="number"?q.rows:20;function N1(q,Z,X,J=X){let $=K4(q??S5);return V4(Z,$-X.length,{hard:!0,trim:!1}).split(`
180
+ `),$=Math.max(X.length,J.length),Q=[];for(let z=0;z<$;z++)X[z]!==J[z]&&Q.push(z);return{lines:Q,numLinesBefore:X.length,numLinesAfter:J.length,numLines:$}}var HT=globalThis.process.platform.startsWith("win"),R4=Symbol("clack:cancel");function q1(q){return q===R4}function Fq(q,Z){let X=q;X.isTTY&&X.setRawMode(Z)}var M4=(q)=>("columns"in q)&&typeof q.columns=="number"?q.columns:80,K4=(q)=>("rows"in q)&&typeof q.rows=="number"?q.rows:20;function N1(q,Z,X,J=X){let $=M4(q??A5);return W4(Z,$-X.length,{hard:!0,trim:!1}).split(`
181
181
  `).map((Q,z)=>`${z===0?J:X}${Q}`).join(`
182
- `)}class W0{input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame="";_subscribers=new Map;_cursor=0;state="initial";error="";value;userInput="";constructor(q,Z=!0){let{input:X=xU,output:J=S5,render:$,signal:Q,...z}=q;this.opts=z,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=$.bind(this),this._track=Z,this._abortSignal=Q,this.input=X,this.output=J}unsubscribe(){this._subscribers.clear()}setSubscriber(q,Z){let X=this._subscribers.get(q)??[];X.push(Z),this._subscribers.set(q,X)}on(q,Z){this.setSubscriber(q,{cb:Z})}once(q,Z){this.setSubscriber(q,{cb:Z,once:!0})}emit(q,...Z){let X=this._subscribers.get(q)??[],J=[];for(let $ of X)$.cb(...Z),$.once&&J.push(()=>X.splice(X.indexOf($),1));for(let $ of J)$()}prompt(){return new Promise((q)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),q(L4);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}this.rl=kU.createInterface({input:this.input,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),this.rl.prompt(),this.opts.initialUserInput!==void 0&&this._setUserInput(this.opts.initialUserInput,!0),this.input.on("keypress",this.onKeypress),Dq(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(m.cursor.show),this.output.off("resize",this.render),Dq(this.input,!1),q(this.value)}),this.once("cancel",()=>{this.output.write(m.cursor.show),this.output.off("resize",this.render),Dq(this.input,!1),q(L4)})})}_isActionKey(q,Z){return q==="\t"}_setValue(q){this.value=q,this.emit("value",this.value)}_setUserInput(q,Z){this.userInput=q??"",this.emit("userInput",this.userInput),Z&&this._track&&this.rl&&(this.rl.write(this.userInput),this._cursor=this.rl.cursor)}_clearUserInput(){this.rl?.write(null,{ctrl:!0,name:"u"}),this._setUserInput("")}onKeypress(q,Z){if(this._track&&Z.name!=="return"&&(Z.name&&this._isActionKey(q,Z)&&this.rl?.write(null,{ctrl:!0,name:"h"}),this._cursor=this.rl?.cursor??0,this._setUserInput(this.rl?.line)),this.state==="error"&&(this.state="active"),Z?.name&&(!this._track&&F1.aliases.has(Z.name)&&this.emit("cursor",F1.aliases.get(Z.name)),F1.actions.has(Z.name)&&this.emit("cursor",Z.name)),q&&(q.toLowerCase()==="y"||q.toLowerCase()==="n")&&this.emit("confirm",q.toLowerCase()==="y"),this.emit("key",q?.toLowerCase(),Z),Z?.name==="return"){if(this.opts.validate){let X=this.opts.validate(this.value);X&&(this.error=X instanceof Error?X.message:X,this.state="error",this.rl?.write(this.userInput))}this.state!=="error"&&(this.state="submit")}E5([q,Z?.name,Z?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
183
- `),Dq(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let q=V4(this._prevFrame,process.stdout.columns,{hard:!0,trim:!1}).split(`
184
- `).length-1;this.output.write(m.cursor.move(-999,q*-1))}render(){let q=V4(this._render(this)??"",process.stdout.columns,{hard:!0,trim:!1});if(q!==this._prevFrame){if(this.state==="initial")this.output.write(m.cursor.hide);else{let Z=nU(this._prevFrame,q),X=P4(this.output);if(this.restoreCursor(),Z){let J=Math.max(0,Z.numLinesAfter-X),$=Math.max(0,Z.numLinesBefore-X),Q=Z.lines.find((z)=>z>=J);if(Q===void 0){this._prevFrame=q;return}if(Z.lines.length===1){this.output.write(m.cursor.move(0,Q-$)),this.output.write(m.erase.lines(1));let z=q.split(`
182
+ `)}class W0{input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame="";_subscribers=new Map;_cursor=0;state="initial";error="";value;userInput="";constructor(q,Z=!0){let{input:X=yU,output:J=A5,render:$,signal:Q,...z}=q;this.opts=z,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=$.bind(this),this._track=Z,this._abortSignal=Q,this.input=X,this.output=J}unsubscribe(){this._subscribers.clear()}setSubscriber(q,Z){let X=this._subscribers.get(q)??[];X.push(Z),this._subscribers.set(q,X)}on(q,Z){this.setSubscriber(q,{cb:Z})}once(q,Z){this.setSubscriber(q,{cb:Z,once:!0})}emit(q,...Z){let X=this._subscribers.get(q)??[],J=[];for(let $ of X)$.cb(...Z),$.once&&J.push(()=>X.splice(X.indexOf($),1));for(let $ of J)$()}prompt(){return new Promise((q)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),q(R4);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}this.rl=kU.createInterface({input:this.input,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),this.rl.prompt(),this.opts.initialUserInput!==void 0&&this._setUserInput(this.opts.initialUserInput,!0),this.input.on("keypress",this.onKeypress),Fq(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(m.cursor.show),this.output.off("resize",this.render),Fq(this.input,!1),q(this.value)}),this.once("cancel",()=>{this.output.write(m.cursor.show),this.output.off("resize",this.render),Fq(this.input,!1),q(R4)})})}_isActionKey(q,Z){return q==="\t"}_setValue(q){this.value=q,this.emit("value",this.value)}_setUserInput(q,Z){this.userInput=q??"",this.emit("userInput",this.userInput),Z&&this._track&&this.rl&&(this.rl.write(this.userInput),this._cursor=this.rl.cursor)}_clearUserInput(){this.rl?.write(null,{ctrl:!0,name:"u"}),this._setUserInput("")}onKeypress(q,Z){if(this._track&&Z.name!=="return"&&(Z.name&&this._isActionKey(q,Z)&&this.rl?.write(null,{ctrl:!0,name:"h"}),this._cursor=this.rl?.cursor??0,this._setUserInput(this.rl?.line)),this.state==="error"&&(this.state="active"),Z?.name&&(!this._track&&F1.aliases.has(Z.name)&&this.emit("cursor",F1.aliases.get(Z.name)),F1.actions.has(Z.name)&&this.emit("cursor",Z.name)),q&&(q.toLowerCase()==="y"||q.toLowerCase()==="n")&&this.emit("confirm",q.toLowerCase()==="y"),this.emit("key",q?.toLowerCase(),Z),Z?.name==="return"){if(this.opts.validate){let X=this.opts.validate(this.value);X&&(this.error=X instanceof Error?X.message:X,this.state="error",this.rl?.write(this.userInput))}this.state!=="error"&&(this.state="submit")}E5([q,Z?.name,Z?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
183
+ `),Fq(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let q=W4(this._prevFrame,process.stdout.columns,{hard:!0,trim:!1}).split(`
184
+ `).length-1;this.output.write(m.cursor.move(-999,q*-1))}render(){let q=W4(this._render(this)??"",process.stdout.columns,{hard:!0,trim:!1});if(q!==this._prevFrame){if(this.state==="initial")this.output.write(m.cursor.hide);else{let Z=nU(this._prevFrame,q),X=K4(this.output);if(this.restoreCursor(),Z){let J=Math.max(0,Z.numLinesAfter-X),$=Math.max(0,Z.numLinesBefore-X),Q=Z.lines.find((z)=>z>=J);if(Q===void 0){this._prevFrame=q;return}if(Z.lines.length===1){this.output.write(m.cursor.move(0,Q-$)),this.output.write(m.erase.lines(1));let z=q.split(`
185
185
  `);this.output.write(z[Q]),this._prevFrame=q,this.output.write(m.cursor.move(0,z.length-Q-1));return}else if(Z.lines.length>1){if(J<$)Q=J;else{let H=Q-$;H>0&&this.output.write(m.cursor.move(0,H))}this.output.write(m.erase.down());let z=q.split(`
186
186
  `).slice(Q);this.output.write(z.join(`
187
- `)),this._prevFrame=q;return}}this.output.write(m.erase.down())}this.output.write(q),this.state==="initial"&&(this.state="active"),this._prevFrame=q}}}function oU(q,Z){if(q===void 0||Z.length===0)return 0;let X=Z.findIndex((J)=>J.value===q);return X!==-1?X:0}function tU(q,Z){return(Z.label??String(Z.value)).toLowerCase().includes(q.toLowerCase())}function eU(q,Z){if(Z)return q?Z:Z[0]}class f5 extends W0{filteredOptions;multiple;isNavigating=!1;selectedValues=[];focusedValue;#q=0;#X="";#J;#Z;get cursor(){return this.#q}get userInputWithCursor(){if(!this.userInput)return Fq.default.inverse(Fq.default.hidden("_"));if(this._cursor>=this.userInput.length)return`${this.userInput}█`;let q=this.userInput.slice(0,this._cursor),[Z,...X]=this.userInput.slice(this._cursor);return`${q}${Fq.default.inverse(Z)}${X.join("")}`}get options(){return typeof this.#Z=="function"?this.#Z():this.#Z}constructor(q){super(q),this.#Z=q.options;let Z=this.options;this.filteredOptions=[...Z],this.multiple=q.multiple===!0,this.#J=q.filter??tU;let X;if(q.initialValue&&Array.isArray(q.initialValue)?this.multiple?X=q.initialValue:X=q.initialValue.slice(0,1):!this.multiple&&this.options.length>0&&(X=[this.options[0].value]),X)for(let J of X){let $=Z.findIndex((Q)=>Q.value===J);$!==-1&&(this.toggleSelected(J),this.#q=$)}this.focusedValue=this.options[this.#q]?.value,this.on("key",(J,$)=>this.#$(J,$)),this.on("userInput",(J)=>this.#Q(J))}_isActionKey(q,Z){return q==="\t"||this.multiple&&this.isNavigating&&Z.name==="space"&&q!==void 0&&q!==""}#$(q,Z){let X=Z.name==="up",J=Z.name==="down",$=Z.name==="return";X||J?(this.#q=Math.max(0,Math.min(this.#q+(X?-1:1),this.filteredOptions.length-1)),this.focusedValue=this.filteredOptions[this.#q]?.value,this.multiple||(this.selectedValues=[this.focusedValue]),this.isNavigating=!0):$?this.value=eU(this.multiple,this.selectedValues):this.multiple?this.focusedValue!==void 0&&(Z.name==="tab"||this.isNavigating&&Z.name==="space")?this.toggleSelected(this.focusedValue):this.isNavigating=!1:(this.focusedValue&&(this.selectedValues=[this.focusedValue]),this.isNavigating=!1)}deselectAll(){this.selectedValues=[]}toggleSelected(q){this.filteredOptions.length!==0&&(this.multiple?this.selectedValues.includes(q)?this.selectedValues=this.selectedValues.filter((Z)=>Z!==q):this.selectedValues=[...this.selectedValues,q]:this.selectedValues=[q])}#Q(q){if(q!==this.#X){this.#X=q;let Z=this.options;q?this.filteredOptions=Z.filter((X)=>this.#J(q,X)):this.filteredOptions=[...Z],this.#q=oU(this.focusedValue,this.filteredOptions),this.focusedValue=this.filteredOptions[this.#q]?.value,this.multiple||(this.focusedValue!==void 0?this.toggleSelected(this.focusedValue):this.deselectAll())}}}class y5 extends W0{options;cursor=0;#q;getGroupItems(q){return this.options.filter((Z)=>Z.group===q)}isGroupSelected(q){let Z=this.getGroupItems(q),X=this.value;return X===void 0?!1:Z.every((J)=>X.includes(J.value))}toggleValue(){let q=this.options[this.cursor];if(this.value===void 0&&(this.value=[]),q.group===!0){let Z=q.value,X=this.getGroupItems(Z);this.isGroupSelected(Z)?this.value=this.value.filter((J)=>X.findIndex(($)=>$.value===J)===-1):this.value=[...this.value,...X.map((J)=>J.value)],this.value=Array.from(new Set(this.value))}else{let Z=this.value.includes(q.value);this.value=Z?this.value.filter((X)=>X!==q.value):[...this.value,q.value]}}constructor(q){super(q,!1);let{options:Z}=q;this.#q=q.selectableGroups!==!1,this.options=Object.entries(Z).flatMap(([X,J])=>[{value:X,group:!0,label:X},...J.map(($)=>({...$,group:X}))]),this.value=[...q.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:X})=>X===q.cursorAt),this.#q?0:1),this.on("cursor",(X)=>{switch(X){case"left":case"up":{this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;let J=this.options[this.cursor]?.group===!0;!this.#q&&J&&(this.cursor=this.cursor===0?this.options.length-1:this.cursor-1);break}case"down":case"right":{this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;let J=this.options[this.cursor]?.group===!0;!this.#q&&J&&(this.cursor=this.cursor===this.options.length-1?0:this.cursor+1);break}case"space":this.toggleValue();break}})}}function O1(q,Z,X){let J=q+Z,$=Math.max(X.length-1,0),Q=J<0?$:J>$?0:J;return X[Q].disabled?O1(Q,Z<0?-1:1,X):Q}class D4 extends W0{options;cursor=0;get _value(){return this.options[this.cursor].value}get _enabledOptions(){return this.options.filter((q)=>q.disabled!==!0)}toggleAll(){let q=this._enabledOptions,Z=this.value!==void 0&&this.value.length===q.length;this.value=Z?[]:q.map((X)=>X.value)}toggleInvert(){let q=this.value;if(!q)return;let Z=this._enabledOptions.filter((X)=>!q.includes(X.value));this.value=Z.map((X)=>X.value)}toggleValue(){this.value===void 0&&(this.value=[]);let q=this.value.includes(this._value);this.value=q?this.value.filter((Z)=>Z!==this._value):[...this.value,this._value]}constructor(q){super(q,!1),this.options=q.options,this.value=[...q.initialValues??[]];let Z=Math.max(this.options.findIndex(({value:X})=>X===q.cursorAt),0);this.cursor=this.options[Z].disabled?O1(Z,1,this.options):Z,this.on("key",(X)=>{X==="a"&&this.toggleAll(),X==="i"&&this.toggleInvert()}),this.on("cursor",(X)=>{switch(X){case"left":case"up":this.cursor=O1(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=O1(this.cursor,1,this.options);break;case"space":this.toggleValue();break}})}}class F4 extends W0{options;cursor=0;get _selectedValue(){return this.options[this.cursor]}changeValue(){this.value=this._selectedValue.value}constructor(q){super(q,!1),this.options=q.options;let Z=this.options.findIndex(({value:J})=>J===q.initialValue),X=Z===-1?0:Z;this.cursor=this.options[X].disabled?O1(X,1,this.options):X,this.changeValue(),this.on("cursor",(J)=>{switch(J){case"left":case"up":this.cursor=O1(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=O1(this.cursor,1,this.options);break}this.changeValue()})}}var F=h1(Y4(),1);import p from"node:process";var m5=h1(T4(),1);function qG(){return p.platform!=="win32"?p.env.TERM!=="linux":!!p.env.CI||!!p.env.WT_SESSION||!!p.env.TERMINUS_SUBLIME||p.env.ConEmuTask==="{cmd::Cmder}"||p.env.TERM_PROGRAM==="Terminus-Sublime"||p.env.TERM_PROGRAM==="vscode"||p.env.TERM==="xterm-256color"||p.env.TERM==="alacritty"||p.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var ZG=qG();var j=(q,Z)=>ZG?q:Z,XG=j("◆","*"),JG=j("■","x"),$G=j("▲","x"),d5=j("◇","o"),QG=j("┌","T"),f=j("│","|"),V0=j("└","—"),IT=j("┐","T"),MT=j("┘","—"),zG=j("●",">"),x5=j("○"," "),HG=j("◻","[•]"),k5=j("◼","[+]"),v5=j("◻","[ ]"),KT=j("▪","•"),PT=j("─","-"),DT=j("╮","+"),FT=j("├","+"),OT=j("╯","+"),NT=j("╰","+"),AT=j("╭","+"),UG=j("●","•"),GG=j("◆","*"),YG=j("▲","!"),BG=j("■","x"),l5=(q)=>{switch(q){case"initial":case"active":return F.default.cyan(XG);case"cancel":return F.default.red(JG);case"error":return F.default.yellow($G);case"submit":return F.default.green(d5)}},p5=(q)=>{switch(q){case"initial":case"active":return F.default.cyan(f);case"cancel":return F.default.red(f);case"error":return F.default.yellow(f);case"submit":return F.default.green(f)}},TG=(q)=>q===161||q===164||q===167||q===168||q===170||q===173||q===174||q>=176&&q<=180||q>=182&&q<=186||q>=188&&q<=191||q===198||q===208||q===215||q===216||q>=222&&q<=225||q===230||q>=232&&q<=234||q===236||q===237||q===240||q===242||q===243||q>=247&&q<=250||q===252||q===254||q===257||q===273||q===275||q===283||q===294||q===295||q===299||q>=305&&q<=307||q===312||q>=319&&q<=322||q===324||q>=328&&q<=331||q===333||q===338||q===339||q===358||q===359||q===363||q===462||q===464||q===466||q===468||q===470||q===472||q===474||q===476||q===593||q===609||q===708||q===711||q>=713&&q<=715||q===717||q===720||q>=728&&q<=731||q===733||q===735||q>=768&&q<=879||q>=913&&q<=929||q>=931&&q<=937||q>=945&&q<=961||q>=963&&q<=969||q===1025||q>=1040&&q<=1103||q===1105||q===8208||q>=8211&&q<=8214||q===8216||q===8217||q===8220||q===8221||q>=8224&&q<=8226||q>=8228&&q<=8231||q===8240||q===8242||q===8243||q===8245||q===8251||q===8254||q===8308||q===8319||q>=8321&&q<=8324||q===8364||q===8451||q===8453||q===8457||q===8467||q===8470||q===8481||q===8482||q===8486||q===8491||q===8531||q===8532||q>=8539&&q<=8542||q>=8544&&q<=8555||q>=8560&&q<=8569||q===8585||q>=8592&&q<=8601||q===8632||q===8633||q===8658||q===8660||q===8679||q===8704||q===8706||q===8707||q===8711||q===8712||q===8715||q===8719||q===8721||q===8725||q===8730||q>=8733&&q<=8736||q===8739||q===8741||q>=8743&&q<=8748||q===8750||q>=8756&&q<=8759||q===8764||q===8765||q===8776||q===8780||q===8786||q===8800||q===8801||q>=8804&&q<=8807||q===8810||q===8811||q===8814||q===8815||q===8834||q===8835||q===8838||q===8839||q===8853||q===8857||q===8869||q===8895||q===8978||q>=9312&&q<=9449||q>=9451&&q<=9547||q>=9552&&q<=9587||q>=9600&&q<=9615||q>=9618&&q<=9621||q===9632||q===9633||q>=9635&&q<=9641||q===9650||q===9651||q===9654||q===9655||q===9660||q===9661||q===9664||q===9665||q>=9670&&q<=9672||q===9675||q>=9678&&q<=9681||q>=9698&&q<=9701||q===9711||q===9733||q===9734||q===9737||q===9742||q===9743||q===9756||q===9758||q===9792||q===9794||q===9824||q===9825||q>=9827&&q<=9829||q>=9831&&q<=9834||q===9836||q===9837||q===9839||q===9886||q===9887||q===9919||q>=9926&&q<=9933||q>=9935&&q<=9939||q>=9941&&q<=9953||q===9955||q===9960||q===9961||q>=9963&&q<=9969||q===9972||q>=9974&&q<=9977||q===9979||q===9980||q===9982||q===9983||q===10045||q>=10102&&q<=10111||q>=11094&&q<=11097||q>=12872&&q<=12879||q>=57344&&q<=63743||q>=65024&&q<=65039||q===65533||q>=127232&&q<=127242||q>=127248&&q<=127277||q>=127280&&q<=127337||q>=127344&&q<=127373||q===127375||q===127376||q>=127387&&q<=127404||q>=917760&&q<=917999||q>=983040&&q<=1048573||q>=1048576&&q<=1114109,_G=(q)=>q===12288||q>=65281&&q<=65376||q>=65504&&q<=65510,WG=(q)=>q>=4352&&q<=4447||q===8986||q===8987||q===9001||q===9002||q>=9193&&q<=9196||q===9200||q===9203||q===9725||q===9726||q===9748||q===9749||q>=9800&&q<=9811||q===9855||q===9875||q===9889||q===9898||q===9899||q===9917||q===9918||q===9924||q===9925||q===9934||q===9940||q===9962||q===9970||q===9971||q===9973||q===9978||q===9981||q===9989||q===9994||q===9995||q===10024||q===10060||q===10062||q>=10067&&q<=10069||q===10071||q>=10133&&q<=10135||q===10160||q===10175||q===11035||q===11036||q===11088||q===11093||q>=11904&&q<=11929||q>=11931&&q<=12019||q>=12032&&q<=12245||q>=12272&&q<=12287||q>=12289&&q<=12350||q>=12353&&q<=12438||q>=12441&&q<=12543||q>=12549&&q<=12591||q>=12593&&q<=12686||q>=12688&&q<=12771||q>=12783&&q<=12830||q>=12832&&q<=12871||q>=12880&&q<=19903||q>=19968&&q<=42124||q>=42128&&q<=42182||q>=43360&&q<=43388||q>=44032&&q<=55203||q>=63744&&q<=64255||q>=65040&&q<=65049||q>=65072&&q<=65106||q>=65108&&q<=65126||q>=65128&&q<=65131||q>=94176&&q<=94180||q===94192||q===94193||q>=94208&&q<=100343||q>=100352&&q<=101589||q>=101632&&q<=101640||q>=110576&&q<=110579||q>=110581&&q<=110587||q===110589||q===110590||q>=110592&&q<=110882||q===110898||q>=110928&&q<=110930||q===110933||q>=110948&&q<=110951||q>=110960&&q<=111355||q===126980||q===127183||q===127374||q>=127377&&q<=127386||q>=127488&&q<=127490||q>=127504&&q<=127547||q>=127552&&q<=127560||q===127568||q===127569||q>=127584&&q<=127589||q>=127744&&q<=127776||q>=127789&&q<=127797||q>=127799&&q<=127868||q>=127870&&q<=127891||q>=127904&&q<=127946||q>=127951&&q<=127955||q>=127968&&q<=127984||q===127988||q>=127992&&q<=128062||q===128064||q>=128066&&q<=128252||q>=128255&&q<=128317||q>=128331&&q<=128334||q>=128336&&q<=128359||q===128378||q===128405||q===128406||q===128420||q>=128507&&q<=128591||q>=128640&&q<=128709||q===128716||q>=128720&&q<=128722||q>=128725&&q<=128727||q>=128732&&q<=128735||q===128747||q===128748||q>=128756&&q<=128764||q>=128992&&q<=129003||q===129008||q>=129292&&q<=129338||q>=129340&&q<=129349||q>=129351&&q<=129535||q>=129648&&q<=129660||q>=129664&&q<=129672||q>=129680&&q<=129725||q>=129727&&q<=129733||q>=129742&&q<=129755||q>=129760&&q<=129768||q>=129776&&q<=129784||q>=131072&&q<=196605||q>=196608&&q<=262141,O4=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,Nq=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Aq=/\t{1,1000}/y,N4=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,Sq=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,RG=/\p{M}+/gu,VG={limit:1/0,ellipsis:""},c5=(q,Z={},X={})=>{let J=Z.limit??1/0,$=Z.ellipsis??"",Q=Z?.ellipsisWidth??($?c5($,VG,X).width:0),z=X.ansiWidth??0,H=X.controlWidth??0,U=X.tabWidth??8,G=X.ambiguousWidth??1,Y=X.emojiWidth??2,B=X.fullWidthWidth??2,_=X.regularWidth??1,V=X.wideWidth??2,R=0,T=0,W=q.length,I=0,M=!1,P=W,O=Math.max(0,J-Q),N=0,A=0,K=0,L=0;q:for(;;){if(A>N||T>=W&&T>R){let w=q.slice(N,A)||q.slice(R,T);I=0;for(let y of w.replaceAll(RG,"")){let x=y.codePointAt(0)||0;if(_G(x)?L=B:WG(x)?L=V:G!==_&&TG(x)?L=G:L=_,K+L>O&&(P=Math.min(P,Math.max(N,R)+I)),K+L>J){M=!0;break q}I+=y.length,K+=L}N=A=0}if(T>=W)break;if(Sq.lastIndex=T,Sq.test(q)){if(I=Sq.lastIndex-T,L=I*_,K+L>O&&(P=Math.min(P,T+Math.floor((O-K)/_))),K+L>J){M=!0;break}K+=L,N=R,A=T,T=R=Sq.lastIndex;continue}if(O4.lastIndex=T,O4.test(q)){if(K+z>O&&(P=Math.min(P,T)),K+z>J){M=!0;break}K+=z,N=R,A=T,T=R=O4.lastIndex;continue}if(Nq.lastIndex=T,Nq.test(q)){if(I=Nq.lastIndex-T,L=I*H,K+L>O&&(P=Math.min(P,T+Math.floor((O-K)/H))),K+L>J){M=!0;break}K+=L,N=R,A=T,T=R=Nq.lastIndex;continue}if(Aq.lastIndex=T,Aq.test(q)){if(I=Aq.lastIndex-T,L=I*U,K+L>O&&(P=Math.min(P,T+Math.floor((O-K)/U))),K+L>J){M=!0;break}K+=L,N=R,A=T,T=R=Aq.lastIndex;continue}if(N4.lastIndex=T,N4.test(q)){if(K+Y>O&&(P=Math.min(P,T)),K+Y>J){M=!0;break}K+=Y,N=R,A=T,T=R=N4.lastIndex;continue}T+=1}return{width:M?O:K,index:M?P:W,truncated:M,ellipsed:M&&J>=Q}},LG={limit:1/0,ellipsis:"",ellipsisWidth:0},L0=(q,Z={})=>c5(q,LG,Z).width,bq="\x1B",i5="›",IG=39,w4="\x07",a5="[",MG="]",s5="m",b4=`${MG}8;;`,g5=new RegExp(`(?:\\${a5}(?<code>\\d+)m|\\${b4}(?<uri>.*)${w4})`,"y"),KG=(q)=>{if(q>=30&&q<=37||q>=90&&q<=97)return 39;if(q>=40&&q<=47||q>=100&&q<=107)return 49;if(q===1||q===2)return 22;if(q===3)return 23;if(q===4)return 24;if(q===7)return 27;if(q===8)return 28;if(q===9)return 29;if(q===0)return 0},h5=(q)=>`${bq}${a5}${q}${s5}`,u5=(q)=>`${bq}${b4}${q}${w4}`,PG=(q)=>q.map((Z)=>L0(Z)),A4=(q,Z,X)=>{let J=Z[Symbol.iterator](),$=!1,Q=!1,z=q.at(-1),H=z===void 0?0:L0(z),U=J.next(),G=J.next(),Y=0;for(;!U.done;){let B=U.value,_=L0(B);H+_<=X?q[q.length-1]+=B:(q.push(B),H=0),(B===bq||B===i5)&&($=!0,Q=Z.startsWith(b4,Y+1)),$?Q?B===w4&&($=!1,Q=!1):B===s5&&($=!1):(H+=_,H===X&&!G.done&&(q.push(""),H=0)),U=G,G=J.next(),Y+=B.length}z=q.at(-1),!H&&z!==void 0&&z.length>0&&q.length>1&&(q[q.length-2]+=q.pop())},DG=(q)=>{let Z=q.split(" "),X=Z.length;for(;X>0&&!(L0(Z[X-1])>0);)X--;return X===Z.length?q:Z.slice(0,X).join(" ")+Z.slice(X).join("")},FG=(q,Z,X={})=>{if(X.trim!==!1&&q.trim()==="")return"";let J="",$,Q,z=q.split(" "),H=PG(z),U=[""];for(let[R,T]of z.entries()){X.trim!==!1&&(U[U.length-1]=(U.at(-1)??"").trimStart());let W=L0(U.at(-1)??"");if(R!==0&&(W>=Z&&(X.wordWrap===!1||X.trim===!1)&&(U.push(""),W=0),(W>0||X.trim===!1)&&(U[U.length-1]+=" ",W++)),X.hard&&H[R]>Z){let I=Z-W,M=1+Math.floor((H[R]-I-1)/Z);Math.floor((H[R]-1)/Z)<M&&U.push(""),A4(U,T,Z);continue}if(W+H[R]>Z&&W>0&&H[R]>0){if(X.wordWrap===!1&&W<Z){A4(U,T,Z);continue}U.push("")}if(W+H[R]>Z&&X.wordWrap===!1){A4(U,T,Z);continue}U[U.length-1]+=T}X.trim!==!1&&(U=U.map((R)=>DG(R)));let G=U.join(`
188
- `),Y=G[Symbol.iterator](),B=Y.next(),_=Y.next(),V=0;for(;!B.done;){let R=B.value,T=_.value;if(J+=R,R===bq||R===i5){g5.lastIndex=V+1;let I=g5.exec(G)?.groups;if(I?.code!==void 0){let M=Number.parseFloat(I.code);$=M===IG?void 0:M}else I?.uri!==void 0&&(Q=I.uri.length===0?void 0:I.uri)}let W=$?KG($):void 0;T===`
189
- `?(Q&&(J+=u5("")),$&&W&&(J+=h5(W))):R===`
190
- `&&($&&W&&(J+=h5($)),Q&&(J+=u5(Q))),V+=R.length,B=_,_=Y.next()}return J};function OG(q,Z,X){return String(q).normalize().replaceAll(`\r
187
+ `)),this._prevFrame=q;return}}this.output.write(m.erase.down())}this.output.write(q),this.state==="initial"&&(this.state="active"),this._prevFrame=q}}}function oU(q,Z){if(q===void 0||Z.length===0)return 0;let X=Z.findIndex((J)=>J.value===q);return X!==-1?X:0}function tU(q,Z){return(Z.label??String(Z.value)).toLowerCase().includes(q.toLowerCase())}function eU(q,Z){if(Z)return q?Z:Z[0]}class C5 extends W0{filteredOptions;multiple;isNavigating=!1;selectedValues=[];focusedValue;#q=0;#X="";#J;#Z;get cursor(){return this.#q}get userInputWithCursor(){if(!this.userInput)return Oq.default.inverse(Oq.default.hidden("_"));if(this._cursor>=this.userInput.length)return`${this.userInput}█`;let q=this.userInput.slice(0,this._cursor),[Z,...X]=this.userInput.slice(this._cursor);return`${q}${Oq.default.inverse(Z)}${X.join("")}`}get options(){return typeof this.#Z=="function"?this.#Z():this.#Z}constructor(q){super(q),this.#Z=q.options;let Z=this.options;this.filteredOptions=[...Z],this.multiple=q.multiple===!0,this.#J=q.filter??tU;let X;if(q.initialValue&&Array.isArray(q.initialValue)?this.multiple?X=q.initialValue:X=q.initialValue.slice(0,1):!this.multiple&&this.options.length>0&&(X=[this.options[0].value]),X)for(let J of X){let $=Z.findIndex((Q)=>Q.value===J);$!==-1&&(this.toggleSelected(J),this.#q=$)}this.focusedValue=this.options[this.#q]?.value,this.on("key",(J,$)=>this.#$(J,$)),this.on("userInput",(J)=>this.#Q(J))}_isActionKey(q,Z){return q==="\t"||this.multiple&&this.isNavigating&&Z.name==="space"&&q!==void 0&&q!==""}#$(q,Z){let X=Z.name==="up",J=Z.name==="down",$=Z.name==="return";X||J?(this.#q=Math.max(0,Math.min(this.#q+(X?-1:1),this.filteredOptions.length-1)),this.focusedValue=this.filteredOptions[this.#q]?.value,this.multiple||(this.selectedValues=[this.focusedValue]),this.isNavigating=!0):$?this.value=eU(this.multiple,this.selectedValues):this.multiple?this.focusedValue!==void 0&&(Z.name==="tab"||this.isNavigating&&Z.name==="space")?this.toggleSelected(this.focusedValue):this.isNavigating=!1:(this.focusedValue&&(this.selectedValues=[this.focusedValue]),this.isNavigating=!1)}deselectAll(){this.selectedValues=[]}toggleSelected(q){this.filteredOptions.length!==0&&(this.multiple?this.selectedValues.includes(q)?this.selectedValues=this.selectedValues.filter((Z)=>Z!==q):this.selectedValues=[...this.selectedValues,q]:this.selectedValues=[q])}#Q(q){if(q!==this.#X){this.#X=q;let Z=this.options;q?this.filteredOptions=Z.filter((X)=>this.#J(q,X)):this.filteredOptions=[...Z],this.#q=oU(this.focusedValue,this.filteredOptions),this.focusedValue=this.filteredOptions[this.#q]?.value,this.multiple||(this.focusedValue!==void 0?this.toggleSelected(this.focusedValue):this.deselectAll())}}}class f5 extends W0{options;cursor=0;#q;getGroupItems(q){return this.options.filter((Z)=>Z.group===q)}isGroupSelected(q){let Z=this.getGroupItems(q),X=this.value;return X===void 0?!1:Z.every((J)=>X.includes(J.value))}toggleValue(){let q=this.options[this.cursor];if(this.value===void 0&&(this.value=[]),q.group===!0){let Z=q.value,X=this.getGroupItems(Z);this.isGroupSelected(Z)?this.value=this.value.filter((J)=>X.findIndex(($)=>$.value===J)===-1):this.value=[...this.value,...X.map((J)=>J.value)],this.value=Array.from(new Set(this.value))}else{let Z=this.value.includes(q.value);this.value=Z?this.value.filter((X)=>X!==q.value):[...this.value,q.value]}}constructor(q){super(q,!1);let{options:Z}=q;this.#q=q.selectableGroups!==!1,this.options=Object.entries(Z).flatMap(([X,J])=>[{value:X,group:!0,label:X},...J.map(($)=>({...$,group:X}))]),this.value=[...q.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:X})=>X===q.cursorAt),this.#q?0:1),this.on("cursor",(X)=>{switch(X){case"left":case"up":{this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;let J=this.options[this.cursor]?.group===!0;!this.#q&&J&&(this.cursor=this.cursor===0?this.options.length-1:this.cursor-1);break}case"down":case"right":{this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;let J=this.options[this.cursor]?.group===!0;!this.#q&&J&&(this.cursor=this.cursor===this.options.length-1?0:this.cursor+1);break}case"space":this.toggleValue();break}})}}function O1(q,Z,X){let J=q+Z,$=Math.max(X.length-1,0),Q=J<0?$:J>$?0:J;return X[Q].disabled?O1(Q,Z<0?-1:1,X):Q}class D4 extends W0{options;cursor=0;get _value(){return this.options[this.cursor].value}get _enabledOptions(){return this.options.filter((q)=>q.disabled!==!0)}toggleAll(){let q=this._enabledOptions,Z=this.value!==void 0&&this.value.length===q.length;this.value=Z?[]:q.map((X)=>X.value)}toggleInvert(){let q=this.value;if(!q)return;let Z=this._enabledOptions.filter((X)=>!q.includes(X.value));this.value=Z.map((X)=>X.value)}toggleValue(){this.value===void 0&&(this.value=[]);let q=this.value.includes(this._value);this.value=q?this.value.filter((Z)=>Z!==this._value):[...this.value,this._value]}constructor(q){super(q,!1),this.options=q.options,this.value=[...q.initialValues??[]];let Z=Math.max(this.options.findIndex(({value:X})=>X===q.cursorAt),0);this.cursor=this.options[Z].disabled?O1(Z,1,this.options):Z,this.on("key",(X)=>{X==="a"&&this.toggleAll(),X==="i"&&this.toggleInvert()}),this.on("cursor",(X)=>{switch(X){case"left":case"up":this.cursor=O1(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=O1(this.cursor,1,this.options);break;case"space":this.toggleValue();break}})}}class P4 extends W0{options;cursor=0;get _selectedValue(){return this.options[this.cursor]}changeValue(){this.value=this._selectedValue.value}constructor(q){super(q,!1),this.options=q.options;let Z=this.options.findIndex(({value:J})=>J===q.initialValue),X=Z===-1?0:Z;this.cursor=this.options[X].disabled?O1(X,1,this.options):X,this.changeValue(),this.on("cursor",(J)=>{switch(J){case"left":case"up":this.cursor=O1(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=O1(this.cursor,1,this.options);break}this.changeValue()})}}var F=u1(G4(),1);import p from"node:process";var u5=u1(B4(),1);function qG(){return p.platform!=="win32"?p.env.TERM!=="linux":!!p.env.CI||!!p.env.WT_SESSION||!!p.env.TERMINUS_SUBLIME||p.env.ConEmuTask==="{cmd::Cmder}"||p.env.TERM_PROGRAM==="Terminus-Sublime"||p.env.TERM_PROGRAM==="vscode"||p.env.TERM==="xterm-256color"||p.env.TERM==="alacritty"||p.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var ZG=qG();var j=(q,Z)=>ZG?q:Z,XG=j("◆","*"),JG=j("■","x"),$G=j("▲","x"),m5=j("◇","o"),QG=j("┌","T"),f=j("│","|"),V0=j("└","—"),VT=j("┐","T"),IT=j("┘","—"),zG=j("●",">"),x5=j("○"," "),HG=j("◻","[•]"),y5=j("◼","[+]"),k5=j("◻","[ ]"),MT=j("▪","•"),KT=j("─","-"),DT=j("╮","+"),PT=j("├","+"),FT=j("╯","+"),OT=j("╰","+"),NT=j("╭","+"),UG=j("●","•"),GG=j("◆","*"),YG=j("▲","!"),BG=j("■","x"),d5=(q)=>{switch(q){case"initial":case"active":return F.default.cyan(XG);case"cancel":return F.default.red(JG);case"error":return F.default.yellow($G);case"submit":return F.default.green(m5)}},l5=(q)=>{switch(q){case"initial":case"active":return F.default.cyan(f);case"cancel":return F.default.red(f);case"error":return F.default.yellow(f);case"submit":return F.default.green(f)}},TG=(q)=>q===161||q===164||q===167||q===168||q===170||q===173||q===174||q>=176&&q<=180||q>=182&&q<=186||q>=188&&q<=191||q===198||q===208||q===215||q===216||q>=222&&q<=225||q===230||q>=232&&q<=234||q===236||q===237||q===240||q===242||q===243||q>=247&&q<=250||q===252||q===254||q===257||q===273||q===275||q===283||q===294||q===295||q===299||q>=305&&q<=307||q===312||q>=319&&q<=322||q===324||q>=328&&q<=331||q===333||q===338||q===339||q===358||q===359||q===363||q===462||q===464||q===466||q===468||q===470||q===472||q===474||q===476||q===593||q===609||q===708||q===711||q>=713&&q<=715||q===717||q===720||q>=728&&q<=731||q===733||q===735||q>=768&&q<=879||q>=913&&q<=929||q>=931&&q<=937||q>=945&&q<=961||q>=963&&q<=969||q===1025||q>=1040&&q<=1103||q===1105||q===8208||q>=8211&&q<=8214||q===8216||q===8217||q===8220||q===8221||q>=8224&&q<=8226||q>=8228&&q<=8231||q===8240||q===8242||q===8243||q===8245||q===8251||q===8254||q===8308||q===8319||q>=8321&&q<=8324||q===8364||q===8451||q===8453||q===8457||q===8467||q===8470||q===8481||q===8482||q===8486||q===8491||q===8531||q===8532||q>=8539&&q<=8542||q>=8544&&q<=8555||q>=8560&&q<=8569||q===8585||q>=8592&&q<=8601||q===8632||q===8633||q===8658||q===8660||q===8679||q===8704||q===8706||q===8707||q===8711||q===8712||q===8715||q===8719||q===8721||q===8725||q===8730||q>=8733&&q<=8736||q===8739||q===8741||q>=8743&&q<=8748||q===8750||q>=8756&&q<=8759||q===8764||q===8765||q===8776||q===8780||q===8786||q===8800||q===8801||q>=8804&&q<=8807||q===8810||q===8811||q===8814||q===8815||q===8834||q===8835||q===8838||q===8839||q===8853||q===8857||q===8869||q===8895||q===8978||q>=9312&&q<=9449||q>=9451&&q<=9547||q>=9552&&q<=9587||q>=9600&&q<=9615||q>=9618&&q<=9621||q===9632||q===9633||q>=9635&&q<=9641||q===9650||q===9651||q===9654||q===9655||q===9660||q===9661||q===9664||q===9665||q>=9670&&q<=9672||q===9675||q>=9678&&q<=9681||q>=9698&&q<=9701||q===9711||q===9733||q===9734||q===9737||q===9742||q===9743||q===9756||q===9758||q===9792||q===9794||q===9824||q===9825||q>=9827&&q<=9829||q>=9831&&q<=9834||q===9836||q===9837||q===9839||q===9886||q===9887||q===9919||q>=9926&&q<=9933||q>=9935&&q<=9939||q>=9941&&q<=9953||q===9955||q===9960||q===9961||q>=9963&&q<=9969||q===9972||q>=9974&&q<=9977||q===9979||q===9980||q===9982||q===9983||q===10045||q>=10102&&q<=10111||q>=11094&&q<=11097||q>=12872&&q<=12879||q>=57344&&q<=63743||q>=65024&&q<=65039||q===65533||q>=127232&&q<=127242||q>=127248&&q<=127277||q>=127280&&q<=127337||q>=127344&&q<=127373||q===127375||q===127376||q>=127387&&q<=127404||q>=917760&&q<=917999||q>=983040&&q<=1048573||q>=1048576&&q<=1114109,_G=(q)=>q===12288||q>=65281&&q<=65376||q>=65504&&q<=65510,LG=(q)=>q>=4352&&q<=4447||q===8986||q===8987||q===9001||q===9002||q>=9193&&q<=9196||q===9200||q===9203||q===9725||q===9726||q===9748||q===9749||q>=9800&&q<=9811||q===9855||q===9875||q===9889||q===9898||q===9899||q===9917||q===9918||q===9924||q===9925||q===9934||q===9940||q===9962||q===9970||q===9971||q===9973||q===9978||q===9981||q===9989||q===9994||q===9995||q===10024||q===10060||q===10062||q>=10067&&q<=10069||q===10071||q>=10133&&q<=10135||q===10160||q===10175||q===11035||q===11036||q===11088||q===11093||q>=11904&&q<=11929||q>=11931&&q<=12019||q>=12032&&q<=12245||q>=12272&&q<=12287||q>=12289&&q<=12350||q>=12353&&q<=12438||q>=12441&&q<=12543||q>=12549&&q<=12591||q>=12593&&q<=12686||q>=12688&&q<=12771||q>=12783&&q<=12830||q>=12832&&q<=12871||q>=12880&&q<=19903||q>=19968&&q<=42124||q>=42128&&q<=42182||q>=43360&&q<=43388||q>=44032&&q<=55203||q>=63744&&q<=64255||q>=65040&&q<=65049||q>=65072&&q<=65106||q>=65108&&q<=65126||q>=65128&&q<=65131||q>=94176&&q<=94180||q===94192||q===94193||q>=94208&&q<=100343||q>=100352&&q<=101589||q>=101632&&q<=101640||q>=110576&&q<=110579||q>=110581&&q<=110587||q===110589||q===110590||q>=110592&&q<=110882||q===110898||q>=110928&&q<=110930||q===110933||q>=110948&&q<=110951||q>=110960&&q<=111355||q===126980||q===127183||q===127374||q>=127377&&q<=127386||q>=127488&&q<=127490||q>=127504&&q<=127547||q>=127552&&q<=127560||q===127568||q===127569||q>=127584&&q<=127589||q>=127744&&q<=127776||q>=127789&&q<=127797||q>=127799&&q<=127868||q>=127870&&q<=127891||q>=127904&&q<=127946||q>=127951&&q<=127955||q>=127968&&q<=127984||q===127988||q>=127992&&q<=128062||q===128064||q>=128066&&q<=128252||q>=128255&&q<=128317||q>=128331&&q<=128334||q>=128336&&q<=128359||q===128378||q===128405||q===128406||q===128420||q>=128507&&q<=128591||q>=128640&&q<=128709||q===128716||q>=128720&&q<=128722||q>=128725&&q<=128727||q>=128732&&q<=128735||q===128747||q===128748||q>=128756&&q<=128764||q>=128992&&q<=129003||q===129008||q>=129292&&q<=129338||q>=129340&&q<=129349||q>=129351&&q<=129535||q>=129648&&q<=129660||q>=129664&&q<=129672||q>=129680&&q<=129725||q>=129727&&q<=129733||q>=129742&&q<=129755||q>=129760&&q<=129768||q>=129776&&q<=129784||q>=131072&&q<=196605||q>=196608&&q<=262141,F4=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,Aq=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Sq=/\t{1,1000}/y,O4=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,wq=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,WG=/\p{M}+/gu,RG={limit:1/0,ellipsis:""},p5=(q,Z={},X={})=>{let J=Z.limit??1/0,$=Z.ellipsis??"",Q=Z?.ellipsisWidth??($?p5($,RG,X).width:0),z=X.ansiWidth??0,H=X.controlWidth??0,U=X.tabWidth??8,G=X.ambiguousWidth??1,B=X.emojiWidth??2,Y=X.fullWidthWidth??2,_=X.regularWidth??1,R=X.wideWidth??2,W=0,T=0,L=q.length,I=0,M=!1,D=L,O=Math.max(0,J-Q),N=0,A=0,K=0,V=0;q:for(;;){if(A>N||T>=L&&T>W){let w=q.slice(N,A)||q.slice(W,T);I=0;for(let x of w.replaceAll(WG,"")){let y=x.codePointAt(0)||0;if(_G(y)?V=Y:LG(y)?V=R:G!==_&&TG(y)?V=G:V=_,K+V>O&&(D=Math.min(D,Math.max(N,W)+I)),K+V>J){M=!0;break q}I+=x.length,K+=V}N=A=0}if(T>=L)break;if(wq.lastIndex=T,wq.test(q)){if(I=wq.lastIndex-T,V=I*_,K+V>O&&(D=Math.min(D,T+Math.floor((O-K)/_))),K+V>J){M=!0;break}K+=V,N=W,A=T,T=W=wq.lastIndex;continue}if(F4.lastIndex=T,F4.test(q)){if(K+z>O&&(D=Math.min(D,T)),K+z>J){M=!0;break}K+=z,N=W,A=T,T=W=F4.lastIndex;continue}if(Aq.lastIndex=T,Aq.test(q)){if(I=Aq.lastIndex-T,V=I*H,K+V>O&&(D=Math.min(D,T+Math.floor((O-K)/H))),K+V>J){M=!0;break}K+=V,N=W,A=T,T=W=Aq.lastIndex;continue}if(Sq.lastIndex=T,Sq.test(q)){if(I=Sq.lastIndex-T,V=I*U,K+V>O&&(D=Math.min(D,T+Math.floor((O-K)/U))),K+V>J){M=!0;break}K+=V,N=W,A=T,T=W=Sq.lastIndex;continue}if(O4.lastIndex=T,O4.test(q)){if(K+B>O&&(D=Math.min(D,T)),K+B>J){M=!0;break}K+=B,N=W,A=T,T=W=O4.lastIndex;continue}T+=1}return{width:M?O:K,index:M?D:L,truncated:M,ellipsed:M&&J>=Q}},VG={limit:1/0,ellipsis:"",ellipsisWidth:0},I0=(q,Z={})=>p5(q,VG,Z).width,jq="\x1B",c5="›",IG=39,S4="\x07",i5="[",MG="]",a5="m",w4=`${MG}8;;`,v5=new RegExp(`(?:\\${i5}(?<code>\\d+)m|\\${w4}(?<uri>.*)${S4})`,"y"),KG=(q)=>{if(q>=30&&q<=37||q>=90&&q<=97)return 39;if(q>=40&&q<=47||q>=100&&q<=107)return 49;if(q===1||q===2)return 22;if(q===3)return 23;if(q===4)return 24;if(q===7)return 27;if(q===8)return 28;if(q===9)return 29;if(q===0)return 0},g5=(q)=>`${jq}${i5}${q}${a5}`,h5=(q)=>`${jq}${w4}${q}${S4}`,DG=(q)=>q.map((Z)=>I0(Z)),N4=(q,Z,X)=>{let J=Z[Symbol.iterator](),$=!1,Q=!1,z=q.at(-1),H=z===void 0?0:I0(z),U=J.next(),G=J.next(),B=0;for(;!U.done;){let Y=U.value,_=I0(Y);H+_<=X?q[q.length-1]+=Y:(q.push(Y),H=0),(Y===jq||Y===c5)&&($=!0,Q=Z.startsWith(w4,B+1)),$?Q?Y===S4&&($=!1,Q=!1):Y===a5&&($=!1):(H+=_,H===X&&!G.done&&(q.push(""),H=0)),U=G,G=J.next(),B+=Y.length}z=q.at(-1),!H&&z!==void 0&&z.length>0&&q.length>1&&(q[q.length-2]+=q.pop())},PG=(q)=>{let Z=q.split(" "),X=Z.length;for(;X>0&&!(I0(Z[X-1])>0);)X--;return X===Z.length?q:Z.slice(0,X).join(" ")+Z.slice(X).join("")},FG=(q,Z,X={})=>{if(X.trim!==!1&&q.trim()==="")return"";let J="",$,Q,z=q.split(" "),H=DG(z),U=[""];for(let[W,T]of z.entries()){X.trim!==!1&&(U[U.length-1]=(U.at(-1)??"").trimStart());let L=I0(U.at(-1)??"");if(W!==0&&(L>=Z&&(X.wordWrap===!1||X.trim===!1)&&(U.push(""),L=0),(L>0||X.trim===!1)&&(U[U.length-1]+=" ",L++)),X.hard&&H[W]>Z){let I=Z-L,M=1+Math.floor((H[W]-I-1)/Z);Math.floor((H[W]-1)/Z)<M&&U.push(""),N4(U,T,Z);continue}if(L+H[W]>Z&&L>0&&H[W]>0){if(X.wordWrap===!1&&L<Z){N4(U,T,Z);continue}U.push("")}if(L+H[W]>Z&&X.wordWrap===!1){N4(U,T,Z);continue}U[U.length-1]+=T}X.trim!==!1&&(U=U.map((W)=>PG(W)));let G=U.join(`
188
+ `),B=G[Symbol.iterator](),Y=B.next(),_=B.next(),R=0;for(;!Y.done;){let W=Y.value,T=_.value;if(J+=W,W===jq||W===c5){v5.lastIndex=R+1;let I=v5.exec(G)?.groups;if(I?.code!==void 0){let M=Number.parseFloat(I.code);$=M===IG?void 0:M}else I?.uri!==void 0&&(Q=I.uri.length===0?void 0:I.uri)}let L=$?KG($):void 0;T===`
189
+ `?(Q&&(J+=h5("")),$&&L&&(J+=g5(L))):W===`
190
+ `&&($&&L&&(J+=g5($)),Q&&(J+=h5(Q))),R+=W.length,Y=_,_=B.next()}return J};function OG(q,Z,X){return String(q).normalize().replaceAll(`\r
191
191
  `,`
192
192
  `).split(`
193
193
  `).map((J)=>FG(J,Z,X)).join(`
194
- `)}var NG=(q,Z,X,J,$)=>{let Q=Z,z=0;for(let H=X;H<J;H++){let U=q[H];if(Q=Q-U.length,z++,Q<=$)break}return{lineCount:Q,removals:z}},S4=(q)=>{let{cursor:Z,options:X,style:J}=q,$=q.output??process.stdout,Q=K4($),z=q.columnPadding??0,H=q.rowPadding??4,U=Q-z,G=P4($),Y=F.default.dim("..."),B=q.maxItems??Number.POSITIVE_INFINITY,_=Math.max(G-H,0),V=Math.max(Math.min(B,_),5),R=0;Z>=V-3&&(R=Math.max(Math.min(Z-V+3,X.length-V),0));let T=V<X.length&&R>0,W=V<X.length&&R+V<X.length,I=Math.min(R+V,X.length),M=[],P=0;T&&P++,W&&P++;let O=R+(T?1:0),N=I-(W?1:0);for(let K=O;K<N;K++){let L=OG(J(X[K],K===Z),U,{hard:!0,trim:!1}).split(`
195
- `);M.push(L),P+=L.length}if(P>_){let K=0,L=0,w=P,y=Z-O,x=(C,P0)=>NG(M,w,C,P0,_);T?({lineCount:w,removals:K}=x(0,y),w>_&&({lineCount:w,removals:L}=x(y+1,M.length))):({lineCount:w,removals:L}=x(y+1,M.length),w>_&&({lineCount:w,removals:K}=x(0,y))),K>0&&(T=!0,M.splice(0,K)),L>0&&(W=!0,M.splice(M.length-L,L))}let A=[];T&&A.push(Y);for(let K of M)for(let L of K)A.push(L);return W&&A.push(Y),A};var B1={message:(q=[],{symbol:Z=F.default.gray(f),secondarySymbol:X=F.default.gray(f),output:J=process.stdout,spacing:$=1,withGuide:Q}={})=>{let z=[],H=(Q??F1.withGuide)!==!1,U=H?X:"",G=H?`${Z} `:"",Y=H?`${X} `:"";for(let _=0;_<$;_++)z.push(U);let B=Array.isArray(q)?q:q.split(`
196
- `);if(B.length>0){let[_,...V]=B;_.length>0?z.push(`${G}${_}`):z.push(H?Z:"");for(let R of V)R.length>0?z.push(`${Y}${R}`):z.push(H?X:"")}J.write(`${z.join(`
194
+ `)}var NG=(q,Z,X,J,$)=>{let Q=Z,z=0;for(let H=X;H<J;H++){let U=q[H];if(Q=Q-U.length,z++,Q<=$)break}return{lineCount:Q,removals:z}},A4=(q)=>{let{cursor:Z,options:X,style:J}=q,$=q.output??process.stdout,Q=M4($),z=q.columnPadding??0,H=q.rowPadding??4,U=Q-z,G=K4($),B=F.default.dim("..."),Y=q.maxItems??Number.POSITIVE_INFINITY,_=Math.max(G-H,0),R=Math.max(Math.min(Y,_),5),W=0;Z>=R-3&&(W=Math.max(Math.min(Z-R+3,X.length-R),0));let T=R<X.length&&W>0,L=R<X.length&&W+R<X.length,I=Math.min(W+R,X.length),M=[],D=0;T&&D++,L&&D++;let O=W+(T?1:0),N=I-(L?1:0);for(let K=O;K<N;K++){let V=OG(J(X[K],K===Z),U,{hard:!0,trim:!1}).split(`
195
+ `);M.push(V),D+=V.length}if(D>_){let K=0,V=0,w=D,x=Z-O,y=(E,P0)=>NG(M,w,E,P0,_);T?({lineCount:w,removals:K}=y(0,x),w>_&&({lineCount:w,removals:V}=y(x+1,M.length))):({lineCount:w,removals:V}=y(x+1,M.length),w>_&&({lineCount:w,removals:K}=y(0,x))),K>0&&(T=!0,M.splice(0,K)),V>0&&(L=!0,M.splice(M.length-V,V))}let A=[];T&&A.push(B);for(let K of M)for(let V of K)A.push(V);return L&&A.push(B),A};var B1={message:(q=[],{symbol:Z=F.default.gray(f),secondarySymbol:X=F.default.gray(f),output:J=process.stdout,spacing:$=1,withGuide:Q}={})=>{let z=[],H=(Q??F1.withGuide)!==!1,U=H?X:"",G=H?`${Z} `:"",B=H?`${X} `:"";for(let _=0;_<$;_++)z.push(U);let Y=Array.isArray(q)?q:q.split(`
196
+ `);if(Y.length>0){let[_,...R]=Y;_.length>0?z.push(`${G}${_}`):z.push(H?Z:"");for(let W of R)W.length>0?z.push(`${B}${W}`):z.push(H?X:"")}J.write(`${z.join(`
197
197
  `)}
198
- `)},info:(q,Z)=>{B1.message(q,{...Z,symbol:F.default.blue(UG)})},success:(q,Z)=>{B1.message(q,{...Z,symbol:F.default.green(GG)})},step:(q,Z)=>{B1.message(q,{...Z,symbol:F.default.green(d5)})},warn:(q,Z)=>{B1.message(q,{...Z,symbol:F.default.yellow(YG)})},warning:(q,Z)=>{B1.warn(q,Z)},error:(q,Z)=>{B1.message(q,{...Z,symbol:F.default.red(BG)})}},jq=(q="",Z)=>{(Z?.output??process.stdout).write(`${F.default.gray(V0)} ${F.default.red(q)}
198
+ `)},info:(q,Z)=>{B1.message(q,{...Z,symbol:F.default.blue(UG)})},success:(q,Z)=>{B1.message(q,{...Z,symbol:F.default.green(GG)})},step:(q,Z)=>{B1.message(q,{...Z,symbol:F.default.green(m5)})},warn:(q,Z)=>{B1.message(q,{...Z,symbol:F.default.yellow(YG)})},warning:(q,Z)=>{B1.warn(q,Z)},error:(q,Z)=>{B1.message(q,{...Z,symbol:F.default.red(BG)})}},Eq=(q="",Z)=>{(Z?.output??process.stdout).write(`${F.default.gray(V0)} ${F.default.red(q)}
199
199
 
200
- `)},r5=(q="",Z)=>{(Z?.output??process.stdout).write(`${F.default.gray(QG)} ${q}
201
- `)},n5=(q="",Z)=>{(Z?.output??process.stdout).write(`${F.default.gray(f)}
200
+ `)},s5=(q="",Z)=>{(Z?.output??process.stdout).write(`${F.default.gray(QG)} ${q}
201
+ `)},r5=(q="",Z)=>{(Z?.output??process.stdout).write(`${F.default.gray(f)}
202
202
  ${F.default.gray(V0)} ${q}
203
203
 
204
204
  `)},R0=(q,Z)=>q.split(`
205
205
  `).map((X)=>Z(X)).join(`
206
- `),Cq=(q)=>{let Z=(J,$)=>{let Q=J.label??String(J.value);return $==="disabled"?`${F.default.gray(v5)} ${R0(Q,(z)=>F.default.strikethrough(F.default.gray(z)))}${J.hint?` ${F.default.dim(`(${J.hint??"disabled"})`)}`:""}`:$==="active"?`${F.default.cyan(HG)} ${Q}${J.hint?` ${F.default.dim(`(${J.hint})`)}`:""}`:$==="selected"?`${F.default.green(k5)} ${R0(Q,F.default.dim)}${J.hint?` ${F.default.dim(`(${J.hint})`)}`:""}`:$==="cancelled"?`${R0(Q,(z)=>F.default.strikethrough(F.default.dim(z)))}`:$==="active-selected"?`${F.default.green(k5)} ${Q}${J.hint?` ${F.default.dim(`(${J.hint})`)}`:""}`:$==="submitted"?`${R0(Q,F.default.dim)}`:`${F.default.dim(v5)} ${R0(Q,F.default.dim)}`},X=q.required??!0;return new D4({options:q.options,signal:q.signal,input:q.input,output:q.output,initialValues:q.initialValues,required:X,cursorAt:q.cursorAt,validate(J){if(X&&(J===void 0||J.length===0))return`Please select at least one option.
207
- ${F.default.reset(F.default.dim(`Press ${F.default.gray(F.default.bgWhite(F.default.inverse(" space ")))} to select, ${F.default.gray(F.default.bgWhite(F.default.inverse(" enter ")))} to submit`))}`},render(){let J=N1(q.output,q.message,`${p5(this.state)} `,`${l5(this.state)} `),$=`${F.default.gray(f)}
206
+ `),M0=(q)=>{let Z=(J,$)=>{let Q=J.label??String(J.value);return $==="disabled"?`${F.default.gray(k5)} ${R0(Q,(z)=>F.default.strikethrough(F.default.gray(z)))}${J.hint?` ${F.default.dim(`(${J.hint??"disabled"})`)}`:""}`:$==="active"?`${F.default.cyan(HG)} ${Q}${J.hint?` ${F.default.dim(`(${J.hint})`)}`:""}`:$==="selected"?`${F.default.green(y5)} ${R0(Q,F.default.dim)}${J.hint?` ${F.default.dim(`(${J.hint})`)}`:""}`:$==="cancelled"?`${R0(Q,(z)=>F.default.strikethrough(F.default.dim(z)))}`:$==="active-selected"?`${F.default.green(y5)} ${Q}${J.hint?` ${F.default.dim(`(${J.hint})`)}`:""}`:$==="submitted"?`${R0(Q,F.default.dim)}`:`${F.default.dim(k5)} ${R0(Q,F.default.dim)}`},X=q.required??!0;return new D4({options:q.options,signal:q.signal,input:q.input,output:q.output,initialValues:q.initialValues,required:X,cursorAt:q.cursorAt,validate(J){if(X&&(J===void 0||J.length===0))return`Please select at least one option.
207
+ ${F.default.reset(F.default.dim(`Press ${F.default.gray(F.default.bgWhite(F.default.inverse(" space ")))} to select, ${F.default.gray(F.default.bgWhite(F.default.inverse(" enter ")))} to submit`))}`},render(){let J=N1(q.output,q.message,`${l5(this.state)} `,`${d5(this.state)} `),$=`${F.default.gray(f)}
208
208
  ${J}
209
209
  `,Q=this.value??[],z=(H,U)=>{if(H.disabled)return Z(H,"disabled");let G=Q.includes(H.value);return U&&G?Z(H,"active-selected"):G?Z(H,"selected"):Z(H,U?"active":"inactive")};switch(this.state){case"submit":{let H=this.options.filter(({value:G})=>Q.includes(G)).map((G)=>Z(G,"submitted")).join(F.default.dim(", "))||F.default.dim("none"),U=N1(q.output,H,`${F.default.gray(f)} `);return`${$}${U}`}case"cancel":{let H=this.options.filter(({value:G})=>Q.includes(G)).map((G)=>Z(G,"cancelled")).join(F.default.dim(", "));if(H.trim()==="")return`${$}${F.default.gray(f)}`;let U=N1(q.output,H,`${F.default.gray(f)} `);return`${$}${U}
210
210
  ${F.default.gray(f)}`}case"error":{let H=`${F.default.yellow(f)} `,U=this.error.split(`
211
- `).map((B,_)=>_===0?`${F.default.yellow(V0)} ${F.default.yellow(B)}`:` ${B}`).join(`
211
+ `).map((Y,_)=>_===0?`${F.default.yellow(V0)} ${F.default.yellow(Y)}`:` ${Y}`).join(`
212
212
  `),G=$.split(`
213
- `).length,Y=U.split(`
214
- `).length+1;return`${$}${H}${S4({output:q.output,options:this.options,cursor:this.cursor,maxItems:q.maxItems,columnPadding:H.length,rowPadding:G+Y,style:z}).join(`
213
+ `).length,B=U.split(`
214
+ `).length+1;return`${$}${H}${A4({output:q.output,options:this.options,cursor:this.cursor,maxItems:q.maxItems,columnPadding:H.length,rowPadding:G+B,style:z}).join(`
215
215
  ${H}`)}
216
216
  ${U}
217
217
  `}default:{let H=`${F.default.cyan(f)} `,U=$.split(`
218
- `).length;return`${$}${H}${S4({output:q.output,options:this.options,cursor:this.cursor,maxItems:q.maxItems,columnPadding:H.length,rowPadding:U+2,style:z}).join(`
218
+ `).length;return`${$}${H}${A4({output:q.output,options:this.options,cursor:this.cursor,maxItems:q.maxItems,columnPadding:H.length,rowPadding:U+2,style:z}).join(`
219
219
  ${H}`)}
220
220
  ${F.default.cyan(V0)}
221
- `}}}}).prompt()};var ST=F.default.magenta;var wT={light:j("─","-"),heavy:j("━","="),block:j("█","#")};var wq=(q,Z)=>q.includes(`
221
+ `}}}}).prompt()};var AT=F.default.magenta;var ST={light:j("─","-"),heavy:j("━","="),block:j("█","#")};var bq=(q,Z)=>q.includes(`
222
222
  `)?q.split(`
223
223
  `).map((X)=>Z(X)).join(`
224
- `):Z(q),j4=(q)=>{let Z=(X,J)=>{let $=X.label??String(X.value);switch(J){case"disabled":return`${F.default.gray(x5)} ${wq($,F.default.gray)}${X.hint?` ${F.default.dim(`(${X.hint??"disabled"})`)}`:""}`;case"selected":return`${wq($,F.default.dim)}`;case"active":return`${F.default.green(zG)} ${$}${X.hint?` ${F.default.dim(`(${X.hint})`)}`:""}`;case"cancelled":return`${wq($,(Q)=>F.default.strikethrough(F.default.dim(Q)))}`;default:return`${F.default.dim(x5)} ${wq($,F.default.dim)}`}};return new F4({options:q.options,signal:q.signal,input:q.input,output:q.output,initialValue:q.initialValue,render(){let X=`${l5(this.state)} `,J=`${p5(this.state)} `,$=N1(q.output,q.message,J,X),Q=`${F.default.gray(f)}
224
+ `):Z(q),b4=(q)=>{let Z=(X,J)=>{let $=X.label??String(X.value);switch(J){case"disabled":return`${F.default.gray(x5)} ${bq($,F.default.gray)}${X.hint?` ${F.default.dim(`(${X.hint??"disabled"})`)}`:""}`;case"selected":return`${bq($,F.default.dim)}`;case"active":return`${F.default.green(zG)} ${$}${X.hint?` ${F.default.dim(`(${X.hint})`)}`:""}`;case"cancelled":return`${bq($,(Q)=>F.default.strikethrough(F.default.dim(Q)))}`;default:return`${F.default.dim(x5)} ${bq($,F.default.dim)}`}};return new P4({options:q.options,signal:q.signal,input:q.input,output:q.output,initialValue:q.initialValue,render(){let X=`${d5(this.state)} `,J=`${l5(this.state)} `,$=N1(q.output,q.message,J,X),Q=`${F.default.gray(f)}
225
225
  ${$}
226
226
  `;switch(this.state){case"submit":{let z=`${F.default.gray(f)} `,H=N1(q.output,Z(this.options[this.cursor],"selected"),z);return`${Q}${H}`}case"cancel":{let z=`${F.default.gray(f)} `,H=N1(q.output,Z(this.options[this.cursor],"cancelled"),z);return`${Q}${H}
227
227
  ${F.default.gray(f)}`}default:{let z=`${F.default.cyan(f)} `,H=Q.split(`
228
- `).length;return`${Q}${z}${S4({output:q.output,cursor:this.cursor,options:this.options,maxItems:q.maxItems,columnPadding:z.length,rowPadding:H+2,style:(U,G)=>Z(U,U.disabled?"disabled":G?"active":"inactive")}).join(`
228
+ `).length;return`${Q}${z}${A4({output:q.output,cursor:this.cursor,options:this.options,maxItems:q.maxItems,columnPadding:z.length,rowPadding:H+2,style:(U,G)=>Z(U,U.disabled?"disabled":G?"active":"inactive")}).join(`
229
229
  ${z}`)}
230
230
  ${F.default.cyan(V0)}
231
- `}}}}).prompt()};var bT=`${F.default.gray(f)} `;var AG=[{name:"pi",displayName:"Pi",projectSkills:".pi/skills",projectAgents:".pi/agents",globalSkills:"~/.pi/agent/skills",globalAgents:"~/.pi/agent/agents",isUniversal:!1},{name:"claude-code",displayName:"Claude Code",projectSkills:".claude/skills",projectAgents:".claude/agents",globalSkills:"~/.claude/skills",globalAgents:"~/.claude/agents",isUniversal:!1},{name:"cursor",displayName:"Cursor",projectSkills:".cursor/skills",projectAgents:".cursor/agents",globalSkills:"~/.cursor/skills",globalAgents:"~/.cursor/agents",isUniversal:!1},{name:"roo",displayName:"Roo",projectSkills:".roo/skills",projectAgents:".roo/agents",globalSkills:"~/.roo/skills",globalAgents:"~/.roo/agents",isUniversal:!1},{name:"cline",displayName:"Cline",projectSkills:".cline/skills",projectAgents:".cline/agents",globalSkills:"~/.cline/skills",globalAgents:"~/.cline/agents",isUniversal:!1},{name:"windsurf",displayName:"Windsurf",projectSkills:".windsurf/skills",projectAgents:".windsurf/agents",globalSkills:"~/.windsurf/skills",globalAgents:"~/.windsurf/agents",isUniversal:!1},{name:"opencode",displayName:"OpenCode",projectSkills:".agents/skills",projectAgents:".agents/agents",globalSkills:"~/.config/opencode/skills",globalAgents:"~/.config/opencode/agents",isUniversal:!0},{name:"codex",displayName:"Codex",projectSkills:".agents/skills",projectAgents:".agents/agents",globalSkills:"~/.config/codex/skills",globalAgents:"~/.config/codex/agents",isUniversal:!0},{name:"amp",displayName:"Amp",projectSkills:".agents/skills",projectAgents:".agents/agents",globalSkills:"~/.config/amp/skills",globalAgents:"~/.config/amp/agents",isUniversal:!0},{name:"gemini-cli",displayName:"Gemini CLI",projectSkills:".agents/skills",projectAgents:".agents/agents",globalSkills:"~/.config/gemini-cli/skills",globalAgents:"~/.config/gemini-cli/agents",isUniversal:!0},{name:"github-copilot",displayName:"GitHub Copilot",projectSkills:".agents/skills",projectAgents:".agents/agents",globalSkills:"~/.config/github-copilot/skills",globalAgents:"~/.config/github-copilot/agents",isUniversal:!0},{name:"kimi-cli",displayName:"Kimi CLI",projectSkills:".agents/skills",projectAgents:".agents/agents",globalSkills:"~/.config/kimi-cli/skills",globalAgents:"~/.config/kimi-cli/agents",isUniversal:!0}],g1=[...AG];function t5(q){return g1.find((Z)=>Z.name===q)}function e5(){return g1.filter((q)=>q.isUniversal)}function q6(){return g1.filter((q)=>!q.isUniversal)}function Z6(q){return q.filter((Z)=>!t5(Z))}function X6(q){let Z=new Map;for(let X of q){let J=t5(X);if(!J)continue;let $=`${J.projectSkills}|${J.projectAgents}|${J.globalSkills}|${J.globalAgents}`,Q=Z.get($);if(Q)Q.displayNames.push(J.displayName);else Z.set($,{projectSkills:J.projectSkills,projectAgents:J.projectAgents,globalSkills:J.globalSkills,globalAgents:J.globalAgents,displayNames:[J.displayName]})}return Array.from(Z.values())}function Eq(q){let Z=new Set(Object.keys(q));g1=g1.filter((X)=>!Z.has(X.name));for(let[X,J]of Object.entries(q))g1.push({name:X,displayName:X,projectSkills:J.project_skills,projectAgents:J.project_agents,globalSkills:J.global_skills,globalAgents:J.global_agents,isUniversal:!1})}function J6(){return process.stdin.isTTY===!0}async function I0(q={}){let{defaults:Z}=q;r5("⚙️ agentdeps setup");let X=await j4({message:"How do you clone git repositories?",options:[{value:"ssh",label:"SSH (git@github.com:...)"},{value:"https",label:"HTTPS (https://github.com/...)"}],initialValue:Z?.clone_method??"ssh"});if(Y1(X)){jq("Setup cancelled.");return}let J=e5(),$=q6(),Q=[];for(let U of $)Q.push({value:U.name,label:`${U.displayName}`,hint:`${U.projectSkills}, ${U.projectAgents}`});for(let U of J)Q.push({value:U.name,label:`${U.displayName}`,hint:".agents/skills, .agents/agents (Universal)"});let z=await Cq({message:"Which coding agents do you use? (space to select, enter to confirm)",options:Q,initialValues:Z?.agents??[],required:!0});if(Y1(z)){jq("Setup cancelled.");return}if(z.length===0)return B1.error("At least one agent must be selected."),I0(q);let H=await j4({message:"How should dependencies be installed?",options:[{value:"link",label:"Link (symlinks)",hint:"Fast, no duplication — default"},{value:"copy",label:"Copy (smart sync)",hint:"Portable, self-contained"}],initialValue:Z?.install_method??"link"});if(Y1(H)){jq("Setup cancelled.");return}return n5("✅ Configuration saved!"),{clone_method:X,agents:z,install_method:H,custom_agents:Z?.custom_agents}}import{join as M0}from"node:path";import{mkdir as SG,readFile as wG,writeFile as bG,access as jG}from"node:fs/promises";import{dirname as CG}from"node:path";function EG(q,Z){if(!q.repo)throw Error(`Dependency at index ${Z} is missing required 'repo' field`);let X;if(q.skills===void 0||q.skills==="*"||q.skills===!0)X="*";else if(q.skills===!1)X=!1;else if(Array.isArray(q.skills))X=q.skills;else rq("config.normalize",`Dependency "${q.repo}" has unexpected skills value (${JSON.stringify(q.skills)}), defaulting to "*"`),X="*";let J;if(q.agents===void 0||q.agents==="*"||q.agents===!0)J="*";else if(q.agents===!1)J=!1;else if(Array.isArray(q.agents))J=q.agents;else rq("config.normalize",`Dependency "${q.repo}" has unexpected agents value (${JSON.stringify(q.agents)}), defaulting to "*"`),J="*";return{repo:q.repo,ref:q.ref??"main",skills:X,agents:J}}async function c(q){try{return await jG(q),!0}catch{return!1}}async function i(q){let Z=await wG(q,"utf-8"),X=B0(Z);if(!X||!X.dependencies){if(X&&!X.dependencies)console.warn("⚠ agents.yaml has no 'dependencies' field");return{dependencies:[]}}let J=X.dependencies;if(!Array.isArray(J))throw Error("'dependencies' must be an array in agents.yaml");if(J.length===0)return console.warn("⚠ agents.yaml has an empty dependencies list"),{dependencies:[]};return{dependencies:J.map((Q,z)=>EG(Q,z))}}async function fq(q,Z){let X=CG(q);await SG(X,{recursive:!0});let J={dependencies:Z.dependencies.map((Q)=>{let z={repo:Q.repo};if(Q.ref!=="main")z.ref=Q.ref;if(Q.skills!=="*")z.skills=Q.skills;if(Q.agents!=="*")z.agents=Q.agents;return z})},$=T0(J,{lineWidth:0});await bG(q,$,"utf-8")}function fG(q){if(q.includes("://"))return!1;if(q.startsWith("git@"))return!1;return q.split("/").length-1===1}function yG(q,Z){if(Z==="ssh")return`git@github.com:${q}.git`;return`https://github.com/${q}.git`}function yq(q,Z){if(fG(q))return yG(q,Z);return q}function xq(q,Z){let X;if(q.startsWith("git@")){let $=q.indexOf(":");X=q.slice($+1)}else if(q.includes("://"))try{X=new URL(q).pathname.slice(1)}catch{X=q}else X=q;if(X.endsWith(".git"))X=X.slice(0,-4);return`${X.replace(/\//g,"-")}-${Z}`}import{readdir as $6,access as xG}from"node:fs/promises";import{join as C4}from"node:path";async function kq(q){let Z=C4(q,"skills");try{let J=(await $6(Z,{withFileTypes:!0})).filter((Q)=>Q.isDirectory());return(await Promise.all(J.map(async(Q)=>{let z;try{await xG(C4(Z,Q.name,"SKILL.md")),z=!0}catch{z=!1}return z?Q.name:null}))).filter((Q)=>Q!==null).sort()}catch{return[]}}async function vq(q){let Z=C4(q,"agents");try{return(await $6(Z,{withFileTypes:!0})).filter((J)=>J.isDirectory()).map((J)=>J.name).sort()}catch{return[]}}function E4(q,Z){if(Z===!1)return{selected:[],missing:[]};if(Z==="*")return{selected:[...q],missing:[]};let X=new Set(q),J=[],$=[];for(let Q of Z)if(X.has(Q))J.push(Q);else $.push(Q);return{selected:J,missing:$}}function f4(q,Z,X,J,$){if(J===!1)return;if(X.length===0)console.warn(`⚠ No ${Z} found in ${q}${Z==="skills"?" (no skills/ directory or no SKILL.md files)":" (no agents/ directory)"}`);if($.length>0)console.warn(`⚠ ${Z} not found in ${q}: ${$.join(", ")}`)}import{readdir as U6,mkdir as rG,rm as G6,lstat as nG}from"node:fs/promises";import{join as k4}from"node:path";import{homedir as oG}from"node:os";import{symlink as kG,readlink as vG,unlink as gG,lstat as hG,rm as uG}from"node:fs/promises";import{platform as mG}from"node:os";import{execFile as dG}from"node:child_process";import{promisify as lG}from"node:util";var pG=lG(dG);async function y4(q,Z){try{await kG(q,Z,"dir")}catch(X){if(mG()==="win32")try{await pG("cmd",["/c","mklink","/J",Z,q])}catch(J){let $=J instanceof Error?J.message:String(J);throw Error(`Failed to create symlink or junction at ${Z}. Consider switching to install_method: copy, or enable Developer Mode on Windows. Error: ${$.trim()}`)}else throw X}}async function Q6(q,Z){try{if((await hG(Z)).isSymbolicLink()){if(await vG(Z)===q)return"unchanged";return await gG(Z),await y4(q,Z),"replaced"}return await uG(Z,{recursive:!0,force:!0}),await y4(q,Z),"replaced"}catch(X){if(X.code==="ENOENT")return await y4(q,Z),"created";throw X}}import{readdir as z6,mkdir as cG,rm as iG,stat as H6,copyFile as aG}from"node:fs/promises";import{join as x4}from"node:path";async function gq(q,Z){await cG(Z,{recursive:!0});let X=await z6(q,{withFileTypes:!0}),J=new Set(X.map((Q)=>Q.name)),$=[];try{$=await z6(Z,{withFileTypes:!0})}catch{}for(let Q of $)if(!J.has(Q.name))await iG(x4(Z,Q.name),{recursive:!0,force:!0});for(let Q of X){let z=x4(q,Q.name),H=x4(Z,Q.name);if(Q.isDirectory())await gq(z,H);else if(Q.isFile()){if(await sG(z,H))await aG(z,H)}}}async function sG(q,Z){try{let[X,J]=await Promise.all([H6(q),H6(Z)]);if(X.size!==J.size)return!0;if(X.mtimeMs>J.mtimeMs)return!0;return!1}catch{return!0}}function v4(q){if(q.startsWith("~/")||q==="~")return k4(oG(),q.slice(1));return q}async function g4(q,Z,X){let J={added:[],removed:[],unchanged:[]},$=[],Q=!1;try{$=await U6(q),Q=!0}catch{}if(Z.size===0&&!Q)return J;let z=new Set(Z.keys());for(let H of $)if(!z.has(H))await G6(k4(q,H),{recursive:!0,force:!0}),J.removed.push(H);if(Z.size===0){try{if((await U6(q)).length===0)await G6(q,{recursive:!0,force:!0})}catch{}return J}await rG(q,{recursive:!0});for(let[H,U]of Z){let G=k4(q,H);if(X==="link"){let Y=await Q6(U,G);if(Y==="created")J.added.push(H);else if(Y==="replaced")J.added.push(H);else J.unchanged.push(H)}else try{await nG(G),await gq(U,G),J.unchanged.push(H)}catch{await gq(U,G),J.added.push(H)}}return J}async function Y6(q,Z){let X=await Promise.all(q.map(async($)=>{let Q=yq($.repo,Z),z=xq($.repo,$.ref);console.log(` \uD83D\uDCE6 ${$.repo} (${$.ref})`);let H=await A0(Q,$.ref,z);return{dep:$,result:H}}));return(await Promise.all(X.map(async({dep:$,result:Q})=>{if(!Q.success)return console.error(` ✗ Failed to cache ${$.repo}, skipping`),null;let[z,H]=await Promise.all([kq(Q.path),vq(Q.path)]),U=E4(z,$.skills),G=E4(H,$.agents);return f4($.repo,"skills",z,$.skills,U.missing),f4($.repo,"agents",H,$.agents,G.missing),{repo:$.repo,cachePath:Q.path,skills:U.selected.map((Y)=>({name:Y,sourcePath:M0(Q.path,"skills",Y)})),agents:G.selected.map((Y)=>({name:Y,sourcePath:M0(Q.path,"agents",Y)}))}}))).filter(($)=>$!==null)}async function B6(q,Z,X,J){let $=new Map,Q=new Map;for(let U of q){for(let G of U.skills)$.set(G.name,G.sourcePath);for(let G of U.agents)Q.set(G.name,G.sourcePath)}let z=new Map;for(let U of Z){let G=X==="global"?v4(U.globalSkills):U.projectSkills,Y=X==="global"?v4(U.globalAgents):U.projectAgents,B=`${G}|${Y}`,_=z.get(B);if(_)_.displayNames.push(...U.displayNames);else z.set(B,{skillsDir:G,agentsDir:Y,displayNames:[...U.displayNames]})}let H=[];for(let{skillsDir:U,agentsDir:G,displayNames:Y}of z.values()){let B=M0(U,"_agentdeps_managed"),_=M0(G,"_agentdeps_managed"),V=await g4(B,$,J),R=await g4(_,Q,J);H.push({displayNames:Y,skillsAdded:V.added.length,skillsRemoved:V.removed.length,agentsAdded:R.added.length,agentsRemoved:R.removed.length})}return H}function T6(q,Z){if(Z.length===0)return` ✓ ${q}: nothing to do`;if(Z.length===1){let J=Z[0],$=J.skillsRemoved+J.agentsRemoved,Q=[];if(J.skillsAdded>0)Q.push(`${J.skillsAdded} skills added`);if(J.agentsAdded>0)Q.push(`${J.agentsAdded} agents added`);if($>0)Q.push(`${$} removed`);if(Q.length===0)Q.push("up to date");let z=J.displayNames.join(", ");return` ✓ ${q} (${z}): ${Q.join(", ")}`}let X=[];for(let J of Z){let $=J.skillsRemoved+J.agentsRemoved,Q=[];if(J.skillsAdded>0)Q.push(`${J.skillsAdded} skills added`);if(J.agentsAdded>0)Q.push(`${J.agentsAdded} agents added`);if($>0)Q.push(`${$} removed`);if(Q.length===0)Q.push("up to date");let z=J.displayNames.join(", ");X.push(` ${z}: ${Q.join(", ")}`)}return` ✓ ${q}:
231
+ `}}}}).prompt()};var wT=`${F.default.gray(f)} `;var AG=[{name:"pi",displayName:"Pi",projectSkills:".pi/skills",projectAgents:".pi/agents",globalSkills:"~/.pi/agent/skills",globalAgents:"~/.pi/agent/agents",isUniversal:!1},{name:"claude-code",displayName:"Claude Code",projectSkills:".claude/skills",projectAgents:".claude/agents",globalSkills:"~/.claude/skills",globalAgents:"~/.claude/agents",isUniversal:!1},{name:"cursor",displayName:"Cursor",projectSkills:".cursor/skills",projectAgents:".cursor/agents",globalSkills:"~/.cursor/skills",globalAgents:"~/.cursor/agents",isUniversal:!1},{name:"roo",displayName:"Roo",projectSkills:".roo/skills",projectAgents:".roo/agents",globalSkills:"~/.roo/skills",globalAgents:"~/.roo/agents",isUniversal:!1},{name:"cline",displayName:"Cline",projectSkills:".cline/skills",projectAgents:".cline/agents",globalSkills:"~/.cline/skills",globalAgents:"~/.cline/agents",isUniversal:!1},{name:"windsurf",displayName:"Windsurf",projectSkills:".windsurf/skills",projectAgents:".windsurf/agents",globalSkills:"~/.windsurf/skills",globalAgents:"~/.windsurf/agents",isUniversal:!1},{name:"opencode",displayName:"OpenCode",projectSkills:".opencode/skills",projectAgents:".opencode/agents",globalSkills:"~/.config/opencode/skills",globalAgents:"~/.config/opencode/agents",isUniversal:!1},{name:"codex",displayName:"Codex",projectSkills:".agents/skills",projectAgents:".agents/agents",globalSkills:"~/.config/codex/skills",globalAgents:"~/.config/codex/agents",isUniversal:!0},{name:"amp",displayName:"Amp",projectSkills:".agents/skills",projectAgents:".agents/agents",globalSkills:"~/.config/amp/skills",globalAgents:"~/.config/amp/agents",isUniversal:!0},{name:"gemini-cli",displayName:"Gemini CLI",projectSkills:".agents/skills",projectAgents:".agents/agents",globalSkills:"~/.config/gemini-cli/skills",globalAgents:"~/.config/gemini-cli/agents",isUniversal:!0},{name:"github-copilot",displayName:"GitHub Copilot",projectSkills:".agents/skills",projectAgents:".agents/agents",globalSkills:"~/.config/github-copilot/skills",globalAgents:"~/.config/github-copilot/agents",isUniversal:!0},{name:"kimi-cli",displayName:"Kimi CLI",projectSkills:".agents/skills",projectAgents:".agents/agents",globalSkills:"~/.config/kimi-cli/skills",globalAgents:"~/.config/kimi-cli/agents",isUniversal:!0}],g1=[...AG];function o5(q){return g1.find((Z)=>Z.name===q)}function t5(){return g1.filter((q)=>q.isUniversal)}function e5(){return g1.filter((q)=>!q.isUniversal)}function q6(q){return q.filter((Z)=>!o5(Z))}function Z6(q){let Z=new Map;for(let X of q){let J=o5(X);if(!J)continue;let $=`${J.projectSkills}|${J.projectAgents}|${J.globalSkills}|${J.globalAgents}`,Q=Z.get($);if(Q)Q.displayNames.push(J.displayName);else Z.set($,{projectSkills:J.projectSkills,projectAgents:J.projectAgents,globalSkills:J.globalSkills,globalAgents:J.globalAgents,displayNames:[J.displayName]})}return Array.from(Z.values())}function Cq(q){let Z=new Set(Object.keys(q));g1=g1.filter((X)=>!Z.has(X.name));for(let[X,J]of Object.entries(q))g1.push({name:X,displayName:X,projectSkills:J.project_skills,projectAgents:J.project_agents,globalSkills:J.global_skills,globalAgents:J.global_agents,isUniversal:!1})}function X6(){return process.stdin.isTTY===!0}async function K0(q={}){let{defaults:Z}=q;s5("⚙️ agentdeps setup");let X=await b4({message:"How do you clone git repositories?",options:[{value:"ssh",label:"SSH (git@github.com:...)"},{value:"https",label:"HTTPS (https://github.com/...)"}],initialValue:Z?.clone_method??"ssh"});if(q1(X)){Eq("Setup cancelled.");return}let J=t5(),$=e5(),Q=[];for(let U of $)Q.push({value:U.name,label:`${U.displayName}`,hint:`${U.projectSkills}, ${U.projectAgents}`});for(let U of J)Q.push({value:U.name,label:`${U.displayName}`,hint:".agents/skills, .agents/agents (Universal)"});let z=await M0({message:"Which coding agents do you use? (space to select, enter to confirm)",options:Q,initialValues:Z?.agents??[],required:!0});if(q1(z)){Eq("Setup cancelled.");return}if(z.length===0)return B1.error("At least one agent must be selected."),K0(q);let H=await b4({message:"How should dependencies be installed?",options:[{value:"link",label:"Link (symlinks)",hint:"Fast, no duplication — default"},{value:"copy",label:"Copy (smart sync)",hint:"Portable, self-contained"}],initialValue:Z?.install_method??"link"});if(q1(H)){Eq("Setup cancelled.");return}return r5("✅ Configuration saved!"),{clone_method:X,agents:z,install_method:H,custom_agents:Z?.custom_agents}}import{join as g4}from"node:path";import{mkdir as SG,readFile as wG,writeFile as bG,access as jG}from"node:fs/promises";import{dirname as EG}from"node:path";function CG(q,Z){if(!q.repo)throw Error(`Dependency at index ${Z} is missing required 'repo' field`);let X;if(q.skills===void 0||q.skills==="*"||q.skills===!0)X="*";else if(q.skills===!1)X=!1;else if(Array.isArray(q.skills))X=q.skills;else sq("config.normalize",`Dependency "${q.repo}" has unexpected skills value (${JSON.stringify(q.skills)}), defaulting to "*"`),X="*";let J;if(q.agents===void 0||q.agents==="*"||q.agents===!0)J="*";else if(q.agents===!1)J=!1;else if(Array.isArray(q.agents))J=q.agents;else sq("config.normalize",`Dependency "${q.repo}" has unexpected agents value (${JSON.stringify(q.agents)}), defaulting to "*"`),J="*";return{repo:q.repo,ref:q.ref??"main",skills:X,agents:J}}async function c(q){try{return await jG(q),!0}catch{return!1}}async function i(q){let Z=await wG(q,"utf-8"),X=T0(Z);if(!X||!X.dependencies){if(X&&!X.dependencies)console.warn("⚠ agents.yaml has no 'dependencies' field");return{dependencies:[]}}let J=X.dependencies;if(!Array.isArray(J))throw Error("'dependencies' must be an array in agents.yaml");if(J.length===0)return console.warn("⚠ agents.yaml has an empty dependencies list"),{dependencies:[]};return{dependencies:J.map((Q,z)=>CG(Q,z))}}async function fq(q,Z){let X=EG(q);await SG(X,{recursive:!0});let J={dependencies:Z.dependencies.map((Q)=>{let z={repo:Q.repo};if(Q.ref!=="main")z.ref=Q.ref;if(Q.skills!=="*")z.skills=Q.skills;if(Q.agents!=="*")z.agents=Q.agents;return z})},$=_0(J,{lineWidth:0});await bG(q,$,"utf-8")}function fG(q){if(q.includes("://"))return!1;if(q.startsWith("git@"))return!1;return q.split("/").length-1===1}function xG(q,Z){if(Z==="ssh")return`git@github.com:${q}.git`;return`https://github.com/${q}.git`}function xq(q,Z){if(fG(q))return xG(q,Z);return q}function yq(q,Z){let X;if(q.startsWith("git@")){let $=q.indexOf(":");X=q.slice($+1)}else if(q.includes("://"))try{X=new URL(q).pathname.slice(1)}catch{X=q}else X=q;if(X.endsWith(".git"))X=X.slice(0,-4);return`${X.replace(/\//g,"-")}-${Z}`}import{readdir as J6,access as yG}from"node:fs/promises";import{join as h1}from"node:path";async function kq(q){let Z=h1(q,"skills");try{let J=(await J6(Z,{withFileTypes:!0})).filter((Q)=>Q.isDirectory());return(await Promise.all(J.map(async(Q)=>{let z;try{await yG(h1(Z,Q.name,"SKILL.md")),z=!0}catch{z=!1}return z?{name:Q.name,sourcePath:h1(Z,Q.name)}:null}))).filter((Q)=>Q!==null).sort((Q,z)=>Q.name.localeCompare(z.name))}catch{return[]}}async function vq(q){let Z=h1(q,"agents");try{let X=await J6(Z,{withFileTypes:!0}),J=[];for(let $ of X)if($.isDirectory())J.push({name:$.name,sourcePath:h1(Z,$.name)});else if($.isFile()&&$.name.endsWith(".md")){let Q=$.name.replace(/\.md$/,"");J.push({name:Q,sourcePath:h1(Z,$.name)})}return J.sort(($,Q)=>$.name.localeCompare(Q.name))}catch{return[]}}function j4(q,Z){if(Z===!1)return{selected:[],missing:[]};if(Z==="*")return{selected:[...q],missing:[]};let X=new Map(q.map((Q)=>[Q.name,Q])),J=[],$=[];for(let Q of Z){let z=X.get(Q);if(z)J.push(z);else $.push(Q)}return{selected:J,missing:$}}function E4(q,Z,X,J,$){if(J===!1)return;if(X.length===0)console.warn(`⚠ No ${Z} found in ${q}${Z==="skills"?" (no skills/ directory or no SKILL.md files)":" (no agents/ directory)"}`);if($.length>0)console.warn(`⚠ ${Z} not found in ${q}: ${$.join(", ")}`)}import{readdir as G6,mkdir as iG,rm as Y6,lstat as aG,stat as sG}from"node:fs/promises";import{join as y4}from"node:path";import{homedir as rG}from"node:os";import{symlink as kG,readlink as vG,unlink as gG,lstat as $6,rm as hG}from"node:fs/promises";import{platform as uG}from"node:os";import{execFile as mG}from"node:child_process";import{promisify as dG}from"node:util";var lG=dG(mG);async function C4(q,Z){let X=!1;try{X=(await $6(q)).isFile()}catch{}try{await kG(q,Z,X?"file":"dir")}catch(J){if(uG()==="win32"&&!X)try{await lG("cmd",["/c","mklink","/J",Z,q])}catch($){let Q=$ instanceof Error?$.message:String($);throw Error(`Failed to create symlink or junction at ${Z}. Consider switching to install_method: copy, or enable Developer Mode on Windows. Error: ${Q.trim()}`)}else throw J}}async function Q6(q,Z){try{if((await $6(Z)).isSymbolicLink()){if(await vG(Z)===q)return"unchanged";return await gG(Z),await C4(q,Z),"replaced"}return await hG(Z,{recursive:!0,force:!0}),await C4(q,Z),"replaced"}catch(X){if(X.code==="ENOENT")return await C4(q,Z),"created";throw X}}import{readdir as z6,mkdir as pG,rm as cG,stat as x4,copyFile as H6}from"node:fs/promises";import{join as f4}from"node:path";async function gq(q,Z){if((await x4(q)).isFile()){if(await U6(q,Z))await H6(q,Z);return}await pG(Z,{recursive:!0});let J=await z6(q,{withFileTypes:!0}),$=new Set(J.map((z)=>z.name)),Q=[];try{Q=await z6(Z,{withFileTypes:!0})}catch{}for(let z of Q)if(!$.has(z.name))await cG(f4(Z,z.name),{recursive:!0,force:!0});for(let z of J){let H=f4(q,z.name),U=f4(Z,z.name);if(z.isDirectory())await gq(H,U);else if(z.isFile()){if(await U6(H,U))await H6(H,U)}}}async function U6(q,Z){try{let[X,J]=await Promise.all([x4(q),x4(Z)]);if(X.size!==J.size)return!0;if(X.mtimeMs>J.mtimeMs)return!0;return!1}catch{return!0}}function k4(q){if(q.startsWith("~/")||q==="~")return y4(rG(),q.slice(1));return q}async function nG(q,Z){try{if((await sG(Z)).isFile()){let J=Z.match(/(\.[^.]+)$/)?.[1]??"";return q+J}}catch{}return q}async function v4(q,Z,X){let J={added:[],removed:[],unchanged:[]},$=[],Q=!1;try{$=await G6(q),Q=!0}catch{}if(Z.size===0&&!Q)return J;let z=[];for(let[U,G]of Z){let B=await nG(U,G);z.push({name:U,targetName:B,sourcePath:G})}let H=new Set(z.map((U)=>U.targetName));for(let U of $)if(!H.has(U))await Y6(y4(q,U),{recursive:!0,force:!0}),J.removed.push(U);if(Z.size===0){try{if((await G6(q)).length===0)await Y6(q,{recursive:!0,force:!0})}catch{}return J}await iG(q,{recursive:!0});for(let{name:U,targetName:G,sourcePath:B}of z){let Y=y4(q,G);if(X==="link"){let _=await Q6(B,Y);if(_==="created")J.added.push(U);else if(_==="replaced")J.added.push(U);else J.unchanged.push(U)}else try{await aG(Y),await gq(B,Y),J.unchanged.push(U)}catch{await gq(B,Y),J.added.push(U)}}return J}async function B6(q,Z){let X=await Promise.all(q.map(async($)=>{let Q=xq($.repo,Z),z=yq($.repo,$.ref);console.log(` \uD83D\uDCE6 ${$.repo} (${$.ref})`);let H=await S0(Q,$.ref,z);return{dep:$,result:H}}));return(await Promise.all(X.map(async({dep:$,result:Q})=>{if(!Q.success)return console.error(` ✗ Failed to cache ${$.repo}, skipping`),null;let[z,H]=await Promise.all([kq(Q.path),vq(Q.path)]),U=j4(z,$.skills),G=j4(H,$.agents);return E4($.repo,"skills",z,$.skills,U.missing),E4($.repo,"agents",H,$.agents,G.missing),{repo:$.repo,cachePath:Q.path,skills:U.selected,agents:G.selected}}))).filter(($)=>$!==null)}async function T6(q,Z,X,J){let $=new Map,Q=new Map;for(let U of q){for(let G of U.skills)$.set(G.name,G.sourcePath);for(let G of U.agents)Q.set(G.name,G.sourcePath)}let z=new Map;for(let U of Z){let G=X==="global"?k4(U.globalSkills):U.projectSkills,B=X==="global"?k4(U.globalAgents):U.projectAgents,Y=`${G}|${B}`,_=z.get(Y);if(_)_.displayNames.push(...U.displayNames);else z.set(Y,{skillsDir:G,agentsDir:B,displayNames:[...U.displayNames]})}let H=[];for(let{skillsDir:U,agentsDir:G,displayNames:B}of z.values()){let Y=g4(U,"_agentdeps_managed"),_=g4(G,"_agentdeps_managed"),R=await v4(Y,$,J),W=await v4(_,Q,J);H.push({displayNames:B,skillsAdded:R.added.length,skillsRemoved:R.removed.length,agentsAdded:W.added.length,agentsRemoved:W.removed.length})}return H}function _6(q,Z){if(Z.length===0)return` ✓ ${q}: nothing to do`;if(Z.length===1){let J=Z[0],$=J.skillsRemoved+J.agentsRemoved,Q=[];if(J.skillsAdded>0)Q.push(`${J.skillsAdded} skills added`);if(J.agentsAdded>0)Q.push(`${J.agentsAdded} agents added`);if($>0)Q.push(`${$} removed`);if(Q.length===0)Q.push("up to date");let z=J.displayNames.join(", ");return` ✓ ${q} (${z}): ${Q.join(", ")}`}let X=[];for(let J of Z){let $=J.skillsRemoved+J.agentsRemoved,Q=[];if(J.skillsAdded>0)Q.push(`${J.skillsAdded} skills added`);if(J.agentsAdded>0)Q.push(`${J.agentsAdded} agents added`);if($>0)Q.push(`${$} removed`);if(Q.length===0)Q.push("up to date");let z=J.displayNames.join(", ");X.push(` ${z}: ${Q.join(", ")}`)}return` ✓ ${q}:
232
232
  ${X.join(`
233
- `)}`}async function K0(q){if(q.custom_agents)Eq(q.custom_agents);let Z=Z6(q.agents);if(Z.length>0)console.warn(`⚠ Unknown agents in config: ${Z.join(", ")}`);let X=X6(q.agents),J=Rq();try{if(await c(J)){console.log(`
234
- \uD83C\uDF10 Processing global dependencies...`);let Q=await i(J);if(Q.dependencies.length>0){let z=await Y6(Q.dependencies,q.clone_method),H=await B6(z,X,"global",q.install_method);console.log(T6("Global",H))}}}catch(Q){o("global-deps",Q),console.warn("⚠ Failed to process global dependencies")}let $=M0(process.cwd(),"agents.yaml");if(await c($)){console.log(`
235
- \uD83D\uDCC1 Processing project dependencies...`);let Q=await i($);if(Q.dependencies.length>0){let z=await Y6(Q.dependencies,q.clone_method),H=await B6(z,X,"project",q.install_method);console.log(T6("Project",H))}else console.log(" ℹ No project dependencies defined")}else console.log(`
233
+ `)}`}async function D0(q){if(q.custom_agents)Cq(q.custom_agents);let Z=q6(q.agents);if(Z.length>0)console.warn(`⚠ Unknown agents in config: ${Z.join(", ")}`);let X=Z6(q.agents),J=Rq();try{if(await c(J)){console.log(`
234
+ \uD83C\uDF10 Processing global dependencies...`);let Q=await i(J);if(Q.dependencies.length>0){let z=await B6(Q.dependencies,q.clone_method),H=await T6(z,X,"global",q.install_method);console.log(_6("Global",H))}}}catch(Q){o("global-deps",Q),console.warn("⚠ Failed to process global dependencies")}let $=g4(process.cwd(),"agents.yaml");if(await c($)){console.log(`
235
+ \uD83D\uDCC1 Processing project dependencies...`);let Q=await i($);if(Q.dependencies.length>0){let z=await B6(Q.dependencies,q.clone_method),H=await T6(z,X,"project",q.install_method);console.log(_6("Project",H))}else console.log(" ℹ No project dependencies defined")}else console.log(`
236
236
  ℹ No project agents.yaml found — only global dependencies processed`);console.log(`
237
- ✅ Install complete`),N0()}var _6=new g("install").description("Install dependencies from agents.yaml").action(async()=>{let q=await G1();await K0(q)});import{join as tG}from"node:path";var L6=new g("add").description("Add a new dependency to agents.yaml").argument("<repo>","Repository (owner/repo or full URL)").option("--ref <ref>","Git ref (branch, tag, SHA)","main").option("--skill <name>","Install specific skill (repeatable)",W6,[]).option("--agent <name>","Install specific agent (repeatable)",W6,[]).option("--all","Install all skills and agents").option("--all-skills","Install all skills").option("--all-agents","Install all agents").option("--no-skills","Don't install any skills").option("--no-agents","Don't install any agents").action(async(q,Z)=>{let X=await G1(),J=tG(process.cwd(),"agents.yaml");if(await c(J)){if((await i(J)).dependencies.find((T)=>T.repo===q||R6(T.repo)===R6(q)))console.error(`✗ ${q} already exists in agents.yaml. Edit the file directly to modify it.`),process.exit(1)}let $=yq(q,X.clone_method),Q=xq(q,Z.ref);console.log(`\uD83D\uDCE6 Fetching ${q}...`);let z=await A0($,Z.ref,Q);if(!z.success)console.error(`✗ Failed to clone ${q}`),process.exit(1);let[H,U]=await Promise.all([kq(z.path),vq(z.path)]);console.log(` Found ${H.length} skill(s), ${U.length} agent(s)`);let G,Y;if(Z.all)G="*",Y="*";else if(Z.skill.length>0||Z.agent.length>0||Z.allSkills||Z.allAgents||Z.skills===!1||Z.agents===!1){if(Z.skills===!1)G=!1;else if(Z.allSkills)G="*";else if(Z.skill.length>0)G=Z.skill;else G="*";if(Z.agents===!1)Y=!1;else if(Z.allAgents)Y="*";else if(Z.agent.length>0)Y=Z.agent;else Y="*"}else{let V=await eG(H,U);if(!V)return;G=V.skills,Y=V.agents}let B={repo:q,ref:Z.ref,skills:G,agents:Y},_=await c(J)?await i(J):{dependencies:[]};_.dependencies.push(B),await fq(J,_),console.log(`
238
- ✓ Added ${q} to agents.yaml`),await K0(X)});function W6(q,Z){return Z.concat([q])}function R6(q){return q.replace(/\.git$/,"").toLowerCase()}var hq="__select_all__",h4="__select_none__";async function V6(q,Z){let X=await Cq({message:q,options:[{value:hq,label:"Select all",hint:"install everything"},{value:h4,label:"Select none",hint:"skip all"},...Z.map((Q)=>({value:Q,label:Q}))],initialValues:[hq,...Z],required:!1});if(Y1(X))return;let J=X;if(J.includes(h4))return!1;if(J.includes(hq))return"*";let $=J.filter((Q)=>Q!==hq&&Q!==h4);if($.length===0)return!1;if($.length===Z.length)return"*";return $}async function eG(q,Z){let X={skills:"*",agents:"*"};if(q.length>0){let J=await V6("Select skills to install:",q);if(J===void 0)return;X.skills=J}else X.skills=!1;if(Z.length>0){let J=await V6("Select agents to install:",Z);if(J===void 0)return;X.agents=J}else X.agents=!1;return X}import{join as qY}from"node:path";var M6=new g("remove").description("Remove a dependency from agents.yaml").argument("<repo>","Repository to remove (owner/repo or full URL)").action(async(q)=>{let Z=await G1(),X=qY(process.cwd(),"agents.yaml");if(!await c(X))console.error("✗ No agents.yaml found in current directory"),process.exit(1);let J=await i(X),$=I6(q),Q=J.dependencies.findIndex((H)=>I6(H.repo)===$);if(Q===-1)console.error(`✗ ${q} not found in agents.yaml`),process.exit(1);let[z]=J.dependencies.splice(Q,1);if(!z)console.error(`✗ Unexpected error removing ${q}`),process.exit(1);await fq(X,J),console.log(`✓ Removed ${z.repo} from agents.yaml`),await K0(Z)});function I6(q){return q.replace(/\.git$/,"").toLowerCase()}import{join as ZY}from"node:path";var P6=new g("list").description("List installed dependencies").action(async()=>{let q=await G1(),Z=!1,X=Rq();if(await c(X)){let $=await i(X);if($.dependencies.length>0)Z=!0,console.log(`\uD83C\uDF10 Global dependencies:
239
- `),K6($.dependencies,q.agents)}let J=ZY(process.cwd(),"agents.yaml");if(await c(J)){let $=await i(J);if($.dependencies.length>0)Z=!0,console.log(`\uD83D\uDCC1 Project dependencies:
237
+ ✅ Install complete`),A0()}var L6=new g("install").description("Install dependencies from agents.yaml").action(async()=>{let q=await Y1();await D0(q)});import{join as oG}from"node:path";var V6=new g("add").description("Add a new dependency to agents.yaml").argument("<repo>","Repository (owner/repo or full URL)").option("--ref <ref>","Git ref (branch, tag, SHA)","main").option("--skill <name>","Install specific skill (repeatable)",W6,[]).option("--agent <name>","Install specific agent (repeatable)",W6,[]).option("--all","Install all skills and agents").option("--all-skills","Install all skills").option("--all-agents","Install all agents").option("--no-skills","Don't install any skills").option("--no-agents","Don't install any agents").action(async(q,Z)=>{let X=await Y1(),J=oG(process.cwd(),"agents.yaml");if(await c(J)){if((await i(J)).dependencies.find((T)=>T.repo===q||R6(T.repo)===R6(q)))console.error(`✗ ${q} already exists in agents.yaml. Edit the file directly to modify it.`),process.exit(1)}let $=xq(q,X.clone_method),Q=yq(q,Z.ref);console.log(`\uD83D\uDCE6 Fetching ${q}...`);let z=await S0($,Z.ref,Q);if(!z.success)console.error(`✗ Failed to clone ${q}`),process.exit(1);let[H,U]=await Promise.all([kq(z.path),vq(z.path)]);console.log(` Found ${H.length} skill(s), ${U.length} agent(s)`);let G,B;if(Z.all)G="*",B="*";else if(Z.skill.length>0||Z.agent.length>0||Z.allSkills||Z.allAgents||Z.skills===!1||Z.agents===!1){if(Z.skills===!1)G=!1;else if(Z.allSkills)G="*";else if(Z.skill.length>0)G=Z.skill;else G="*";if(Z.agents===!1)B=!1;else if(Z.allAgents)B="*";else if(Z.agent.length>0)B=Z.agent;else B="*"}else{let R=await tG(H,U);if(!R)return;G=R.skills,B=R.agents}let Y={repo:q,ref:Z.ref,skills:G,agents:B},_=await c(J)?await i(J):{dependencies:[]};_.dependencies.push(Y),await fq(J,_),console.log(`
238
+ ✓ Added ${q} to agents.yaml`),await D0(X)});function W6(q,Z){return Z.concat([q])}function R6(q){return q.replace(/\.git$/,"").toLowerCase()}async function tG(q,Z){let X={skills:"*",agents:"*"};if(q.length>0){let J=q.map((z)=>z.name),$=await M0({message:"Select skills to install (press 'a' to toggle all):",options:J.map((z)=>({value:z,label:z})),initialValues:J,required:!1});if(q1($))return;let Q=$;if(Q.length===J.length)X.skills="*";else if(Q.length===0)X.skills=!1;else X.skills=Q}else X.skills=!1;if(Z.length>0){let J=Z.map((z)=>z.name),$=await M0({message:"Select agents to install (press 'a' to toggle all):",options:J.map((z)=>({value:z,label:z})),initialValues:J,required:!1});if(q1($))return;let Q=$;if(Q.length===J.length)X.agents="*";else if(Q.length===0)X.agents=!1;else X.agents=Q}else X.agents=!1;return X}import{join as eG}from"node:path";var M6=new g("remove").description("Remove a dependency from agents.yaml").argument("<repo>","Repository to remove (owner/repo or full URL)").action(async(q)=>{let Z=await Y1(),X=eG(process.cwd(),"agents.yaml");if(!await c(X))console.error("✗ No agents.yaml found in current directory"),process.exit(1);let J=await i(X),$=I6(q),Q=J.dependencies.findIndex((H)=>I6(H.repo)===$);if(Q===-1)console.error(`✗ ${q} not found in agents.yaml`),process.exit(1);let[z]=J.dependencies.splice(Q,1);if(!z)console.error(`✗ Unexpected error removing ${q}`),process.exit(1);await fq(X,J),console.log(`✓ Removed ${z.repo} from agents.yaml`),await D0(Z)});function I6(q){return q.replace(/\.git$/,"").toLowerCase()}import{join as qY}from"node:path";var D6=new g("list").description("List installed dependencies").action(async()=>{let q=await Y1(),Z=!1,X=Rq();if(await c(X)){let $=await i(X);if($.dependencies.length>0)Z=!0,console.log(`\uD83C\uDF10 Global dependencies:
239
+ `),K6($.dependencies,q.agents)}let J=qY(process.cwd(),"agents.yaml");if(await c(J)){let $=await i(J);if($.dependencies.length>0)Z=!0,console.log(`\uD83D\uDCC1 Project dependencies:
240
240
  `),K6($.dependencies,q.agents)}if(!Z)console.log(`No dependencies configured.
241
241
 
242
242
  Add one with:
243
243
  agentdeps add <owner/repo>
244
244
 
245
- Or create agents.yaml manually.`)});function K6(q,Z){for(let X of q){if(console.log(` ${X.repo} (ref: ${X.ref})`),X.skills==="*")console.log(" skills: all");else if(X.skills===!1)console.log(" skills: none");else console.log(` skills: ${X.skills.join(", ")}`);if(X.agents==="*")console.log(" agents: all");else if(X.agents===!1)console.log(" agents: none");else console.log(` agents: ${X.agents.join(", ")}`);console.log(` targets: ${Z.join(", ")}`),console.log()}}var D6=new g("config").description("Configure agentdeps (re-run interactive setup)").action(async()=>{let q=void 0;try{q=await U4()}catch(X){o("config.load",X),console.warn("⚠ Existing config is invalid, starting fresh")}if(q?.custom_agents)Eq(q.custom_agents);let Z=await I0({defaults:q});if(!Z)return;if(q?.custom_agents&&!Z.custom_agents)Z.custom_agents=q.custom_agents;await Vq(Z),console.log(`
246
- ✓ Configuration saved`)});var T1=new g().name("agentdeps").version("0.1.0").description("Declarative dependency manager for AI coding agent skills and subagents"),XY=new Set(["install","add","remove","list"]);T1.hook("preAction",async(q,Z)=>{let X=Z.name();if(!XY.has(X))return;if(!await Y2())console.error(`✗ git is not installed or not in PATH.
245
+ Or create agents.yaml manually.`)});function K6(q,Z){for(let X of q){if(console.log(` ${X.repo} (ref: ${X.ref})`),X.skills==="*")console.log(" skills: all");else if(X.skills===!1)console.log(" skills: none");else console.log(` skills: ${X.skills.join(", ")}`);if(X.agents==="*")console.log(" agents: all");else if(X.agents===!1)console.log(" agents: none");else console.log(` agents: ${X.agents.join(", ")}`);console.log(` targets: ${Z.join(", ")}`),console.log()}}var P6=new g("config").description("Configure agentdeps (re-run interactive setup)").action(async()=>{let q=void 0;try{q=await H4()}catch(X){o("config.load",X),console.warn("⚠ Existing config is invalid, starting fresh")}if(q?.custom_agents)Cq(q.custom_agents);let Z=await K0({defaults:q});if(!Z)return;if(q?.custom_agents&&!Z.custom_agents)Z.custom_agents=q.custom_agents;await Vq(Z),console.log(`
246
+ ✓ Configuration saved`)});var T1=new g().name("agentdeps").version("0.1.0").description("Declarative dependency manager for AI coding agent skills and subagents"),ZY=new Set(["install","add","remove","list"]);T1.hook("preAction",async(q,Z)=>{let X=Z.name();if(!ZY.has(X))return;if(!await G2())console.error(`✗ git is not installed or not in PATH.
247
247
  `+` agentdeps requires git to clone and update repositories.
248
- Install git: https://git-scm.com/downloads`),process.exit(1);if(!await K5()){if(!J6())console.error(`✗ No configuration found and terminal is not interactive.
248
+ Install git: https://git-scm.com/downloads`),process.exit(1);if(!await M5()){if(!X6())console.error(`✗ No configuration found and terminal is not interactive.
249
249
  `+" Run `agentdeps config` in an interactive terminal first."),process.exit(1);console.log(`Welcome to agentdeps! Let's set up your configuration.
250
- `);let Q=await I0();if(!Q)process.exit(1);await Vq(Q)}});T1.addCommand(_6);T1.addCommand(L6);T1.addCommand(M6);T1.addCommand(P6);T1.addCommand(D6);T1.parse();
250
+ `);let Q=await K0();if(!Q)process.exit(1);await Vq(Q)}});T1.addCommand(L6);T1.addCommand(V6);T1.addCommand(M6);T1.addCommand(D6);T1.addCommand(P6);T1.parse();