@pickled-dev/cli 0.9.0 → 0.11.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 (2) hide show
  1. package/dist/index.js +185 -182
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,204 +1,207 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun
3
- var s4=Object.create;var{getPrototypeOf:r4,defineProperty:s1,getOwnPropertyNames:n4}=Object;var o4=Object.prototype.hasOwnProperty;function t4(q){return this[q]}var e4,q5,r1=(q,$,X)=>{var Z=q!=null&&typeof q==="object";if(Z){var H=$?e4??=new WeakMap:q5??=new WeakMap,z=H.get(q);if(z)return z}X=q!=null?s4(r4(q)):{};let U=$||!q||!q.__esModule?s1(X,"default",{value:q,enumerable:!0}):X;for(let Q of n4(q))if(!o4.call(U,Q))s1(U,Q,{get:t4.bind(q,Q),enumerable:!0});if(Z)H.set(q,U);return U};var I=(q,$)=>()=>($||q(($={exports:{}}).exports,$),$.exports);var c=import.meta.require;var E0=I(($5)=>{class J$ extends Error{constructor(q,$,X){super(X);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=$,this.exitCode=q,this.nestedError=void 0}}class n1 extends J${constructor(q){super(1,"commander.invalidArgument",q);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}$5.CommanderError=J$;$5.InvalidArgumentError=n1});var Hq=I((U5)=>{var{InvalidArgumentError:H5}=E0();class o1{constructor(q,$){switch(this.description=$||"",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,$){if($===this.defaultValue||!Array.isArray($))return[q];return $.push(q),$}default(q,$){return this.defaultValue=q,this.defaultValueDescription=$,this}argParser(q){return this.parseArg=q,this}choices(q){return this.argChoices=q.slice(),this.parseArg=($,X)=>{if(!this.argChoices.includes($))throw new H5(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue($,X);return $},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function z5(q){let $=q.name()+(q.variadic===!0?"...":"");return q.required?"<"+$+">":"["+$+"]"}U5.Argument=o1;U5.humanReadableArgName=z5});var T$=I((T5)=>{var{humanReadableArgName:J5}=Hq();class t1{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 $=q.commands.filter((Z)=>!Z._hidden),X=q._getHelpCommand();if(X&&!X._hidden)$.push(X);if(this.sortSubcommands)$.sort((Z,H)=>{return Z.name().localeCompare(H.name())});return $}compareOptions(q,$){let X=(Z)=>{return Z.short?Z.short.replace(/^-/,""):Z.long.replace(/^--/,"")};return X(q).localeCompare(X($))}visibleOptions(q){let $=q.options.filter((Z)=>!Z.hidden),X=q._getHelpOption();if(X&&!X.hidden){let Z=X.short&&q._findOption(X.short),H=X.long&&q._findOption(X.long);if(!Z&&!H)$.push(X);else if(X.long&&!H)$.push(q.createOption(X.long,X.description));else if(X.short&&!Z)$.push(q.createOption(X.short,X.description))}if(this.sortOptions)$.sort(this.compareOptions);return $}visibleGlobalOptions(q){if(!this.showGlobalOptions)return[];let $=[];for(let X=q.parent;X;X=X.parent){let Z=X.options.filter((H)=>!H.hidden);$.push(...Z)}if(this.sortOptions)$.sort(this.compareOptions);return $}visibleArguments(q){if(q._argsDescription)q.registeredArguments.forEach(($)=>{$.description=$.description||q._argsDescription[$.name()]||""});if(q.registeredArguments.find(($)=>$.description))return q.registeredArguments;return[]}subcommandTerm(q){let $=q.registeredArguments.map((X)=>J5(X)).join(" ");return q._name+(q._aliases[0]?"|"+q._aliases[0]:"")+(q.options.length?" [options]":"")+($?" "+$:"")}optionTerm(q){return q.flags}argumentTerm(q){return q.name()}longestSubcommandTermLength(q,$){return $.visibleCommands(q).reduce((X,Z)=>{return Math.max(X,this.displayWidth($.styleSubcommandTerm($.subcommandTerm(Z))))},0)}longestOptionTermLength(q,$){return $.visibleOptions(q).reduce((X,Z)=>{return Math.max(X,this.displayWidth($.styleOptionTerm($.optionTerm(Z))))},0)}longestGlobalOptionTermLength(q,$){return $.visibleGlobalOptions(q).reduce((X,Z)=>{return Math.max(X,this.displayWidth($.styleOptionTerm($.optionTerm(Z))))},0)}longestArgumentTermLength(q,$){return $.visibleArguments(q).reduce((X,Z)=>{return Math.max(X,this.displayWidth($.styleArgumentTerm($.argumentTerm(Z))))},0)}commandUsage(q){let $=q._name;if(q._aliases[0])$=$+"|"+q._aliases[0];let X="";for(let Z=q.parent;Z;Z=Z.parent)X=Z.name()+" "+X;return X+$+" "+q.usage()}commandDescription(q){return q.description()}subcommandDescription(q){return q.summary()||q.description()}optionDescription(q){let $=[];if(q.argChoices)$.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")$.push(`default: ${q.defaultValueDescription||JSON.stringify(q.defaultValue)}`)}if(q.presetArg!==void 0&&q.optional)$.push(`preset: ${JSON.stringify(q.presetArg)}`);if(q.envVar!==void 0)$.push(`env: ${q.envVar}`);if($.length>0){let X=`(${$.join(", ")})`;if(q.description)return`${q.description} ${X}`;return X}return q.description}argumentDescription(q){let $=[];if(q.argChoices)$.push(`choices: ${q.argChoices.map((X)=>JSON.stringify(X)).join(", ")}`);if(q.defaultValue!==void 0)$.push(`default: ${q.defaultValueDescription||JSON.stringify(q.defaultValue)}`);if($.length>0){let X=`(${$.join(", ")})`;if(q.description)return`${q.description} ${X}`;return X}return q.description}formatItemList(q,$,X){if($.length===0)return[];return[X.styleTitle(q),...$,""]}groupItems(q,$,X){let Z=new Map;return q.forEach((H)=>{let z=X(H);if(!Z.has(z))Z.set(z,[])}),$.forEach((H)=>{let z=X(H);if(!Z.has(z))Z.set(z,[]);Z.get(z).push(H)}),Z}formatHelp(q,$){let X=$.padWidth(q,$),Z=$.helpWidth??80;function H(Y,T){return $.formatItem(Y,X,T,$)}let z=[`${$.styleTitle("Usage:")} ${$.styleUsage($.commandUsage(q))}`,""],U=$.commandDescription(q);if(U.length>0)z=z.concat([$.boxWrap($.styleCommandDescription(U),Z),""]);let Q=$.visibleArguments(q).map((Y)=>{return H($.styleArgumentTerm($.argumentTerm(Y)),$.styleArgumentDescription($.argumentDescription(Y)))});if(z=z.concat(this.formatItemList("Arguments:",Q,$)),this.groupItems(q.options,$.visibleOptions(q),(Y)=>Y.helpGroupHeading??"Options:").forEach((Y,T)=>{let L=Y.map((_)=>{return H($.styleOptionTerm($.optionTerm(_)),$.styleOptionDescription($.optionDescription(_)))});z=z.concat(this.formatItemList(T,L,$))}),$.showGlobalOptions){let Y=$.visibleGlobalOptions(q).map((T)=>{return H($.styleOptionTerm($.optionTerm(T)),$.styleOptionDescription($.optionDescription(T)))});z=z.concat(this.formatItemList("Global Options:",Y,$))}return this.groupItems(q.commands,$.visibleCommands(q),(Y)=>Y.helpGroup()||"Commands:").forEach((Y,T)=>{let L=Y.map((_)=>{return H($.styleSubcommandTerm($.subcommandTerm(_)),$.styleSubcommandDescription($.subcommandDescription(_)))});z=z.concat(this.formatItemList(T,L,$))}),z.join(`
4
- `)}displayWidth(q){return e1(q).length}styleTitle(q){return q}styleUsage(q){return q.split(" ").map(($)=>{if($==="[options]")return this.styleOptionText($);if($==="[command]")return this.styleSubcommandText($);if($[0]==="["||$[0]==="<")return this.styleArgumentText($);return this.styleCommandText($)}).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(($)=>{if($==="[options]")return this.styleOptionText($);if($[0]==="["||$[0]==="<")return this.styleArgumentText($);return this.styleSubcommandText($)}).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,$){return Math.max($.longestOptionTermLength(q,$),$.longestGlobalOptionTermLength(q,$),$.longestSubcommandTermLength(q,$),$.longestArgumentTermLength(q,$))}preformatted(q){return/\n[^\S\r\n]/.test(q)}formatItem(q,$,X,Z){let z=" ".repeat(2);if(!X)return z+q;let U=q.padEnd($+q.length-Z.displayWidth(q)),Q=2,G=(this.helpWidth??80)-$-Q-2,Y;if(G<this.minWidthToWrap||Z.preformatted(X))Y=X;else Y=Z.boxWrap(X,G).replace(/\n/g,`
5
- `+" ".repeat($+Q));return z+U+" ".repeat(Q)+Y.replace(/\n/g,`
6
- ${z}`)}boxWrap(q,$){if($<this.minWidthToWrap)return q;let X=q.split(/\r\n|\n/),Z=/[\s]*[^\s]+/g,H=[];return X.forEach((z)=>{let U=z.match(Z);if(U===null){H.push("");return}let Q=[U.shift()],J=this.displayWidth(Q[0]);U.forEach((G)=>{let Y=this.displayWidth(G);if(J+Y<=$){Q.push(G),J+=Y;return}H.push(Q.join(""));let T=G.trimStart();Q=[T],J=this.displayWidth(T)}),H.push(Q.join(""))}),H.join(`
7
- `)}}function e1(q){let $=/\x1b\[\d*(;\d*)*m/g;return q.replace($,"")}T5.Help=t1;T5.stripColor=e1});var Y$=I((W5)=>{var{InvalidArgumentError:B5}=E0();class $2{constructor(q,$){this.flags=q,this.description=$||"",this.required=q.includes("<"),this.optional=q.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(q),this.mandatory=!1;let X=_5(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,$){return this.defaultValue=q,this.defaultValueDescription=$,this}preset(q){return this.presetArg=q,this}conflicts(q){return this.conflictsWith=this.conflictsWith.concat(q),this}implies(q){let $=q;if(typeof q==="string")$={[q]:!0};return this.implied=Object.assign(this.implied||{},$),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,$){if($===this.defaultValue||!Array.isArray($))return[q];return $.push(q),$}choices(q){return this.argChoices=q.slice(),this.parseArg=($,X)=>{if(!this.argChoices.includes($))throw new B5(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue($,X);return $},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return q2(this.name().replace(/^no-/,""));return q2(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 X2{constructor(q){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,q.forEach(($)=>{if($.negate)this.negativeOptions.set($.attributeName(),$);else this.positiveOptions.set($.attributeName(),$)}),this.negativeOptions.forEach(($,X)=>{if(this.positiveOptions.has(X))this.dualOptions.add(X)})}valueFromOption(q,$){let X=$.attributeName();if(!this.dualOptions.has(X))return!0;let Z=this.negativeOptions.get(X).presetArg,H=Z!==void 0?Z:!1;return $.negate===(H===q)}}function q2(q){return q.split("-").reduce(($,X)=>{return $+X[0].toUpperCase()+X.slice(1)})}function _5(q){let $,X,Z=/^-[^-]$/,H=/^--[^-]/,z=q.split(/[ |,]+/).concat("guard");if(Z.test(z[0]))$=z.shift();if(H.test(z[0]))X=z.shift();if(!$&&Z.test(z[0]))$=z.shift();if(!$&&H.test(z[0]))$=X,X=z.shift();if(z[0].startsWith("-")){let U=z[0],Q=`option creation failed due to '${U}' in option flags '${q}'`;if(/^-[^-][^-]/.test(U))throw Error(`${Q}
3
+ var n4=Object.create;var{getPrototypeOf:o4,defineProperty:r1,getOwnPropertyNames:t4}=Object;var e4=Object.prototype.hasOwnProperty;function $5($){return this[$]}var q5,z5,n1=($,q,z)=>{var X=$!=null&&typeof $==="object";if(X){var Z=q?q5??=new WeakMap:z5??=new WeakMap,H=Z.get($);if(H)return H}z=$!=null?n4(o4($)):{};let Q=q||!$||!$.__esModule?r1(z,"default",{value:$,enumerable:!0}):z;for(let J of t4($))if(!e4.call(Q,J))r1(Q,J,{get:$5.bind($,J),enumerable:!0});if(X)Z.set($,Q);return Q};var D=($,q)=>()=>(q||$((q={exports:{}}).exports,q),q.exports);var c=import.meta.require;var C0=D((X5)=>{class Yq extends Error{constructor($,q,z){super(z);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=q,this.exitCode=$,this.nestedError=void 0}}class o1 extends Yq{constructor($){super(1,"commander.invalidArgument",$);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}X5.CommanderError=Yq;X5.InvalidArgumentError=o1});var J$=D((U5)=>{var{InvalidArgumentError:Q5}=C0();class t1{constructor($,q){switch(this.description=q||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,$[0]){case"<":this.required=!0,this._name=$.slice(1,-1);break;case"[":this.required=!1,this._name=$.slice(1,-1);break;default:this.required=!0,this._name=$;break}if(this._name.endsWith("..."))this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_collectValue($,q){if(q===this.defaultValue||!Array.isArray(q))return[$];return q.push($),q}default($,q){return this.defaultValue=$,this.defaultValueDescription=q,this}argParser($){return this.parseArg=$,this}choices($){return this.argChoices=$.slice(),this.parseArg=(q,z)=>{if(!this.argChoices.includes(q))throw new Q5(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(q,z);return q},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function J5($){let q=$.name()+($.variadic===!0?"...":"");return $.required?"<"+q+">":"["+q+"]"}U5.Argument=t1;U5.humanReadableArgName=J5});var Bq=D((T5)=>{var{humanReadableArgName:B5}=J$();class e1{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext($){this.helpWidth=this.helpWidth??$.helpWidth??80}visibleCommands($){let q=$.commands.filter((X)=>!X._hidden),z=$._getHelpCommand();if(z&&!z._hidden)q.push(z);if(this.sortSubcommands)q.sort((X,Z)=>{return X.name().localeCompare(Z.name())});return q}compareOptions($,q){let z=(X)=>{return X.short?X.short.replace(/^-/,""):X.long.replace(/^--/,"")};return z($).localeCompare(z(q))}visibleOptions($){let q=$.options.filter((X)=>!X.hidden),z=$._getHelpOption();if(z&&!z.hidden){let X=z.short&&$._findOption(z.short),Z=z.long&&$._findOption(z.long);if(!X&&!Z)q.push(z);else if(z.long&&!Z)q.push($.createOption(z.long,z.description));else if(z.short&&!X)q.push($.createOption(z.short,z.description))}if(this.sortOptions)q.sort(this.compareOptions);return q}visibleGlobalOptions($){if(!this.showGlobalOptions)return[];let q=[];for(let z=$.parent;z;z=z.parent){let X=z.options.filter((Z)=>!Z.hidden);q.push(...X)}if(this.sortOptions)q.sort(this.compareOptions);return q}visibleArguments($){if($._argsDescription)$.registeredArguments.forEach((q)=>{q.description=q.description||$._argsDescription[q.name()]||""});if($.registeredArguments.find((q)=>q.description))return $.registeredArguments;return[]}subcommandTerm($){let q=$.registeredArguments.map((z)=>B5(z)).join(" ");return $._name+($._aliases[0]?"|"+$._aliases[0]:"")+($.options.length?" [options]":"")+(q?" "+q:"")}optionTerm($){return $.flags}argumentTerm($){return $.name()}longestSubcommandTermLength($,q){return q.visibleCommands($).reduce((z,X)=>{return Math.max(z,this.displayWidth(q.styleSubcommandTerm(q.subcommandTerm(X))))},0)}longestOptionTermLength($,q){return q.visibleOptions($).reduce((z,X)=>{return Math.max(z,this.displayWidth(q.styleOptionTerm(q.optionTerm(X))))},0)}longestGlobalOptionTermLength($,q){return q.visibleGlobalOptions($).reduce((z,X)=>{return Math.max(z,this.displayWidth(q.styleOptionTerm(q.optionTerm(X))))},0)}longestArgumentTermLength($,q){return q.visibleArguments($).reduce((z,X)=>{return Math.max(z,this.displayWidth(q.styleArgumentTerm(q.argumentTerm(X))))},0)}commandUsage($){let q=$._name;if($._aliases[0])q=q+"|"+$._aliases[0];let z="";for(let X=$.parent;X;X=X.parent)z=X.name()+" "+z;return z+q+" "+$.usage()}commandDescription($){return $.description()}subcommandDescription($){return $.summary()||$.description()}optionDescription($){let q=[];if($.argChoices)q.push(`choices: ${$.argChoices.map((z)=>JSON.stringify(z)).join(", ")}`);if($.defaultValue!==void 0){if($.required||$.optional||$.isBoolean()&&typeof $.defaultValue==="boolean")q.push(`default: ${$.defaultValueDescription||JSON.stringify($.defaultValue)}`)}if($.presetArg!==void 0&&$.optional)q.push(`preset: ${JSON.stringify($.presetArg)}`);if($.envVar!==void 0)q.push(`env: ${$.envVar}`);if(q.length>0){let z=`(${q.join(", ")})`;if($.description)return`${$.description} ${z}`;return z}return $.description}argumentDescription($){let q=[];if($.argChoices)q.push(`choices: ${$.argChoices.map((z)=>JSON.stringify(z)).join(", ")}`);if($.defaultValue!==void 0)q.push(`default: ${$.defaultValueDescription||JSON.stringify($.defaultValue)}`);if(q.length>0){let z=`(${q.join(", ")})`;if($.description)return`${$.description} ${z}`;return z}return $.description}formatItemList($,q,z){if(q.length===0)return[];return[z.styleTitle($),...q,""]}groupItems($,q,z){let X=new Map;return $.forEach((Z)=>{let H=z(Z);if(!X.has(H))X.set(H,[])}),q.forEach((Z)=>{let H=z(Z);if(!X.has(H))X.set(H,[]);X.get(H).push(Z)}),X}formatHelp($,q){let z=q.padWidth($,q),X=q.helpWidth??80;function Z(B,G){return q.formatItem(B,z,G,q)}let H=[`${q.styleTitle("Usage:")} ${q.styleUsage(q.commandUsage($))}`,""],Q=q.commandDescription($);if(Q.length>0)H=H.concat([q.boxWrap(q.styleCommandDescription(Q),X),""]);let J=q.visibleArguments($).map((B)=>{return Z(q.styleArgumentTerm(q.argumentTerm(B)),q.styleArgumentDescription(q.argumentDescription(B)))});if(H=H.concat(this.formatItemList("Arguments:",J,q)),this.groupItems($.options,q.visibleOptions($),(B)=>B.helpGroupHeading??"Options:").forEach((B,G)=>{let T=B.map((L)=>{return Z(q.styleOptionTerm(q.optionTerm(L)),q.styleOptionDescription(q.optionDescription(L)))});H=H.concat(this.formatItemList(G,T,q))}),q.showGlobalOptions){let B=q.visibleGlobalOptions($).map((G)=>{return Z(q.styleOptionTerm(q.optionTerm(G)),q.styleOptionDescription(q.optionDescription(G)))});H=H.concat(this.formatItemList("Global Options:",B,q))}return this.groupItems($.commands,q.visibleCommands($),(B)=>B.helpGroup()||"Commands:").forEach((B,G)=>{let T=B.map((L)=>{return Z(q.styleSubcommandTerm(q.subcommandTerm(L)),q.styleSubcommandDescription(q.subcommandDescription(L)))});H=H.concat(this.formatItemList(G,T,q))}),H.join(`
4
+ `)}displayWidth($){return $2($).length}styleTitle($){return $}styleUsage($){return $.split(" ").map((q)=>{if(q==="[options]")return this.styleOptionText(q);if(q==="[command]")return this.styleSubcommandText(q);if(q[0]==="["||q[0]==="<")return this.styleArgumentText(q);return this.styleCommandText(q)}).join(" ")}styleCommandDescription($){return this.styleDescriptionText($)}styleOptionDescription($){return this.styleDescriptionText($)}styleSubcommandDescription($){return this.styleDescriptionText($)}styleArgumentDescription($){return this.styleDescriptionText($)}styleDescriptionText($){return $}styleOptionTerm($){return this.styleOptionText($)}styleSubcommandTerm($){return $.split(" ").map((q)=>{if(q==="[options]")return this.styleOptionText(q);if(q[0]==="["||q[0]==="<")return this.styleArgumentText(q);return this.styleSubcommandText(q)}).join(" ")}styleArgumentTerm($){return this.styleArgumentText($)}styleOptionText($){return $}styleArgumentText($){return $}styleSubcommandText($){return $}styleCommandText($){return $}padWidth($,q){return Math.max(q.longestOptionTermLength($,q),q.longestGlobalOptionTermLength($,q),q.longestSubcommandTermLength($,q),q.longestArgumentTermLength($,q))}preformatted($){return/\n[^\S\r\n]/.test($)}formatItem($,q,z,X){let H=" ".repeat(2);if(!z)return H+$;let Q=$.padEnd(q+$.length-X.displayWidth($)),J=2,U=(this.helpWidth??80)-q-J-2,B;if(U<this.minWidthToWrap||X.preformatted(z))B=z;else B=X.boxWrap(z,U).replace(/\n/g,`
5
+ `+" ".repeat(q+J));return H+Q+" ".repeat(J)+B.replace(/\n/g,`
6
+ ${H}`)}boxWrap($,q){if(q<this.minWidthToWrap)return $;let z=$.split(/\r\n|\n/),X=/[\s]*[^\s]+/g,Z=[];return z.forEach((H)=>{let Q=H.match(X);if(Q===null){Z.push("");return}let J=[Q.shift()],Y=this.displayWidth(J[0]);Q.forEach((U)=>{let B=this.displayWidth(U);if(Y+B<=q){J.push(U),Y+=B;return}Z.push(J.join(""));let G=U.trimStart();J=[G],Y=this.displayWidth(G)}),Z.push(J.join(""))}),Z.join(`
7
+ `)}}function $2($){let q=/\x1b\[\d*(;\d*)*m/g;return $.replace(q,"")}T5.Help=e1;T5.stripColor=$2});var Tq=D((D5)=>{var{InvalidArgumentError:V5}=C0();class z2{constructor($,q){this.flags=$,this.description=q||"",this.required=$.includes("<"),this.optional=$.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test($),this.mandatory=!1;let z=_5($);if(this.short=z.shortFlag,this.long=z.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){return this.defaultValue=$,this.defaultValueDescription=q,this}preset($){return this.presetArg=$,this}conflicts($){return this.conflictsWith=this.conflictsWith.concat($),this}implies($){let q=$;if(typeof $==="string")q={[$]:!0};return this.implied=Object.assign(this.implied||{},q),this}env($){return this.envVar=$,this}argParser($){return this.parseArg=$,this}makeOptionMandatory($=!0){return this.mandatory=!!$,this}hideHelp($=!0){return this.hidden=!!$,this}_collectValue($,q){if(q===this.defaultValue||!Array.isArray(q))return[$];return q.push($),q}choices($){return this.argChoices=$.slice(),this.parseArg=(q,z)=>{if(!this.argChoices.includes(q))throw new V5(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(q,z);return q},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return q2(this.name().replace(/^no-/,""));return q2(this.name())}helpGroup($){return this.helpGroupHeading=$,this}is($){return this.short===$||this.long===$}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class X2{constructor($){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,$.forEach((q)=>{if(q.negate)this.negativeOptions.set(q.attributeName(),q);else this.positiveOptions.set(q.attributeName(),q)}),this.negativeOptions.forEach((q,z)=>{if(this.positiveOptions.has(z))this.dualOptions.add(z)})}valueFromOption($,q){let z=q.attributeName();if(!this.dualOptions.has(z))return!0;let X=this.negativeOptions.get(z).presetArg,Z=X!==void 0?X:!1;return q.negate===(Z===$)}}function q2($){return $.split("-").reduce((q,z)=>{return q+z[0].toUpperCase()+z.slice(1)})}function _5($){let q,z,X=/^-[^-]$/,Z=/^--[^-]/,H=$.split(/[ |,]+/).concat("guard");if(X.test(H[0]))q=H.shift();if(Z.test(H[0]))z=H.shift();if(!q&&X.test(H[0]))q=H.shift();if(!q&&Z.test(H[0]))q=z,z=H.shift();if(H[0].startsWith("-")){let Q=H[0],J=`option creation failed due to '${Q}' in option flags '${$}'`;if(/^-[^-][^-]/.test(Q))throw Error(`${J}
8
8
  - a short flag is a single dash and a single character
9
9
  - either use a single dash and a single character (for a short flag)
10
- - or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(Z.test(U))throw Error(`${Q}
11
- - too many short flags`);if(H.test(U))throw Error(`${Q}
12
- - too many long flags`);throw Error(`${Q}
13
- - unrecognised flag format`)}if($===void 0&&X===void 0)throw Error(`option creation failed due to no flags found in '${q}'.`);return{shortFlag:$,longFlag:X}}W5.Option=$2;W5.DualOptions=X2});var Z2=I((P5)=>{function D5(q,$){if(Math.abs(q.length-$.length)>3)return Math.max(q.length,$.length);let X=[];for(let Z=0;Z<=q.length;Z++)X[Z]=[Z];for(let Z=0;Z<=$.length;Z++)X[0][Z]=Z;for(let Z=1;Z<=$.length;Z++)for(let H=1;H<=q.length;H++){let z=1;if(q[H-1]===$[Z-1])z=0;else z=1;if(X[H][Z]=Math.min(X[H-1][Z]+1,X[H][Z-1]+1,X[H-1][Z-1]+z),H>1&&Z>1&&q[H-1]===$[Z-2]&&q[H-2]===$[Z-1])X[H][Z]=Math.min(X[H][Z],X[H-2][Z-2]+1)}return X[q.length][$.length]}function R5(q,$){if(!$||$.length===0)return"";$=Array.from(new Set($));let X=q.startsWith("--");if(X)q=q.slice(2),$=$.map((U)=>U.slice(2));let Z=[],H=3,z=0.4;if($.forEach((U)=>{if(U.length<=1)return;let Q=D5(q,U),J=Math.max(q.length,U.length);if((J-Q)/J>z){if(Q<H)H=Q,Z=[U];else if(Q===H)Z.push(U)}}),Z.sort((U,Q)=>U.localeCompare(Q)),X)Z=Z.map((U)=>`--${U}`);if(Z.length>1)return`
14
- (Did you mean one of ${Z.join(", ")}?)`;if(Z.length===1)return`
15
- (Did you mean ${Z[0]}?)`;return""}P5.suggestSimilar=R5});var Q2=I((j5)=>{var K5=c("events").EventEmitter,L$=c("child_process"),i=c("path"),zq=c("fs"),S=c("process"),{Argument:w5,humanReadableArgName:F5}=Hq(),{CommanderError:B$}=E0(),{Help:O5,stripColor:A5}=T$(),{Option:H2,DualOptions:S5}=Y$(),{suggestSimilar:z2}=Z2();class W$ extends K5{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:($)=>S.stdout.write($),writeErr:($)=>S.stderr.write($),outputError:($,X)=>X($),getOutHelpWidth:()=>S.stdout.isTTY?S.stdout.columns:void 0,getErrHelpWidth:()=>S.stderr.isTTY?S.stderr.columns:void 0,getOutHasColors:()=>_$()??(S.stdout.isTTY&&S.stdout.hasColors?.()),getErrHasColors:()=>_$()??(S.stderr.isTTY&&S.stderr.hasColors?.()),stripColor:($)=>A5($)},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 $=this;$;$=$.parent)q.push($);return q}command(q,$,X){let Z=$,H=X;if(typeof Z==="object"&&Z!==null)H=Z,Z=null;H=H||{};let[,z,U]=q.match(/([^ ]+) *(.*)/),Q=this.createCommand(z);if(Z)Q.description(Z),Q._executableHandler=!0;if(H.isDefault)this._defaultCommandName=Q._name;if(Q._hidden=!!(H.noHelp||H.hidden),Q._executableFile=H.executableFile||null,U)Q.arguments(U);if(this._registerCommand(Q),Q.parent=this,Q.copyInheritedSettings(this),Z)return this;return Q}createCommand(q){return new W$(q)}createHelp(){return Object.assign(new O5,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,$){if(!q._name)throw Error(`Command passed to .addCommand() must have a name
16
- - specify the name in Command constructor or using .name()`);if($=$||{},$.isDefault)this._defaultCommandName=q._name;if($.noHelp||$.hidden)q._hidden=!0;return this._registerCommand(q),q.parent=this,q._checkForBrokenPassThrough(),this}createArgument(q,$){return new w5(q,$)}argument(q,$,X,Z){let H=this.createArgument(q,$);if(typeof X==="function")H.default(Z).argParser(X);else H.default(X);return this.addArgument(H),this}arguments(q){return q.trim().split(/ +/).forEach(($)=>{this.argument($)}),this}addArgument(q){let $=this.registeredArguments.slice(-1)[0];if($?.variadic)throw Error(`only the last argument can be variadic '${$.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,$){if(typeof q==="boolean"){if(this._addImplicitHelpCommand=q,q&&this._defaultCommandGroup)this._initCommandGroup(this._getHelpCommand());return this}let X=q??"help [command]",[,Z,H]=X.match(/([^ ]+) *(.*)/),z=$??"display help for command",U=this.createCommand(Z);if(U.helpOption(!1),H)U.arguments(H);if(z)U.description(z);if(this._addImplicitHelpCommand=!0,this._helpCommand=U,q||$)this._initCommandGroup(U);return this}addHelpCommand(q,$){if(typeof q!=="object")return this.helpCommand(q,$),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,$){let X=["preSubcommand","preAction","postAction"];if(!X.includes(q))throw Error(`Unexpected value for event passed to hook : '${q}'.
17
- Expecting one of '${X.join("', '")}'`);if(this._lifeCycleHooks[q])this._lifeCycleHooks[q].push($);else this._lifeCycleHooks[q]=[$];return this}exitOverride(q){if(q)this._exitCallback=q;else this._exitCallback=($)=>{if($.code!=="commander.executeSubCommandAsync")throw $};return this}_exit(q,$,X){if(this._exitCallback)this._exitCallback(new B$(q,$,X));S.exit(q)}action(q){let $=(X)=>{let Z=this.registeredArguments.length,H=X.slice(0,Z);if(this._storeOptionsAsProperties)H[Z]=this;else H[Z]=this.opts();return H.push(this),q.apply(this,H)};return this._actionHandler=$,this}createOption(q,$){return new H2(q,$)}_callParseArg(q,$,X,Z){try{return q.parseArg($,X)}catch(H){if(H.code==="commander.invalidArgument"){let z=`${Z} ${H.message}`;this.error(z,{exitCode:H.exitCode,code:H.code})}throw H}}_registerOption(q){let $=q.short&&this._findOption(q.short)||q.long&&this._findOption(q.long);if($){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}'
18
- - already used by option '${$.flags}'`)}this._initOptionGroup(q),this.options.push(q)}_registerCommand(q){let $=(Z)=>{return[Z.name()].concat(Z.aliases())},X=$(q).find((Z)=>this._findCommand(Z));if(X){let Z=$(this._findCommand(X)).join("|"),H=$(q).join("|");throw Error(`cannot add command '${H}' as already have command '${Z}'`)}this._initCommandGroup(q),this.commands.push(q)}addOption(q){this._registerOption(q);let $=q.name(),X=q.attributeName();if(q.negate){let H=q.long.replace(/^--no-/,"--");if(!this._findOption(H))this.setOptionValueWithSource(X,q.defaultValue===void 0?!0:q.defaultValue,"default")}else if(q.defaultValue!==void 0)this.setOptionValueWithSource(X,q.defaultValue,"default");let Z=(H,z,U)=>{if(H==null&&q.presetArg!==void 0)H=q.presetArg;let Q=this.getOptionValue(X);if(H!==null&&q.parseArg)H=this._callParseArg(q,H,Q,z);else if(H!==null&&q.variadic)H=q._collectValue(H,Q);if(H==null)if(q.negate)H=!1;else if(q.isBoolean()||q.optional)H=!0;else H="";this.setOptionValueWithSource(X,H,U)};if(this.on("option:"+$,(H)=>{let z=`error: option '${q.flags}' argument '${H}' is invalid.`;Z(H,z,"cli")}),q.envVar)this.on("optionEnv:"+$,(H)=>{let z=`error: option '${q.flags}' value '${H}' from env '${q.envVar}' is invalid.`;Z(H,z,"env")});return this}_optionEx(q,$,X,Z,H){if(typeof $==="object"&&$ instanceof H2)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let z=this.createOption($,X);if(z.makeOptionMandatory(!!q.mandatory),typeof Z==="function")z.default(H).argParser(Z);else if(Z instanceof RegExp){let U=Z;Z=(Q,J)=>{let G=U.exec(Q);return G?G[0]:J},z.default(H).argParser(Z)}else z.default(Z);return this.addOption(z)}option(q,$,X,Z){return this._optionEx({},q,$,X,Z)}requiredOption(q,$,X,Z){return this._optionEx({mandatory:!0},q,$,X,Z)}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,$){return this.setOptionValueWithSource(q,$,void 0)}setOptionValueWithSource(q,$,X){if(this._storeOptionsAsProperties)this[q]=$;else this._optionValues[q]=$;return this._optionValueSources[q]=X,this}getOptionValueSource(q){return this._optionValueSources[q]}getOptionValueSourceWithGlobals(q){let $;return this._getCommandAndAncestors().forEach((X)=>{if(X.getOptionValueSource(q)!==void 0)$=X.getOptionValueSource(q)}),$}_prepareUserArgs(q,$){if(q!==void 0&&!Array.isArray(q))throw Error("first parameter to parse must be array or undefined");if($=$||{},q===void 0&&$.from===void 0){if(S.versions?.electron)$.from="electron";let Z=S.execArgv??[];if(Z.includes("-e")||Z.includes("--eval")||Z.includes("-p")||Z.includes("--print"))$.from="eval"}if(q===void 0)q=S.argv;this.rawArgs=q.slice();let X;switch($.from){case void 0:case"node":this._scriptPath=q[1],X=q.slice(2);break;case"electron":if(S.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: '${$.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",X}parse(q,$){this._prepareForParse();let X=this._prepareUserArgs(q,$);return this._parseCommand([],X),this}async parseAsync(q,$){this._prepareForParse();let X=this._prepareUserArgs(q,$);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.
19
- - 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,$,X){if(zq.existsSync(q))return;let Z=$?`searched for local subcommand relative to directory '${$}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",H=`'${q}' does not exist
20
- - if '${X}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
10
+ - or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(X.test(Q))throw Error(`${J}
11
+ - too many short flags`);if(Z.test(Q))throw Error(`${J}
12
+ - too many long flags`);throw Error(`${J}
13
+ - unrecognised flag format`)}if(q===void 0&&z===void 0)throw Error(`option creation failed due to no flags found in '${$}'.`);return{shortFlag:q,longFlag:z}}D5.Option=z2;D5.DualOptions=X2});var Z2=D((P5)=>{function w5($,q){if(Math.abs($.length-q.length)>3)return Math.max($.length,q.length);let z=[];for(let X=0;X<=$.length;X++)z[X]=[X];for(let X=0;X<=q.length;X++)z[0][X]=X;for(let X=1;X<=q.length;X++)for(let Z=1;Z<=$.length;Z++){let H=1;if($[Z-1]===q[X-1])H=0;else H=1;if(z[Z][X]=Math.min(z[Z-1][X]+1,z[Z][X-1]+1,z[Z-1][X-1]+H),Z>1&&X>1&&$[Z-1]===q[X-2]&&$[Z-2]===q[X-1])z[Z][X]=Math.min(z[Z][X],z[Z-2][X-2]+1)}return z[$.length][q.length]}function M5($,q){if(!q||q.length===0)return"";q=Array.from(new Set(q));let z=$.startsWith("--");if(z)$=$.slice(2),q=q.map((Q)=>Q.slice(2));let X=[],Z=3,H=0.4;if(q.forEach((Q)=>{if(Q.length<=1)return;let J=w5($,Q),Y=Math.max($.length,Q.length);if((Y-J)/Y>H){if(J<Z)Z=J,X=[Q];else if(J===Z)X.push(Q)}}),X.sort((Q,J)=>Q.localeCompare(J)),z)X=X.map((Q)=>`--${Q}`);if(X.length>1)return`
14
+ (Did you mean one of ${X.join(", ")}?)`;if(X.length===1)return`
15
+ (Did you mean ${X[0]}?)`;return""}P5.suggestSimilar=M5});var U2=D((E5)=>{var F5=c("events").EventEmitter,Wq=c("child_process"),i=c("path"),U$=c("fs"),S=c("process"),{Argument:O5,humanReadableArgName:A5}=J$(),{CommanderError:Lq}=C0(),{Help:S5,stripColor:j5}=Bq(),{Option:H2,DualOptions:N5}=Tq(),{suggestSimilar:Q2}=Z2();class _q extends F5{constructor($){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=$||"",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:(q)=>S.stdout.write(q),writeErr:(q)=>S.stderr.write(q),outputError:(q,z)=>z(q),getOutHelpWidth:()=>S.stdout.isTTY?S.stdout.columns:void 0,getErrHelpWidth:()=>S.stderr.isTTY?S.stderr.columns:void 0,getOutHasColors:()=>Vq()??(S.stdout.isTTY&&S.stdout.hasColors?.()),getErrHasColors:()=>Vq()??(S.stderr.isTTY&&S.stderr.hasColors?.()),stripColor:(q)=>j5(q)},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($){return this._outputConfiguration=$._outputConfiguration,this._helpOption=$._helpOption,this._helpCommand=$._helpCommand,this._helpConfiguration=$._helpConfiguration,this._exitCallback=$._exitCallback,this._storeOptionsAsProperties=$._storeOptionsAsProperties,this._combineFlagAndOptionalValue=$._combineFlagAndOptionalValue,this._allowExcessArguments=$._allowExcessArguments,this._enablePositionalOptions=$._enablePositionalOptions,this._showHelpAfterError=$._showHelpAfterError,this._showSuggestionAfterError=$._showSuggestionAfterError,this}_getCommandAndAncestors(){let $=[];for(let q=this;q;q=q.parent)$.push(q);return $}command($,q,z){let X=q,Z=z;if(typeof X==="object"&&X!==null)Z=X,X=null;Z=Z||{};let[,H,Q]=$.match(/([^ ]+) *(.*)/),J=this.createCommand(H);if(X)J.description(X),J._executableHandler=!0;if(Z.isDefault)this._defaultCommandName=J._name;if(J._hidden=!!(Z.noHelp||Z.hidden),J._executableFile=Z.executableFile||null,Q)J.arguments(Q);if(this._registerCommand(J),J.parent=this,J.copyInheritedSettings(this),X)return this;return J}createCommand($){return new _q($)}createHelp(){return Object.assign(new S5,this.configureHelp())}configureHelp($){if($===void 0)return this._helpConfiguration;return this._helpConfiguration=$,this}configureOutput($){if($===void 0)return this._outputConfiguration;return this._outputConfiguration={...this._outputConfiguration,...$},this}showHelpAfterError($=!0){if(typeof $!=="string")$=!!$;return this._showHelpAfterError=$,this}showSuggestionAfterError($=!0){return this._showSuggestionAfterError=!!$,this}addCommand($,q){if(!$._name)throw Error(`Command passed to .addCommand() must have a name
16
+ - specify the name in Command constructor or using .name()`);if(q=q||{},q.isDefault)this._defaultCommandName=$._name;if(q.noHelp||q.hidden)$._hidden=!0;return this._registerCommand($),$.parent=this,$._checkForBrokenPassThrough(),this}createArgument($,q){return new O5($,q)}argument($,q,z,X){let Z=this.createArgument($,q);if(typeof z==="function")Z.default(X).argParser(z);else Z.default(z);return this.addArgument(Z),this}arguments($){return $.trim().split(/ +/).forEach((q)=>{this.argument(q)}),this}addArgument($){let q=this.registeredArguments.slice(-1)[0];if(q?.variadic)throw Error(`only the last argument can be variadic '${q.name()}'`);if($.required&&$.defaultValue!==void 0&&$.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${$.name()}'`);return this.registeredArguments.push($),this}helpCommand($,q){if(typeof $==="boolean"){if(this._addImplicitHelpCommand=$,$&&this._defaultCommandGroup)this._initCommandGroup(this._getHelpCommand());return this}let z=$??"help [command]",[,X,Z]=z.match(/([^ ]+) *(.*)/),H=q??"display help for command",Q=this.createCommand(X);if(Q.helpOption(!1),Z)Q.arguments(Z);if(H)Q.description(H);if(this._addImplicitHelpCommand=!0,this._helpCommand=Q,$||q)this._initCommandGroup(Q);return this}addHelpCommand($,q){if(typeof $!=="object")return this.helpCommand($,q),this;return this._addImplicitHelpCommand=!0,this._helpCommand=$,this._initCommandGroup($),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){let z=["preSubcommand","preAction","postAction"];if(!z.includes($))throw Error(`Unexpected value for event passed to hook : '${$}'.
17
+ Expecting one of '${z.join("', '")}'`);if(this._lifeCycleHooks[$])this._lifeCycleHooks[$].push(q);else this._lifeCycleHooks[$]=[q];return this}exitOverride($){if($)this._exitCallback=$;else this._exitCallback=(q)=>{if(q.code!=="commander.executeSubCommandAsync")throw q};return this}_exit($,q,z){if(this._exitCallback)this._exitCallback(new Lq($,q,z));S.exit($)}action($){let q=(z)=>{let X=this.registeredArguments.length,Z=z.slice(0,X);if(this._storeOptionsAsProperties)Z[X]=this;else Z[X]=this.opts();return Z.push(this),$.apply(this,Z)};return this._actionHandler=q,this}createOption($,q){return new H2($,q)}_callParseArg($,q,z,X){try{return $.parseArg(q,z)}catch(Z){if(Z.code==="commander.invalidArgument"){let H=`${X} ${Z.message}`;this.error(H,{exitCode:Z.exitCode,code:Z.code})}throw Z}}_registerOption($){let q=$.short&&this._findOption($.short)||$.long&&this._findOption($.long);if(q){let z=$.long&&this._findOption($.long)?$.long:$.short;throw Error(`Cannot add option '${$.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${z}'
18
+ - already used by option '${q.flags}'`)}this._initOptionGroup($),this.options.push($)}_registerCommand($){let q=(X)=>{return[X.name()].concat(X.aliases())},z=q($).find((X)=>this._findCommand(X));if(z){let X=q(this._findCommand(z)).join("|"),Z=q($).join("|");throw Error(`cannot add command '${Z}' as already have command '${X}'`)}this._initCommandGroup($),this.commands.push($)}addOption($){this._registerOption($);let q=$.name(),z=$.attributeName();if($.negate){let Z=$.long.replace(/^--no-/,"--");if(!this._findOption(Z))this.setOptionValueWithSource(z,$.defaultValue===void 0?!0:$.defaultValue,"default")}else if($.defaultValue!==void 0)this.setOptionValueWithSource(z,$.defaultValue,"default");let X=(Z,H,Q)=>{if(Z==null&&$.presetArg!==void 0)Z=$.presetArg;let J=this.getOptionValue(z);if(Z!==null&&$.parseArg)Z=this._callParseArg($,Z,J,H);else if(Z!==null&&$.variadic)Z=$._collectValue(Z,J);if(Z==null)if($.negate)Z=!1;else if($.isBoolean()||$.optional)Z=!0;else Z="";this.setOptionValueWithSource(z,Z,Q)};if(this.on("option:"+q,(Z)=>{let H=`error: option '${$.flags}' argument '${Z}' is invalid.`;X(Z,H,"cli")}),$.envVar)this.on("optionEnv:"+q,(Z)=>{let H=`error: option '${$.flags}' value '${Z}' from env '${$.envVar}' is invalid.`;X(Z,H,"env")});return this}_optionEx($,q,z,X,Z){if(typeof q==="object"&&q instanceof H2)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let H=this.createOption(q,z);if(H.makeOptionMandatory(!!$.mandatory),typeof X==="function")H.default(Z).argParser(X);else if(X instanceof RegExp){let Q=X;X=(J,Y)=>{let U=Q.exec(J);return U?U[0]:Y},H.default(Z).argParser(X)}else H.default(X);return this.addOption(H)}option($,q,z,X){return this._optionEx({},$,q,z,X)}requiredOption($,q,z,X){return this._optionEx({mandatory:!0},$,q,z,X)}combineFlagAndOptionalValue($=!0){return this._combineFlagAndOptionalValue=!!$,this}allowUnknownOption($=!0){return this._allowUnknownOption=!!$,this}allowExcessArguments($=!0){return this._allowExcessArguments=!!$,this}enablePositionalOptions($=!0){return this._enablePositionalOptions=!!$,this}passThroughOptions($=!0){return this._passThroughOptions=!!$,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($=!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=!!$,this}getOptionValue($){if(this._storeOptionsAsProperties)return this[$];return this._optionValues[$]}setOptionValue($,q){return this.setOptionValueWithSource($,q,void 0)}setOptionValueWithSource($,q,z){if(this._storeOptionsAsProperties)this[$]=q;else this._optionValues[$]=q;return this._optionValueSources[$]=z,this}getOptionValueSource($){return this._optionValueSources[$]}getOptionValueSourceWithGlobals($){let q;return this._getCommandAndAncestors().forEach((z)=>{if(z.getOptionValueSource($)!==void 0)q=z.getOptionValueSource($)}),q}_prepareUserArgs($,q){if($!==void 0&&!Array.isArray($))throw Error("first parameter to parse must be array or undefined");if(q=q||{},$===void 0&&q.from===void 0){if(S.versions?.electron)q.from="electron";let X=S.execArgv??[];if(X.includes("-e")||X.includes("--eval")||X.includes("-p")||X.includes("--print"))q.from="eval"}if($===void 0)$=S.argv;this.rawArgs=$.slice();let z;switch(q.from){case void 0:case"node":this._scriptPath=$[1],z=$.slice(2);break;case"electron":if(S.defaultApp)this._scriptPath=$[1],z=$.slice(2);else z=$.slice(1);break;case"user":z=$.slice(0);break;case"eval":z=$.slice(1);break;default:throw Error(`unexpected parse option { from: '${q.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",z}parse($,q){this._prepareForParse();let z=this._prepareUserArgs($,q);return this._parseCommand([],z),this}async parseAsync($,q){this._prepareForParse();let z=this._prepareUserArgs($,q);return await this._parseCommand([],z),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.
19
+ - 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){if(U$.existsSync($))return;let X=q?`searched for local subcommand relative to directory '${q}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",Z=`'${$}' does not exist
20
+ - if '${z}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
21
21
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
22
- - ${Z}`;throw Error(H)}_executeSubCommand(q,$){$=$.slice();let X=!1,Z=[".js",".ts",".tsx",".mjs",".cjs"];function H(G,Y){let T=i.resolve(G,Y);if(zq.existsSync(T))return T;if(Z.includes(i.extname(Y)))return;let L=Z.find((_)=>zq.existsSync(`${T}${_}`));if(L)return`${T}${L}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let z=q._executableFile||`${this._name}-${q._name}`,U=this._executableDir||"";if(this._scriptPath){let G;try{G=zq.realpathSync(this._scriptPath)}catch{G=this._scriptPath}U=i.resolve(i.dirname(G),U)}if(U){let G=H(U,z);if(!G&&!q._executableFile&&this._scriptPath){let Y=i.basename(this._scriptPath,i.extname(this._scriptPath));if(Y!==this._name)G=H(U,`${Y}-${q._name}`)}z=G||z}X=Z.includes(i.extname(z));let Q;if(S.platform!=="win32")if(X)$.unshift(z),$=U2(S.execArgv).concat($),Q=L$.spawn(S.argv[0],$,{stdio:"inherit"});else Q=L$.spawn(z,$,{stdio:"inherit"});else this._checkForMissingExecutable(z,U,q._name),$.unshift(z),$=U2(S.execArgv).concat($),Q=L$.spawn(S.execPath,$,{stdio:"inherit"});if(!Q.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((Y)=>{S.on(Y,()=>{if(Q.killed===!1&&Q.exitCode===null)Q.kill(Y)})});let J=this._exitCallback;Q.on("close",(G)=>{if(G=G??1,!J)S.exit(G);else J(new B$(G,"commander.executeSubCommandAsync","(close)"))}),Q.on("error",(G)=>{if(G.code==="ENOENT")this._checkForMissingExecutable(z,U,q._name);else if(G.code==="EACCES")throw Error(`'${z}' not executable`);if(!J)S.exit(1);else{let Y=new B$(1,"commander.executeSubCommandAsync","(error)");Y.nestedError=G,J(Y)}}),this.runningCommand=Q}_dispatchSubcommand(q,$,X){let Z=this._findCommand(q);if(!Z)this.help({error:!0});Z._prepareForParse();let H;return H=this._chainOrCallSubCommandHook(H,Z,"preSubcommand"),H=this._chainOrCall(H,()=>{if(Z._executableHandler)this._executeSubCommand(Z,$.concat(X));else return Z._parseCommand($,X)}),H}_dispatchHelpCommand(q){if(!q)this.help();let $=this._findCommand(q);if($&&!$._executableHandler)$.help();return this._dispatchSubcommand(q,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach((q,$)=>{if(q.required&&this.args[$]==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,Z,H)=>{let z=Z;if(Z!==null&&X.parseArg){let U=`error: command-argument value '${Z}' is invalid for argument '${X.name()}'.`;z=this._callParseArg(X,Z,H,U)}return z};this._checkNumberOfArguments();let $=[];this.registeredArguments.forEach((X,Z)=>{let H=X.defaultValue;if(X.variadic){if(Z<this.args.length){if(H=this.args.slice(Z),X.parseArg)H=H.reduce((z,U)=>{return q(X,U,z)},X.defaultValue)}else if(H===void 0)H=[]}else if(Z<this.args.length){if(H=this.args[Z],X.parseArg)H=q(X,H,X.defaultValue)}$[Z]=H}),this.processedArgs=$}_chainOrCall(q,$){if(q?.then&&typeof q.then==="function")return q.then(()=>$());return $()}_chainOrCallHooks(q,$){let X=q,Z=[];if(this._getCommandAndAncestors().reverse().filter((H)=>H._lifeCycleHooks[$]!==void 0).forEach((H)=>{H._lifeCycleHooks[$].forEach((z)=>{Z.push({hookedCommand:H,callback:z})})}),$==="postAction")Z.reverse();return Z.forEach((H)=>{X=this._chainOrCall(X,()=>{return H.callback(H.hookedCommand,this)})}),X}_chainOrCallSubCommandHook(q,$,X){let Z=q;if(this._lifeCycleHooks[X]!==void 0)this._lifeCycleHooks[X].forEach((H)=>{Z=this._chainOrCall(Z,()=>{return H(this,$)})});return Z}_parseCommand(q,$){let X=this.parseOptions($);if(this._parseOptionsEnv(),this._parseOptionsImplied(),q=q.concat(X.operands),$=X.unknown,this.args=q.concat($),q&&this._findCommand(q[0]))return this._dispatchSubcommand(q[0],q.slice(1),$);if(this._getHelpCommand()&&q[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(q[1]);if(this._defaultCommandName)return this._outputHelpIfRequested($),this._dispatchSubcommand(this._defaultCommandName,q,$);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 Z=()=>{if(X.unknown.length>0)this.unknownOption(X.unknown[0])},H=`command:${this.name()}`;if(this._actionHandler){Z(),this._processArguments();let z;if(z=this._chainOrCallHooks(z,"preAction"),z=this._chainOrCall(z,()=>this._actionHandler(this.processedArgs)),this.parent)z=this._chainOrCall(z,()=>{this.parent.emit(H,q,$)});return z=this._chainOrCallHooks(z,"postAction"),z}if(this.parent?.listenerCount(H))Z(),this._processArguments(),this.parent.emit(H,q,$);else if(q.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",q,$);if(this.listenerCount("command:*"))this.emit("command:*",q,$);else if(this.commands.length)this.unknownCommand();else Z(),this._processArguments()}else if(this.commands.length)Z(),this.help({error:!0});else Z(),this._processArguments()}_findCommand(q){if(!q)return;return this.commands.find(($)=>$._name===q||$._aliases.includes(q))}_findOption(q){return this.options.find(($)=>$.is(q))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach((q)=>{q.options.forEach(($)=>{if($.mandatory&&q.getOptionValue($.attributeName())===void 0)q.missingMandatoryOptionValue($)})})}_checkForConflictingLocalOptions(){let q=this.options.filter((X)=>{let Z=X.attributeName();if(this.getOptionValue(Z)===void 0)return!1;return this.getOptionValueSource(Z)!=="default"});q.filter((X)=>X.conflictsWith.length>0).forEach((X)=>{let Z=q.find((H)=>X.conflictsWith.includes(H.attributeName()));if(Z)this._conflictingOption(X,Z)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((q)=>{q._checkForConflictingLocalOptions()})}parseOptions(q){let $=[],X=[],Z=$;function H(G){return G.length>1&&G[0]==="-"}let z=(G)=>{if(!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(G))return!1;return!this._getCommandAndAncestors().some((Y)=>Y.options.map((T)=>T.short).some((T)=>/^-\d$/.test(T)))},U=null,Q=null,J=0;while(J<q.length||Q){let G=Q??q[J++];if(Q=null,G==="--"){if(Z===X)Z.push(G);Z.push(...q.slice(J));break}if(U&&(!H(G)||z(G))){this.emit(`option:${U.name()}`,G);continue}if(U=null,H(G)){let Y=this._findOption(G);if(Y){if(Y.required){let T=q[J++];if(T===void 0)this.optionMissingArgument(Y);this.emit(`option:${Y.name()}`,T)}else if(Y.optional){let T=null;if(J<q.length&&(!H(q[J])||z(q[J])))T=q[J++];this.emit(`option:${Y.name()}`,T)}else this.emit(`option:${Y.name()}`);U=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()}`),Q=`-${G.slice(2)}`;continue}}if(/^--[^=]+=/.test(G)){let Y=G.indexOf("="),T=this._findOption(G.slice(0,Y));if(T&&(T.required||T.optional)){this.emit(`option:${T.name()}`,G.slice(Y+1));continue}}if(Z===$&&H(G)&&!(this.commands.length===0&&z(G)))Z=X;if((this._enablePositionalOptions||this._passThroughOptions)&&$.length===0&&X.length===0){if(this._findCommand(G)){$.push(G),X.push(...q.slice(J));break}else if(this._getHelpCommand()&&G===this._getHelpCommand().name()){$.push(G,...q.slice(J));break}else if(this._defaultCommandName){X.push(G,...q.slice(J));break}}if(this._passThroughOptions){Z.push(G,...q.slice(J));break}Z.push(G)}return{operands:$,unknown:X}}opts(){if(this._storeOptionsAsProperties){let q={},$=this.options.length;for(let X=0;X<$;X++){let Z=this.options[X].attributeName();q[Z]=Z===this._versionOptionName?this._version:this[Z]}return q}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((q,$)=>Object.assign(q,$.opts()),{})}error(q,$){if(this._outputConfiguration.outputError(`${q}
22
+ - ${X}`;throw Error(Z)}_executeSubCommand($,q){q=q.slice();let z=!1,X=[".js",".ts",".tsx",".mjs",".cjs"];function Z(U,B){let G=i.resolve(U,B);if(U$.existsSync(G))return G;if(X.includes(i.extname(B)))return;let T=X.find((L)=>U$.existsSync(`${G}${L}`));if(T)return`${G}${T}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let H=$._executableFile||`${this._name}-${$._name}`,Q=this._executableDir||"";if(this._scriptPath){let U;try{U=U$.realpathSync(this._scriptPath)}catch{U=this._scriptPath}Q=i.resolve(i.dirname(U),Q)}if(Q){let U=Z(Q,H);if(!U&&!$._executableFile&&this._scriptPath){let B=i.basename(this._scriptPath,i.extname(this._scriptPath));if(B!==this._name)U=Z(Q,`${B}-${$._name}`)}H=U||H}z=X.includes(i.extname(H));let J;if(S.platform!=="win32")if(z)q.unshift(H),q=J2(S.execArgv).concat(q),J=Wq.spawn(S.argv[0],q,{stdio:"inherit"});else J=Wq.spawn(H,q,{stdio:"inherit"});else this._checkForMissingExecutable(H,Q,$._name),q.unshift(H),q=J2(S.execArgv).concat(q),J=Wq.spawn(S.execPath,q,{stdio:"inherit"});if(!J.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((B)=>{S.on(B,()=>{if(J.killed===!1&&J.exitCode===null)J.kill(B)})});let Y=this._exitCallback;J.on("close",(U)=>{if(U=U??1,!Y)S.exit(U);else Y(new Lq(U,"commander.executeSubCommandAsync","(close)"))}),J.on("error",(U)=>{if(U.code==="ENOENT")this._checkForMissingExecutable(H,Q,$._name);else if(U.code==="EACCES")throw Error(`'${H}' not executable`);if(!Y)S.exit(1);else{let B=new Lq(1,"commander.executeSubCommandAsync","(error)");B.nestedError=U,Y(B)}}),this.runningCommand=J}_dispatchSubcommand($,q,z){let X=this._findCommand($);if(!X)this.help({error:!0});X._prepareForParse();let Z;return Z=this._chainOrCallSubCommandHook(Z,X,"preSubcommand"),Z=this._chainOrCall(Z,()=>{if(X._executableHandler)this._executeSubCommand(X,q.concat(z));else return X._parseCommand(q,z)}),Z}_dispatchHelpCommand($){if(!$)this.help();let q=this._findCommand($);if(q&&!q._executableHandler)q.help();return this._dispatchSubcommand($,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach(($,q)=>{if($.required&&this.args[q]==null)this.missingArgument($.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 $=(z,X,Z)=>{let H=X;if(X!==null&&z.parseArg){let Q=`error: command-argument value '${X}' is invalid for argument '${z.name()}'.`;H=this._callParseArg(z,X,Z,Q)}return H};this._checkNumberOfArguments();let q=[];this.registeredArguments.forEach((z,X)=>{let Z=z.defaultValue;if(z.variadic){if(X<this.args.length){if(Z=this.args.slice(X),z.parseArg)Z=Z.reduce((H,Q)=>{return $(z,Q,H)},z.defaultValue)}else if(Z===void 0)Z=[]}else if(X<this.args.length){if(Z=this.args[X],z.parseArg)Z=$(z,Z,z.defaultValue)}q[X]=Z}),this.processedArgs=q}_chainOrCall($,q){if($?.then&&typeof $.then==="function")return $.then(()=>q());return q()}_chainOrCallHooks($,q){let z=$,X=[];if(this._getCommandAndAncestors().reverse().filter((Z)=>Z._lifeCycleHooks[q]!==void 0).forEach((Z)=>{Z._lifeCycleHooks[q].forEach((H)=>{X.push({hookedCommand:Z,callback:H})})}),q==="postAction")X.reverse();return X.forEach((Z)=>{z=this._chainOrCall(z,()=>{return Z.callback(Z.hookedCommand,this)})}),z}_chainOrCallSubCommandHook($,q,z){let X=$;if(this._lifeCycleHooks[z]!==void 0)this._lifeCycleHooks[z].forEach((Z)=>{X=this._chainOrCall(X,()=>{return Z(this,q)})});return X}_parseCommand($,q){let z=this.parseOptions(q);if(this._parseOptionsEnv(),this._parseOptionsImplied(),$=$.concat(z.operands),q=z.unknown,this.args=$.concat(q),$&&this._findCommand($[0]))return this._dispatchSubcommand($[0],$.slice(1),q);if(this._getHelpCommand()&&$[0]===this._getHelpCommand().name())return this._dispatchHelpCommand($[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(q),this._dispatchSubcommand(this._defaultCommandName,$,q);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(z.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let X=()=>{if(z.unknown.length>0)this.unknownOption(z.unknown[0])},Z=`command:${this.name()}`;if(this._actionHandler){X(),this._processArguments();let H;if(H=this._chainOrCallHooks(H,"preAction"),H=this._chainOrCall(H,()=>this._actionHandler(this.processedArgs)),this.parent)H=this._chainOrCall(H,()=>{this.parent.emit(Z,$,q)});return H=this._chainOrCallHooks(H,"postAction"),H}if(this.parent?.listenerCount(Z))X(),this._processArguments(),this.parent.emit(Z,$,q);else if($.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",$,q);if(this.listenerCount("command:*"))this.emit("command:*",$,q);else if(this.commands.length)this.unknownCommand();else X(),this._processArguments()}else if(this.commands.length)X(),this.help({error:!0});else X(),this._processArguments()}_findCommand($){if(!$)return;return this.commands.find((q)=>q._name===$||q._aliases.includes($))}_findOption($){return this.options.find((q)=>q.is($))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(($)=>{$.options.forEach((q)=>{if(q.mandatory&&$.getOptionValue(q.attributeName())===void 0)$.missingMandatoryOptionValue(q)})})}_checkForConflictingLocalOptions(){let $=this.options.filter((z)=>{let X=z.attributeName();if(this.getOptionValue(X)===void 0)return!1;return this.getOptionValueSource(X)!=="default"});$.filter((z)=>z.conflictsWith.length>0).forEach((z)=>{let X=$.find((Z)=>z.conflictsWith.includes(Z.attributeName()));if(X)this._conflictingOption(z,X)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(($)=>{$._checkForConflictingLocalOptions()})}parseOptions($){let q=[],z=[],X=q;function Z(U){return U.length>1&&U[0]==="-"}let H=(U)=>{if(!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(U))return!1;return!this._getCommandAndAncestors().some((B)=>B.options.map((G)=>G.short).some((G)=>/^-\d$/.test(G)))},Q=null,J=null,Y=0;while(Y<$.length||J){let U=J??$[Y++];if(J=null,U==="--"){if(X===z)X.push(U);X.push(...$.slice(Y));break}if(Q&&(!Z(U)||H(U))){this.emit(`option:${Q.name()}`,U);continue}if(Q=null,Z(U)){let B=this._findOption(U);if(B){if(B.required){let G=$[Y++];if(G===void 0)this.optionMissingArgument(B);this.emit(`option:${B.name()}`,G)}else if(B.optional){let G=null;if(Y<$.length&&(!Z($[Y])||H($[Y])))G=$[Y++];this.emit(`option:${B.name()}`,G)}else this.emit(`option:${B.name()}`);Q=B.variadic?B:null;continue}}if(U.length>2&&U[0]==="-"&&U[1]!=="-"){let B=this._findOption(`-${U[1]}`);if(B){if(B.required||B.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${B.name()}`,U.slice(2));else this.emit(`option:${B.name()}`),J=`-${U.slice(2)}`;continue}}if(/^--[^=]+=/.test(U)){let B=U.indexOf("="),G=this._findOption(U.slice(0,B));if(G&&(G.required||G.optional)){this.emit(`option:${G.name()}`,U.slice(B+1));continue}}if(X===q&&Z(U)&&!(this.commands.length===0&&H(U)))X=z;if((this._enablePositionalOptions||this._passThroughOptions)&&q.length===0&&z.length===0){if(this._findCommand(U)){q.push(U),z.push(...$.slice(Y));break}else if(this._getHelpCommand()&&U===this._getHelpCommand().name()){q.push(U,...$.slice(Y));break}else if(this._defaultCommandName){z.push(U,...$.slice(Y));break}}if(this._passThroughOptions){X.push(U,...$.slice(Y));break}X.push(U)}return{operands:q,unknown:z}}opts(){if(this._storeOptionsAsProperties){let $={},q=this.options.length;for(let z=0;z<q;z++){let X=this.options[z].attributeName();$[X]=X===this._versionOptionName?this._version:this[X]}return $}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce(($,q)=>Object.assign($,q.opts()),{})}error($,q){if(this._outputConfiguration.outputError(`${$}
23
23
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==="string")this._outputConfiguration.writeErr(`${this._showHelpAfterError}
24
24
  `);else if(this._showHelpAfterError)this._outputConfiguration.writeErr(`
25
- `),this.outputHelp({error:!0});let X=$||{},Z=X.exitCode||1,H=X.code||"commander.error";this._exit(Z,H,q)}_parseOptionsEnv(){this.options.forEach((q)=>{if(q.envVar&&q.envVar in S.env){let $=q.attributeName();if(this.getOptionValue($)===void 0||["default","config","env"].includes(this.getOptionValueSource($)))if(q.required||q.optional)this.emit(`optionEnv:${q.name()}`,S.env[q.envVar]);else this.emit(`optionEnv:${q.name()}`)}})}_parseOptionsImplied(){let q=new S5(this.options),$=(X)=>{return this.getOptionValue(X)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(X))};this.options.filter((X)=>X.implied!==void 0&&$(X.attributeName())&&q.valueFromOption(this.getOptionValue(X.attributeName()),X)).forEach((X)=>{Object.keys(X.implied).filter((Z)=>!$(Z)).forEach((Z)=>{this.setOptionValueWithSource(Z,X.implied[Z],"implied")})})}missingArgument(q){let $=`error: missing required argument '${q}'`;this.error($,{code:"commander.missingArgument"})}optionMissingArgument(q){let $=`error: option '${q.flags}' argument missing`;this.error($,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(q){let $=`error: required option '${q.flags}' not specified`;this.error($,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(q,$){let X=(z)=>{let U=z.attributeName(),Q=this.getOptionValue(U),J=this.options.find((Y)=>Y.negate&&U===Y.attributeName()),G=this.options.find((Y)=>!Y.negate&&U===Y.attributeName());if(J&&(J.presetArg===void 0&&Q===!1||J.presetArg!==void 0&&Q===J.presetArg))return J;return G||z},Z=(z)=>{let U=X(z),Q=U.attributeName();if(this.getOptionValueSource(Q)==="env")return`environment variable '${U.envVar}'`;return`option '${U.flags}'`},H=`error: ${Z(q)} cannot be used with ${Z($)}`;this.error(H,{code:"commander.conflictingOption"})}unknownOption(q){if(this._allowUnknownOption)return;let $="";if(q.startsWith("--")&&this._showSuggestionAfterError){let Z=[],H=this;do{let z=H.createHelp().visibleOptions(H).filter((U)=>U.long).map((U)=>U.long);Z=Z.concat(z),H=H.parent}while(H&&!H._enablePositionalOptions);$=z2(q,Z)}let X=`error: unknown option '${q}'${$}`;this.error(X,{code:"commander.unknownOption"})}_excessArguments(q){if(this._allowExcessArguments)return;let $=this.registeredArguments.length,X=$===1?"":"s",H=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${$} argument${X} but got ${q.length}.`;this.error(H,{code:"commander.excessArguments"})}unknownCommand(){let q=this.args[0],$="";if(this._showSuggestionAfterError){let Z=[];this.createHelp().visibleCommands(this).forEach((H)=>{if(Z.push(H.name()),H.alias())Z.push(H.alias())}),$=z2(q,Z)}let X=`error: unknown command '${q}'${$}`;this.error(X,{code:"commander.unknownCommand"})}version(q,$,X){if(q===void 0)return this._version;this._version=q,$=$||"-V, --version",X=X||"output the version number";let Z=this.createOption($,X);return this._versionOptionName=Z.attributeName(),this._registerOption(Z),this.on("option:"+Z.name(),()=>{this._outputConfiguration.writeOut(`${q}
26
- `),this._exit(0,"commander.version",q)}),this}description(q,$){if(q===void 0&&$===void 0)return this._description;if(this._description=q,$)this._argsDescription=$;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 $=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)$=this.commands[this.commands.length-1];if(q===$._name)throw Error("Command alias can't be the same as its name");let X=this.parent?._findCommand(q);if(X){let Z=[X.name()].concat(X.aliases()).join("|");throw Error(`cannot add alias '${q}' to command '${this.name()}' as already have command '${Z}'`)}return $._aliases.push(q),this}aliases(q){if(q===void 0)return this._aliases;return q.forEach(($)=>this.alias($)),this}usage(q){if(q===void 0){if(this._usage)return this._usage;let $=this.registeredArguments.map((X)=>{return F5(X)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?$:[]).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=i.basename(q,i.extname(q)),this}executableDir(q){if(q===void 0)return this._executableDir;return this._executableDir=q,this}helpInformation(q){let $=this.createHelp(),X=this._getOutputContext(q);$.prepareContext({error:X.error,helpWidth:X.helpWidth,outputHasColors:X.hasColors});let Z=$.formatHelp(this,$);if(X.hasColors)return Z;return this._outputConfiguration.stripColor(Z)}_getOutputContext(q){q=q||{};let $=!!q.error,X,Z,H;if($)X=(U)=>this._outputConfiguration.writeErr(U),Z=this._outputConfiguration.getErrHasColors(),H=this._outputConfiguration.getErrHelpWidth();else X=(U)=>this._outputConfiguration.writeOut(U),Z=this._outputConfiguration.getOutHasColors(),H=this._outputConfiguration.getOutHelpWidth();return{error:$,write:(U)=>{if(!Z)U=this._outputConfiguration.stripColor(U);return X(U)},hasColors:Z,helpWidth:H}}outputHelp(q){let $;if(typeof q==="function")$=q,q=void 0;let X=this._getOutputContext(q),Z={error:X.error,write:X.write,command:this};this._getCommandAndAncestors().reverse().forEach((z)=>z.emit("beforeAllHelp",Z)),this.emit("beforeHelp",Z);let H=this.helpInformation({error:X.error});if($){if(H=$(H),typeof H!=="string"&&!Buffer.isBuffer(H))throw Error("outputHelp callback must return a string or a Buffer")}if(X.write(H),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",Z),this._getCommandAndAncestors().forEach((z)=>z.emit("afterAllHelp",Z))}helpOption(q,$){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",$??"display help for command"),q||$)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 $=Number(S.exitCode??0);if($===0&&q&&typeof q!=="function"&&q.error)$=1;this._exit($,"commander.help","(outputHelp)")}addHelpText(q,$){let X=["beforeAll","before","after","afterAll"];if(!X.includes(q))throw Error(`Unexpected value for position to addHelpText.
27
- Expecting one of '${X.join("', '")}'`);let Z=`${q}Help`;return this.on(Z,(H)=>{let z;if(typeof $==="function")z=$({error:H.error,command:H.command});else z=$;if(z)H.write(`${z}
28
- `)}),this}_outputHelpIfRequested(q){let $=this._getHelpOption();if($&&q.find((Z)=>$.is(Z)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function U2(q){return q.map(($)=>{if(!$.startsWith("--inspect"))return $;let X,Z="127.0.0.1",H="9229",z;if((z=$.match(/^(--inspect(-brk)?)$/))!==null)X=z[1];else if((z=$.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(X=z[1],/^\d+$/.test(z[3]))H=z[3];else Z=z[3];else if((z=$.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)X=z[1],Z=z[3],H=z[4];if(X&&H!=="0")return`${X}=${Z}:${parseInt(H)+1}`;return $})}function _$(){if(S.env.NO_COLOR||S.env.FORCE_COLOR==="0"||S.env.FORCE_COLOR==="false")return!1;if(S.env.FORCE_COLOR||S.env.CLICOLOR_FORCE!==void 0)return!0;return}j5.Command=W$;j5.useColor=_$});var Y2=I((y5)=>{var{Argument:G2}=Hq(),{Command:V$}=Q2(),{CommanderError:b5,InvalidArgumentError:J2}=E0(),{Help:C5}=T$(),{Option:T2}=Y$();y5.program=new V$;y5.createCommand=(q)=>new V$(q);y5.createOption=(q,$)=>new T2(q,$);y5.createArgument=(q,$)=>new G2(q,$);y5.Command=V$;y5.Option=T2;y5.Argument=G2;y5.Help=C5;y5.CommanderError=b5;y5.InvalidArgumentError=J2;y5.InvalidOptionArgumentError=J2});var A=I((e5)=>{var P$=Symbol.for("yaml.alias"),_2=Symbol.for("yaml.document"),Uq=Symbol.for("yaml.map"),W2=Symbol.for("yaml.pair"),M$=Symbol.for("yaml.scalar"),Qq=Symbol.for("yaml.seq"),a=Symbol.for("yaml.node.type"),i5=(q)=>!!q&&typeof q==="object"&&q[a]===P$,a5=(q)=>!!q&&typeof q==="object"&&q[a]===_2,s5=(q)=>!!q&&typeof q==="object"&&q[a]===Uq,r5=(q)=>!!q&&typeof q==="object"&&q[a]===W2,V2=(q)=>!!q&&typeof q==="object"&&q[a]===M$,n5=(q)=>!!q&&typeof q==="object"&&q[a]===Qq;function I2(q){if(q&&typeof q==="object")switch(q[a]){case Uq:case Qq:return!0}return!1}function o5(q){if(q&&typeof q==="object")switch(q[a]){case P$:case Uq:case M$:case Qq:return!0}return!1}var t5=(q)=>(V2(q)||I2(q))&&!!q.anchor;e5.ALIAS=P$;e5.DOC=_2;e5.MAP=Uq;e5.NODE_TYPE=a;e5.PAIR=W2;e5.SCALAR=M$;e5.SEQ=Qq;e5.hasAnchor=t5;e5.isAlias=i5;e5.isCollection=I2;e5.isDocument=a5;e5.isMap=s5;e5.isNode=o5;e5.isPair=r5;e5.isScalar=V2;e5.isSeq=n5});var b0=I((V8)=>{var f=A(),x=Symbol("break visit"),D2=Symbol("skip children"),p=Symbol("remove node");function Gq(q,$){let X=R2($);if(f.isDocument(q)){if(_0(null,q.contents,X,Object.freeze([q]))===p)q.contents=null}else _0(null,q,X,Object.freeze([]))}Gq.BREAK=x;Gq.SKIP=D2;Gq.REMOVE=p;function _0(q,$,X,Z){let H=P2(q,$,X,Z);if(f.isNode(H)||f.isPair(H))return M2(q,Z,H),_0(q,H,X,Z);if(typeof H!=="symbol"){if(f.isCollection($)){Z=Object.freeze(Z.concat($));for(let z=0;z<$.items.length;++z){let U=_0(z,$.items[z],X,Z);if(typeof U==="number")z=U-1;else if(U===x)return x;else if(U===p)$.items.splice(z,1),z-=1}}else if(f.isPair($)){Z=Object.freeze(Z.concat($));let z=_0("key",$.key,X,Z);if(z===x)return x;else if(z===p)$.key=null;let U=_0("value",$.value,X,Z);if(U===x)return x;else if(U===p)$.value=null}}return H}async function Jq(q,$){let X=R2($);if(f.isDocument(q)){if(await W0(null,q.contents,X,Object.freeze([q]))===p)q.contents=null}else await W0(null,q,X,Object.freeze([]))}Jq.BREAK=x;Jq.SKIP=D2;Jq.REMOVE=p;async function W0(q,$,X,Z){let H=await P2(q,$,X,Z);if(f.isNode(H)||f.isPair(H))return M2(q,Z,H),W0(q,H,X,Z);if(typeof H!=="symbol"){if(f.isCollection($)){Z=Object.freeze(Z.concat($));for(let z=0;z<$.items.length;++z){let U=await W0(z,$.items[z],X,Z);if(typeof U==="number")z=U-1;else if(U===x)return x;else if(U===p)$.items.splice(z,1),z-=1}}else if(f.isPair($)){Z=Object.freeze(Z.concat($));let z=await W0("key",$.key,X,Z);if(z===x)return x;else if(z===p)$.key=null;let U=await W0("value",$.value,X,Z);if(U===x)return x;else if(U===p)$.value=null}}return H}function R2(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 P2(q,$,X,Z){if(typeof X==="function")return X(q,$,Z);if(f.isMap($))return X.Map?.(q,$,Z);if(f.isSeq($))return X.Seq?.(q,$,Z);if(f.isPair($))return X.Pair?.(q,$,Z);if(f.isScalar($))return X.Scalar?.(q,$,Z);if(f.isAlias($))return X.Alias?.(q,$,Z);return}function M2(q,$,X){let Z=$[$.length-1];if(f.isCollection(Z))Z.items[q]=X;else if(f.isPair(Z))if(q==="key")Z.key=X;else Z.value=X;else if(f.isDocument(Z))Z.contents=X;else{let H=f.isAlias(Z)?"alias":"scalar";throw Error(`Cannot replace node with ${H} parent`)}}V8.visit=Gq;V8.visitAsync=Jq});var K$=I((K8)=>{var K2=A(),R8=b0(),P8={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},M8=(q)=>q.replace(/[!,[\]{}]/g,($)=>P8[$]);class k{constructor(q,$){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},k.defaultYaml,q),this.tags=Object.assign({},k.defaultTags,$)}clone(){let q=new k(this.yaml,this.tags);return q.docStart=this.docStart,q}atDocument(){let q=new k(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:k.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},k.defaultTags);break}return q}add(q,$){if(this.atNextDocument)this.yaml={explicit:k.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},k.defaultTags),this.atNextDocument=!1;let X=q.trim().split(/[ \t]+/),Z=X.shift();switch(Z){case"%TAG":{if(X.length!==2){if($(0,"%TAG directive should contain exactly two parts"),X.length<2)return!1}let[H,z]=X;return this.tags[H]=z,!0}case"%YAML":{if(this.yaml.explicit=!0,X.length!==1)return $(0,"%YAML directive should contain exactly one part"),!1;let[H]=X;if(H==="1.1"||H==="1.2")return this.yaml.version=H,!0;else{let z=/^\d+\.\d+$/.test(H);return $(6,`Unsupported YAML version ${H}`,z),!1}}default:return $(0,`Unknown directive ${Z}`,!0),!1}}tagName(q,$){if(q==="!")return"!";if(q[0]!=="!")return $(`Not a valid tag: ${q}`),null;if(q[1]==="<"){let z=q.slice(2,-1);if(z==="!"||z==="!!")return $(`Verbatim tags aren't resolved, so ${q} is invalid.`),null;if(q[q.length-1]!==">")$("Verbatim tags must end with a >");return z}let[,X,Z]=q.match(/^(.*!)([^!]*)$/s);if(!Z)$(`The ${q} tag has no suffix`);let H=this.tags[X];if(H)try{return H+decodeURIComponent(Z)}catch(z){return $(String(z)),null}if(X==="!")return q;return $(`Could not resolve tag: ${q}`),null}tagString(q){for(let[$,X]of Object.entries(this.tags))if(q.startsWith(X))return $+M8(q.substring(X.length));return q[0]==="!"?q:`!<${q}>`}toString(q){let $=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],X=Object.entries(this.tags),Z;if(q&&X.length>0&&K2.isNode(q.contents)){let H={};R8.visit(q.contents,(z,U)=>{if(K2.isNode(U)&&U.tag)H[U.tag]=!0}),Z=Object.keys(H)}else Z=[];for(let[H,z]of X){if(H==="!!"&&z==="tag:yaml.org,2002:")continue;if(!q||Z.some((U)=>U.startsWith(z)))$.push(`%TAG ${H} ${z}`)}return $.join(`
29
- `)}}k.defaultYaml={explicit:!1,version:"1.2"};k.defaultTags={"!!":"tag:yaml.org,2002:"};K8.Directives=k});var Tq=I((S8)=>{var w2=A(),F8=b0();function O8(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 F2(q){let $=new Set;return F8.visit(q,{Value(X,Z){if(Z.anchor)$.add(Z.anchor)}}),$}function O2(q,$){for(let X=1;;++X){let Z=`${q}${X}`;if(!$.has(Z))return Z}}function A8(q,$){let X=[],Z=new Map,H=null;return{onAnchor:(z)=>{X.push(z),H??(H=F2(q));let U=O2($,H);return H.add(U),U},setAnchors:()=>{for(let z of X){let U=Z.get(z);if(typeof U==="object"&&U.anchor&&(w2.isScalar(U.node)||w2.isCollection(U.node)))U.node.anchor=U.anchor;else{let Q=Error("Failed to resolve repeated object (this should not happen)");throw Q.source=z,Q}}},sourceObjects:Z}}S8.anchorIsValid=O8;S8.anchorNames=F2;S8.createNodeAnchors=A8;S8.findNewAnchor=O2});var w$=I((C8)=>{function C0(q,$,X,Z){if(Z&&typeof Z==="object")if(Array.isArray(Z))for(let H=0,z=Z.length;H<z;++H){let U=Z[H],Q=C0(q,Z,String(H),U);if(Q===void 0)delete Z[H];else if(Q!==U)Z[H]=Q}else if(Z instanceof Map)for(let H of Array.from(Z.keys())){let z=Z.get(H),U=C0(q,Z,H,z);if(U===void 0)Z.delete(H);else if(U!==z)Z.set(H,U)}else if(Z instanceof Set)for(let H of Array.from(Z)){let z=C0(q,Z,H,H);if(z===void 0)Z.delete(H);else if(z!==H)Z.delete(H),Z.add(z)}else for(let[H,z]of Object.entries(Z)){let U=C0(q,Z,H,z);if(U===void 0)delete Z[H];else if(U!==z)Z[H]=U}return q.call($,X,Z)}C8.applyReviver=C0});var n=I((x8)=>{var f8=A();function A2(q,$,X){if(Array.isArray(q))return q.map((Z,H)=>A2(Z,String(H),X));if(q&&typeof q.toJSON==="function"){if(!X||!f8.hasAnchor(q))return q.toJSON($,X);let Z={aliasCount:0,count:1,res:void 0};X.anchors.set(q,Z),X.onCreate=(z)=>{Z.res=z,delete X.onCreate};let H=q.toJSON($,X);if(X.onCreate)X.onCreate(H);return H}if(typeof q==="bigint"&&!X?.keep)return Number(q);return q}x8.toJS=A2});var Yq=I((u8)=>{var h8=w$(),S2=A(),g8=n();class j2{constructor(q){Object.defineProperty(this,S2.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:$,maxAliasCount:X,onAnchor:Z,reviver:H}={}){if(!S2.isDocument(q))throw TypeError("A document argument is required");let z={anchors:new Map,doc:q,keep:!0,mapAsMap:$===!0,mapKeyWarned:!1,maxAliasCount:typeof X==="number"?X:100},U=g8.toJS(this,"",z);if(typeof Z==="function")for(let{count:Q,res:J}of z.anchors.values())Z(J,Q);return typeof H==="function"?h8.applyReviver(H,{"":U},"",U):U}}u8.NodeBase=j2});var y0=I((c8)=>{var m8=Tq(),d8=b0(),V0=A(),p8=Yq(),l8=n();class N2 extends p8.NodeBase{constructor(q){super(V0.ALIAS);this.source=q,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(q,$){let X;if($?.aliasResolveCache)X=$.aliasResolveCache;else if(X=[],d8.visit(q,{Node:(H,z)=>{if(V0.isAlias(z)||V0.hasAnchor(z))X.push(z)}}),$)$.aliasResolveCache=X;let Z=void 0;for(let H of X){if(H===this)break;if(H.anchor===this.source)Z=H}return Z}toJSON(q,$){if(!$)return{source:this.source};let{anchors:X,doc:Z,maxAliasCount:H}=$,z=this.resolve(Z,$);if(!z){let Q=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(Q)}let U=X.get(z);if(!U)l8.toJS(z,null,$),U=X.get(z);if(U?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(H>=0){if(U.count+=1,U.aliasCount===0)U.aliasCount=Lq(Z,z,X);if(U.count*U.aliasCount>H)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return U.res}toString(q,$,X){let Z=`*${this.source}`;if(q){if(m8.anchorIsValid(this.source),q.options.verifyAliasOrder&&!q.anchors.has(this.source)){let H=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(H)}if(q.implicitKey)return`${Z} `}return Z}}function Lq(q,$,X){if(V0.isAlias($)){let Z=$.resolve(q),H=X&&Z&&X.get(Z);return H?H.count*H.aliasCount:0}else if(V0.isCollection($)){let Z=0;for(let H of $.items){let z=Lq(q,H,X);if(z>Z)Z=z}return Z}else if(V0.isPair($)){let Z=Lq(q,$.key,X),H=Lq(q,$.value,X);return Math.max(Z,H)}return 1}c8.Alias=N2});var b=I((o8)=>{var a8=A(),s8=Yq(),r8=n(),n8=(q)=>!q||typeof q!=="function"&&typeof q!=="object";class z0 extends s8.NodeBase{constructor(q){super(a8.SCALAR);this.value=q}toJSON(q,$){return $?.keep?this.value:r8.toJS(this.value,q,$)}toString(){return String(this.value)}}z0.BLOCK_FOLDED="BLOCK_FOLDED";z0.BLOCK_LITERAL="BLOCK_LITERAL";z0.PLAIN="PLAIN";z0.QUOTE_DOUBLE="QUOTE_DOUBLE";z0.QUOTE_SINGLE="QUOTE_SINGLE";o8.Scalar=z0;o8.isScalarValue=n8});var f0=I((HX)=>{var qX=y0(),U0=A(),E2=b(),$X="tag:yaml.org,2002:";function XX(q,$,X){if($){let Z=X.filter((z)=>z.tag===$),H=Z.find((z)=>!z.format)??Z[0];if(!H)throw Error(`Tag ${$} not found`);return H}return X.find((Z)=>Z.identify?.(q)&&!Z.format)}function ZX(q,$,X){if(U0.isDocument(q))q=q.contents;if(U0.isNode(q))return q;if(U0.isPair(q)){let T=X.schema[U0.MAP].createNode?.(X.schema,null,X);return T.items.push(q),T}if(q instanceof String||q instanceof Number||q instanceof Boolean||typeof BigInt<"u"&&q instanceof BigInt)q=q.valueOf();let{aliasDuplicateObjects:Z,onAnchor:H,onTagObj:z,schema:U,sourceObjects:Q}=X,J=void 0;if(Z&&q&&typeof q==="object")if(J=Q.get(q),J)return J.anchor??(J.anchor=H(q)),new qX.Alias(J.anchor);else J={anchor:null,node:null},Q.set(q,J);if($?.startsWith("!!"))$=$X+$.slice(2);let G=XX(q,$,U.tags);if(!G){if(q&&typeof q.toJSON==="function")q=q.toJSON();if(!q||typeof q!=="object"){let T=new E2.Scalar(q);if(J)J.node=T;return T}G=q instanceof Map?U[U0.MAP]:(Symbol.iterator in Object(q))?U[U0.SEQ]:U[U0.MAP]}if(z)z(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 E2.Scalar(q);if($)Y.tag=$;else if(!G.default)Y.tag=G.tag;if(J)J.node=Y;return Y}HX.createNode=ZX});var Bq=I((GX)=>{var UX=f0(),l=A(),QX=Yq();function F$(q,$,X){let Z=X;for(let H=$.length-1;H>=0;--H){let z=$[H];if(typeof z==="number"&&Number.isInteger(z)&&z>=0){let U=[];U[z]=Z,Z=U}else Z=new Map([[z,Z]])}return UX.createNode(Z,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:q,sourceObjects:new Map})}var b2=(q)=>q==null||typeof q==="object"&&!!q[Symbol.iterator]().next().done;class C2 extends QX.NodeBase{constructor(q,$){super(q);Object.defineProperty(this,"schema",{value:$,configurable:!0,enumerable:!1,writable:!0})}clone(q){let $=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(q)$.schema=q;if($.items=$.items.map((X)=>l.isNode(X)||l.isPair(X)?X.clone(q):X),this.range)$.range=this.range.slice();return $}addIn(q,$){if(b2(q))this.add($);else{let[X,...Z]=q,H=this.get(X,!0);if(l.isCollection(H))H.addIn(Z,$);else if(H===void 0&&this.schema)this.set(X,F$(this.schema,Z,$));else throw Error(`Expected YAML collection at ${X}. Remaining path: ${Z}`)}}deleteIn(q){let[$,...X]=q;if(X.length===0)return this.delete($);let Z=this.get($,!0);if(l.isCollection(Z))return Z.deleteIn(X);else throw Error(`Expected YAML collection at ${$}. Remaining path: ${X}`)}getIn(q,$){let[X,...Z]=q,H=this.get(X,!0);if(Z.length===0)return!$&&l.isScalar(H)?H.value:H;else return l.isCollection(H)?H.getIn(Z,$):void 0}hasAllNullValues(q){return this.items.every(($)=>{if(!l.isPair($))return!1;let X=$.value;return X==null||q&&l.isScalar(X)&&X.value==null&&!X.commentBefore&&!X.comment&&!X.tag})}hasIn(q){let[$,...X]=q;if(X.length===0)return this.has($);let Z=this.get($,!0);return l.isCollection(Z)?Z.hasIn(X):!1}setIn(q,$){let[X,...Z]=q;if(Z.length===0)this.set(X,$);else{let H=this.get(X,!0);if(l.isCollection(H))H.setIn(Z,$);else if(H===void 0&&this.schema)this.set(X,F$(this.schema,Z,$));else throw Error(`Expected YAML collection at ${X}. Remaining path: ${Z}`)}}}GX.Collection=C2;GX.collectionFromPath=F$;GX.isEmptyPath=b2});var x0=I((_X)=>{var LX=(q)=>q.replace(/^(?!$)(?: $)?/gm,"#");function O$(q,$){if(/^\n+$/.test(q))return q.substring(1);return $?q.replace(/^(?! *$)/gm,$):q}var BX=(q,$,X)=>q.endsWith(`
30
- `)?O$(X,$):X.includes(`
25
+ `),this.outputHelp({error:!0});let z=q||{},X=z.exitCode||1,Z=z.code||"commander.error";this._exit(X,Z,$)}_parseOptionsEnv(){this.options.forEach(($)=>{if($.envVar&&$.envVar in S.env){let q=$.attributeName();if(this.getOptionValue(q)===void 0||["default","config","env"].includes(this.getOptionValueSource(q)))if($.required||$.optional)this.emit(`optionEnv:${$.name()}`,S.env[$.envVar]);else this.emit(`optionEnv:${$.name()}`)}})}_parseOptionsImplied(){let $=new N5(this.options),q=(z)=>{return this.getOptionValue(z)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(z))};this.options.filter((z)=>z.implied!==void 0&&q(z.attributeName())&&$.valueFromOption(this.getOptionValue(z.attributeName()),z)).forEach((z)=>{Object.keys(z.implied).filter((X)=>!q(X)).forEach((X)=>{this.setOptionValueWithSource(X,z.implied[X],"implied")})})}missingArgument($){let q=`error: missing required argument '${$}'`;this.error(q,{code:"commander.missingArgument"})}optionMissingArgument($){let q=`error: option '${$.flags}' argument missing`;this.error(q,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue($){let q=`error: required option '${$.flags}' not specified`;this.error(q,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption($,q){let z=(H)=>{let Q=H.attributeName(),J=this.getOptionValue(Q),Y=this.options.find((B)=>B.negate&&Q===B.attributeName()),U=this.options.find((B)=>!B.negate&&Q===B.attributeName());if(Y&&(Y.presetArg===void 0&&J===!1||Y.presetArg!==void 0&&J===Y.presetArg))return Y;return U||H},X=(H)=>{let Q=z(H),J=Q.attributeName();if(this.getOptionValueSource(J)==="env")return`environment variable '${Q.envVar}'`;return`option '${Q.flags}'`},Z=`error: ${X($)} cannot be used with ${X(q)}`;this.error(Z,{code:"commander.conflictingOption"})}unknownOption($){if(this._allowUnknownOption)return;let q="";if($.startsWith("--")&&this._showSuggestionAfterError){let X=[],Z=this;do{let H=Z.createHelp().visibleOptions(Z).filter((Q)=>Q.long).map((Q)=>Q.long);X=X.concat(H),Z=Z.parent}while(Z&&!Z._enablePositionalOptions);q=Q2($,X)}let z=`error: unknown option '${$}'${q}`;this.error(z,{code:"commander.unknownOption"})}_excessArguments($){if(this._allowExcessArguments)return;let q=this.registeredArguments.length,z=q===1?"":"s",Z=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${q} argument${z} but got ${$.length}.`;this.error(Z,{code:"commander.excessArguments"})}unknownCommand(){let $=this.args[0],q="";if(this._showSuggestionAfterError){let X=[];this.createHelp().visibleCommands(this).forEach((Z)=>{if(X.push(Z.name()),Z.alias())X.push(Z.alias())}),q=Q2($,X)}let z=`error: unknown command '${$}'${q}`;this.error(z,{code:"commander.unknownCommand"})}version($,q,z){if($===void 0)return this._version;this._version=$,q=q||"-V, --version",z=z||"output the version number";let X=this.createOption(q,z);return this._versionOptionName=X.attributeName(),this._registerOption(X),this.on("option:"+X.name(),()=>{this._outputConfiguration.writeOut(`${$}
26
+ `),this._exit(0,"commander.version",$)}),this}description($,q){if($===void 0&&q===void 0)return this._description;if(this._description=$,q)this._argsDescription=q;return this}summary($){if($===void 0)return this._summary;return this._summary=$,this}alias($){if($===void 0)return this._aliases[0];let q=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)q=this.commands[this.commands.length-1];if($===q._name)throw Error("Command alias can't be the same as its name");let z=this.parent?._findCommand($);if(z){let X=[z.name()].concat(z.aliases()).join("|");throw Error(`cannot add alias '${$}' to command '${this.name()}' as already have command '${X}'`)}return q._aliases.push($),this}aliases($){if($===void 0)return this._aliases;return $.forEach((q)=>this.alias(q)),this}usage($){if($===void 0){if(this._usage)return this._usage;let q=this.registeredArguments.map((z)=>{return A5(z)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?q:[]).join(" ")}return this._usage=$,this}name($){if($===void 0)return this._name;return this._name=$,this}helpGroup($){if($===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=$,this}commandsGroup($){if($===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=$,this}optionsGroup($){if($===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=$,this}_initOptionGroup($){if(this._defaultOptionGroup&&!$.helpGroupHeading)$.helpGroup(this._defaultOptionGroup)}_initCommandGroup($){if(this._defaultCommandGroup&&!$.helpGroup())$.helpGroup(this._defaultCommandGroup)}nameFromFilename($){return this._name=i.basename($,i.extname($)),this}executableDir($){if($===void 0)return this._executableDir;return this._executableDir=$,this}helpInformation($){let q=this.createHelp(),z=this._getOutputContext($);q.prepareContext({error:z.error,helpWidth:z.helpWidth,outputHasColors:z.hasColors});let X=q.formatHelp(this,q);if(z.hasColors)return X;return this._outputConfiguration.stripColor(X)}_getOutputContext($){$=$||{};let q=!!$.error,z,X,Z;if(q)z=(Q)=>this._outputConfiguration.writeErr(Q),X=this._outputConfiguration.getErrHasColors(),Z=this._outputConfiguration.getErrHelpWidth();else z=(Q)=>this._outputConfiguration.writeOut(Q),X=this._outputConfiguration.getOutHasColors(),Z=this._outputConfiguration.getOutHelpWidth();return{error:q,write:(Q)=>{if(!X)Q=this._outputConfiguration.stripColor(Q);return z(Q)},hasColors:X,helpWidth:Z}}outputHelp($){let q;if(typeof $==="function")q=$,$=void 0;let z=this._getOutputContext($),X={error:z.error,write:z.write,command:this};this._getCommandAndAncestors().reverse().forEach((H)=>H.emit("beforeAllHelp",X)),this.emit("beforeHelp",X);let Z=this.helpInformation({error:z.error});if(q){if(Z=q(Z),typeof Z!=="string"&&!Buffer.isBuffer(Z))throw Error("outputHelp callback must return a string or a Buffer")}if(z.write(Z),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",X),this._getCommandAndAncestors().forEach((H)=>H.emit("afterAllHelp",X))}helpOption($,q){if(typeof $==="boolean"){if($){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($??"-h, --help",q??"display help for command"),$||q)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption($){return this._helpOption=$,this._initOptionGroup($),this}help($){this.outputHelp($);let q=Number(S.exitCode??0);if(q===0&&$&&typeof $!=="function"&&$.error)q=1;this._exit(q,"commander.help","(outputHelp)")}addHelpText($,q){let z=["beforeAll","before","after","afterAll"];if(!z.includes($))throw Error(`Unexpected value for position to addHelpText.
27
+ Expecting one of '${z.join("', '")}'`);let X=`${$}Help`;return this.on(X,(Z)=>{let H;if(typeof q==="function")H=q({error:Z.error,command:Z.command});else H=q;if(H)Z.write(`${H}
28
+ `)}),this}_outputHelpIfRequested($){let q=this._getHelpOption();if(q&&$.find((X)=>q.is(X)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function J2($){return $.map((q)=>{if(!q.startsWith("--inspect"))return q;let z,X="127.0.0.1",Z="9229",H;if((H=q.match(/^(--inspect(-brk)?)$/))!==null)z=H[1];else if((H=q.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(z=H[1],/^\d+$/.test(H[3]))Z=H[3];else X=H[3];else if((H=q.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)z=H[1],X=H[3],Z=H[4];if(z&&Z!=="0")return`${z}=${X}:${parseInt(Z)+1}`;return q})}function Vq(){if(S.env.NO_COLOR||S.env.FORCE_COLOR==="0"||S.env.FORCE_COLOR==="false")return!1;if(S.env.FORCE_COLOR||S.env.CLICOLOR_FORCE!==void 0)return!0;return}E5.Command=_q;E5.useColor=Vq});var T2=D((k5)=>{var{Argument:G2}=J$(),{Command:Dq}=U2(),{CommanderError:y5,InvalidArgumentError:Y2}=C0(),{Help:f5}=Bq(),{Option:B2}=Tq();k5.program=new Dq;k5.createCommand=($)=>new Dq($);k5.createOption=($,q)=>new B2($,q);k5.createArgument=($,q)=>new G2($,q);k5.Command=Dq;k5.Option=B2;k5.Argument=G2;k5.Help=f5;k5.CommanderError=y5;k5.InvalidArgumentError=Y2;k5.InvalidOptionArgumentError=Y2});var A=D((qz)=>{var Mq=Symbol.for("yaml.alias"),V2=Symbol.for("yaml.document"),G$=Symbol.for("yaml.map"),_2=Symbol.for("yaml.pair"),Pq=Symbol.for("yaml.scalar"),Y$=Symbol.for("yaml.seq"),a=Symbol.for("yaml.node.type"),s5=($)=>!!$&&typeof $==="object"&&$[a]===Mq,r5=($)=>!!$&&typeof $==="object"&&$[a]===V2,n5=($)=>!!$&&typeof $==="object"&&$[a]===G$,o5=($)=>!!$&&typeof $==="object"&&$[a]===_2,D2=($)=>!!$&&typeof $==="object"&&$[a]===Pq,t5=($)=>!!$&&typeof $==="object"&&$[a]===Y$;function I2($){if($&&typeof $==="object")switch($[a]){case G$:case Y$:return!0}return!1}function e5($){if($&&typeof $==="object")switch($[a]){case Mq:case G$:case Pq:case Y$:return!0}return!1}var $z=($)=>(D2($)||I2($))&&!!$.anchor;qz.ALIAS=Mq;qz.DOC=V2;qz.MAP=G$;qz.NODE_TYPE=a;qz.PAIR=_2;qz.SCALAR=Pq;qz.SEQ=Y$;qz.hasAnchor=$z;qz.isAlias=s5;qz.isCollection=I2;qz.isDocument=r5;qz.isMap=n5;qz.isNode=e5;qz.isPair=o5;qz.isScalar=D2;qz.isSeq=t5});var y0=D((Iz)=>{var f=A(),k=Symbol("break visit"),R2=Symbol("skip children"),p=Symbol("remove node");function B$($,q){let z=w2(q);if(f.isDocument($)){if(L0(null,$.contents,z,Object.freeze([$]))===p)$.contents=null}else L0(null,$,z,Object.freeze([]))}B$.BREAK=k;B$.SKIP=R2;B$.REMOVE=p;function L0($,q,z,X){let Z=M2($,q,z,X);if(f.isNode(Z)||f.isPair(Z))return P2($,X,Z),L0($,Z,z,X);if(typeof Z!=="symbol"){if(f.isCollection(q)){X=Object.freeze(X.concat(q));for(let H=0;H<q.items.length;++H){let Q=L0(H,q.items[H],z,X);if(typeof Q==="number")H=Q-1;else if(Q===k)return k;else if(Q===p)q.items.splice(H,1),H-=1}}else if(f.isPair(q)){X=Object.freeze(X.concat(q));let H=L0("key",q.key,z,X);if(H===k)return k;else if(H===p)q.key=null;let Q=L0("value",q.value,z,X);if(Q===k)return k;else if(Q===p)q.value=null}}return Z}async function T$($,q){let z=w2(q);if(f.isDocument($)){if(await V0(null,$.contents,z,Object.freeze([$]))===p)$.contents=null}else await V0(null,$,z,Object.freeze([]))}T$.BREAK=k;T$.SKIP=R2;T$.REMOVE=p;async function V0($,q,z,X){let Z=await M2($,q,z,X);if(f.isNode(Z)||f.isPair(Z))return P2($,X,Z),V0($,Z,z,X);if(typeof Z!=="symbol"){if(f.isCollection(q)){X=Object.freeze(X.concat(q));for(let H=0;H<q.items.length;++H){let Q=await V0(H,q.items[H],z,X);if(typeof Q==="number")H=Q-1;else if(Q===k)return k;else if(Q===p)q.items.splice(H,1),H-=1}}else if(f.isPair(q)){X=Object.freeze(X.concat(q));let H=await V0("key",q.key,z,X);if(H===k)return k;else if(H===p)q.key=null;let Q=await V0("value",q.value,z,X);if(Q===k)return k;else if(Q===p)q.value=null}}return Z}function w2($){if(typeof $==="object"&&($.Collection||$.Node||$.Value))return Object.assign({Alias:$.Node,Map:$.Node,Scalar:$.Node,Seq:$.Node},$.Value&&{Map:$.Value,Scalar:$.Value,Seq:$.Value},$.Collection&&{Map:$.Collection,Seq:$.Collection},$);return $}function M2($,q,z,X){if(typeof z==="function")return z($,q,X);if(f.isMap(q))return z.Map?.($,q,X);if(f.isSeq(q))return z.Seq?.($,q,X);if(f.isPair(q))return z.Pair?.($,q,X);if(f.isScalar(q))return z.Scalar?.($,q,X);if(f.isAlias(q))return z.Alias?.($,q,X);return}function P2($,q,z){let X=q[q.length-1];if(f.isCollection(X))X.items[$]=z;else if(f.isPair(X))if($==="key")X.key=z;else X.value=z;else if(f.isDocument(X))X.contents=z;else{let Z=f.isAlias(X)?"alias":"scalar";throw Error(`Cannot replace node with ${Z} parent`)}}Iz.visit=B$;Iz.visitAsync=T$});var Kq=D((Fz)=>{var K2=A(),Mz=y0(),Pz={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Kz=($)=>$.replace(/[!,[\]{}]/g,(q)=>Pz[q]);class x{constructor($,q){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},x.defaultYaml,$),this.tags=Object.assign({},x.defaultTags,q)}clone(){let $=new x(this.yaml,this.tags);return $.docStart=this.docStart,$}atDocument(){let $=new x(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:x.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},x.defaultTags);break}return $}add($,q){if(this.atNextDocument)this.yaml={explicit:x.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},x.defaultTags),this.atNextDocument=!1;let z=$.trim().split(/[ \t]+/),X=z.shift();switch(X){case"%TAG":{if(z.length!==2){if(q(0,"%TAG directive should contain exactly two parts"),z.length<2)return!1}let[Z,H]=z;return this.tags[Z]=H,!0}case"%YAML":{if(this.yaml.explicit=!0,z.length!==1)return q(0,"%YAML directive should contain exactly one part"),!1;let[Z]=z;if(Z==="1.1"||Z==="1.2")return this.yaml.version=Z,!0;else{let H=/^\d+\.\d+$/.test(Z);return q(6,`Unsupported YAML version ${Z}`,H),!1}}default:return q(0,`Unknown directive ${X}`,!0),!1}}tagName($,q){if($==="!")return"!";if($[0]!=="!")return q(`Not a valid tag: ${$}`),null;if($[1]==="<"){let H=$.slice(2,-1);if(H==="!"||H==="!!")return q(`Verbatim tags aren't resolved, so ${$} is invalid.`),null;if($[$.length-1]!==">")q("Verbatim tags must end with a >");return H}let[,z,X]=$.match(/^(.*!)([^!]*)$/s);if(!X)q(`The ${$} tag has no suffix`);let Z=this.tags[z];if(Z)try{return Z+decodeURIComponent(X)}catch(H){return q(String(H)),null}if(z==="!")return $;return q(`Could not resolve tag: ${$}`),null}tagString($){for(let[q,z]of Object.entries(this.tags))if($.startsWith(z))return q+Kz($.substring(z.length));return $[0]==="!"?$:`!<${$}>`}toString($){let q=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],z=Object.entries(this.tags),X;if($&&z.length>0&&K2.isNode($.contents)){let Z={};Mz.visit($.contents,(H,Q)=>{if(K2.isNode(Q)&&Q.tag)Z[Q.tag]=!0}),X=Object.keys(Z)}else X=[];for(let[Z,H]of z){if(Z==="!!"&&H==="tag:yaml.org,2002:")continue;if(!$||X.some((Q)=>Q.startsWith(H)))q.push(`%TAG ${Z} ${H}`)}return q.join(`
29
+ `)}}x.defaultYaml={explicit:!1,version:"1.2"};x.defaultTags={"!!":"tag:yaml.org,2002:"};Fz.Directives=x});var W$=D((Nz)=>{var F2=A(),Az=y0();function Sz($){if(/[\x00-\x19\s,[\]{}]/.test($)){let z=`Anchor must not contain whitespace or control characters: ${JSON.stringify($)}`;throw Error(z)}return!0}function O2($){let q=new Set;return Az.visit($,{Value(z,X){if(X.anchor)q.add(X.anchor)}}),q}function A2($,q){for(let z=1;;++z){let X=`${$}${z}`;if(!q.has(X))return X}}function jz($,q){let z=[],X=new Map,Z=null;return{onAnchor:(H)=>{z.push(H),Z??(Z=O2($));let Q=A2(q,Z);return Z.add(Q),Q},setAnchors:()=>{for(let H of z){let Q=X.get(H);if(typeof Q==="object"&&Q.anchor&&(F2.isScalar(Q.node)||F2.isCollection(Q.node)))Q.node.anchor=Q.anchor;else{let J=Error("Failed to resolve repeated object (this should not happen)");throw J.source=H,J}}},sourceObjects:X}}Nz.anchorIsValid=Sz;Nz.anchorNames=O2;Nz.createNodeAnchors=jz;Nz.findNewAnchor=A2});var Fq=D((fz)=>{function f0($,q,z,X){if(X&&typeof X==="object")if(Array.isArray(X))for(let Z=0,H=X.length;Z<H;++Z){let Q=X[Z],J=f0($,X,String(Z),Q);if(J===void 0)delete X[Z];else if(J!==Q)X[Z]=J}else if(X instanceof Map)for(let Z of Array.from(X.keys())){let H=X.get(Z),Q=f0($,X,Z,H);if(Q===void 0)X.delete(Z);else if(Q!==H)X.set(Z,Q)}else if(X instanceof Set)for(let Z of Array.from(X)){let H=f0($,X,Z,Z);if(H===void 0)X.delete(Z);else if(H!==Z)X.delete(Z),X.add(H)}else for(let[Z,H]of Object.entries(X)){let Q=f0($,X,Z,H);if(Q===void 0)delete X[Z];else if(Q!==H)X[Z]=Q}return $.call(q,z,X)}fz.applyReviver=f0});var n=D((hz)=>{var xz=A();function S2($,q,z){if(Array.isArray($))return $.map((X,Z)=>S2(X,String(Z),z));if($&&typeof $.toJSON==="function"){if(!z||!xz.hasAnchor($))return $.toJSON(q,z);let X={aliasCount:0,count:1,res:void 0};z.anchors.set($,X),z.onCreate=(H)=>{X.res=H,delete z.onCreate};let Z=$.toJSON(q,z);if(z.onCreate)z.onCreate(Z);return Z}if(typeof $==="bigint"&&!z?.keep)return Number($);return $}hz.toJS=S2});var L$=D((mz)=>{var vz=Fq(),j2=A(),uz=n();class N2{constructor($){Object.defineProperty(this,j2.NODE_TYPE,{value:$})}clone(){let $=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)$.range=this.range.slice();return $}toJS($,{mapAsMap:q,maxAliasCount:z,onAnchor:X,reviver:Z}={}){if(!j2.isDocument($))throw TypeError("A document argument is required");let H={anchors:new Map,doc:$,keep:!0,mapAsMap:q===!0,mapKeyWarned:!1,maxAliasCount:typeof z==="number"?z:100},Q=uz.toJS(this,"",H);if(typeof X==="function")for(let{count:J,res:Y}of H.anchors.values())X(Y,J);return typeof Z==="function"?vz.applyReviver(Z,{"":Q},"",Q):Q}}mz.NodeBase=N2});var k0=D((az)=>{var pz=W$(),lz=y0(),_0=A(),cz=L$(),iz=n();class E2 extends cz.NodeBase{constructor($){super(_0.ALIAS);this.source=$,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve($,q){let z;if(q?.aliasResolveCache)z=q.aliasResolveCache;else if(z=[],lz.visit($,{Node:(Z,H)=>{if(_0.isAlias(H)||_0.hasAnchor(H))z.push(H)}}),q)q.aliasResolveCache=z;let X=void 0;for(let Z of z){if(Z===this)break;if(Z.anchor===this.source)X=Z}return X}toJSON($,q){if(!q)return{source:this.source};let{anchors:z,doc:X,maxAliasCount:Z}=q,H=this.resolve(X,q);if(!H){let J=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(J)}let Q=z.get(H);if(!Q)iz.toJS(H,null,q),Q=z.get(H);if(Q?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(Z>=0){if(Q.count+=1,Q.aliasCount===0)Q.aliasCount=V$(X,H,z);if(Q.count*Q.aliasCount>Z)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return Q.res}toString($,q,z){let X=`*${this.source}`;if($){if(pz.anchorIsValid(this.source),$.options.verifyAliasOrder&&!$.anchors.has(this.source)){let Z=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(Z)}if($.implicitKey)return`${X} `}return X}}function V$($,q,z){if(_0.isAlias(q)){let X=q.resolve($),Z=z&&X&&z.get(X);return Z?Z.count*Z.aliasCount:0}else if(_0.isCollection(q)){let X=0;for(let Z of q.items){let H=V$($,Z,z);if(H>X)X=H}return X}else if(_0.isPair(q)){let X=V$($,q.key,z),Z=V$($,q.value,z);return Math.max(X,Z)}return 1}az.Alias=E2});var b=D((ez)=>{var rz=A(),nz=L$(),oz=n(),tz=($)=>!$||typeof $!=="function"&&typeof $!=="object";class H0 extends nz.NodeBase{constructor($){super(rz.SCALAR);this.value=$}toJSON($,q){return q?.keep?this.value:oz.toJS(this.value,$,q)}toString(){return String(this.value)}}H0.BLOCK_FOLDED="BLOCK_FOLDED";H0.BLOCK_LITERAL="BLOCK_LITERAL";H0.PLAIN="PLAIN";H0.QUOTE_DOUBLE="QUOTE_DOUBLE";H0.QUOTE_SINGLE="QUOTE_SINGLE";ez.Scalar=H0;ez.isScalarValue=tz});var x0=D((QX)=>{var zX=k0(),Q0=A(),b2=b(),XX="tag:yaml.org,2002:";function ZX($,q,z){if(q){let X=z.filter((H)=>H.tag===q),Z=X.find((H)=>!H.format)??X[0];if(!Z)throw Error(`Tag ${q} not found`);return Z}return z.find((X)=>X.identify?.($)&&!X.format)}function HX($,q,z){if(Q0.isDocument($))$=$.contents;if(Q0.isNode($))return $;if(Q0.isPair($)){let G=z.schema[Q0.MAP].createNode?.(z.schema,null,z);return G.items.push($),G}if($ instanceof String||$ instanceof Number||$ instanceof Boolean||typeof BigInt<"u"&&$ instanceof BigInt)$=$.valueOf();let{aliasDuplicateObjects:X,onAnchor:Z,onTagObj:H,schema:Q,sourceObjects:J}=z,Y=void 0;if(X&&$&&typeof $==="object")if(Y=J.get($),Y)return Y.anchor??(Y.anchor=Z($)),new zX.Alias(Y.anchor);else Y={anchor:null,node:null},J.set($,Y);if(q?.startsWith("!!"))q=XX+q.slice(2);let U=ZX($,q,Q.tags);if(!U){if($&&typeof $.toJSON==="function")$=$.toJSON();if(!$||typeof $!=="object"){let G=new b2.Scalar($);if(Y)Y.node=G;return G}U=$ instanceof Map?Q[Q0.MAP]:(Symbol.iterator in Object($))?Q[Q0.SEQ]:Q[Q0.MAP]}if(H)H(U),delete z.onTagObj;let B=U?.createNode?U.createNode(z.schema,$,z):typeof U?.nodeClass?.from==="function"?U.nodeClass.from(z.schema,$,z):new b2.Scalar($);if(q)B.tag=q;else if(!U.default)B.tag=U.tag;if(Y)Y.node=B;return B}QX.createNode=HX});var _$=D((YX)=>{var UX=x0(),l=A(),GX=L$();function Oq($,q,z){let X=z;for(let Z=q.length-1;Z>=0;--Z){let H=q[Z];if(typeof H==="number"&&Number.isInteger(H)&&H>=0){let Q=[];Q[H]=X,X=Q}else X=new Map([[H,X]])}return UX.createNode(X,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:$,sourceObjects:new Map})}var C2=($)=>$==null||typeof $==="object"&&!!$[Symbol.iterator]().next().done;class y2 extends GX.NodeBase{constructor($,q){super($);Object.defineProperty(this,"schema",{value:q,configurable:!0,enumerable:!1,writable:!0})}clone($){let q=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if($)q.schema=$;if(q.items=q.items.map((z)=>l.isNode(z)||l.isPair(z)?z.clone($):z),this.range)q.range=this.range.slice();return q}addIn($,q){if(C2($))this.add(q);else{let[z,...X]=$,Z=this.get(z,!0);if(l.isCollection(Z))Z.addIn(X,q);else if(Z===void 0&&this.schema)this.set(z,Oq(this.schema,X,q));else throw Error(`Expected YAML collection at ${z}. Remaining path: ${X}`)}}deleteIn($){let[q,...z]=$;if(z.length===0)return this.delete(q);let X=this.get(q,!0);if(l.isCollection(X))return X.deleteIn(z);else throw Error(`Expected YAML collection at ${q}. Remaining path: ${z}`)}getIn($,q){let[z,...X]=$,Z=this.get(z,!0);if(X.length===0)return!q&&l.isScalar(Z)?Z.value:Z;else return l.isCollection(Z)?Z.getIn(X,q):void 0}hasAllNullValues($){return this.items.every((q)=>{if(!l.isPair(q))return!1;let z=q.value;return z==null||$&&l.isScalar(z)&&z.value==null&&!z.commentBefore&&!z.comment&&!z.tag})}hasIn($){let[q,...z]=$;if(z.length===0)return this.has(q);let X=this.get(q,!0);return l.isCollection(X)?X.hasIn(z):!1}setIn($,q){let[z,...X]=$;if(X.length===0)this.set(z,q);else{let Z=this.get(z,!0);if(l.isCollection(Z))Z.setIn(X,q);else if(Z===void 0&&this.schema)this.set(z,Oq(this.schema,X,q));else throw Error(`Expected YAML collection at ${z}. Remaining path: ${X}`)}}}YX.Collection=y2;YX.collectionFromPath=Oq;YX.isEmptyPath=C2});var h0=D((_X)=>{var LX=($)=>$.replace(/^(?!$)(?: $)?/gm,"#");function Aq($,q){if(/^\n+$/.test($))return $.substring(1);return q?$.replace(/^(?! *$)/gm,q):$}var VX=($,q,z)=>$.endsWith(`
30
+ `)?Aq(z,q):z.includes(`
31
31
  `)?`
32
- `+O$(X,$):(q.endsWith(" ")?"":" ")+X;_X.indentComment=O$;_X.lineComment=BX;_X.stringifyComment=LX});var f2=I((RX)=>{function DX(q,$,X="flow",{indentAtStart:Z,lineWidth:H=80,minContentWidth:z=20,onFold:U,onOverflow:Q}={}){if(!H||H<0)return q;if(H<z)z=0;let J=Math.max(1+z,1+H-$.length);if(q.length<=J)return q;let G=[],Y={},T=H-$.length;if(typeof Z==="number")if(Z>H-Math.max(2,z))G.push(0);else T=H-Z;let L=void 0,_=void 0,V=!1,B=-1,W=-1,D=-1;if(X==="block"){if(B=y2(q,B,$.length),B!==-1)T=B+J}for(let K;K=q[B+=1];){if(X==="quoted"&&K==="\\"){switch(W=B,q[B+1]){case"x":B+=3;break;case"u":B+=5;break;case"U":B+=9;break;default:B+=1}D=B}if(K===`
33
- `){if(X==="block")B=y2(q,B,$.length);T=B+$.length+J,L=void 0}else{if(K===" "&&_&&_!==" "&&_!==`
34
- `&&_!=="\t"){let w=q[B+1];if(w&&w!==" "&&w!==`
35
- `&&w!=="\t")L=B}if(B>=T)if(L)G.push(L),T=L+J,L=void 0;else if(X==="quoted"){while(_===" "||_==="\t")_=K,K=q[B+=1],V=!0;let w=B>D+1?B-2:W-1;if(Y[w])return q;G.push(w),Y[w]=!0,T=w+J,L=void 0}else V=!0}_=K}if(V&&Q)Q();if(G.length===0)return q;if(U)U();let R=q.slice(0,G[0]);for(let K=0;K<G.length;++K){let w=G[K],F=G[K+1]||q.length;if(w===0)R=`
36
- ${$}${q.slice(0,F)}`;else{if(X==="quoted"&&Y[w])R+=`${q[w]}\\`;R+=`
37
- ${$}${q.slice(w+1,F)}`}}return R}function y2(q,$,X){let Z=$,H=$+1,z=q[H];while(z===" "||z==="\t")if($<H+X)z=q[++$];else{do z=q[++$];while(z&&z!==`
38
- `);Z=$,H=$+1,z=q[H]}return Z}RX.FOLD_BLOCK="block";RX.FOLD_FLOW="flow";RX.FOLD_QUOTED="quoted";RX.foldFlowLines=DX});var h0=I((SX)=>{var u=b(),o=f2(),Wq=(q,$)=>({indentAtStart:$?q.indent.length:q.indentAtStart,lineWidth:q.options.lineWidth,minContentWidth:q.options.minContentWidth}),Vq=(q)=>/^(%|---|\.\.\.)/m.test(q);function FX(q,$,X){if(!$||$<0)return!1;let Z=$-X,H=q.length;if(H<=Z)return!1;for(let z=0,U=0;z<H;++z)if(q[z]===`
39
- `){if(z-U>Z)return!0;if(U=z+1,H-U<=Z)return!1}return!0}function k0(q,$){let X=JSON.stringify(q);if($.options.doubleQuotedAsJSON)return X;let{implicitKey:Z}=$,H=$.options.doubleQuotedMinMultiLineLength,z=$.indent||(Vq(q)?" ":""),U="",Q=0;for(let J=0,G=X[J];G;G=X[++J]){if(G===" "&&X[J+1]==="\\"&&X[J+2]==="n")U+=X.slice(Q,J)+"\\ ",J+=1,Q=J,G="\\";if(G==="\\")switch(X[J+1]){case"u":{U+=X.slice(Q,J);let Y=X.substr(J+2,4);switch(Y){case"0000":U+="\\0";break;case"0007":U+="\\a";break;case"000b":U+="\\v";break;case"001b":U+="\\e";break;case"0085":U+="\\N";break;case"00a0":U+="\\_";break;case"2028":U+="\\L";break;case"2029":U+="\\P";break;default:if(Y.substr(0,2)==="00")U+="\\x"+Y.substr(2);else U+=X.substr(J,6)}J+=5,Q=J+1}break;case"n":if(Z||X[J+2]==='"'||X.length<H)J+=1;else{U+=X.slice(Q,J)+`
40
-
41
- `;while(X[J+2]==="\\"&&X[J+3]==="n"&&X[J+4]!=='"')U+=`
42
- `,J+=2;if(U+=z,X[J+2]===" ")U+="\\";J+=1,Q=J+1}break;default:J+=1}}return U=Q?U+X.slice(Q):X,Z?U:o.foldFlowLines(U,z,o.FOLD_QUOTED,Wq($,!1))}function A$(q,$){if($.options.singleQuote===!1||$.implicitKey&&q.includes(`
43
- `)||/[ \t]\n|\n[ \t]/.test(q))return k0(q,$);let X=$.indent||(Vq(q)?" ":""),Z="'"+q.replace(/'/g,"''").replace(/\n+/g,`$&
44
- ${X}`)+"'";return $.implicitKey?Z:o.foldFlowLines(Z,X,o.FOLD_FLOW,Wq($,!1))}function I0(q,$){let{singleQuote:X}=$.options,Z;if(X===!1)Z=k0;else{let H=q.includes('"'),z=q.includes("'");if(H&&!z)Z=A$;else if(z&&!H)Z=k0;else Z=X?A$:k0}return Z(q,$)}var S$;try{S$=new RegExp(`(^|(?<!
32
+ `+Aq(z,q):($.endsWith(" ")?"":" ")+z;_X.indentComment=Aq;_X.lineComment=VX;_X.stringifyComment=LX});var k2=D((MX)=>{function wX($,q,z="flow",{indentAtStart:X,lineWidth:Z=80,minContentWidth:H=20,onFold:Q,onOverflow:J}={}){if(!Z||Z<0)return $;if(Z<H)H=0;let Y=Math.max(1+H,1+Z-q.length);if($.length<=Y)return $;let U=[],B={},G=Z-q.length;if(typeof X==="number")if(X>Z-Math.max(2,H))U.push(0);else G=Z-X;let T=void 0,L=void 0,_=!1,W=-1,V=-1,I=-1;if(z==="block"){if(W=f2($,W,q.length),W!==-1)G=W+Y}for(let P;P=$[W+=1];){if(z==="quoted"&&P==="\\"){switch(V=W,$[W+1]){case"x":W+=3;break;case"u":W+=5;break;case"U":W+=9;break;default:W+=1}I=W}if(P===`
33
+ `){if(z==="block")W=f2($,W,q.length);G=W+q.length+Y,T=void 0}else{if(P===" "&&L&&L!==" "&&L!==`
34
+ `&&L!=="\t"){let K=$[W+1];if(K&&K!==" "&&K!==`
35
+ `&&K!=="\t")T=W}if(W>=G)if(T)U.push(T),G=T+Y,T=void 0;else if(z==="quoted"){while(L===" "||L==="\t")L=P,P=$[W+=1],_=!0;let K=W>I+1?W-2:V-1;if(B[K])return $;U.push(K),B[K]=!0,G=K+Y,T=void 0}else _=!0}L=P}if(_&&J)J();if(U.length===0)return $;if(Q)Q();let R=$.slice(0,U[0]);for(let P=0;P<U.length;++P){let K=U[P],F=U[P+1]||$.length;if(K===0)R=`
36
+ ${q}${$.slice(0,F)}`;else{if(z==="quoted"&&B[K])R+=`${$[K]}\\`;R+=`
37
+ ${q}${$.slice(K+1,F)}`}}return R}function f2($,q,z){let X=q,Z=q+1,H=$[Z];while(H===" "||H==="\t")if(q<Z+z)H=$[++q];else{do H=$[++q];while(H&&H!==`
38
+ `);X=q,Z=q+1,H=$[Z]}return X}MX.FOLD_BLOCK="block";MX.FOLD_FLOW="flow";MX.FOLD_QUOTED="quoted";MX.foldFlowLines=wX});var v0=D((NX)=>{var v=b(),o=k2(),I$=($,q)=>({indentAtStart:q?$.indent.length:$.indentAtStart,lineWidth:$.options.lineWidth,minContentWidth:$.options.minContentWidth}),R$=($)=>/^(%|---|\.\.\.)/m.test($);function AX($,q,z){if(!q||q<0)return!1;let X=q-z,Z=$.length;if(Z<=X)return!1;for(let H=0,Q=0;H<Z;++H)if($[H]===`
39
+ `){if(H-Q>X)return!0;if(Q=H+1,Z-Q<=X)return!1}return!0}function g0($,q){let z=JSON.stringify($);if(q.options.doubleQuotedAsJSON)return z;let{implicitKey:X}=q,Z=q.options.doubleQuotedMinMultiLineLength,H=q.indent||(R$($)?" ":""),Q="",J=0;for(let Y=0,U=z[Y];U;U=z[++Y]){if(U===" "&&z[Y+1]==="\\"&&z[Y+2]==="n")Q+=z.slice(J,Y)+"\\ ",Y+=1,J=Y,U="\\";if(U==="\\")switch(z[Y+1]){case"u":{Q+=z.slice(J,Y);let B=z.substr(Y+2,4);switch(B){case"0000":Q+="\\0";break;case"0007":Q+="\\a";break;case"000b":Q+="\\v";break;case"001b":Q+="\\e";break;case"0085":Q+="\\N";break;case"00a0":Q+="\\_";break;case"2028":Q+="\\L";break;case"2029":Q+="\\P";break;default:if(B.substr(0,2)==="00")Q+="\\x"+B.substr(2);else Q+=z.substr(Y,6)}Y+=5,J=Y+1}break;case"n":if(X||z[Y+2]==='"'||z.length<Z)Y+=1;else{Q+=z.slice(J,Y)+`
40
+
41
+ `;while(z[Y+2]==="\\"&&z[Y+3]==="n"&&z[Y+4]!=='"')Q+=`
42
+ `,Y+=2;if(Q+=H,z[Y+2]===" ")Q+="\\";Y+=1,J=Y+1}break;default:Y+=1}}return Q=J?Q+z.slice(J):z,X?Q:o.foldFlowLines(Q,H,o.FOLD_QUOTED,I$(q,!1))}function Sq($,q){if(q.options.singleQuote===!1||q.implicitKey&&$.includes(`
43
+ `)||/[ \t]\n|\n[ \t]/.test($))return g0($,q);let z=q.indent||(R$($)?" ":""),X="'"+$.replace(/'/g,"''").replace(/\n+/g,`$&
44
+ ${z}`)+"'";return q.implicitKey?X:o.foldFlowLines(X,z,o.FOLD_FLOW,I$(q,!1))}function D0($,q){let{singleQuote:z}=q.options,X;if(z===!1)X=g0;else{let Z=$.includes('"'),H=$.includes("'");if(Z&&!H)X=Sq;else if(H&&!Z)X=g0;else X=z?Sq:g0}return X($,q)}var jq;try{jq=new RegExp(`(^|(?<!
45
45
  ))
46
46
  +(?!
47
- |$)`,"g")}catch{S$=/\n+(?!\n|$)/g}function _q({comment:q,type:$,value:X},Z,H,z){let{blockQuote:U,commentString:Q,lineWidth:J}=Z.options;if(!U||/\n[\t ]+$/.test(X))return I0(X,Z);let G=Z.indent||(Z.forceBlockIndent||Vq(X)?" ":""),Y=U==="literal"?!0:U==="folded"||$===u.Scalar.BLOCK_FOLDED?!1:$===u.Scalar.BLOCK_LITERAL?!0:!FX(X,J,G.length);if(!X)return Y?`|
47
+ |$)`,"g")}catch{jq=/\n+(?!\n|$)/g}function D$({comment:$,type:q,value:z},X,Z,H){let{blockQuote:Q,commentString:J,lineWidth:Y}=X.options;if(!Q||/\n[\t ]+$/.test(z))return D0(z,X);let U=X.indent||(X.forceBlockIndent||R$(z)?" ":""),B=Q==="literal"?!0:Q==="folded"||q===v.Scalar.BLOCK_FOLDED?!1:q===v.Scalar.BLOCK_LITERAL?!0:!AX(z,Y,U.length);if(!z)return B?`|
48
48
  `:`>
49
- `;let T,L;for(L=X.length;L>0;--L){let F=X[L-1];if(F!==`
50
- `&&F!=="\t"&&F!==" ")break}let _=X.substring(L),V=_.indexOf(`
51
- `);if(V===-1)T="-";else if(X===_||V!==_.length-1){if(T="+",z)z()}else T="";if(_){if(X=X.slice(0,-_.length),_[_.length-1]===`
52
- `)_=_.slice(0,-1);_=_.replace(S$,`$&${G}`)}let B=!1,W,D=-1;for(W=0;W<X.length;++W){let F=X[W];if(F===" ")B=!0;else if(F===`
53
- `)D=W;else break}let R=X.substring(0,D<W?D+1:W);if(R)X=X.substring(R.length),R=R.replace(/\n+/g,`$&${G}`);let w=(B?G?"2":"1":"")+T;if(q){if(w+=" "+Q(q.replace(/ ?[\r\n]+/g," ")),H)H()}if(!Y){let F=X.replace(/\n+/g,`
54
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${G}`),O=!1,j=Wq(Z,!0);if(U!=="folded"&&$!==u.Scalar.BLOCK_FOLDED)j.onOverflow=()=>{O=!0};let P=o.foldFlowLines(`${R}${F}${_}`,G,o.FOLD_BLOCK,j);if(!O)return`>${w}
55
- ${G}${P}`}return X=X.replace(/\n+/g,`$&${G}`),`|${w}
56
- ${G}${R}${X}${_}`}function OX(q,$,X,Z){let{type:H,value:z}=q,{actualString:U,implicitKey:Q,indent:J,indentStep:G,inFlow:Y}=$;if(Q&&z.includes(`
57
- `)||Y&&/[[\]{},]/.test(z))return I0(z,$);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(z))return Q||Y||!z.includes(`
58
- `)?I0(z,$):_q(q,$,X,Z);if(!Q&&!Y&&H!==u.Scalar.PLAIN&&z.includes(`
59
- `))return _q(q,$,X,Z);if(Vq(z)){if(J==="")return $.forceBlockIndent=!0,_q(q,$,X,Z);else if(Q&&J===G)return I0(z,$)}let T=z.replace(/\n+/g,`$&
60
- ${J}`);if(U){let L=(B)=>B.default&&B.tag!=="tag:yaml.org,2002:str"&&B.test?.test(T),{compat:_,tags:V}=$.doc.schema;if(V.some(L)||_?.some(L))return I0(z,$)}return Q?T:o.foldFlowLines(T,J,o.FOLD_FLOW,Wq($,!1))}function AX(q,$,X,Z){let{implicitKey:H,inFlow:z}=$,U=typeof q.value==="string"?q:Object.assign({},q,{value:String(q.value)}),{type:Q}=q;if(Q!==u.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(U.value))Q=u.Scalar.QUOTE_DOUBLE}let J=(Y)=>{switch(Y){case u.Scalar.BLOCK_FOLDED:case u.Scalar.BLOCK_LITERAL:return H||z?I0(U.value,$):_q(U,$,X,Z);case u.Scalar.QUOTE_DOUBLE:return k0(U.value,$);case u.Scalar.QUOTE_SINGLE:return A$(U.value,$);case u.Scalar.PLAIN:return OX(U,$,X,Z);default:return null}},G=J(Q);if(G===null){let{defaultKeyType:Y,defaultStringType:T}=$.options,L=H&&Y||T;if(G=J(L),G===null)throw Error(`Unsupported default string type ${L}`)}return G}SX.stringifyString=AX});var g0=I((kX)=>{var NX=Tq(),t=A(),EX=x0(),bX=h0();function CX(q,$){let X=Object.assign({blockQuote:!0,commentString:EX.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;switch(X.collectionStyle){case"block":Z=!1;break;case"flow":Z=!0;break;default:Z=null}return{anchors:new Set,doc:q,flowCollectionPadding:X.flowCollectionPadding?" ":"",indent:"",indentStep:typeof X.indent==="number"?" ".repeat(X.indent):" ",inFlow:Z,options:X}}function yX(q,$){if($.tag){let H=q.filter((z)=>z.tag===$.tag);if(H.length>0)return H.find((z)=>z.format===$.format)??H[0]}let X=void 0,Z;if(t.isScalar($)){Z=$.value;let H=q.filter((z)=>z.identify?.(Z));if(H.length>1){let z=H.filter((U)=>U.test);if(z.length>0)H=z}X=H.find((z)=>z.format===$.format)??H.find((z)=>!z.format)}else Z=$,X=q.find((H)=>H.nodeClass&&Z instanceof H.nodeClass);if(!X){let H=Z?.constructor?.name??(Z===null?"null":typeof Z);throw Error(`Tag not resolved for ${H} value`)}return X}function fX(q,$,{anchors:X,doc:Z}){if(!Z.directives)return"";let H=[],z=(t.isScalar(q)||t.isCollection(q))&&q.anchor;if(z&&NX.anchorIsValid(z))X.add(z),H.push(`&${z}`);let U=q.tag??($.default?null:$.tag);if(U)H.push(Z.directives.tagString(U));return H.join(" ")}function xX(q,$,X,Z){if(t.isPair(q))return q.toString($,X,Z);if(t.isAlias(q)){if($.doc.directives)return q.toString($);if($.resolvedAliases?.has(q))throw TypeError("Cannot stringify circular structure without alias nodes");else{if($.resolvedAliases)$.resolvedAliases.add(q);else $.resolvedAliases=new Set([q]);q=q.resolve($.doc)}}let H=void 0,z=t.isNode(q)?q:$.doc.createNode(q,{onTagObj:(J)=>H=J});H??(H=yX($.doc.schema.tags,z));let U=fX(z,H,$);if(U.length>0)$.indentAtStart=($.indentAtStart??0)+U.length+1;let Q=typeof H.stringify==="function"?H.stringify(z,$,X,Z):t.isScalar(z)?bX.stringifyString(z,$,X,Z):z.toString($,X,Z);if(!U)return Q;return t.isScalar(z)||Q[0]==="{"||Q[0]==="["?`${U} ${Q}`:`${U}
61
- ${$.indent}${Q}`}kX.createStringifyContext=CX;kX.stringify=xX});var h2=I((vX)=>{var s=A(),x2=b(),k2=g0(),u0=x0();function uX({key:q,value:$},X,Z,H){let{allNullValues:z,doc:U,indent:Q,indentStep:J,options:{commentString:G,indentSeq:Y,simpleKeys:T}}=X,L=s.isNode(q)&&q.comment||null;if(T){if(L)throw Error("With simple keys, key nodes cannot have comments");if(s.isCollection(q)||!s.isNode(q)&&typeof q==="object")throw Error("With simple keys, collection cannot be used as a key value")}let _=!T&&(!q||L&&$==null&&!X.inFlow||s.isCollection(q)||(s.isScalar(q)?q.type===x2.Scalar.BLOCK_FOLDED||q.type===x2.Scalar.BLOCK_LITERAL:typeof q==="object"));X=Object.assign({},X,{allNullValues:!1,implicitKey:!_&&(T||!z),indent:Q+J});let V=!1,B=!1,W=k2.stringify(q,X,()=>V=!0,()=>B=!0);if(!_&&!X.inFlow&&W.length>1024){if(T)throw Error("With simple keys, single line scalar must not span more than 1024 characters");_=!0}if(X.inFlow){if(z||$==null){if(V&&Z)Z();return W===""?"?":_?`? ${W}`:W}}else if(z&&!T||$==null&&_){if(W=`? ${W}`,L&&!V)W+=u0.lineComment(W,X.indent,G(L));else if(B&&H)H();return W}if(V)L=null;if(_){if(L)W+=u0.lineComment(W,X.indent,G(L));W=`? ${W}
62
- ${Q}:`}else if(W=`${W}:`,L)W+=u0.lineComment(W,X.indent,G(L));let D,R,K;if(s.isNode($))D=!!$.spaceBefore,R=$.commentBefore,K=$.comment;else if(D=!1,R=null,K=null,$&&typeof $==="object")$=U.createNode($);if(X.implicitKey=!1,!_&&!L&&s.isScalar($))X.indentAtStart=W.length+1;if(B=!1,!Y&&J.length>=2&&!X.inFlow&&!_&&s.isSeq($)&&!$.flow&&!$.tag&&!$.anchor)X.indent=X.indent.substring(2);let w=!1,F=k2.stringify($,X,()=>w=!0,()=>B=!0),O=" ";if(L||D||R){if(O=D?`
63
- `:"",R){let j=G(R);O+=`
64
- ${u0.indentComment(j,X.indent)}`}if(F===""&&!X.inFlow){if(O===`
65
- `&&K)O=`
49
+ `;let G,T;for(T=z.length;T>0;--T){let F=z[T-1];if(F!==`
50
+ `&&F!=="\t"&&F!==" ")break}let L=z.substring(T),_=L.indexOf(`
51
+ `);if(_===-1)G="-";else if(z===L||_!==L.length-1){if(G="+",H)H()}else G="";if(L){if(z=z.slice(0,-L.length),L[L.length-1]===`
52
+ `)L=L.slice(0,-1);L=L.replace(jq,`$&${U}`)}let W=!1,V,I=-1;for(V=0;V<z.length;++V){let F=z[V];if(F===" ")W=!0;else if(F===`
53
+ `)I=V;else break}let R=z.substring(0,I<V?I+1:V);if(R)z=z.substring(R.length),R=R.replace(/\n+/g,`$&${U}`);let K=(W?U?"2":"1":"")+G;if($){if(K+=" "+J($.replace(/ ?[\r\n]+/g," ")),Z)Z()}if(!B){let F=z.replace(/\n+/g,`
54
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${U}`),O=!1,j=I$(X,!0);if(Q!=="folded"&&q!==v.Scalar.BLOCK_FOLDED)j.onOverflow=()=>{O=!0};let w=o.foldFlowLines(`${R}${F}${L}`,U,o.FOLD_BLOCK,j);if(!O)return`>${K}
55
+ ${U}${w}`}return z=z.replace(/\n+/g,`$&${U}`),`|${K}
56
+ ${U}${R}${z}${L}`}function SX($,q,z,X){let{type:Z,value:H}=$,{actualString:Q,implicitKey:J,indent:Y,indentStep:U,inFlow:B}=q;if(J&&H.includes(`
57
+ `)||B&&/[[\]{},]/.test(H))return D0(H,q);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(H))return J||B||!H.includes(`
58
+ `)?D0(H,q):D$($,q,z,X);if(!J&&!B&&Z!==v.Scalar.PLAIN&&H.includes(`
59
+ `))return D$($,q,z,X);if(R$(H)){if(Y==="")return q.forceBlockIndent=!0,D$($,q,z,X);else if(J&&Y===U)return D0(H,q)}let G=H.replace(/\n+/g,`$&
60
+ ${Y}`);if(Q){let T=(W)=>W.default&&W.tag!=="tag:yaml.org,2002:str"&&W.test?.test(G),{compat:L,tags:_}=q.doc.schema;if(_.some(T)||L?.some(T))return D0(H,q)}return J?G:o.foldFlowLines(G,Y,o.FOLD_FLOW,I$(q,!1))}function jX($,q,z,X){let{implicitKey:Z,inFlow:H}=q,Q=typeof $.value==="string"?$:Object.assign({},$,{value:String($.value)}),{type:J}=$;if(J!==v.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(Q.value))J=v.Scalar.QUOTE_DOUBLE}let Y=(B)=>{switch(B){case v.Scalar.BLOCK_FOLDED:case v.Scalar.BLOCK_LITERAL:return Z||H?D0(Q.value,q):D$(Q,q,z,X);case v.Scalar.QUOTE_DOUBLE:return g0(Q.value,q);case v.Scalar.QUOTE_SINGLE:return Sq(Q.value,q);case v.Scalar.PLAIN:return SX(Q,q,z,X);default:return null}},U=Y(J);if(U===null){let{defaultKeyType:B,defaultStringType:G}=q.options,T=Z&&B||G;if(U=Y(T),U===null)throw Error(`Unsupported default string type ${T}`)}return U}NX.stringifyString=jX});var u0=D((gX)=>{var bX=W$(),t=A(),CX=h0(),yX=v0();function fX($,q){let z=Object.assign({blockQuote:!0,commentString:CX.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},$.schema.toStringOptions,q),X;switch(z.collectionStyle){case"block":X=!1;break;case"flow":X=!0;break;default:X=null}return{anchors:new Set,doc:$,flowCollectionPadding:z.flowCollectionPadding?" ":"",indent:"",indentStep:typeof z.indent==="number"?" ".repeat(z.indent):" ",inFlow:X,options:z}}function kX($,q){if(q.tag){let Z=$.filter((H)=>H.tag===q.tag);if(Z.length>0)return Z.find((H)=>H.format===q.format)??Z[0]}let z=void 0,X;if(t.isScalar(q)){X=q.value;let Z=$.filter((H)=>H.identify?.(X));if(Z.length>1){let H=Z.filter((Q)=>Q.test);if(H.length>0)Z=H}z=Z.find((H)=>H.format===q.format)??Z.find((H)=>!H.format)}else X=q,z=$.find((Z)=>Z.nodeClass&&X instanceof Z.nodeClass);if(!z){let Z=X?.constructor?.name??(X===null?"null":typeof X);throw Error(`Tag not resolved for ${Z} value`)}return z}function xX($,q,{anchors:z,doc:X}){if(!X.directives)return"";let Z=[],H=(t.isScalar($)||t.isCollection($))&&$.anchor;if(H&&bX.anchorIsValid(H))z.add(H),Z.push(`&${H}`);let Q=$.tag??(q.default?null:q.tag);if(Q)Z.push(X.directives.tagString(Q));return Z.join(" ")}function hX($,q,z,X){if(t.isPair($))return $.toString(q,z,X);if(t.isAlias($)){if(q.doc.directives)return $.toString(q);if(q.resolvedAliases?.has($))throw TypeError("Cannot stringify circular structure without alias nodes");else{if(q.resolvedAliases)q.resolvedAliases.add($);else q.resolvedAliases=new Set([$]);$=$.resolve(q.doc)}}let Z=void 0,H=t.isNode($)?$:q.doc.createNode($,{onTagObj:(Y)=>Z=Y});Z??(Z=kX(q.doc.schema.tags,H));let Q=xX(H,Z,q);if(Q.length>0)q.indentAtStart=(q.indentAtStart??0)+Q.length+1;let J=typeof Z.stringify==="function"?Z.stringify(H,q,z,X):t.isScalar(H)?yX.stringifyString(H,q,z,X):H.toString(q,z,X);if(!Q)return J;return t.isScalar(H)||J[0]==="{"||J[0]==="["?`${Q} ${J}`:`${Q}
61
+ ${q.indent}${J}`}gX.createStringifyContext=fX;gX.stringify=hX});var g2=D((dX)=>{var s=A(),x2=b(),h2=u0(),m0=h0();function mX({key:$,value:q},z,X,Z){let{allNullValues:H,doc:Q,indent:J,indentStep:Y,options:{commentString:U,indentSeq:B,simpleKeys:G}}=z,T=s.isNode($)&&$.comment||null;if(G){if(T)throw Error("With simple keys, key nodes cannot have comments");if(s.isCollection($)||!s.isNode($)&&typeof $==="object")throw Error("With simple keys, collection cannot be used as a key value")}let L=!G&&(!$||T&&q==null&&!z.inFlow||s.isCollection($)||(s.isScalar($)?$.type===x2.Scalar.BLOCK_FOLDED||$.type===x2.Scalar.BLOCK_LITERAL:typeof $==="object"));z=Object.assign({},z,{allNullValues:!1,implicitKey:!L&&(G||!H),indent:J+Y});let _=!1,W=!1,V=h2.stringify($,z,()=>_=!0,()=>W=!0);if(!L&&!z.inFlow&&V.length>1024){if(G)throw Error("With simple keys, single line scalar must not span more than 1024 characters");L=!0}if(z.inFlow){if(H||q==null){if(_&&X)X();return V===""?"?":L?`? ${V}`:V}}else if(H&&!G||q==null&&L){if(V=`? ${V}`,T&&!_)V+=m0.lineComment(V,z.indent,U(T));else if(W&&Z)Z();return V}if(_)T=null;if(L){if(T)V+=m0.lineComment(V,z.indent,U(T));V=`? ${V}
62
+ ${J}:`}else if(V=`${V}:`,T)V+=m0.lineComment(V,z.indent,U(T));let I,R,P;if(s.isNode(q))I=!!q.spaceBefore,R=q.commentBefore,P=q.comment;else if(I=!1,R=null,P=null,q&&typeof q==="object")q=Q.createNode(q);if(z.implicitKey=!1,!L&&!T&&s.isScalar(q))z.indentAtStart=V.length+1;if(W=!1,!B&&Y.length>=2&&!z.inFlow&&!L&&s.isSeq(q)&&!q.flow&&!q.tag&&!q.anchor)z.indent=z.indent.substring(2);let K=!1,F=h2.stringify(q,z,()=>K=!0,()=>W=!0),O=" ";if(T||I||R){if(O=I?`
63
+ `:"",R){let j=U(R);O+=`
64
+ ${m0.indentComment(j,z.indent)}`}if(F===""&&!z.inFlow){if(O===`
65
+ `&&P)O=`
66
66
 
67
67
  `}else O+=`
68
- ${X.indent}`}else if(!_&&s.isCollection($)){let j=F[0],P=F.indexOf(`
69
- `),C=P!==-1,r=X.inFlow??$.flow??$.items.length===0;if(C||!r){let L0=!1;if(C&&(j==="&"||j==="!")){let y=F.indexOf(" ");if(j==="&"&&y!==-1&&y<P&&F[y+1]==="!")y=F.indexOf(" ",y+1);if(y===-1||P<y)L0=!0}if(!L0)O=`
70
- ${X.indent}`}}else if(F===""||F[0]===`
71
- `)O="";if(W+=O+F,X.inFlow){if(w&&Z)Z()}else if(K&&!w)W+=u0.lineComment(W,X.indent,G(K));else if(B&&H)H();return W}vX.stringifyPair=uX});var j$=I((lX)=>{var g2=c("process");function dX(q,...$){if(q==="debug")console.log(...$)}function pX(q,$){if(q==="debug"||q==="warn")if(typeof g2.emitWarning==="function")g2.emitWarning($);else console.warn($)}lX.debug=dX;lX.warn=pX});var Rq=I((sX)=>{var v0=A(),u2=b(),Iq="<<",Dq={identify:(q)=>q===Iq||typeof q==="symbol"&&q.description===Iq,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new u2.Scalar(Symbol(Iq)),{addToJSMap:v2}),stringify:()=>Iq},aX=(q,$)=>(Dq.identify($)||v0.isScalar($)&&(!$.type||$.type===u2.Scalar.PLAIN)&&Dq.identify($.value))&&q?.doc.schema.tags.some((X)=>X.tag===Dq.tag&&X.default);function v2(q,$,X){if(X=q&&v0.isAlias(X)?X.resolve(q.doc):X,v0.isSeq(X))for(let Z of X.items)N$(q,$,Z);else if(Array.isArray(X))for(let Z of X)N$(q,$,Z);else N$(q,$,X)}function N$(q,$,X){let Z=q&&v0.isAlias(X)?X.resolve(q.doc):X;if(!v0.isMap(Z))throw Error("Merge sources must be maps or map aliases");let H=Z.toJSON(null,q,Map);for(let[z,U]of H)if($ instanceof Map){if(!$.has(z))$.set(z,U)}else if($ instanceof Set)$.add(z);else if(!Object.prototype.hasOwnProperty.call($,z))Object.defineProperty($,z,{value:U,writable:!0,enumerable:!0,configurable:!0});return $}sX.addMergeToJSMap=v2;sX.isMergeKey=aX;sX.merge=Dq});var b$=I((XZ)=>{var tX=j$(),m2=Rq(),eX=g0(),d2=A(),E$=n();function qZ(q,$,{key:X,value:Z}){if(d2.isNode(X)&&X.addToJSMap)X.addToJSMap(q,$,Z);else if(m2.isMergeKey(q,X))m2.addMergeToJSMap(q,$,Z);else{let H=E$.toJS(X,"",q);if($ instanceof Map)$.set(H,E$.toJS(Z,H,q));else if($ instanceof Set)$.add(H);else{let z=$Z(X,H,q),U=E$.toJS(Z,z,q);if(z in $)Object.defineProperty($,z,{value:U,writable:!0,enumerable:!0,configurable:!0});else $[z]=U}}return $}function $Z(q,$,X){if($===null)return"";if(typeof $!=="object")return String($);if(d2.isNode(q)&&X?.doc){let Z=eX.createStringifyContext(X.doc,{});Z.anchors=new Set;for(let z of X.anchors.keys())Z.anchors.add(z.anchor);Z.inFlow=!0,Z.inStringifyKey=!0;let H=q.toString(Z);if(!X.mapKeyWarned){let z=JSON.stringify(H);if(z.length>40)z=z.substring(0,36)+'..."';tX.warn(X.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${z}. Set mapAsMap: true to use object keys.`),X.mapKeyWarned=!0}return H}return JSON.stringify($)}XZ.addPairToJSMap=qZ});var e=I((QZ)=>{var p2=f0(),HZ=h2(),zZ=b$(),Pq=A();function UZ(q,$,X){let Z=p2.createNode(q,void 0,X),H=p2.createNode($,void 0,X);return new Mq(Z,H)}class Mq{constructor(q,$=null){Object.defineProperty(this,Pq.NODE_TYPE,{value:Pq.PAIR}),this.key=q,this.value=$}clone(q){let{key:$,value:X}=this;if(Pq.isNode($))$=$.clone(q);if(Pq.isNode(X))X=X.clone(q);return new Mq($,X)}toJSON(q,$){let X=$?.mapAsMap?new Map:{};return zZ.addPairToJSMap($,X,this)}toString(q,$,X){return q?.doc?HZ.stringifyPair(this,q,$,X):JSON.stringify(this)}}QZ.Pair=Mq;QZ.createPair=UZ});var C$=I((BZ)=>{var Q0=A(),l2=g0(),Kq=x0();function TZ(q,$,X){return($.inFlow??q.flow?LZ:YZ)(q,$,X)}function YZ({comment:q,items:$},X,{blockItemPrefix:Z,flowChars:H,itemIndent:z,onChompKeep:U,onComment:Q}){let{indent:J,options:{commentString:G}}=X,Y=Object.assign({},X,{indent:z,type:null}),T=!1,L=[];for(let V=0;V<$.length;++V){let B=$[V],W=null;if(Q0.isNode(B)){if(!T&&B.spaceBefore)L.push("");if(wq(X,L,B.commentBefore,T),B.comment)W=B.comment}else if(Q0.isPair(B)){let R=Q0.isNode(B.key)?B.key:null;if(R){if(!T&&R.spaceBefore)L.push("");wq(X,L,R.commentBefore,T)}}T=!1;let D=l2.stringify(B,Y,()=>W=null,()=>T=!0);if(W)D+=Kq.lineComment(D,z,G(W));if(T&&W)T=!1;L.push(Z+D)}let _;if(L.length===0)_=H.start+H.end;else{_=L[0];for(let V=1;V<L.length;++V){let B=L[V];_+=B?`
72
- ${J}${B}`:`
73
- `}}if(q){if(_+=`
74
- `+Kq.indentComment(G(q),J),Q)Q()}else if(T&&U)U();return _}function LZ({items:q},$,{flowChars:X,itemIndent:Z}){let{indent:H,indentStep:z,flowCollectionPadding:U,options:{commentString:Q}}=$;Z+=z;let J=Object.assign({},$,{indent:Z,inFlow:!0,type:null}),G=!1,Y=0,T=[];for(let V=0;V<q.length;++V){let B=q[V],W=null;if(Q0.isNode(B)){if(B.spaceBefore)T.push("");if(wq($,T,B.commentBefore,!1),B.comment)W=B.comment}else if(Q0.isPair(B)){let R=Q0.isNode(B.key)?B.key:null;if(R){if(R.spaceBefore)T.push("");if(wq($,T,R.commentBefore,!1),R.comment)G=!0}let K=Q0.isNode(B.value)?B.value:null;if(K){if(K.comment)W=K.comment;if(K.commentBefore)G=!0}else if(B.value==null&&R?.comment)W=R.comment}if(W)G=!0;let D=l2.stringify(B,J,()=>W=null);if(V<q.length-1)D+=",";if(W)D+=Kq.lineComment(D,Z,Q(W));if(!G&&(T.length>Y||D.includes(`
75
- `)))G=!0;T.push(D),Y=T.length}let{start:L,end:_}=X;if(T.length===0)return L+_;else{if(!G){let V=T.reduce((B,W)=>B+W.length+2,2);G=$.options.lineWidth>0&&V>$.options.lineWidth}if(G){let V=L;for(let B of T)V+=B?`
76
- ${z}${H}${B}`:`
77
- `;return`${V}
78
- ${H}${_}`}else return`${L}${U}${T.join(" ")}${U}${_}`}}function wq({indent:q,options:{commentString:$}},X,Z,H){if(Z&&H)Z=Z.replace(/^\n+/,"");if(Z){let z=Kq.indentComment($(Z),q);X.push(z.trimStart())}}BZ.stringifyCollection=TZ});var $0=I((RZ)=>{var WZ=C$(),VZ=b$(),IZ=Bq(),q0=A(),Fq=e(),DZ=b();function m0(q,$){let X=q0.isScalar($)?$.value:$;for(let Z of q)if(q0.isPair(Z)){if(Z.key===$||Z.key===X)return Z;if(q0.isScalar(Z.key)&&Z.key.value===X)return Z}return}class c2 extends IZ.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(q){super(q0.MAP,q);this.items=[]}static from(q,$,X){let{keepUndefined:Z,replacer:H}=X,z=new this(q),U=(Q,J)=>{if(typeof H==="function")J=H.call($,Q,J);else if(Array.isArray(H)&&!H.includes(Q))return;if(J!==void 0||Z)z.items.push(Fq.createPair(Q,J,X))};if($ instanceof Map)for(let[Q,J]of $)U(Q,J);else if($&&typeof $==="object")for(let Q of Object.keys($))U(Q,$[Q]);if(typeof q.sortMapEntries==="function")z.items.sort(q.sortMapEntries);return z}add(q,$){let X;if(q0.isPair(q))X=q;else if(!q||typeof q!=="object"||!("key"in q))X=new Fq.Pair(q,q?.value);else X=new Fq.Pair(q.key,q.value);let Z=m0(this.items,X.key),H=this.schema?.sortMapEntries;if(Z){if(!$)throw Error(`Key ${X.key} already set`);if(q0.isScalar(Z.value)&&DZ.isScalarValue(X.value))Z.value.value=X.value;else Z.value=X.value}else if(H){let z=this.items.findIndex((U)=>H(X,U)<0);if(z===-1)this.items.push(X);else this.items.splice(z,0,X)}else this.items.push(X)}delete(q){let $=m0(this.items,q);if(!$)return!1;return this.items.splice(this.items.indexOf($),1).length>0}get(q,$){let Z=m0(this.items,q)?.value;return(!$&&q0.isScalar(Z)?Z.value:Z)??void 0}has(q){return!!m0(this.items,q)}set(q,$){this.add(new Fq.Pair(q,$),!0)}toJSON(q,$,X){let Z=X?new X:$?.mapAsMap?new Map:{};if($?.onCreate)$.onCreate(Z);for(let H of this.items)VZ.addPairToJSMap($,Z,H);return Z}toString(q,$,X){if(!q)return JSON.stringify(this);for(let Z of this.items)if(!q0.isPair(Z))throw Error(`Map items must all be pairs; found ${JSON.stringify(Z)} instead`);if(!q.allNullValues&&this.hasAllNullValues(!1))q=Object.assign({},q,{allNullValues:!0});return WZ.stringifyCollection(this,q,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:q.indent||"",onChompKeep:X,onComment:$})}}RZ.YAMLMap=c2;RZ.findPair=m0});var D0=I((FZ)=>{var KZ=A(),i2=$0(),wZ={collection:"map",default:!0,nodeClass:i2.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(q,$){if(!KZ.isMap(q))$("Expected a mapping for this tag");return q},createNode:(q,$,X)=>i2.YAMLMap.from(q,$,X)};FZ.map=wZ});var X0=I((bZ)=>{var AZ=f0(),SZ=C$(),jZ=Bq(),Aq=A(),NZ=b(),EZ=n();class a2 extends jZ.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(q){super(Aq.SEQ,q);this.items=[]}add(q){this.items.push(q)}delete(q){let $=Oq(q);if(typeof $!=="number")return!1;return this.items.splice($,1).length>0}get(q,$){let X=Oq(q);if(typeof X!=="number")return;let Z=this.items[X];return!$&&Aq.isScalar(Z)?Z.value:Z}has(q){let $=Oq(q);return typeof $==="number"&&$<this.items.length}set(q,$){let X=Oq(q);if(typeof X!=="number")throw Error(`Expected a valid index, not ${q}.`);let Z=this.items[X];if(Aq.isScalar(Z)&&NZ.isScalarValue($))Z.value=$;else this.items[X]=$}toJSON(q,$){let X=[];if($?.onCreate)$.onCreate(X);let Z=0;for(let H of this.items)X.push(EZ.toJS(H,String(Z++),$));return X}toString(q,$,X){if(!q)return JSON.stringify(this);return SZ.stringifyCollection(this,q,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(q.indent||"")+" ",onChompKeep:X,onComment:$})}static from(q,$,X){let{replacer:Z}=X,H=new this(q);if($&&Symbol.iterator in Object($)){let z=0;for(let U of $){if(typeof Z==="function"){let Q=$ instanceof Set?U:String(z++);U=Z.call($,Q,U)}H.items.push(AZ.createNode(U,void 0,X))}}return H}}function Oq(q){let $=Aq.isScalar(q)?q.value:q;if($&&typeof $==="string")$=Number($);return typeof $==="number"&&Number.isInteger($)&&$>=0?$:null}bZ.YAMLSeq=a2});var R0=I((xZ)=>{var yZ=A(),s2=X0(),fZ={collection:"seq",default:!0,nodeClass:s2.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(q,$){if(!yZ.isSeq(q))$("Expected a sequence for this tag");return q},createNode:(q,$,X)=>s2.YAMLSeq.from(q,$,X)};xZ.seq=fZ});var d0=I((uZ)=>{var hZ=h0(),gZ={identify:(q)=>typeof q==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(q)=>q,stringify(q,$,X,Z){return $=Object.assign({actualString:!0},$),hZ.stringifyString(q,$,X,Z)}};uZ.string=gZ});var Sq=I((mZ)=>{var r2=b(),n2={identify:(q)=>q==null,createNode:()=>new r2.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new r2.Scalar(null),stringify:({source:q},$)=>typeof q==="string"&&n2.test.test(q)?q:$.options.nullStr};mZ.nullTag=n2});var y$=I((lZ)=>{var pZ=b(),o2={identify:(q)=>typeof q==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:(q)=>new pZ.Scalar(q[0]==="t"||q[0]==="T"),stringify({source:q,value:$},X){if(q&&o2.test.test(q)){let Z=q[0]==="t"||q[0]==="T";if($===Z)return q}return $?X.options.trueStr:X.options.falseStr}};lZ.boolTag=o2});var P0=I((aZ)=>{function iZ({format:q,minFractionDigits:$,tag:X,value:Z}){if(typeof Z==="bigint")return String(Z);let H=typeof Z==="number"?Z:Number(Z);if(!isFinite(H))return isNaN(H)?".nan":H<0?"-.inf":".inf";let z=Object.is(Z,-0)?"-0":JSON.stringify(Z);if(!q&&$&&(!X||X==="tag:yaml.org,2002:float")&&/^\d/.test(z)){let U=z.indexOf(".");if(U<0)U=z.length,z+=".";let Q=$-(z.length-U-1);while(Q-- >0)z+="0"}return z}aZ.stringifyNumber=iZ});var x$=I((eZ)=>{var rZ=b(),f$=P0(),nZ={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:f$.stringifyNumber},oZ={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 $=Number(q.value);return isFinite($)?$.toExponential():f$.stringifyNumber(q)}},tZ={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(q){let $=new rZ.Scalar(parseFloat(q)),X=q.indexOf(".");if(X!==-1&&q[q.length-1]==="0")$.minFractionDigits=q.length-X-1;return $},stringify:f$.stringifyNumber};eZ.float=tZ;eZ.floatExp=oZ;eZ.floatNaN=nZ});var h$=I((U6)=>{var t2=P0(),jq=(q)=>typeof q==="bigint"||Number.isInteger(q),k$=(q,$,X,{intAsBigInt:Z})=>Z?BigInt(q):parseInt(q.substring($),X);function e2(q,$,X){let{value:Z}=q;if(jq(Z)&&Z>=0)return X+Z.toString($);return t2.stringifyNumber(q)}var Z6={identify:(q)=>jq(q)&&q>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(q,$,X)=>k$(q,2,8,X),stringify:(q)=>e2(q,8,"0o")},H6={identify:jq,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(q,$,X)=>k$(q,0,10,X),stringify:t2.stringifyNumber},z6={identify:(q)=>jq(q)&&q>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(q,$,X)=>k$(q,2,16,X),stringify:(q)=>e2(q,16,"0x")};U6.int=H6;U6.intHex=z6;U6.intOct=Z6});var q9=I((V6)=>{var T6=D0(),Y6=Sq(),L6=R0(),B6=d0(),_6=y$(),g$=x$(),u$=h$(),W6=[T6.map,L6.seq,B6.string,Y6.nullTag,_6.boolTag,u$.intOct,u$.int,u$.intHex,g$.floatNaN,g$.floatExp,g$.float];V6.schema=W6});var X9=I((F6)=>{var D6=b(),R6=D0(),P6=R0();function $9(q){return typeof q==="bigint"||Number.isInteger(q)}var Nq=({value:q})=>JSON.stringify(q),M6=[{identify:(q)=>typeof q==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(q)=>q,stringify:Nq},{identify:(q)=>q==null,createNode:()=>new D6.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Nq},{identify:(q)=>typeof q==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:(q)=>q==="true",stringify:Nq},{identify:$9,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(q,$,{intAsBigInt:X})=>X?BigInt(q):parseInt(q,10),stringify:({value:q})=>$9(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:Nq}],K6={default:!0,tag:"",test:/^/,resolve(q,$){return $(`Unresolved plain scalar ${JSON.stringify(q)}`),q}},w6=[R6.map,P6.seq].concat(M6,K6);F6.schema=w6});var m$=I((j6)=>{var p0=c("buffer"),v$=b(),A6=h0(),S6={identify:(q)=>q instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(q,$){if(typeof p0.Buffer==="function")return p0.Buffer.from(q,"base64");else if(typeof atob==="function"){let X=atob(q.replace(/[\n\r]/g,"")),Z=new Uint8Array(X.length);for(let H=0;H<X.length;++H)Z[H]=X.charCodeAt(H);return Z}else return $("This environment does not support reading binary tags; either Buffer or atob is required"),q},stringify({comment:q,type:$,value:X},Z,H,z){if(!X)return"";let U=X,Q;if(typeof p0.Buffer==="function")Q=U instanceof p0.Buffer?U.toString("base64"):p0.Buffer.from(U.buffer).toString("base64");else if(typeof btoa==="function"){let J="";for(let G=0;G<U.length;++G)J+=String.fromCharCode(U[G]);Q=btoa(J)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if($??($=v$.Scalar.BLOCK_LITERAL),$!==v$.Scalar.QUOTE_DOUBLE){let J=Math.max(Z.options.lineWidth-Z.indent.length,Z.options.minContentWidth),G=Math.ceil(Q.length/J),Y=Array(G);for(let T=0,L=0;T<G;++T,L+=J)Y[T]=Q.substr(L,J);Q=Y.join($===v$.Scalar.BLOCK_LITERAL?`
79
- `:" ")}return A6.stringifyString({comment:q,type:$,value:Q},Z,H,z)}};j6.binary=S6});var bq=I((y6)=>{var Eq=A(),d$=e(),E6=b(),b6=X0();function Z9(q,$){if(Eq.isSeq(q))for(let X=0;X<q.items.length;++X){let Z=q.items[X];if(Eq.isPair(Z))continue;else if(Eq.isMap(Z)){if(Z.items.length>1)$("Each pair must have its own sequence indicator");let H=Z.items[0]||new d$.Pair(new E6.Scalar(null));if(Z.commentBefore)H.key.commentBefore=H.key.commentBefore?`${Z.commentBefore}
80
- ${H.key.commentBefore}`:Z.commentBefore;if(Z.comment){let z=H.value??H.key;z.comment=z.comment?`${Z.comment}
81
- ${z.comment}`:Z.comment}Z=H}q.items[X]=Eq.isPair(Z)?Z:new d$.Pair(Z)}else $("Expected a sequence for this tag");return q}function H9(q,$,X){let{replacer:Z}=X,H=new b6.YAMLSeq(q);H.tag="tag:yaml.org,2002:pairs";let z=0;if($&&Symbol.iterator in Object($))for(let U of $){if(typeof Z==="function")U=Z.call($,String(z++),U);let Q,J;if(Array.isArray(U))if(U.length===2)Q=U[0],J=U[1];else throw TypeError(`Expected [key, value] tuple: ${U}`);else if(U&&U instanceof Object){let G=Object.keys(U);if(G.length===1)Q=G[0],J=U[Q];else throw TypeError(`Expected tuple with one key, not ${G.length} keys`)}else Q=U;H.items.push(d$.createPair(Q,J,X))}return H}var C6={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Z9,createNode:H9};y6.createPairs=H9;y6.pairs=C6;y6.resolvePairs=Z9});var l$=I((u6)=>{var z9=A(),p$=n(),l0=$0(),h6=X0(),U9=bq();class G0 extends h6.YAMLSeq{constructor(){super();this.add=l0.YAMLMap.prototype.add.bind(this),this.delete=l0.YAMLMap.prototype.delete.bind(this),this.get=l0.YAMLMap.prototype.get.bind(this),this.has=l0.YAMLMap.prototype.has.bind(this),this.set=l0.YAMLMap.prototype.set.bind(this),this.tag=G0.tag}toJSON(q,$){if(!$)return super.toJSON(q);let X=new Map;if($?.onCreate)$.onCreate(X);for(let Z of this.items){let H,z;if(z9.isPair(Z))H=p$.toJS(Z.key,"",$),z=p$.toJS(Z.value,H,$);else H=p$.toJS(Z,"",$);if(X.has(H))throw Error("Ordered maps must not include duplicate keys");X.set(H,z)}return X}static from(q,$,X){let Z=U9.createPairs(q,$,X),H=new this;return H.items=Z.items,H}}G0.tag="tag:yaml.org,2002:omap";var g6={collection:"seq",identify:(q)=>q instanceof Map,nodeClass:G0,default:!1,tag:"tag:yaml.org,2002:omap",resolve(q,$){let X=U9.resolvePairs(q,$),Z=[];for(let{key:H}of X.items)if(z9.isScalar(H))if(Z.includes(H.value))$(`Ordered maps must not include duplicate keys: ${H.value}`);else Z.push(H.value);return Object.assign(new G0,X)},createNode:(q,$,X)=>G0.from(q,$,X)};u6.YAMLOMap=G0;u6.omap=g6});var Y9=I((d6)=>{var Q9=b();function G9({value:q,source:$},X){if($&&(q?J9:T9).test.test($))return $;return q?X.options.trueStr:X.options.falseStr}var J9={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 Q9.Scalar(!0),stringify:G9},T9={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 Q9.Scalar(!1),stringify:G9};d6.falseTag=T9;d6.trueTag=J9});var L9=I((r6)=>{var c6=b(),c$=P0(),i6={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:c$.stringifyNumber},a6={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 $=Number(q.value);return isFinite($)?$.toExponential():c$.stringifyNumber(q)}},s6={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(q){let $=new c6.Scalar(parseFloat(q.replace(/_/g,""))),X=q.indexOf(".");if(X!==-1){let Z=q.substring(X+1).replace(/_/g,"");if(Z[Z.length-1]==="0")$.minFractionDigits=Z.length}return $},stringify:c$.stringifyNumber};r6.float=s6;r6.floatExp=a6;r6.floatNaN=i6});var _9=I((ZH)=>{var B9=P0(),c0=(q)=>typeof q==="bigint"||Number.isInteger(q);function Cq(q,$,X,{intAsBigInt:Z}){let H=q[0];if(H==="-"||H==="+")$+=1;if(q=q.substring($).replace(/_/g,""),Z){switch(X){case 2:q=`0b${q}`;break;case 8:q=`0o${q}`;break;case 16:q=`0x${q}`;break}let U=BigInt(q);return H==="-"?BigInt(-1)*U:U}let z=parseInt(q,X);return H==="-"?-1*z:z}function i$(q,$,X){let{value:Z}=q;if(c0(Z)){let H=Z.toString($);return Z<0?"-"+X+H.substr(1):X+H}return B9.stringifyNumber(q)}var e6={identify:c0,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(q,$,X)=>Cq(q,2,2,X),stringify:(q)=>i$(q,2,"0b")},qH={identify:c0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(q,$,X)=>Cq(q,1,8,X),stringify:(q)=>i$(q,8,"0")},$H={identify:c0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(q,$,X)=>Cq(q,0,10,X),stringify:B9.stringifyNumber},XH={identify:c0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(q,$,X)=>Cq(q,2,16,X),stringify:(q)=>i$(q,16,"0x")};ZH.int=$H;ZH.intBin=e6;ZH.intHex=XH;ZH.intOct=qH});var a$=I((JH)=>{var xq=A(),yq=e(),fq=$0();class J0 extends fq.YAMLMap{constructor(q){super(q);this.tag=J0.tag}add(q){let $;if(xq.isPair(q))$=q;else if(q&&typeof q==="object"&&"key"in q&&"value"in q&&q.value===null)$=new yq.Pair(q.key,null);else $=new yq.Pair(q,null);if(!fq.findPair(this.items,$.key))this.items.push($)}get(q,$){let X=fq.findPair(this.items,q);return!$&&xq.isPair(X)?xq.isScalar(X.key)?X.key.value:X.key:X}set(q,$){if(typeof $!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof $}`);let X=fq.findPair(this.items,q);if(X&&!$)this.items.splice(this.items.indexOf(X),1);else if(!X&&$)this.items.push(new yq.Pair(q))}toJSON(q,$){return super.toJSON(q,$,Set)}toString(q,$,X){if(!q)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},q,{allNullValues:!0}),$,X);else throw Error("Set items must all have null values")}static from(q,$,X){let{replacer:Z}=X,H=new this(q);if($&&Symbol.iterator in Object($))for(let z of $){if(typeof Z==="function")z=Z.call($,z,z);H.items.push(yq.createPair(z,null,X))}return H}}J0.tag="tag:yaml.org,2002:set";var GH={collection:"map",identify:(q)=>q instanceof Set,nodeClass:J0,default:!1,tag:"tag:yaml.org,2002:set",createNode:(q,$,X)=>J0.from(q,$,X),resolve(q,$){if(xq.isMap(q))if(q.hasAllNullValues(!0))return Object.assign(new J0,q);else $("Set items must all have null values");else $("Expected a mapping for this tag");return q}};JH.YAMLSet=J0;JH.set=GH});var r$=I((WH)=>{var LH=P0();function s$(q,$){let X=q[0],Z=X==="-"||X==="+"?q.substring(1):q,H=(U)=>$?BigInt(U):Number(U),z=Z.replace(/_/g,"").split(":").reduce((U,Q)=>U*H(60)+H(Q),H(0));return X==="-"?H(-1)*z:z}function W9(q){let{value:$}=q,X=(U)=>U;if(typeof $==="bigint")X=(U)=>BigInt(U);else if(isNaN($)||!isFinite($))return LH.stringifyNumber(q);let Z="";if($<0)Z="-",$*=X(-1);let H=X(60),z=[$%H];if($<60)z.unshift(0);else if($=($-z[0])/H,z.unshift($%H),$>=60)$=($-z[0])/H,z.unshift($);return Z+z.map((U)=>String(U).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var BH={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,$,{intAsBigInt:X})=>s$(q,X),stringify:W9},_H={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)=>s$(q,!1),stringify:W9},V9={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 $=q.match(V9.test);if(!$)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,X,Z,H,z,U,Q]=$.map(Number),J=$[7]?Number(($[7]+"00").substr(1,3)):0,G=Date.UTC(X,Z-1,H,z||0,U||0,Q||0,J),Y=$[8];if(Y&&Y!=="Z"){let T=s$(Y,!1);if(Math.abs(T)<30)T*=60;G-=60000*T}return new Date(G)},stringify:({value:q})=>q?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};WH.floatTime=_H;WH.intTime=BH;WH.timestamp=V9});var D9=I((NH)=>{var RH=D0(),PH=Sq(),MH=R0(),KH=d0(),wH=m$(),I9=Y9(),n$=L9(),kq=_9(),FH=Rq(),OH=l$(),AH=bq(),SH=a$(),o$=r$(),jH=[RH.map,MH.seq,KH.string,PH.nullTag,I9.trueTag,I9.falseTag,kq.intBin,kq.intOct,kq.int,kq.intHex,n$.floatNaN,n$.floatExp,n$.float,wH.binary,FH.merge,OH.omap,AH.pairs,SH.set,o$.intTime,o$.floatTime,o$.timestamp];NH.schema=jH});var j9=I((gH)=>{var K9=D0(),bH=Sq(),w9=R0(),CH=d0(),yH=y$(),t$=x$(),e$=h$(),fH=q9(),xH=X9(),F9=m$(),i0=Rq(),O9=l$(),A9=bq(),R9=D9(),S9=a$(),hq=r$(),P9=new Map([["core",fH.schema],["failsafe",[K9.map,w9.seq,CH.string]],["json",xH.schema],["yaml11",R9.schema],["yaml-1.1",R9.schema]]),M9={binary:F9.binary,bool:yH.boolTag,float:t$.float,floatExp:t$.floatExp,floatNaN:t$.floatNaN,floatTime:hq.floatTime,int:e$.int,intHex:e$.intHex,intOct:e$.intOct,intTime:hq.intTime,map:K9.map,merge:i0.merge,null:bH.nullTag,omap:O9.omap,pairs:A9.pairs,seq:w9.seq,set:S9.set,timestamp:hq.timestamp},kH={"tag:yaml.org,2002:binary":F9.binary,"tag:yaml.org,2002:merge":i0.merge,"tag:yaml.org,2002:omap":O9.omap,"tag:yaml.org,2002:pairs":A9.pairs,"tag:yaml.org,2002:set":S9.set,"tag:yaml.org,2002:timestamp":hq.timestamp};function hH(q,$,X){let Z=P9.get($);if(Z&&!q)return X&&!Z.includes(i0.merge)?Z.concat(i0.merge):Z.slice();let H=Z;if(!H)if(Array.isArray(q))H=[];else{let z=Array.from(P9.keys()).filter((U)=>U!=="yaml11").map((U)=>JSON.stringify(U)).join(", ");throw Error(`Unknown schema "${$}"; use one of ${z} or define customTags array`)}if(Array.isArray(q))for(let z of q)H=H.concat(z);else if(typeof q==="function")H=q(H.slice());if(X)H=H.concat(i0.merge);return H.reduce((z,U)=>{let Q=typeof U==="string"?M9[U]:U;if(!Q){let J=JSON.stringify(U),G=Object.keys(M9).map((Y)=>JSON.stringify(Y)).join(", ");throw Error(`Unknown custom tag ${J}; use one of ${G}`)}if(!z.includes(Q))z.push(Q);return z},[])}gH.coreKnownTags=kH;gH.getTags=hH});var X1=I((cH)=>{var q1=A(),mH=D0(),dH=R0(),pH=d0(),gq=j9(),lH=(q,$)=>q.key<$.key?-1:q.key>$.key?1:0;class $1{constructor({compat:q,customTags:$,merge:X,resolveKnownTags:Z,schema:H,sortMapEntries:z,toStringDefaults:U}){this.compat=Array.isArray(q)?gq.getTags(q,"compat"):q?gq.getTags(null,q):null,this.name=typeof H==="string"&&H||"core",this.knownTags=Z?gq.coreKnownTags:{},this.tags=gq.getTags($,this.name,X),this.toStringOptions=U??null,Object.defineProperty(this,q1.MAP,{value:mH.map}),Object.defineProperty(this,q1.SCALAR,{value:pH.string}),Object.defineProperty(this,q1.SEQ,{value:dH.seq}),this.sortMapEntries=typeof z==="function"?z:z===!0?lH:null}clone(){let q=Object.create($1.prototype,Object.getOwnPropertyDescriptors(this));return q.tags=this.tags.slice(),q}}cH.Schema=$1});var N9=I((rH)=>{var aH=A(),Z1=g0(),a0=x0();function sH(q,$){let X=[],Z=$.directives===!0;if($.directives!==!1&&q.directives){let J=q.directives.toString(q);if(J)X.push(J),Z=!0;else if(q.directives.docStart)Z=!0}if(Z)X.push("---");let H=Z1.createStringifyContext(q,$),{commentString:z}=H.options;if(q.commentBefore){if(X.length!==1)X.unshift("");let J=z(q.commentBefore);X.unshift(a0.indentComment(J,""))}let U=!1,Q=null;if(q.contents){if(aH.isNode(q.contents)){if(q.contents.spaceBefore&&Z)X.push("");if(q.contents.commentBefore){let Y=z(q.contents.commentBefore);X.push(a0.indentComment(Y,""))}H.forceBlockIndent=!!q.comment,Q=q.contents.comment}let J=Q?void 0:()=>U=!0,G=Z1.stringify(q.contents,H,()=>Q=null,J);if(Q)G+=a0.lineComment(G,"",z(Q));if((G[0]==="|"||G[0]===">")&&X[X.length-1]==="---")X[X.length-1]=`--- ${G}`;else X.push(G)}else X.push(Z1.stringify(q.contents,H));if(q.directives?.docEnd)if(q.comment){let J=z(q.comment);if(J.includes(`
82
- `))X.push("..."),X.push(a0.indentComment(J,""));else X.push(`... ${J}`)}else X.push("...");else{let J=q.comment;if(J&&U)J=J.replace(/^\n+/,"");if(J){if((!U||Q)&&X[X.length-1]!=="")X.push("");X.push(a0.indentComment(z(J),""))}}return X.join(`
68
+ ${z.indent}`}else if(!L&&s.isCollection(q)){let j=F[0],w=F.indexOf(`
69
+ `),C=w!==-1,r=z.inFlow??q.flow??q.items.length===0;if(C||!r){let T0=!1;if(C&&(j==="&"||j==="!")){let y=F.indexOf(" ");if(j==="&"&&y!==-1&&y<w&&F[y+1]==="!")y=F.indexOf(" ",y+1);if(y===-1||w<y)T0=!0}if(!T0)O=`
70
+ ${z.indent}`}}else if(F===""||F[0]===`
71
+ `)O="";if(V+=O+F,z.inFlow){if(K&&X)X()}else if(P&&!K)V+=m0.lineComment(V,z.indent,U(P));else if(W&&Z)Z();return V}dX.stringifyPair=mX});var Nq=D((iX)=>{var v2=c("process");function lX($,...q){if($==="debug")console.log(...q)}function cX($,q){if($==="debug"||$==="warn")if(typeof v2.emitWarning==="function")v2.emitWarning(q);else console.warn(q)}iX.debug=lX;iX.warn=cX});var P$=D((nX)=>{var d0=A(),u2=b(),w$="<<",M$={identify:($)=>$===w$||typeof $==="symbol"&&$.description===w$,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new u2.Scalar(Symbol(w$)),{addToJSMap:m2}),stringify:()=>w$},rX=($,q)=>(M$.identify(q)||d0.isScalar(q)&&(!q.type||q.type===u2.Scalar.PLAIN)&&M$.identify(q.value))&&$?.doc.schema.tags.some((z)=>z.tag===M$.tag&&z.default);function m2($,q,z){if(z=$&&d0.isAlias(z)?z.resolve($.doc):z,d0.isSeq(z))for(let X of z.items)Eq($,q,X);else if(Array.isArray(z))for(let X of z)Eq($,q,X);else Eq($,q,z)}function Eq($,q,z){let X=$&&d0.isAlias(z)?z.resolve($.doc):z;if(!d0.isMap(X))throw Error("Merge sources must be maps or map aliases");let Z=X.toJSON(null,$,Map);for(let[H,Q]of Z)if(q instanceof Map){if(!q.has(H))q.set(H,Q)}else if(q instanceof Set)q.add(H);else if(!Object.prototype.hasOwnProperty.call(q,H))Object.defineProperty(q,H,{value:Q,writable:!0,enumerable:!0,configurable:!0});return q}nX.addMergeToJSMap=m2;nX.isMergeKey=rX;nX.merge=M$});var Cq=D((Z8)=>{var $8=Nq(),d2=P$(),q8=u0(),p2=A(),bq=n();function z8($,q,{key:z,value:X}){if(p2.isNode(z)&&z.addToJSMap)z.addToJSMap($,q,X);else if(d2.isMergeKey($,z))d2.addMergeToJSMap($,q,X);else{let Z=bq.toJS(z,"",$);if(q instanceof Map)q.set(Z,bq.toJS(X,Z,$));else if(q instanceof Set)q.add(Z);else{let H=X8(z,Z,$),Q=bq.toJS(X,H,$);if(H in q)Object.defineProperty(q,H,{value:Q,writable:!0,enumerable:!0,configurable:!0});else q[H]=Q}}return q}function X8($,q,z){if(q===null)return"";if(typeof q!=="object")return String(q);if(p2.isNode($)&&z?.doc){let X=q8.createStringifyContext(z.doc,{});X.anchors=new Set;for(let H of z.anchors.keys())X.anchors.add(H.anchor);X.inFlow=!0,X.inStringifyKey=!0;let Z=$.toString(X);if(!z.mapKeyWarned){let H=JSON.stringify(Z);if(H.length>40)H=H.substring(0,36)+'..."';$8.warn(z.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${H}. Set mapAsMap: true to use object keys.`),z.mapKeyWarned=!0}return Z}return JSON.stringify(q)}Z8.addPairToJSMap=z8});var e=D((G8)=>{var l2=x0(),Q8=g2(),J8=Cq(),K$=A();function U8($,q,z){let X=l2.createNode($,void 0,z),Z=l2.createNode(q,void 0,z);return new F$(X,Z)}class F${constructor($,q=null){Object.defineProperty(this,K$.NODE_TYPE,{value:K$.PAIR}),this.key=$,this.value=q}clone($){let{key:q,value:z}=this;if(K$.isNode(q))q=q.clone($);if(K$.isNode(z))z=z.clone($);return new F$(q,z)}toJSON($,q){let z=q?.mapAsMap?new Map:{};return J8.addPairToJSMap(q,z,this)}toString($,q,z){return $?.doc?Q8.stringifyPair(this,$,q,z):JSON.stringify(this)}}G8.Pair=F$;G8.createPair=U8});var yq=D((V8)=>{var J0=A(),c2=u0(),O$=h0();function T8($,q,z){return(q.inFlow??$.flow?L8:W8)($,q,z)}function W8({comment:$,items:q},z,{blockItemPrefix:X,flowChars:Z,itemIndent:H,onChompKeep:Q,onComment:J}){let{indent:Y,options:{commentString:U}}=z,B=Object.assign({},z,{indent:H,type:null}),G=!1,T=[];for(let _=0;_<q.length;++_){let W=q[_],V=null;if(J0.isNode(W)){if(!G&&W.spaceBefore)T.push("");if(A$(z,T,W.commentBefore,G),W.comment)V=W.comment}else if(J0.isPair(W)){let R=J0.isNode(W.key)?W.key:null;if(R){if(!G&&R.spaceBefore)T.push("");A$(z,T,R.commentBefore,G)}}G=!1;let I=c2.stringify(W,B,()=>V=null,()=>G=!0);if(V)I+=O$.lineComment(I,H,U(V));if(G&&V)G=!1;T.push(X+I)}let L;if(T.length===0)L=Z.start+Z.end;else{L=T[0];for(let _=1;_<T.length;++_){let W=T[_];L+=W?`
72
+ ${Y}${W}`:`
73
+ `}}if($){if(L+=`
74
+ `+O$.indentComment(U($),Y),J)J()}else if(G&&Q)Q();return L}function L8({items:$},q,{flowChars:z,itemIndent:X}){let{indent:Z,indentStep:H,flowCollectionPadding:Q,options:{commentString:J}}=q;X+=H;let Y=Object.assign({},q,{indent:X,inFlow:!0,type:null}),U=!1,B=0,G=[];for(let _=0;_<$.length;++_){let W=$[_],V=null;if(J0.isNode(W)){if(W.spaceBefore)G.push("");if(A$(q,G,W.commentBefore,!1),W.comment)V=W.comment}else if(J0.isPair(W)){let R=J0.isNode(W.key)?W.key:null;if(R){if(R.spaceBefore)G.push("");if(A$(q,G,R.commentBefore,!1),R.comment)U=!0}let P=J0.isNode(W.value)?W.value:null;if(P){if(P.comment)V=P.comment;if(P.commentBefore)U=!0}else if(W.value==null&&R?.comment)V=R.comment}if(V)U=!0;let I=c2.stringify(W,Y,()=>V=null);if(_<$.length-1)I+=",";if(V)I+=O$.lineComment(I,X,J(V));if(!U&&(G.length>B||I.includes(`
75
+ `)))U=!0;G.push(I),B=G.length}let{start:T,end:L}=z;if(G.length===0)return T+L;else{if(!U){let _=G.reduce((W,V)=>W+V.length+2,2);U=q.options.lineWidth>0&&_>q.options.lineWidth}if(U){let _=T;for(let W of G)_+=W?`
76
+ ${H}${Z}${W}`:`
77
+ `;return`${_}
78
+ ${Z}${L}`}else return`${T}${Q}${G.join(" ")}${Q}${L}`}}function A$({indent:$,options:{commentString:q}},z,X,Z){if(X&&Z)X=X.replace(/^\n+/,"");if(X){let H=O$.indentComment(q(X),$);z.push(H.trimStart())}}V8.stringifyCollection=T8});var q0=D((M8)=>{var D8=yq(),I8=Cq(),R8=_$(),$0=A(),S$=e(),w8=b();function p0($,q){let z=$0.isScalar(q)?q.value:q;for(let X of $)if($0.isPair(X)){if(X.key===q||X.key===z)return X;if($0.isScalar(X.key)&&X.key.value===z)return X}return}class i2 extends R8.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor($){super($0.MAP,$);this.items=[]}static from($,q,z){let{keepUndefined:X,replacer:Z}=z,H=new this($),Q=(J,Y)=>{if(typeof Z==="function")Y=Z.call(q,J,Y);else if(Array.isArray(Z)&&!Z.includes(J))return;if(Y!==void 0||X)H.items.push(S$.createPair(J,Y,z))};if(q instanceof Map)for(let[J,Y]of q)Q(J,Y);else if(q&&typeof q==="object")for(let J of Object.keys(q))Q(J,q[J]);if(typeof $.sortMapEntries==="function")H.items.sort($.sortMapEntries);return H}add($,q){let z;if($0.isPair($))z=$;else if(!$||typeof $!=="object"||!("key"in $))z=new S$.Pair($,$?.value);else z=new S$.Pair($.key,$.value);let X=p0(this.items,z.key),Z=this.schema?.sortMapEntries;if(X){if(!q)throw Error(`Key ${z.key} already set`);if($0.isScalar(X.value)&&w8.isScalarValue(z.value))X.value.value=z.value;else X.value=z.value}else if(Z){let H=this.items.findIndex((Q)=>Z(z,Q)<0);if(H===-1)this.items.push(z);else this.items.splice(H,0,z)}else this.items.push(z)}delete($){let q=p0(this.items,$);if(!q)return!1;return this.items.splice(this.items.indexOf(q),1).length>0}get($,q){let X=p0(this.items,$)?.value;return(!q&&$0.isScalar(X)?X.value:X)??void 0}has($){return!!p0(this.items,$)}set($,q){this.add(new S$.Pair($,q),!0)}toJSON($,q,z){let X=z?new z:q?.mapAsMap?new Map:{};if(q?.onCreate)q.onCreate(X);for(let Z of this.items)I8.addPairToJSMap(q,X,Z);return X}toString($,q,z){if(!$)return JSON.stringify(this);for(let X of this.items)if(!$0.isPair(X))throw Error(`Map items must all be pairs; found ${JSON.stringify(X)} instead`);if(!$.allNullValues&&this.hasAllNullValues(!1))$=Object.assign({},$,{allNullValues:!0});return D8.stringifyCollection(this,$,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:$.indent||"",onChompKeep:z,onComment:q})}}M8.YAMLMap=i2;M8.findPair=p0});var I0=D((A8)=>{var F8=A(),a2=q0(),O8={collection:"map",default:!0,nodeClass:a2.YAMLMap,tag:"tag:yaml.org,2002:map",resolve($,q){if(!F8.isMap($))q("Expected a mapping for this tag");return $},createNode:($,q,z)=>a2.YAMLMap.from($,q,z)};A8.map=O8});var z0=D((y8)=>{var j8=x0(),N8=yq(),E8=_$(),N$=A(),b8=b(),C8=n();class s2 extends E8.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor($){super(N$.SEQ,$);this.items=[]}add($){this.items.push($)}delete($){let q=j$($);if(typeof q!=="number")return!1;return this.items.splice(q,1).length>0}get($,q){let z=j$($);if(typeof z!=="number")return;let X=this.items[z];return!q&&N$.isScalar(X)?X.value:X}has($){let q=j$($);return typeof q==="number"&&q<this.items.length}set($,q){let z=j$($);if(typeof z!=="number")throw Error(`Expected a valid index, not ${$}.`);let X=this.items[z];if(N$.isScalar(X)&&b8.isScalarValue(q))X.value=q;else this.items[z]=q}toJSON($,q){let z=[];if(q?.onCreate)q.onCreate(z);let X=0;for(let Z of this.items)z.push(C8.toJS(Z,String(X++),q));return z}toString($,q,z){if(!$)return JSON.stringify(this);return N8.stringifyCollection(this,$,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:($.indent||"")+" ",onChompKeep:z,onComment:q})}static from($,q,z){let{replacer:X}=z,Z=new this($);if(q&&Symbol.iterator in Object(q)){let H=0;for(let Q of q){if(typeof X==="function"){let J=q instanceof Set?Q:String(H++);Q=X.call(q,J,Q)}Z.items.push(j8.createNode(Q,void 0,z))}}return Z}}function j$($){let q=N$.isScalar($)?$.value:$;if(q&&typeof q==="string")q=Number(q);return typeof q==="number"&&Number.isInteger(q)&&q>=0?q:null}y8.YAMLSeq=s2});var R0=D((h8)=>{var k8=A(),r2=z0(),x8={collection:"seq",default:!0,nodeClass:r2.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve($,q){if(!k8.isSeq($))q("Expected a sequence for this tag");return $},createNode:($,q,z)=>r2.YAMLSeq.from($,q,z)};h8.seq=x8});var l0=D((m8)=>{var v8=v0(),u8={identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify($,q,z,X){return q=Object.assign({actualString:!0},q),v8.stringifyString($,q,z,X)}};m8.string=u8});var E$=D((p8)=>{var n2=b(),o2={identify:($)=>$==null,createNode:()=>new n2.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new n2.Scalar(null),stringify:({source:$},q)=>typeof $==="string"&&o2.test.test($)?$:q.options.nullStr};p8.nullTag=o2});var fq=D((i8)=>{var c8=b(),t2={identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:($)=>new c8.Scalar($[0]==="t"||$[0]==="T"),stringify({source:$,value:q},z){if($&&t2.test.test($)){let X=$[0]==="t"||$[0]==="T";if(q===X)return $}return q?z.options.trueStr:z.options.falseStr}};i8.boolTag=t2});var w0=D((r8)=>{function s8({format:$,minFractionDigits:q,tag:z,value:X}){if(typeof X==="bigint")return String(X);let Z=typeof X==="number"?X:Number(X);if(!isFinite(Z))return isNaN(Z)?".nan":Z<0?"-.inf":".inf";let H=Object.is(X,-0)?"-0":JSON.stringify(X);if(!$&&q&&(!z||z==="tag:yaml.org,2002:float")&&/^\d/.test(H)){let Q=H.indexOf(".");if(Q<0)Q=H.length,H+=".";let J=q-(H.length-Q-1);while(J-- >0)H+="0"}return H}r8.stringifyNumber=s8});var xq=D((qZ)=>{var o8=b(),kq=w0(),t8={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:($)=>$.slice(-3).toLowerCase()==="nan"?NaN:$[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:kq.stringifyNumber},e8={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:($)=>parseFloat($),stringify($){let q=Number($.value);return isFinite(q)?q.toExponential():kq.stringifyNumber($)}},$Z={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve($){let q=new o8.Scalar(parseFloat($)),z=$.indexOf(".");if(z!==-1&&$[$.length-1]==="0")q.minFractionDigits=$.length-z-1;return q},stringify:kq.stringifyNumber};qZ.float=$Z;qZ.floatExp=e8;qZ.floatNaN=t8});var gq=D((UZ)=>{var e2=w0(),b$=($)=>typeof $==="bigint"||Number.isInteger($),hq=($,q,z,{intAsBigInt:X})=>X?BigInt($):parseInt($.substring(q),z);function $9($,q,z){let{value:X}=$;if(b$(X)&&X>=0)return z+X.toString(q);return e2.stringifyNumber($)}var HZ={identify:($)=>b$($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:($,q,z)=>hq($,2,8,z),stringify:($)=>$9($,8,"0o")},QZ={identify:b$,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:($,q,z)=>hq($,0,10,z),stringify:e2.stringifyNumber},JZ={identify:($)=>b$($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:($,q,z)=>hq($,2,16,z),stringify:($)=>$9($,16,"0x")};UZ.int=QZ;UZ.intHex=JZ;UZ.intOct=HZ});var q9=D((IZ)=>{var TZ=I0(),WZ=E$(),LZ=R0(),VZ=l0(),_Z=fq(),vq=xq(),uq=gq(),DZ=[TZ.map,LZ.seq,VZ.string,WZ.nullTag,_Z.boolTag,uq.intOct,uq.int,uq.intHex,vq.floatNaN,vq.floatExp,vq.float];IZ.schema=DZ});var X9=D((AZ)=>{var wZ=b(),MZ=I0(),PZ=R0();function z9($){return typeof $==="bigint"||Number.isInteger($)}var C$=({value:$})=>JSON.stringify($),KZ=[{identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify:C$},{identify:($)=>$==null,createNode:()=>new wZ.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:C$},{identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:($)=>$==="true",stringify:C$},{identify:z9,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:($,q,{intAsBigInt:z})=>z?BigInt($):parseInt($,10),stringify:({value:$})=>z9($)?$.toString():JSON.stringify($)},{identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:($)=>parseFloat($),stringify:C$}],FZ={default:!0,tag:"",test:/^/,resolve($,q){return q(`Unresolved plain scalar ${JSON.stringify($)}`),$}},OZ=[MZ.map,PZ.seq].concat(KZ,FZ);AZ.schema=OZ});var dq=D((EZ)=>{var c0=c("buffer"),mq=b(),jZ=v0(),NZ={identify:($)=>$ instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve($,q){if(typeof c0.Buffer==="function")return c0.Buffer.from($,"base64");else if(typeof atob==="function"){let z=atob($.replace(/[\n\r]/g,"")),X=new Uint8Array(z.length);for(let Z=0;Z<z.length;++Z)X[Z]=z.charCodeAt(Z);return X}else return q("This environment does not support reading binary tags; either Buffer or atob is required"),$},stringify({comment:$,type:q,value:z},X,Z,H){if(!z)return"";let Q=z,J;if(typeof c0.Buffer==="function")J=Q instanceof c0.Buffer?Q.toString("base64"):c0.Buffer.from(Q.buffer).toString("base64");else if(typeof btoa==="function"){let Y="";for(let U=0;U<Q.length;++U)Y+=String.fromCharCode(Q[U]);J=btoa(Y)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(q??(q=mq.Scalar.BLOCK_LITERAL),q!==mq.Scalar.QUOTE_DOUBLE){let Y=Math.max(X.options.lineWidth-X.indent.length,X.options.minContentWidth),U=Math.ceil(J.length/Y),B=Array(U);for(let G=0,T=0;G<U;++G,T+=Y)B[G]=J.substr(T,Y);J=B.join(q===mq.Scalar.BLOCK_LITERAL?`
79
+ `:" ")}return jZ.stringifyString({comment:$,type:q,value:J},X,Z,H)}};EZ.binary=NZ});var f$=D((kZ)=>{var y$=A(),pq=e(),CZ=b(),yZ=z0();function Z9($,q){if(y$.isSeq($))for(let z=0;z<$.items.length;++z){let X=$.items[z];if(y$.isPair(X))continue;else if(y$.isMap(X)){if(X.items.length>1)q("Each pair must have its own sequence indicator");let Z=X.items[0]||new pq.Pair(new CZ.Scalar(null));if(X.commentBefore)Z.key.commentBefore=Z.key.commentBefore?`${X.commentBefore}
80
+ ${Z.key.commentBefore}`:X.commentBefore;if(X.comment){let H=Z.value??Z.key;H.comment=H.comment?`${X.comment}
81
+ ${H.comment}`:X.comment}X=Z}$.items[z]=y$.isPair(X)?X:new pq.Pair(X)}else q("Expected a sequence for this tag");return $}function H9($,q,z){let{replacer:X}=z,Z=new yZ.YAMLSeq($);Z.tag="tag:yaml.org,2002:pairs";let H=0;if(q&&Symbol.iterator in Object(q))for(let Q of q){if(typeof X==="function")Q=X.call(q,String(H++),Q);let J,Y;if(Array.isArray(Q))if(Q.length===2)J=Q[0],Y=Q[1];else throw TypeError(`Expected [key, value] tuple: ${Q}`);else if(Q&&Q instanceof Object){let U=Object.keys(Q);if(U.length===1)J=U[0],Y=Q[J];else throw TypeError(`Expected tuple with one key, not ${U.length} keys`)}else J=Q;Z.items.push(pq.createPair(J,Y,z))}return Z}var fZ={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Z9,createNode:H9};kZ.createPairs=H9;kZ.pairs=fZ;kZ.resolvePairs=Z9});var cq=D((mZ)=>{var Q9=A(),lq=n(),i0=q0(),vZ=z0(),J9=f$();class U0 extends vZ.YAMLSeq{constructor(){super();this.add=i0.YAMLMap.prototype.add.bind(this),this.delete=i0.YAMLMap.prototype.delete.bind(this),this.get=i0.YAMLMap.prototype.get.bind(this),this.has=i0.YAMLMap.prototype.has.bind(this),this.set=i0.YAMLMap.prototype.set.bind(this),this.tag=U0.tag}toJSON($,q){if(!q)return super.toJSON($);let z=new Map;if(q?.onCreate)q.onCreate(z);for(let X of this.items){let Z,H;if(Q9.isPair(X))Z=lq.toJS(X.key,"",q),H=lq.toJS(X.value,Z,q);else Z=lq.toJS(X,"",q);if(z.has(Z))throw Error("Ordered maps must not include duplicate keys");z.set(Z,H)}return z}static from($,q,z){let X=J9.createPairs($,q,z),Z=new this;return Z.items=X.items,Z}}U0.tag="tag:yaml.org,2002:omap";var uZ={collection:"seq",identify:($)=>$ instanceof Map,nodeClass:U0,default:!1,tag:"tag:yaml.org,2002:omap",resolve($,q){let z=J9.resolvePairs($,q),X=[];for(let{key:Z}of z.items)if(Q9.isScalar(Z))if(X.includes(Z.value))q(`Ordered maps must not include duplicate keys: ${Z.value}`);else X.push(Z.value);return Object.assign(new U0,z)},createNode:($,q,z)=>U0.from($,q,z)};mZ.YAMLOMap=U0;mZ.omap=uZ});var T9=D((lZ)=>{var U9=b();function G9({value:$,source:q},z){if(q&&($?Y9:B9).test.test(q))return q;return $?z.options.trueStr:z.options.falseStr}var Y9={identify:($)=>$===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new U9.Scalar(!0),stringify:G9},B9={identify:($)=>$===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new U9.Scalar(!1),stringify:G9};lZ.falseTag=B9;lZ.trueTag=Y9});var W9=D((oZ)=>{var aZ=b(),iq=w0(),sZ={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:($)=>$.slice(-3).toLowerCase()==="nan"?NaN:$[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:iq.stringifyNumber},rZ={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:($)=>parseFloat($.replace(/_/g,"")),stringify($){let q=Number($.value);return isFinite(q)?q.toExponential():iq.stringifyNumber($)}},nZ={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve($){let q=new aZ.Scalar(parseFloat($.replace(/_/g,""))),z=$.indexOf(".");if(z!==-1){let X=$.substring(z+1).replace(/_/g,"");if(X[X.length-1]==="0")q.minFractionDigits=X.length}return q},stringify:iq.stringifyNumber};oZ.float=nZ;oZ.floatExp=rZ;oZ.floatNaN=sZ});var V9=D((H6)=>{var L9=w0(),a0=($)=>typeof $==="bigint"||Number.isInteger($);function k$($,q,z,{intAsBigInt:X}){let Z=$[0];if(Z==="-"||Z==="+")q+=1;if($=$.substring(q).replace(/_/g,""),X){switch(z){case 2:$=`0b${$}`;break;case 8:$=`0o${$}`;break;case 16:$=`0x${$}`;break}let Q=BigInt($);return Z==="-"?BigInt(-1)*Q:Q}let H=parseInt($,z);return Z==="-"?-1*H:H}function aq($,q,z){let{value:X}=$;if(a0(X)){let Z=X.toString(q);return X<0?"-"+z+Z.substr(1):z+Z}return L9.stringifyNumber($)}var q6={identify:a0,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:($,q,z)=>k$($,2,2,z),stringify:($)=>aq($,2,"0b")},z6={identify:a0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:($,q,z)=>k$($,1,8,z),stringify:($)=>aq($,8,"0")},X6={identify:a0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:($,q,z)=>k$($,0,10,z),stringify:L9.stringifyNumber},Z6={identify:a0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:($,q,z)=>k$($,2,16,z),stringify:($)=>aq($,16,"0x")};H6.int=X6;H6.intBin=q6;H6.intHex=Z6;H6.intOct=z6});var sq=D((B6)=>{var g$=A(),x$=e(),h$=q0();class G0 extends h$.YAMLMap{constructor($){super($);this.tag=G0.tag}add($){let q;if(g$.isPair($))q=$;else if($&&typeof $==="object"&&"key"in $&&"value"in $&&$.value===null)q=new x$.Pair($.key,null);else q=new x$.Pair($,null);if(!h$.findPair(this.items,q.key))this.items.push(q)}get($,q){let z=h$.findPair(this.items,$);return!q&&g$.isPair(z)?g$.isScalar(z.key)?z.key.value:z.key:z}set($,q){if(typeof q!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof q}`);let z=h$.findPair(this.items,$);if(z&&!q)this.items.splice(this.items.indexOf(z),1);else if(!z&&q)this.items.push(new x$.Pair($))}toJSON($,q){return super.toJSON($,q,Set)}toString($,q,z){if(!$)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},$,{allNullValues:!0}),q,z);else throw Error("Set items must all have null values")}static from($,q,z){let{replacer:X}=z,Z=new this($);if(q&&Symbol.iterator in Object(q))for(let H of q){if(typeof X==="function")H=X.call(q,H,H);Z.items.push(x$.createPair(H,null,z))}return Z}}G0.tag="tag:yaml.org,2002:set";var Y6={collection:"map",identify:($)=>$ instanceof Set,nodeClass:G0,default:!1,tag:"tag:yaml.org,2002:set",createNode:($,q,z)=>G0.from($,q,z),resolve($,q){if(g$.isMap($))if($.hasAllNullValues(!0))return Object.assign(new G0,$);else q("Set items must all have null values");else q("Expected a mapping for this tag");return $}};B6.YAMLSet=G0;B6.set=Y6});var nq=D((D6)=>{var L6=w0();function rq($,q){let z=$[0],X=z==="-"||z==="+"?$.substring(1):$,Z=(Q)=>q?BigInt(Q):Number(Q),H=X.replace(/_/g,"").split(":").reduce((Q,J)=>Q*Z(60)+Z(J),Z(0));return z==="-"?Z(-1)*H:H}function _9($){let{value:q}=$,z=(Q)=>Q;if(typeof q==="bigint")z=(Q)=>BigInt(Q);else if(isNaN(q)||!isFinite(q))return L6.stringifyNumber($);let X="";if(q<0)X="-",q*=z(-1);let Z=z(60),H=[q%Z];if(q<60)H.unshift(0);else if(q=(q-H[0])/Z,H.unshift(q%Z),q>=60)q=(q-H[0])/Z,H.unshift(q);return X+H.map((Q)=>String(Q).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var V6={identify:($)=>typeof $==="bigint"||Number.isInteger($),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:($,q,{intAsBigInt:z})=>rq($,z),stringify:_9},_6={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:($)=>rq($,!1),stringify:_9},D9={identify:($)=>$ 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($){let q=$.match(D9.test);if(!q)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,z,X,Z,H,Q,J]=q.map(Number),Y=q[7]?Number((q[7]+"00").substr(1,3)):0,U=Date.UTC(z,X-1,Z,H||0,Q||0,J||0,Y),B=q[8];if(B&&B!=="Z"){let G=rq(B,!1);if(Math.abs(G)<30)G*=60;U-=60000*G}return new Date(U)},stringify:({value:$})=>$?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};D6.floatTime=_6;D6.intTime=V6;D6.timestamp=D9});var R9=D((b6)=>{var M6=I0(),P6=E$(),K6=R0(),F6=l0(),O6=dq(),I9=T9(),oq=W9(),v$=V9(),A6=P$(),S6=cq(),j6=f$(),N6=sq(),tq=nq(),E6=[M6.map,K6.seq,F6.string,P6.nullTag,I9.trueTag,I9.falseTag,v$.intBin,v$.intOct,v$.int,v$.intHex,oq.floatNaN,oq.floatExp,oq.float,O6.binary,A6.merge,S6.omap,j6.pairs,N6.set,tq.intTime,tq.floatTime,tq.timestamp];b6.schema=E6});var N9=D((u6)=>{var K9=I0(),y6=E$(),F9=R0(),f6=l0(),k6=fq(),eq=xq(),$1=gq(),x6=q9(),h6=X9(),O9=dq(),s0=P$(),A9=cq(),S9=f$(),w9=R9(),j9=sq(),u$=nq(),M9=new Map([["core",x6.schema],["failsafe",[K9.map,F9.seq,f6.string]],["json",h6.schema],["yaml11",w9.schema],["yaml-1.1",w9.schema]]),P9={binary:O9.binary,bool:k6.boolTag,float:eq.float,floatExp:eq.floatExp,floatNaN:eq.floatNaN,floatTime:u$.floatTime,int:$1.int,intHex:$1.intHex,intOct:$1.intOct,intTime:u$.intTime,map:K9.map,merge:s0.merge,null:y6.nullTag,omap:A9.omap,pairs:S9.pairs,seq:F9.seq,set:j9.set,timestamp:u$.timestamp},g6={"tag:yaml.org,2002:binary":O9.binary,"tag:yaml.org,2002:merge":s0.merge,"tag:yaml.org,2002:omap":A9.omap,"tag:yaml.org,2002:pairs":S9.pairs,"tag:yaml.org,2002:set":j9.set,"tag:yaml.org,2002:timestamp":u$.timestamp};function v6($,q,z){let X=M9.get(q);if(X&&!$)return z&&!X.includes(s0.merge)?X.concat(s0.merge):X.slice();let Z=X;if(!Z)if(Array.isArray($))Z=[];else{let H=Array.from(M9.keys()).filter((Q)=>Q!=="yaml11").map((Q)=>JSON.stringify(Q)).join(", ");throw Error(`Unknown schema "${q}"; use one of ${H} or define customTags array`)}if(Array.isArray($))for(let H of $)Z=Z.concat(H);else if(typeof $==="function")Z=$(Z.slice());if(z)Z=Z.concat(s0.merge);return Z.reduce((H,Q)=>{let J=typeof Q==="string"?P9[Q]:Q;if(!J){let Y=JSON.stringify(Q),U=Object.keys(P9).map((B)=>JSON.stringify(B)).join(", ");throw Error(`Unknown custom tag ${Y}; use one of ${U}`)}if(!H.includes(J))H.push(J);return H},[])}u6.coreKnownTags=g6;u6.getTags=v6});var X1=D((a6)=>{var q1=A(),p6=I0(),l6=R0(),c6=l0(),m$=N9(),i6=($,q)=>$.key<q.key?-1:$.key>q.key?1:0;class z1{constructor({compat:$,customTags:q,merge:z,resolveKnownTags:X,schema:Z,sortMapEntries:H,toStringDefaults:Q}){this.compat=Array.isArray($)?m$.getTags($,"compat"):$?m$.getTags(null,$):null,this.name=typeof Z==="string"&&Z||"core",this.knownTags=X?m$.coreKnownTags:{},this.tags=m$.getTags(q,this.name,z),this.toStringOptions=Q??null,Object.defineProperty(this,q1.MAP,{value:p6.map}),Object.defineProperty(this,q1.SCALAR,{value:c6.string}),Object.defineProperty(this,q1.SEQ,{value:l6.seq}),this.sortMapEntries=typeof H==="function"?H:H===!0?i6:null}clone(){let $=Object.create(z1.prototype,Object.getOwnPropertyDescriptors(this));return $.tags=this.tags.slice(),$}}a6.Schema=z1});var E9=D((o6)=>{var r6=A(),Z1=u0(),r0=h0();function n6($,q){let z=[],X=q.directives===!0;if(q.directives!==!1&&$.directives){let Y=$.directives.toString($);if(Y)z.push(Y),X=!0;else if($.directives.docStart)X=!0}if(X)z.push("---");let Z=Z1.createStringifyContext($,q),{commentString:H}=Z.options;if($.commentBefore){if(z.length!==1)z.unshift("");let Y=H($.commentBefore);z.unshift(r0.indentComment(Y,""))}let Q=!1,J=null;if($.contents){if(r6.isNode($.contents)){if($.contents.spaceBefore&&X)z.push("");if($.contents.commentBefore){let B=H($.contents.commentBefore);z.push(r0.indentComment(B,""))}Z.forceBlockIndent=!!$.comment,J=$.contents.comment}let Y=J?void 0:()=>Q=!0,U=Z1.stringify($.contents,Z,()=>J=null,Y);if(J)U+=r0.lineComment(U,"",H(J));if((U[0]==="|"||U[0]===">")&&z[z.length-1]==="---")z[z.length-1]=`--- ${U}`;else z.push(U)}else z.push(Z1.stringify($.contents,Z));if($.directives?.docEnd)if($.comment){let Y=H($.comment);if(Y.includes(`
82
+ `))z.push("..."),z.push(r0.indentComment(Y,""));else z.push(`... ${Y}`)}else z.push("...");else{let Y=$.comment;if(Y&&Q)Y=Y.replace(/^\n+/,"");if(Y){if((!Q||J)&&z[z.length-1]!=="")z.push("");z.push(r0.indentComment(H(Y),""))}}return z.join(`
83
83
  `)+`
84
- `}rH.stringifyDocument=sH});var s0=I((Hz)=>{var oH=y0(),M0=Bq(),h=A(),tH=e(),eH=n(),qz=X1(),$z=N9(),H1=Tq(),Xz=w$(),Zz=f0(),z1=K$();class U1{constructor(q,$,X){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,h.NODE_TYPE,{value:h.DOC});let Z=null;if(typeof $==="function"||Array.isArray($))Z=$;else if(X===void 0&&$)X=$,$=void 0;let H=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},X);this.options=H;let{version:z}=H;if(X?._directives){if(this.directives=X._directives.atDocument(),this.directives.yaml.explicit)z=this.directives.yaml.version}else this.directives=new z1.Directives({version:z});this.setSchema(z,X),this.contents=q===void 0?null:this.createNode(q,Z,X)}clone(){let q=Object.create(U1.prototype,{[h.NODE_TYPE]:{value:h.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=h.isNode(this.contents)?this.contents.clone(q.schema):this.contents,this.range)q.range=this.range.slice();return q}add(q){if(K0(this.contents))this.contents.add(q)}addIn(q,$){if(K0(this.contents))this.contents.addIn(q,$)}createAlias(q,$){if(!q.anchor){let X=H1.anchorNames(this);q.anchor=!$||X.has($)?H1.findNewAnchor($||"a",X):$}return new oH.Alias(q.anchor)}createNode(q,$,X){let Z=void 0;if(typeof $==="function")q=$.call({"":q},"",q),Z=$;else if(Array.isArray($)){let B=(D)=>typeof D==="number"||D instanceof String||D instanceof Number,W=$.filter(B).map(String);if(W.length>0)$=$.concat(W);Z=$}else if(X===void 0&&$)X=$,$=void 0;let{aliasDuplicateObjects:H,anchorPrefix:z,flow:U,keepUndefined:Q,onTagObj:J,tag:G}=X??{},{onAnchor:Y,setAnchors:T,sourceObjects:L}=H1.createNodeAnchors(this,z||"a"),_={aliasDuplicateObjects:H??!0,keepUndefined:Q??!1,onAnchor:Y,onTagObj:J,replacer:Z,schema:this.schema,sourceObjects:L},V=Zz.createNode(q,G,_);if(U&&h.isCollection(V))V.flow=!0;return T(),V}createPair(q,$,X={}){let Z=this.createNode(q,null,X),H=this.createNode($,null,X);return new tH.Pair(Z,H)}delete(q){return K0(this.contents)?this.contents.delete(q):!1}deleteIn(q){if(M0.isEmptyPath(q)){if(this.contents==null)return!1;return this.contents=null,!0}return K0(this.contents)?this.contents.deleteIn(q):!1}get(q,$){return h.isCollection(this.contents)?this.contents.get(q,$):void 0}getIn(q,$){if(M0.isEmptyPath(q))return!$&&h.isScalar(this.contents)?this.contents.value:this.contents;return h.isCollection(this.contents)?this.contents.getIn(q,$):void 0}has(q){return h.isCollection(this.contents)?this.contents.has(q):!1}hasIn(q){if(M0.isEmptyPath(q))return this.contents!==void 0;return h.isCollection(this.contents)?this.contents.hasIn(q):!1}set(q,$){if(this.contents==null)this.contents=M0.collectionFromPath(this.schema,[q],$);else if(K0(this.contents))this.contents.set(q,$)}setIn(q,$){if(M0.isEmptyPath(q))this.contents=$;else if(this.contents==null)this.contents=M0.collectionFromPath(this.schema,Array.from(q),$);else if(K0(this.contents))this.contents.setIn(q,$)}setSchema(q,$={}){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 z1.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 z1.Directives({version:q});X={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;X=null;break;default:{let Z=JSON.stringify(q);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${Z}`)}}if($.schema instanceof Object)this.schema=$.schema;else if(X)this.schema=new qz.Schema(Object.assign(X,$));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:q,jsonArg:$,mapAsMap:X,maxAliasCount:Z,onAnchor:H,reviver:z}={}){let U={anchors:new Map,doc:this,keep:!q,mapAsMap:X===!0,mapKeyWarned:!1,maxAliasCount:typeof Z==="number"?Z:100},Q=eH.toJS(this.contents,$??"",U);if(typeof H==="function")for(let{count:J,res:G}of U.anchors.values())H(G,J);return typeof z==="function"?Xz.applyReviver(z,{"":Q},"",Q):Q}toJSON(q,$){return this.toJS({json:!0,jsonArg:q,mapAsMap:!1,onAnchor:$})}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 $=JSON.stringify(q.indent);throw Error(`"indent" option must be a positive integer, not ${$}`)}return $z.stringifyDocument(this,q)}}function K0(q){if(h.isCollection(q))return!0;throw Error("Expected a YAML collection as document contents")}Hz.Document=U1});var r0=I((Qz)=>{class uq extends Error{constructor(q,$,X,Z){super();this.name=q,this.code=X,this.message=Z,this.pos=$}}class E9 extends uq{constructor(q,$,X){super("YAMLParseError",q,$,X)}}class b9 extends uq{constructor(q,$,X){super("YAMLWarning",q,$,X)}}var Uz=(q,$)=>(X)=>{if(X.pos[0]===-1)return;X.linePos=X.pos.map((Q)=>$.linePos(Q));let{line:Z,col:H}=X.linePos[0];X.message+=` at line ${Z}, column ${H}`;let z=H-1,U=q.substring($.lineStarts[Z-1],$.lineStarts[Z]).replace(/[\n\r]+$/,"");if(z>=60&&U.length>80){let Q=Math.min(z-39,U.length-79);U="\u2026"+U.substring(Q),z-=Q-1}if(U.length>80)U=U.substring(0,79)+"\u2026";if(Z>1&&/^ *$/.test(U.substring(0,z))){let Q=q.substring($.lineStarts[Z-2],$.lineStarts[Z-1]);if(Q.length>80)Q=Q.substring(0,79)+`\u2026
85
- `;U=Q+U}if(/[^ ]/.test(U)){let Q=1,J=X.linePos[1];if(J?.line===Z&&J.col>H)Q=Math.max(1,Math.min(J.col-H,80-z));let G=" ".repeat(z)+"^".repeat(Q);X.message+=`:
84
+ `}o6.stringifyDocument=n6});var n0=D((QH)=>{var e6=k0(),M0=_$(),h=A(),$H=e(),qH=n(),zH=X1(),XH=E9(),H1=W$(),ZH=Fq(),HH=x0(),Q1=Kq();class J1{constructor($,q,z){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,h.NODE_TYPE,{value:h.DOC});let X=null;if(typeof q==="function"||Array.isArray(q))X=q;else if(z===void 0&&q)z=q,q=void 0;let Z=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},z);this.options=Z;let{version:H}=Z;if(z?._directives){if(this.directives=z._directives.atDocument(),this.directives.yaml.explicit)H=this.directives.yaml.version}else this.directives=new Q1.Directives({version:H});this.setSchema(H,z),this.contents=$===void 0?null:this.createNode($,X,z)}clone(){let $=Object.create(J1.prototype,{[h.NODE_TYPE]:{value:h.DOC}});if($.commentBefore=this.commentBefore,$.comment=this.comment,$.errors=this.errors.slice(),$.warnings=this.warnings.slice(),$.options=Object.assign({},this.options),this.directives)$.directives=this.directives.clone();if($.schema=this.schema.clone(),$.contents=h.isNode(this.contents)?this.contents.clone($.schema):this.contents,this.range)$.range=this.range.slice();return $}add($){if(P0(this.contents))this.contents.add($)}addIn($,q){if(P0(this.contents))this.contents.addIn($,q)}createAlias($,q){if(!$.anchor){let z=H1.anchorNames(this);$.anchor=!q||z.has(q)?H1.findNewAnchor(q||"a",z):q}return new e6.Alias($.anchor)}createNode($,q,z){let X=void 0;if(typeof q==="function")$=q.call({"":$},"",$),X=q;else if(Array.isArray(q)){let W=(I)=>typeof I==="number"||I instanceof String||I instanceof Number,V=q.filter(W).map(String);if(V.length>0)q=q.concat(V);X=q}else if(z===void 0&&q)z=q,q=void 0;let{aliasDuplicateObjects:Z,anchorPrefix:H,flow:Q,keepUndefined:J,onTagObj:Y,tag:U}=z??{},{onAnchor:B,setAnchors:G,sourceObjects:T}=H1.createNodeAnchors(this,H||"a"),L={aliasDuplicateObjects:Z??!0,keepUndefined:J??!1,onAnchor:B,onTagObj:Y,replacer:X,schema:this.schema,sourceObjects:T},_=HH.createNode($,U,L);if(Q&&h.isCollection(_))_.flow=!0;return G(),_}createPair($,q,z={}){let X=this.createNode($,null,z),Z=this.createNode(q,null,z);return new $H.Pair(X,Z)}delete($){return P0(this.contents)?this.contents.delete($):!1}deleteIn($){if(M0.isEmptyPath($)){if(this.contents==null)return!1;return this.contents=null,!0}return P0(this.contents)?this.contents.deleteIn($):!1}get($,q){return h.isCollection(this.contents)?this.contents.get($,q):void 0}getIn($,q){if(M0.isEmptyPath($))return!q&&h.isScalar(this.contents)?this.contents.value:this.contents;return h.isCollection(this.contents)?this.contents.getIn($,q):void 0}has($){return h.isCollection(this.contents)?this.contents.has($):!1}hasIn($){if(M0.isEmptyPath($))return this.contents!==void 0;return h.isCollection(this.contents)?this.contents.hasIn($):!1}set($,q){if(this.contents==null)this.contents=M0.collectionFromPath(this.schema,[$],q);else if(P0(this.contents))this.contents.set($,q)}setIn($,q){if(M0.isEmptyPath($))this.contents=q;else if(this.contents==null)this.contents=M0.collectionFromPath(this.schema,Array.from($),q);else if(P0(this.contents))this.contents.setIn($,q)}setSchema($,q={}){if(typeof $==="number")$=String($);let z;switch($){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new Q1.Directives({version:"1.1"});z={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=$;else this.directives=new Q1.Directives({version:$});z={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;z=null;break;default:{let X=JSON.stringify($);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${X}`)}}if(q.schema instanceof Object)this.schema=q.schema;else if(z)this.schema=new zH.Schema(Object.assign(z,q));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:$,jsonArg:q,mapAsMap:z,maxAliasCount:X,onAnchor:Z,reviver:H}={}){let Q={anchors:new Map,doc:this,keep:!$,mapAsMap:z===!0,mapKeyWarned:!1,maxAliasCount:typeof X==="number"?X:100},J=qH.toJS(this.contents,q??"",Q);if(typeof Z==="function")for(let{count:Y,res:U}of Q.anchors.values())Z(U,Y);return typeof H==="function"?ZH.applyReviver(H,{"":J},"",J):J}toJSON($,q){return this.toJS({json:!0,jsonArg:$,mapAsMap:!1,onAnchor:q})}toString($={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in $&&(!Number.isInteger($.indent)||Number($.indent)<=0)){let q=JSON.stringify($.indent);throw Error(`"indent" option must be a positive integer, not ${q}`)}return XH.stringifyDocument(this,$)}}function P0($){if(h.isCollection($))return!0;throw Error("Expected a YAML collection as document contents")}QH.Document=J1});var o0=D((GH)=>{class d$ extends Error{constructor($,q,z,X){super();this.name=$,this.code=z,this.message=X,this.pos=q}}class b9 extends d${constructor($,q,z){super("YAMLParseError",$,q,z)}}class C9 extends d${constructor($,q,z){super("YAMLWarning",$,q,z)}}var UH=($,q)=>(z)=>{if(z.pos[0]===-1)return;z.linePos=z.pos.map((J)=>q.linePos(J));let{line:X,col:Z}=z.linePos[0];z.message+=` at line ${X}, column ${Z}`;let H=Z-1,Q=$.substring(q.lineStarts[X-1],q.lineStarts[X]).replace(/[\n\r]+$/,"");if(H>=60&&Q.length>80){let J=Math.min(H-39,Q.length-79);Q="\u2026"+Q.substring(J),H-=J-1}if(Q.length>80)Q=Q.substring(0,79)+"\u2026";if(X>1&&/^ *$/.test(Q.substring(0,H))){let J=$.substring(q.lineStarts[X-2],q.lineStarts[X-1]);if(J.length>80)J=J.substring(0,79)+`\u2026
85
+ `;Q=J+Q}if(/[^ ]/.test(Q)){let J=1,Y=z.linePos[1];if(Y?.line===X&&Y.col>Z)J=Math.max(1,Math.min(Y.col-Z,80-H));let U=" ".repeat(H)+"^".repeat(J);z.message+=`:
86
86
 
87
+ ${Q}
87
88
  ${U}
88
- ${G}
89
- `}};Qz.YAMLError=uq;Qz.YAMLParseError=E9;Qz.YAMLWarning=b9;Qz.prettifyError=Uz});var n0=I((Bz)=>{function Lz(q,{flow:$,indicator:X,next:Z,offset:H,onError:z,parentIndent:U,startOnNewline:Q}){let J=!1,G=Q,Y=Q,T="",L="",_=!1,V=!1,B=null,W=null,D=null,R=null,K=null,w=null,F=null;for(let P of q){if(V){if(P.type!=="space"&&P.type!=="newline"&&P.type!=="comma")z(P.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");V=!1}if(B){if(G&&P.type!=="comment"&&P.type!=="newline")z(B,"TAB_AS_INDENT","Tabs are not allowed as indentation");B=null}switch(P.type){case"space":if(!$&&(X!=="doc-start"||Z?.type!=="flow-collection")&&P.source.includes("\t"))B=P;Y=!0;break;case"comment":{if(!Y)z(P,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let C=P.source.substring(1)||" ";if(!T)T=C;else T+=L+C;L="",G=!1;break}case"newline":if(G){if(T)T+=P.source;else if(!w||X!=="seq-item-ind")J=!0}else L+=P.source;if(G=!0,_=!0,W||D)R=P;Y=!0;break;case"anchor":if(W)z(P,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(P.source.endsWith(":"))z(P.offset+P.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);W=P,F??(F=P.offset),G=!1,Y=!1,V=!0;break;case"tag":{if(D)z(P,"MULTIPLE_TAGS","A node can have at most one tag");D=P,F??(F=P.offset),G=!1,Y=!1,V=!0;break}case X:if(W||D)z(P,"BAD_PROP_ORDER",`Anchors and tags must be after the ${P.source} indicator`);if(w)z(P,"UNEXPECTED_TOKEN",`Unexpected ${P.source} in ${$??"collection"}`);w=P,G=X==="seq-item-ind"||X==="explicit-key-ind",Y=!1;break;case"comma":if($){if(K)z(P,"UNEXPECTED_TOKEN",`Unexpected , in ${$}`);K=P,G=!1,Y=!1;break}default:z(P,"UNEXPECTED_TOKEN",`Unexpected ${P.type} token`),G=!1,Y=!1}}let O=q[q.length-1],j=O?O.offset+O.source.length:H;if(V&&Z&&Z.type!=="space"&&Z.type!=="newline"&&Z.type!=="comma"&&(Z.type!=="scalar"||Z.source!==""))z(Z.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(B&&(G&&B.indent<=U||Z?.type==="block-map"||Z?.type==="block-seq"))z(B,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:K,found:w,spaceBefore:J,comment:T,hasNewline:_,anchor:W,tag:D,newlineAfterProp:R,end:j,start:F??j}}Bz.resolveProps=Lz});var vq=I((Wz)=>{function Q1(q){if(!q)return null;switch(q.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(q.source.includes(`
90
- `))return!0;if(q.end){for(let $ of q.end)if($.type==="newline")return!0}return!1;case"flow-collection":for(let $ of q.items){for(let X of $.start)if(X.type==="newline")return!0;if($.sep){for(let X of $.sep)if(X.type==="newline")return!0}if(Q1($.key)||Q1($.value))return!0}return!1;default:return!0}}Wz.containsNewline=Q1});var G1=I((Rz)=>{var Iz=vq();function Dz(q,$,X){if($?.type==="flow-collection"){let Z=$.end[0];if(Z.indent===q&&(Z.source==="]"||Z.source==="}")&&Iz.containsNewline($))X(Z,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Rz.flowIndentCheck=Dz});var J1=I((Kz)=>{var C9=A();function Mz(q,$,X){let{uniqueKeys:Z}=q.options;if(Z===!1)return!1;let H=typeof Z==="function"?Z:(z,U)=>z===U||C9.isScalar(z)&&C9.isScalar(U)&&z.value===U.value;return $.some((z)=>H(z.key,X))}Kz.mapIncludes=Mz});var h9=I((jz)=>{var y9=e(),Fz=$0(),f9=n0(),Oz=vq(),x9=G1(),Az=J1(),k9="All mapping items must start at the same column";function Sz({composeNode:q,composeEmptyNode:$},X,Z,H,z){let Q=new(z?.nodeClass??Fz.YAMLMap)(X.schema);if(X.atRoot)X.atRoot=!1;let J=Z.offset,G=null;for(let Y of Z.items){let{start:T,key:L,sep:_,value:V}=Y,B=f9.resolveProps(T,{indicator:"explicit-key-ind",next:L??_?.[0],offset:J,onError:H,parentIndent:Z.indent,startOnNewline:!0}),W=!B.found;if(W){if(L){if(L.type==="block-seq")H(J,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in L&&L.indent!==Z.indent)H(J,"BAD_INDENT",k9)}if(!B.anchor&&!B.tag&&!_){if(G=B.end,B.comment)if(Q.comment)Q.comment+=`
91
- `+B.comment;else Q.comment=B.comment;continue}if(B.newlineAfterProp||Oz.containsNewline(L))H(L??T[T.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(B.found?.indent!==Z.indent)H(J,"BAD_INDENT",k9);X.atKey=!0;let D=B.end,R=L?q(X,L,B,H):$(X,D,T,null,B,H);if(X.schema.compat)x9.flowIndentCheck(Z.indent,L,H);if(X.atKey=!1,Az.mapIncludes(X,Q.items,R))H(D,"DUPLICATE_KEY","Map keys must be unique");let K=f9.resolveProps(_??[],{indicator:"map-value-ind",next:V,offset:R.range[2],onError:H,parentIndent:Z.indent,startOnNewline:!L||L.type==="block-scalar"});if(J=K.end,K.found){if(W){if(V?.type==="block-map"&&!K.hasNewline)H(J,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(X.options.strict&&B.start<K.found.offset-1024)H(R.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let w=V?q(X,V,K,H):$(X,J,_,null,K,H);if(X.schema.compat)x9.flowIndentCheck(Z.indent,V,H);J=w.range[2];let F=new y9.Pair(R,w);if(X.options.keepSourceTokens)F.srcToken=Y;Q.items.push(F)}else{if(W)H(R.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(K.comment)if(R.comment)R.comment+=`
92
- `+K.comment;else R.comment=K.comment;let w=new y9.Pair(R);if(X.options.keepSourceTokens)w.srcToken=Y;Q.items.push(w)}}if(G&&G<J)H(G,"IMPOSSIBLE","Map comment with trailing content");return Q.range=[Z.offset,J,G??J],Q}jz.resolveBlockMap=Sz});var g9=I((fz)=>{var Ez=X0(),bz=n0(),Cz=G1();function yz({composeNode:q,composeEmptyNode:$},X,Z,H,z){let Q=new(z?.nodeClass??Ez.YAMLSeq)(X.schema);if(X.atRoot)X.atRoot=!1;if(X.atKey)X.atKey=!1;let J=Z.offset,G=null;for(let{start:Y,value:T}of Z.items){let L=bz.resolveProps(Y,{indicator:"seq-item-ind",next:T,offset:J,onError:H,parentIndent:Z.indent,startOnNewline:!0});if(!L.found)if(L.anchor||L.tag||T)if(T?.type==="block-seq")H(L.end,"BAD_INDENT","All sequence items must start at the same column");else H(J,"MISSING_CHAR","Sequence item without - indicator");else{if(G=L.end,L.comment)Q.comment=L.comment;continue}let _=T?q(X,T,L,H):$(X,L.end,Y,null,L,H);if(X.schema.compat)Cz.flowIndentCheck(Z.indent,T,H);J=_.range[2],Q.items.push(_)}return Q.range=[Z.offset,J,G??J],Q}fz.resolveBlockSeq=yz});var w0=I((hz)=>{function kz(q,$,X,Z){let H="";if(q){let z=!1,U="";for(let Q of q){let{source:J,type:G}=Q;switch(G){case"space":z=!0;break;case"comment":{if(X&&!z)Z(Q,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let Y=J.substring(1)||" ";if(!H)H=Y;else H+=U+Y;U="";break}case"newline":if(H)U+=J;z=!0;break;default:Z(Q,"UNEXPECTED_TOKEN",`Unexpected ${G} at node end`)}$+=J.length}}return{comment:H,offset:$}}hz.resolveEnd=kz});var m9=I((iz)=>{var uz=A(),vz=e(),u9=$0(),mz=X0(),dz=w0(),v9=n0(),pz=vq(),lz=J1(),T1="Block collections are not allowed within flow collections",Y1=(q)=>q&&(q.type==="block-map"||q.type==="block-seq");function cz({composeNode:q,composeEmptyNode:$},X,Z,H,z){let U=Z.start.source==="{",Q=U?"flow map":"flow sequence",G=new(z?.nodeClass??(U?u9.YAMLMap:mz.YAMLSeq))(X.schema);G.flow=!0;let Y=X.atRoot;if(Y)X.atRoot=!1;if(X.atKey)X.atKey=!1;let T=Z.offset+Z.start.source.length;for(let W=0;W<Z.items.length;++W){let D=Z.items[W],{start:R,key:K,sep:w,value:F}=D,O=v9.resolveProps(R,{flow:Q,indicator:"explicit-key-ind",next:K??w?.[0],offset:T,onError:H,parentIndent:Z.indent,startOnNewline:!1});if(!O.found){if(!O.anchor&&!O.tag&&!w&&!F){if(W===0&&O.comma)H(O.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${Q}`);else if(W<Z.items.length-1)H(O.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${Q}`);if(O.comment)if(G.comment)G.comment+=`
93
- `+O.comment;else G.comment=O.comment;T=O.end;continue}if(!U&&X.options.strict&&pz.containsNewline(K))H(K,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(W===0){if(O.comma)H(O.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${Q}`)}else{if(!O.comma)H(O.start,"MISSING_CHAR",`Missing , between ${Q} items`);if(O.comment){let j="";q:for(let P of R)switch(P.type){case"comma":case"space":break;case"comment":j=P.source.substring(1);break q;default:break q}if(j){let P=G.items[G.items.length-1];if(uz.isPair(P))P=P.value??P.key;if(P.comment)P.comment+=`
94
- `+j;else P.comment=j;O.comment=O.comment.substring(j.length+1)}}}if(!U&&!w&&!O.found){let j=F?q(X,F,O,H):$(X,O.end,w,null,O,H);if(G.items.push(j),T=j.range[2],Y1(F))H(j.range,"BLOCK_IN_FLOW",T1)}else{X.atKey=!0;let j=O.end,P=K?q(X,K,O,H):$(X,j,R,null,O,H);if(Y1(K))H(P.range,"BLOCK_IN_FLOW",T1);X.atKey=!1;let C=v9.resolveProps(w??[],{flow:Q,indicator:"map-value-ind",next:F,offset:P.range[2],onError:H,parentIndent:Z.indent,startOnNewline:!1});if(C.found){if(!U&&!O.found&&X.options.strict){if(w)for(let y of w){if(y===C.found)break;if(y.type==="newline"){H(y,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(O.start<C.found.offset-1024)H(C.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(F)if("source"in F&&F.source?.[0]===":")H(F,"MISSING_CHAR",`Missing space after : in ${Q}`);else H(C.start,"MISSING_CHAR",`Missing , or : between ${Q} items`);let r=F?q(X,F,C,H):C.found?$(X,C.end,w,null,C,H):null;if(r){if(Y1(F))H(r.range,"BLOCK_IN_FLOW",T1)}else if(C.comment)if(P.comment)P.comment+=`
95
- `+C.comment;else P.comment=C.comment;let L0=new vz.Pair(P,r);if(X.options.keepSourceTokens)L0.srcToken=D;if(U){let y=G;if(lz.mapIncludes(X,y.items,P))H(j,"DUPLICATE_KEY","Map keys must be unique");y.items.push(L0)}else{let y=new u9.YAMLMap(X.schema);y.flow=!0,y.items.push(L0);let a1=(r??P).range;y.range=[P.range[0],a1[1],a1[2]],G.items.push(y)}T=r?r.range[2]:C.end}}let L=U?"}":"]",[_,...V]=Z.end,B=T;if(_?.source===L)B=_.offset+_.source.length;else{let W=Q[0].toUpperCase()+Q.substring(1),D=Y?`${W} must end with a ${L}`:`${W} in block collection must be sufficiently indented and end with a ${L}`;if(H(T,Y?"MISSING_CHAR":"BAD_INDENT",D),_&&_.source.length!==1)V.unshift(_)}if(V.length>0){let W=dz.resolveEnd(V,B,X.options.strict,H);if(W.comment)if(G.comment)G.comment+=`
96
- `+W.comment;else G.comment=W.comment;G.range=[Z.offset,B,W.offset]}else G.range=[Z.offset,B,B];return G}iz.resolveFlowCollection=cz});var d9=I((XU)=>{var sz=A(),rz=b(),nz=$0(),oz=X0(),tz=h9(),ez=g9(),qU=m9();function L1(q,$,X,Z,H,z){let U=X.type==="block-map"?tz.resolveBlockMap(q,$,X,Z,z):X.type==="block-seq"?ez.resolveBlockSeq(q,$,X,Z,z):qU.resolveFlowCollection(q,$,X,Z,z),Q=U.constructor;if(H==="!"||H===Q.tagName)return U.tag=Q.tagName,U;if(H)U.tag=H;return U}function $U(q,$,X,Z,H){let z=Z.tag,U=!z?null:$.directives.tagName(z.source,(L)=>H(z,"TAG_RESOLVE_FAILED",L));if(X.type==="block-seq"){let{anchor:L,newlineAfterProp:_}=Z,V=L&&z?L.offset>z.offset?L:z:L??z;if(V&&(!_||_.offset<V.offset))H(V,"MISSING_CHAR","Missing newline after block sequence props")}let Q=X.type==="block-map"?"map":X.type==="block-seq"?"seq":X.start.source==="{"?"map":"seq";if(!z||!U||U==="!"||U===nz.YAMLMap.tagName&&Q==="map"||U===oz.YAMLSeq.tagName&&Q==="seq")return L1(q,$,X,H,U);let J=$.schema.tags.find((L)=>L.tag===U&&L.collection===Q);if(!J){let L=$.schema.knownTags[U];if(L?.collection===Q)$.schema.tags.push(Object.assign({},L,{default:!1})),J=L;else{if(L)H(z,"BAD_COLLECTION_TYPE",`${L.tag} used for ${Q} collection, but expects ${L.collection??"scalar"}`,!0);else H(z,"TAG_RESOLVE_FAILED",`Unresolved tag: ${U}`,!0);return L1(q,$,X,H,U)}}let G=L1(q,$,X,H,U,J),Y=J.resolve?.(G,(L)=>H(z,"TAG_RESOLVE_FAILED",L),$.options)??G,T=sz.isNode(Y)?Y:new rz.Scalar(Y);if(T.range=G.range,T.tag=U,J?.format)T.format=J.format;return T}XU.composeCollection=$U});var _1=I((QU)=>{var B1=b();function HU(q,$,X){let Z=$.offset,H=zU($,q.options.strict,X);if(!H)return{value:"",type:null,comment:"",range:[Z,Z,Z]};let z=H.mode===">"?B1.Scalar.BLOCK_FOLDED:B1.Scalar.BLOCK_LITERAL,U=$.source?UU($.source):[],Q=U.length;for(let B=U.length-1;B>=0;--B){let W=U[B][1];if(W===""||W==="\r")Q=B;else break}if(Q===0){let B=H.chomp==="+"&&U.length>0?`
97
- `.repeat(Math.max(1,U.length-1)):"",W=Z+H.length;if($.source)W+=$.source.length;return{value:B,type:z,comment:H.comment,range:[Z,W,W]}}let J=$.indent+H.indent,G=$.offset+H.length,Y=0;for(let B=0;B<Q;++B){let[W,D]=U[B];if(D===""||D==="\r"){if(H.indent===0&&W.length>J)J=W.length}else{if(W.length<J)X(G+W.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(H.indent===0)J=W.length;if(Y=B,J===0&&!q.atRoot)X(G,"BAD_INDENT","Block scalar values in collections must be indented");break}G+=W.length+D.length+1}for(let B=U.length-1;B>=Q;--B)if(U[B][0].length>J)Q=B+1;let T="",L="",_=!1;for(let B=0;B<Y;++B)T+=U[B][0].slice(J)+`
98
- `;for(let B=Y;B<Q;++B){let[W,D]=U[B];G+=W.length+D.length+1;let R=D[D.length-1]==="\r";if(R)D=D.slice(0,-1);if(D&&W.length<J){let w=`Block scalar lines must not be less indented than their ${H.indent?"explicit indentation indicator":"first line"}`;X(G-D.length-(R?2:1),"BAD_INDENT",w),W=""}if(z===B1.Scalar.BLOCK_LITERAL)T+=L+W.slice(J)+D,L=`
99
- `;else if(W.length>J||D[0]==="\t"){if(L===" ")L=`
100
- `;else if(!_&&L===`
101
- `)L=`
102
-
103
- `;T+=L+W.slice(J)+D,L=`
104
- `,_=!0}else if(D==="")if(L===`
105
- `)T+=`
106
- `;else L=`
107
- `;else T+=L+D,L=" ",_=!1}switch(H.chomp){case"-":break;case"+":for(let B=Q;B<U.length;++B)T+=`
108
- `+U[B][0].slice(J);if(T[T.length-1]!==`
109
- `)T+=`
110
- `;break;default:T+=`
111
- `}let V=Z+H.length+$.source.length;return{value:T,type:z,comment:H.comment,range:[Z,V,V]}}function zU({offset:q,props:$},X,Z){if($[0].type!=="block-scalar-header")return Z($[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:H}=$[0],z=H[0],U=0,Q="",J=-1;for(let L=1;L<H.length;++L){let _=H[L];if(!Q&&(_==="-"||_==="+"))Q=_;else{let V=Number(_);if(!U&&V)U=V;else if(J===-1)J=q+L}}if(J!==-1)Z(J,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${H}`);let G=!1,Y="",T=H.length;for(let L=1;L<$.length;++L){let _=$[L];switch(_.type){case"space":G=!0;case"newline":T+=_.source.length;break;case"comment":if(X&&!G)Z(_,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");T+=_.source.length,Y=_.source.substring(1);break;case"error":Z(_,"UNEXPECTED_TOKEN",_.message),T+=_.source.length;break;default:{let V=`Unexpected token in block scalar header: ${_.type}`;Z(_,"UNEXPECTED_TOKEN",V);let B=_.source;if(B&&typeof B==="string")T+=B.length}}}return{mode:z,indent:U,chomp:Q,comment:Y,length:T}}function UU(q){let $=q.split(/\n( *)/),X=$[0],Z=X.match(/^( *)/),z=[Z?.[1]?[Z[1],X.slice(Z[1].length)]:["",X]];for(let U=1;U<$.length;U+=2)z.push([$[U],$[U+1]]);return z}QU.resolveBlockScalar=HU});var V1=I((IU)=>{var W1=b(),JU=w0();function TU(q,$,X){let{offset:Z,type:H,source:z,end:U}=q,Q,J,G=(L,_,V)=>X(Z+L,_,V);switch(H){case"scalar":Q=W1.Scalar.PLAIN,J=YU(z,G);break;case"single-quoted-scalar":Q=W1.Scalar.QUOTE_SINGLE,J=LU(z,G);break;case"double-quoted-scalar":Q=W1.Scalar.QUOTE_DOUBLE,J=BU(z,G);break;default:return X(q,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${H}`),{value:"",type:null,comment:"",range:[Z,Z+z.length,Z+z.length]}}let Y=Z+z.length,T=JU.resolveEnd(U,Y,$,X);return{value:J,type:Q,comment:T.comment,range:[Z,Y,T.offset]}}function YU(q,$){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)$(0,"BAD_SCALAR_START",`Plain value cannot start with ${X}`);return p9(q)}function LU(q,$){if(q[q.length-1]!=="'"||q.length===1)$(q.length,"MISSING_CHAR","Missing closing 'quote");return p9(q.slice(1,-1)).replace(/''/g,"'")}function p9(q){let $,X;try{$=new RegExp(`(.*?)(?<![ ])[ ]*\r?
112
- `,"sy"),X=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
113
- `,"sy")}catch{$=/(.*?)[ \t]*\r?\n/sy,X=/[ \t]*(.*?)[ \t]*\r?\n/sy}let Z=$.exec(q);if(!Z)return q;let H=Z[1],z=" ",U=$.lastIndex;X.lastIndex=U;while(Z=X.exec(q)){if(Z[1]==="")if(z===`
114
- `)H+=z;else z=`
115
- `;else H+=z+Z[1],z=" ";U=X.lastIndex}let Q=/[ \t]*(.*)/sy;return Q.lastIndex=U,Z=Q.exec(q),H+z+(Z?.[1]??"")}function BU(q,$){let X="";for(let Z=1;Z<q.length-1;++Z){let H=q[Z];if(H==="\r"&&q[Z+1]===`
116
- `)continue;if(H===`
117
- `){let{fold:z,offset:U}=_U(q,Z);X+=z,Z=U}else if(H==="\\"){let z=q[++Z],U=WU[z];if(U)X+=U;else if(z===`
118
- `){z=q[Z+1];while(z===" "||z==="\t")z=q[++Z+1]}else if(z==="\r"&&q[Z+1]===`
119
- `){z=q[++Z+1];while(z===" "||z==="\t")z=q[++Z+1]}else if(z==="x"||z==="u"||z==="U"){let Q={x:2,u:4,U:8}[z];X+=VU(q,Z+1,Q,$),Z+=Q}else{let Q=q.substr(Z-1,2);$(Z-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${Q}`),X+=Q}}else if(H===" "||H==="\t"){let z=Z,U=q[Z+1];while(U===" "||U==="\t")U=q[++Z+1];if(U!==`
120
- `&&!(U==="\r"&&q[Z+2]===`
121
- `))X+=Z>z?q.slice(z,Z+1):H}else X+=H}if(q[q.length-1]!=='"'||q.length===1)$(q.length,"MISSING_CHAR",'Missing closing "quote');return X}function _U(q,$){let X="",Z=q[$+1];while(Z===" "||Z==="\t"||Z===`
122
- `||Z==="\r"){if(Z==="\r"&&q[$+2]!==`
123
- `)break;if(Z===`
124
- `)X+=`
125
- `;$+=1,Z=q[$+1]}if(!X)X=" ";return{fold:X,offset:$}}var WU={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
126
- `,r:"\r",t:"\t",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function VU(q,$,X,Z){let H=q.substr($,X),U=H.length===X&&/^[0-9a-fA-F]+$/.test(H)?parseInt(H,16):NaN;if(isNaN(U)){let Q=q.substr($-2,X+2);return Z($-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${Q}`),Q}return String.fromCodePoint(U)}IU.resolveFlowScalar=TU});var c9=I((FU)=>{var T0=A(),l9=b(),RU=_1(),PU=V1();function MU(q,$,X,Z){let{value:H,type:z,comment:U,range:Q}=$.type==="block-scalar"?RU.resolveBlockScalar(q,$,Z):PU.resolveFlowScalar($,q.options.strict,Z),J=X?q.directives.tagName(X.source,(T)=>Z(X,"TAG_RESOLVE_FAILED",T)):null,G;if(q.options.stringKeys&&q.atKey)G=q.schema[T0.SCALAR];else if(J)G=KU(q.schema,H,J,X,Z);else if($.type==="scalar")G=wU(q,H,$,Z);else G=q.schema[T0.SCALAR];let Y;try{let T=G.resolve(H,(L)=>Z(X??$,"TAG_RESOLVE_FAILED",L),q.options);Y=T0.isScalar(T)?T:new l9.Scalar(T)}catch(T){let L=T instanceof Error?T.message:String(T);Z(X??$,"TAG_RESOLVE_FAILED",L),Y=new l9.Scalar(H)}if(Y.range=Q,Y.source=H,z)Y.type=z;if(J)Y.tag=J;if(G.format)Y.format=G.format;if(U)Y.comment=U;return Y}function KU(q,$,X,Z,H){if(X==="!")return q[T0.SCALAR];let z=[];for(let Q of q.tags)if(!Q.collection&&Q.tag===X)if(Q.default&&Q.test)z.push(Q);else return Q;for(let Q of z)if(Q.test?.test($))return Q;let U=q.knownTags[X];if(U&&!U.collection)return q.tags.push(Object.assign({},U,{default:!1,test:void 0})),U;return H(Z,"TAG_RESOLVE_FAILED",`Unresolved tag: ${X}`,X!=="tag:yaml.org,2002:str"),q[T0.SCALAR]}function wU({atKey:q,directives:$,schema:X},Z,H,z){let U=X.tags.find((Q)=>(Q.default===!0||q&&Q.default==="key")&&Q.test?.test(Z))||X[T0.SCALAR];if(X.compat){let Q=X.compat.find((J)=>J.default&&J.test?.test(Z))??X[T0.SCALAR];if(U.tag!==Q.tag){let J=$.tagString(U.tag),G=$.tagString(Q.tag),Y=`Value may be parsed as either ${J} or ${G}`;z(H,"TAG_RESOLVE_FAILED",Y,!0)}}return U}FU.composeScalar=MU});var i9=I((SU)=>{function AU(q,$,X){if($){X??(X=$.length);for(let Z=X-1;Z>=0;--Z){let H=$[Z];switch(H.type){case"space":case"comment":case"newline":q-=H.source.length;continue}H=$[++Z];while(H?.type==="space")q+=H.source.length,H=$[++Z];break}}return q}SU.emptyScalarPosition=AU});var r9=I((kU)=>{var NU=y0(),EU=A(),bU=d9(),a9=c9(),CU=w0(),yU=i9(),fU={composeNode:s9,composeEmptyNode:I1};function s9(q,$,X,Z){let H=q.atKey,{spaceBefore:z,comment:U,anchor:Q,tag:J}=X,G,Y=!0;switch($.type){case"alias":if(G=xU(q,$,Z),Q||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=a9.composeScalar(q,$,J,Z),Q)G.anchor=Q.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":if(G=bU.composeCollection(fU,q,$,X,Z),Q)G.anchor=Q.source.substring(1);break;default:{let T=$.type==="error"?$.message:`Unsupported token (type: ${$.type})`;Z($,"UNEXPECTED_TOKEN",T),G=I1(q,$.offset,void 0,null,X,Z),Y=!1}}if(Q&&G.anchor==="")Z(Q,"BAD_ALIAS","Anchor cannot be an empty string");if(H&&q.options.stringKeys&&(!EU.isScalar(G)||typeof G.value!=="string"||G.tag&&G.tag!=="tag:yaml.org,2002:str"))Z(J??$,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(z)G.spaceBefore=!0;if(U)if($.type==="scalar"&&$.source==="")G.comment=U;else G.commentBefore=U;if(q.options.keepSourceTokens&&Y)G.srcToken=$;return G}function I1(q,$,X,Z,{spaceBefore:H,comment:z,anchor:U,tag:Q,end:J},G){let Y={type:"scalar",offset:yU.emptyScalarPosition($,X,Z),indent:-1,source:""},T=a9.composeScalar(q,Y,Q,G);if(U){if(T.anchor=U.source.substring(1),T.anchor==="")G(U,"BAD_ALIAS","Anchor cannot be an empty string")}if(H)T.spaceBefore=!0;if(z)T.comment=z,T.range[2]=J;return T}function xU({options:q},{offset:$,source:X,end:Z},H){let z=new NU.Alias(X.substring(1));if(z.source==="")H($,"BAD_ALIAS","Alias cannot be an empty string");if(z.source.endsWith(":"))H($+X.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let U=$+X.length,Q=CU.resolveEnd(Z,U,q.strict,H);if(z.range=[$,U,Q.offset],Q.comment)z.comment=Q.comment;return z}kU.composeEmptyNode=I1;kU.composeNode=s9});var o9=I((pU)=>{var uU=s0(),n9=r9(),vU=w0(),mU=n0();function dU(q,$,{offset:X,start:Z,value:H,end:z},U){let Q=Object.assign({_directives:$},q),J=new uU.Document(void 0,Q),G={atKey:!1,atRoot:!0,directives:J.directives,options:J.options,schema:J.schema},Y=mU.resolveProps(Z,{indicator:"doc-start",next:H??z?.[0],offset:X,onError:U,parentIndent:0,startOnNewline:!0});if(Y.found){if(J.directives.docStart=!0,H&&(H.type==="block-map"||H.type==="block-seq")&&!Y.hasNewline)U(Y.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}J.contents=H?n9.composeNode(G,H,Y,U):n9.composeEmptyNode(G,Y.end,Z,null,Y,U);let T=J.contents.range[2],L=vU.resolveEnd(z,T,!1,U);if(L.comment)J.comment=L.comment;return J.range=[X,T,L.offset],J}pU.composeDoc=dU});var D1=I((nU)=>{var cU=c("process"),iU=K$(),aU=s0(),o0=r0(),t9=A(),sU=o9(),rU=w0();function t0(q){if(typeof q==="number")return[q,q+1];if(Array.isArray(q))return q.length===2?q:[q[0],q[1]];let{offset:$,source:X}=q;return[$,$+(typeof X==="string"?X.length:1)]}function e9(q){let $="",X=!1,Z=!1;for(let H=0;H<q.length;++H){let z=q[H];switch(z[0]){case"#":$+=($===""?"":Z?`
89
+ `}};GH.YAMLError=d$;GH.YAMLParseError=b9;GH.YAMLWarning=C9;GH.prettifyError=UH});var t0=D((VH)=>{function LH($,{flow:q,indicator:z,next:X,offset:Z,onError:H,parentIndent:Q,startOnNewline:J}){let Y=!1,U=J,B=J,G="",T="",L=!1,_=!1,W=null,V=null,I=null,R=null,P=null,K=null,F=null;for(let w of $){if(_){if(w.type!=="space"&&w.type!=="newline"&&w.type!=="comma")H(w.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");_=!1}if(W){if(U&&w.type!=="comment"&&w.type!=="newline")H(W,"TAB_AS_INDENT","Tabs are not allowed as indentation");W=null}switch(w.type){case"space":if(!q&&(z!=="doc-start"||X?.type!=="flow-collection")&&w.source.includes("\t"))W=w;B=!0;break;case"comment":{if(!B)H(w,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let C=w.source.substring(1)||" ";if(!G)G=C;else G+=T+C;T="",U=!1;break}case"newline":if(U){if(G)G+=w.source;else if(!K||z!=="seq-item-ind")Y=!0}else T+=w.source;if(U=!0,L=!0,V||I)R=w;B=!0;break;case"anchor":if(V)H(w,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(w.source.endsWith(":"))H(w.offset+w.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);V=w,F??(F=w.offset),U=!1,B=!1,_=!0;break;case"tag":{if(I)H(w,"MULTIPLE_TAGS","A node can have at most one tag");I=w,F??(F=w.offset),U=!1,B=!1,_=!0;break}case z:if(V||I)H(w,"BAD_PROP_ORDER",`Anchors and tags must be after the ${w.source} indicator`);if(K)H(w,"UNEXPECTED_TOKEN",`Unexpected ${w.source} in ${q??"collection"}`);K=w,U=z==="seq-item-ind"||z==="explicit-key-ind",B=!1;break;case"comma":if(q){if(P)H(w,"UNEXPECTED_TOKEN",`Unexpected , in ${q}`);P=w,U=!1,B=!1;break}default:H(w,"UNEXPECTED_TOKEN",`Unexpected ${w.type} token`),U=!1,B=!1}}let O=$[$.length-1],j=O?O.offset+O.source.length:Z;if(_&&X&&X.type!=="space"&&X.type!=="newline"&&X.type!=="comma"&&(X.type!=="scalar"||X.source!==""))H(X.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(W&&(U&&W.indent<=Q||X?.type==="block-map"||X?.type==="block-seq"))H(W,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:P,found:K,spaceBefore:Y,comment:G,hasNewline:L,anchor:V,tag:I,newlineAfterProp:R,end:j,start:F??j}}VH.resolveProps=LH});var p$=D((DH)=>{function U1($){if(!$)return null;switch($.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if($.source.includes(`
90
+ `))return!0;if($.end){for(let q of $.end)if(q.type==="newline")return!0}return!1;case"flow-collection":for(let q of $.items){for(let z of q.start)if(z.type==="newline")return!0;if(q.sep){for(let z of q.sep)if(z.type==="newline")return!0}if(U1(q.key)||U1(q.value))return!0}return!1;default:return!0}}DH.containsNewline=U1});var G1=D((MH)=>{var RH=p$();function wH($,q,z){if(q?.type==="flow-collection"){let X=q.end[0];if(X.indent===$&&(X.source==="]"||X.source==="}")&&RH.containsNewline(q))z(X,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}MH.flowIndentCheck=wH});var Y1=D((FH)=>{var y9=A();function KH($,q,z){let{uniqueKeys:X}=$.options;if(X===!1)return!1;let Z=typeof X==="function"?X:(H,Q)=>H===Q||y9.isScalar(H)&&y9.isScalar(Q)&&H.value===Q.value;return q.some((H)=>Z(H.key,z))}FH.mapIncludes=KH});var g9=D((EH)=>{var f9=e(),AH=q0(),k9=t0(),SH=p$(),x9=G1(),jH=Y1(),h9="All mapping items must start at the same column";function NH({composeNode:$,composeEmptyNode:q},z,X,Z,H){let J=new(H?.nodeClass??AH.YAMLMap)(z.schema);if(z.atRoot)z.atRoot=!1;let Y=X.offset,U=null;for(let B of X.items){let{start:G,key:T,sep:L,value:_}=B,W=k9.resolveProps(G,{indicator:"explicit-key-ind",next:T??L?.[0],offset:Y,onError:Z,parentIndent:X.indent,startOnNewline:!0}),V=!W.found;if(V){if(T){if(T.type==="block-seq")Z(Y,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in T&&T.indent!==X.indent)Z(Y,"BAD_INDENT",h9)}if(!W.anchor&&!W.tag&&!L){if(U=W.end,W.comment)if(J.comment)J.comment+=`
91
+ `+W.comment;else J.comment=W.comment;continue}if(W.newlineAfterProp||SH.containsNewline(T))Z(T??G[G.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(W.found?.indent!==X.indent)Z(Y,"BAD_INDENT",h9);z.atKey=!0;let I=W.end,R=T?$(z,T,W,Z):q(z,I,G,null,W,Z);if(z.schema.compat)x9.flowIndentCheck(X.indent,T,Z);if(z.atKey=!1,jH.mapIncludes(z,J.items,R))Z(I,"DUPLICATE_KEY","Map keys must be unique");let P=k9.resolveProps(L??[],{indicator:"map-value-ind",next:_,offset:R.range[2],onError:Z,parentIndent:X.indent,startOnNewline:!T||T.type==="block-scalar"});if(Y=P.end,P.found){if(V){if(_?.type==="block-map"&&!P.hasNewline)Z(Y,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(z.options.strict&&W.start<P.found.offset-1024)Z(R.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let K=_?$(z,_,P,Z):q(z,Y,L,null,P,Z);if(z.schema.compat)x9.flowIndentCheck(X.indent,_,Z);Y=K.range[2];let F=new f9.Pair(R,K);if(z.options.keepSourceTokens)F.srcToken=B;J.items.push(F)}else{if(V)Z(R.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(P.comment)if(R.comment)R.comment+=`
92
+ `+P.comment;else R.comment=P.comment;let K=new f9.Pair(R);if(z.options.keepSourceTokens)K.srcToken=B;J.items.push(K)}}if(U&&U<Y)Z(U,"IMPOSSIBLE","Map comment with trailing content");return J.range=[X.offset,Y,U??Y],J}EH.resolveBlockMap=NH});var v9=D((xH)=>{var CH=z0(),yH=t0(),fH=G1();function kH({composeNode:$,composeEmptyNode:q},z,X,Z,H){let J=new(H?.nodeClass??CH.YAMLSeq)(z.schema);if(z.atRoot)z.atRoot=!1;if(z.atKey)z.atKey=!1;let Y=X.offset,U=null;for(let{start:B,value:G}of X.items){let T=yH.resolveProps(B,{indicator:"seq-item-ind",next:G,offset:Y,onError:Z,parentIndent:X.indent,startOnNewline:!0});if(!T.found)if(T.anchor||T.tag||G)if(G?.type==="block-seq")Z(T.end,"BAD_INDENT","All sequence items must start at the same column");else Z(Y,"MISSING_CHAR","Sequence item without - indicator");else{if(U=T.end,T.comment)J.comment=T.comment;continue}let L=G?$(z,G,T,Z):q(z,T.end,B,null,T,Z);if(z.schema.compat)fH.flowIndentCheck(X.indent,G,Z);Y=L.range[2],J.items.push(L)}return J.range=[X.offset,Y,U??Y],J}xH.resolveBlockSeq=kH});var K0=D((vH)=>{function gH($,q,z,X){let Z="";if($){let H=!1,Q="";for(let J of $){let{source:Y,type:U}=J;switch(U){case"space":H=!0;break;case"comment":{if(z&&!H)X(J,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let B=Y.substring(1)||" ";if(!Z)Z=B;else Z+=Q+B;Q="";break}case"newline":if(Z)Q+=Y;H=!0;break;default:X(J,"UNEXPECTED_TOKEN",`Unexpected ${U} at node end`)}q+=Y.length}}return{comment:Z,offset:q}}vH.resolveEnd=gH});var d9=D((sH)=>{var mH=A(),dH=e(),u9=q0(),pH=z0(),lH=K0(),m9=t0(),cH=p$(),iH=Y1(),B1="Block collections are not allowed within flow collections",T1=($)=>$&&($.type==="block-map"||$.type==="block-seq");function aH({composeNode:$,composeEmptyNode:q},z,X,Z,H){let Q=X.start.source==="{",J=Q?"flow map":"flow sequence",U=new(H?.nodeClass??(Q?u9.YAMLMap:pH.YAMLSeq))(z.schema);U.flow=!0;let B=z.atRoot;if(B)z.atRoot=!1;if(z.atKey)z.atKey=!1;let G=X.offset+X.start.source.length;for(let V=0;V<X.items.length;++V){let I=X.items[V],{start:R,key:P,sep:K,value:F}=I,O=m9.resolveProps(R,{flow:J,indicator:"explicit-key-ind",next:P??K?.[0],offset:G,onError:Z,parentIndent:X.indent,startOnNewline:!1});if(!O.found){if(!O.anchor&&!O.tag&&!K&&!F){if(V===0&&O.comma)Z(O.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${J}`);else if(V<X.items.length-1)Z(O.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${J}`);if(O.comment)if(U.comment)U.comment+=`
93
+ `+O.comment;else U.comment=O.comment;G=O.end;continue}if(!Q&&z.options.strict&&cH.containsNewline(P))Z(P,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(V===0){if(O.comma)Z(O.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${J}`)}else{if(!O.comma)Z(O.start,"MISSING_CHAR",`Missing , between ${J} items`);if(O.comment){let j="";$:for(let w of R)switch(w.type){case"comma":case"space":break;case"comment":j=w.source.substring(1);break $;default:break $}if(j){let w=U.items[U.items.length-1];if(mH.isPair(w))w=w.value??w.key;if(w.comment)w.comment+=`
94
+ `+j;else w.comment=j;O.comment=O.comment.substring(j.length+1)}}}if(!Q&&!K&&!O.found){let j=F?$(z,F,O,Z):q(z,O.end,K,null,O,Z);if(U.items.push(j),G=j.range[2],T1(F))Z(j.range,"BLOCK_IN_FLOW",B1)}else{z.atKey=!0;let j=O.end,w=P?$(z,P,O,Z):q(z,j,R,null,O,Z);if(T1(P))Z(w.range,"BLOCK_IN_FLOW",B1);z.atKey=!1;let C=m9.resolveProps(K??[],{flow:J,indicator:"map-value-ind",next:F,offset:w.range[2],onError:Z,parentIndent:X.indent,startOnNewline:!1});if(C.found){if(!Q&&!O.found&&z.options.strict){if(K)for(let y of K){if(y===C.found)break;if(y.type==="newline"){Z(y,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(O.start<C.found.offset-1024)Z(C.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(F)if("source"in F&&F.source?.[0]===":")Z(F,"MISSING_CHAR",`Missing space after : in ${J}`);else Z(C.start,"MISSING_CHAR",`Missing , or : between ${J} items`);let r=F?$(z,F,C,Z):C.found?q(z,C.end,K,null,C,Z):null;if(r){if(T1(F))Z(r.range,"BLOCK_IN_FLOW",B1)}else if(C.comment)if(w.comment)w.comment+=`
95
+ `+C.comment;else w.comment=C.comment;let T0=new dH.Pair(w,r);if(z.options.keepSourceTokens)T0.srcToken=I;if(Q){let y=U;if(iH.mapIncludes(z,y.items,w))Z(j,"DUPLICATE_KEY","Map keys must be unique");y.items.push(T0)}else{let y=new u9.YAMLMap(z.schema);y.flow=!0,y.items.push(T0);let s1=(r??w).range;y.range=[w.range[0],s1[1],s1[2]],U.items.push(y)}G=r?r.range[2]:C.end}}let T=Q?"}":"]",[L,..._]=X.end,W=G;if(L?.source===T)W=L.offset+L.source.length;else{let V=J[0].toUpperCase()+J.substring(1),I=B?`${V} must end with a ${T}`:`${V} in block collection must be sufficiently indented and end with a ${T}`;if(Z(G,B?"MISSING_CHAR":"BAD_INDENT",I),L&&L.source.length!==1)_.unshift(L)}if(_.length>0){let V=lH.resolveEnd(_,W,z.options.strict,Z);if(V.comment)if(U.comment)U.comment+=`
96
+ `+V.comment;else U.comment=V.comment;U.range=[X.offset,W,V.offset]}else U.range=[X.offset,W,W];return U}sH.resolveFlowCollection=aH});var p9=D((Z3)=>{var nH=A(),oH=b(),tH=q0(),eH=z0(),$3=g9(),q3=v9(),z3=d9();function W1($,q,z,X,Z,H){let Q=z.type==="block-map"?$3.resolveBlockMap($,q,z,X,H):z.type==="block-seq"?q3.resolveBlockSeq($,q,z,X,H):z3.resolveFlowCollection($,q,z,X,H),J=Q.constructor;if(Z==="!"||Z===J.tagName)return Q.tag=J.tagName,Q;if(Z)Q.tag=Z;return Q}function X3($,q,z,X,Z){let H=X.tag,Q=!H?null:q.directives.tagName(H.source,(T)=>Z(H,"TAG_RESOLVE_FAILED",T));if(z.type==="block-seq"){let{anchor:T,newlineAfterProp:L}=X,_=T&&H?T.offset>H.offset?T:H:T??H;if(_&&(!L||L.offset<_.offset))Z(_,"MISSING_CHAR","Missing newline after block sequence props")}let J=z.type==="block-map"?"map":z.type==="block-seq"?"seq":z.start.source==="{"?"map":"seq";if(!H||!Q||Q==="!"||Q===tH.YAMLMap.tagName&&J==="map"||Q===eH.YAMLSeq.tagName&&J==="seq")return W1($,q,z,Z,Q);let Y=q.schema.tags.find((T)=>T.tag===Q&&T.collection===J);if(!Y){let T=q.schema.knownTags[Q];if(T?.collection===J)q.schema.tags.push(Object.assign({},T,{default:!1})),Y=T;else{if(T)Z(H,"BAD_COLLECTION_TYPE",`${T.tag} used for ${J} collection, but expects ${T.collection??"scalar"}`,!0);else Z(H,"TAG_RESOLVE_FAILED",`Unresolved tag: ${Q}`,!0);return W1($,q,z,Z,Q)}}let U=W1($,q,z,Z,Q,Y),B=Y.resolve?.(U,(T)=>Z(H,"TAG_RESOLVE_FAILED",T),q.options)??U,G=nH.isNode(B)?B:new oH.Scalar(B);if(G.range=U.range,G.tag=Q,Y?.format)G.format=Y.format;return G}Z3.composeCollection=X3});var V1=D((G3)=>{var L1=b();function Q3($,q,z){let X=q.offset,Z=J3(q,$.options.strict,z);if(!Z)return{value:"",type:null,comment:"",range:[X,X,X]};let H=Z.mode===">"?L1.Scalar.BLOCK_FOLDED:L1.Scalar.BLOCK_LITERAL,Q=q.source?U3(q.source):[],J=Q.length;for(let W=Q.length-1;W>=0;--W){let V=Q[W][1];if(V===""||V==="\r")J=W;else break}if(J===0){let W=Z.chomp==="+"&&Q.length>0?`
97
+ `.repeat(Math.max(1,Q.length-1)):"",V=X+Z.length;if(q.source)V+=q.source.length;return{value:W,type:H,comment:Z.comment,range:[X,V,V]}}let Y=q.indent+Z.indent,U=q.offset+Z.length,B=0;for(let W=0;W<J;++W){let[V,I]=Q[W];if(I===""||I==="\r"){if(Z.indent===0&&V.length>Y)Y=V.length}else{if(V.length<Y)z(U+V.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(Z.indent===0)Y=V.length;if(B=W,Y===0&&!$.atRoot)z(U,"BAD_INDENT","Block scalar values in collections must be indented");break}U+=V.length+I.length+1}for(let W=Q.length-1;W>=J;--W)if(Q[W][0].length>Y)J=W+1;let G="",T="",L=!1;for(let W=0;W<B;++W)G+=Q[W][0].slice(Y)+`
98
+ `;for(let W=B;W<J;++W){let[V,I]=Q[W];U+=V.length+I.length+1;let R=I[I.length-1]==="\r";if(R)I=I.slice(0,-1);if(I&&V.length<Y){let K=`Block scalar lines must not be less indented than their ${Z.indent?"explicit indentation indicator":"first line"}`;z(U-I.length-(R?2:1),"BAD_INDENT",K),V=""}if(H===L1.Scalar.BLOCK_LITERAL)G+=T+V.slice(Y)+I,T=`
99
+ `;else if(V.length>Y||I[0]==="\t"){if(T===" ")T=`
100
+ `;else if(!L&&T===`
101
+ `)T=`
102
+
103
+ `;G+=T+V.slice(Y)+I,T=`
104
+ `,L=!0}else if(I==="")if(T===`
105
+ `)G+=`
106
+ `;else T=`
107
+ `;else G+=T+I,T=" ",L=!1}switch(Z.chomp){case"-":break;case"+":for(let W=J;W<Q.length;++W)G+=`
108
+ `+Q[W][0].slice(Y);if(G[G.length-1]!==`
109
+ `)G+=`
110
+ `;break;default:G+=`
111
+ `}let _=X+Z.length+q.source.length;return{value:G,type:H,comment:Z.comment,range:[X,_,_]}}function J3({offset:$,props:q},z,X){if(q[0].type!=="block-scalar-header")return X(q[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:Z}=q[0],H=Z[0],Q=0,J="",Y=-1;for(let T=1;T<Z.length;++T){let L=Z[T];if(!J&&(L==="-"||L==="+"))J=L;else{let _=Number(L);if(!Q&&_)Q=_;else if(Y===-1)Y=$+T}}if(Y!==-1)X(Y,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${Z}`);let U=!1,B="",G=Z.length;for(let T=1;T<q.length;++T){let L=q[T];switch(L.type){case"space":U=!0;case"newline":G+=L.source.length;break;case"comment":if(z&&!U)X(L,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");G+=L.source.length,B=L.source.substring(1);break;case"error":X(L,"UNEXPECTED_TOKEN",L.message),G+=L.source.length;break;default:{let _=`Unexpected token in block scalar header: ${L.type}`;X(L,"UNEXPECTED_TOKEN",_);let W=L.source;if(W&&typeof W==="string")G+=W.length}}}return{mode:H,indent:Q,chomp:J,comment:B,length:G}}function U3($){let q=$.split(/\n( *)/),z=q[0],X=z.match(/^( *)/),H=[X?.[1]?[X[1],z.slice(X[1].length)]:["",z]];for(let Q=1;Q<q.length;Q+=2)H.push([q[Q],q[Q+1]]);return H}G3.resolveBlockScalar=Q3});var D1=D((R3)=>{var _1=b(),B3=K0();function T3($,q,z){let{offset:X,type:Z,source:H,end:Q}=$,J,Y,U=(T,L,_)=>z(X+T,L,_);switch(Z){case"scalar":J=_1.Scalar.PLAIN,Y=W3(H,U);break;case"single-quoted-scalar":J=_1.Scalar.QUOTE_SINGLE,Y=L3(H,U);break;case"double-quoted-scalar":J=_1.Scalar.QUOTE_DOUBLE,Y=V3(H,U);break;default:return z($,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${Z}`),{value:"",type:null,comment:"",range:[X,X+H.length,X+H.length]}}let B=X+H.length,G=B3.resolveEnd(Q,B,q,z);return{value:Y,type:J,comment:G.comment,range:[X,B,G.offset]}}function W3($,q){let z="";switch($[0]){case"\t":z="a tab character";break;case",":z="flow indicator character ,";break;case"%":z="directive indicator character %";break;case"|":case">":{z=`block scalar indicator ${$[0]}`;break}case"@":case"`":{z=`reserved character ${$[0]}`;break}}if(z)q(0,"BAD_SCALAR_START",`Plain value cannot start with ${z}`);return l9($)}function L3($,q){if($[$.length-1]!=="'"||$.length===1)q($.length,"MISSING_CHAR","Missing closing 'quote");return l9($.slice(1,-1)).replace(/''/g,"'")}function l9($){let q,z;try{q=new RegExp(`(.*?)(?<![ ])[ ]*\r?
112
+ `,"sy"),z=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
113
+ `,"sy")}catch{q=/(.*?)[ \t]*\r?\n/sy,z=/[ \t]*(.*?)[ \t]*\r?\n/sy}let X=q.exec($);if(!X)return $;let Z=X[1],H=" ",Q=q.lastIndex;z.lastIndex=Q;while(X=z.exec($)){if(X[1]==="")if(H===`
114
+ `)Z+=H;else H=`
115
+ `;else Z+=H+X[1],H=" ";Q=z.lastIndex}let J=/[ \t]*(.*)/sy;return J.lastIndex=Q,X=J.exec($),Z+H+(X?.[1]??"")}function V3($,q){let z="";for(let X=1;X<$.length-1;++X){let Z=$[X];if(Z==="\r"&&$[X+1]===`
116
+ `)continue;if(Z===`
117
+ `){let{fold:H,offset:Q}=_3($,X);z+=H,X=Q}else if(Z==="\\"){let H=$[++X],Q=D3[H];if(Q)z+=Q;else if(H===`
118
+ `){H=$[X+1];while(H===" "||H==="\t")H=$[++X+1]}else if(H==="\r"&&$[X+1]===`
119
+ `){H=$[++X+1];while(H===" "||H==="\t")H=$[++X+1]}else if(H==="x"||H==="u"||H==="U"){let J={x:2,u:4,U:8}[H];z+=I3($,X+1,J,q),X+=J}else{let J=$.substr(X-1,2);q(X-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${J}`),z+=J}}else if(Z===" "||Z==="\t"){let H=X,Q=$[X+1];while(Q===" "||Q==="\t")Q=$[++X+1];if(Q!==`
120
+ `&&!(Q==="\r"&&$[X+2]===`
121
+ `))z+=X>H?$.slice(H,X+1):Z}else z+=Z}if($[$.length-1]!=='"'||$.length===1)q($.length,"MISSING_CHAR",'Missing closing "quote');return z}function _3($,q){let z="",X=$[q+1];while(X===" "||X==="\t"||X===`
122
+ `||X==="\r"){if(X==="\r"&&$[q+2]!==`
123
+ `)break;if(X===`
124
+ `)z+=`
125
+ `;q+=1,X=$[q+1]}if(!z)z=" ";return{fold:z,offset:q}}var D3={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
126
+ `,r:"\r",t:"\t",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function I3($,q,z,X){let Z=$.substr(q,z),Q=Z.length===z&&/^[0-9a-fA-F]+$/.test(Z)?parseInt(Z,16):NaN;if(isNaN(Q)){let J=$.substr(q-2,z+2);return X(q-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${J}`),J}return String.fromCodePoint(Q)}R3.resolveFlowScalar=T3});var i9=D((A3)=>{var Y0=A(),c9=b(),M3=V1(),P3=D1();function K3($,q,z,X){let{value:Z,type:H,comment:Q,range:J}=q.type==="block-scalar"?M3.resolveBlockScalar($,q,X):P3.resolveFlowScalar(q,$.options.strict,X),Y=z?$.directives.tagName(z.source,(G)=>X(z,"TAG_RESOLVE_FAILED",G)):null,U;if($.options.stringKeys&&$.atKey)U=$.schema[Y0.SCALAR];else if(Y)U=F3($.schema,Z,Y,z,X);else if(q.type==="scalar")U=O3($,Z,q,X);else U=$.schema[Y0.SCALAR];let B;try{let G=U.resolve(Z,(T)=>X(z??q,"TAG_RESOLVE_FAILED",T),$.options);B=Y0.isScalar(G)?G:new c9.Scalar(G)}catch(G){let T=G instanceof Error?G.message:String(G);X(z??q,"TAG_RESOLVE_FAILED",T),B=new c9.Scalar(Z)}if(B.range=J,B.source=Z,H)B.type=H;if(Y)B.tag=Y;if(U.format)B.format=U.format;if(Q)B.comment=Q;return B}function F3($,q,z,X,Z){if(z==="!")return $[Y0.SCALAR];let H=[];for(let J of $.tags)if(!J.collection&&J.tag===z)if(J.default&&J.test)H.push(J);else return J;for(let J of H)if(J.test?.test(q))return J;let Q=$.knownTags[z];if(Q&&!Q.collection)return $.tags.push(Object.assign({},Q,{default:!1,test:void 0})),Q;return Z(X,"TAG_RESOLVE_FAILED",`Unresolved tag: ${z}`,z!=="tag:yaml.org,2002:str"),$[Y0.SCALAR]}function O3({atKey:$,directives:q,schema:z},X,Z,H){let Q=z.tags.find((J)=>(J.default===!0||$&&J.default==="key")&&J.test?.test(X))||z[Y0.SCALAR];if(z.compat){let J=z.compat.find((Y)=>Y.default&&Y.test?.test(X))??z[Y0.SCALAR];if(Q.tag!==J.tag){let Y=q.tagString(Q.tag),U=q.tagString(J.tag),B=`Value may be parsed as either ${Y} or ${U}`;H(Z,"TAG_RESOLVE_FAILED",B,!0)}}return Q}A3.composeScalar=K3});var a9=D((N3)=>{function j3($,q,z){if(q){z??(z=q.length);for(let X=z-1;X>=0;--X){let Z=q[X];switch(Z.type){case"space":case"comment":case"newline":$-=Z.source.length;continue}Z=q[++X];while(Z?.type==="space")$+=Z.source.length,Z=q[++X];break}}return $}N3.emptyScalarPosition=j3});var n9=D((g3)=>{var b3=k0(),C3=A(),y3=p9(),s9=i9(),f3=K0(),k3=a9(),x3={composeNode:r9,composeEmptyNode:I1};function r9($,q,z,X){let Z=$.atKey,{spaceBefore:H,comment:Q,anchor:J,tag:Y}=z,U,B=!0;switch(q.type){case"alias":if(U=h3($,q,X),J||Y)X(q,"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(U=s9.composeScalar($,q,Y,X),J)U.anchor=J.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":if(U=y3.composeCollection(x3,$,q,z,X),J)U.anchor=J.source.substring(1);break;default:{let G=q.type==="error"?q.message:`Unsupported token (type: ${q.type})`;X(q,"UNEXPECTED_TOKEN",G),U=I1($,q.offset,void 0,null,z,X),B=!1}}if(J&&U.anchor==="")X(J,"BAD_ALIAS","Anchor cannot be an empty string");if(Z&&$.options.stringKeys&&(!C3.isScalar(U)||typeof U.value!=="string"||U.tag&&U.tag!=="tag:yaml.org,2002:str"))X(Y??q,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(H)U.spaceBefore=!0;if(Q)if(q.type==="scalar"&&q.source==="")U.comment=Q;else U.commentBefore=Q;if($.options.keepSourceTokens&&B)U.srcToken=q;return U}function I1($,q,z,X,{spaceBefore:Z,comment:H,anchor:Q,tag:J,end:Y},U){let B={type:"scalar",offset:k3.emptyScalarPosition(q,z,X),indent:-1,source:""},G=s9.composeScalar($,B,J,U);if(Q){if(G.anchor=Q.source.substring(1),G.anchor==="")U(Q,"BAD_ALIAS","Anchor cannot be an empty string")}if(Z)G.spaceBefore=!0;if(H)G.comment=H,G.range[2]=Y;return G}function h3({options:$},{offset:q,source:z,end:X},Z){let H=new b3.Alias(z.substring(1));if(H.source==="")Z(q,"BAD_ALIAS","Alias cannot be an empty string");if(H.source.endsWith(":"))Z(q+z.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let Q=q+z.length,J=f3.resolveEnd(X,Q,$.strict,Z);if(H.range=[q,Q,J.offset],J.comment)H.comment=J.comment;return H}g3.composeEmptyNode=I1;g3.composeNode=r9});var t9=D((c3)=>{var m3=n0(),o9=n9(),d3=K0(),p3=t0();function l3($,q,{offset:z,start:X,value:Z,end:H},Q){let J=Object.assign({_directives:q},$),Y=new m3.Document(void 0,J),U={atKey:!1,atRoot:!0,directives:Y.directives,options:Y.options,schema:Y.schema},B=p3.resolveProps(X,{indicator:"doc-start",next:Z??H?.[0],offset:z,onError:Q,parentIndent:0,startOnNewline:!0});if(B.found){if(Y.directives.docStart=!0,Z&&(Z.type==="block-map"||Z.type==="block-seq")&&!B.hasNewline)Q(B.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}Y.contents=Z?o9.composeNode(U,Z,B,Q):o9.composeEmptyNode(U,B.end,X,null,B,Q);let G=Y.contents.range[2],T=d3.resolveEnd(H,G,!1,Q);if(T.comment)Y.comment=T.comment;return Y.range=[z,G,T.offset],Y}c3.composeDoc=l3});var R1=D((t3)=>{var a3=c("process"),s3=Kq(),r3=n0(),e0=o0(),e9=A(),n3=t9(),o3=K0();function $$($){if(typeof $==="number")return[$,$+1];if(Array.isArray($))return $.length===2?$:[$[0],$[1]];let{offset:q,source:z}=$;return[q,q+(typeof z==="string"?z.length:1)]}function $4($){let q="",z=!1,X=!1;for(let Z=0;Z<$.length;++Z){let H=$[Z];switch(H[0]){case"#":q+=(q===""?"":X?`
127
127
 
128
128
  `:`
129
- `)+(z.substring(1)||" "),X=!0,Z=!1;break;case"%":if(q[H+1]?.[0]!=="#")H+=1;X=!1;break;default:if(!X)Z=!0;X=!1}}return{comment:$,afterEmptyLine:Z}}class q4{constructor(q={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=($,X,Z,H)=>{let z=t0($);if(H)this.warnings.push(new o0.YAMLWarning(z,X,Z));else this.errors.push(new o0.YAMLParseError(z,X,Z))},this.directives=new iU.Directives({version:q.version||"1.2"}),this.options=q}decorate(q,$){let{comment:X,afterEmptyLine:Z}=e9(this.prelude);if(X){let H=q.contents;if($)q.comment=q.comment?`${q.comment}
130
- ${X}`:X;else if(Z||q.directives.docStart||!H)q.commentBefore=X;else if(t9.isCollection(H)&&!H.flow&&H.items.length>0){let z=H.items[0];if(t9.isPair(z))z=z.key;let U=z.commentBefore;z.commentBefore=U?`${X}
131
- ${U}`:X}else{let z=H.commentBefore;H.commentBefore=z?`${X}
132
- ${z}`:X}}if($)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:e9(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(q,$=!1,X=-1){for(let Z of q)yield*this.next(Z);yield*this.end($,X)}*next(q){if(cU.env.LOG_STREAM)console.dir(q,{depth:null});switch(q.type){case"directive":this.directives.add(q.source,($,X,Z)=>{let H=t0(q);H[0]+=$,this.onError(H,"BAD_DIRECTIVE",X,Z)}),this.prelude.push(q.source),this.atDirectives=!0;break;case"document":{let $=sU.composeDoc(this.options,this.directives,q,this.onError);if(this.atDirectives&&!$.directives.docStart)this.onError(q,"MISSING_CHAR","Missing directives-end/doc-start indicator line");if(this.decorate($,!1),this.doc)yield this.doc;this.doc=$,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(q.source);break;case"error":{let $=q.source?`${q.message}: ${JSON.stringify(q.source)}`:q.message,X=new o0.YAMLParseError(t0(q),"UNEXPECTED_TOKEN",$);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 o0.YAMLParseError(t0(q),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let $=rU.resolveEnd(q.end,q.offset+q.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),$.comment){let X=this.doc.comment;this.doc.comment=X?`${X}
133
- ${$.comment}`:$.comment}this.doc.range[2]=$.offset;break}default:this.errors.push(new o0.YAMLParseError(t0(q),"UNEXPECTED_TOKEN",`Unsupported token ${q.type}`))}}*end(q=!1,$=-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),Z=new aU.Document(void 0,X);if(this.atDirectives)this.onError($,"MISSING_CHAR","Missing directives-end indicator line");Z.range=[0,$,$],this.decorate(Z,!1),yield Z}}}nU.Composer=q4});var Z4=I((z3)=>{var tU=_1(),eU=V1(),q3=r0(),$4=h0();function $3(q,$=!0,X){if(q){let Z=(H,z,U)=>{let Q=typeof H==="number"?H:Array.isArray(H)?H[0]:H.offset;if(X)X(Q,z,U);else throw new q3.YAMLParseError([Q,Q+1],z,U)};switch(q.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return eU.resolveFlowScalar(q,$,Z);case"block-scalar":return tU.resolveBlockScalar({options:{strict:$}},q,Z)}}return null}function X3(q,$){let{implicitKey:X=!1,indent:Z,inFlow:H=!1,offset:z=-1,type:U="PLAIN"}=$,Q=$4.stringifyString({type:U,value:q},{implicitKey:X,indent:Z>0?" ".repeat(Z):"",inFlow:H,options:{blockQuote:!0,lineWidth:-1}}),J=$.end??[{type:"newline",offset:-1,indent:Z,source:`
134
- `}];switch(Q[0]){case"|":case">":{let G=Q.indexOf(`
135
- `),Y=Q.substring(0,G),T=Q.substring(G+1)+`
136
- `,L=[{type:"block-scalar-header",offset:z,indent:Z,source:Y}];if(!X4(L,J))L.push({type:"newline",offset:-1,indent:Z,source:`
137
- `});return{type:"block-scalar",offset:z,indent:Z,props:L,source:T}}case'"':return{type:"double-quoted-scalar",offset:z,indent:Z,source:Q,end:J};case"'":return{type:"single-quoted-scalar",offset:z,indent:Z,source:Q,end:J};default:return{type:"scalar",offset:z,indent:Z,source:Q,end:J}}}function Z3(q,$,X={}){let{afterKey:Z=!1,implicitKey:H=!1,inFlow:z=!1,type:U}=X,Q="indent"in q?q.indent:null;if(Z&&typeof Q==="number")Q+=2;if(!U)switch(q.type){case"single-quoted-scalar":U="QUOTE_SINGLE";break;case"double-quoted-scalar":U="QUOTE_DOUBLE";break;case"block-scalar":{let G=q.props[0];if(G.type!=="block-scalar-header")throw Error("Invalid block scalar header");U=G.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:U="PLAIN"}let J=$4.stringifyString({type:U,value:$},{implicitKey:H||Q===null,indent:Q!==null&&Q>0?" ".repeat(Q):"",inFlow:z,options:{blockQuote:!0,lineWidth:-1}});switch(J[0]){case"|":case">":H3(q,J);break;case'"':R1(q,J,"double-quoted-scalar");break;case"'":R1(q,J,"single-quoted-scalar");break;default:R1(q,J,"scalar")}}function H3(q,$){let X=$.indexOf(`
138
- `),Z=$.substring(0,X),H=$.substring(X+1)+`
139
- `;if(q.type==="block-scalar"){let z=q.props[0];if(z.type!=="block-scalar-header")throw Error("Invalid block scalar header");z.source=Z,q.source=H}else{let{offset:z}=q,U="indent"in q?q.indent:-1,Q=[{type:"block-scalar-header",offset:z,indent:U,source:Z}];if(!X4(Q,"end"in q?q.end:void 0))Q.push({type:"newline",offset:-1,indent:U,source:`
140
- `});for(let J of Object.keys(q))if(J!=="type"&&J!=="offset")delete q[J];Object.assign(q,{type:"block-scalar",indent:U,props:Q,source:H})}}function X4(q,$){if($)for(let X of $)switch(X.type){case"space":case"comment":q.push(X);break;case"newline":return q.push(X),!0}return!1}function R1(q,$,X){switch(q.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":q.type=X,q.source=$;break;case"block-scalar":{let Z=q.props.slice(1),H=$.length;if(q.props[0].type==="block-scalar-header")H-=q.props[0].source.length;for(let z of Z)z.offset+=H;delete q.props,Object.assign(q,{type:X,source:$,end:Z});break}case"block-map":case"block-seq":{let H={type:"newline",offset:q.offset+$.length,indent:q.indent,source:`
141
- `};delete q.items,Object.assign(q,{type:X,source:$,end:[H]});break}default:{let Z="indent"in q?q.indent:-1,H="end"in q&&Array.isArray(q.end)?q.end.filter((z)=>z.type==="space"||z.type==="comment"||z.type==="newline"):[];for(let z of Object.keys(q))if(z!=="type"&&z!=="offset")delete q[z];Object.assign(q,{type:X,indent:Z,source:$,end:H})}}}z3.createScalarToken=X3;z3.resolveAsScalar=$3;z3.setScalarValue=Z3});var H4=I((T3)=>{var J3=(q)=>("type"in q)?dq(q):mq(q);function dq(q){switch(q.type){case"block-scalar":{let $="";for(let X of q.props)$+=dq(X);return $+q.source}case"block-map":case"block-seq":{let $="";for(let X of q.items)$+=mq(X);return $}case"flow-collection":{let $=q.start.source;for(let X of q.items)$+=mq(X);for(let X of q.end)$+=X.source;return $}case"document":{let $=mq(q);if(q.end)for(let X of q.end)$+=X.source;return $}default:{let $=q.source;if("end"in q&&q.end)for(let X of q.end)$+=X.source;return $}}}function mq({start:q,key:$,sep:X,value:Z}){let H="";for(let z of q)H+=z.source;if($)H+=dq($);if(X)for(let z of X)H+=z.source;if(Z)H+=dq(Z);return H}T3.stringify=J3});var Q4=I((B3)=>{var P1=Symbol("break visit"),L3=Symbol("skip children"),z4=Symbol("remove item");function Y0(q,$){if("type"in q&&q.type==="document")q={start:q.start,value:q.value};U4(Object.freeze([]),q,$)}Y0.BREAK=P1;Y0.SKIP=L3;Y0.REMOVE=z4;Y0.itemAtPath=(q,$)=>{let X=q;for(let[Z,H]of $){let z=X?.[Z];if(z&&"items"in z)X=z.items[H];else return}return X};Y0.parentCollection=(q,$)=>{let X=Y0.itemAtPath(q,$.slice(0,-1)),Z=$[$.length-1][0],H=X?.[Z];if(H&&"items"in H)return H;throw Error("Parent collection not found")};function U4(q,$,X){let Z=X($,q);if(typeof Z==="symbol")return Z;for(let H of["key","value"]){let z=$[H];if(z&&"items"in z){for(let U=0;U<z.items.length;++U){let Q=U4(Object.freeze(q.concat([[H,U]])),z.items[U],X);if(typeof Q==="number")U=Q-1;else if(Q===P1)return P1;else if(Q===z4)z.items.splice(U,1),U-=1}if(typeof Z==="function"&&H==="key")Z=Z($,q)}}return typeof Z==="function"?Z($,q):Z}B3.visit=Y0});var pq=I((M3)=>{var M1=Z4(),W3=H4(),V3=Q4(),K1="\uFEFF",w1="\x02",F1="\x18",O1="\x1F",I3=(q)=>!!q&&("items"in q),D3=(q)=>!!q&&(q.type==="scalar"||q.type==="single-quoted-scalar"||q.type==="double-quoted-scalar"||q.type==="block-scalar");function R3(q){switch(q){case K1:return"<BOM>";case w1:return"<DOC>";case F1:return"<FLOW_END>";case O1:return"<SCALAR>";default:return JSON.stringify(q)}}function P3(q){switch(q){case K1:return"byte-order-mark";case w1:return"doc-mode";case F1:return"flow-error-end";case O1:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
129
+ `)+(H.substring(1)||" "),z=!0,X=!1;break;case"%":if($[Z+1]?.[0]!=="#")Z+=1;z=!1;break;default:if(!z)X=!0;z=!1}}return{comment:q,afterEmptyLine:X}}class q4{constructor($={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(q,z,X,Z)=>{let H=$$(q);if(Z)this.warnings.push(new e0.YAMLWarning(H,z,X));else this.errors.push(new e0.YAMLParseError(H,z,X))},this.directives=new s3.Directives({version:$.version||"1.2"}),this.options=$}decorate($,q){let{comment:z,afterEmptyLine:X}=$4(this.prelude);if(z){let Z=$.contents;if(q)$.comment=$.comment?`${$.comment}
130
+ ${z}`:z;else if(X||$.directives.docStart||!Z)$.commentBefore=z;else if(e9.isCollection(Z)&&!Z.flow&&Z.items.length>0){let H=Z.items[0];if(e9.isPair(H))H=H.key;let Q=H.commentBefore;H.commentBefore=Q?`${z}
131
+ ${Q}`:z}else{let H=Z.commentBefore;Z.commentBefore=H?`${z}
132
+ ${H}`:z}}if(q)Array.prototype.push.apply($.errors,this.errors),Array.prototype.push.apply($.warnings,this.warnings);else $.errors=this.errors,$.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:$4(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose($,q=!1,z=-1){for(let X of $)yield*this.next(X);yield*this.end(q,z)}*next($){if(a3.env.LOG_STREAM)console.dir($,{depth:null});switch($.type){case"directive":this.directives.add($.source,(q,z,X)=>{let Z=$$($);Z[0]+=q,this.onError(Z,"BAD_DIRECTIVE",z,X)}),this.prelude.push($.source),this.atDirectives=!0;break;case"document":{let q=n3.composeDoc(this.options,this.directives,$,this.onError);if(this.atDirectives&&!q.directives.docStart)this.onError($,"MISSING_CHAR","Missing directives-end/doc-start indicator line");if(this.decorate(q,!1),this.doc)yield this.doc;this.doc=q,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push($.source);break;case"error":{let q=$.source?`${$.message}: ${JSON.stringify($.source)}`:$.message,z=new e0.YAMLParseError($$($),"UNEXPECTED_TOKEN",q);if(this.atDirectives||!this.doc)this.errors.push(z);else this.doc.errors.push(z);break}case"doc-end":{if(!this.doc){this.errors.push(new e0.YAMLParseError($$($),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let q=o3.resolveEnd($.end,$.offset+$.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),q.comment){let z=this.doc.comment;this.doc.comment=z?`${z}
133
+ ${q.comment}`:q.comment}this.doc.range[2]=q.offset;break}default:this.errors.push(new e0.YAMLParseError($$($),"UNEXPECTED_TOKEN",`Unsupported token ${$.type}`))}}*end($=!1,q=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if($){let z=Object.assign({_directives:this.directives},this.options),X=new r3.Document(void 0,z);if(this.atDirectives)this.onError(q,"MISSING_CHAR","Missing directives-end indicator line");X.range=[0,q,q],this.decorate(X,!1),yield X}}}t3.Composer=q4});var Z4=D((JQ)=>{var $Q=V1(),qQ=D1(),zQ=o0(),z4=v0();function XQ($,q=!0,z){if($){let X=(Z,H,Q)=>{let J=typeof Z==="number"?Z:Array.isArray(Z)?Z[0]:Z.offset;if(z)z(J,H,Q);else throw new zQ.YAMLParseError([J,J+1],H,Q)};switch($.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return qQ.resolveFlowScalar($,q,X);case"block-scalar":return $Q.resolveBlockScalar({options:{strict:q}},$,X)}}return null}function ZQ($,q){let{implicitKey:z=!1,indent:X,inFlow:Z=!1,offset:H=-1,type:Q="PLAIN"}=q,J=z4.stringifyString({type:Q,value:$},{implicitKey:z,indent:X>0?" ".repeat(X):"",inFlow:Z,options:{blockQuote:!0,lineWidth:-1}}),Y=q.end??[{type:"newline",offset:-1,indent:X,source:`
134
+ `}];switch(J[0]){case"|":case">":{let U=J.indexOf(`
135
+ `),B=J.substring(0,U),G=J.substring(U+1)+`
136
+ `,T=[{type:"block-scalar-header",offset:H,indent:X,source:B}];if(!X4(T,Y))T.push({type:"newline",offset:-1,indent:X,source:`
137
+ `});return{type:"block-scalar",offset:H,indent:X,props:T,source:G}}case'"':return{type:"double-quoted-scalar",offset:H,indent:X,source:J,end:Y};case"'":return{type:"single-quoted-scalar",offset:H,indent:X,source:J,end:Y};default:return{type:"scalar",offset:H,indent:X,source:J,end:Y}}}function HQ($,q,z={}){let{afterKey:X=!1,implicitKey:Z=!1,inFlow:H=!1,type:Q}=z,J="indent"in $?$.indent:null;if(X&&typeof J==="number")J+=2;if(!Q)switch($.type){case"single-quoted-scalar":Q="QUOTE_SINGLE";break;case"double-quoted-scalar":Q="QUOTE_DOUBLE";break;case"block-scalar":{let U=$.props[0];if(U.type!=="block-scalar-header")throw Error("Invalid block scalar header");Q=U.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:Q="PLAIN"}let Y=z4.stringifyString({type:Q,value:q},{implicitKey:Z||J===null,indent:J!==null&&J>0?" ".repeat(J):"",inFlow:H,options:{blockQuote:!0,lineWidth:-1}});switch(Y[0]){case"|":case">":QQ($,Y);break;case'"':w1($,Y,"double-quoted-scalar");break;case"'":w1($,Y,"single-quoted-scalar");break;default:w1($,Y,"scalar")}}function QQ($,q){let z=q.indexOf(`
138
+ `),X=q.substring(0,z),Z=q.substring(z+1)+`
139
+ `;if($.type==="block-scalar"){let H=$.props[0];if(H.type!=="block-scalar-header")throw Error("Invalid block scalar header");H.source=X,$.source=Z}else{let{offset:H}=$,Q="indent"in $?$.indent:-1,J=[{type:"block-scalar-header",offset:H,indent:Q,source:X}];if(!X4(J,"end"in $?$.end:void 0))J.push({type:"newline",offset:-1,indent:Q,source:`
140
+ `});for(let Y of Object.keys($))if(Y!=="type"&&Y!=="offset")delete $[Y];Object.assign($,{type:"block-scalar",indent:Q,props:J,source:Z})}}function X4($,q){if(q)for(let z of q)switch(z.type){case"space":case"comment":$.push(z);break;case"newline":return $.push(z),!0}return!1}function w1($,q,z){switch($.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":$.type=z,$.source=q;break;case"block-scalar":{let X=$.props.slice(1),Z=q.length;if($.props[0].type==="block-scalar-header")Z-=$.props[0].source.length;for(let H of X)H.offset+=Z;delete $.props,Object.assign($,{type:z,source:q,end:X});break}case"block-map":case"block-seq":{let Z={type:"newline",offset:$.offset+q.length,indent:$.indent,source:`
141
+ `};delete $.items,Object.assign($,{type:z,source:q,end:[Z]});break}default:{let X="indent"in $?$.indent:-1,Z="end"in $&&Array.isArray($.end)?$.end.filter((H)=>H.type==="space"||H.type==="comment"||H.type==="newline"):[];for(let H of Object.keys($))if(H!=="type"&&H!=="offset")delete $[H];Object.assign($,{type:z,indent:X,source:q,end:Z})}}}JQ.createScalarToken=ZQ;JQ.resolveAsScalar=XQ;JQ.setScalarValue=HQ});var H4=D((TQ)=>{var BQ=($)=>("type"in $)?c$($):l$($);function c$($){switch($.type){case"block-scalar":{let q="";for(let z of $.props)q+=c$(z);return q+$.source}case"block-map":case"block-seq":{let q="";for(let z of $.items)q+=l$(z);return q}case"flow-collection":{let q=$.start.source;for(let z of $.items)q+=l$(z);for(let z of $.end)q+=z.source;return q}case"document":{let q=l$($);if($.end)for(let z of $.end)q+=z.source;return q}default:{let q=$.source;if("end"in $&&$.end)for(let z of $.end)q+=z.source;return q}}}function l$({start:$,key:q,sep:z,value:X}){let Z="";for(let H of $)Z+=H.source;if(q)Z+=c$(q);if(z)for(let H of z)Z+=H.source;if(X)Z+=c$(X);return Z}TQ.stringify=BQ});var U4=D((VQ)=>{var M1=Symbol("break visit"),LQ=Symbol("skip children"),Q4=Symbol("remove item");function B0($,q){if("type"in $&&$.type==="document")$={start:$.start,value:$.value};J4(Object.freeze([]),$,q)}B0.BREAK=M1;B0.SKIP=LQ;B0.REMOVE=Q4;B0.itemAtPath=($,q)=>{let z=$;for(let[X,Z]of q){let H=z?.[X];if(H&&"items"in H)z=H.items[Z];else return}return z};B0.parentCollection=($,q)=>{let z=B0.itemAtPath($,q.slice(0,-1)),X=q[q.length-1][0],Z=z?.[X];if(Z&&"items"in Z)return Z;throw Error("Parent collection not found")};function J4($,q,z){let X=z(q,$);if(typeof X==="symbol")return X;for(let Z of["key","value"]){let H=q[Z];if(H&&"items"in H){for(let Q=0;Q<H.items.length;++Q){let J=J4(Object.freeze($.concat([[Z,Q]])),H.items[Q],z);if(typeof J==="number")Q=J-1;else if(J===M1)return M1;else if(J===Q4)H.items.splice(Q,1),Q-=1}if(typeof X==="function"&&Z==="key")X=X(q,$)}}return typeof X==="function"?X(q,$):X}VQ.visit=B0});var i$=D((KQ)=>{var P1=Z4(),DQ=H4(),IQ=U4(),K1="\uFEFF",F1="\x02",O1="\x18",A1="\x1F",RQ=($)=>!!$&&("items"in $),wQ=($)=>!!$&&($.type==="scalar"||$.type==="single-quoted-scalar"||$.type==="double-quoted-scalar"||$.type==="block-scalar");function MQ($){switch($){case K1:return"<BOM>";case F1:return"<DOC>";case O1:return"<FLOW_END>";case A1:return"<SCALAR>";default:return JSON.stringify($)}}function PQ($){switch($){case K1:return"byte-order-mark";case F1:return"doc-mode";case O1:return"flow-error-end";case A1:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
142
142
  `:case`\r
143
- `: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}M3.createScalarToken=M1.createScalarToken;M3.resolveAsScalar=M1.resolveAsScalar;M3.setScalarValue=M1.setScalarValue;M3.stringify=W3.stringify;M3.visit=V3.visit;M3.BOM=K1;M3.DOCUMENT=w1;M3.FLOW_END=F1;M3.SCALAR=O1;M3.isCollection=I3;M3.isScalar=D3;M3.prettyToken=R3;M3.tokenType=P3});var S1=I((h3)=>{var e0=pq();function v(q){switch(q){case void 0:case" ":case`
144
- `:case"\r":case"\t":return!0;default:return!1}}var G4=new Set("0123456789ABCDEFabcdef"),x3=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),lq=new Set(",[]{}"),k3=new Set(` ,[]{}
145
- \r `),A1=(q)=>!q||k3.has(q);class J4{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,$=!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=!$;let X=this.next??"stream";while(X&&($||this.hasChars(1)))X=yield*this.parseNext(X)}atLineEnd(){let q=this.pos,$=this.buffer[q];while($===" "||$==="\t")$=this.buffer[++q];if(!$||$==="#"||$===`
146
- `)return!0;if($==="\r")return this.buffer[q+1]===`
147
- `;return!1}charAt(q){return this.buffer[this.pos+q]}continueScalar(q){let $=this.buffer[q];if(this.indentNext>0){let X=0;while($===" ")$=this.buffer[++X+q];if($==="\r"){let Z=this.buffer[X+q+1];if(Z===`
148
- `||!Z&&!this.atEnd)return q+X+1}return $===`
149
- `||X>=this.indentNext||!$&&!this.atEnd?q+X:-1}if($==="-"||$==="."){let X=this.buffer.substr(q,3);if((X==="---"||X==="...")&&v(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(`
150
- `,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]===e0.BOM)yield*this.pushCount(1),q=q.substring(1);if(q[0]==="%"){let $=q.length,X=q.indexOf("#");while(X!==-1){let H=q[X-1];if(H===" "||H==="\t"){$=X-1;break}else X=q.indexOf("#",X+1)}while(!0){let H=q[$-1];if(H===" "||H==="\t")$-=1;else break}let Z=(yield*this.pushCount($))+(yield*this.pushSpaces(!0));return yield*this.pushCount(q.length-Z),this.pushNewline(),"stream"}if(this.atLineEnd()){let $=yield*this.pushSpaces(!0);return yield*this.pushCount(q.length-$),yield*this.pushNewline(),"stream"}return yield e0.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 $=this.peek(3);if(($==="---"||$==="...")&&v(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,$==="---"?"doc":"stream"}if(this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!v(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){let[q,$]=this.peek(2);if(!$&&!this.atEnd)return this.setNext("block-start");if((q==="-"||q==="?"||q===":")&&v($)){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 $=yield*this.pushIndicators();switch(q[$]){case"#":yield*this.pushCount(q.length-$);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(A1),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return $+=yield*this.parseBlockScalarHeader(),$+=yield*this.pushSpaces(!0),yield*this.pushCount(q.length-$),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let q,$,X=-1;do{if(q=yield*this.pushNewline(),q>0)$=yield*this.pushSpaces(!1),this.indentValue=X=$;else $=0;$+=yield*this.pushSpaces(!0)}while(q+$>0);let Z=this.getLine();if(Z===null)return this.setNext("flow");if(X!==-1&&X<this.indentNext&&Z[0]!=="#"||X===0&&(Z.startsWith("---")||Z.startsWith("..."))&&v(Z[3])){if(!(X===this.indentNext-1&&this.flowLevel===1&&(Z[0]==="]"||Z[0]==="}")))return this.flowLevel=0,yield e0.FLOW_END,yield*this.parseLineStart()}let H=0;while(Z[H]===",")H+=yield*this.pushCount(1),H+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(H+=yield*this.pushIndicators(),Z[H]){case void 0:return"flow";case"#":return yield*this.pushCount(Z.length-H),"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(A1),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let z=this.charAt(1);if(this.flowKey||v(z)||z===",")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),$=this.buffer.indexOf(q,this.pos+1);if(q==="'")while($!==-1&&this.buffer[$+1]==="'")$=this.buffer.indexOf("'",$+2);else while($!==-1){let H=0;while(this.buffer[$-1-H]==="\\")H+=1;if(H%2===0)break;$=this.buffer.indexOf('"',$+1)}let X=this.buffer.substring(0,$),Z=X.indexOf(`
151
- `,this.pos);if(Z!==-1){while(Z!==-1){let H=this.continueScalar(Z+1);if(H===-1)break;Z=X.indexOf(`
152
- `,H)}if(Z!==-1)$=Z-(X[Z-1]==="\r"?2:1)}if($===-1){if(!this.atEnd)return this.setNext("quoted-scalar");$=this.buffer.length}return yield*this.pushToIndex($+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let q=this.pos;while(!0){let $=this.buffer[++q];if($==="+")this.blockScalarKeep=!0;else if($>"0"&&$<="9")this.blockScalarIndent=Number($)-1;else if($!=="-")break}return yield*this.pushUntil(($)=>v($)||$==="#")}*parseBlockScalar(){let q=this.pos-1,$=0,X;q:for(let H=this.pos;X=this.buffer[H];++H)switch(X){case" ":$+=1;break;case`
153
- `:q=H,$=0;break;case"\r":{let z=this.buffer[H+1];if(!z&&!this.atEnd)return this.setNext("block-scalar");if(z===`
154
- `)break}default:break q}if(!X&&!this.atEnd)return this.setNext("block-scalar");if($>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=$;else this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let H=this.continueScalar(q+1);if(H===-1)break;q=this.buffer.indexOf(`
155
- `,H)}while(q!==-1);if(q===-1){if(!this.atEnd)return this.setNext("block-scalar");q=this.buffer.length}}let Z=q+1;X=this.buffer[Z];while(X===" ")X=this.buffer[++Z];if(X==="\t"){while(X==="\t"||X===" "||X==="\r"||X===`
156
- `)X=this.buffer[++Z];q=Z-1}else if(!this.blockScalarKeep)do{let H=q-1,z=this.buffer[H];if(z==="\r")z=this.buffer[--H];let U=H;while(z===" ")z=this.buffer[--H];if(z===`
157
- `&&H>=this.pos&&H+1+$>U)q=H;else break}while(!0);return yield e0.SCALAR,yield*this.pushToIndex(q+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let q=this.flowLevel>0,$=this.pos-1,X=this.pos-1,Z;while(Z=this.buffer[++X])if(Z===":"){let H=this.buffer[X+1];if(v(H)||q&&lq.has(H))break;$=X}else if(v(Z)){let H=this.buffer[X+1];if(Z==="\r")if(H===`
158
- `)X+=1,Z=`
159
- `,H=this.buffer[X+1];else $=X;if(H==="#"||q&&lq.has(H))break;if(Z===`
160
- `){let z=this.continueScalar(X+1);if(z===-1)break;X=Math.max(X,z-2)}}else{if(q&&lq.has(Z))break;$=X}if(!Z&&!this.atEnd)return this.setNext("plain-scalar");return yield e0.SCALAR,yield*this.pushToIndex($+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,$){let X=this.buffer.slice(this.pos,q);if(X)return yield X,this.pos+=X.length,X.length;else if($)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(A1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let q=this.flowLevel>0,$=this.charAt(1);if(v($)||q&&lq.has($)){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,$=this.buffer[q];while(!v($)&&$!==">")$=this.buffer[++q];return yield*this.pushToIndex($===">"?q+1:q,!1)}else{let q=this.pos+1,$=this.buffer[q];while($)if(x3.has($))$=this.buffer[++q];else if($==="%"&&G4.has(this.buffer[q+1])&&G4.has(this.buffer[q+2]))$=this.buffer[q+=3];else break;return yield*this.pushToIndex(q,!1)}}*pushNewline(){let q=this.buffer[this.pos];if(q===`
161
- `)return yield*this.pushCount(1);else if(q==="\r"&&this.charAt(1)===`
162
- `)return yield*this.pushCount(2);else return 0}*pushSpaces(q){let $=this.pos-1,X;do X=this.buffer[++$];while(X===" "||q&&X==="\t");let Z=$-this.pos;if(Z>0)yield this.buffer.substr(this.pos,Z),this.pos=$;return Z}*pushUntil(q){let $=this.pos,X=this.buffer[$];while(!q(X))X=this.buffer[++$];return yield*this.pushToIndex($,!1)}}h3.Lexer=J4});var j1=I((u3)=>{class T4{constructor(){this.lineStarts=[],this.addNewLine=(q)=>this.lineStarts.push(q),this.linePos=(q)=>{let $=0,X=this.lineStarts.length;while($<X){let H=$+X>>1;if(this.lineStarts[H]<q)$=H+1;else X=H}if(this.lineStarts[$]===q)return{line:$+1,col:1};if($===0)return{line:0,col:q};let Z=this.lineStarts[$-1];return{line:$,col:q-Z+1}}}}u3.LineCounter=T4});var N1=I((p3)=>{var m3=c("process"),Y4=pq(),d3=S1();function Z0(q,$){for(let X=0;X<q.length;++X)if(q[X].type===$)return!0;return!1}function L4(q){for(let $=0;$<q.length;++$)switch(q[$].type){case"space":case"comment":case"newline":break;default:return $}return-1}function _4(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 cq(q){switch(q.type){case"document":return q.start;case"block-map":{let $=q.items[q.items.length-1];return $.sep??$.start}case"block-seq":return q.items[q.items.length-1].start;default:return[]}}function F0(q){if(q.length===0)return[];let $=q.length;q:while(--$>=0)switch(q[$].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break q}while(q[++$]?.type==="space");return q.splice($,q.length)}function B4(q){if(q.start.type==="flow-seq-start"){for(let $ of q.items)if($.sep&&!$.value&&!Z0($.start,"explicit-key-ind")&&!Z0($.sep,"map-value-ind")){if($.key)$.value=$.key;if(delete $.key,_4($.value))if($.value.end)Array.prototype.push.apply($.value.end,$.sep);else $.value.end=$.sep;else Array.prototype.push.apply($.start,$.sep);delete $.sep}}}class W4{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 d3.Lexer,this.onNewLine=q}*parse(q,$=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let X of this.lexer.lex(q,$))yield*this.next(X);if(!$)yield*this.end()}*next(q){if(this.source=q,m3.env.LOG_TOKENS)console.log("|",Y4.prettyToken(q));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=q.length;return}let $=Y4.tokenType(q);if(!$){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($==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=$,yield*this.step(),$){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 $=q??this.stack.pop();if(!$)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield $;else{let X=this.peek(1);if($.type==="block-scalar")$.indent="indent"in X?X.indent:0;else if($.type==="flow-collection"&&X.type==="document")$.indent=0;if($.type==="flow-collection")B4($);switch(X.type){case"document":X.value=$;break;case"block-scalar":X.props.push($);break;case"block-map":{let Z=X.items[X.items.length-1];if(Z.value){X.items.push({start:[],key:$,sep:[]}),this.onKeyLine=!0;return}else if(Z.sep)Z.value=$;else{Object.assign(Z,{key:$,sep:[]}),this.onKeyLine=!Z.explicitKey;return}break}case"block-seq":{let Z=X.items[X.items.length-1];if(Z.value)X.items.push({start:[],value:$});else Z.value=$;break}case"flow-collection":{let Z=X.items[X.items.length-1];if(!Z||Z.value)X.items.push({start:[],key:$,sep:[]});else if(Z.sep)Z.value=$;else Object.assign(Z,{key:$,sep:[]});return}default:yield*this.pop(),yield*this.pop($)}if((X.type==="document"||X.type==="block-map"||X.type==="block-seq")&&($.type==="block-map"||$.type==="block-seq")){let Z=$.items[$.items.length-1];if(Z&&!Z.sep&&!Z.value&&Z.start.length>0&&L4(Z.start)===-1&&($.indent===0||Z.start.every((H)=>H.type!=="comment"||H.indent<$.indent))){if(X.type==="document")X.end=Z.start;else X.items.push({start:Z.start});$.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(L4(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 $=this.startBlockValue(q);if($)this.stack.push($);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 $=cq(this.peek(2)),X=F0($),Z;if(q.end)Z=q.end,Z.push(this.sourceToken),delete q.end;else Z=[this.sourceToken];let H={type:"block-map",offset:q.offset,indent:q.indent,items:[{start:X,key:q,sep:Z}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=H}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 $=this.source.indexOf(`
163
- `)+1;while($!==0)this.onNewLine(this.offset+$),$=this.source.indexOf(`
164
- `,$)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(q){let $=q.items[q.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,$.value){let X="end"in $.value?$.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($.sep)$.sep.push(this.sourceToken);else $.start.push(this.sourceToken);return;case"space":case"comment":if($.value)q.items.push({start:[this.sourceToken]});else if($.sep)$.sep.push(this.sourceToken);else{if(this.atIndentedComment($.start,q.indent)){let Z=q.items[q.items.length-2]?.value?.end;if(Array.isArray(Z)){Array.prototype.push.apply(Z,$.start),Z.push(this.sourceToken),q.items.pop();return}}$.start.push(this.sourceToken)}return}if(this.indent>=q.indent){let X=!this.onKeyLine&&this.indent===q.indent,Z=X&&($.sep||$.explicitKey)&&this.type!=="seq-item-ind",H=[];if(Z&&$.sep&&!$.value){let z=[];for(let U=0;U<$.sep.length;++U){let Q=$.sep[U];switch(Q.type){case"newline":z.push(U);break;case"space":break;case"comment":if(Q.indent>q.indent)z.length=0;break;default:z.length=0}}if(z.length>=2)H=$.sep.splice(z[1])}switch(this.type){case"anchor":case"tag":if(Z||$.value)H.push(this.sourceToken),q.items.push({start:H}),this.onKeyLine=!0;else if($.sep)$.sep.push(this.sourceToken);else $.start.push(this.sourceToken);return;case"explicit-key-ind":if(!$.sep&&!$.explicitKey)$.start.push(this.sourceToken),$.explicitKey=!0;else if(Z||$.value)H.push(this.sourceToken),q.items.push({start:H,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($.explicitKey)if(!$.sep)if(Z0($.start,"newline"))Object.assign($,{key:null,sep:[this.sourceToken]});else{let z=F0($.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:z,key:null,sep:[this.sourceToken]}]})}else if($.value)q.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Z0($.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:H,key:null,sep:[this.sourceToken]}]});else if(_4($.key)&&!Z0($.sep,"newline")){let z=F0($.start),U=$.key,Q=$.sep;Q.push(this.sourceToken),delete $.key,delete $.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:z,key:U,sep:Q}]})}else if(H.length>0)$.sep=$.sep.concat(H,this.sourceToken);else $.sep.push(this.sourceToken);else if(!$.sep)Object.assign($,{key:null,sep:[this.sourceToken]});else if($.value||Z)q.items.push({start:H,key:null,sep:[this.sourceToken]});else if(Z0($.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else $.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let z=this.flowScalar(this.type);if(Z||$.value)q.items.push({start:H,key:z,sep:[]}),this.onKeyLine=!0;else if($.sep)this.stack.push(z);else Object.assign($,{key:z,sep:[]}),this.onKeyLine=!0;return}default:{let z=this.startBlockValue(q);if(z){if(z.type==="block-seq"){if(!$.explicitKey&&$.sep&&!Z0($.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:H});this.stack.push(z);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(q){let $=q.items[q.items.length-1];switch(this.type){case"newline":if($.value){let X="end"in $.value?$.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 $.start.push(this.sourceToken);return;case"space":case"comment":if($.value)q.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment($.start,q.indent)){let Z=q.items[q.items.length-2]?.value?.end;if(Array.isArray(Z)){Array.prototype.push.apply(Z,$.start),Z.push(this.sourceToken),q.items.pop();return}}$.start.push(this.sourceToken)}return;case"anchor":case"tag":if($.value||this.indent<=q.indent)break;$.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==q.indent)break;if($.value||Z0($.start,"seq-item-ind"))q.items.push({start:[this.sourceToken]});else $.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 $=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(!$||$.sep)q.items.push({start:[this.sourceToken]});else $.start.push(this.sourceToken);return;case"map-value-ind":if(!$||$.value)q.items.push({start:[],key:null,sep:[this.sourceToken]});else if($.sep)$.sep.push(this.sourceToken);else Object.assign($,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!$||$.value)q.items.push({start:[this.sourceToken]});else if($.sep)$.sep.push(this.sourceToken);else $.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let Z=this.flowScalar(this.type);if(!$||$.value)q.items.push({start:[],key:Z,sep:[]});else if($.sep)this.stack.push(Z);else Object.assign($,{key:Z,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 Z=cq(X),H=F0(Z);B4(q);let z=q.end.splice(1,q.end.length);z.push(this.sourceToken);let U={type:"block-map",offset:q.offset,indent:q.indent,items:[{start:H,key:q,sep:z}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=U}else yield*this.lineEnd(q)}}flowScalar(q){if(this.onNewLine){let $=this.source.indexOf(`
165
- `)+1;while($!==0)this.onNewLine(this.offset+$),$=this.source.indexOf(`
166
- `,$)+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 $=cq(q),X=F0($);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 $=cq(q),X=F0($);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:X,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(q,$){if(this.type!=="comment")return!1;if(this.indent<=$)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()}}}p3.Parser=W4});var P4=I((t3)=>{var V4=D1(),c3=s0(),qq=r0(),i3=j$(),a3=A(),s3=j1(),I4=N1();function D4(q){let $=q.prettyErrors!==!1;return{lineCounter:q.lineCounter||$&&new s3.LineCounter||null,prettyErrors:$}}function r3(q,$={}){let{lineCounter:X,prettyErrors:Z}=D4($),H=new I4.Parser(X?.addNewLine),z=new V4.Composer($),U=Array.from(z.compose(H.parse(q)));if(Z&&X)for(let Q of U)Q.errors.forEach(qq.prettifyError(q,X)),Q.warnings.forEach(qq.prettifyError(q,X));if(U.length>0)return U;return Object.assign([],{empty:!0},z.streamInfo())}function R4(q,$={}){let{lineCounter:X,prettyErrors:Z}=D4($),H=new I4.Parser(X?.addNewLine),z=new V4.Composer($),U=null;for(let Q of z.compose(H.parse(q),!0,q.length))if(!U)U=Q;else if(U.options.logLevel!=="silent"){U.errors.push(new qq.YAMLParseError(Q.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(Z&&X)U.errors.forEach(qq.prettifyError(q,X)),U.warnings.forEach(qq.prettifyError(q,X));return U}function n3(q,$,X){let Z=void 0;if(typeof $==="function")Z=$;else if(X===void 0&&$&&typeof $==="object")X=$;let H=R4(q,X);if(!H)return null;if(H.warnings.forEach((z)=>i3.warn(H.options.logLevel,z)),H.errors.length>0)if(H.options.logLevel!=="silent")throw H.errors[0];else H.errors=[];return H.toJS(Object.assign({reviver:Z},X))}function o3(q,$,X){let Z=null;if(typeof $==="function"||Array.isArray($))Z=$;else if(X===void 0&&$)X=$;if(typeof X==="string")X=X.length;if(typeof X==="number"){let H=Math.round(X);X=H<1?void 0:H>8?{indent:8}:{indent:H}}if(q===void 0){let{keepUndefined:H}=X??$??{};if(!H)return}if(a3.isDocument(q)&&!Z)return q.toString(X);return new c3.Document(q,Z,X).toString(X)}t3.parse=n3;t3.parseAllDocuments=r3;t3.parseDocument=R4;t3.stringify=o3});var K4=I((WQ)=>{var ZQ=D1(),HQ=s0(),zQ=X1(),E1=r0(),UQ=y0(),H0=A(),QQ=e(),GQ=b(),JQ=$0(),TQ=X0(),YQ=pq(),LQ=S1(),BQ=j1(),_Q=N1(),iq=P4(),M4=b0();WQ.Composer=ZQ.Composer;WQ.Document=HQ.Document;WQ.Schema=zQ.Schema;WQ.YAMLError=E1.YAMLError;WQ.YAMLParseError=E1.YAMLParseError;WQ.YAMLWarning=E1.YAMLWarning;WQ.Alias=UQ.Alias;WQ.isAlias=H0.isAlias;WQ.isCollection=H0.isCollection;WQ.isDocument=H0.isDocument;WQ.isMap=H0.isMap;WQ.isNode=H0.isNode;WQ.isPair=H0.isPair;WQ.isScalar=H0.isScalar;WQ.isSeq=H0.isSeq;WQ.Pair=QQ.Pair;WQ.Scalar=GQ.Scalar;WQ.YAMLMap=JQ.YAMLMap;WQ.YAMLSeq=TQ.YAMLSeq;WQ.CST=YQ;WQ.Lexer=LQ.Lexer;WQ.LineCounter=BQ.LineCounter;WQ.Parser=_Q.Parser;WQ.parse=iq.parse;WQ.parseAllDocuments=iq.parseAllDocuments;WQ.parseDocument=iq.parseDocument;WQ.stringify=iq.stringify;WQ.visit=M4.visit;WQ.visitAsync=M4.visitAsync});var L2=r1(Y2(),1),{program:B0,createCommand:RG,createArgument:PG,createOption:MG,CommanderError:KG,InvalidArgumentError:wG,InvalidOptionArgumentError:FG,Command:OG,Argument:AG,Option:I$,Help:SG}=L2.default;var B2={name:"@pickled-dev/cli",version:"0.8.1",description:"Test what agents actually understand about your product",module:"dist/index.js",type:"module",bin:{pickled:"./dist/index.js"},files:["dist"],scripts:{dev:"bun run ./src/index.ts",build:"bun build ./src/index.ts --outdir ./dist --target bun --minify --external @anthropic-ai/claude-agent-sdk",release:"semantic-release"},dependencies:{commander:"^14.0.2",chalk:"^5.6.2","@anthropic-ai/claude-agent-sdk":"^0.3.0"},devDependencies:{"@pickled-dev/config":"workspace:*","@pickled-dev/core":"workspace:*","semantic-release":"^25.0.2","@semantic-release/commit-analyzer":"^13.0.1","@semantic-release/exec":"^7.1.0","@semantic-release/git":"^10.0.1","@semantic-release/github":"^12.0.2","semantic-release-ai-notes":"^0.3.0"}};import HG from"path";var d={category:"cli",provider:"claude-code",model:"sonnet"},D$=["Read","Glob","Grep","Bash"],R$=["Edit","MultiEdit","Write","NotebookEdit"];var w4=r1(K4(),1);async function aq(q){let $=`${q}/pickled.yml`,X=Bun.file($);if(!await X.exists())throw Error(`pickled.yml not found in ${q}`);let Z;try{let H=await X.text();Z=w4.default.parse(H)}catch(H){throw Error(`Failed to parse pickled.yml: ${H}`)}return cQ(Z),Z}function cQ(q){if(!q.tool?.name)throw Error("pickled.yml: 'tool.name' is required");if(!Array.isArray(q.scenarios)||q.scenarios.length===0)throw Error("pickled.yml: 'scenarios' must be a non-empty array");if(q.docs?.sources){for(let[X,Z]of Object.entries(q.docs.sources))if(typeof Z!=="string"||Z.length===0)throw Error(`pickled.yml: docs.sources["${X}"] must be a non-empty string (file path or URL)`)}if(q.targets)for(let[X,Z]of Object.entries(q.targets)){if(Z.systemPrompt!==void 0)throw Error(`pickled.yml: target "${X}" sets 'systemPrompt', which bypasses the citation contract. Remove it; custom prompts are not supported in citation mode.`);if(Z.provider==="codex-cli"){if(!Z.model)throw Error(`pickled.yml: target "${X}" (codex-cli) requires an explicit 'model' field. Codex's default model can change without notice; pin it for reproducible evals.`);if(Z.maxTurns!==void 0)throw Error(`pickled.yml: target "${X}" (codex-cli) sets 'maxTurns', but the codex CLI does not support a turn cap. Remove the field.`)}}let $=new Set(Object.keys(q.docs?.sources??{}));for(let X of q.scenarios){if(!X.name||!X.prompt)throw Error("pickled.yml: every scenario needs 'name' and 'prompt'");if(!Array.isArray(X.requiredSources))throw Error(`pickled.yml: scenario "${X.name}" is missing 'requiredSources' (use [] to allow any citation)`);for(let Z of X.requiredSources)if(!$.has(Z))throw Error(`pickled.yml: scenario "${X.name}" references unknown source "${Z}". Declared sources: ${[...$].join(", ")||"(none)"}`);sQ(X.name,X.traps)}}var iQ=new Set(["g","y"]),aQ=new Set(["i","m","s","u","v"]);function sQ(q,$){if($===void 0)return;if(!Array.isArray($))throw Error(`pickled.yml: scenario "${q}" has non-array 'traps'`);let X=new Set;for(let Z of $){if(!Z.id||typeof Z.id!=="string")throw Error(`pickled.yml: scenario "${q}" has a trap missing 'id'`);if(X.has(Z.id))throw Error(`pickled.yml: scenario "${q}" has duplicate trap id "${Z.id}"`);if(X.add(Z.id),!Z.reason||typeof Z.reason!=="string")throw Error(`pickled.yml: scenario "${q}" trap "${Z.id}" requires non-empty 'reason'`);let H=typeof Z.match==="string",z=typeof Z.pattern==="string";if(H===z)throw Error(`pickled.yml: scenario "${q}" trap "${Z.id}" must set exactly one of 'match' or 'pattern'`);if(H){if(Z.match==="")throw Error(`pickled.yml: scenario "${q}" trap "${Z.id}" has empty 'match'`);if(Z.flags!==void 0)throw Error(`pickled.yml: scenario "${q}" trap "${Z.id}" sets 'flags' without 'pattern'`)}else{let U=Z.pattern;if(typeof U!=="string")throw Error(`pickled.yml: scenario "${q}" trap "${Z.id}" must set 'pattern'`);if(U==="")throw Error(`pickled.yml: scenario "${q}" trap "${Z.id}" has empty 'pattern'`);if(Z.flags!==void 0){if(typeof Z.flags!=="string")throw Error(`pickled.yml: scenario "${q}" trap "${Z.id}" has non-string 'flags'`);for(let Q of Z.flags){if(iQ.has(Q))throw Error(`pickled.yml: scenario "${q}" trap "${Z.id}" uses forbidden regex flag "${Q}" (g and y are not allowed)`);if(!aQ.has(Q))throw Error(`pickled.yml: scenario "${q}" trap "${Z.id}" uses unsupported regex flag "${Q}"`)}}try{new RegExp(U,Z.flags??"")}catch(Q){throw Error(`pickled.yml: scenario "${q}" trap "${Z.id}" has invalid regex pattern: ${Q instanceof Error?Q.message:Q}`)}}}}function b1(q,$){let X=new Set([...Object.keys(q.targets??{}),"default"]);if(!X.has($)){let Z=[...X].sort().join(", ");throw Error(`Unknown target: "${$}". Available targets: ${Z}`)}return{...q,matrix:{...q.matrix,target:[$]},scenarios:q.scenarios.filter((Z)=>!Z.target||Z.target===$)}}function sq(q){let{config:$,files:X,pairs:Z,findings:H}=q,z=[],U=H.filter((T)=>T.severity==="error").length,Q=H.filter((T)=>T.severity==="warning").length;if(z.push(`# Agent-context audit
167
- `),z.push(`Target: \`${$.targetRepo}\``),z.push(`Budgets: root \u2264 ${$.budgets.rootLines} lines, nested warn at ${$.budgets.nestedWarnLines} lines.`),z.push(`Found ${X.length} agent-doc files. ${U} error(s), ${Q} warning(s).
168
- `),z.push(`## Inventory
169
- `),X.length===0)z.push(`No agent-doc files found.
170
- `);else{z.push("| File | Lines | Kind | Notes |"),z.push("|---|---|---|---|");let T=[...X].sort((L,_)=>_.lineCount-L.lineCount);for(let L of T){let _=!L.relPath.includes("/"),V=F4(L.lineCount,_,$),B=L.isSymlink?`symlink \u2192 ${L.symlinkTarget?.replace(`${$.targetRepo}/`,"")??"?"}`:"file";z.push(`| \`${L.relPath}\` | ${L.lineCount} | ${B} | ${V} |`)}z.push("")}if(z.push(`## AGENTS.md / CLAUDE.md pairs
171
- `),Z.length===0)z.push(`No pairs found.
172
- `);else{z.push("| Directory | A | C | Class | Detail |"),z.push("|---|---|---|---|---|");for(let T of Z)z.push(`| \`${T.dir||"(root)"}\` | ${T.agentsExists?"\u2713":"\xB7"} | ${T.claudeExists?"\u2713":"\xB7"} | ${T.classification} | ${T.detail} |`);z.push("")}let J=X.filter((T)=>!T.isSymlink&&T.brokenPathRefs.length+T.brokenImports.length>0);if(z.push(`## Broken references
173
- `),J.length===0)z.push(`None detected.
174
- `);else for(let T of J){if(z.push(`### \`${T.relPath}\`
175
- `),T.brokenPathRefs.length>0){z.push("Broken path references:");for(let L of T.brokenPathRefs)z.push(` - \`${L}\``);z.push("")}if(T.brokenImports.length>0){z.push("Broken `@`-imports:");for(let L of T.brokenImports)z.push(` - \`${L}\``);z.push("")}}let G=X.filter((T)=>!T.isSymlink&&T.unresolvedCommands.length>0);if(z.push(`## Unresolved package-manager commands (advisory)
176
- `),z.push("Looks like a script command in markdown that did not match anything in the target `package.json` `scripts` or the `knownCommands` allowlist. Workspace-filtered commands check against root scripts, so false positives are expected. Review, do not fail CI on this.\n"),G.length===0)z.push(`None flagged.
177
- `);else for(let T of G){z.push(`### \`${T.relPath}\`
178
- `);for(let L of T.unresolvedCommands)z.push(` - \`${L}\``);z.push("")}let Y=X.filter((T)=>{if(T.isSymlink)return!1;return!T.relPath.includes("/")?T.lineCount>$.budgets.rootLines:T.lineCount>$.budgets.nestedWarnLines});if(z.push(`## Section breakdown for files over budget
179
- `),Y.length===0)z.push(`All files within budget.
180
- `);else for(let T of Y){z.push(`### \`${T.relPath}\` (${T.lineCount} lines)
181
- `),z.push(`Largest H2 sections (lines including any subsections):
182
- `),z.push("| Section | Lines |"),z.push("|---|---|");for(let L of T.sections.slice(0,10))z.push(`| ${L.header} | ${L.lines} |`);z.push("")}return z.join(`
183
- `)}function rq(q){return JSON.stringify(q,null,2)}function nq(q){let{config:$,files:X,pairs:Z,findings:H}=q,z=[],U=H.filter((T)=>T.severity==="error").length,Q=H.filter((T)=>T.severity==="warning").length;if(z.push("pickled audit"),z.push(`Target: ${$.targetRepo}`),z.push(`Budgets: root \u2264 ${$.budgets.rootLines} lines, nested warn at ${$.budgets.nestedWarnLines} lines.`),z.push(`Found: ${X.length} agent-doc file(s) \xB7 ${U} error(s) \xB7 ${Q} warning(s)`),z.push(""),z.push("Inventory"),X.length===0)z.push(" none");else{let T=[...X].sort((_,V)=>V.lineCount-_.lineCount),L=Math.max(...T.map((_)=>_.relPath.length));for(let _ of T){let V=!_.relPath.includes("/"),B=F4(_.lineCount,V,$),W=_.isSymlink?`symlink \u2192 ${_.symlinkTarget?.replace(`${$.targetRepo}/`,"")??"?"}`:"file",D=`${_.lineCount}`.padStart(4),R=_.relPath.padEnd(L),K=B?` (${B})`:"";z.push(` ${R} ${D} lines ${W}${K}`)}}if(z.push(""),z.push("AGENTS.md / CLAUDE.md pairs"),Z.length===0)z.push(" none");else for(let T of Z){let L=T.dir||"(root)";z.push(` ${L}: ${T.classification} \xB7 ${T.detail}`)}z.push("");let J=X.filter((T)=>!T.isSymlink&&T.brokenPathRefs.length+T.brokenImports.length>0);if(z.push("Broken references"),J.length===0)z.push(" none");else for(let T of J){z.push(` ${T.relPath}:`);for(let L of T.brokenPathRefs)z.push(` path: ${L}`);for(let L of T.brokenImports)z.push(` @-import: ${L}`)}z.push("");let G=X.filter((T)=>!T.isSymlink&&T.unresolvedCommands.length>0);if(z.push("Unresolved package-manager commands (advisory)"),G.length===0)z.push(" none");else for(let T of G){z.push(` ${T.relPath}:`);for(let L of T.unresolvedCommands)z.push(` ${L}`)}z.push("");let Y=X.filter((T)=>{if(T.isSymlink)return!1;return!T.relPath.includes("/")?T.lineCount>$.budgets.rootLines:T.lineCount>$.budgets.nestedWarnLines});if(z.push("Section breakdown for files over budget"),Y.length===0)z.push(" all files within budget");else for(let T of Y){z.push(` ${T.relPath} (${T.lineCount} lines):`);for(let L of T.sections.slice(0,10))z.push(` ${L.header.padEnd(40)} ${L.lines} lines`)}return z.join(`
184
- `)}function F4(q,$,X){if($&&q>X.budgets.rootLines)return`over root budget (${q} > ${X.budgets.rootLines})`;if(!$&&q>X.budgets.nestedWarnLines)return`over nested-warn (${q} > ${X.budgets.nestedWarnLines})`;return""}import{existsSync as A0,lstatSync as A4,readFileSync as eq,readlinkSync as rQ,statSync as nQ}from"fs";import{dirname as q$,isAbsolute as oQ,join as C1,relative as tQ,resolve as y1}from"path";var{Glob:O4}=globalThis.Bun;var oq=["node_modules/**","**/node_modules/**",".git/**","**/.git/**","dist/**","**/dist/**","build/**","**/build/**",".next/**","**/.next/**",".turbo/**","**/.turbo/**",".cache/**","**/.cache/**",".runs/**","**/.runs/**","coverage/**","**/coverage/**","**/__fixtures__/**","**/tests/**/fixture/**","**/tests/**/fixtures/**","**/test/**/fixture/**","**/test/**/fixtures/**"],O0={targetRepo:".",budgets:{rootLines:120,nestedWarnLines:200},ignore:oq,intentionalDifferentPairs:[],knownCommands:[]};function tq(q){if(!q)return O0;return{targetRepo:q.targetRepo??O0.targetRepo,budgets:{rootLines:q.budgets?.rootLines??O0.budgets.rootLines,nestedWarnLines:q.budgets?.nestedWarnLines??O0.budgets.nestedWarnLines},ignore:q.ignore??oq,intentionalDifferentPairs:q.intentionalDifferentPairs??[],knownCommands:q.knownCommands??[]}}var eQ=["AGENTS.md","CLAUDE.md","CLAUDE.local.md","llms.txt","llms-full.txt",".claude/CLAUDE.md",".claude/rules/*.md","**/AGENTS.md","**/CLAUDE.md","**/CLAUDE.local.md","**/llms.txt","**/llms-full.txt","**/.claude/CLAUDE.md","**/.claude/rules/*.md"];async function $$(q){let $=tq(q),X=y1($.targetRepo);if(!A0(X))throw Error(`targetRepo does not exist: ${X}`);let Z=new Set;for(let Q of eQ){let J=new O4(Q);for await(let G of J.scan({cwd:X,dot:!0,onlyFiles:!1,followSymlinks:!1})){if($.ignore.some((L)=>new O4(L).match(G)))continue;let Y=C1(X,G),T=A4(Y);if(T.isFile()){Z.add(G);continue}if(T.isSymbolicLink())try{if(nQ(Y).isFile())Z.add(G)}catch{}}}let H=[];for(let Q of[...Z].sort())H.push(await q7(X,Q,C1(X,Q),$));let z=L7(H,$),U=B7(H,z,$);return{config:$,files:H,pairs:z,findings:U}}async function q7(q,$,X,Z){let z=A4(X).isSymbolicLink(),U=null,Q=$;if(z){let L=rQ(X),_=oQ(L)?L:y1(q$(X),L);if(U=_,A0(_))Q=tQ(q,_)}let J=z&&U&&A0(U)?U:X,G=eq(J,"utf8"),Y=(G.match(/\n/g)??[]).length,T=G.endsWith(`
185
- `)?Y:Y+1;return{relPath:$,absPath:X,isSymlink:z,symlinkTarget:U,realRelPath:Q,lineCount:T,brokenPathRefs:X7(G,q,$),brokenImports:H7(G,q$(X)),unresolvedCommands:G7(G,q,Z.knownCommands),sections:J7(G)}}function $7(q){let $=q.split("/");if($.length<2)return null;if($[0]==="packages"||$[0]==="apps"||$[0]==="shared")return`${$[0]}/${$[1]}`;if($[0]==="tests")return $.slice(0,2).join("/");return null}function X7(q,$,X){let Z=Y7(q),H=q$(X),z=$7(X),U=new Set,Q=/`([^`\n]{2,200})`/g,J;J=Q.exec(Z);while(J!==null){let G=J[1].trim().replace(/[#?].*$/,"");if(T7(G)&&!Z7($,G,H,z).found)U.add(G);J=Q.exec(Z)}return[...U].sort()}function Z7(q,$,X,Z){let H=[$];if(X&&X!==".")H.push(`${X}/${$}`);if(Z)H.push(`${Z}/${$}`);H.push(`packages/${$}`,`apps/${$}`,`shared/${$}`);for(let z of H){let U=z.replace(/\/+/g,"/");if(A0(`${q}/${U}`))return{found:!0,resolvedAs:U}}return{found:!1}}function H7(q,$){let X=new Set,Z=/@([\w./@~-]+\.md)/g,H;H=Z.exec(q);while(H!==null){let z=H[1];if(z.startsWith("~/")){H=Z.exec(q);continue}let U=z.startsWith("/")?z:y1($,z);if(!A0(U))X.add(z);H=Z.exec(q)}return[...X].sort()}var z7=["bun","pnpm","npm","yarn"],U7=new Set(["install","add","remove","update","i","audit","list","ls","why","outdated","exec","run","create","init","x"]),Q7={bun:new Set(["build","test","link","unlink","upgrade"])};function G7(q,$,X){let Z=new Set,H=C1($,"package.json"),z=new Set;if(A0(H))try{let Q=JSON.parse(eq(H,"utf8"));z=new Set(Object.keys(Q.scripts??{}))}catch{}let U=new Set(X.map((Q)=>Q.trim()));for(let Q of z7){let J=new RegExp(`\\b${Q}\\s+(?:run\\s+|--filter\\s+\\S+\\s+(?:run\\s+)?)?([a-zA-Z][\\w:.\\-]*)`,"g"),G;G=J.exec(q);while(G!==null){let Y=G[1];if(!z.has(Y)&&!U.has(`${Q} ${Y}`)&&!U.has(`${Q} run ${Y}`)&&!U7.has(Y)&&!Q7[Q]?.has(Y))Z.add(`${Q} ${Y}`);G=J.exec(q)}}return[...Z].sort()}function J7(q){let $=q.split(`
186
- `),X=[],Z=null;if($.forEach((H,z)=>{if(/^##\s+/.test(H)){if(Z)X.push({header:Z.header,lines:z-Z.start});Z={header:H.replace(/^##\s+/,"").trim(),start:z}}}),Z){let H=Z;X.push({header:H.header,lines:$.length-H.start})}return X.sort((H,z)=>z.lines-H.lines)}function T7(q){if(q.length===0||q.length>160)return!1;if(!q.includes("/"))return!1;if(/\s/.test(q))return!1;if(/^https?:\/\//.test(q))return!1;if(/[*?{}[\]<>]/.test(q))return!1;if(q.startsWith("@"))return!1;if(q.startsWith("~/"))return!1;if(/^[a-z]+:\/\//i.test(q))return!1;if(/^cdn\./.test(q)||/^unpkg\./.test(q)||/^npm\./.test(q))return!1;if(/^\/[a-z]/.test(q)&&/(?:icon|image|img|asset|file|path)/i.test(q))return!1;if(/^(cd|pnpm|npm|yarn|bun|node|git|ls|cat|grep|find|sed|awk|mkdir|rm|mv|cp|echo|export|source|sudo|brew|docker|curl|wget)\b/.test(q))return!1;return/[a-zA-Z0-9_.-]\/[a-zA-Z0-9_.-]/.test(q)}function Y7(q){return q.replace(/```[\s\S]*?```/g,"")}function L7(q,$){let X=new Map;for(let z of q){let U=z.relPath.split("/").pop()??"";if(U!=="AGENTS.md"&&U!=="CLAUDE.md")continue;let Q=q$(z.relPath),J=X.get(Q)??{};if(U==="AGENTS.md")J.agents=z;if(U==="CLAUDE.md")J.claude=z;X.set(Q,J)}let Z=new Set($.intentionalDifferentPairs),H=[];for(let[z,U]of X){let Q=!!U.agents,J=!!U.claude;if(!Q&&!J)continue;if(!Q||!J){H.push({dir:z,agentsExists:Q,claudeExists:J,classification:"single",detail:Q?"only AGENTS.md":"only CLAUDE.md"});continue}let{agents:G,claude:Y}=U,T=`${G.relPath}:${Y.relPath}`,L=`${Y.relPath}:${G.relPath}`;if(Z.has(T)||Z.has(L)){H.push({dir:z,agentsExists:Q,claudeExists:J,classification:"intentional-different",detail:`allowlisted: ${G.lineCount}L vs ${Y.lineCount}L`});continue}if(G.isSymlink&&G.symlinkTarget===Y.absPath||Y.isSymlink&&Y.symlinkTarget===G.absPath){let W=G.isSymlink?"CLAUDE.md":"AGENTS.md";H.push({dir:z,agentsExists:Q,claudeExists:J,classification:"linked",detail:`canonical: ${W}`});continue}let V=eq(G.absPath,"utf8"),B=eq(Y.absPath,"utf8");if(V===B)H.push({dir:z,agentsExists:Q,claudeExists:J,classification:"unexpected-duplicate",detail:`byte-for-byte duplicate (${G.lineCount}L), not symlinked`});else H.push({dir:z,agentsExists:Q,claudeExists:J,classification:"unexpected-duplicate",detail:`divergent (${G.lineCount}L vs ${Y.lineCount}L), not in intentional-different allowlist`})}return H.sort((z,U)=>z.dir.localeCompare(U.dir)),H}function B7(q,$,X){let Z=[];for(let H of q){if(H.isSymlink)continue;for(let Q of H.brokenImports)Z.push({severity:"error",category:"broken-import",file:H.relPath,message:`broken @-import: ${Q}`});for(let Q of H.brokenPathRefs)Z.push({severity:"error",category:"broken-path-ref",file:H.relPath,message:`broken path reference: ${Q}`});for(let Q of H.unresolvedCommands)Z.push({severity:"warning",category:"unresolved-command",file:H.relPath,message:`unresolved command: ${Q}`});let z=!H.relPath.includes("/"),U=z?X.budgets.rootLines:X.budgets.nestedWarnLines;if(H.lineCount>U)Z.push({severity:"warning",category:"over-budget",file:H.relPath,message:`${H.lineCount} lines exceeds ${z?"root":"nested"} budget of ${U}`})}for(let H of $)if(H.classification==="unexpected-duplicate"){let z=H.detail.startsWith("divergent")?"error":"warning";Z.push({severity:z,category:z==="error"?"divergent-pair":"duplicate-pair",file:H.dir||"(root)",message:`AGENTS.md / CLAUDE.md ${H.detail}`})}return Z}function $q(q){let $=q.confidence;if(q.error)return{icon:"\u2717",label:"Error",confidence:$,tone:"error"};if(q.traps.fired.length>0)return{icon:"\u2717",label:"Trap fired",confidence:$,tone:"error"};if(q.answerable==="YES")return{icon:"\u2713",label:$>=90?"Well grounded":"Grounded",confidence:$,tone:"success"};if(q.answerable==="PARTIAL")return{icon:"\u26A0",label:"Partially grounded",confidence:$,tone:"warning"};return{icon:"\u2717",label:"Ungrounded",confidence:$,tone:"error"}}function f1(q){let $=_7(q);if($===null)return[];let X=[],Z=/^\s*-\s+\[([^\]]+)\]\s*(.*)$/gm,H=Z.exec($);while(H!==null)X.push({id:H[1].trim(),note:H[2].trim()||void 0}),H=Z.exec($);return X}function _7(q){let X=/^##\s+Sources\s*$/im.exec(q);if(!X)return null;let Z=X.index+X[0].length,H=q.slice(Z),z=/^##\s+/m.exec(H);return z?H.slice(0,z.index):H}function X$(q){let $=f1(q.response),X=new Set($.map((L)=>L.id)),Z=new Set(q.registeredIds),H=new Set(q.requiredSources),z=[...X],U=[...H].filter((L)=>!X.has(L)),Q=[...X].filter((L)=>!Z.has(L)),J=[...H],G,Y,T;if(z.length===0)G="NO",Y=0,T="No citations in response";else if(Q.length===z.length)G="NO",Y=0,T=`All cited sources are unknown: ${Q.join(", ")}`;else if(U.length===0&&Q.length===0)G="YES",Y=100,T=J.length>0?`All required sources cited: ${J.join(", ")}`:`Cited registered sources: ${z.join(", ")}`;else{G="PARTIAL";let L=J.length>0?J.length:1,_=J.length-U.length,V=J.length>0?_/L*100:60,B=Q.length*15;Y=Math.max(0,Math.min(100,Math.round(V-B)));let W=[];if(U.length>0)W.push(`missing: ${U.join(", ")}`);if(Q.length>0)W.push(`unknown: ${Q.join(", ")}`);T=W.join("; ")}return{answerable:G,confidence:Y,reason:T,citations:{cited:z,required:J,missing:U,unknown:Q}}}function Z$(q){let $=[],X=[];for(let Z of q.traps){let H=W7(q.response,Z);if(H)$.push(H);else X.push(Z.id)}return{fired:$,avoided:X}}function W7(q,$){if($.match!==void 0){let X=q.indexOf($.match);if(X===-1)return null;return{id:$.id,reason:$.reason,matched:$.match,snippet:S4(q,X,$.match.length)}}if($.pattern!==void 0){let Z=new RegExp($.pattern,$.flags??"").exec(q);if(!Z)return null;return{id:$.id,reason:$.reason,matched:Z[0],snippet:S4(q,Z.index,Z[0].length)}}return null}function S4(q,$,X){let Z=Math.max(0,$-40),H=Math.min(q.length,$+X+40),z=q.slice(Z,H).replace(/\s+/g," ").trim();if(Z>0)z=`...${z}`;if(H<q.length)z=`${z}...`;return z}import x1 from"path";function V7(q){return q.startsWith("http://")||q.startsWith("https://")}async function I7(q,$){let X=await fetch($);if(!X.ok)throw Error(`Failed to fetch source "${q}" from ${$}: ${X.status} ${X.statusText}`);let Z=await X.text();return{id:q,source:$,content:Z,name:new URL($).hostname+new URL($).pathname,type:"url"}}async function D7(q,$,X){let Z=x1.isAbsolute($)?$:x1.resolve(X,$),H=Bun.file(Z);if(!await H.exists())throw Error(`Source "${q}" not found at ${Z}`);let z=await H.text();return{id:q,source:$,content:z,name:x1.basename(Z),type:"file"}}async function j4(q,$,X){if(V7($))return I7(q,$);return D7(q,$,X)}async function k1(q,$){let X=Object.entries(q);return await Promise.all(X.map(([H,z])=>j4(H,z,$)))}import{query as R7}from"@anthropic-ai/claude-agent-sdk";function H$(q,$,X){let Z=$.length>0?$.map((U)=>`- ${U.id}: ${U.name} (${U.source})`).join(`
187
- `):"(no sources provided)",H=$.map((U)=>`<source id="${U.id}">
188
- ${U.content.trimEnd()}
143
+ `: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($[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}KQ.createScalarToken=P1.createScalarToken;KQ.resolveAsScalar=P1.resolveAsScalar;KQ.setScalarValue=P1.setScalarValue;KQ.stringify=DQ.stringify;KQ.visit=IQ.visit;KQ.BOM=K1;KQ.DOCUMENT=F1;KQ.FLOW_END=O1;KQ.SCALAR=A1;KQ.isCollection=RQ;KQ.isScalar=wQ;KQ.prettyToken=MQ;KQ.tokenType=PQ});var j1=D((vQ)=>{var q$=i$();function u($){switch($){case void 0:case" ":case`
144
+ `:case"\r":case"\t":return!0;default:return!1}}var G4=new Set("0123456789ABCDEFabcdef"),hQ=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),a$=new Set(",[]{}"),gQ=new Set(` ,[]{}
145
+ \r `),S1=($)=>!$||gQ.has($);class Y4{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=!1){if($){if(typeof $!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+$:$,this.lineEndPos=null}this.atEnd=!q;let z=this.next??"stream";while(z&&(q||this.hasChars(1)))z=yield*this.parseNext(z)}atLineEnd(){let $=this.pos,q=this.buffer[$];while(q===" "||q==="\t")q=this.buffer[++$];if(!q||q==="#"||q===`
146
+ `)return!0;if(q==="\r")return this.buffer[$+1]===`
147
+ `;return!1}charAt($){return this.buffer[this.pos+$]}continueScalar($){let q=this.buffer[$];if(this.indentNext>0){let z=0;while(q===" ")q=this.buffer[++z+$];if(q==="\r"){let X=this.buffer[z+$+1];if(X===`
148
+ `||!X&&!this.atEnd)return $+z+1}return q===`
149
+ `||z>=this.indentNext||!q&&!this.atEnd?$+z:-1}if(q==="-"||q==="."){let z=this.buffer.substr($,3);if((z==="---"||z==="...")&&u(this.buffer[$+3]))return-1}return $}getLine(){let $=this.lineEndPos;if(typeof $!=="number"||$!==-1&&$<this.pos)$=this.buffer.indexOf(`
150
+ `,this.pos),this.lineEndPos=$;if($===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[$-1]==="\r")$-=1;return this.buffer.substring(this.pos,$)}hasChars($){return this.pos+$<=this.buffer.length}setNext($){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=$,null}peek($){return this.buffer.substr(this.pos,$)}*parseNext($){switch($){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 $=this.getLine();if($===null)return this.setNext("stream");if($[0]===q$.BOM)yield*this.pushCount(1),$=$.substring(1);if($[0]==="%"){let q=$.length,z=$.indexOf("#");while(z!==-1){let Z=$[z-1];if(Z===" "||Z==="\t"){q=z-1;break}else z=$.indexOf("#",z+1)}while(!0){let Z=$[q-1];if(Z===" "||Z==="\t")q-=1;else break}let X=(yield*this.pushCount(q))+(yield*this.pushSpaces(!0));return yield*this.pushCount($.length-X),this.pushNewline(),"stream"}if(this.atLineEnd()){let q=yield*this.pushSpaces(!0);return yield*this.pushCount($.length-q),yield*this.pushNewline(),"stream"}return yield q$.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let $=this.charAt(0);if(!$&&!this.atEnd)return this.setNext("line-start");if($==="-"||$==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let q=this.peek(3);if((q==="---"||q==="...")&&u(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,q==="---"?"doc":"stream"}if(this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!u(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){let[$,q]=this.peek(2);if(!q&&!this.atEnd)return this.setNext("block-start");if(($==="-"||$==="?"||$===":")&&u(q)){let z=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=z,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let $=this.getLine();if($===null)return this.setNext("doc");let q=yield*this.pushIndicators();switch($[q]){case"#":yield*this.pushCount($.length-q);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(S1),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return q+=yield*this.parseBlockScalarHeader(),q+=yield*this.pushSpaces(!0),yield*this.pushCount($.length-q),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let $,q,z=-1;do{if($=yield*this.pushNewline(),$>0)q=yield*this.pushSpaces(!1),this.indentValue=z=q;else q=0;q+=yield*this.pushSpaces(!0)}while($+q>0);let X=this.getLine();if(X===null)return this.setNext("flow");if(z!==-1&&z<this.indentNext&&X[0]!=="#"||z===0&&(X.startsWith("---")||X.startsWith("..."))&&u(X[3])){if(!(z===this.indentNext-1&&this.flowLevel===1&&(X[0]==="]"||X[0]==="}")))return this.flowLevel=0,yield q$.FLOW_END,yield*this.parseLineStart()}let Z=0;while(X[Z]===",")Z+=yield*this.pushCount(1),Z+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(Z+=yield*this.pushIndicators(),X[Z]){case void 0:return"flow";case"#":return yield*this.pushCount(X.length-Z),"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(S1),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let H=this.charAt(1);if(this.flowKey||u(H)||H===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let $=this.charAt(0),q=this.buffer.indexOf($,this.pos+1);if($==="'")while(q!==-1&&this.buffer[q+1]==="'")q=this.buffer.indexOf("'",q+2);else while(q!==-1){let Z=0;while(this.buffer[q-1-Z]==="\\")Z+=1;if(Z%2===0)break;q=this.buffer.indexOf('"',q+1)}let z=this.buffer.substring(0,q),X=z.indexOf(`
151
+ `,this.pos);if(X!==-1){while(X!==-1){let Z=this.continueScalar(X+1);if(Z===-1)break;X=z.indexOf(`
152
+ `,Z)}if(X!==-1)q=X-(z[X-1]==="\r"?2:1)}if(q===-1){if(!this.atEnd)return this.setNext("quoted-scalar");q=this.buffer.length}return yield*this.pushToIndex(q+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let $=this.pos;while(!0){let q=this.buffer[++$];if(q==="+")this.blockScalarKeep=!0;else if(q>"0"&&q<="9")this.blockScalarIndent=Number(q)-1;else if(q!=="-")break}return yield*this.pushUntil((q)=>u(q)||q==="#")}*parseBlockScalar(){let $=this.pos-1,q=0,z;$:for(let Z=this.pos;z=this.buffer[Z];++Z)switch(z){case" ":q+=1;break;case`
153
+ `:$=Z,q=0;break;case"\r":{let H=this.buffer[Z+1];if(!H&&!this.atEnd)return this.setNext("block-scalar");if(H===`
154
+ `)break}default:break $}if(!z&&!this.atEnd)return this.setNext("block-scalar");if(q>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=q;else this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let Z=this.continueScalar($+1);if(Z===-1)break;$=this.buffer.indexOf(`
155
+ `,Z)}while($!==-1);if($===-1){if(!this.atEnd)return this.setNext("block-scalar");$=this.buffer.length}}let X=$+1;z=this.buffer[X];while(z===" ")z=this.buffer[++X];if(z==="\t"){while(z==="\t"||z===" "||z==="\r"||z===`
156
+ `)z=this.buffer[++X];$=X-1}else if(!this.blockScalarKeep)do{let Z=$-1,H=this.buffer[Z];if(H==="\r")H=this.buffer[--Z];let Q=Z;while(H===" ")H=this.buffer[--Z];if(H===`
157
+ `&&Z>=this.pos&&Z+1+q>Q)$=Z;else break}while(!0);return yield q$.SCALAR,yield*this.pushToIndex($+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let $=this.flowLevel>0,q=this.pos-1,z=this.pos-1,X;while(X=this.buffer[++z])if(X===":"){let Z=this.buffer[z+1];if(u(Z)||$&&a$.has(Z))break;q=z}else if(u(X)){let Z=this.buffer[z+1];if(X==="\r")if(Z===`
158
+ `)z+=1,X=`
159
+ `,Z=this.buffer[z+1];else q=z;if(Z==="#"||$&&a$.has(Z))break;if(X===`
160
+ `){let H=this.continueScalar(z+1);if(H===-1)break;z=Math.max(z,H-2)}}else{if($&&a$.has(X))break;q=z}if(!X&&!this.atEnd)return this.setNext("plain-scalar");return yield q$.SCALAR,yield*this.pushToIndex(q+1,!0),$?"flow":"doc"}*pushCount($){if($>0)return yield this.buffer.substr(this.pos,$),this.pos+=$,$;return 0}*pushToIndex($,q){let z=this.buffer.slice(this.pos,$);if(z)return yield z,this.pos+=z.length,z.length;else if(q)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(S1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let $=this.flowLevel>0,q=this.charAt(1);if(u(q)||$&&a$.has(q)){if(!$)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 $=this.pos+2,q=this.buffer[$];while(!u(q)&&q!==">")q=this.buffer[++$];return yield*this.pushToIndex(q===">"?$+1:$,!1)}else{let $=this.pos+1,q=this.buffer[$];while(q)if(hQ.has(q))q=this.buffer[++$];else if(q==="%"&&G4.has(this.buffer[$+1])&&G4.has(this.buffer[$+2]))q=this.buffer[$+=3];else break;return yield*this.pushToIndex($,!1)}}*pushNewline(){let $=this.buffer[this.pos];if($===`
161
+ `)return yield*this.pushCount(1);else if($==="\r"&&this.charAt(1)===`
162
+ `)return yield*this.pushCount(2);else return 0}*pushSpaces($){let q=this.pos-1,z;do z=this.buffer[++q];while(z===" "||$&&z==="\t");let X=q-this.pos;if(X>0)yield this.buffer.substr(this.pos,X),this.pos=q;return X}*pushUntil($){let q=this.pos,z=this.buffer[q];while(!$(z))z=this.buffer[++q];return yield*this.pushToIndex(q,!1)}}vQ.Lexer=Y4});var N1=D((mQ)=>{class B4{constructor(){this.lineStarts=[],this.addNewLine=($)=>this.lineStarts.push($),this.linePos=($)=>{let q=0,z=this.lineStarts.length;while(q<z){let Z=q+z>>1;if(this.lineStarts[Z]<$)q=Z+1;else z=Z}if(this.lineStarts[q]===$)return{line:q+1,col:1};if(q===0)return{line:0,col:$};let X=this.lineStarts[q-1];return{line:q,col:$-X+1}}}}mQ.LineCounter=B4});var E1=D((cQ)=>{var pQ=c("process"),T4=i$(),lQ=j1();function X0($,q){for(let z=0;z<$.length;++z)if($[z].type===q)return!0;return!1}function W4($){for(let q=0;q<$.length;++q)switch($[q].type){case"space":case"comment":case"newline":break;default:return q}return-1}function V4($){switch($?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function s$($){switch($.type){case"document":return $.start;case"block-map":{let q=$.items[$.items.length-1];return q.sep??q.start}case"block-seq":return $.items[$.items.length-1].start;default:return[]}}function F0($){if($.length===0)return[];let q=$.length;$:while(--q>=0)switch($[q].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break $}while($[++q]?.type==="space");return $.splice(q,$.length)}function L4($){if($.start.type==="flow-seq-start"){for(let q of $.items)if(q.sep&&!q.value&&!X0(q.start,"explicit-key-ind")&&!X0(q.sep,"map-value-ind")){if(q.key)q.value=q.key;if(delete q.key,V4(q.value))if(q.value.end)Array.prototype.push.apply(q.value.end,q.sep);else q.value.end=q.sep;else Array.prototype.push.apply(q.start,q.sep);delete q.sep}}}class _4{constructor($){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new lQ.Lexer,this.onNewLine=$}*parse($,q=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let z of this.lexer.lex($,q))yield*this.next(z);if(!q)yield*this.end()}*next($){if(this.source=$,pQ.env.LOG_TOKENS)console.log("|",T4.prettyToken($));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=$.length;return}let q=T4.tokenType($);if(!q){let z=`Not a YAML token: ${$}`;yield*this.pop({type:"error",offset:this.offset,message:z,source:$}),this.offset+=$.length}else if(q==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=q,yield*this.step(),q){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+$.length);break;case"space":if(this.atNewLine&&$[0]===" ")this.indent+=$.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=$.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=$.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 $=this.peek(1);if(this.type==="doc-end"&&$?.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(!$)return yield*this.stream();switch($.type){case"document":return yield*this.document($);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar($);case"block-scalar":return yield*this.blockScalar($);case"block-map":return yield*this.blockMap($);case"block-seq":return yield*this.blockSequence($);case"flow-collection":return yield*this.flowCollection($);case"doc-end":return yield*this.documentEnd($)}yield*this.pop()}peek($){return this.stack[this.stack.length-$]}*pop($){let q=$??this.stack.pop();if(!q)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield q;else{let z=this.peek(1);if(q.type==="block-scalar")q.indent="indent"in z?z.indent:0;else if(q.type==="flow-collection"&&z.type==="document")q.indent=0;if(q.type==="flow-collection")L4(q);switch(z.type){case"document":z.value=q;break;case"block-scalar":z.props.push(q);break;case"block-map":{let X=z.items[z.items.length-1];if(X.value){z.items.push({start:[],key:q,sep:[]}),this.onKeyLine=!0;return}else if(X.sep)X.value=q;else{Object.assign(X,{key:q,sep:[]}),this.onKeyLine=!X.explicitKey;return}break}case"block-seq":{let X=z.items[z.items.length-1];if(X.value)z.items.push({start:[],value:q});else X.value=q;break}case"flow-collection":{let X=z.items[z.items.length-1];if(!X||X.value)z.items.push({start:[],key:q,sep:[]});else if(X.sep)X.value=q;else Object.assign(X,{key:q,sep:[]});return}default:yield*this.pop(),yield*this.pop(q)}if((z.type==="document"||z.type==="block-map"||z.type==="block-seq")&&(q.type==="block-map"||q.type==="block-seq")){let X=q.items[q.items.length-1];if(X&&!X.sep&&!X.value&&X.start.length>0&&W4(X.start)===-1&&(q.indent===0||X.start.every((Z)=>Z.type!=="comment"||Z.indent<q.indent))){if(z.type==="document")z.end=X.start;else z.items.push({start:X.start});q.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 $={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")$.start.push(this.sourceToken);this.stack.push($);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document($){if($.value)return yield*this.lineEnd($);switch(this.type){case"doc-start":{if(W4($.start)!==-1)yield*this.pop(),yield*this.step();else $.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":$.start.push(this.sourceToken);return}let q=this.startBlockValue($);if(q)this.stack.push(q);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar($){if(this.type==="map-value-ind"){let q=s$(this.peek(2)),z=F0(q),X;if($.end)X=$.end,X.push(this.sourceToken),delete $.end;else X=[this.sourceToken];let Z={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:z,key:$,sep:X}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=Z}else yield*this.lineEnd($)}*blockScalar($){switch(this.type){case"space":case"comment":case"newline":$.props.push(this.sourceToken);return;case"scalar":if($.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let q=this.source.indexOf(`
163
+ `)+1;while(q!==0)this.onNewLine(this.offset+q),q=this.source.indexOf(`
164
+ `,q)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap($){let q=$.items[$.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,q.value){let z="end"in q.value?q.value.end:void 0;if((Array.isArray(z)?z[z.length-1]:void 0)?.type==="comment")z?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else if(q.sep)q.sep.push(this.sourceToken);else q.start.push(this.sourceToken);return;case"space":case"comment":if(q.value)$.items.push({start:[this.sourceToken]});else if(q.sep)q.sep.push(this.sourceToken);else{if(this.atIndentedComment(q.start,$.indent)){let X=$.items[$.items.length-2]?.value?.end;if(Array.isArray(X)){Array.prototype.push.apply(X,q.start),X.push(this.sourceToken),$.items.pop();return}}q.start.push(this.sourceToken)}return}if(this.indent>=$.indent){let z=!this.onKeyLine&&this.indent===$.indent,X=z&&(q.sep||q.explicitKey)&&this.type!=="seq-item-ind",Z=[];if(X&&q.sep&&!q.value){let H=[];for(let Q=0;Q<q.sep.length;++Q){let J=q.sep[Q];switch(J.type){case"newline":H.push(Q);break;case"space":break;case"comment":if(J.indent>$.indent)H.length=0;break;default:H.length=0}}if(H.length>=2)Z=q.sep.splice(H[1])}switch(this.type){case"anchor":case"tag":if(X||q.value)Z.push(this.sourceToken),$.items.push({start:Z}),this.onKeyLine=!0;else if(q.sep)q.sep.push(this.sourceToken);else q.start.push(this.sourceToken);return;case"explicit-key-ind":if(!q.sep&&!q.explicitKey)q.start.push(this.sourceToken),q.explicitKey=!0;else if(X||q.value)Z.push(this.sourceToken),$.items.push({start:Z,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(q.explicitKey)if(!q.sep)if(X0(q.start,"newline"))Object.assign(q,{key:null,sep:[this.sourceToken]});else{let H=F0(q.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:H,key:null,sep:[this.sourceToken]}]})}else if(q.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(X0(q.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Z,key:null,sep:[this.sourceToken]}]});else if(V4(q.key)&&!X0(q.sep,"newline")){let H=F0(q.start),Q=q.key,J=q.sep;J.push(this.sourceToken),delete q.key,delete q.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:H,key:Q,sep:J}]})}else if(Z.length>0)q.sep=q.sep.concat(Z,this.sourceToken);else q.sep.push(this.sourceToken);else if(!q.sep)Object.assign(q,{key:null,sep:[this.sourceToken]});else if(q.value||X)$.items.push({start:Z,key:null,sep:[this.sourceToken]});else if(X0(q.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else q.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let H=this.flowScalar(this.type);if(X||q.value)$.items.push({start:Z,key:H,sep:[]}),this.onKeyLine=!0;else if(q.sep)this.stack.push(H);else Object.assign(q,{key:H,sep:[]}),this.onKeyLine=!0;return}default:{let H=this.startBlockValue($);if(H){if(H.type==="block-seq"){if(!q.explicitKey&&q.sep&&!X0(q.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(z)$.items.push({start:Z});this.stack.push(H);return}}}}yield*this.pop(),yield*this.step()}*blockSequence($){let q=$.items[$.items.length-1];switch(this.type){case"newline":if(q.value){let z="end"in q.value?q.value.end:void 0;if((Array.isArray(z)?z[z.length-1]:void 0)?.type==="comment")z?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else q.start.push(this.sourceToken);return;case"space":case"comment":if(q.value)$.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(q.start,$.indent)){let X=$.items[$.items.length-2]?.value?.end;if(Array.isArray(X)){Array.prototype.push.apply(X,q.start),X.push(this.sourceToken),$.items.pop();return}}q.start.push(this.sourceToken)}return;case"anchor":case"tag":if(q.value||this.indent<=$.indent)break;q.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==$.indent)break;if(q.value||X0(q.start,"seq-item-ind"))$.items.push({start:[this.sourceToken]});else q.start.push(this.sourceToken);return}if(this.indent>$.indent){let z=this.startBlockValue($);if(z){this.stack.push(z);return}}yield*this.pop(),yield*this.step()}*flowCollection($){let q=$.items[$.items.length-1];if(this.type==="flow-error-end"){let z;do yield*this.pop(),z=this.peek(1);while(z?.type==="flow-collection")}else if($.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!q||q.sep)$.items.push({start:[this.sourceToken]});else q.start.push(this.sourceToken);return;case"map-value-ind":if(!q||q.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(q.sep)q.sep.push(this.sourceToken);else Object.assign(q,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!q||q.value)$.items.push({start:[this.sourceToken]});else if(q.sep)q.sep.push(this.sourceToken);else q.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let X=this.flowScalar(this.type);if(!q||q.value)$.items.push({start:[],key:X,sep:[]});else if(q.sep)this.stack.push(X);else Object.assign(q,{key:X,sep:[]});return}case"flow-map-end":case"flow-seq-end":$.end.push(this.sourceToken);return}let z=this.startBlockValue($);if(z)this.stack.push(z);else yield*this.pop(),yield*this.step()}else{let z=this.peek(2);if(z.type==="block-map"&&(this.type==="map-value-ind"&&z.indent===$.indent||this.type==="newline"&&!z.items[z.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&z.type!=="flow-collection"){let X=s$(z),Z=F0(X);L4($);let H=$.end.splice(1,$.end.length);H.push(this.sourceToken);let Q={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:Z,key:$,sep:H}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=Q}else yield*this.lineEnd($)}}flowScalar($){if(this.onNewLine){let q=this.source.indexOf(`
165
+ `)+1;while(q!==0)this.onNewLine(this.offset+q),q=this.source.indexOf(`
166
+ `,q)+1}return{type:$,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue($){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 q=s$($),z=F0(q);return z.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:z,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let q=s$($),z=F0(q);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:z,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment($,q){if(this.type!=="comment")return!1;if(this.indent<=q)return!1;return $.every((z)=>z.type==="newline"||z.type==="space")}*documentEnd($){if(this.type!=="doc-mode"){if($.end)$.end.push(this.sourceToken);else $.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd($){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($.end)$.end.push(this.sourceToken);else $.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}cQ.Parser=_4});var M4=D(($7)=>{var D4=R1(),aQ=n0(),z$=o0(),sQ=Nq(),rQ=A(),nQ=N1(),I4=E1();function R4($){let q=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||q&&new nQ.LineCounter||null,prettyErrors:q}}function oQ($,q={}){let{lineCounter:z,prettyErrors:X}=R4(q),Z=new I4.Parser(z?.addNewLine),H=new D4.Composer(q),Q=Array.from(H.compose(Z.parse($)));if(X&&z)for(let J of Q)J.errors.forEach(z$.prettifyError($,z)),J.warnings.forEach(z$.prettifyError($,z));if(Q.length>0)return Q;return Object.assign([],{empty:!0},H.streamInfo())}function w4($,q={}){let{lineCounter:z,prettyErrors:X}=R4(q),Z=new I4.Parser(z?.addNewLine),H=new D4.Composer(q),Q=null;for(let J of H.compose(Z.parse($),!0,$.length))if(!Q)Q=J;else if(Q.options.logLevel!=="silent"){Q.errors.push(new z$.YAMLParseError(J.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(X&&z)Q.errors.forEach(z$.prettifyError($,z)),Q.warnings.forEach(z$.prettifyError($,z));return Q}function tQ($,q,z){let X=void 0;if(typeof q==="function")X=q;else if(z===void 0&&q&&typeof q==="object")z=q;let Z=w4($,z);if(!Z)return null;if(Z.warnings.forEach((H)=>sQ.warn(Z.options.logLevel,H)),Z.errors.length>0)if(Z.options.logLevel!=="silent")throw Z.errors[0];else Z.errors=[];return Z.toJS(Object.assign({reviver:X},z))}function eQ($,q,z){let X=null;if(typeof q==="function"||Array.isArray(q))X=q;else if(z===void 0&&q)z=q;if(typeof z==="string")z=z.length;if(typeof z==="number"){let Z=Math.round(z);z=Z<1?void 0:Z>8?{indent:8}:{indent:Z}}if($===void 0){let{keepUndefined:Z}=z??q??{};if(!Z)return}if(rQ.isDocument($)&&!X)return $.toString(z);return new aQ.Document($,X,z).toString(z)}$7.parse=tQ;$7.parseAllDocuments=oQ;$7.parseDocument=w4;$7.stringify=eQ});var K4=D((D7)=>{var H7=R1(),Q7=n0(),J7=X1(),b1=o0(),U7=k0(),Z0=A(),G7=e(),Y7=b(),B7=q0(),T7=z0(),W7=i$(),L7=j1(),V7=N1(),_7=E1(),r$=M4(),P4=y0();D7.Composer=H7.Composer;D7.Document=Q7.Document;D7.Schema=J7.Schema;D7.YAMLError=b1.YAMLError;D7.YAMLParseError=b1.YAMLParseError;D7.YAMLWarning=b1.YAMLWarning;D7.Alias=U7.Alias;D7.isAlias=Z0.isAlias;D7.isCollection=Z0.isCollection;D7.isDocument=Z0.isDocument;D7.isMap=Z0.isMap;D7.isNode=Z0.isNode;D7.isPair=Z0.isPair;D7.isScalar=Z0.isScalar;D7.isSeq=Z0.isSeq;D7.Pair=G7.Pair;D7.Scalar=Y7.Scalar;D7.YAMLMap=B7.YAMLMap;D7.YAMLSeq=T7.YAMLSeq;D7.CST=W7;D7.Lexer=L7.Lexer;D7.LineCounter=V7.LineCounter;D7.Parser=_7.Parser;D7.parse=r$.parse;D7.parseAllDocuments=r$.parseAllDocuments;D7.parseDocument=r$.parseDocument;D7.stringify=r$.stringify;D7.visit=P4.visit;D7.visitAsync=P4.visitAsync});var W2=n1(T2(),1),{program:W0,createCommand:AU,createArgument:SU,createOption:jU,CommanderError:NU,InvalidArgumentError:EU,InvalidOptionArgumentError:bU,Command:CU,Argument:yU,Option:Iq,Help:fU}=W2.default;var L2={name:"@pickled-dev/cli",version:"0.10.0",description:"Test what agents actually understand about your product",module:"dist/index.js",type:"module",bin:{pickled:"./dist/index.js"},files:["dist"],scripts:{dev:"bun run ./src/index.ts",build:"bun build ./src/index.ts --outdir ./dist --target bun --minify --external @anthropic-ai/claude-agent-sdk",release:"semantic-release"},dependencies:{commander:"^14.0.2",chalk:"^5.6.2","@anthropic-ai/claude-agent-sdk":"^0.3.0"},devDependencies:{"@pickled-dev/config":"workspace:*","@pickled-dev/core":"workspace:*","semantic-release":"^25.0.2","@semantic-release/commit-analyzer":"^13.0.1","@semantic-release/exec":"^7.1.0","@semantic-release/git":"^10.0.1","@semantic-release/github":"^12.0.2","semantic-release-ai-notes":"^0.3.0"}};import BU from"path";var d={category:"cli",provider:"claude-code",model:"sonnet"},Rq=["Read","Glob","Grep","Bash"],wq=["Edit","MultiEdit","Write","NotebookEdit"];var F4=n1(K4(),1);async function O0($){let q=`${$}/pickled.yml`,z=Bun.file(q);if(!await z.exists())throw Error(`pickled.yml not found in ${$}`);let X;try{let Z=await z.text();X=F4.default.parse(Z)}catch(Z){throw Error(`Failed to parse pickled.yml: ${Z}`)}return a7(X),X}function a7($){if(!$.tool?.name)throw Error("pickled.yml: 'tool.name' is required");if(!Array.isArray($.scenarios)||$.scenarios.length===0)throw Error("pickled.yml: 'scenarios' must be a non-empty array");if($.docs?.sources)for(let[z,X]of Object.entries($.docs.sources))r7(z,X);if($.targets)for(let[z,X]of Object.entries($.targets)){if(X.systemPrompt!==void 0)throw Error(`pickled.yml: target "${z}" sets 'systemPrompt', which bypasses the citation contract. Remove it; custom prompts are not supported in citation mode.`);if(X.provider==="codex-cli"){if(!X.model)throw Error(`pickled.yml: target "${z}" (codex-cli) requires an explicit 'model' field. Codex's default model can change without notice; pin it for reproducible evals.`);if(X.maxTurns!==void 0)throw Error(`pickled.yml: target "${z}" (codex-cli) sets 'maxTurns', but the codex CLI does not support a turn cap. Remove the field.`)}}let q=new Set(Object.keys($.docs?.sources??{}));for(let z of $.scenarios){if(!z.name||!z.prompt)throw Error("pickled.yml: every scenario needs 'name' and 'prompt'");if(!Array.isArray(z.requiredSources))throw Error(`pickled.yml: scenario "${z.name}" is missing 'requiredSources' (use [] to allow any citation)`);for(let X of z.requiredSources)if(!q.has(X))throw Error(`pickled.yml: scenario "${z.name}" references unknown source "${X}". Declared sources: ${[...q].join(", ")||"(none)"}`);t7(z.name,z.traps),s7(z.name,z.compareSurfaces,q)}}function s7($,q,z){if(q===void 0)return;if(!Array.isArray(q))throw Error(`pickled.yml: scenario "${$}" compareSurfaces must be an array of source-id lists`);if(q.length===0)throw Error(`pickled.yml: scenario "${$}" compareSurfaces cannot be empty (use a non-empty list of surfaces, or remove the field)`);for(let X=0;X<q.length;X++){let Z=q[X];if(!Array.isArray(Z))throw Error(`pickled.yml: scenario "${$}" compareSurfaces[${X}] must be an array of source ids`);if(Z.length===0)throw Error(`pickled.yml: scenario "${$}" compareSurfaces[${X}] must be a non-empty list of source ids`);for(let H of Z){if(typeof H!=="string")throw Error(`pickled.yml: scenario "${$}" compareSurfaces[${X}] entries must be string source ids`);if(!z.has(H))throw Error(`pickled.yml: scenario "${$}" compareSurfaces[${X}] references unknown source "${H}". Declared sources: ${[...z].join(", ")||"(none)"}`)}}}function r7($,q){if(typeof q==="string"){if(q.length===0)throw Error(`pickled.yml: docs.sources["${$}"] string form must be a non-empty file path or URL`);return}if(!q||typeof q!=="object")throw Error(`pickled.yml: docs.sources["${$}"] must be a string (path/URL) or an object with a 'path' field`);let z=q;if(typeof z.path!=="string"||z.path.length===0)throw Error(`pickled.yml: docs.sources["${$}"] object form requires a non-empty 'path' field`);if(z.audit!==void 0){if(typeof z.audit!=="object"||z.audit===null)throw Error(`pickled.yml: docs.sources["${$}"].audit must be an object`);let X=z.audit;if(X.traps!==void 0&&typeof X.traps!=="boolean")throw Error(`pickled.yml: docs.sources["${$}"].audit.traps must be a boolean`);for(let Z of Object.keys(X))if(Z!=="traps")throw Error(`pickled.yml: docs.sources["${$}"].audit has unknown field "${Z}"`)}for(let X of Object.keys(z))if(X!=="path"&&X!=="audit")throw Error(`pickled.yml: docs.sources["${$}"] has unknown field "${X}"`)}var n7=new Set(["g","y"]),o7=new Set(["i","m","s","u","v"]);function t7($,q){if(q===void 0)return;if(!Array.isArray(q))throw Error(`pickled.yml: scenario "${$}" has non-array 'traps'`);let z=new Set;for(let X of q){if(!X.id||typeof X.id!=="string")throw Error(`pickled.yml: scenario "${$}" has a trap missing 'id'`);if(z.has(X.id))throw Error(`pickled.yml: scenario "${$}" has duplicate trap id "${X.id}"`);if(z.add(X.id),!X.reason||typeof X.reason!=="string")throw Error(`pickled.yml: scenario "${$}" trap "${X.id}" requires non-empty 'reason'`);if(X.auditSeverity!==void 0&&X.auditSeverity!=="warning"&&X.auditSeverity!=="error")throw Error(`pickled.yml: scenario "${$}" trap "${X.id}" auditSeverity must be "warning" or "error"`);let Z=typeof X.match==="string",H=typeof X.pattern==="string";if(Z===H)throw Error(`pickled.yml: scenario "${$}" trap "${X.id}" must set exactly one of 'match' or 'pattern'`);if(Z){if(X.match==="")throw Error(`pickled.yml: scenario "${$}" trap "${X.id}" has empty 'match'`);if(X.flags!==void 0)throw Error(`pickled.yml: scenario "${$}" trap "${X.id}" sets 'flags' without 'pattern'`)}else{let Q=X.pattern;if(typeof Q!=="string")throw Error(`pickled.yml: scenario "${$}" trap "${X.id}" must set 'pattern'`);if(Q==="")throw Error(`pickled.yml: scenario "${$}" trap "${X.id}" has empty 'pattern'`);if(X.flags!==void 0){if(typeof X.flags!=="string")throw Error(`pickled.yml: scenario "${$}" trap "${X.id}" has non-string 'flags'`);for(let J of X.flags){if(n7.has(J))throw Error(`pickled.yml: scenario "${$}" trap "${X.id}" uses forbidden regex flag "${J}" (g and y are not allowed)`);if(!o7.has(J))throw Error(`pickled.yml: scenario "${$}" trap "${X.id}" uses unsupported regex flag "${J}"`)}}try{new RegExp(Q,X.flags??"")}catch(J){throw Error(`pickled.yml: scenario "${$}" trap "${X.id}" has invalid regex pattern: ${J instanceof Error?J.message:J}`)}}}}function C1($,q){let z=new Set([...Object.keys($.targets??{}),"default"]);if(!z.has(q)){let X=[...z].sort().join(", ");throw Error(`Unknown target: "${q}". Available targets: ${X}`)}return{...$,matrix:{...$.matrix,target:[q]},scenarios:$.scenarios.filter((X)=>!X.target||X.target===q)}}function y1($){if(typeof $==="string")return{path:$,auditTraps:!0};return{path:$.path,auditTraps:$.audit?.traps??!0}}function n$($){let{config:q,files:z,pairs:X,findings:Z}=$,H=[],Q=Z.filter((G)=>G.severity==="error").length,J=Z.filter((G)=>G.severity==="warning").length;if(H.push(`# Agent-context audit
167
+ `),H.push(`Target: \`${q.targetRepo}\``),H.push(`Budgets: root \u2264 ${q.budgets.rootLines} lines, nested warn at ${q.budgets.nestedWarnLines} lines.`),H.push(`Found ${z.length} agent-doc files. ${Q} error(s), ${J} warning(s).
168
+ `),H.push(`## Inventory
169
+ `),z.length===0)H.push(`No agent-doc files found.
170
+ `);else{H.push("| File | Lines | Kind | Notes |"),H.push("|---|---|---|---|");let G=[...z].sort((T,L)=>L.lineCount-T.lineCount);for(let T of G){let L=!T.relPath.includes("/"),_=O4(T.lineCount,L,q),W=T.isSymlink?`symlink \u2192 ${T.symlinkTarget?.replace(`${q.targetRepo}/`,"")??"?"}`:"file";H.push(`| \`${T.relPath}\` | ${T.lineCount} | ${W} | ${_} |`)}H.push("")}if(H.push(`## AGENTS.md / CLAUDE.md pairs
171
+ `),X.length===0)H.push(`No pairs found.
172
+ `);else{H.push("| Directory | A | C | Class | Detail |"),H.push("|---|---|---|---|---|");for(let G of X)H.push(`| \`${G.dir||"(root)"}\` | ${G.agentsExists?"\u2713":"\xB7"} | ${G.claudeExists?"\u2713":"\xB7"} | ${G.classification} | ${G.detail} |`);H.push("")}let Y=z.filter((G)=>!G.isSymlink&&G.brokenPathRefs.length+G.brokenImports.length>0);if(H.push(`## Broken references
173
+ `),Y.length===0)H.push(`None detected.
174
+ `);else for(let G of Y){if(H.push(`### \`${G.relPath}\`
175
+ `),G.brokenPathRefs.length>0){H.push("Broken path references:");for(let T of G.brokenPathRefs)H.push(` - \`${T}\``);H.push("")}if(G.brokenImports.length>0){H.push("Broken `@`-imports:");for(let T of G.brokenImports)H.push(` - \`${T}\``);H.push("")}}let U=z.filter((G)=>!G.isSymlink&&G.unresolvedCommands.length>0);if(H.push(`## Unresolved package-manager commands (advisory)
176
+ `),H.push("Looks like a script command in markdown that did not match anything in the target `package.json` `scripts` or the `knownCommands` allowlist. Workspace-filtered commands check against root scripts, so false positives are expected. Review, do not fail CI on this.\n"),U.length===0)H.push(`None flagged.
177
+ `);else for(let G of U){H.push(`### \`${G.relPath}\`
178
+ `);for(let T of G.unresolvedCommands)H.push(` - \`${T}\``);H.push("")}let B=z.filter((G)=>{if(G.isSymlink)return!1;return!G.relPath.includes("/")?G.lineCount>q.budgets.rootLines:G.lineCount>q.budgets.nestedWarnLines});if(H.push(`## Section breakdown for files over budget
179
+ `),B.length===0)H.push(`All files within budget.
180
+ `);else for(let G of B){H.push(`### \`${G.relPath}\` (${G.lineCount} lines)
181
+ `),H.push(`Largest H2 sections (lines including any subsections):
182
+ `),H.push("| Section | Lines |"),H.push("|---|---|");for(let T of G.sections.slice(0,10))H.push(`| ${T.header} | ${T.lines} |`);H.push("")}if(H.push(`## Registered-source trap matches
183
+ `),H.push("Catches stale claims in `docs.sources` against declared traps. Sources with `audit.traps: false` are excluded.\n"),$.sourceTrapMatches.length===0)H.push(`None.
184
+ `);else{for(let G of $.sourceTrapMatches)H.push(`- **${G.sourceId}** (\`${G.sourcePath}:L${G.line}\`) \u2014 trap \`${G.trapId}\` matched \`${G.matched}\` (${G.severity})`),H.push(` - reason: ${G.trapReason}`),H.push(" - fix: remove the stale claim, retire the trap, or set `audit.traps: false` on the source");H.push("")}return H.join(`
185
+ `)}function o$($){return JSON.stringify($,null,2)}function t$($){let{config:q,files:z,pairs:X,findings:Z}=$,H=[],Q=Z.filter((G)=>G.severity==="error").length,J=Z.filter((G)=>G.severity==="warning").length;if(H.push("pickled audit"),H.push(`Target: ${q.targetRepo}`),H.push(`Budgets: root \u2264 ${q.budgets.rootLines} lines, nested warn at ${q.budgets.nestedWarnLines} lines.`),H.push(`Found: ${z.length} agent-doc file(s) \xB7 ${Q} error(s) \xB7 ${J} warning(s)`),H.push(""),H.push("Inventory"),z.length===0)H.push(" none");else{let G=[...z].sort((L,_)=>_.lineCount-L.lineCount),T=Math.max(...G.map((L)=>L.relPath.length));for(let L of G){let _=!L.relPath.includes("/"),W=O4(L.lineCount,_,q),V=L.isSymlink?`symlink \u2192 ${L.symlinkTarget?.replace(`${q.targetRepo}/`,"")??"?"}`:"file",I=`${L.lineCount}`.padStart(4),R=L.relPath.padEnd(T),P=W?` (${W})`:"";H.push(` ${R} ${I} lines ${V}${P}`)}}if(H.push(""),H.push("AGENTS.md / CLAUDE.md pairs"),X.length===0)H.push(" none");else for(let G of X){let T=G.dir||"(root)";H.push(` ${T}: ${G.classification} \xB7 ${G.detail}`)}H.push("");let Y=z.filter((G)=>!G.isSymlink&&G.brokenPathRefs.length+G.brokenImports.length>0);if(H.push("Broken references"),Y.length===0)H.push(" none");else for(let G of Y){H.push(` ${G.relPath}:`);for(let T of G.brokenPathRefs)H.push(` path: ${T}`);for(let T of G.brokenImports)H.push(` @-import: ${T}`)}H.push("");let U=z.filter((G)=>!G.isSymlink&&G.unresolvedCommands.length>0);if(H.push("Unresolved package-manager commands (advisory)"),U.length===0)H.push(" none");else for(let G of U){H.push(` ${G.relPath}:`);for(let T of G.unresolvedCommands)H.push(` ${T}`)}H.push("");let B=z.filter((G)=>{if(G.isSymlink)return!1;return!G.relPath.includes("/")?G.lineCount>q.budgets.rootLines:G.lineCount>q.budgets.nestedWarnLines});if(H.push("Section breakdown for files over budget"),B.length===0)H.push(" all files within budget");else for(let G of B){H.push(` ${G.relPath} (${G.lineCount} lines):`);for(let T of G.sections.slice(0,10))H.push(` ${T.header.padEnd(40)} ${T.lines} lines`)}if(H.push(""),H.push("Registered-source trap matches"),$.sourceTrapMatches.length===0)H.push(" none");else for(let G of $.sourceTrapMatches){let T=G.severity==="error"?"error":"warning";H.push(` [${T}] ${G.sourceId} (${G.sourcePath}:L${G.line}): trap ${G.trapId} matched "${G.matched}"`),H.push(` reason: ${G.trapReason}`),H.push(" fix: remove the stale claim, retire the trap, or set audit.traps: false on the source")}return H.join(`
186
+ `)}function O4($,q,z){if(q&&$>z.budgets.rootLines)return`over root budget (${$} > ${z.budgets.rootLines})`;if(!q&&$>z.budgets.nestedWarnLines)return`over nested-warn (${$} > ${z.budgets.nestedWarnLines})`;return""}import{existsSync as j0,lstatSync as E4,readFileSync as qq,readlinkSync as QJ,statSync as JJ}from"fs";import{dirname as zq,isAbsolute as UJ,join as k1,relative as GJ,resolve as x1}from"path";var{Glob:N4}=globalThis.Bun;var e$=["node_modules/**","**/node_modules/**",".git/**","**/.git/**","dist/**","**/dist/**","build/**","**/build/**",".next/**","**/.next/**",".turbo/**","**/.turbo/**",".cache/**","**/.cache/**",".runs/**","**/.runs/**","coverage/**","**/coverage/**","**/__fixtures__/**","**/tests/**/fixture/**","**/tests/**/fixtures/**","**/test/**/fixture/**","**/test/**/fixtures/**"],A0={targetRepo:".",budgets:{rootLines:120,nestedWarnLines:200},ignore:e$,intentionalDifferentPairs:[],knownCommands:[]};function $q($){if(!$)return A0;return{targetRepo:$.targetRepo??A0.targetRepo,budgets:{rootLines:$.budgets?.rootLines??A0.budgets.rootLines,nestedWarnLines:$.budgets?.nestedWarnLines??A0.budgets.nestedWarnLines},ignore:$.ignore??e$,intentionalDifferentPairs:$.intentionalDifferentPairs??[],knownCommands:$.knownCommands??[]}}import{existsSync as XJ}from"fs";import{join as ZJ}from"path";function S0($){let q=[],z=[];for(let X of $.traps){let Z=e7($.response,X);if(Z)q.push(Z);else z.push(X.id)}return{fired:q,avoided:z}}function e7($,q){if(q.match!==void 0){let z=$.indexOf(q.match);if(z===-1)return null;return{id:q.id,reason:q.reason,matched:q.match,snippet:A4($,z,q.match.length),index:z}}if(q.pattern!==void 0){let X=new RegExp(q.pattern,q.flags??"").exec($);if(!X)return null;return{id:q.id,reason:q.reason,matched:X[0],snippet:A4($,X.index,X[0].length),index:X.index}}return null}function A4($,q,z){let X=Math.max(0,q-40),Z=Math.min($.length,q+z+40),H=$.slice(X,Z).replace(/\s+/g," ").trim();if(X>0)H=`...${H}`;if(Z<$.length)H=`${H}...`;return H}import f1 from"path";function $J($){return $.startsWith("http://")||$.startsWith("https://")}async function qJ($,q,z){let X=await fetch(q);if(!X.ok)throw Error(`Failed to fetch source "${$}" from ${q}: ${X.status} ${X.statusText}`);let Z=await X.text();return{id:$,source:q,content:Z,name:new URL(q).hostname+new URL(q).pathname,type:"url",auditTraps:z}}async function zJ($,q,z,X){let Z=f1.isAbsolute(q)?q:f1.resolve(z,q),H=Bun.file(Z);if(!await H.exists())throw Error(`Source "${$}" not found at ${Z}`);let Q=await H.text();return{id:$,source:q,content:Q,name:f1.basename(Z),type:"file",auditTraps:X}}async function S4($,q,z){let{path:X,auditTraps:Z}=y1(q);if($J(X))return qJ($,X,Z);return zJ($,X,z,Z)}async function X$($,q){let z=Object.entries($);return await Promise.all(z.map(([Z,H])=>S4(Z,H,q)))}async function j4($){if(!XJ(ZJ($,"pickled.yml")))return{matches:[],findings:[]};let q=await O0($),z=q.docs?.sources;if(!z||Object.keys(z).length===0)return{matches:[],findings:[]};let X={};for(let[U,B]of Object.entries(z)){let G=typeof B==="string"?B:B.path;if(G.startsWith("http://")||G.startsWith("https://"))continue;X[U]=B}if(Object.keys(X).length===0)return{matches:[],findings:[]};let Z=[],H=new Map;for(let U of q.scenarios)for(let B of U.traps??[])Z.push(B),H.set(B,B.auditSeverity??"warning");if(Z.length===0)return{matches:[],findings:[]};let Q=await X$(X,$),J=[],Y=[];for(let U of Q){if(U.auditTraps===!1)continue;for(let B of Z){let{fired:G}=S0({response:U.content,traps:[B]}),T=G[0];if(!T)continue;let L=HJ(U.content,T.index),_=H.get(B)??"warning";J.push({sourceId:U.id,sourcePath:U.source,trapId:T.id,trapReason:T.reason,matched:T.matched,snippet:T.snippet,line:L,severity:_}),Y.push({severity:_,category:"trap-source-match",file:U.source,message:`source [${U.id}] matches trap '${T.id}' ("${T.matched}"). ${T.reason} Fix: remove the stale claim from the source, retire the trap if no longer relevant, or set audit.traps: false on the source if it is deliberately stale or test-only.`})}}return{matches:J,findings:Y}}function HJ($,q){let z=1,X=Math.min(q,$.length);for(let Z=0;Z<X;Z++)if($[Z]===`
187
+ `)z++;return z}var YJ=["AGENTS.md","CLAUDE.md","CLAUDE.local.md","llms.txt","llms-full.txt",".claude/CLAUDE.md",".claude/rules/*.md","**/AGENTS.md","**/CLAUDE.md","**/CLAUDE.local.md","**/llms.txt","**/llms-full.txt","**/.claude/CLAUDE.md","**/.claude/rules/*.md"];async function Xq($){let q=$q($),z=x1(q.targetRepo);if(!j0(z))throw Error(`targetRepo does not exist: ${z}`);let X=new Set;for(let U of YJ){let B=new N4(U);for await(let G of B.scan({cwd:z,dot:!0,onlyFiles:!1,followSymlinks:!1})){if(q.ignore.some((_)=>new N4(_).match(G)))continue;let T=k1(z,G),L=E4(T);if(L.isFile()){X.add(G);continue}if(L.isSymbolicLink())try{if(JJ(T).isFile())X.add(G)}catch{}}}let Z=[];for(let U of[...X].sort())Z.push(await BJ(z,U,k1(z,U),q));let H=KJ(Z,q),Q=FJ(Z,H,q),{matches:J,findings:Y}=await j4(z);return{config:q,files:Z,pairs:H,findings:[...Q,...Y],sourceTrapMatches:J}}async function BJ($,q,z,X){let H=E4(z).isSymbolicLink(),Q=null,J=q;if(H){let T=QJ(z),L=UJ(T)?T:x1(zq(z),T);if(Q=L,j0(L))J=GJ($,L)}let Y=H&&Q&&j0(Q)?Q:z,U=qq(Y,"utf8"),B=(U.match(/\n/g)??[]).length,G=U.endsWith(`
188
+ `)?B:B+1;return{relPath:q,absPath:z,isSymlink:H,symlinkTarget:Q,realRelPath:J,lineCount:G,brokenPathRefs:WJ(U,$,q),brokenImports:VJ(U,zq(z)),unresolvedCommands:RJ(U,$,X.knownCommands),sections:wJ(U)}}function TJ($){let q=$.split("/");if(q.length<2)return null;if(q[0]==="packages"||q[0]==="apps"||q[0]==="shared")return`${q[0]}/${q[1]}`;if(q[0]==="tests")return q.slice(0,2).join("/");return null}function WJ($,q,z){let X=PJ($),Z=zq(z),H=TJ(z),Q=new Set,J=/`([^`\n]{2,200})`/g,Y;Y=J.exec(X);while(Y!==null){let U=Y[1].trim().replace(/[#?].*$/,"");if(MJ(U)&&!LJ(q,U,Z,H).found)Q.add(U);Y=J.exec(X)}return[...Q].sort()}function LJ($,q,z,X){let Z=[q];if(z&&z!==".")Z.push(`${z}/${q}`);if(X)Z.push(`${X}/${q}`);Z.push(`packages/${q}`,`apps/${q}`,`shared/${q}`);for(let H of Z){let Q=H.replace(/\/+/g,"/");if(j0(`${$}/${Q}`))return{found:!0,resolvedAs:Q}}return{found:!1}}function VJ($,q){let z=new Set,X=/@([\w./@~-]+\.md)/g,Z;Z=X.exec($);while(Z!==null){let H=Z[1];if(H.startsWith("~/")){Z=X.exec($);continue}let Q=H.startsWith("/")?H:x1(q,H);if(!j0(Q))z.add(H);Z=X.exec($)}return[...z].sort()}var _J=["bun","pnpm","npm","yarn"],DJ=new Set(["install","add","remove","update","i","audit","list","ls","why","outdated","exec","run","create","init","x"]),IJ={bun:new Set(["build","test","link","unlink","upgrade"])};function RJ($,q,z){let X=new Set,Z=k1(q,"package.json"),H=new Set;if(j0(Z))try{let J=JSON.parse(qq(Z,"utf8"));H=new Set(Object.keys(J.scripts??{}))}catch{}let Q=new Set(z.map((J)=>J.trim()));for(let J of _J){let Y=new RegExp(`\\b${J}\\s+(?:run\\s+|--filter\\s+\\S+\\s+(?:run\\s+)?)?([a-zA-Z][\\w:.\\-]*)`,"g"),U;U=Y.exec($);while(U!==null){let B=U[1];if(!H.has(B)&&!Q.has(`${J} ${B}`)&&!Q.has(`${J} run ${B}`)&&!DJ.has(B)&&!IJ[J]?.has(B))X.add(`${J} ${B}`);U=Y.exec($)}}return[...X].sort()}function wJ($){let q=$.split(`
189
+ `),z=[],X=null;if(q.forEach((Z,H)=>{if(/^##\s+/.test(Z)){if(X)z.push({header:X.header,lines:H-X.start});X={header:Z.replace(/^##\s+/,"").trim(),start:H}}}),X){let Z=X;z.push({header:Z.header,lines:q.length-Z.start})}return z.sort((Z,H)=>H.lines-Z.lines)}function MJ($){if($.length===0||$.length>160)return!1;if(!$.includes("/"))return!1;if(/\s/.test($))return!1;if(/^https?:\/\//.test($))return!1;if(/[*?{}[\]<>]/.test($))return!1;if($.startsWith("@"))return!1;if($.startsWith("~/"))return!1;if(/^[a-z]+:\/\//i.test($))return!1;if(/^cdn\./.test($)||/^unpkg\./.test($)||/^npm\./.test($))return!1;if(/^\/[a-z]/.test($)&&/(?:icon|image|img|asset|file|path)/i.test($))return!1;if(/^(cd|pnpm|npm|yarn|bun|node|git|ls|cat|grep|find|sed|awk|mkdir|rm|mv|cp|echo|export|source|sudo|brew|docker|curl|wget)\b/.test($))return!1;return/[a-zA-Z0-9_.-]\/[a-zA-Z0-9_.-]/.test($)}function PJ($){return $.replace(/```[\s\S]*?```/g,"")}function KJ($,q){let z=new Map;for(let H of $){let Q=H.relPath.split("/").pop()??"";if(Q!=="AGENTS.md"&&Q!=="CLAUDE.md")continue;let J=zq(H.relPath),Y=z.get(J)??{};if(Q==="AGENTS.md")Y.agents=H;if(Q==="CLAUDE.md")Y.claude=H;z.set(J,Y)}let X=new Set(q.intentionalDifferentPairs),Z=[];for(let[H,Q]of z){let J=!!Q.agents,Y=!!Q.claude;if(!J&&!Y)continue;if(!J||!Y){Z.push({dir:H,agentsExists:J,claudeExists:Y,classification:"single",detail:J?"only AGENTS.md":"only CLAUDE.md"});continue}let{agents:U,claude:B}=Q,G=`${U.relPath}:${B.relPath}`,T=`${B.relPath}:${U.relPath}`;if(X.has(G)||X.has(T)){Z.push({dir:H,agentsExists:J,claudeExists:Y,classification:"intentional-different",detail:`allowlisted: ${U.lineCount}L vs ${B.lineCount}L`});continue}if(U.isSymlink&&U.symlinkTarget===B.absPath||B.isSymlink&&B.symlinkTarget===U.absPath){let V=U.isSymlink?"CLAUDE.md":"AGENTS.md";Z.push({dir:H,agentsExists:J,claudeExists:Y,classification:"linked",detail:`canonical: ${V}`});continue}let _=qq(U.absPath,"utf8"),W=qq(B.absPath,"utf8");if(_===W)Z.push({dir:H,agentsExists:J,claudeExists:Y,classification:"unexpected-duplicate",detail:`byte-for-byte duplicate (${U.lineCount}L), not symlinked`});else Z.push({dir:H,agentsExists:J,claudeExists:Y,classification:"unexpected-duplicate",detail:`divergent (${U.lineCount}L vs ${B.lineCount}L), not in intentional-different allowlist`})}return Z.sort((H,Q)=>H.dir.localeCompare(Q.dir)),Z}function FJ($,q,z){let X=[];for(let Z of $){if(Z.isSymlink)continue;for(let J of Z.brokenImports)X.push({severity:"error",category:"broken-import",file:Z.relPath,message:`broken @-import: ${J}`});for(let J of Z.brokenPathRefs)X.push({severity:"error",category:"broken-path-ref",file:Z.relPath,message:`broken path reference: ${J}`});for(let J of Z.unresolvedCommands)X.push({severity:"warning",category:"unresolved-command",file:Z.relPath,message:`unresolved command: ${J}`});let H=!Z.relPath.includes("/"),Q=H?z.budgets.rootLines:z.budgets.nestedWarnLines;if(Z.lineCount>Q)X.push({severity:"warning",category:"over-budget",file:Z.relPath,message:`${Z.lineCount} lines exceeds ${H?"root":"nested"} budget of ${Q}`})}for(let Z of q)if(Z.classification==="unexpected-duplicate"){let H=Z.detail.startsWith("divergent")?"error":"warning";X.push({severity:H,category:H==="error"?"divergent-pair":"duplicate-pair",file:Z.dir||"(root)",message:`AGENTS.md / CLAUDE.md ${Z.detail}`})}return X}function Z$($){let q=$.confidence;if($.error)return{icon:"\u2717",label:"Error",confidence:q,tone:"error"};if($.traps.fired.length>0)return{icon:"\u2717",label:"Trap fired",confidence:q,tone:"error"};if($.answerable==="YES")return{icon:"\u2713",label:q>=90?"Well grounded":"Grounded",confidence:q,tone:"success"};if($.answerable==="PARTIAL")return{icon:"\u26A0",label:"Partially grounded",confidence:q,tone:"warning"};return{icon:"\u2717",label:"Ungrounded",confidence:q,tone:"error"}}function h1($){let q=OJ($);if(q===null)return[];let z=[],X=/^\s*-\s+\[([^\]]+)\]\s*(.*)$/gm,Z=X.exec(q);while(Z!==null)z.push({id:Z[1].trim(),note:Z[2].trim()||void 0}),Z=X.exec(q);return z}function OJ($){let z=/^##\s+Sources\s*$/im.exec($);if(!z)return null;let X=z.index+z[0].length,Z=$.slice(X),H=/^##\s+/m.exec(Z);return H?Z.slice(0,H.index):Z}function Zq($){let q=h1($.response),z=new Set(q.map((T)=>T.id)),X=new Set($.registeredIds),Z=new Set($.requiredSources),H=[...z],Q=[...Z].filter((T)=>!z.has(T)),J=[...z].filter((T)=>!X.has(T)),Y=[...Z],U,B,G;if(H.length===0)U="NO",B=0,G="No citations in response";else if(J.length===H.length)U="NO",B=0,G=`All cited sources are unknown: ${J.join(", ")}`;else if(Q.length===0&&J.length===0)U="YES",B=100,G=Y.length>0?`All required sources cited: ${Y.join(", ")}`:`Cited registered sources: ${H.join(", ")}`;else{U="PARTIAL";let T=Y.length>0?Y.length:1,L=Y.length-Q.length,_=Y.length>0?L/T*100:60,W=J.length*15;B=Math.max(0,Math.min(100,Math.round(_-W)));let V=[];if(Q.length>0)V.push(`missing: ${Q.join(", ")}`);if(J.length>0)V.push(`unknown: ${J.join(", ")}`);G=V.join("; ")}return{answerable:U,confidence:B,reason:G,citations:{cited:H,required:Y,missing:Q,unknown:J}}}import{query as AJ}from"@anthropic-ai/claude-agent-sdk";function Hq($,q,z){let X=q.length>0?q.map((Q)=>`- ${Q.id}: ${Q.name} (${Q.source})`).join(`
190
+ `):"(no sources provided)",Z=q.map((Q)=>`<source id="${Q.id}">
191
+ ${Q.content.trimEnd()}
189
192
  </source>`).join(`
190
193
 
191
- `),z=X.length>0?`The scenario REQUIRES citations from: ${X.join(", ")}.`:"No specific source is required, but every claim must cite a registered source.";return`You are answering a question about the tool "${q.name}": ${q.description}.
194
+ `),H=z.length>0?`The scenario REQUIRES citations from: ${z.join(", ")}.`:"No specific source is required, but every claim must cite a registered source.";return`You are answering a question about the tool "${$.name}": ${$.description}.
192
195
 
193
196
  Answer using ONLY information from the provided sources below. Do not draw on general knowledge.
194
197
 
195
198
  Available sources:
199
+ ${X}
200
+
196
201
  ${Z}
197
202
 
198
203
  ${H}
199
204
 
200
- ${z}
201
-
202
205
  End your response with a "## Sources" section that lists every source you actually used. Use this exact format:
203
206
 
204
207
  ## Sources
@@ -208,19 +211,19 @@ End your response with a "## Sources" section that lists every source you actual
208
211
  Rules:
209
212
  - Only cite IDs that appear in the inventory above. Do not invent IDs.
210
213
  - If you cannot answer from the provided sources, say so explicitly and write an empty "## Sources" section (just the heading, no bullets).
211
- - The "## Sources" heading must be the last heading in your response.`}class h1{category="cli";provider="claude-code";name;config;constructor(q,$){this.name=q,this.config=$}async run(q,$){let{tool:X,cwd:Z,context:H,docs:z,requiredSources:U}=$,Q=[],J=[],G=H$(X,z,U),Y={cwd:Z,model:this.config.model??"sonnet",systemPrompt:G,allowedTools:H?.allowedTools??this.config.allowedTools??D$,disallowedTools:H?.disallowedTools??this.config.disallowedTools??R$,permissionMode:this.config.permissionMode??"acceptEdits",maxTurns:this.config.maxTurns??10,maxThinkingTokens:this.config.maxThinkingTokens,maxBudgetUsd:this.config.maxBudgetUsd,mcpServers:H?.mcpServers??this.config.mcpServers,settingSources:[]},T=[],L="",_="";for await(let V of R7({prompt:q,options:Y})){if(V.type==="assistant"){let B=V.message?.content;if(Array.isArray(B)){let W="";for(let D of B){if(D.type==="text")W+=D.text;if(D.type==="tool_use"){let R=D;if(!Q.includes(R.name))Q.push(R.name)}}if(W){let D=T.length===0?"initial":"intermediate";T.push({type:D,text:W}),L=W}}}if(V.type==="result"){let B=V;if(B.result)_=B.result}}if(T.length>0)T[T.length-1].type="final";return{response:_||L,allResponses:T,toolsUsed:Q,sources:J,metadata:{model:this.config.model??"sonnet",category:this.category,provider:this.provider,target:this.name}}}}import{randomUUID as P7}from"crypto";import{rm as M7}from"fs/promises";import{tmpdir as K7}from"os";import{join as w7}from"path";var F7="codex";class g1{category="cli";provider="codex-cli";name;config;spawnFn;readFileFn;binary;constructor(q,$,X={}){this.name=q,this.config=$,this.spawnFn=X.spawn??j7,this.readFileFn=X.readFile??N7,this.binary=X.binary??F7}async run(q,$){let{tool:X,cwd:Z,docs:H,requiredSources:z}=$,U=this.config.model;if(!U)throw Error(`CodexCliTarget "${this.name}" requires an explicit model. Validation should have caught this at config load.`);let J=`${H$(X,H,z)}
214
+ - The "## Sources" heading must be the last heading in your response.`}class g1{category="cli";provider="claude-code";name;config;constructor($,q){this.name=$,this.config=q}async run($,q){let{tool:z,cwd:X,context:Z,docs:H,requiredSources:Q}=q,J=[],Y=[],U=Hq(z,H,Q),B={cwd:X,model:this.config.model??"sonnet",systemPrompt:U,allowedTools:Z?.allowedTools??this.config.allowedTools??Rq,disallowedTools:Z?.disallowedTools??this.config.disallowedTools??wq,permissionMode:this.config.permissionMode??"acceptEdits",maxTurns:this.config.maxTurns??10,maxThinkingTokens:this.config.maxThinkingTokens,maxBudgetUsd:this.config.maxBudgetUsd,mcpServers:Z?.mcpServers??this.config.mcpServers,settingSources:[]},G=[],T="",L="";for await(let _ of AJ({prompt:$,options:B})){if(_.type==="assistant"){let W=_.message?.content;if(Array.isArray(W)){let V="";for(let I of W){if(I.type==="text")V+=I.text;if(I.type==="tool_use"){let R=I;if(!J.includes(R.name))J.push(R.name)}}if(V){let I=G.length===0?"initial":"intermediate";G.push({type:I,text:V}),T=V}}}if(_.type==="result"){let W=_;if(W.result)L=W.result}}if(G.length>0)G[G.length-1].type="final";return{response:L||T,allResponses:G,toolsUsed:J,sources:Y,metadata:{model:this.config.model??"sonnet",category:this.category,provider:this.provider,target:this.name}}}}import{randomUUID as SJ}from"crypto";import{rm as jJ}from"fs/promises";import{tmpdir as NJ}from"os";import{join as EJ}from"path";var bJ="codex";class v1{category="cli";provider="codex-cli";name;config;spawnFn;readFileFn;binary;constructor($,q,z={}){this.name=$,this.config=q,this.spawnFn=z.spawn??kJ,this.readFileFn=z.readFile??xJ,this.binary=z.binary??bJ}async run($,q){let{tool:z,cwd:X,docs:Z,requiredSources:H}=q,Q=this.config.model;if(!Q)throw Error(`CodexCliTarget "${this.name}" requires an explicit model. Validation should have caught this at config load.`);let Y=`${Hq(z,Z,H)}
212
215
 
213
216
  ---
214
217
 
215
- ${q}`,G=w7(K7(),`pickled-codex-${P7()}.txt`),Y=["--ask-for-approval","never","exec","--json","--sandbox","read-only","--ignore-user-config","--ignore-rules","--ephemeral","--skip-git-repo-check","--cd",Z,"--model",U,"--output-last-message",G,"-"];try{let T=await this.spawnFn(this.binary,Y,{cwd:Z,stdin:J}),{allResponses:L,toolsUsed:_}=O7(T.stdout);if(T.exitCode!==0)throw Error(`codex exec failed (exit ${T.exitCode}): ${T.stderr.trim()||"no stderr output"}`);let V="";try{V=(await this.readFileFn(G)).trim()}catch{V=L.length>0?L[L.length-1].text:""}if(L.length>0)L[L.length-1].type="final";return{response:V,allResponses:L,toolsUsed:_,sources:[],metadata:{model:U,category:this.category,provider:this.provider,target:this.name}}}finally{await M7(G,{force:!0})}}}function O7(q){let $=[],X=[];for(let Z of q.split(`
216
- `)){let H=Z.trim();if(!H)continue;let z;try{z=JSON.parse(H)}catch{continue}let U=A7(z);if(U){let J=$.length===0?"initial":"intermediate";$.push({type:J,text:U})}let Q=S7(z);if(Q&&!X.includes(Q))X.push(Q)}return{allResponses:$,toolsUsed:X}}function A7(q){if(!q||typeof q!=="object")return null;let $=q;if(typeof $.message==="string")return $.message;if(typeof $.content==="string")return $.content;if(typeof $.type==="string"&&($.type==="assistant_message"||$.type==="agent_message")&&typeof $.text==="string")return $.text;if($.type==="message"&&typeof $.text==="string")return $.text;return null}function S7(q){if(!q||typeof q!=="object")return null;let $=q;if(typeof $.tool==="string")return $.tool;if(typeof $.type==="string"&&($.type==="tool_call"||$.type==="function_call")&&typeof $.name==="string")return $.name;return null}var j7=async(q,$,X)=>{let Z=Bun.spawn([q,...$],{cwd:X.cwd,stdin:"pipe",stdout:"pipe",stderr:"pipe"});Z.stdin.write(X.stdin),await Z.stdin.end();let[H,z,U]=await Promise.all([new Response(Z.stdout).text(),new Response(Z.stderr).text(),Z.exited]);return{exitCode:U,stdout:H,stderr:z}},N7=async(q)=>{let $=Bun.file(q);if(!await $.exists())throw Error(`Last-message file not found: ${q}`);return $.text()};function u1(q,$){let X=$??d;switch(X.category){case"cli":return E7(q,X);case"api":throw Error("API targets not yet implemented. Coming soon!");case"ide":throw Error("IDE targets not yet implemented. Coming soon!");default:throw Error(`Unknown target category: ${X.category}`)}}function E7(q,$){switch($.provider){case"claude-code":return new h1(q,$);case"codex-cli":return new g1(q,$);case"gemini-cli":throw Error("Gemini CLI target not yet implemented. Coming soon!");case"amazon-q":throw Error("Amazon Q target not yet implemented. Coming soon!");default:throw Error(`Unknown CLI provider: ${$.provider}`)}}var S0="default";function v1(q,$){if(!q||q===S0)return{name:S0,config:d};if($?.[q])return{name:q,config:$[q]};return console.warn(`Target "${q}" not found, using default`),{name:S0,config:d}}function N4(q,$){if(!q||q===S0)return{name:S0,config:{}};if($?.[q])return{name:q,config:$[q]};return console.warn(`Context "${q}" not found, using default`),{name:S0,config:{}}}function b7(q){let $=[],X=q.matrix?.target??["default"],Z=q.matrix?.context??["default"];for(let H of q.scenarios){let z=H.target?[H.target]:X,U=H.context?[H.context]:Z;for(let Q of z)for(let J of U)$.push({scenario:H,targetName:Q,contextName:J})}return $}async function m1(q,$,X={}){let{onProgress:Z}=X,H=[];if($.scenarios.length===0)throw Error("No scenarios defined in config");let z=$.docs?.sources??{},U=[];if(Object.keys(z).length>0){Z?.("Loading sources..."),U=await k1(z,q.path);for(let Y of U)Z?.(` [${Y.id}] ${Y.name}`);Z?.("")}let Q=U.map((Y)=>Y.id),J=b7($),G="";for(let{scenario:Y,targetName:T,contextName:L}of J){let _=C7(T,L);if(Y.name!==G){if(G)Z?.("");Z?.(`"${Y.name}"`),G=Y.name}try{let V=await y7(Y,T,L,q,$,U,Q,X);H.push(V);let B=_?_.padEnd(18):"",W=$q(V);Z?.(` ${B} ${W.icon} ${W.label} (${W.confidence}%)`)}catch(V){let B=T==="default"?d:$.targets?.[T]??d,W={scenario:Y,answerable:"NO",confidence:0,response:"",reason:"Error during run",citations:{cited:[],required:Y.requiredSources,missing:Y.requiredSources,unknown:[]},traps:{fired:[],avoided:(Y.traps??[]).map((R)=>R.id)},error:V instanceof Error?V.message:String(V),target:{target:T,category:B.category,provider:B.provider,model:B.model??"unknown"},context:{name:L}};H.push(W);let D=_?_.padEnd(18):"";Z?.(` ${D} \u2717 Error`)}}return Z?.(""),f7(q,U,H)}function C7(q,$){if(q==="default"&&$==="default")return"";if($==="default")return`[${q}]`;return`[${q}/${$}]`}async function y7(q,$,X,Z,H,z,U,Q){let{config:J}=v1($,H.targets),{config:G}=N4(X,H.contexts),T=await(Q.targetFactory?Q.targetFactory($,J):u1($,J)).run(q.prompt,{tool:Z,cwd:Z.path,context:G,docs:z,requiredSources:q.requiredSources,onProgress:Q.onProgress}),L=X$({response:T.response,requiredSources:q.requiredSources,registeredIds:U}),_=Z$({response:T.response,traps:q.traps??[]}),V=_.fired.length>0,B=V?"NO":L.answerable,W=V?0:L.confidence,D=V?`Trap fired: ${_.fired.map((R)=>`"${R.id}" (${R.reason})`).join("; ")}`:L.reason;return{scenario:q,answerable:B,confidence:W,response:T.response,reason:D,citations:L.citations,traps:_,target:T.metadata,context:{name:X},toolsUsed:T.toolsUsed,sources:T.sources,allResponses:T.allResponses}}function f7(q,$,X){let Z=X.length,H=X.filter((U)=>U.answerable==="YES"||U.answerable==="PARTIAL").length,z=Z>0?Math.round(X.reduce((U,Q)=>{if(Q.answerable==="YES")return U+Q.confidence;if(Q.answerable==="PARTIAL")return U+Q.confidence*0.5;return U},0)/Z):0;return{tool:{name:q.name,description:q.description,path:q.path},docs:$,scenarios:X,summary:{total:Z,answered:H,unanswered:Z-H,score:z}}}var E4=(q=0)=>($)=>`\x1B[${$+q}m`,b4=(q=0)=>($)=>`\x1B[${38+q};5;${$}m`,C4=(q=0)=>($,X,Z)=>`\x1B[${38+q};2;${$};${X};${Z}m`,N={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},mT=Object.keys(N.modifier),x7=Object.keys(N.color),k7=Object.keys(N.bgColor),dT=[...x7,...k7];function h7(){let q=new Map;for(let[$,X]of Object.entries(N)){for(let[Z,H]of Object.entries(X))N[Z]={open:`\x1B[${H[0]}m`,close:`\x1B[${H[1]}m`},X[Z]=N[Z],q.set(H[0],H[1]);Object.defineProperty(N,$,{value:X,enumerable:!1})}return Object.defineProperty(N,"codes",{value:q,enumerable:!1}),N.color.close="\x1B[39m",N.bgColor.close="\x1B[49m",N.color.ansi=E4(),N.color.ansi256=b4(),N.color.ansi16m=C4(),N.bgColor.ansi=E4(10),N.bgColor.ansi256=b4(10),N.bgColor.ansi16m=C4(10),Object.defineProperties(N,{rgbToAnsi256:{value($,X,Z){if($===X&&X===Z){if($<8)return 16;if($>248)return 231;return Math.round(($-8)/247*24)+232}return 16+36*Math.round($/255*5)+6*Math.round(X/255*5)+Math.round(Z/255*5)},enumerable:!1},hexToRgb:{value($){let X=/[a-f\d]{6}|[a-f\d]{3}/i.exec($.toString(16));if(!X)return[0,0,0];let[Z]=X;if(Z.length===3)Z=[...Z].map((z)=>z+z).join("");let H=Number.parseInt(Z,16);return[H>>16&255,H>>8&255,H&255]},enumerable:!1},hexToAnsi256:{value:($)=>N.rgbToAnsi256(...N.hexToRgb($)),enumerable:!1},ansi256ToAnsi:{value($){if($<8)return 30+$;if($<16)return 90+($-8);let X,Z,H;if($>=232)X=(($-232)*10+8)/255,Z=X,H=X;else{$-=16;let Q=$%36;X=Math.floor($/36)/5,Z=Math.floor(Q/6)/5,H=Q%6/5}let z=Math.max(X,Z,H)*2;if(z===0)return 30;let U=30+(Math.round(H)<<2|Math.round(Z)<<1|Math.round(X));if(z===2)U+=60;return U},enumerable:!1},rgbToAnsi:{value:($,X,Z)=>N.ansi256ToAnsi(N.rgbToAnsi256($,X,Z)),enumerable:!1},hexToAnsi:{value:($)=>N.ansi256ToAnsi(N.hexToAnsi256($)),enumerable:!1}}),N}var g7=h7(),m=g7;import d1 from"process";import u7 from"os";import y4 from"tty";function g(q,$=globalThis.Deno?globalThis.Deno.args:d1.argv){let X=q.startsWith("-")?"":q.length===1?"-":"--",Z=$.indexOf(X+q),H=$.indexOf("--");return Z!==-1&&(H===-1||Z<H)}var{env:E}=d1,z$;if(g("no-color")||g("no-colors")||g("color=false")||g("color=never"))z$=0;else if(g("color")||g("colors")||g("color=true")||g("color=always"))z$=1;function v7(){if("FORCE_COLOR"in E){if(E.FORCE_COLOR==="true")return 1;if(E.FORCE_COLOR==="false")return 0;return E.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(E.FORCE_COLOR,10),3)}}function m7(q){if(q===0)return!1;return{level:q,hasBasic:!0,has256:q>=2,has16m:q>=3}}function d7(q,{streamIsTTY:$,sniffFlags:X=!0}={}){let Z=v7();if(Z!==void 0)z$=Z;let H=X?z$:Z;if(H===0)return 0;if(X){if(g("color=16m")||g("color=full")||g("color=truecolor"))return 3;if(g("color=256"))return 2}if("TF_BUILD"in E&&"AGENT_NAME"in E)return 1;if(q&&!$&&H===void 0)return 0;let z=H||0;if(E.TERM==="dumb")return z;if(d1.platform==="win32"){let U=u7.release().split(".");if(Number(U[0])>=10&&Number(U[2])>=10586)return Number(U[2])>=14931?3:2;return 1}if("CI"in E){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((U)=>(U in E)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((U)=>(U in E))||E.CI_NAME==="codeship")return 1;return z}if("TEAMCITY_VERSION"in E)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(E.TEAMCITY_VERSION)?1:0;if(E.COLORTERM==="truecolor")return 3;if(E.TERM==="xterm-kitty")return 3;if(E.TERM==="xterm-ghostty")return 3;if(E.TERM==="wezterm")return 3;if("TERM_PROGRAM"in E){let U=Number.parseInt((E.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(E.TERM_PROGRAM){case"iTerm.app":return U>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(E.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(E.TERM))return 1;if("COLORTERM"in E)return 1;return z}function f4(q,$={}){let X=d7(q,{streamIsTTY:q&&q.isTTY,...$});return m7(X)}var p7={stdout:f4({isTTY:y4.isatty(1)}),stderr:f4({isTTY:y4.isatty(2)})},x4=p7;function k4(q,$,X){let Z=q.indexOf($);if(Z===-1)return q;let H=$.length,z=0,U="";do U+=q.slice(z,Z)+$+X,z=Z+H,Z=q.indexOf($,z);while(Z!==-1);return U+=q.slice(z),U}function h4(q,$,X,Z){let H=0,z="";do{let U=q[Z-1]==="\r";z+=q.slice(H,U?Z-1:Z)+$+(U?`\r
218
+ ${$}`,U=EJ(NJ(),`pickled-codex-${SJ()}.txt`),B=["--ask-for-approval","never","exec","--json","--sandbox","read-only","--ignore-user-config","--ignore-rules","--ephemeral","--skip-git-repo-check","--cd",X,"--model",Q,"--output-last-message",U,"-"];try{let G=await this.spawnFn(this.binary,B,{cwd:X,stdin:Y}),{allResponses:T,toolsUsed:L}=CJ(G.stdout);if(G.exitCode!==0)throw Error(`codex exec failed (exit ${G.exitCode}): ${G.stderr.trim()||"no stderr output"}`);let _="";try{_=(await this.readFileFn(U)).trim()}catch{_=T.length>0?T[T.length-1].text:""}if(T.length>0)T[T.length-1].type="final";return{response:_,allResponses:T,toolsUsed:L,sources:[],metadata:{model:Q,category:this.category,provider:this.provider,target:this.name}}}finally{await jJ(U,{force:!0})}}}function CJ($){let q=[],z=[];for(let X of $.split(`
219
+ `)){let Z=X.trim();if(!Z)continue;let H;try{H=JSON.parse(Z)}catch{continue}let Q=yJ(H);if(Q){let Y=q.length===0?"initial":"intermediate";q.push({type:Y,text:Q})}let J=fJ(H);if(J&&!z.includes(J))z.push(J)}return{allResponses:q,toolsUsed:z}}function yJ($){if(!$||typeof $!=="object")return null;let q=$;if(typeof q.message==="string")return q.message;if(typeof q.content==="string")return q.content;if(typeof q.type==="string"&&(q.type==="assistant_message"||q.type==="agent_message")&&typeof q.text==="string")return q.text;if(q.type==="message"&&typeof q.text==="string")return q.text;return null}function fJ($){if(!$||typeof $!=="object")return null;let q=$;if(typeof q.tool==="string")return q.tool;if(typeof q.type==="string"&&(q.type==="tool_call"||q.type==="function_call")&&typeof q.name==="string")return q.name;return null}var kJ=async($,q,z)=>{let X=Bun.spawn([$,...q],{cwd:z.cwd,stdin:"pipe",stdout:"pipe",stderr:"pipe"});X.stdin.write(z.stdin),await X.stdin.end();let[Z,H,Q]=await Promise.all([new Response(X.stdout).text(),new Response(X.stderr).text(),X.exited]);return{exitCode:Q,stdout:Z,stderr:H}},xJ=async($)=>{let q=Bun.file($);if(!await q.exists())throw Error(`Last-message file not found: ${$}`);return q.text()};function u1($,q){let z=q??d;switch(z.category){case"cli":return hJ($,z);case"api":throw Error("API targets not yet implemented. Coming soon!");case"ide":throw Error("IDE targets not yet implemented. Coming soon!");default:throw Error(`Unknown target category: ${z.category}`)}}function hJ($,q){switch(q.provider){case"claude-code":return new g1($,q);case"codex-cli":return new v1($,q);case"gemini-cli":throw Error("Gemini CLI target not yet implemented. Coming soon!");case"amazon-q":throw Error("Amazon Q target not yet implemented. Coming soon!");default:throw Error(`Unknown CLI provider: ${q.provider}`)}}var N0="default";function m1($,q){if(!$||$===N0)return{name:N0,config:d};if(q?.[$])return{name:$,config:q[$]};return console.warn(`Target "${$}" not found, using default`),{name:N0,config:d}}function b4($,q){if(!$||$===N0)return{name:N0,config:{}};if(q?.[$])return{name:$,config:q[$]};return console.warn(`Context "${$}" not found, using default`),{name:N0,config:{}}}function gJ($){let q=[],z=$.matrix?.target??["default"],X=$.matrix?.context??["default"];for(let Z of $.scenarios){let H=Z.target?[Z.target]:z,Q=Z.context?[Z.context]:X;for(let J of H)for(let Y of Q)q.push({scenario:Z,targetName:J,contextName:Y})}return q}async function d1($,q,z={}){let{onProgress:X}=z,Z=[];if(q.scenarios.length===0)throw Error("No scenarios defined in config");let H=q.docs?.sources??{},Q=[];if(Object.keys(H).length>0){X?.("Loading sources..."),Q=await X$(H,$.path);for(let B of Q)X?.(` [${B.id}] ${B.name}`);X?.("")}let J=Q.map((B)=>B.id),Y=gJ(q),U="";for(let{scenario:B,targetName:G,contextName:T}of Y){let L=vJ(G,T);if(B.name!==U){if(U)X?.("");X?.(`"${B.name}"`),U=B.name}try{let _=await uJ(B,G,T,$,q,Q,J,z);Z.push(_);let W=L?L.padEnd(18):"",V=Z$(_);X?.(` ${W} ${V.icon} ${V.label} (${V.confidence}%)`)}catch(_){let W=G==="default"?d:q.targets?.[G]??d,V={scenario:B,answerable:"NO",confidence:0,response:"",reason:"Error during run",citations:{cited:[],required:B.requiredSources,missing:B.requiredSources,unknown:[]},traps:{fired:[],avoided:(B.traps??[]).map((R)=>R.id)},error:_ instanceof Error?_.message:String(_),target:{target:G,category:W.category,provider:W.provider,model:W.model??"unknown"},context:{name:T}};Z.push(V);let I=L?L.padEnd(18):"";X?.(` ${I} \u2717 Error`)}}return X?.(""),mJ($,Q,Z)}function vJ($,q){if($==="default"&&q==="default")return"";if(q==="default")return`[${$}]`;return`[${$}/${q}]`}async function uJ($,q,z,X,Z,H,Q,J){let{config:Y}=m1(q,Z.targets),{config:U}=b4(z,Z.contexts),G=await(J.targetFactory?J.targetFactory(q,Y):u1(q,Y)).run($.prompt,{tool:X,cwd:X.path,context:U,docs:H,requiredSources:$.requiredSources,onProgress:J.onProgress}),T=Zq({response:G.response,requiredSources:$.requiredSources,registeredIds:Q}),L=S0({response:G.response,traps:$.traps??[]}),_=L.fired.length>0,W=_?"NO":T.answerable,V=_?0:T.confidence,I=_?`Trap fired: ${L.fired.map((R)=>`"${R.id}" (${R.reason})`).join("; ")}`:T.reason;return{scenario:$,answerable:W,confidence:V,response:G.response,reason:I,citations:T.citations,traps:L,target:G.metadata,context:{name:z},toolsUsed:G.toolsUsed,sources:G.sources,allResponses:G.allResponses}}function mJ($,q,z){let X=z.length,Z=z.filter((Q)=>Q.answerable==="YES"||Q.answerable==="PARTIAL").length,H=X>0?Math.round(z.reduce((Q,J)=>{if(J.answerable==="YES")return Q+J.confidence;if(J.answerable==="PARTIAL")return Q+J.confidence*0.5;return Q},0)/X):0;return{tool:{name:$.name,description:$.description,path:$.path},docs:q,scenarios:z,summary:{total:X,answered:Z,unanswered:X-Z,score:H}}}var C4=($=0)=>(q)=>`\x1B[${q+$}m`,y4=($=0)=>(q)=>`\x1B[${38+$};5;${q}m`,f4=($=0)=>(q,z,X)=>`\x1B[${38+$};2;${q};${z};${X}m`,N={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},ZB=Object.keys(N.modifier),dJ=Object.keys(N.color),pJ=Object.keys(N.bgColor),HB=[...dJ,...pJ];function lJ(){let $=new Map;for(let[q,z]of Object.entries(N)){for(let[X,Z]of Object.entries(z))N[X]={open:`\x1B[${Z[0]}m`,close:`\x1B[${Z[1]}m`},z[X]=N[X],$.set(Z[0],Z[1]);Object.defineProperty(N,q,{value:z,enumerable:!1})}return Object.defineProperty(N,"codes",{value:$,enumerable:!1}),N.color.close="\x1B[39m",N.bgColor.close="\x1B[49m",N.color.ansi=C4(),N.color.ansi256=y4(),N.color.ansi16m=f4(),N.bgColor.ansi=C4(10),N.bgColor.ansi256=y4(10),N.bgColor.ansi16m=f4(10),Object.defineProperties(N,{rgbToAnsi256:{value(q,z,X){if(q===z&&z===X){if(q<8)return 16;if(q>248)return 231;return Math.round((q-8)/247*24)+232}return 16+36*Math.round(q/255*5)+6*Math.round(z/255*5)+Math.round(X/255*5)},enumerable:!1},hexToRgb:{value(q){let z=/[a-f\d]{6}|[a-f\d]{3}/i.exec(q.toString(16));if(!z)return[0,0,0];let[X]=z;if(X.length===3)X=[...X].map((H)=>H+H).join("");let Z=Number.parseInt(X,16);return[Z>>16&255,Z>>8&255,Z&255]},enumerable:!1},hexToAnsi256:{value:(q)=>N.rgbToAnsi256(...N.hexToRgb(q)),enumerable:!1},ansi256ToAnsi:{value(q){if(q<8)return 30+q;if(q<16)return 90+(q-8);let z,X,Z;if(q>=232)z=((q-232)*10+8)/255,X=z,Z=z;else{q-=16;let J=q%36;z=Math.floor(q/36)/5,X=Math.floor(J/6)/5,Z=J%6/5}let H=Math.max(z,X,Z)*2;if(H===0)return 30;let Q=30+(Math.round(Z)<<2|Math.round(X)<<1|Math.round(z));if(H===2)Q+=60;return Q},enumerable:!1},rgbToAnsi:{value:(q,z,X)=>N.ansi256ToAnsi(N.rgbToAnsi256(q,z,X)),enumerable:!1},hexToAnsi:{value:(q)=>N.ansi256ToAnsi(N.hexToAnsi256(q)),enumerable:!1}}),N}var cJ=lJ(),m=cJ;import p1 from"process";import iJ from"os";import k4 from"tty";function g($,q=globalThis.Deno?globalThis.Deno.args:p1.argv){let z=$.startsWith("-")?"":$.length===1?"-":"--",X=q.indexOf(z+$),Z=q.indexOf("--");return X!==-1&&(Z===-1||X<Z)}var{env:E}=p1,Qq;if(g("no-color")||g("no-colors")||g("color=false")||g("color=never"))Qq=0;else if(g("color")||g("colors")||g("color=true")||g("color=always"))Qq=1;function aJ(){if("FORCE_COLOR"in E){if(E.FORCE_COLOR==="true")return 1;if(E.FORCE_COLOR==="false")return 0;return E.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(E.FORCE_COLOR,10),3)}}function sJ($){if($===0)return!1;return{level:$,hasBasic:!0,has256:$>=2,has16m:$>=3}}function rJ($,{streamIsTTY:q,sniffFlags:z=!0}={}){let X=aJ();if(X!==void 0)Qq=X;let Z=z?Qq:X;if(Z===0)return 0;if(z){if(g("color=16m")||g("color=full")||g("color=truecolor"))return 3;if(g("color=256"))return 2}if("TF_BUILD"in E&&"AGENT_NAME"in E)return 1;if($&&!q&&Z===void 0)return 0;let H=Z||0;if(E.TERM==="dumb")return H;if(p1.platform==="win32"){let Q=iJ.release().split(".");if(Number(Q[0])>=10&&Number(Q[2])>=10586)return Number(Q[2])>=14931?3:2;return 1}if("CI"in E){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((Q)=>(Q in E)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((Q)=>(Q in E))||E.CI_NAME==="codeship")return 1;return H}if("TEAMCITY_VERSION"in E)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(E.TEAMCITY_VERSION)?1:0;if(E.COLORTERM==="truecolor")return 3;if(E.TERM==="xterm-kitty")return 3;if(E.TERM==="xterm-ghostty")return 3;if(E.TERM==="wezterm")return 3;if("TERM_PROGRAM"in E){let Q=Number.parseInt((E.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(E.TERM_PROGRAM){case"iTerm.app":return Q>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(E.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(E.TERM))return 1;if("COLORTERM"in E)return 1;return H}function x4($,q={}){let z=rJ($,{streamIsTTY:$&&$.isTTY,...q});return sJ(z)}var nJ={stdout:x4({isTTY:k4.isatty(1)}),stderr:x4({isTTY:k4.isatty(2)})},h4=nJ;function g4($,q,z){let X=$.indexOf(q);if(X===-1)return $;let Z=q.length,H=0,Q="";do Q+=$.slice(H,X)+q+z,H=X+Z,X=$.indexOf(q,H);while(X!==-1);return Q+=$.slice(H),Q}function v4($,q,z,X){let Z=0,H="";do{let Q=$[X-1]==="\r";H+=$.slice(Z,Q?X-1:X)+q+(Q?`\r
217
220
  `:`
218
- `)+X,H=Z+1,Z=q.indexOf(`
219
- `,H)}while(Z!==-1);return z+=q.slice(H),z}var{stdout:g4,stderr:u4}=x4,p1=Symbol("GENERATOR"),j0=Symbol("STYLER"),Xq=Symbol("IS_EMPTY"),v4=["ansi","ansi","ansi256","ansi16m"],N0=Object.create(null),l7=(q,$={})=>{if($.level&&!(Number.isInteger($.level)&&$.level>=0&&$.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let X=g4?g4.level:0;q.level=$.level===void 0?X:$.level};var c7=(q)=>{let $=(...X)=>X.join(" ");return l7($,q),Object.setPrototypeOf($,Zq.prototype),$};function Zq(q){return c7(q)}Object.setPrototypeOf(Zq.prototype,Function.prototype);for(let[q,$]of Object.entries(m))N0[q]={get(){let X=U$(this,c1($.open,$.close,this[j0]),this[Xq]);return Object.defineProperty(this,q,{value:X}),X}};N0.visible={get(){let q=U$(this,this[j0],!0);return Object.defineProperty(this,"visible",{value:q}),q}};var l1=(q,$,X,...Z)=>{if(q==="rgb"){if($==="ansi16m")return m[X].ansi16m(...Z);if($==="ansi256")return m[X].ansi256(m.rgbToAnsi256(...Z));return m[X].ansi(m.rgbToAnsi(...Z))}if(q==="hex")return l1("rgb",$,X,...m.hexToRgb(...Z));return m[X][q](...Z)},i7=["rgb","hex","ansi256"];for(let q of i7){N0[q]={get(){let{level:X}=this;return function(...Z){let H=c1(l1(q,v4[X],"color",...Z),m.color.close,this[j0]);return U$(this,H,this[Xq])}}};let $="bg"+q[0].toUpperCase()+q.slice(1);N0[$]={get(){let{level:X}=this;return function(...Z){let H=c1(l1(q,v4[X],"bgColor",...Z),m.bgColor.close,this[j0]);return U$(this,H,this[Xq])}}}}var a7=Object.defineProperties(()=>{},{...N0,level:{enumerable:!0,get(){return this[p1].level},set(q){this[p1].level=q}}}),c1=(q,$,X)=>{let Z,H;if(X===void 0)Z=q,H=$;else Z=X.openAll+q,H=$+X.closeAll;return{open:q,close:$,openAll:Z,closeAll:H,parent:X}},U$=(q,$,X)=>{let Z=(...H)=>s7(Z,H.length===1?""+H[0]:H.join(" "));return Object.setPrototypeOf(Z,a7),Z[p1]=q,Z[j0]=$,Z[Xq]=X,Z},s7=(q,$)=>{if(q.level<=0||!$)return q[Xq]?"":$;let X=q[j0];if(X===void 0)return $;let{openAll:Z,closeAll:H}=X;if($.includes("\x1B"))while(X!==void 0)$=k4($,X.close,X.open),X=X.parent;let z=$.indexOf(`
220
- `);if(z!==-1)$=h4($,H,Z,z);return Z+$+H};Object.defineProperties(Zq.prototype,N0);var r7=Zq(),tT=Zq({level:u4?u4.level:0});var M=r7;var m4="\u2500".repeat(55);function n7(q){if(q==="success")return M.green;if(q==="warning")return M.yellow;return M.red}function o7(q){if(q>=70)return M.green;if(q>=50)return M.yellow;return M.red}function t7(q){if(q.label==="Error")return q.label;return`${q.label} (${q.confidence}%)`}function e7(q){let $=$q(q),X=n7($.tone);return{icon:X($.icon),status:t7($),color:X}}function qG(q){let $=q.target?.target??"default",X=q.context?.name??"default";if($==="default"&&X==="default")return"";if(X==="default")return M.dim(`[${$}]`);return M.dim(`[${$}/${X}]`)}function $G(q){let $=q.map((X)=>X.scenario.name);return new Set($).size!==$.length}function Q$(q){return q.map(($)=>`[${$}]`).join(", ")}function d4(q,$){let X=[];if(q.error)return X.push(M.dim(`${$}error: ${q.error}`)),X;if(q.traps.fired.length>0)for(let Z of q.traps.fired)X.push(M.red(`${$}trap: ${Z.id}`)),X.push(M.dim(`${$}reason: ${Z.reason}`)),X.push(M.dim(`${$}match: "${Z.matched}"`));else if(q.reason&&q.answerable!=="YES")X.push(M.dim(`${$}reason: ${q.reason}`));if(q.citations.cited.length>0)X.push(M.dim(`${$}cited: ${Q$(q.citations.cited)}`));if(q.citations.missing.length>0)X.push(M.dim(`${$}missing: ${Q$(q.citations.missing)}`));if(q.citations.unknown.length>0)X.push(M.dim(`${$}unknown: ${Q$(q.citations.unknown)}`));return X}function p4(q){let{icon:$,status:X,color:Z}=e7(q),H=qG(q),z=`${$} ${X}`;return H?`${H} ${Z(z)}`:Z(z)}function XG(q){let $=q.reduce((H,z)=>{return H+z.traps.fired.length},0),X=q.reduce((H,z)=>{return H+z.citations.missing.length},0),Z=q.reduce((H,z)=>{return H+z.citations.unknown.length},0);if($>0&&X+Z>0)return"Review fired traps and citation gaps.";if($>0)return"Review fired traps before trusting this surface.";if(X+Z>0)return"Review missing and unknown citations.";return"Citations hold. No declared traps fired."}function ZG(q,$){let X=q.summary.score,H=`Overall: ${o7(X)(`${X}`)} / 100`;if($===void 0||$<=0)return H;let U=X>=$?M.green("run passes"):M.red("run fails");return`${H} \xB7 threshold ${$} \xB7 ${U}`}function l4(q,$={}){let{tool:X,scenarios:Z,summary:H}=q,z=Z,U=[];if(U.push(M.bold("pickled check")),U.push(m4),U.push(`Tool: ${M.cyan(X.name)}`),q.docs.length>0)U.push(`Sources: ${M.dim(Q$(q.docs.map((Q)=>Q.id)))}`);else U.push(`Sources: ${M.dim("none registered")}`);if(U.push(`Scenarios: ${M.dim(String(H.total))}`),U.push(""),$G(z)){let Q=new Map;for(let J of z){let G=J.scenario.name;if(!Q.has(G))Q.set(G,[]);Q.get(G)?.push(J)}for(let[J,G]of Q){U.push(`Scenario: ${J}`);for(let Y of G)U.push(` ${p4(Y)}`),U.push(...d4(Y," "));U.push("")}}else for(let Q of z)U.push(`Scenario: ${Q.scenario.name}`),U.push(` ${p4(Q)}`),U.push(...d4(Q," ")),U.push("");return U.push(m4),U.push(ZG(q,$.threshold)),U.push(M.dim(XG(Z))),U.join(`
221
- `)}function i1(q,$={}){console.log(l4(q,$)),console.log()}function G$(q,$={}){if($.verbose)return JSON.stringify(q,null,2);let X={...q,docs:q.docs.map((Z)=>({...Z,content:""})),scenarios:q.scenarios.map((Z)=>{let{allResponses:H,...z}=Z;return z})};return JSON.stringify(X,null,2)}function zG(q){if(q.format&&q.format!=="terminal")return q.format;if(q.json)return"json";return q.format??"terminal"}async function c4(q,$){let{output:X}=$,Z=zG($),H=HG.resolve(q),z;try{z=await $$({targetRepo:H})}catch(T){console.error(M.red(T instanceof Error?T.message:T)),process.exit(1)}let U;if(Z==="json")U=rq(z);else if(Z==="markdown")U=sq(z);else U=nq(z);if(X)await Bun.write(X,U);else await UG(`${U}
222
- `);let Q=z.findings.filter((T)=>T.severity==="error").length,J=z.findings.filter((T)=>T.severity==="warning").length;if(Z!=="json"&&!X)if(console.log(),Q===0&&J===0)console.log(M.green("Audit clean. No issues found."));else{let T=Q>0?M.red:M.yellow;console.log(T(`Audit found ${Q} error(s), ${J} warning(s).`))}if(($.failOn??"error")==="warning"?Q+J>0:Q>0)process.exit(1)}function UG(q){return new Promise(($,X)=>{process.stdout.write(q,(Z)=>{if(Z)X(Z);else $()})})}import QG from"path";async function i4(q,$){let{json:X,output:Z,verbose:H}=$,z=(L)=>!X&&console.log(L),U=QG.resolve(q),Q;try{Q=await aq(U)}catch(L){console.error(M.red(L instanceof Error?L.message:L)),console.error(),console.error(M.dim("Run `pickled init` to create a config file")),process.exit(1)}if($.target){let L=Q.scenarios.length;try{Q=b1(Q,$.target)}catch(V){console.error(M.red(V instanceof Error?V.message:String(V))),process.exit(1)}let _=L-Q.scenarios.length;if(_>0&&!X)z(M.dim(`Skipping ${_} scenario(s) with explicit target != "${$.target}"`))}let J={name:Q.tool.name,description:Q.tool.description,path:U};if(H){z(M.bold("pickled check")),z(""),z(M.dim(` Tool: ${J.name}`)),z(M.dim(` Scenarios: ${Q.scenarios.length}`));for(let L of Q.scenarios)z(M.dim(` - ${L.name}`))}let G=await m1(J,Q,{onProgress:H?(L)=>{if(!X)z(M.dim(` ${L}`))}:void 0}),Y=$.threshold?parseInt($.threshold,10):Q.threshold??0,T=Y>0&&G.summary.score<Y;if(Z)await Bun.write(Z,G$(G,{verbose:H}));else if(X)await GG(`${G$(G,{verbose:H})}
223
- `);else i1(G,{threshold:Y});if(T){if(X||Z)console.error(M.red(`Overall: ${G.summary.score} / 100 \xB7 threshold ${Y} \xB7 run fails`)),console.error(M.dim("Review failed scenarios before trusting this surface."));process.exit(1)}}function GG(q){return new Promise(($,X)=>{process.stdout.write(q,(Z)=>{if(Z)X(Z);else $()})})}import JG from"path";var TG=`# pickled.yml - Agent legibility check for your product
221
+ `)+z,Z=X+1,X=$.indexOf(`
222
+ `,Z)}while(X!==-1);return H+=$.slice(Z),H}var{stdout:u4,stderr:m4}=h4,l1=Symbol("GENERATOR"),E0=Symbol("STYLER"),H$=Symbol("IS_EMPTY"),d4=["ansi","ansi","ansi256","ansi16m"],b0=Object.create(null),oJ=($,q={})=>{if(q.level&&!(Number.isInteger(q.level)&&q.level>=0&&q.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let z=u4?u4.level:0;$.level=q.level===void 0?z:q.level};var tJ=($)=>{let q=(...z)=>z.join(" ");return oJ(q,$),Object.setPrototypeOf(q,Q$.prototype),q};function Q$($){return tJ($)}Object.setPrototypeOf(Q$.prototype,Function.prototype);for(let[$,q]of Object.entries(m))b0[$]={get(){let z=Jq(this,i1(q.open,q.close,this[E0]),this[H$]);return Object.defineProperty(this,$,{value:z}),z}};b0.visible={get(){let $=Jq(this,this[E0],!0);return Object.defineProperty(this,"visible",{value:$}),$}};var c1=($,q,z,...X)=>{if($==="rgb"){if(q==="ansi16m")return m[z].ansi16m(...X);if(q==="ansi256")return m[z].ansi256(m.rgbToAnsi256(...X));return m[z].ansi(m.rgbToAnsi(...X))}if($==="hex")return c1("rgb",q,z,...m.hexToRgb(...X));return m[z][$](...X)},eJ=["rgb","hex","ansi256"];for(let $ of eJ){b0[$]={get(){let{level:z}=this;return function(...X){let Z=i1(c1($,d4[z],"color",...X),m.color.close,this[E0]);return Jq(this,Z,this[H$])}}};let q="bg"+$[0].toUpperCase()+$.slice(1);b0[q]={get(){let{level:z}=this;return function(...X){let Z=i1(c1($,d4[z],"bgColor",...X),m.bgColor.close,this[E0]);return Jq(this,Z,this[H$])}}}}var $U=Object.defineProperties(()=>{},{...b0,level:{enumerable:!0,get(){return this[l1].level},set($){this[l1].level=$}}}),i1=($,q,z)=>{let X,Z;if(z===void 0)X=$,Z=q;else X=z.openAll+$,Z=q+z.closeAll;return{open:$,close:q,openAll:X,closeAll:Z,parent:z}},Jq=($,q,z)=>{let X=(...Z)=>qU(X,Z.length===1?""+Z[0]:Z.join(" "));return Object.setPrototypeOf(X,$U),X[l1]=$,X[E0]=q,X[H$]=z,X},qU=($,q)=>{if($.level<=0||!q)return $[H$]?"":q;let z=$[E0];if(z===void 0)return q;let{openAll:X,closeAll:Z}=z;if(q.includes("\x1B"))while(z!==void 0)q=g4(q,z.close,z.open),z=z.parent;let H=q.indexOf(`
223
+ `);if(H!==-1)q=v4(q,Z,X,H);return X+q+Z};Object.defineProperties(Q$.prototype,b0);var zU=Q$(),VB=Q$({level:m4?m4.level:0});var M=zU;var p4="\u2500".repeat(55);function XU($){if($==="success")return M.green;if($==="warning")return M.yellow;return M.red}function ZU($){if($>=70)return M.green;if($>=50)return M.yellow;return M.red}function HU($){if($.label==="Error")return $.label;return`${$.label} (${$.confidence}%)`}function QU($){let q=Z$($),z=XU(q.tone);return{icon:z(q.icon),status:HU(q),color:z}}function JU($){let q=$.target?.target??"default",z=$.context?.name??"default";if(q==="default"&&z==="default")return"";if(z==="default")return M.dim(`[${q}]`);return M.dim(`[${q}/${z}]`)}function UU($){let q=$.map((z)=>z.scenario.name);return new Set(q).size!==q.length}function Uq($){return $.map((q)=>`[${q}]`).join(", ")}function l4($,q){let z=[];if($.error)return z.push(M.dim(`${q}error: ${$.error}`)),z;if($.traps.fired.length>0)for(let X of $.traps.fired)z.push(M.red(`${q}trap: ${X.id}`)),z.push(M.dim(`${q}reason: ${X.reason}`)),z.push(M.dim(`${q}match: "${X.matched}"`));else if($.reason&&$.answerable!=="YES")z.push(M.dim(`${q}reason: ${$.reason}`));if($.citations.cited.length>0)z.push(M.dim(`${q}cited: ${Uq($.citations.cited)}`));if($.citations.missing.length>0)z.push(M.dim(`${q}missing: ${Uq($.citations.missing)}`));if($.citations.unknown.length>0)z.push(M.dim(`${q}unknown: ${Uq($.citations.unknown)}`));return z}function c4($){let{icon:q,status:z,color:X}=QU($),Z=JU($),H=`${q} ${z}`;return Z?`${Z} ${X(H)}`:X(H)}function GU($){let q=$.reduce((Z,H)=>{return Z+H.traps.fired.length},0),z=$.reduce((Z,H)=>{return Z+H.citations.missing.length},0),X=$.reduce((Z,H)=>{return Z+H.citations.unknown.length},0);if(q>0&&z+X>0)return"Review fired traps and citation gaps.";if(q>0)return"Review fired traps before trusting this surface.";if(z+X>0)return"Review missing and unknown citations.";return"Citations hold. No declared traps fired."}function YU($,q){let z=$.summary.score,Z=`Overall: ${ZU(z)(`${z}`)} / 100`;if(q===void 0||q<=0)return Z;let Q=z>=q?M.green("run passes"):M.red("run fails");return`${Z} \xB7 threshold ${q} \xB7 ${Q}`}function i4($,q={}){let{tool:z,scenarios:X,summary:Z}=$,H=X,Q=[];if(Q.push(M.bold("pickled check")),Q.push(p4),Q.push(`Tool: ${M.cyan(z.name)}`),$.docs.length>0)Q.push(`Sources: ${M.dim(Uq($.docs.map((J)=>J.id)))}`);else Q.push(`Sources: ${M.dim("none registered")}`);if(Q.push(`Scenarios: ${M.dim(String(Z.total))}`),Q.push(""),UU(H)){let J=new Map;for(let Y of H){let U=Y.scenario.name;if(!J.has(U))J.set(U,[]);J.get(U)?.push(Y)}for(let[Y,U]of J){Q.push(`Scenario: ${Y}`);for(let B of U)Q.push(` ${c4(B)}`),Q.push(...l4(B," "));Q.push("")}}else for(let J of H)Q.push(`Scenario: ${J.scenario.name}`),Q.push(` ${c4(J)}`),Q.push(...l4(J," ")),Q.push("");return Q.push(p4),Q.push(YU($,q.threshold)),Q.push(M.dim(GU(X))),Q.join(`
224
+ `)}function a1($,q={}){console.log(i4($,q)),console.log()}function Gq($,q={}){if(q.verbose)return JSON.stringify($,null,2);let z={...$,docs:$.docs.map((X)=>({...X,content:""})),scenarios:$.scenarios.map((X)=>{let{allResponses:Z,...H}=X;return H})};return JSON.stringify(z,null,2)}function TU($){if($.format&&$.format!=="terminal")return $.format;if($.json)return"json";return $.format??"terminal"}async function a4($,q){let{output:z}=q,X=TU(q),Z=BU.resolve($),H;try{H=await Xq({targetRepo:Z})}catch(G){console.error(M.red(G instanceof Error?G.message:G)),process.exit(1)}let Q;if(X==="json")Q=o$(H);else if(X==="markdown")Q=n$(H);else Q=t$(H);if(z)await Bun.write(z,Q);else await WU(`${Q}
225
+ `);let J=H.findings.filter((G)=>G.severity==="error").length,Y=H.findings.filter((G)=>G.severity==="warning").length;if(X!=="json"&&!z)if(console.log(),J===0&&Y===0)console.log(M.green("Audit clean. No issues found."));else{let G=J>0?M.red:M.yellow;console.log(G(`Audit found ${J} error(s), ${Y} warning(s).`))}if((q.failOn??"error")==="warning"?J+Y>0:J>0)process.exit(1)}function WU($){return new Promise((q,z)=>{process.stdout.write($,(X)=>{if(X)z(X);else q()})})}import LU from"path";async function s4($,q){let{json:z,output:X,verbose:Z}=q,H=(T)=>!z&&console.log(T),Q=LU.resolve($),J;try{J=await O0(Q)}catch(T){console.error(M.red(T instanceof Error?T.message:T)),console.error(),console.error(M.dim("Run `pickled init` to create a config file")),process.exit(1)}if(q.target){let T=J.scenarios.length;try{J=C1(J,q.target)}catch(_){console.error(M.red(_ instanceof Error?_.message:String(_))),process.exit(1)}let L=T-J.scenarios.length;if(L>0&&!z)H(M.dim(`Skipping ${L} scenario(s) with explicit target != "${q.target}"`))}let Y={name:J.tool.name,description:J.tool.description,path:Q};if(Z){H(M.bold("pickled check")),H(""),H(M.dim(` Tool: ${Y.name}`)),H(M.dim(` Scenarios: ${J.scenarios.length}`));for(let T of J.scenarios)H(M.dim(` - ${T.name}`))}let U=await d1(Y,J,{onProgress:Z?(T)=>{if(!z)H(M.dim(` ${T}`))}:void 0}),B=q.threshold?parseInt(q.threshold,10):J.threshold??0,G=B>0&&U.summary.score<B;if(X)await Bun.write(X,Gq(U,{verbose:Z}));else if(z)await VU(`${Gq(U,{verbose:Z})}
226
+ `);else a1(U,{threshold:B});if(G){if(z||X)console.error(M.red(`Overall: ${U.summary.score} / 100 \xB7 threshold ${B} \xB7 run fails`)),console.error(M.dim("Review failed scenarios before trusting this surface."));process.exit(1)}}function VU($){return new Promise((q,z)=>{process.stdout.write($,(X)=>{if(X)z(X);else q()})})}import _U from"path";var DU=`# pickled.yml - Agent legibility check for your product
224
227
 
225
228
  tool:
226
229
  name: "your-product"
@@ -242,4 +245,4 @@ scenarios:
242
245
 
243
246
  # Optional: fail CI if score falls below threshold
244
247
  # threshold: 80
245
- `;async function a4(q){let X=`${JG.resolve(q)}/pickled.yml`;if(await Bun.file(X).exists())console.error(M.red("pickled.yml already exists")),process.exit(1);await Bun.write(X,TG),console.log(M.green("Created pickled.yml")),console.log(),console.log(M.dim("Next steps:")),console.log(M.dim(" 1. Edit pickled.yml: list your sources and scenarios")),console.log(M.dim(" 2. Run: pickled check")),console.log()}B0.name("pickled").description("Test what agents actually understand about your product").version(B2.version);B0.command("init").description("Create a pickled.yml config file").argument("[path]","Path to your project (default: current directory)",".").action(a4);B0.command("audit").description("Static scan of agent-context files (CLAUDE.md, AGENTS.md, llms.txt). No LLM calls.").argument("[path]","Path to your project (default: current directory)",".").addOption(new I$("--format <name>","Output format").choices(["terminal","markdown","json"]).default("terminal")).option("--json","Shorthand for --format json").option("-o, --output <file>","Save report to file").addOption(new I$("--fail-on <level>","Exit non-zero on this severity or higher").choices(["error","warning"]).default("error")).action(c4);B0.command("check").description("Run agent scenarios against registered sources").argument("[path]","Path to your project (default: current directory)",".").option("--json","Output as JSON").option("-o, --output <file>","Save report to file").option("-v, --verbose","Show detailed progress").option("-t, --threshold <percent>","Minimum score % to pass (overrides config)").option("--target <name>","Run only the named target (overrides matrix.target)").action(i4);await B0.parseAsync();
248
+ `;async function r4($){let z=`${_U.resolve($)}/pickled.yml`;if(await Bun.file(z).exists())console.error(M.red("pickled.yml already exists")),process.exit(1);await Bun.write(z,DU),console.log(M.green("Created pickled.yml")),console.log(),console.log(M.dim("Next steps:")),console.log(M.dim(" 1. Edit pickled.yml: list your sources and scenarios")),console.log(M.dim(" 2. Run: pickled check")),console.log()}W0.name("pickled").description("Test what agents actually understand about your product").version(L2.version);W0.command("init").description("Create a pickled.yml config file").argument("[path]","Path to your project (default: current directory)",".").action(r4);W0.command("audit").description("Static scan of agent-context files (CLAUDE.md, AGENTS.md, llms.txt). No LLM calls.").argument("[path]","Path to your project (default: current directory)",".").addOption(new Iq("--format <name>","Output format").choices(["terminal","markdown","json"]).default("terminal")).option("--json","Shorthand for --format json").option("-o, --output <file>","Save report to file").addOption(new Iq("--fail-on <level>","Exit non-zero on this severity or higher").choices(["error","warning"]).default("error")).action(a4);W0.command("check").description("Run agent scenarios against registered sources").argument("[path]","Path to your project (default: current directory)",".").option("--json","Output as JSON").option("-o, --output <file>","Save report to file").option("-v, --verbose","Show detailed progress").option("-t, --threshold <percent>","Minimum score % to pass (overrides config)").option("--target <name>","Run only the named target (overrides matrix.target)").action(s4);await W0.parseAsync();