@pickled-dev/cli 0.11.0 → 0.12.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 +138 -138
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,192 +1,192 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun
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,`
3
+ var z5=Object.create;var{getPrototypeOf:X5,defineProperty:n1,getOwnPropertyNames:Z5}=Object;var H5=Object.prototype.hasOwnProperty;function Q5($){return this[$]}var J5,U5,o1=($,q,z)=>{var X=$!=null&&typeof $==="object";if(X){var Z=q?J5??=new WeakMap:U5??=new WeakMap,H=Z.get($);if(H)return H}z=$!=null?z5(X5($)):{};let Q=q||!$||!$.__esModule?n1(z,"default",{value:$,enumerable:!0}):z;for(let J of Z5($))if(!H5.call(Q,J))n1(Q,J,{get:Q5.bind($,J),enumerable:!0});if(X)Z.set($,Q);return Q};var I=($,q)=>()=>(q||$((q={exports:{}}).exports,q),q.exports);var a=import.meta.require;var f0=I((G5)=>{class Wq 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 t1 extends Wq{constructor($){super(1,"commander.invalidArgument",$);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}G5.CommanderError=Wq;G5.InvalidArgumentError=t1});var Y$=I((L5)=>{var{InvalidArgumentError:W5}=f0();class e1{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 W5(`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 T5($){let q=$.name()+($.variadic===!0?"...":"");return $.required?"<"+q+">":"["+q+"]"}L5.Argument=e1;L5.humanReadableArgName=T5});var Tq=I((D5)=>{var{humanReadableArgName:I5}=Y$();class $2{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)=>I5(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,Y){return q.formatItem(B,z,Y,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,Y)=>{let W=B.map((L)=>{return Z(q.styleOptionTerm(q.optionTerm(L)),q.styleOptionDescription(q.optionDescription(L)))});H=H.concat(this.formatItemList(Y,W,q))}),q.showGlobalOptions){let B=q.visibleGlobalOptions($).map((Y)=>{return Z(q.styleOptionTerm(q.optionTerm(Y)),q.styleOptionDescription(q.optionDescription(Y)))});H=H.concat(this.formatItemList("Global Options:",B,q))}return this.groupItems($.commands,q.visibleCommands($),(B)=>B.helpGroup()||"Commands:").forEach((B,Y)=>{let W=B.map((L)=>{return Z(q.styleSubcommandTerm(q.subcommandTerm(L)),q.styleSubcommandDescription(q.subcommandDescription(L)))});H=H.concat(this.formatItemList(Y,W,q))}),H.join(`
4
+ `)}displayWidth($){return q2($).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
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}
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()],G=this.displayWidth(J[0]);Q.forEach((U)=>{let B=this.displayWidth(U);if(G+B<=q){J.push(U),G+=B;return}Z.push(J.join(""));let Y=U.trimStart();J=[Y],G=this.displayWidth(Y)}),Z.push(J.join(""))}),Z.join(`
7
+ `)}}function q2($){let q=/\x1b\[\d*(;\d*)*m/g;return $.replace(q,"")}D5.Help=$2;D5.stripColor=q2});var Lq=I((K5)=>{var{InvalidArgumentError:w5}=f0();class X2{constructor($,q){this.flags=$,this.description=q||"",this.required=$.includes("<"),this.optional=$.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test($),this.mandatory=!1;let z=P5($);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 w5(`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 z2(this.name().replace(/^no-/,""));return z2(this.name())}helpGroup($){return this.helpGroupHeading=$,this}is($){return this.short===$||this.long===$}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class Z2{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 z2($){return $.split("-").reduce((q,z)=>{return q+z[0].toUpperCase()+z.slice(1)})}function P5($){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
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
11
  - too many short flags`);if(Z.test(Q))throw Error(`${J}
12
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`
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}}K5.Option=X2;K5.DualOptions=Z2});var H2=I((S5)=>{function A5($,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 j5($,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=A5($,Q),G=Math.max($.length,Q.length);if((G-J)/G>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
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
15
+ (Did you mean ${X[0]}?)`;return""}S5.suggestSimilar=j5});var G2=I((x5)=>{var E5=a("events").EventEmitter,Vq=a("child_process"),s=a("path"),B$=a("fs"),j=a("process"),{Argument:b5,humanReadableArgName:C5}=Y$(),{CommanderError:_q}=f0(),{Help:y5,stripColor:f5}=Tq(),{Option:Q2,DualOptions:k5}=Lq(),{suggestSimilar:J2}=H2();class Dq extends E5{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)=>j.stdout.write(q),writeErr:(q)=>j.stderr.write(q),outputError:(q,z)=>z(q),getOutHelpWidth:()=>j.stdout.isTTY?j.stdout.columns:void 0,getErrHelpWidth:()=>j.stderr.isTTY?j.stderr.columns:void 0,getOutHasColors:()=>Iq()??(j.stdout.isTTY&&j.stdout.hasColors?.()),getErrHasColors:()=>Iq()??(j.stderr.isTTY&&j.stderr.hasColors?.()),stripColor:(q)=>f5(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 Dq($)}createHelp(){return Object.assign(new y5,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 b5($,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 _q($,q,z));j.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 Q2($,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 Q2)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,G)=>{let U=Q.exec(J);return U?U[0]:G},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(j.versions?.electron)q.from="electron";let X=j.execArgv??[];if(X.includes("-e")||X.includes("--eval")||X.includes("-p")||X.includes("--print"))q.from="eval"}if($===void 0)$=j.argv;this.rawArgs=$.slice();let z;switch(q.from){case void 0:case"node":this._scriptPath=$[1],z=$.slice(2);break;case"electron":if(j.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(B$.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
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
- - ${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(`${$}
22
+ - ${X}`;throw Error(Z)}_executeSubCommand($,q){q=q.slice();let z=!1,X=[".js",".ts",".tsx",".mjs",".cjs"];function Z(U,B){let Y=s.resolve(U,B);if(B$.existsSync(Y))return Y;if(X.includes(s.extname(B)))return;let W=X.find((L)=>B$.existsSync(`${Y}${L}`));if(W)return`${Y}${W}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let H=$._executableFile||`${this._name}-${$._name}`,Q=this._executableDir||"";if(this._scriptPath){let U;try{U=B$.realpathSync(this._scriptPath)}catch{U=this._scriptPath}Q=s.resolve(s.dirname(U),Q)}if(Q){let U=Z(Q,H);if(!U&&!$._executableFile&&this._scriptPath){let B=s.basename(this._scriptPath,s.extname(this._scriptPath));if(B!==this._name)U=Z(Q,`${B}-${$._name}`)}H=U||H}z=X.includes(s.extname(H));let J;if(j.platform!=="win32")if(z)q.unshift(H),q=U2(j.execArgv).concat(q),J=Vq.spawn(j.argv[0],q,{stdio:"inherit"});else J=Vq.spawn(H,q,{stdio:"inherit"});else this._checkForMissingExecutable(H,Q,$._name),q.unshift(H),q=U2(j.execArgv).concat(q),J=Vq.spawn(j.execPath,q,{stdio:"inherit"});if(!J.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((B)=>{j.on(B,()=>{if(J.killed===!1&&J.exitCode===null)J.kill(B)})});let G=this._exitCallback;J.on("close",(U)=>{if(U=U??1,!G)j.exit(U);else G(new _q(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(!G)j.exit(1);else{let B=new _q(1,"commander.executeSubCommandAsync","(error)");B.nestedError=U,G(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((Y)=>Y.short).some((Y)=>/^-\d$/.test(Y)))},Q=null,J=null,G=0;while(G<$.length||J){let U=J??$[G++];if(J=null,U==="--"){if(X===z)X.push(U);X.push(...$.slice(G));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 Y=$[G++];if(Y===void 0)this.optionMissingArgument(B);this.emit(`option:${B.name()}`,Y)}else if(B.optional){let Y=null;if(G<$.length&&(!Z($[G])||H($[G])))Y=$[G++];this.emit(`option:${B.name()}`,Y)}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("="),Y=this._findOption(U.slice(0,B));if(Y&&(Y.required||Y.optional)){this.emit(`option:${Y.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(G));break}else if(this._getHelpCommand()&&U===this._getHelpCommand().name()){q.push(U,...$.slice(G));break}else if(this._defaultCommandName){z.push(U,...$.slice(G));break}}if(this._passThroughOptions){X.push(U,...$.slice(G));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 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.
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 j.env){let q=$.attributeName();if(this.getOptionValue(q)===void 0||["default","config","env"].includes(this.getOptionValueSource(q)))if($.required||$.optional)this.emit(`optionEnv:${$.name()}`,j.env[$.envVar]);else this.emit(`optionEnv:${$.name()}`)}})}_parseOptionsImplied(){let $=new k5(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),G=this.options.find((B)=>B.negate&&Q===B.attributeName()),U=this.options.find((B)=>!B.negate&&Q===B.attributeName());if(G&&(G.presetArg===void 0&&J===!1||G.presetArg!==void 0&&J===G.presetArg))return G;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=J2($,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=J2($,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 C5(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=s.basename($,s.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(j.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
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(`
28
+ `)}),this}_outputHelpIfRequested($){let q=this._getHelpOption();if(q&&$.find((X)=>q.is(X)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function U2($){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 Iq(){if(j.env.NO_COLOR||j.env.FORCE_COLOR==="0"||j.env.FORCE_COLOR==="false")return!1;if(j.env.FORCE_COLOR||j.env.CLICOLOR_FORCE!==void 0)return!0;return}x5.Command=Dq;x5.useColor=Iq});var T2=I((m5)=>{var{Argument:Y2}=Y$(),{Command:Rq}=G2(),{CommanderError:v5,InvalidArgumentError:B2}=f0(),{Help:u5}=Tq(),{Option:W2}=Lq();m5.program=new Rq;m5.createCommand=($)=>new Rq($);m5.createOption=($,q)=>new W2($,q);m5.createArgument=($,q)=>new Y2($,q);m5.Command=Rq;m5.Option=W2;m5.Argument=Y2;m5.Help=u5;m5.CommanderError=v5;m5.InvalidArgumentError=B2;m5.InvalidOptionArgumentError=B2});var A=I((Jz)=>{var Kq=Symbol.for("yaml.alias"),_2=Symbol.for("yaml.document"),W$=Symbol.for("yaml.map"),I2=Symbol.for("yaml.pair"),Oq=Symbol.for("yaml.scalar"),T$=Symbol.for("yaml.seq"),r=Symbol.for("yaml.node.type"),$z=($)=>!!$&&typeof $==="object"&&$[r]===Kq,qz=($)=>!!$&&typeof $==="object"&&$[r]===_2,zz=($)=>!!$&&typeof $==="object"&&$[r]===W$,Xz=($)=>!!$&&typeof $==="object"&&$[r]===I2,D2=($)=>!!$&&typeof $==="object"&&$[r]===Oq,Zz=($)=>!!$&&typeof $==="object"&&$[r]===T$;function R2($){if($&&typeof $==="object")switch($[r]){case W$:case T$:return!0}return!1}function Hz($){if($&&typeof $==="object")switch($[r]){case Kq:case W$:case Oq:case T$:return!0}return!1}var Qz=($)=>(D2($)||R2($))&&!!$.anchor;Jz.ALIAS=Kq;Jz.DOC=_2;Jz.MAP=W$;Jz.NODE_TYPE=r;Jz.PAIR=I2;Jz.SCALAR=Oq;Jz.SEQ=T$;Jz.hasAnchor=Qz;Jz.isAlias=$z;Jz.isCollection=R2;Jz.isDocument=qz;Jz.isMap=zz;Jz.isNode=Hz;Jz.isPair=Xz;Jz.isScalar=D2;Jz.isSeq=Zz});var k0=I((Oz)=>{var f=A(),k=Symbol("break visit"),M2=Symbol("skip children"),c=Symbol("remove node");function L$($,q){let z=w2(q);if(f.isDocument($)){if(I0(null,$.contents,z,Object.freeze([$]))===c)$.contents=null}else I0(null,$,z,Object.freeze([]))}L$.BREAK=k;L$.SKIP=M2;L$.REMOVE=c;function I0($,q,z,X){let Z=P2($,q,z,X);if(f.isNode(Z)||f.isPair(Z))return K2($,X,Z),I0($,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=I0(H,q.items[H],z,X);if(typeof Q==="number")H=Q-1;else if(Q===k)return k;else if(Q===c)q.items.splice(H,1),H-=1}}else if(f.isPair(q)){X=Object.freeze(X.concat(q));let H=I0("key",q.key,z,X);if(H===k)return k;else if(H===c)q.key=null;let Q=I0("value",q.value,z,X);if(Q===k)return k;else if(Q===c)q.value=null}}return Z}async function V$($,q){let z=w2(q);if(f.isDocument($)){if(await D0(null,$.contents,z,Object.freeze([$]))===c)$.contents=null}else await D0(null,$,z,Object.freeze([]))}V$.BREAK=k;V$.SKIP=M2;V$.REMOVE=c;async function D0($,q,z,X){let Z=await P2($,q,z,X);if(f.isNode(Z)||f.isPair(Z))return K2($,X,Z),D0($,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 D0(H,q.items[H],z,X);if(typeof Q==="number")H=Q-1;else if(Q===k)return k;else if(Q===c)q.items.splice(H,1),H-=1}}else if(f.isPair(q)){X=Object.freeze(X.concat(q));let H=await D0("key",q.key,z,X);if(H===k)return k;else if(H===c)q.key=null;let Q=await D0("value",q.value,z,X);if(Q===k)return k;else if(Q===c)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 P2($,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 K2($,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`)}}Oz.visit=L$;Oz.visitAsync=V$});var Fq=I((Ez)=>{var O2=A(),jz=k0(),Sz={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Nz=($)=>$.replace(/[!,[\]{}]/g,(q)=>Sz[q]);class h{constructor($,q){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},h.defaultYaml,$),this.tags=Object.assign({},h.defaultTags,q)}clone(){let $=new h(this.yaml,this.tags);return $.docStart=this.docStart,$}atDocument(){let $=new h(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:h.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},h.defaultTags);break}return $}add($,q){if(this.atNextDocument)this.yaml={explicit:h.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},h.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+Nz($.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&&O2.isNode($.contents)){let Z={};jz.visit($.contents,(H,Q)=>{if(O2.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
+ `)}}h.defaultYaml={explicit:!1,version:"1.2"};h.defaultTags={"!!":"tag:yaml.org,2002:"};Ez.Directives=h});var _$=I((kz)=>{var F2=A(),Cz=k0();function yz($){if(/[\x00-\x19\s,[\]{}]/.test($)){let z=`Anchor must not contain whitespace or control characters: ${JSON.stringify($)}`;throw Error(z)}return!0}function A2($){let q=new Set;return Cz.visit($,{Value(z,X){if(X.anchor)q.add(X.anchor)}}),q}function j2($,q){for(let z=1;;++z){let X=`${$}${z}`;if(!q.has(X))return X}}function fz($,q){let z=[],X=new Map,Z=null;return{onAnchor:(H)=>{z.push(H),Z??(Z=A2($));let Q=j2(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}}kz.anchorIsValid=yz;kz.anchorNames=A2;kz.createNodeAnchors=fz;kz.findNewAnchor=j2});var Aq=I((uz)=>{function x0($,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=x0($,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=x0($,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=x0($,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=x0($,X,Z,H);if(Q===void 0)delete X[Z];else if(Q!==H)X[Z]=Q}return $.call(q,z,X)}uz.applyReviver=x0});var o=I((pz)=>{var dz=A();function S2($,q,z){if(Array.isArray($))return $.map((X,Z)=>S2(X,String(Z),z));if($&&typeof $.toJSON==="function"){if(!z||!dz.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 $}pz.toJS=S2});var I$=I((az)=>{var cz=Aq(),N2=A(),iz=o();class E2{constructor($){Object.defineProperty(this,N2.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(!N2.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=iz.toJS(this,"",H);if(typeof X==="function")for(let{count:J,res:G}of H.anchors.values())X(G,J);return typeof Z==="function"?cz.applyReviver(Z,{"":Q},"",Q):Q}}az.NodeBase=E2});var h0=I((ez)=>{var rz=_$(),nz=k0(),R0=A(),oz=I$(),tz=o();class b2 extends oz.NodeBase{constructor($){super(R0.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=[],nz.visit($,{Node:(Z,H)=>{if(R0.isAlias(H)||R0.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)tz.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=D$(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(rz.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 D$($,q,z){if(R0.isAlias(q)){let X=q.resolve($),Z=z&&X&&z.get(X);return Z?Z.count*Z.aliasCount:0}else if(R0.isCollection(q)){let X=0;for(let Z of q.items){let H=D$($,Z,z);if(H>X)X=H}return X}else if(R0.isPair(q)){let X=D$($,q.key,z),Z=D$($,q.value,z);return Math.max(X,Z)}return 1}ez.Alias=b2});var y=I((HX)=>{var qX=A(),zX=I$(),XX=o(),ZX=($)=>!$||typeof $!=="function"&&typeof $!=="object";class Q0 extends zX.NodeBase{constructor($){super(qX.SCALAR);this.value=$}toJSON($,q){return q?.keep?this.value:XX.toJS(this.value,$,q)}toString(){return String(this.value)}}Q0.BLOCK_FOLDED="BLOCK_FOLDED";Q0.BLOCK_LITERAL="BLOCK_LITERAL";Q0.PLAIN="PLAIN";Q0.QUOTE_DOUBLE="QUOTE_DOUBLE";Q0.QUOTE_SINGLE="QUOTE_SINGLE";HX.Scalar=Q0;HX.isScalarValue=ZX});var g0=I((WX)=>{var UX=h0(),J0=A(),C2=y(),GX="tag:yaml.org,2002:";function YX($,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 BX($,q,z){if(J0.isDocument($))$=$.contents;if(J0.isNode($))return $;if(J0.isPair($)){let Y=z.schema[J0.MAP].createNode?.(z.schema,null,z);return Y.items.push($),Y}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,G=void 0;if(X&&$&&typeof $==="object")if(G=J.get($),G)return G.anchor??(G.anchor=Z($)),new UX.Alias(G.anchor);else G={anchor:null,node:null},J.set($,G);if(q?.startsWith("!!"))q=GX+q.slice(2);let U=YX($,q,Q.tags);if(!U){if($&&typeof $.toJSON==="function")$=$.toJSON();if(!$||typeof $!=="object"){let Y=new C2.Scalar($);if(G)G.node=Y;return Y}U=$ instanceof Map?Q[J0.MAP]:(Symbol.iterator in Object($))?Q[J0.SEQ]:Q[J0.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 C2.Scalar($);if(q)B.tag=q;else if(!U.default)B.tag=U.tag;if(G)G.node=B;return B}WX.createNode=BX});var R$=I((_X)=>{var LX=g0(),i=A(),VX=I$();function jq($,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 LX.createNode(X,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:$,sourceObjects:new Map})}var y2=($)=>$==null||typeof $==="object"&&!!$[Symbol.iterator]().next().done;class f2 extends VX.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)=>i.isNode(z)||i.isPair(z)?z.clone($):z),this.range)q.range=this.range.slice();return q}addIn($,q){if(y2($))this.add(q);else{let[z,...X]=$,Z=this.get(z,!0);if(i.isCollection(Z))Z.addIn(X,q);else if(Z===void 0&&this.schema)this.set(z,jq(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(i.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&&i.isScalar(Z)?Z.value:Z;else return i.isCollection(Z)?Z.getIn(X,q):void 0}hasAllNullValues($){return this.items.every((q)=>{if(!i.isPair(q))return!1;let z=q.value;return z==null||$&&i.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 i.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(i.isCollection(Z))Z.setIn(X,q);else if(Z===void 0&&this.schema)this.set(z,jq(this.schema,X,q));else throw Error(`Expected YAML collection at ${z}. Remaining path: ${X}`)}}}_X.Collection=f2;_X.collectionFromPath=jq;_X.isEmptyPath=y2});var v0=I((PX)=>{var MX=($)=>$.replace(/^(?!$)(?: $)?/gm,"#");function Sq($,q){if(/^\n+$/.test($))return $.substring(1);return q?$.replace(/^(?! *$)/gm,q):$}var wX=($,q,z)=>$.endsWith(`
30
+ `)?Sq(z,q):z.includes(`
31
31
  `)?`
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(`(^|(?<!
32
+ `+Sq(z,q):($.endsWith(" ")?"":" ")+z;PX.indentComment=Sq;PX.lineComment=wX;PX.stringifyComment=MX});var x2=I((jX)=>{function AX($,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 G=Math.max(1+H,1+Z-q.length);if($.length<=G)return $;let U=[],B={},Y=Z-q.length;if(typeof X==="number")if(X>Z-Math.max(2,H))U.push(0);else Y=Z-X;let W=void 0,L=void 0,_=!1,T=-1,V=-1,D=-1;if(z==="block"){if(T=k2($,T,q.length),T!==-1)Y=T+G}for(let w;w=$[T+=1];){if(z==="quoted"&&w==="\\"){switch(V=T,$[T+1]){case"x":T+=3;break;case"u":T+=5;break;case"U":T+=9;break;default:T+=1}D=T}if(w===`
33
+ `){if(z==="block")T=k2($,T,q.length);Y=T+q.length+G,W=void 0}else{if(w===" "&&L&&L!==" "&&L!==`
34
+ `&&L!=="\t"){let K=$[T+1];if(K&&K!==" "&&K!==`
35
+ `&&K!=="\t")W=T}if(T>=Y)if(W)U.push(W),Y=W+G,W=void 0;else if(z==="quoted"){while(L===" "||L==="\t")L=w,w=$[T+=1],_=!0;let K=T>D+1?T-2:V-1;if(B[K])return $;U.push(K),B[K]=!0,Y=K+G,W=void 0}else _=!0}L=w}if(_&&J)J();if(U.length===0)return $;if(Q)Q();let R=$.slice(0,U[0]);for(let w=0;w<U.length;++w){let K=U[w],O=U[w+1]||$.length;if(K===0)R=`
36
+ ${q}${$.slice(0,O)}`;else{if(z==="quoted"&&B[K])R+=`${$[K]}\\`;R+=`
37
+ ${q}${$.slice(K+1,O)}`}}return R}function k2($,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}jX.FOLD_BLOCK="block";jX.FOLD_FLOW="flow";jX.FOLD_QUOTED="quoted";jX.foldFlowLines=AX});var m0=I((kX)=>{var u=y(),t=x2(),w$=($,q)=>({indentAtStart:q?$.indent.length:$.indentAtStart,lineWidth:$.options.lineWidth,minContentWidth:$.options.minContentWidth}),P$=($)=>/^(%|---|\.\.\.)/m.test($);function CX($,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 u0($,q){let z=JSON.stringify($);if(q.options.doubleQuotedAsJSON)return z;let{implicitKey:X}=q,Z=q.options.doubleQuotedMinMultiLineLength,H=q.indent||(P$($)?" ":""),Q="",J=0;for(let G=0,U=z[G];U;U=z[++G]){if(U===" "&&z[G+1]==="\\"&&z[G+2]==="n")Q+=z.slice(J,G)+"\\ ",G+=1,J=G,U="\\";if(U==="\\")switch(z[G+1]){case"u":{Q+=z.slice(J,G);let B=z.substr(G+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(G,6)}G+=5,J=G+1}break;case"n":if(X||z[G+2]==='"'||z.length<Z)G+=1;else{Q+=z.slice(J,G)+`
40
+
41
+ `;while(z[G+2]==="\\"&&z[G+3]==="n"&&z[G+4]!=='"')Q+=`
42
+ `,G+=2;if(Q+=H,z[G+2]===" ")Q+="\\";G+=1,J=G+1}break;default:G+=1}}return Q=J?Q+z.slice(J):z,X?Q:t.foldFlowLines(Q,H,t.FOLD_QUOTED,w$(q,!1))}function Nq($,q){if(q.options.singleQuote===!1||q.implicitKey&&$.includes(`
43
+ `)||/[ \t]\n|\n[ \t]/.test($))return u0($,q);let z=q.indent||(P$($)?" ":""),X="'"+$.replace(/'/g,"''").replace(/\n+/g,`$&
44
+ ${z}`)+"'";return q.implicitKey?X:t.foldFlowLines(X,z,t.FOLD_FLOW,w$(q,!1))}function M0($,q){let{singleQuote:z}=q.options,X;if(z===!1)X=u0;else{let Z=$.includes('"'),H=$.includes("'");if(Z&&!H)X=Nq;else if(H&&!Z)X=u0;else X=z?Nq:u0}return X($,q)}var Eq;try{Eq=new RegExp(`(^|(?<!
45
45
  ))
46
46
  +(?!
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?`|
47
+ |$)`,"g")}catch{Eq=/\n+(?!\n|$)/g}function M$({comment:$,type:q,value:z},X,Z,H){let{blockQuote:Q,commentString:J,lineWidth:G}=X.options;if(!Q||/\n[\t ]+$/.test(z))return M0(z,X);let U=X.indent||(X.forceBlockIndent||P$(z)?" ":""),B=Q==="literal"?!0:Q==="folded"||q===u.Scalar.BLOCK_FOLDED?!1:q===u.Scalar.BLOCK_LITERAL?!0:!CX(z,G,U.length);if(!z)return B?`|
48
48
  `:`>
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
-
67
- `}else O+=`
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}`:`
49
+ `;let Y,W;for(W=z.length;W>0;--W){let O=z[W-1];if(O!==`
50
+ `&&O!=="\t"&&O!==" ")break}let L=z.substring(W),_=L.indexOf(`
51
+ `);if(_===-1)Y="-";else if(z===L||_!==L.length-1){if(Y="+",H)H()}else Y="";if(L){if(z=z.slice(0,-L.length),L[L.length-1]===`
52
+ `)L=L.slice(0,-1);L=L.replace(Eq,`$&${U}`)}let T=!1,V,D=-1;for(V=0;V<z.length;++V){let O=z[V];if(O===" ")T=!0;else if(O===`
53
+ `)D=V;else break}let R=z.substring(0,D<V?D+1:V);if(R)z=z.substring(R.length),R=R.replace(/\n+/g,`$&${U}`);let K=(T?U?"2":"1":"")+Y;if($){if(K+=" "+J($.replace(/ ?[\r\n]+/g," ")),Z)Z()}if(!B){let O=z.replace(/\n+/g,`
54
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${U}`),F=!1,S=w$(X,!0);if(Q!=="folded"&&q!==u.Scalar.BLOCK_FOLDED)S.onOverflow=()=>{F=!0};let M=t.foldFlowLines(`${R}${O}${L}`,U,t.FOLD_BLOCK,S);if(!F)return`>${K}
55
+ ${U}${M}`}return z=z.replace(/\n+/g,`$&${U}`),`|${K}
56
+ ${U}${R}${z}${L}`}function yX($,q,z,X){let{type:Z,value:H}=$,{actualString:Q,implicitKey:J,indent:G,indentStep:U,inFlow:B}=q;if(J&&H.includes(`
57
+ `)||B&&/[[\]{},]/.test(H))return M0(H,q);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(H))return J||B||!H.includes(`
58
+ `)?M0(H,q):M$($,q,z,X);if(!J&&!B&&Z!==u.Scalar.PLAIN&&H.includes(`
59
+ `))return M$($,q,z,X);if(P$(H)){if(G==="")return q.forceBlockIndent=!0,M$($,q,z,X);else if(J&&G===U)return M0(H,q)}let Y=H.replace(/\n+/g,`$&
60
+ ${G}`);if(Q){let W=(T)=>T.default&&T.tag!=="tag:yaml.org,2002:str"&&T.test?.test(Y),{compat:L,tags:_}=q.doc.schema;if(_.some(W)||L?.some(W))return M0(H,q)}return J?Y:t.foldFlowLines(Y,G,t.FOLD_FLOW,w$(q,!1))}function fX($,q,z,X){let{implicitKey:Z,inFlow:H}=q,Q=typeof $.value==="string"?$:Object.assign({},$,{value:String($.value)}),{type:J}=$;if(J!==u.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(Q.value))J=u.Scalar.QUOTE_DOUBLE}let G=(B)=>{switch(B){case u.Scalar.BLOCK_FOLDED:case u.Scalar.BLOCK_LITERAL:return Z||H?M0(Q.value,q):M$(Q,q,z,X);case u.Scalar.QUOTE_DOUBLE:return u0(Q.value,q);case u.Scalar.QUOTE_SINGLE:return Nq(Q.value,q);case u.Scalar.PLAIN:return yX(Q,q,z,X);default:return null}},U=G(J);if(U===null){let{defaultKeyType:B,defaultStringType:Y}=q.options,W=Z&&B||Y;if(U=G(W),U===null)throw Error(`Unsupported default string type ${W}`)}return U}kX.stringifyString=fX});var d0=I((lX)=>{var hX=_$(),e=A(),gX=v0(),vX=m0();function uX($,q){let z=Object.assign({blockQuote:!0,commentString:gX.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 mX($,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(e.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 dX($,q,{anchors:z,doc:X}){if(!X.directives)return"";let Z=[],H=(e.isScalar($)||e.isCollection($))&&$.anchor;if(H&&hX.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 pX($,q,z,X){if(e.isPair($))return $.toString(q,z,X);if(e.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=e.isNode($)?$:q.doc.createNode($,{onTagObj:(G)=>Z=G});Z??(Z=mX(q.doc.schema.tags,H));let Q=dX(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):e.isScalar(H)?vX.stringifyString(H,q,z,X):H.toString(q,z,X);if(!Q)return J;return e.isScalar(H)||J[0]==="{"||J[0]==="["?`${Q} ${J}`:`${Q}
61
+ ${q.indent}${J}`}lX.createStringifyContext=uX;lX.stringify=pX});var v2=I((sX)=>{var n=A(),h2=y(),g2=d0(),p0=v0();function aX({key:$,value:q},z,X,Z){let{allNullValues:H,doc:Q,indent:J,indentStep:G,options:{commentString:U,indentSeq:B,simpleKeys:Y}}=z,W=n.isNode($)&&$.comment||null;if(Y){if(W)throw Error("With simple keys, key nodes cannot have comments");if(n.isCollection($)||!n.isNode($)&&typeof $==="object")throw Error("With simple keys, collection cannot be used as a key value")}let L=!Y&&(!$||W&&q==null&&!z.inFlow||n.isCollection($)||(n.isScalar($)?$.type===h2.Scalar.BLOCK_FOLDED||$.type===h2.Scalar.BLOCK_LITERAL:typeof $==="object"));z=Object.assign({},z,{allNullValues:!1,implicitKey:!L&&(Y||!H),indent:J+G});let _=!1,T=!1,V=g2.stringify($,z,()=>_=!0,()=>T=!0);if(!L&&!z.inFlow&&V.length>1024){if(Y)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&&!Y||q==null&&L){if(V=`? ${V}`,W&&!_)V+=p0.lineComment(V,z.indent,U(W));else if(T&&Z)Z();return V}if(_)W=null;if(L){if(W)V+=p0.lineComment(V,z.indent,U(W));V=`? ${V}
62
+ ${J}:`}else if(V=`${V}:`,W)V+=p0.lineComment(V,z.indent,U(W));let D,R,w;if(n.isNode(q))D=!!q.spaceBefore,R=q.commentBefore,w=q.comment;else if(D=!1,R=null,w=null,q&&typeof q==="object")q=Q.createNode(q);if(z.implicitKey=!1,!L&&!W&&n.isScalar(q))z.indentAtStart=V.length+1;if(T=!1,!B&&G.length>=2&&!z.inFlow&&!L&&n.isSeq(q)&&!q.flow&&!q.tag&&!q.anchor)z.indent=z.indent.substring(2);let K=!1,O=g2.stringify(q,z,()=>K=!0,()=>T=!0),F=" ";if(W||D||R){if(F=D?`
63
+ `:"",R){let S=U(R);F+=`
64
+ ${p0.indentComment(S,z.indent)}`}if(O===""&&!z.inFlow){if(F===`
65
+ `&&w)F=`
66
+
67
+ `}else F+=`
68
+ ${z.indent}`}else if(!L&&n.isCollection(q)){let S=O[0],M=O.indexOf(`
69
+ `),N=M!==-1,x=z.inFlow??q.flow??q.items.length===0;if(N||!x){let p=!1;if(N&&(S==="&"||S==="!")){let C=O.indexOf(" ");if(S==="&"&&C!==-1&&C<M&&O[C+1]==="!")C=O.indexOf(" ",C+1);if(C===-1||M<C)p=!0}if(!p)F=`
70
+ ${z.indent}`}}else if(O===""||O[0]===`
71
+ `)F="";if(V+=F+O,z.inFlow){if(K&&X)X()}else if(w&&!K)V+=p0.lineComment(V,z.indent,U(w));else if(T&&Z)Z();return V}sX.stringifyPair=aX});var bq=I((tX)=>{var u2=a("process");function nX($,...q){if($==="debug")console.log(...q)}function oX($,q){if($==="debug"||$==="warn")if(typeof u2.emitWarning==="function")u2.emitWarning(q);else console.warn(q)}tX.debug=nX;tX.warn=oX});var F$=I((z8)=>{var l0=A(),m2=y(),K$="<<",O$={identify:($)=>$===K$||typeof $==="symbol"&&$.description===K$,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new m2.Scalar(Symbol(K$)),{addToJSMap:d2}),stringify:()=>K$},q8=($,q)=>(O$.identify(q)||l0.isScalar(q)&&(!q.type||q.type===m2.Scalar.PLAIN)&&O$.identify(q.value))&&$?.doc.schema.tags.some((z)=>z.tag===O$.tag&&z.default);function d2($,q,z){if(z=$&&l0.isAlias(z)?z.resolve($.doc):z,l0.isSeq(z))for(let X of z.items)Cq($,q,X);else if(Array.isArray(z))for(let X of z)Cq($,q,X);else Cq($,q,z)}function Cq($,q,z){let X=$&&l0.isAlias(z)?z.resolve($.doc):z;if(!l0.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}z8.addMergeToJSMap=d2;z8.isMergeKey=q8;z8.merge=O$});var fq=I((Y8)=>{var Q8=bq(),p2=F$(),J8=d0(),l2=A(),yq=o();function U8($,q,{key:z,value:X}){if(l2.isNode(z)&&z.addToJSMap)z.addToJSMap($,q,X);else if(p2.isMergeKey($,z))p2.addMergeToJSMap($,q,X);else{let Z=yq.toJS(z,"",$);if(q instanceof Map)q.set(Z,yq.toJS(X,Z,$));else if(q instanceof Set)q.add(Z);else{let H=G8(z,Z,$),Q=yq.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 G8($,q,z){if(q===null)return"";if(typeof q!=="object")return String(q);if(l2.isNode($)&&z?.doc){let X=J8.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)+'..."';Q8.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)}Y8.addPairToJSMap=U8});var $0=I((V8)=>{var c2=g0(),W8=v2(),T8=fq(),A$=A();function L8($,q,z){let X=c2.createNode($,void 0,z),Z=c2.createNode(q,void 0,z);return new j$(X,Z)}class j${constructor($,q=null){Object.defineProperty(this,A$.NODE_TYPE,{value:A$.PAIR}),this.key=$,this.value=q}clone($){let{key:q,value:z}=this;if(A$.isNode(q))q=q.clone($);if(A$.isNode(z))z=z.clone($);return new j$(q,z)}toJSON($,q){let z=q?.mapAsMap?new Map:{};return T8.addPairToJSMap(q,z,this)}toString($,q,z){return $?.doc?W8.stringifyPair(this,$,q,z):JSON.stringify(this)}}V8.Pair=j$;V8.createPair=L8});var kq=I((w8)=>{var U0=A(),i2=d0(),S$=v0();function D8($,q,z){return(q.inFlow??$.flow?M8:R8)($,q,z)}function R8({comment:$,items:q},z,{blockItemPrefix:X,flowChars:Z,itemIndent:H,onChompKeep:Q,onComment:J}){let{indent:G,options:{commentString:U}}=z,B=Object.assign({},z,{indent:H,type:null}),Y=!1,W=[];for(let _=0;_<q.length;++_){let T=q[_],V=null;if(U0.isNode(T)){if(!Y&&T.spaceBefore)W.push("");if(N$(z,W,T.commentBefore,Y),T.comment)V=T.comment}else if(U0.isPair(T)){let R=U0.isNode(T.key)?T.key:null;if(R){if(!Y&&R.spaceBefore)W.push("");N$(z,W,R.commentBefore,Y)}}Y=!1;let D=i2.stringify(T,B,()=>V=null,()=>Y=!0);if(V)D+=S$.lineComment(D,H,U(V));if(Y&&V)Y=!1;W.push(X+D)}let L;if(W.length===0)L=Z.start+Z.end;else{L=W[0];for(let _=1;_<W.length;++_){let T=W[_];L+=T?`
72
+ ${G}${T}`:`
73
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}`:`
74
+ `+S$.indentComment(U($),G),J)J()}else if(Y&&Q)Q();return L}function M8({items:$},q,{flowChars:z,itemIndent:X}){let{indent:Z,indentStep:H,flowCollectionPadding:Q,options:{commentString:J}}=q;X+=H;let G=Object.assign({},q,{indent:X,inFlow:!0,type:null}),U=!1,B=0,Y=[];for(let _=0;_<$.length;++_){let T=$[_],V=null;if(U0.isNode(T)){if(T.spaceBefore)Y.push("");if(N$(q,Y,T.commentBefore,!1),T.comment)V=T.comment}else if(U0.isPair(T)){let R=U0.isNode(T.key)?T.key:null;if(R){if(R.spaceBefore)Y.push("");if(N$(q,Y,R.commentBefore,!1),R.comment)U=!0}let w=U0.isNode(T.value)?T.value:null;if(w){if(w.comment)V=w.comment;if(w.commentBefore)U=!0}else if(T.value==null&&R?.comment)V=R.comment}if(V)U=!0;let D=i2.stringify(T,G,()=>V=null);if(_<$.length-1)D+=",";if(V)D+=S$.lineComment(D,X,J(V));if(!U&&(Y.length>B||D.includes(`
75
+ `)))U=!0;Y.push(D),B=Y.length}let{start:W,end:L}=z;if(Y.length===0)return W+L;else{if(!U){let _=Y.reduce((T,V)=>T+V.length+2,2);U=q.options.lineWidth>0&&_>q.options.lineWidth}if(U){let _=W;for(let T of Y)_+=T?`
76
+ ${H}${Z}${T}`:`
77
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}
78
+ ${Z}${L}`}else return`${W}${Q}${Y.join(" ")}${Q}${L}`}}function N$({indent:$,options:{commentString:q}},z,X,Z){if(X&&Z)X=X.replace(/^\n+/,"");if(X){let H=S$.indentComment(q(X),$);z.push(H.trimStart())}}w8.stringifyCollection=D8});var z0=I((j8)=>{var K8=kq(),O8=fq(),F8=R$(),q0=A(),E$=$0(),A8=y();function c0($,q){let z=q0.isScalar(q)?q.value:q;for(let X of $)if(q0.isPair(X)){if(X.key===q||X.key===z)return X;if(q0.isScalar(X.key)&&X.key.value===z)return X}return}class a2 extends F8.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor($){super(q0.MAP,$);this.items=[]}static from($,q,z){let{keepUndefined:X,replacer:Z}=z,H=new this($),Q=(J,G)=>{if(typeof Z==="function")G=Z.call(q,J,G);else if(Array.isArray(Z)&&!Z.includes(J))return;if(G!==void 0||X)H.items.push(E$.createPair(J,G,z))};if(q instanceof Map)for(let[J,G]of q)Q(J,G);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(q0.isPair($))z=$;else if(!$||typeof $!=="object"||!("key"in $))z=new E$.Pair($,$?.value);else z=new E$.Pair($.key,$.value);let X=c0(this.items,z.key),Z=this.schema?.sortMapEntries;if(X){if(!q)throw Error(`Key ${z.key} already set`);if(q0.isScalar(X.value)&&A8.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=c0(this.items,$);if(!q)return!1;return this.items.splice(this.items.indexOf(q),1).length>0}get($,q){let X=c0(this.items,$)?.value;return(!q&&q0.isScalar(X)?X.value:X)??void 0}has($){return!!c0(this.items,$)}set($,q){this.add(new E$.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)O8.addPairToJSMap(q,X,Z);return X}toString($,q,z){if(!$)return JSON.stringify(this);for(let X of this.items)if(!q0.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 K8.stringifyCollection(this,$,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:$.indent||"",onChompKeep:z,onComment:q})}}j8.YAMLMap=a2;j8.findPair=c0});var w0=I((C8)=>{var E8=A(),s2=z0(),b8={collection:"map",default:!0,nodeClass:s2.YAMLMap,tag:"tag:yaml.org,2002:map",resolve($,q){if(!E8.isMap($))q("Expected a mapping for this tag");return $},createNode:($,q,z)=>s2.YAMLMap.from($,q,z)};C8.map=b8});var X0=I((v8)=>{var f8=g0(),k8=kq(),x8=R$(),C$=A(),h8=y(),g8=o();class r2 extends x8.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor($){super(C$.SEQ,$);this.items=[]}add($){this.items.push($)}delete($){let q=b$($);if(typeof q!=="number")return!1;return this.items.splice(q,1).length>0}get($,q){let z=b$($);if(typeof z!=="number")return;let X=this.items[z];return!q&&C$.isScalar(X)?X.value:X}has($){let q=b$($);return typeof q==="number"&&q<this.items.length}set($,q){let z=b$($);if(typeof z!=="number")throw Error(`Expected a valid index, not ${$}.`);let X=this.items[z];if(C$.isScalar(X)&&h8.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(g8.toJS(Z,String(X++),q));return z}toString($,q,z){if(!$)return JSON.stringify(this);return k8.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(f8.createNode(Q,void 0,z))}}return Z}}function b$($){let q=C$.isScalar($)?$.value:$;if(q&&typeof q==="string")q=Number(q);return typeof q==="number"&&Number.isInteger(q)&&q>=0?q:null}v8.YAMLSeq=r2});var P0=I((p8)=>{var m8=A(),n2=X0(),d8={collection:"seq",default:!0,nodeClass:n2.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve($,q){if(!m8.isSeq($))q("Expected a sequence for this tag");return $},createNode:($,q,z)=>n2.YAMLSeq.from($,q,z)};p8.seq=d8});var i0=I((a8)=>{var c8=m0(),i8={identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify($,q,z,X){return q=Object.assign({actualString:!0},q),c8.stringifyString($,q,z,X)}};a8.string=i8});var y$=I((r8)=>{var o2=y(),t2={identify:($)=>$==null,createNode:()=>new o2.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new o2.Scalar(null),stringify:({source:$},q)=>typeof $==="string"&&t2.test.test($)?$:q.options.nullStr};r8.nullTag=t2});var xq=I((t8)=>{var o8=y(),e2={identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:($)=>new o8.Scalar($[0]==="t"||$[0]==="T"),stringify({source:$,value:q},z){if($&&e2.test.test($)){let X=$[0]==="t"||$[0]==="T";if(q===X)return $}return q?z.options.trueStr:z.options.falseStr}};t8.boolTag=e2});var K0=I((qZ)=>{function $Z({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}qZ.stringifyNumber=$Z});var gq=I((JZ)=>{var XZ=y(),hq=K0(),ZZ={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:hq.stringifyNumber},HZ={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():hq.stringifyNumber($)}},QZ={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve($){let q=new XZ.Scalar(parseFloat($)),z=$.indexOf(".");if(z!==-1&&$[$.length-1]==="0")q.minFractionDigits=$.length-z-1;return q},stringify:hq.stringifyNumber};JZ.float=QZ;JZ.floatExp=HZ;JZ.floatNaN=ZZ});var uq=I((LZ)=>{var $9=K0(),f$=($)=>typeof $==="bigint"||Number.isInteger($),vq=($,q,z,{intAsBigInt:X})=>X?BigInt($):parseInt($.substring(q),z);function q9($,q,z){let{value:X}=$;if(f$(X)&&X>=0)return z+X.toString(q);return $9.stringifyNumber($)}var BZ={identify:($)=>f$($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:($,q,z)=>vq($,2,8,z),stringify:($)=>q9($,8,"0o")},WZ={identify:f$,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:($,q,z)=>vq($,0,10,z),stringify:$9.stringifyNumber},TZ={identify:($)=>f$($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:($,q,z)=>vq($,2,16,z),stringify:($)=>q9($,16,"0x")};LZ.int=WZ;LZ.intHex=TZ;LZ.intOct=BZ});var z9=I((OZ)=>{var DZ=w0(),RZ=y$(),MZ=P0(),wZ=i0(),PZ=xq(),mq=gq(),dq=uq(),KZ=[DZ.map,MZ.seq,wZ.string,RZ.nullTag,PZ.boolTag,dq.intOct,dq.int,dq.intHex,mq.floatNaN,mq.floatExp,mq.float];OZ.schema=KZ});var Z9=I((CZ)=>{var AZ=y(),jZ=w0(),SZ=P0();function X9($){return typeof $==="bigint"||Number.isInteger($)}var k$=({value:$})=>JSON.stringify($),NZ=[{identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify:k$},{identify:($)=>$==null,createNode:()=>new AZ.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:k$},{identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:($)=>$==="true",stringify:k$},{identify:X9,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:($,q,{intAsBigInt:z})=>z?BigInt($):parseInt($,10),stringify:({value:$})=>X9($)?$.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:k$}],EZ={default:!0,tag:"",test:/^/,resolve($,q){return q(`Unresolved plain scalar ${JSON.stringify($)}`),$}},bZ=[jZ.map,SZ.seq].concat(NZ,EZ);CZ.schema=bZ});var lq=I((xZ)=>{var a0=a("buffer"),pq=y(),fZ=m0(),kZ={identify:($)=>$ instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve($,q){if(typeof a0.Buffer==="function")return a0.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 a0.Buffer==="function")J=Q instanceof a0.Buffer?Q.toString("base64"):a0.Buffer.from(Q.buffer).toString("base64");else if(typeof btoa==="function"){let G="";for(let U=0;U<Q.length;++U)G+=String.fromCharCode(Q[U]);J=btoa(G)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(q??(q=pq.Scalar.BLOCK_LITERAL),q!==pq.Scalar.QUOTE_DOUBLE){let G=Math.max(X.options.lineWidth-X.indent.length,X.options.minContentWidth),U=Math.ceil(J.length/G),B=Array(U);for(let Y=0,W=0;Y<U;++Y,W+=G)B[Y]=J.substr(W,G);J=B.join(q===pq.Scalar.BLOCK_LITERAL?`
79
+ `:" ")}return fZ.stringifyString({comment:$,type:q,value:J},X,Z,H)}};xZ.binary=kZ});var h$=I((mZ)=>{var x$=A(),cq=$0(),gZ=y(),vZ=X0();function H9($,q){if(x$.isSeq($))for(let z=0;z<$.items.length;++z){let X=$.items[z];if(x$.isPair(X))continue;else if(x$.isMap(X)){if(X.items.length>1)q("Each pair must have its own sequence indicator");let Z=X.items[0]||new cq.Pair(new gZ.Scalar(null));if(X.commentBefore)Z.key.commentBefore=Z.key.commentBefore?`${X.commentBefore}
80
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(`
81
+ ${H.comment}`:X.comment}X=Z}$.items[z]=x$.isPair(X)?X:new cq.Pair(X)}else q("Expected a sequence for this tag");return $}function Q9($,q,z){let{replacer:X}=z,Z=new vZ.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,G;if(Array.isArray(Q))if(Q.length===2)J=Q[0],G=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],G=Q[J];else throw TypeError(`Expected tuple with one key, not ${U.length} keys`)}else J=Q;Z.items.push(cq.createPair(J,G,z))}return Z}var uZ={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:H9,createNode:Q9};mZ.createPairs=Q9;mZ.pairs=uZ;mZ.resolvePairs=H9});var aq=I((aZ)=>{var J9=A(),iq=o(),s0=z0(),cZ=X0(),U9=h$();class G0 extends cZ.YAMLSeq{constructor(){super();this.add=s0.YAMLMap.prototype.add.bind(this),this.delete=s0.YAMLMap.prototype.delete.bind(this),this.get=s0.YAMLMap.prototype.get.bind(this),this.has=s0.YAMLMap.prototype.has.bind(this),this.set=s0.YAMLMap.prototype.set.bind(this),this.tag=G0.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(J9.isPair(X))Z=iq.toJS(X.key,"",q),H=iq.toJS(X.value,Z,q);else Z=iq.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=U9.createPairs($,q,z),Z=new this;return Z.items=X.items,Z}}G0.tag="tag:yaml.org,2002:omap";var iZ={collection:"seq",identify:($)=>$ instanceof Map,nodeClass:G0,default:!1,tag:"tag:yaml.org,2002:omap",resolve($,q){let z=U9.resolvePairs($,q),X=[];for(let{key:Z}of z.items)if(J9.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 G0,z)},createNode:($,q,z)=>G0.from($,q,z)};aZ.YAMLOMap=G0;aZ.omap=iZ});var T9=I((nZ)=>{var G9=y();function Y9({value:$,source:q},z){if(q&&($?B9:W9).test.test(q))return q;return $?z.options.trueStr:z.options.falseStr}var B9={identify:($)=>$===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new G9.Scalar(!0),stringify:Y9},W9={identify:($)=>$===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new G9.Scalar(!1),stringify:Y9};nZ.falseTag=W9;nZ.trueTag=B9});var L9=I((X6)=>{var eZ=y(),sq=K0(),$6={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:sq.stringifyNumber},q6={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():sq.stringifyNumber($)}},z6={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve($){let q=new eZ.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:sq.stringifyNumber};X6.float=z6;X6.floatExp=q6;X6.floatNaN=$6});var _9=I((B6)=>{var V9=K0(),r0=($)=>typeof $==="bigint"||Number.isInteger($);function g$($,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 rq($,q,z){let{value:X}=$;if(r0(X)){let Z=X.toString(q);return X<0?"-"+z+Z.substr(1):z+Z}return V9.stringifyNumber($)}var J6={identify:r0,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:($,q,z)=>g$($,2,2,z),stringify:($)=>rq($,2,"0b")},U6={identify:r0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:($,q,z)=>g$($,1,8,z),stringify:($)=>rq($,8,"0")},G6={identify:r0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:($,q,z)=>g$($,0,10,z),stringify:V9.stringifyNumber},Y6={identify:r0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:($,q,z)=>g$($,2,16,z),stringify:($)=>rq($,16,"0x")};B6.int=G6;B6.intBin=J6;B6.intHex=Y6;B6.intOct=U6});var nq=I((I6)=>{var m$=A(),v$=$0(),u$=z0();class Y0 extends u$.YAMLMap{constructor($){super($);this.tag=Y0.tag}add($){let q;if(m$.isPair($))q=$;else if($&&typeof $==="object"&&"key"in $&&"value"in $&&$.value===null)q=new v$.Pair($.key,null);else q=new v$.Pair($,null);if(!u$.findPair(this.items,q.key))this.items.push(q)}get($,q){let z=u$.findPair(this.items,$);return!q&&m$.isPair(z)?m$.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=u$.findPair(this.items,$);if(z&&!q)this.items.splice(this.items.indexOf(z),1);else if(!z&&q)this.items.push(new v$.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(v$.createPair(H,null,z))}return Z}}Y0.tag="tag:yaml.org,2002:set";var _6={collection:"map",identify:($)=>$ instanceof Set,nodeClass:Y0,default:!1,tag:"tag:yaml.org,2002:set",createNode:($,q,z)=>Y0.from($,q,z),resolve($,q){if(m$.isMap($))if($.hasAllNullValues(!0))return Object.assign(new Y0,$);else q("Set items must all have null values");else q("Expected a mapping for this tag");return $}};I6.YAMLSet=Y0;I6.set=_6});var tq=I((K6)=>{var M6=K0();function oq($,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 I9($){let{value:q}=$,z=(Q)=>Q;if(typeof q==="bigint")z=(Q)=>BigInt(Q);else if(isNaN(q)||!isFinite(q))return M6.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 w6={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})=>oq($,z),stringify:I9},P6={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:($)=>oq($,!1),stringify:I9},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),G=q[7]?Number((q[7]+"00").substr(1,3)):0,U=Date.UTC(z,X-1,Z,H||0,Q||0,J||0,G),B=q[8];if(B&&B!=="Z"){let Y=oq(B,!1);if(Math.abs(Y)<30)Y*=60;U-=60000*Y}return new Date(U)},stringify:({value:$})=>$?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};K6.floatTime=P6;K6.intTime=w6;K6.timestamp=D9});var M9=I((h6)=>{var j6=w0(),S6=y$(),N6=P0(),E6=i0(),b6=lq(),R9=T9(),eq=L9(),d$=_9(),C6=F$(),y6=aq(),f6=h$(),k6=nq(),$1=tq(),x6=[j6.map,N6.seq,E6.string,S6.nullTag,R9.trueTag,R9.falseTag,d$.intBin,d$.intOct,d$.int,d$.intHex,eq.floatNaN,eq.floatExp,eq.float,b6.binary,C6.merge,y6.omap,f6.pairs,k6.set,$1.intTime,$1.floatTime,$1.timestamp];h6.schema=x6});var E9=I((i6)=>{var O9=w0(),v6=y$(),F9=P0(),u6=i0(),m6=xq(),q1=gq(),z1=uq(),d6=z9(),p6=Z9(),A9=lq(),n0=F$(),j9=aq(),S9=h$(),w9=M9(),N9=nq(),p$=tq(),P9=new Map([["core",d6.schema],["failsafe",[O9.map,F9.seq,u6.string]],["json",p6.schema],["yaml11",w9.schema],["yaml-1.1",w9.schema]]),K9={binary:A9.binary,bool:m6.boolTag,float:q1.float,floatExp:q1.floatExp,floatNaN:q1.floatNaN,floatTime:p$.floatTime,int:z1.int,intHex:z1.intHex,intOct:z1.intOct,intTime:p$.intTime,map:O9.map,merge:n0.merge,null:v6.nullTag,omap:j9.omap,pairs:S9.pairs,seq:F9.seq,set:N9.set,timestamp:p$.timestamp},l6={"tag:yaml.org,2002:binary":A9.binary,"tag:yaml.org,2002:merge":n0.merge,"tag:yaml.org,2002:omap":j9.omap,"tag:yaml.org,2002:pairs":S9.pairs,"tag:yaml.org,2002:set":N9.set,"tag:yaml.org,2002:timestamp":p$.timestamp};function c6($,q,z){let X=P9.get(q);if(X&&!$)return z&&!X.includes(n0.merge)?X.concat(n0.merge):X.slice();let Z=X;if(!Z)if(Array.isArray($))Z=[];else{let H=Array.from(P9.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(n0.merge);return Z.reduce((H,Q)=>{let J=typeof Q==="string"?K9[Q]:Q;if(!J){let G=JSON.stringify(Q),U=Object.keys(K9).map((B)=>JSON.stringify(B)).join(", ");throw Error(`Unknown custom tag ${G}; use one of ${U}`)}if(!H.includes(J))H.push(J);return H},[])}i6.coreKnownTags=l6;i6.getTags=c6});var H1=I((e6)=>{var X1=A(),r6=w0(),n6=P0(),o6=i0(),l$=E9(),t6=($,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($)?l$.getTags($,"compat"):$?l$.getTags(null,$):null,this.name=typeof Z==="string"&&Z||"core",this.knownTags=X?l$.coreKnownTags:{},this.tags=l$.getTags(q,this.name,z),this.toStringOptions=Q??null,Object.defineProperty(this,X1.MAP,{value:r6.map}),Object.defineProperty(this,X1.SCALAR,{value:o6.string}),Object.defineProperty(this,X1.SEQ,{value:n6.seq}),this.sortMapEntries=typeof H==="function"?H:H===!0?t6:null}clone(){let $=Object.create(Z1.prototype,Object.getOwnPropertyDescriptors(this));return $.tags=this.tags.slice(),$}}e6.Schema=Z1});var b9=I((XH)=>{var qH=A(),Q1=d0(),o0=v0();function zH($,q){let z=[],X=q.directives===!0;if(q.directives!==!1&&$.directives){let G=$.directives.toString($);if(G)z.push(G),X=!0;else if($.directives.docStart)X=!0}if(X)z.push("---");let Z=Q1.createStringifyContext($,q),{commentString:H}=Z.options;if($.commentBefore){if(z.length!==1)z.unshift("");let G=H($.commentBefore);z.unshift(o0.indentComment(G,""))}let Q=!1,J=null;if($.contents){if(qH.isNode($.contents)){if($.contents.spaceBefore&&X)z.push("");if($.contents.commentBefore){let B=H($.contents.commentBefore);z.push(o0.indentComment(B,""))}Z.forceBlockIndent=!!$.comment,J=$.contents.comment}let G=J?void 0:()=>Q=!0,U=Q1.stringify($.contents,Z,()=>J=null,G);if(J)U+=o0.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(Q1.stringify($.contents,Z));if($.directives?.docEnd)if($.comment){let G=H($.comment);if(G.includes(`
82
+ `))z.push("..."),z.push(o0.indentComment(G,""));else z.push(`... ${G}`)}else z.push("...");else{let G=$.comment;if(G&&Q)G=G.replace(/^\n+/,"");if(G){if((!Q||J)&&z[z.length-1]!=="")z.push("");z.push(o0.indentComment(H(G),""))}}return z.join(`
83
83
  `)+`
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+=`:
84
+ `}XH.stringifyDocument=zH});var t0=I((WH)=>{var HH=h0(),O0=R$(),g=A(),QH=$0(),JH=o(),UH=H1(),GH=b9(),J1=_$(),YH=Aq(),BH=g0(),U1=Fq();class G1{constructor($,q,z){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,g.NODE_TYPE,{value:g.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 U1.Directives({version:H});this.setSchema(H,z),this.contents=$===void 0?null:this.createNode($,X,z)}clone(){let $=Object.create(G1.prototype,{[g.NODE_TYPE]:{value:g.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=g.isNode(this.contents)?this.contents.clone($.schema):this.contents,this.range)$.range=this.range.slice();return $}add($){if(F0(this.contents))this.contents.add($)}addIn($,q){if(F0(this.contents))this.contents.addIn($,q)}createAlias($,q){if(!$.anchor){let z=J1.anchorNames(this);$.anchor=!q||z.has(q)?J1.findNewAnchor(q||"a",z):q}return new HH.Alias($.anchor)}createNode($,q,z){let X=void 0;if(typeof q==="function")$=q.call({"":$},"",$),X=q;else if(Array.isArray(q)){let T=(D)=>typeof D==="number"||D instanceof String||D instanceof Number,V=q.filter(T).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:G,tag:U}=z??{},{onAnchor:B,setAnchors:Y,sourceObjects:W}=J1.createNodeAnchors(this,H||"a"),L={aliasDuplicateObjects:Z??!0,keepUndefined:J??!1,onAnchor:B,onTagObj:G,replacer:X,schema:this.schema,sourceObjects:W},_=BH.createNode($,U,L);if(Q&&g.isCollection(_))_.flow=!0;return Y(),_}createPair($,q,z={}){let X=this.createNode($,null,z),Z=this.createNode(q,null,z);return new QH.Pair(X,Z)}delete($){return F0(this.contents)?this.contents.delete($):!1}deleteIn($){if(O0.isEmptyPath($)){if(this.contents==null)return!1;return this.contents=null,!0}return F0(this.contents)?this.contents.deleteIn($):!1}get($,q){return g.isCollection(this.contents)?this.contents.get($,q):void 0}getIn($,q){if(O0.isEmptyPath($))return!q&&g.isScalar(this.contents)?this.contents.value:this.contents;return g.isCollection(this.contents)?this.contents.getIn($,q):void 0}has($){return g.isCollection(this.contents)?this.contents.has($):!1}hasIn($){if(O0.isEmptyPath($))return this.contents!==void 0;return g.isCollection(this.contents)?this.contents.hasIn($):!1}set($,q){if(this.contents==null)this.contents=O0.collectionFromPath(this.schema,[$],q);else if(F0(this.contents))this.contents.set($,q)}setIn($,q){if(O0.isEmptyPath($))this.contents=q;else if(this.contents==null)this.contents=O0.collectionFromPath(this.schema,Array.from($),q);else if(F0(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 U1.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 U1.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 UH.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=JH.toJS(this.contents,q??"",Q);if(typeof Z==="function")for(let{count:G,res:U}of Q.anchors.values())Z(U,G);return typeof H==="function"?YH.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 GH.stringifyDocument(this,$)}}function F0($){if(g.isCollection($))return!0;throw Error("Expected a YAML collection as document contents")}WH.Document=G1});var e0=I((VH)=>{class c$ extends Error{constructor($,q,z,X){super();this.name=$,this.code=z,this.message=X,this.pos=q}}class C9 extends c${constructor($,q,z){super("YAMLParseError",$,q,z)}}class y9 extends c${constructor($,q,z){super("YAMLWarning",$,q,z)}}var LH=($,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,G=z.linePos[1];if(G?.line===X&&G.col>Z)J=Math.max(1,Math.min(G.col-Z,80-H));let U=" ".repeat(H)+"^".repeat(J);z.message+=`:
86
86
 
87
87
  ${Q}
88
88
  ${U}
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?
89
+ `}};VH.YAMLError=c$;VH.YAMLParseError=C9;VH.YAMLWarning=y9;VH.prettifyError=LH});var $$=I((wH)=>{function MH($,{flow:q,indicator:z,next:X,offset:Z,onError:H,parentIndent:Q,startOnNewline:J}){let G=!1,U=J,B=J,Y="",W="",L=!1,_=!1,T=null,V=null,D=null,R=null,w=null,K=null,O=null;for(let M of $){if(_){if(M.type!=="space"&&M.type!=="newline"&&M.type!=="comma")H(M.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");_=!1}if(T){if(U&&M.type!=="comment"&&M.type!=="newline")H(T,"TAB_AS_INDENT","Tabs are not allowed as indentation");T=null}switch(M.type){case"space":if(!q&&(z!=="doc-start"||X?.type!=="flow-collection")&&M.source.includes("\t"))T=M;B=!0;break;case"comment":{if(!B)H(M,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let N=M.source.substring(1)||" ";if(!Y)Y=N;else Y+=W+N;W="",U=!1;break}case"newline":if(U){if(Y)Y+=M.source;else if(!K||z!=="seq-item-ind")G=!0}else W+=M.source;if(U=!0,L=!0,V||D)R=M;B=!0;break;case"anchor":if(V)H(M,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(M.source.endsWith(":"))H(M.offset+M.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);V=M,O??(O=M.offset),U=!1,B=!1,_=!0;break;case"tag":{if(D)H(M,"MULTIPLE_TAGS","A node can have at most one tag");D=M,O??(O=M.offset),U=!1,B=!1,_=!0;break}case z:if(V||D)H(M,"BAD_PROP_ORDER",`Anchors and tags must be after the ${M.source} indicator`);if(K)H(M,"UNEXPECTED_TOKEN",`Unexpected ${M.source} in ${q??"collection"}`);K=M,U=z==="seq-item-ind"||z==="explicit-key-ind",B=!1;break;case"comma":if(q){if(w)H(M,"UNEXPECTED_TOKEN",`Unexpected , in ${q}`);w=M,U=!1,B=!1;break}default:H(M,"UNEXPECTED_TOKEN",`Unexpected ${M.type} token`),U=!1,B=!1}}let F=$[$.length-1],S=F?F.offset+F.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(T&&(U&&T.indent<=Q||X?.type==="block-map"||X?.type==="block-seq"))H(T,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:w,found:K,spaceBefore:G,comment:Y,hasNewline:L,anchor:V,tag:D,newlineAfterProp:R,end:S,start:O??S}}wH.resolveProps=MH});var i$=I((KH)=>{function Y1($){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(Y1(q.key)||Y1(q.value))return!0}return!1;default:return!0}}KH.containsNewline=Y1});var B1=I((jH)=>{var FH=i$();function AH($,q,z){if(q?.type==="flow-collection"){let X=q.end[0];if(X.indent===$&&(X.source==="]"||X.source==="}")&&FH.containsNewline(q))z(X,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}jH.flowIndentCheck=AH});var W1=I((EH)=>{var f9=A();function NH($,q,z){let{uniqueKeys:X}=$.options;if(X===!1)return!1;let Z=typeof X==="function"?X:(H,Q)=>H===Q||f9.isScalar(H)&&f9.isScalar(Q)&&H.value===Q.value;return q.some((H)=>Z(H.key,z))}EH.mapIncludes=NH});var v9=I((xH)=>{var k9=$0(),CH=z0(),x9=$$(),yH=i$(),h9=B1(),fH=W1(),g9="All mapping items must start at the same column";function kH({composeNode:$,composeEmptyNode:q},z,X,Z,H){let J=new(H?.nodeClass??CH.YAMLMap)(z.schema);if(z.atRoot)z.atRoot=!1;let G=X.offset,U=null;for(let B of X.items){let{start:Y,key:W,sep:L,value:_}=B,T=x9.resolveProps(Y,{indicator:"explicit-key-ind",next:W??L?.[0],offset:G,onError:Z,parentIndent:X.indent,startOnNewline:!0}),V=!T.found;if(V){if(W){if(W.type==="block-seq")Z(G,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in W&&W.indent!==X.indent)Z(G,"BAD_INDENT",g9)}if(!T.anchor&&!T.tag&&!L){if(U=T.end,T.comment)if(J.comment)J.comment+=`
91
+ `+T.comment;else J.comment=T.comment;continue}if(T.newlineAfterProp||yH.containsNewline(W))Z(W??Y[Y.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(T.found?.indent!==X.indent)Z(G,"BAD_INDENT",g9);z.atKey=!0;let D=T.end,R=W?$(z,W,T,Z):q(z,D,Y,null,T,Z);if(z.schema.compat)h9.flowIndentCheck(X.indent,W,Z);if(z.atKey=!1,fH.mapIncludes(z,J.items,R))Z(D,"DUPLICATE_KEY","Map keys must be unique");let w=x9.resolveProps(L??[],{indicator:"map-value-ind",next:_,offset:R.range[2],onError:Z,parentIndent:X.indent,startOnNewline:!W||W.type==="block-scalar"});if(G=w.end,w.found){if(V){if(_?.type==="block-map"&&!w.hasNewline)Z(G,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(z.options.strict&&T.start<w.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,_,w,Z):q(z,G,L,null,w,Z);if(z.schema.compat)h9.flowIndentCheck(X.indent,_,Z);G=K.range[2];let O=new k9.Pair(R,K);if(z.options.keepSourceTokens)O.srcToken=B;J.items.push(O)}else{if(V)Z(R.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(w.comment)if(R.comment)R.comment+=`
92
+ `+w.comment;else R.comment=w.comment;let K=new k9.Pair(R);if(z.options.keepSourceTokens)K.srcToken=B;J.items.push(K)}}if(U&&U<G)Z(U,"IMPOSSIBLE","Map comment with trailing content");return J.range=[X.offset,G,U??G],J}xH.resolveBlockMap=kH});var u9=I((dH)=>{var gH=X0(),vH=$$(),uH=B1();function mH({composeNode:$,composeEmptyNode:q},z,X,Z,H){let J=new(H?.nodeClass??gH.YAMLSeq)(z.schema);if(z.atRoot)z.atRoot=!1;if(z.atKey)z.atKey=!1;let G=X.offset,U=null;for(let{start:B,value:Y}of X.items){let W=vH.resolveProps(B,{indicator:"seq-item-ind",next:Y,offset:G,onError:Z,parentIndent:X.indent,startOnNewline:!0});if(!W.found)if(W.anchor||W.tag||Y)if(Y?.type==="block-seq")Z(W.end,"BAD_INDENT","All sequence items must start at the same column");else Z(G,"MISSING_CHAR","Sequence item without - indicator");else{if(U=W.end,W.comment)J.comment=W.comment;continue}let L=Y?$(z,Y,W,Z):q(z,W.end,B,null,W,Z);if(z.schema.compat)uH.flowIndentCheck(X.indent,Y,Z);G=L.range[2],J.items.push(L)}return J.range=[X.offset,G,U??G],J}dH.resolveBlockSeq=mH});var A0=I((cH)=>{function lH($,q,z,X){let Z="";if($){let H=!1,Q="";for(let J of $){let{source:G,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=G.substring(1)||" ";if(!Z)Z=B;else Z+=Q+B;Q="";break}case"newline":if(Z)Q+=G;H=!0;break;default:X(J,"UNEXPECTED_TOKEN",`Unexpected ${U} at node end`)}q+=G.length}}return{comment:Z,offset:q}}cH.resolveEnd=lH});var p9=I(($3)=>{var aH=A(),sH=$0(),m9=z0(),rH=X0(),nH=A0(),d9=$$(),oH=i$(),tH=W1(),T1="Block collections are not allowed within flow collections",L1=($)=>$&&($.type==="block-map"||$.type==="block-seq");function eH({composeNode:$,composeEmptyNode:q},z,X,Z,H){let Q=X.start.source==="{",J=Q?"flow map":"flow sequence",U=new(H?.nodeClass??(Q?m9.YAMLMap:rH.YAMLSeq))(z.schema);U.flow=!0;let B=z.atRoot;if(B)z.atRoot=!1;if(z.atKey)z.atKey=!1;let Y=X.offset+X.start.source.length;for(let V=0;V<X.items.length;++V){let D=X.items[V],{start:R,key:w,sep:K,value:O}=D,F=d9.resolveProps(R,{flow:J,indicator:"explicit-key-ind",next:w??K?.[0],offset:Y,onError:Z,parentIndent:X.indent,startOnNewline:!1});if(!F.found){if(!F.anchor&&!F.tag&&!K&&!O){if(V===0&&F.comma)Z(F.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${J}`);else if(V<X.items.length-1)Z(F.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${J}`);if(F.comment)if(U.comment)U.comment+=`
93
+ `+F.comment;else U.comment=F.comment;Y=F.end;continue}if(!Q&&z.options.strict&&oH.containsNewline(w))Z(w,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(V===0){if(F.comma)Z(F.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${J}`)}else{if(!F.comma)Z(F.start,"MISSING_CHAR",`Missing , between ${J} items`);if(F.comment){let S="";$:for(let M of R)switch(M.type){case"comma":case"space":break;case"comment":S=M.source.substring(1);break $;default:break $}if(S){let M=U.items[U.items.length-1];if(aH.isPair(M))M=M.value??M.key;if(M.comment)M.comment+=`
94
+ `+S;else M.comment=S;F.comment=F.comment.substring(S.length+1)}}}if(!Q&&!K&&!F.found){let S=O?$(z,O,F,Z):q(z,F.end,K,null,F,Z);if(U.items.push(S),Y=S.range[2],L1(O))Z(S.range,"BLOCK_IN_FLOW",T1)}else{z.atKey=!0;let S=F.end,M=w?$(z,w,F,Z):q(z,S,R,null,F,Z);if(L1(w))Z(M.range,"BLOCK_IN_FLOW",T1);z.atKey=!1;let N=d9.resolveProps(K??[],{flow:J,indicator:"map-value-ind",next:O,offset:M.range[2],onError:Z,parentIndent:X.indent,startOnNewline:!1});if(N.found){if(!Q&&!F.found&&z.options.strict){if(K)for(let C of K){if(C===N.found)break;if(C.type==="newline"){Z(C,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(F.start<N.found.offset-1024)Z(N.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(O)if("source"in O&&O.source?.[0]===":")Z(O,"MISSING_CHAR",`Missing space after : in ${J}`);else Z(N.start,"MISSING_CHAR",`Missing , or : between ${J} items`);let x=O?$(z,O,N,Z):N.found?q(z,N.end,K,null,N,Z):null;if(x){if(L1(O))Z(x.range,"BLOCK_IN_FLOW",T1)}else if(N.comment)if(M.comment)M.comment+=`
95
+ `+N.comment;else M.comment=N.comment;let p=new sH.Pair(M,x);if(z.options.keepSourceTokens)p.srcToken=D;if(Q){let C=U;if(tH.mapIncludes(z,C.items,M))Z(S,"DUPLICATE_KEY","Map keys must be unique");C.items.push(p)}else{let C=new m9.YAMLMap(z.schema);C.flow=!0,C.items.push(p);let G$=(x??M).range;C.range=[M.range[0],G$[1],G$[2]],U.items.push(C)}Y=x?x.range[2]:N.end}}let W=Q?"}":"]",[L,..._]=X.end,T=Y;if(L?.source===W)T=L.offset+L.source.length;else{let V=J[0].toUpperCase()+J.substring(1),D=B?`${V} must end with a ${W}`:`${V} in block collection must be sufficiently indented and end with a ${W}`;if(Z(Y,B?"MISSING_CHAR":"BAD_INDENT",D),L&&L.source.length!==1)_.unshift(L)}if(_.length>0){let V=nH.resolveEnd(_,T,z.options.strict,Z);if(V.comment)if(U.comment)U.comment+=`
96
+ `+V.comment;else U.comment=V.comment;U.range=[X.offset,T,V.offset]}else U.range=[X.offset,T,T];return U}$3.resolveFlowCollection=eH});var l9=I((Y3)=>{var z3=A(),X3=y(),Z3=z0(),H3=X0(),Q3=v9(),J3=u9(),U3=p9();function V1($,q,z,X,Z,H){let Q=z.type==="block-map"?Q3.resolveBlockMap($,q,z,X,H):z.type==="block-seq"?J3.resolveBlockSeq($,q,z,X,H):U3.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 G3($,q,z,X,Z){let H=X.tag,Q=!H?null:q.directives.tagName(H.source,(W)=>Z(H,"TAG_RESOLVE_FAILED",W));if(z.type==="block-seq"){let{anchor:W,newlineAfterProp:L}=X,_=W&&H?W.offset>H.offset?W:H:W??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===Z3.YAMLMap.tagName&&J==="map"||Q===H3.YAMLSeq.tagName&&J==="seq")return V1($,q,z,Z,Q);let G=q.schema.tags.find((W)=>W.tag===Q&&W.collection===J);if(!G){let W=q.schema.knownTags[Q];if(W?.collection===J)q.schema.tags.push(Object.assign({},W,{default:!1})),G=W;else{if(W)Z(H,"BAD_COLLECTION_TYPE",`${W.tag} used for ${J} collection, but expects ${W.collection??"scalar"}`,!0);else Z(H,"TAG_RESOLVE_FAILED",`Unresolved tag: ${Q}`,!0);return V1($,q,z,Z,Q)}}let U=V1($,q,z,Z,Q,G),B=G.resolve?.(U,(W)=>Z(H,"TAG_RESOLVE_FAILED",W),q.options)??U,Y=z3.isNode(B)?B:new X3.Scalar(B);if(Y.range=U.range,Y.tag=Q,G?.format)Y.format=G.format;return Y}Y3.composeCollection=G3});var I1=I((V3)=>{var _1=y();function W3($,q,z){let X=q.offset,Z=T3(q,$.options.strict,z);if(!Z)return{value:"",type:null,comment:"",range:[X,X,X]};let H=Z.mode===">"?_1.Scalar.BLOCK_FOLDED:_1.Scalar.BLOCK_LITERAL,Q=q.source?L3(q.source):[],J=Q.length;for(let T=Q.length-1;T>=0;--T){let V=Q[T][1];if(V===""||V==="\r")J=T;else break}if(J===0){let T=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:T,type:H,comment:Z.comment,range:[X,V,V]}}let G=q.indent+Z.indent,U=q.offset+Z.length,B=0;for(let T=0;T<J;++T){let[V,D]=Q[T];if(D===""||D==="\r"){if(Z.indent===0&&V.length>G)G=V.length}else{if(V.length<G)z(U+V.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(Z.indent===0)G=V.length;if(B=T,G===0&&!$.atRoot)z(U,"BAD_INDENT","Block scalar values in collections must be indented");break}U+=V.length+D.length+1}for(let T=Q.length-1;T>=J;--T)if(Q[T][0].length>G)J=T+1;let Y="",W="",L=!1;for(let T=0;T<B;++T)Y+=Q[T][0].slice(G)+`
98
+ `;for(let T=B;T<J;++T){let[V,D]=Q[T];U+=V.length+D.length+1;let R=D[D.length-1]==="\r";if(R)D=D.slice(0,-1);if(D&&V.length<G){let K=`Block scalar lines must not be less indented than their ${Z.indent?"explicit indentation indicator":"first line"}`;z(U-D.length-(R?2:1),"BAD_INDENT",K),V=""}if(H===_1.Scalar.BLOCK_LITERAL)Y+=W+V.slice(G)+D,W=`
99
+ `;else if(V.length>G||D[0]==="\t"){if(W===" ")W=`
100
+ `;else if(!L&&W===`
101
+ `)W=`
102
+
103
+ `;Y+=W+V.slice(G)+D,W=`
104
+ `,L=!0}else if(D==="")if(W===`
105
+ `)Y+=`
106
+ `;else W=`
107
+ `;else Y+=W+D,W=" ",L=!1}switch(Z.chomp){case"-":break;case"+":for(let T=J;T<Q.length;++T)Y+=`
108
+ `+Q[T][0].slice(G);if(Y[Y.length-1]!==`
109
+ `)Y+=`
110
+ `;break;default:Y+=`
111
+ `}let _=X+Z.length+q.source.length;return{value:Y,type:H,comment:Z.comment,range:[X,_,_]}}function T3({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="",G=-1;for(let W=1;W<Z.length;++W){let L=Z[W];if(!J&&(L==="-"||L==="+"))J=L;else{let _=Number(L);if(!Q&&_)Q=_;else if(G===-1)G=$+W}}if(G!==-1)X(G,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${Z}`);let U=!1,B="",Y=Z.length;for(let W=1;W<q.length;++W){let L=q[W];switch(L.type){case"space":U=!0;case"newline":Y+=L.source.length;break;case"comment":if(z&&!U)X(L,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");Y+=L.source.length,B=L.source.substring(1);break;case"error":X(L,"UNEXPECTED_TOKEN",L.message),Y+=L.source.length;break;default:{let _=`Unexpected token in block scalar header: ${L.type}`;X(L,"UNEXPECTED_TOKEN",_);let T=L.source;if(T&&typeof T==="string")Y+=T.length}}}return{mode:H,indent:Q,chomp:J,comment:B,length:Y}}function L3($){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}V3.resolveBlockScalar=W3});var R1=I((F3)=>{var D1=y(),I3=A0();function D3($,q,z){let{offset:X,type:Z,source:H,end:Q}=$,J,G,U=(W,L,_)=>z(X+W,L,_);switch(Z){case"scalar":J=D1.Scalar.PLAIN,G=R3(H,U);break;case"single-quoted-scalar":J=D1.Scalar.QUOTE_SINGLE,G=M3(H,U);break;case"double-quoted-scalar":J=D1.Scalar.QUOTE_DOUBLE,G=w3(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,Y=I3.resolveEnd(Q,B,q,z);return{value:G,type:J,comment:Y.comment,range:[X,B,Y.offset]}}function R3($,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 c9($)}function M3($,q){if($[$.length-1]!=="'"||$.length===1)q($.length,"MISSING_CHAR","Missing closing 'quote");return c9($.slice(1,-1)).replace(/''/g,"'")}function c9($){let q,z;try{q=new RegExp(`(.*?)(?<![ ])[ ]*\r?
112
112
  `,"sy"),z=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
113
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
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]===`
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 w3($,q){let z="";for(let X=1;X<$.length-1;++X){let Z=$[X];if(Z==="\r"&&$[X+1]===`
116
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===`
117
+ `){let{fold:H,offset:Q}=P3($,X);z+=H,X=Q}else if(Z==="\\"){let H=$[++X],Q=K3[H];if(Q)z+=Q;else if(H===`
118
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!==`
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+=O3($,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
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===`
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 P3($,q){let z="",X=$[q+1];while(X===" "||X==="\t"||X===`
122
122
  `||X==="\r"){if(X==="\r"&&$[q+2]!==`
123
123
  `)break;if(X===`
124
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?`
125
+ `;q+=1,X=$[q+1]}if(!z)z=" ";return{fold:z,offset:q}}var K3={"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 O3($,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)}F3.resolveFlowScalar=D3});var a9=I((C3)=>{var B0=A(),i9=y(),j3=I1(),S3=R1();function N3($,q,z,X){let{value:Z,type:H,comment:Q,range:J}=q.type==="block-scalar"?j3.resolveBlockScalar($,q,X):S3.resolveFlowScalar(q,$.options.strict,X),G=z?$.directives.tagName(z.source,(Y)=>X(z,"TAG_RESOLVE_FAILED",Y)):null,U;if($.options.stringKeys&&$.atKey)U=$.schema[B0.SCALAR];else if(G)U=E3($.schema,Z,G,z,X);else if(q.type==="scalar")U=b3($,Z,q,X);else U=$.schema[B0.SCALAR];let B;try{let Y=U.resolve(Z,(W)=>X(z??q,"TAG_RESOLVE_FAILED",W),$.options);B=B0.isScalar(Y)?Y:new i9.Scalar(Y)}catch(Y){let W=Y instanceof Error?Y.message:String(Y);X(z??q,"TAG_RESOLVE_FAILED",W),B=new i9.Scalar(Z)}if(B.range=J,B.source=Z,H)B.type=H;if(G)B.tag=G;if(U.format)B.format=U.format;if(Q)B.comment=Q;return B}function E3($,q,z,X,Z){if(z==="!")return $[B0.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"),$[B0.SCALAR]}function b3({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[B0.SCALAR];if(z.compat){let J=z.compat.find((G)=>G.default&&G.test?.test(X))??z[B0.SCALAR];if(Q.tag!==J.tag){let G=q.tagString(Q.tag),U=q.tagString(J.tag),B=`Value may be parsed as either ${G} or ${U}`;H(Z,"TAG_RESOLVE_FAILED",B,!0)}}return Q}C3.composeScalar=N3});var s9=I((k3)=>{function f3($,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 $}k3.emptyScalarPosition=f3});var o9=I((l3)=>{var h3=h0(),g3=A(),v3=l9(),r9=a9(),u3=A0(),m3=s9(),d3={composeNode:n9,composeEmptyNode:M1};function n9($,q,z,X){let Z=$.atKey,{spaceBefore:H,comment:Q,anchor:J,tag:G}=z,U,B=!0;switch(q.type){case"alias":if(U=p3($,q,X),J||G)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=r9.composeScalar($,q,G,X),J)U.anchor=J.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":if(U=v3.composeCollection(d3,$,q,z,X),J)U.anchor=J.source.substring(1);break;default:{let Y=q.type==="error"?q.message:`Unsupported token (type: ${q.type})`;X(q,"UNEXPECTED_TOKEN",Y),U=M1($,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&&(!g3.isScalar(U)||typeof U.value!=="string"||U.tag&&U.tag!=="tag:yaml.org,2002:str"))X(G??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 M1($,q,z,X,{spaceBefore:Z,comment:H,anchor:Q,tag:J,end:G},U){let B={type:"scalar",offset:m3.emptyScalarPosition(q,z,X),indent:-1,source:""},Y=r9.composeScalar($,B,J,U);if(Q){if(Y.anchor=Q.source.substring(1),Y.anchor==="")U(Q,"BAD_ALIAS","Anchor cannot be an empty string")}if(Z)Y.spaceBefore=!0;if(H)Y.comment=H,Y.range[2]=G;return Y}function p3({options:$},{offset:q,source:z,end:X},Z){let H=new h3.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=u3.resolveEnd(X,Q,$.strict,Z);if(H.range=[q,Q,J.offset],J.comment)H.comment=J.comment;return H}l3.composeEmptyNode=M1;l3.composeNode=n9});var e9=I((o3)=>{var a3=t0(),t9=o9(),s3=A0(),r3=$$();function n3($,q,{offset:z,start:X,value:Z,end:H},Q){let J=Object.assign({_directives:q},$),G=new a3.Document(void 0,J),U={atKey:!1,atRoot:!0,directives:G.directives,options:G.options,schema:G.schema},B=r3.resolveProps(X,{indicator:"doc-start",next:Z??H?.[0],offset:z,onError:Q,parentIndent:0,startOnNewline:!0});if(B.found){if(G.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")}G.contents=Z?t9.composeNode(U,Z,B,Q):t9.composeEmptyNode(U,B.end,X,null,B,Q);let Y=G.contents.range[2],W=s3.resolveEnd(H,Y,!1,Q);if(W.comment)G.comment=W.comment;return G.range=[z,Y,W.offset],G}o3.composeDoc=n3});var w1=I((ZQ)=>{var e3=a("process"),$Q=Fq(),qQ=t0(),q$=e0(),$4=A(),zQ=e9(),XQ=A0();function z$($){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 q4($){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
- `)+(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}
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 z4{constructor($={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(q,z,X,Z)=>{let H=z$(q);if(Z)this.warnings.push(new q$.YAMLWarning(H,z,X));else this.errors.push(new q$.YAMLParseError(H,z,X))},this.directives=new $Q.Directives({version:$.version||"1.2"}),this.options=$}decorate($,q){let{comment:z,afterEmptyLine:X}=q4(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($4.isCollection(Z)&&!Z.flow&&Z.items.length>0){let H=Z.items[0];if($4.isPair(H))H=H.key;let Q=H.commentBefore;H.commentBefore=Q?`${z}
131
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:`
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:q4(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(e3.env.LOG_STREAM)console.dir($,{depth:null});switch($.type){case"directive":this.directives.add($.source,(q,z,X)=>{let Z=z$($);Z[0]+=q,this.onError(Z,"BAD_DIRECTIVE",z,X)}),this.prelude.push($.source),this.atDirectives=!0;break;case"document":{let q=zQ.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 q$.YAMLParseError(z$($),"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 q$.YAMLParseError(z$($),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let q=XQ.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 q$.YAMLParseError(z$($),"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 qQ.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}}}ZQ.Composer=z4});var H4=I((TQ)=>{var QQ=I1(),JQ=R1(),UQ=e0(),X4=m0();function GQ($,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 UQ.YAMLParseError([J,J+1],H,Q)};switch($.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return JQ.resolveFlowScalar($,q,X);case"block-scalar":return QQ.resolveBlockScalar({options:{strict:q}},$,X)}}return null}function YQ($,q){let{implicitKey:z=!1,indent:X,inFlow:Z=!1,offset:H=-1,type:Q="PLAIN"}=q,J=X4.stringifyString({type:Q,value:$},{implicitKey:z,indent:X>0?" ".repeat(X):"",inFlow:Z,options:{blockQuote:!0,lineWidth:-1}}),G=q.end??[{type:"newline",offset:-1,indent:X,source:`
134
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(`
135
+ `),B=J.substring(0,U),Y=J.substring(U+1)+`
136
+ `,W=[{type:"block-scalar-header",offset:H,indent:X,source:B}];if(!Z4(W,G))W.push({type:"newline",offset:-1,indent:X,source:`
137
+ `});return{type:"block-scalar",offset:H,indent:X,props:W,source:Y}}case'"':return{type:"double-quoted-scalar",offset:H,indent:X,source:J,end:G};case"'":return{type:"single-quoted-scalar",offset:H,indent:X,source:J,end:G};default:return{type:"scalar",offset:H,indent:X,source:J,end:G}}}function BQ($,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 G=X4.stringifyString({type:Q,value:q},{implicitKey:Z||J===null,indent:J!==null&&J>0?" ".repeat(J):"",inFlow:H,options:{blockQuote:!0,lineWidth:-1}});switch(G[0]){case"|":case">":WQ($,G);break;case'"':P1($,G,"double-quoted-scalar");break;case"'":P1($,G,"single-quoted-scalar");break;default:P1($,G,"scalar")}}function WQ($,q){let z=q.indexOf(`
138
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`
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(!Z4(J,"end"in $?$.end:void 0))J.push({type:"newline",offset:-1,indent:Q,source:`
140
+ `});for(let G of Object.keys($))if(G!=="type"&&G!=="offset")delete $[G];Object.assign($,{type:"block-scalar",indent:Q,props:J,source:Z})}}function Z4($,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 P1($,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})}}}TQ.createScalarToken=YQ;TQ.resolveAsScalar=GQ;TQ.setScalarValue=BQ});var Q4=I((DQ)=>{var IQ=($)=>("type"in $)?s$($):a$($);function s$($){switch($.type){case"block-scalar":{let q="";for(let z of $.props)q+=s$(z);return q+$.source}case"block-map":case"block-seq":{let q="";for(let z of $.items)q+=a$(z);return q}case"flow-collection":{let q=$.start.source;for(let z of $.items)q+=a$(z);for(let z of $.end)q+=z.source;return q}case"document":{let q=a$($);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 a$({start:$,key:q,sep:z,value:X}){let Z="";for(let H of $)Z+=H.source;if(q)Z+=s$(q);if(z)for(let H of z)Z+=H.source;if(X)Z+=s$(X);return Z}DQ.stringify=IQ});var G4=I((wQ)=>{var K1=Symbol("break visit"),MQ=Symbol("skip children"),J4=Symbol("remove item");function W0($,q){if("type"in $&&$.type==="document")$={start:$.start,value:$.value};U4(Object.freeze([]),$,q)}W0.BREAK=K1;W0.SKIP=MQ;W0.REMOVE=J4;W0.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};W0.parentCollection=($,q)=>{let z=W0.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 U4($,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=U4(Object.freeze($.concat([[Z,Q]])),H.items[Q],z);if(typeof J==="number")Q=J-1;else if(J===K1)return K1;else if(J===J4)H.items.splice(Q,1),Q-=1}if(typeof X==="function"&&Z==="key")X=X(q,$)}}return typeof X==="function"?X(q,$):X}wQ.visit=W0});var r$=I((NQ)=>{var O1=H4(),KQ=Q4(),OQ=G4(),F1="\uFEFF",A1="\x02",j1="\x18",S1="\x1F",FQ=($)=>!!$&&("items"in $),AQ=($)=>!!$&&($.type==="scalar"||$.type==="single-quoted-scalar"||$.type==="double-quoted-scalar"||$.type==="block-scalar");function jQ($){switch($){case F1:return"<BOM>";case A1:return"<DOC>";case j1:return"<FLOW_END>";case S1:return"<SCALAR>";default:return JSON.stringify($)}}function SQ($){switch($){case F1:return"byte-order-mark";case A1:return"doc-mode";case j1:return"flow-error-end";case S1: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($[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===`
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}NQ.createScalarToken=O1.createScalarToken;NQ.resolveAsScalar=O1.resolveAsScalar;NQ.setScalarValue=O1.setScalarValue;NQ.stringify=KQ.stringify;NQ.visit=OQ.visit;NQ.BOM=F1;NQ.DOCUMENT=A1;NQ.FLOW_END=j1;NQ.SCALAR=S1;NQ.isCollection=FQ;NQ.isScalar=AQ;NQ.prettyToken=jQ;NQ.tokenType=SQ});var E1=I((cQ)=>{var X$=r$();function m($){switch($){case void 0:case" ":case`
144
+ `:case"\r":case"\t":return!0;default:return!1}}var Y4=new Set("0123456789ABCDEFabcdef"),pQ=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),n$=new Set(",[]{}"),lQ=new Set(` ,[]{}
145
+ \r `),N1=($)=>!$||lQ.has($);class B4{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
146
  `)return!0;if(q==="\r")return this.buffer[$+1]===`
147
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
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(`
149
+ `||z>=this.indentNext||!q&&!this.atEnd?$+z:-1}if(q==="-"||q==="."){let z=this.buffer.substr($,3);if((z==="---"||z==="...")&&m(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]===X$.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 X$.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==="...")&&m(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&&!m(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(($==="-"||$==="?"||$===":")&&m(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(N1),"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("..."))&&m(X[3])){if(!(z===this.indentNext-1&&this.flowLevel===1&&(X[0]==="]"||X[0]==="}")))return this.flowLevel=0,yield X$.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(N1),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let H=this.charAt(1);if(this.flowKey||m(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
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`
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)=>m(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
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
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
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
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===`
157
+ `&&Z>=this.pos&&Z+1+q>Q)$=Z;else break}while(!0);return yield X$.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(m(Z)||$&&n$.has(Z))break;q=z}else if(m(X)){let Z=this.buffer[z+1];if(X==="\r")if(Z===`
158
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($===`
159
+ `,Z=this.buffer[z+1];else q=z;if(Z==="#"||$&&n$.has(Z))break;if(X===`
160
+ `){let H=this.continueScalar(z+1);if(H===-1)break;z=Math.max(z,H-2)}}else{if($&&n$.has(X))break;q=z}if(!X&&!this.atEnd)return this.setNext("plain-scalar");return yield X$.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(N1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let $=this.flowLevel>0,q=this.charAt(1);if(m(q)||$&&n$.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(!m(q)&&q!==">")q=this.buffer[++$];return yield*this.pushToIndex(q===">"?$+1:$,!1)}else{let $=this.pos+1,q=this.buffer[$];while(q)if(pQ.has(q))q=this.buffer[++$];else if(q==="%"&&Y4.has(this.buffer[$+1])&&Y4.has(this.buffer[$+2]))q=this.buffer[$+=3];else break;return yield*this.pushToIndex($,!1)}}*pushNewline(){let $=this.buffer[this.pos];if($===`
161
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(`
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)}}cQ.Lexer=B4});var b1=I((aQ)=>{class W4{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}}}}aQ.LineCounter=W4});var C1=I((oQ)=>{var rQ=a("process"),T4=r$(),nQ=E1();function Z0($,q){for(let z=0;z<$.length;++z)if($[z].type===q)return!0;return!1}function L4($){for(let q=0;q<$.length;++q)switch($[q].type){case"space":case"comment":case"newline":break;default:return q}return-1}function _4($){switch($?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function o$($){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 j0($){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 V4($){if($.start.type==="flow-seq-start"){for(let q of $.items)if(q.sep&&!q.value&&!Z0(q.start,"explicit-key-ind")&&!Z0(q.sep,"map-value-ind")){if(q.key)q.value=q.key;if(delete q.key,_4(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 I4{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 nQ.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=$,rQ.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")V4(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&&L4(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(L4($.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=o$(this.peek(2)),z=j0(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
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(`
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(Z0(q.start,"newline"))Object.assign(q,{key:null,sep:[this.sourceToken]});else{let H=j0(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(Z0(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(_4(q.key)&&!Z0(q.sep,"newline")){let H=j0(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(Z0(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&&!Z0(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||Z0(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=o$(z),Z=j0(X);V4($);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
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
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=o$($),z=j0(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=o$($),z=j0(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()}}}oQ.Parser=I4});var P4=I((Q7)=>{var D4=w1(),eQ=t0(),Z$=e0(),$7=bq(),q7=A(),z7=b1(),R4=C1();function M4($){let q=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||q&&new z7.LineCounter||null,prettyErrors:q}}function X7($,q={}){let{lineCounter:z,prettyErrors:X}=M4(q),Z=new R4.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}=M4(q),Z=new R4.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 Z7($,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)=>$7.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 H7($,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(q7.isDocument($)&&!X)return $.toString(z);return new eQ.Document($,X,z).toString(z)}Q7.parse=Z7;Q7.parseAllDocuments=X7;Q7.parseDocument=w4;Q7.stringify=H7});var O4=I((K7)=>{var B7=w1(),W7=t0(),T7=H1(),y1=e0(),L7=h0(),H0=A(),V7=$0(),_7=y(),I7=z0(),D7=X0(),R7=r$(),M7=E1(),w7=b1(),P7=C1(),t$=P4(),K4=k0();K7.Composer=B7.Composer;K7.Document=W7.Document;K7.Schema=T7.Schema;K7.YAMLError=y1.YAMLError;K7.YAMLParseError=y1.YAMLParseError;K7.YAMLWarning=y1.YAMLWarning;K7.Alias=L7.Alias;K7.isAlias=H0.isAlias;K7.isCollection=H0.isCollection;K7.isDocument=H0.isDocument;K7.isMap=H0.isMap;K7.isNode=H0.isNode;K7.isPair=H0.isPair;K7.isScalar=H0.isScalar;K7.isSeq=H0.isSeq;K7.Pair=V7.Pair;K7.Scalar=_7.Scalar;K7.YAMLMap=I7.YAMLMap;K7.YAMLSeq=D7.YAMLSeq;K7.CST=R7;K7.Lexer=M7.Lexer;K7.LineCounter=w7.LineCounter;K7.Parser=P7.Parser;K7.parse=t$.parse;K7.parseAllDocuments=t$.parseAllDocuments;K7.parseDocument=t$.parseDocument;K7.stringify=t$.stringify;K7.visit=K4.visit;K7.visitAsync=K4.visitAsync});var L2=o1(T2(),1),{program:_0,createCommand:EU,createArgument:bU,createOption:CU,CommanderError:yU,InvalidArgumentError:fU,InvalidOptionArgumentError:kU,Command:xU,Argument:hU,Option:Mq,Help:gU}=L2.default;var V2={name:"@pickled-dev/cli",version:"0.11.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 VU from"path";var l={category:"cli",provider:"claude-code",model:"sonnet"},wq=["Read","Glob","Grep","Bash"],Pq=["Edit","MultiEdit","Write","NotebookEdit"];var F4=o1(O4(),1);async function S0($){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 e7(X),X}function e7($){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))qJ(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)"}`);ZJ(z.name,z.traps),$J(z.name,z.compareSurfaces,q)}}function $J($,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 qJ($,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 zJ=new Set(["g","y"]),XJ=new Set(["i","m","s","u","v"]);function ZJ($,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(zJ.has(J))throw Error(`pickled.yml: scenario "${$}" trap "${X.id}" uses forbidden regex flag "${J}" (g and y are not allowed)`);if(!XJ.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 f1($,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 k1($){if(typeof $==="string")return{path:$,auditTraps:!0};return{path:$.path,auditTraps:$.audit?.traps??!0}}function e$($){let{config:q,files:z,pairs:X,findings:Z}=$,H=[],Q=Z.filter((Y)=>Y.severity==="error").length,J=Z.filter((Y)=>Y.severity==="warning").length;if(H.push(`# Agent-context audit
167
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
168
  `),H.push(`## Inventory
169
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
170
+ `);else{H.push("| File | Lines | Kind | Notes |"),H.push("|---|---|---|---|");let Y=[...z].sort((W,L)=>L.lineCount-W.lineCount);for(let W of Y){let L=!W.relPath.includes("/"),_=A4(W.lineCount,L,q),T=W.isSymlink?`symlink \u2192 ${W.symlinkTarget?.replace(`${q.targetRepo}/`,"")??"?"}`:"file";H.push(`| \`${W.relPath}\` | ${W.lineCount} | ${T} | ${_} |`)}H.push("")}if(H.push(`## AGENTS.md / CLAUDE.md pairs
171
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)
172
+ `);else{H.push("| Directory | A | C | Class | Detail |"),H.push("|---|---|---|---|---|");for(let Y of X)H.push(`| \`${Y.dir||"(root)"}\` | ${Y.agentsExists?"\u2713":"\xB7"} | ${Y.claudeExists?"\u2713":"\xB7"} | ${Y.classification} | ${Y.detail} |`);H.push("")}let G=z.filter((Y)=>!Y.isSymlink&&Y.brokenPathRefs.length+Y.brokenImports.length>0);if(H.push(`## Broken references
173
+ `),G.length===0)H.push(`None detected.
174
+ `);else for(let Y of G){if(H.push(`### \`${Y.relPath}\`
175
+ `),Y.brokenPathRefs.length>0){H.push("Broken path references:");for(let W of Y.brokenPathRefs)H.push(` - \`${W}\``);H.push("")}if(Y.brokenImports.length>0){H.push("Broken `@`-imports:");for(let W of Y.brokenImports)H.push(` - \`${W}\``);H.push("")}}let U=z.filter((Y)=>!Y.isSymlink&&Y.unresolvedCommands.length>0);if(H.push(`## Unresolved package-manager commands (advisory)
176
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
177
+ `);else for(let Y of U){H.push(`### \`${Y.relPath}\`
178
+ `);for(let W of Y.unresolvedCommands)H.push(` - \`${W}\``);H.push("")}let B=z.filter((Y)=>{if(Y.isSymlink)return!1;return!Y.relPath.includes("/")?Y.lineCount>q.budgets.rootLines:Y.lineCount>q.budgets.nestedWarnLines});if(H.push(`## Section breakdown for files over budget
179
179
  `),B.length===0)H.push(`All files within budget.
180
- `);else for(let G of B){H.push(`### \`${G.relPath}\` (${G.lineCount} lines)
180
+ `);else for(let Y of B){H.push(`### \`${Y.relPath}\` (${Y.lineCount} lines)
181
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
182
+ `),H.push("| Section | Lines |"),H.push("|---|---|");for(let W of Y.sections.slice(0,10))H.push(`| ${W.header} | ${W.lines} |`);H.push("")}if(H.push(`## Registered-source trap matches
183
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(`
184
+ `);else{for(let Y of $.sourceTrapMatches)H.push(`- **${Y.sourceId}** (\`${Y.sourcePath}:L${Y.line}\`) \u2014 trap \`${Y.trapId}\` matched \`${Y.matched}\` (${Y.severity})`),H.push(` - reason: ${Y.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 $q($){return JSON.stringify($,null,2)}function qq($){let{config:q,files:z,pairs:X,findings:Z}=$,H=[],Q=Z.filter((Y)=>Y.severity==="error").length,J=Z.filter((Y)=>Y.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 Y=[...z].sort((L,_)=>_.lineCount-L.lineCount),W=Math.max(...Y.map((L)=>L.relPath.length));for(let L of Y){let _=!L.relPath.includes("/"),T=A4(L.lineCount,_,q),V=L.isSymlink?`symlink \u2192 ${L.symlinkTarget?.replace(`${q.targetRepo}/`,"")??"?"}`:"file",D=`${L.lineCount}`.padStart(4),R=L.relPath.padEnd(W),w=T?` (${T})`:"";H.push(` ${R} ${D} lines ${V}${w}`)}}if(H.push(""),H.push("AGENTS.md / CLAUDE.md pairs"),X.length===0)H.push(" none");else for(let Y of X){let W=Y.dir||"(root)";H.push(` ${W}: ${Y.classification} \xB7 ${Y.detail}`)}H.push("");let G=z.filter((Y)=>!Y.isSymlink&&Y.brokenPathRefs.length+Y.brokenImports.length>0);if(H.push("Broken references"),G.length===0)H.push(" none");else for(let Y of G){H.push(` ${Y.relPath}:`);for(let W of Y.brokenPathRefs)H.push(` path: ${W}`);for(let W of Y.brokenImports)H.push(` @-import: ${W}`)}H.push("");let U=z.filter((Y)=>!Y.isSymlink&&Y.unresolvedCommands.length>0);if(H.push("Unresolved package-manager commands (advisory)"),U.length===0)H.push(" none");else for(let Y of U){H.push(` ${Y.relPath}:`);for(let W of Y.unresolvedCommands)H.push(` ${W}`)}H.push("");let B=z.filter((Y)=>{if(Y.isSymlink)return!1;return!Y.relPath.includes("/")?Y.lineCount>q.budgets.rootLines:Y.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 Y of B){H.push(` ${Y.relPath} (${Y.lineCount} lines):`);for(let W of Y.sections.slice(0,10))H.push(` ${W.header.padEnd(40)} ${W.lines} lines`)}if(H.push(""),H.push("Registered-source trap matches"),$.sourceTrapMatches.length===0)H.push(" none");else for(let Y of $.sourceTrapMatches){let W=Y.severity==="error"?"error":"warning";H.push(` [${W}] ${Y.sourceId} (${Y.sourcePath}:L${Y.line}): trap ${Y.trapId} matched "${Y.matched}"`),H.push(` reason: ${Y.trapReason}`),H.push(" fix: remove the stale claim, retire the trap, or set audit.traps: false on the source")}return H.join(`
186
+ `)}function A4($,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 E0,lstatSync as b4,readFileSync as Zq,readlinkSync as WJ,statSync as TJ}from"fs";import{dirname as Hq,isAbsolute as LJ,join as h1,relative as VJ,resolve as g1}from"path";var{Glob:E4}=globalThis.Bun;var zq=["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/**"],N0={targetRepo:".",budgets:{rootLines:120,nestedWarnLines:200},ignore:zq,intentionalDifferentPairs:[],knownCommands:[]};function Xq($){if(!$)return N0;return{targetRepo:$.targetRepo??N0.targetRepo,budgets:{rootLines:$.budgets?.rootLines??N0.budgets.rootLines,nestedWarnLines:$.budgets?.nestedWarnLines??N0.budgets.nestedWarnLines},ignore:$.ignore??zq,intentionalDifferentPairs:$.intentionalDifferentPairs??[],knownCommands:$.knownCommands??[]}}import{existsSync as GJ}from"fs";import{join as YJ}from"path";function T0($){let q=[],z=[];for(let X of $.traps){let Z=HJ($.response,X);if(Z)q.push(Z);else z.push(X.id)}return{fired:q,avoided:z}}function HJ($,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:j4($,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:j4($,X.index,X[0].length),index:X.index}}return null}function j4($,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 x1 from"path";function QJ($){return $.startsWith("http://")||$.startsWith("https://")}async function JJ($,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 UJ($,q,z,X){let Z=x1.isAbsolute(q)?q:x1.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:x1.basename(Z),type:"file",auditTraps:X}}async function S4($,q,z){let{path:X,auditTraps:Z}=k1(q);if(QJ(X))return JJ($,X,Z);return UJ($,X,z,Z)}async function H$($,q){let z=Object.entries($);return await Promise.all(z.map(([Z,H])=>S4(Z,H,q)))}async function N4($){if(!GJ(YJ($,"pickled.yml")))return{matches:[],findings:[]};let q=await S0($),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 Y=typeof B==="string"?B:B.path;if(Y.startsWith("http://")||Y.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 H$(X,$),J=[],G=[];for(let U of Q){if(U.auditTraps===!1)continue;for(let B of Z){let{fired:Y}=T0({response:U.content,traps:[B]}),W=Y[0];if(!W)continue;let L=BJ(U.content,W.index),_=H.get(B)??"warning";J.push({sourceId:U.id,sourcePath:U.source,trapId:W.id,trapReason:W.reason,matched:W.matched,snippet:W.snippet,line:L,severity:_}),G.push({severity:_,category:"trap-source-match",file:U.source,message:`source [${U.id}] matches trap '${W.id}' ("${W.matched}"). ${W.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:G}}function BJ($,q){let z=1,X=Math.min(q,$.length);for(let Z=0;Z<X;Z++)if($[Z]===`
187
+ `)z++;return z}var _J=["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 Qq($){let q=Xq($),z=g1(q.targetRepo);if(!E0(z))throw Error(`targetRepo does not exist: ${z}`);let X=new Set;for(let U of _J){let B=new E4(U);for await(let Y of B.scan({cwd:z,dot:!0,onlyFiles:!1,followSymlinks:!1})){if(q.ignore.some((_)=>new E4(_).match(Y)))continue;let W=h1(z,Y),L=b4(W);if(L.isFile()){X.add(Y);continue}if(L.isSymbolicLink())try{if(TJ(W).isFile())X.add(Y)}catch{}}}let Z=[];for(let U of[...X].sort())Z.push(await IJ(z,U,h1(z,U),q));let H=NJ(Z,q),Q=EJ(Z,H,q),{matches:J,findings:G}=await N4(z);return{config:q,files:Z,pairs:H,findings:[...Q,...G],sourceTrapMatches:J}}async function IJ($,q,z,X){let H=b4(z).isSymbolicLink(),Q=null,J=q;if(H){let W=WJ(z),L=LJ(W)?W:g1(Hq(z),W);if(Q=L,E0(L))J=VJ($,L)}let G=H&&Q&&E0(Q)?Q:z,U=Zq(G,"utf8"),B=(U.match(/\n/g)??[]).length,Y=U.endsWith(`
188
+ `)?B:B+1;return{relPath:q,absPath:z,isSymlink:H,symlinkTarget:Q,realRelPath:J,lineCount:Y,brokenPathRefs:RJ(U,$,q),brokenImports:wJ(U,Hq(z)),unresolvedCommands:FJ(U,$,X.knownCommands),sections:AJ(U)}}function DJ($){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 RJ($,q,z){let X=SJ($),Z=Hq(z),H=DJ(z),Q=new Set,J=/`([^`\n]{2,200})`/g,G;G=J.exec(X);while(G!==null){let U=G[1].trim().replace(/[#?].*$/,"");if(jJ(U)&&!MJ(q,U,Z,H).found)Q.add(U);G=J.exec(X)}return[...Q].sort()}function MJ($,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(E0(`${$}/${Q}`))return{found:!0,resolvedAs:Q}}return{found:!1}}function wJ($,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:g1(q,H);if(!E0(Q))z.add(H);Z=X.exec($)}return[...z].sort()}var PJ=["bun","pnpm","npm","yarn"],KJ=new Set(["install","add","remove","update","i","audit","list","ls","why","outdated","exec","run","create","init","x"]),OJ={bun:new Set(["build","test","link","unlink","upgrade"])};function FJ($,q,z){let X=new Set,Z=h1(q,"package.json"),H=new Set;if(E0(Z))try{let J=JSON.parse(Zq(Z,"utf8"));H=new Set(Object.keys(J.scripts??{}))}catch{}let Q=new Set(z.map((J)=>J.trim()));for(let J of PJ){let G=new RegExp(`\\b${J}\\s+(?:run\\s+|--filter\\s+\\S+\\s+(?:run\\s+)?)?([a-zA-Z][\\w:.\\-]*)`,"g"),U;U=G.exec($);while(U!==null){let B=U[1];if(!H.has(B)&&!Q.has(`${J} ${B}`)&&!Q.has(`${J} run ${B}`)&&!KJ.has(B)&&!OJ[J]?.has(B))X.add(`${J} ${B}`);U=G.exec($)}}return[...X].sort()}function AJ($){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 jJ($){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 SJ($){return $.replace(/```[\s\S]*?```/g,"")}function NJ($,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=Hq(H.relPath),G=z.get(J)??{};if(Q==="AGENTS.md")G.agents=H;if(Q==="CLAUDE.md")G.claude=H;z.set(J,G)}let X=new Set(q.intentionalDifferentPairs),Z=[];for(let[H,Q]of z){let J=!!Q.agents,G=!!Q.claude;if(!J&&!G)continue;if(!J||!G){Z.push({dir:H,agentsExists:J,claudeExists:G,classification:"single",detail:J?"only AGENTS.md":"only CLAUDE.md"});continue}let{agents:U,claude:B}=Q,Y=`${U.relPath}:${B.relPath}`,W=`${B.relPath}:${U.relPath}`;if(X.has(Y)||X.has(W)){Z.push({dir:H,agentsExists:J,claudeExists:G,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:G,classification:"linked",detail:`canonical: ${V}`});continue}let _=Zq(U.absPath,"utf8"),T=Zq(B.absPath,"utf8");if(_===T)Z.push({dir:H,agentsExists:J,claudeExists:G,classification:"unexpected-duplicate",detail:`byte-for-byte duplicate (${U.lineCount}L), not symlinked`});else Z.push({dir:H,agentsExists:J,claudeExists:G,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 EJ($,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 L0($){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 v1($){let q=bJ($);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 bJ($){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 Q$($){let q=v1($.response),z=new Set(q.map((W)=>W.id)),X=new Set($.registeredIds),Z=new Set($.requiredSources),H=[...z],Q=[...Z].filter((W)=>!z.has(W)),J=[...z].filter((W)=>!X.has(W)),G=[...Z],U,B,Y;if(H.length===0)U="NO",B=0,Y="No citations in response";else if(J.length===H.length)U="NO",B=0,Y=`All cited sources are unknown: ${J.join(", ")}`;else if(Q.length===0&&J.length===0)U="YES",B=100,Y=G.length>0?`All required sources cited: ${G.join(", ")}`:`Cited registered sources: ${H.join(", ")}`;else{U="PARTIAL";let W=G.length>0?G.length:1,L=G.length-Q.length,_=G.length>0?L/W*100:60,T=J.length*15;B=Math.max(0,Math.min(100,Math.round(_-T)));let V=[];if(Q.length>0)V.push(`missing: ${Q.join(", ")}`);if(J.length>0)V.push(`unknown: ${J.join(", ")}`);Y=V.join("; ")}return{answerable:U,confidence:B,reason:Y,citations:{cited:H,required:G,missing:Q,unknown:J}}}import{query as CJ}from"@anthropic-ai/claude-agent-sdk";function Jq($,q,z){let X=q.length>0?q.map((Q)=>`- ${Q.id}: ${Q.name} (${Q.source})`).join(`
190
190
  `):"(no sources provided)",Z=q.map((Q)=>`<source id="${Q.id}">
191
191
  ${Q.content.trimEnd()}
192
192
  </source>`).join(`
@@ -211,19 +211,19 @@ End your response with a "## Sources" section that lists every source you actual
211
211
  Rules:
212
212
  - Only cite IDs that appear in the inventory above. Do not invent IDs.
213
213
  - If you cannot answer from the provided sources, say so explicitly and write an empty "## Sources" section (just the heading, no bullets).
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)}
214
+ - The "## Sources" heading must be the last heading in your response.`}class u1{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=[],G=[],U=Jq(z,H,Q),B={cwd:X,model:this.config.model??"sonnet",systemPrompt:U,allowedTools:Z?.allowedTools??this.config.allowedTools??wq,disallowedTools:Z?.disallowedTools??this.config.disallowedTools??Pq,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:[]},Y=[],W="",L="";for await(let _ of CJ({prompt:$,options:B})){if(_.type==="assistant"){let T=_.message?.content;if(Array.isArray(T)){let V="";for(let D of T){if(D.type==="text")V+=D.text;if(D.type==="tool_use"){let R=D;if(!J.includes(R.name))J.push(R.name)}}if(V){let D=Y.length===0?"initial":"intermediate";Y.push({type:D,text:V}),W=V}}}if(_.type==="result"){let T=_;if(T.result)L=T.result}}if(Y.length>0)Y[Y.length-1].type="final";return{response:L||W,allResponses:Y,toolsUsed:J,sources:G,metadata:{model:this.config.model??"sonnet",category:this.category,provider:this.provider,target:this.name}}}}import{randomUUID as yJ}from"crypto";import{rm as fJ}from"fs/promises";import{tmpdir as kJ}from"os";import{join as xJ}from"path";var hJ="codex";class m1{category="cli";provider="codex-cli";name;config;spawnFn;readFileFn;binary;constructor($,q,z={}){this.name=$,this.config=q,this.spawnFn=z.spawn??mJ,this.readFileFn=z.readFile??dJ,this.binary=z.binary??hJ}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 G=`${Jq(z,Z,H)}
215
215
 
216
216
  ---
217
217
 
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
218
+ ${$}`,U=xJ(kJ(),`pickled-codex-${yJ()}.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 Y=await this.spawnFn(this.binary,B,{cwd:X,stdin:G}),{allResponses:W,toolsUsed:L}=gJ(Y.stdout);if(Y.exitCode!==0)throw Error(`codex exec failed (exit ${Y.exitCode}): ${Y.stderr.trim()||"no stderr output"}`);let _="";try{_=(await this.readFileFn(U)).trim()}catch{_=W.length>0?W[W.length-1].text:""}if(W.length>0)W[W.length-1].type="final";return{response:_,allResponses:W,toolsUsed:L,sources:[],metadata:{model:Q,category:this.category,provider:this.provider,target:this.name}}}finally{await fJ(U,{force:!0})}}}function gJ($){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=vJ(H);if(Q){let G=q.length===0?"initial":"intermediate";q.push({type:G,text:Q})}let J=uJ(H);if(J&&!z.includes(J))z.push(J)}return{allResponses:q,toolsUsed:z}}function vJ($){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 uJ($){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 mJ=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}},dJ=async($)=>{let q=Bun.file($);if(!await q.exists())throw Error(`Last-message file not found: ${$}`);return q.text()};function d1($,q){let z=q??l;switch(z.category){case"cli":return pJ($,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 pJ($,q){switch(q.provider){case"claude-code":return new u1($,q);case"codex-cli":return new m1($,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 b0="default";function p1($,q){if(!$||$===b0)return{name:b0,config:l};if(q?.[$])return{name:$,config:q[$]};return console.warn(`Target "${$}" not found, using default`),{name:b0,config:l}}function C4($,q){if(!$||$===b0)return{name:b0,config:{}};if(q?.[$])return{name:$,config:q[$]};return console.warn(`Context "${$}" not found, using default`),{name:b0,config:{}}}function lJ($){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 G of Q)q.push({scenario:Z,targetName:J,contextName:G})}return q}async function l1($,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 H$(H,$.path);for(let B of Q)X?.(` [${B.id}] ${B.name}`);X?.("")}let J=Q.map((B)=>B.id),G=lJ(q),U="";for(let{scenario:B,targetName:Y,contextName:W}of G){let L=cJ(Y,W);if(B.name!==U){if(U)X?.("");X?.(`"${B.name}"`),U=B.name}try{let _=await iJ(B,Y,W,$,q,Q,J,z);Z.push(_);let T=L?L.padEnd(18):"";if(_.surfaces){X?.(` ${T} (compare-surfaces mode)`);for(let V of _.surfaces){let D=L0(V),R=` [${V.active.join(",")}]`.padEnd(22);X?.(`${R} ${D.icon} ${D.label} (${D.confidence}%)`)}}else{let V=L0({answerable:_.answerable??"NO",confidence:_.confidence??0,traps:_.traps??{fired:[],avoided:[]},error:_.error});X?.(` ${T} ${V.icon} ${V.label} (${V.confidence}%)`)}}catch(_){let T=Y==="default"?l:q.targets?.[Y]??l,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:Y,category:T.category,provider:T.provider,model:T.model??"unknown"},context:{name:W}};Z.push(V);let D=L?L.padEnd(18):"";X?.(` ${D} \u2717 Error`)}}return X?.(""),aJ($,Q,Z)}function cJ($,q){if($==="default"&&q==="default")return"";if(q==="default")return`[${$}]`;return`[${$}/${q}]`}async function iJ($,q,z,X,Z,H,Q,J){let{config:G}=p1(q,Z.targets),{config:U}=C4(z,Z.contexts),B=J.targetFactory?J.targetFactory(q,G):d1(q,G);if($.compareSurfaces&&$.compareSurfaces.length>0){let R=[],w;for(let K of $.compareSurfaces){let O=new Set(K),F=H.filter((V0)=>O.has(V0.id)),S=$.requiredSources.filter((V0)=>O.has(V0)),M=await B.run($.prompt,{tool:X,cwd:X.path,context:U,docs:F,requiredSources:S,onProgress:J.onProgress}),N=Q$({response:M.response,requiredSources:S,registeredIds:K}),x=T0({response:M.response,traps:$.traps??[]}),p=x.fired.length>0,C=p?"NO":N.answerable,G$=p?0:N.confidence,q5=p?`Trap fired: ${x.fired.map((V0)=>`"${V0.id}" (${V0.reason})`).join("; ")}`:N.reason;R.push({active:K,answerable:C,confidence:G$,response:M.response,reason:q5,citations:N.citations,traps:x,allResponses:M.allResponses}),w=M.metadata??w}return{scenario:$,answerable:null,confidence:null,response:null,reason:null,citations:null,traps:null,surfaces:R,target:w,context:{name:z}}}let Y=await B.run($.prompt,{tool:X,cwd:X.path,context:U,docs:H,requiredSources:$.requiredSources,onProgress:J.onProgress}),W=Q$({response:Y.response,requiredSources:$.requiredSources,registeredIds:Q}),L=T0({response:Y.response,traps:$.traps??[]}),_=L.fired.length>0,T=_?"NO":W.answerable,V=_?0:W.confidence,D=_?`Trap fired: ${L.fired.map((R)=>`"${R.id}" (${R.reason})`).join("; ")}`:W.reason;return{scenario:$,answerable:T,confidence:V,response:Y.response,reason:D,citations:W.citations,traps:L,target:Y.metadata,context:{name:z},toolsUsed:Y.toolsUsed,sources:Y.sources,allResponses:Y.allResponses}}function aJ($,q,z){let X=[];for(let J of z){if(J.surfaces){for(let G of J.surfaces)X.push({answerable:G.answerable,confidence:G.confidence});continue}if(J.answerable!==null&&J.confidence!==null)X.push({answerable:J.answerable,confidence:J.confidence})}let Z=X.length,H=X.filter((J)=>J.answerable==="YES"||J.answerable==="PARTIAL").length,Q=Z>0?Math.round(X.reduce((J,G)=>{if(G.answerable==="YES")return J+G.confidence;if(G.answerable==="PARTIAL")return J+G.confidence*0.5;return J},0)/Z):0;return{tool:{name:$.name,description:$.description,path:$.path},docs:q,scenarios:z,summary:{total:Z,answered:H,unanswered:Z-H,score:Q}}}var y4=($=0)=>(q)=>`\x1B[${q+$}m`,f4=($=0)=>(q)=>`\x1B[${38+$};5;${q}m`,k4=($=0)=>(q,z,X)=>`\x1B[${38+$};2;${q};${z};${X}m`,E={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]}},UB=Object.keys(E.modifier),sJ=Object.keys(E.color),rJ=Object.keys(E.bgColor),GB=[...sJ,...rJ];function nJ(){let $=new Map;for(let[q,z]of Object.entries(E)){for(let[X,Z]of Object.entries(z))E[X]={open:`\x1B[${Z[0]}m`,close:`\x1B[${Z[1]}m`},z[X]=E[X],$.set(Z[0],Z[1]);Object.defineProperty(E,q,{value:z,enumerable:!1})}return Object.defineProperty(E,"codes",{value:$,enumerable:!1}),E.color.close="\x1B[39m",E.bgColor.close="\x1B[49m",E.color.ansi=y4(),E.color.ansi256=f4(),E.color.ansi16m=k4(),E.bgColor.ansi=y4(10),E.bgColor.ansi256=f4(10),E.bgColor.ansi16m=k4(10),Object.defineProperties(E,{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)=>E.rgbToAnsi256(...E.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)=>E.ansi256ToAnsi(E.rgbToAnsi256(q,z,X)),enumerable:!1},hexToAnsi:{value:(q)=>E.ansi256ToAnsi(E.hexToAnsi256(q)),enumerable:!1}}),E}var oJ=nJ(),d=oJ;import c1 from"process";import tJ from"os";import x4 from"tty";function v($,q=globalThis.Deno?globalThis.Deno.args:c1.argv){let z=$.startsWith("-")?"":$.length===1?"-":"--",X=q.indexOf(z+$),Z=q.indexOf("--");return X!==-1&&(Z===-1||X<Z)}var{env:b}=c1,Uq;if(v("no-color")||v("no-colors")||v("color=false")||v("color=never"))Uq=0;else if(v("color")||v("colors")||v("color=true")||v("color=always"))Uq=1;function eJ(){if("FORCE_COLOR"in b){if(b.FORCE_COLOR==="true")return 1;if(b.FORCE_COLOR==="false")return 0;return b.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(b.FORCE_COLOR,10),3)}}function $U($){if($===0)return!1;return{level:$,hasBasic:!0,has256:$>=2,has16m:$>=3}}function qU($,{streamIsTTY:q,sniffFlags:z=!0}={}){let X=eJ();if(X!==void 0)Uq=X;let Z=z?Uq:X;if(Z===0)return 0;if(z){if(v("color=16m")||v("color=full")||v("color=truecolor"))return 3;if(v("color=256"))return 2}if("TF_BUILD"in b&&"AGENT_NAME"in b)return 1;if($&&!q&&Z===void 0)return 0;let H=Z||0;if(b.TERM==="dumb")return H;if(c1.platform==="win32"){let Q=tJ.release().split(".");if(Number(Q[0])>=10&&Number(Q[2])>=10586)return Number(Q[2])>=14931?3:2;return 1}if("CI"in b){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((Q)=>(Q in b)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((Q)=>(Q in b))||b.CI_NAME==="codeship")return 1;return H}if("TEAMCITY_VERSION"in b)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(b.TEAMCITY_VERSION)?1:0;if(b.COLORTERM==="truecolor")return 3;if(b.TERM==="xterm-kitty")return 3;if(b.TERM==="xterm-ghostty")return 3;if(b.TERM==="wezterm")return 3;if("TERM_PROGRAM"in b){let Q=Number.parseInt((b.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(b.TERM_PROGRAM){case"iTerm.app":return Q>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(b.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(b.TERM))return 1;if("COLORTERM"in b)return 1;return H}function h4($,q={}){let z=qU($,{streamIsTTY:$&&$.isTTY,...q});return $U(z)}var zU={stdout:h4({isTTY:x4.isatty(1)}),stderr:h4({isTTY:x4.isatty(2)})},g4=zU;function v4($,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 u4($,q,z,X){let Z=0,H="";do{let Q=$[X-1]==="\r";H+=$.slice(Z,Q?X-1:X)+q+(Q?`\r
220
220
  `:`
221
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
222
+ `,Z)}while(X!==-1);return H+=$.slice(Z),H}var{stdout:m4,stderr:d4}=g4,i1=Symbol("GENERATOR"),C0=Symbol("STYLER"),J$=Symbol("IS_EMPTY"),p4=["ansi","ansi","ansi256","ansi16m"],y0=Object.create(null),XU=($,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=m4?m4.level:0;$.level=q.level===void 0?z:q.level};var ZU=($)=>{let q=(...z)=>z.join(" ");return XU(q,$),Object.setPrototypeOf(q,U$.prototype),q};function U$($){return ZU($)}Object.setPrototypeOf(U$.prototype,Function.prototype);for(let[$,q]of Object.entries(d))y0[$]={get(){let z=Gq(this,s1(q.open,q.close,this[C0]),this[J$]);return Object.defineProperty(this,$,{value:z}),z}};y0.visible={get(){let $=Gq(this,this[C0],!0);return Object.defineProperty(this,"visible",{value:$}),$}};var a1=($,q,z,...X)=>{if($==="rgb"){if(q==="ansi16m")return d[z].ansi16m(...X);if(q==="ansi256")return d[z].ansi256(d.rgbToAnsi256(...X));return d[z].ansi(d.rgbToAnsi(...X))}if($==="hex")return a1("rgb",q,z,...d.hexToRgb(...X));return d[z][$](...X)},HU=["rgb","hex","ansi256"];for(let $ of HU){y0[$]={get(){let{level:z}=this;return function(...X){let Z=s1(a1($,p4[z],"color",...X),d.color.close,this[C0]);return Gq(this,Z,this[J$])}}};let q="bg"+$[0].toUpperCase()+$.slice(1);y0[q]={get(){let{level:z}=this;return function(...X){let Z=s1(a1($,p4[z],"bgColor",...X),d.bgColor.close,this[C0]);return Gq(this,Z,this[J$])}}}}var QU=Object.defineProperties(()=>{},{...y0,level:{enumerable:!0,get(){return this[i1].level},set($){this[i1].level=$}}}),s1=($,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}},Gq=($,q,z)=>{let X=(...Z)=>JU(X,Z.length===1?""+Z[0]:Z.join(" "));return Object.setPrototypeOf(X,QU),X[i1]=$,X[C0]=q,X[J$]=z,X},JU=($,q)=>{if($.level<=0||!q)return $[J$]?"":q;let z=$[C0];if(z===void 0)return q;let{openAll:X,closeAll:Z}=z;if(q.includes("\x1B"))while(z!==void 0)q=v4(q,z.close,z.open),z=z.parent;let H=q.indexOf(`
223
+ `);if(H!==-1)q=u4(q,Z,X,H);return X+q+Z};Object.defineProperties(U$.prototype,y0);var UU=U$(),RB=U$({level:d4?d4.level:0});var P=UU;var l4="\u2500".repeat(55);function s4($){if($==="success")return P.green;if($==="warning")return P.yellow;return P.red}function GU($){if($>=70)return P.green;if($>=50)return P.yellow;return P.red}function r4($){if($.label==="Error")return $.label;return`${$.label} (${$.confidence}%)`}function YU($){let q=L0({answerable:$.answerable??"NO",confidence:$.confidence??0,traps:$.traps??{fired:[],avoided:[]},error:$.error}),z=s4(q.tone);return{icon:z(q.icon),status:r4(q),color:z}}function BU($){let q=$.target?.target??"default",z=$.context?.name??"default";if(q==="default"&&z==="default")return"";if(z==="default")return P.dim(`[${q}]`);return P.dim(`[${q}/${z}]`)}function WU($){let q=$.map((z)=>z.scenario.name);return new Set(q).size!==q.length}function Yq($){return $.map((q)=>`[${q}]`).join(", ")}function n4($,q){let z=[];if($.error)return z.push(P.dim(`${q}error: ${$.error}`)),z;if($.traps.fired.length>0)for(let X of $.traps.fired)z.push(P.red(`${q}trap: ${X.id}`)),z.push(P.dim(`${q}reason: ${X.reason}`)),z.push(P.dim(`${q}match: "${X.matched}"`));else if($.reason&&$.answerable!=="YES")z.push(P.dim(`${q}reason: ${$.reason}`));if($.citations.cited.length>0)z.push(P.dim(`${q}cited: ${Yq($.citations.cited)}`));if($.citations.missing.length>0)z.push(P.dim(`${q}missing: ${Yq($.citations.missing)}`));if($.citations.unknown.length>0)z.push(P.dim(`${q}unknown: ${Yq($.citations.unknown)}`));return z}function c4($,q){if(!$.traps||!$.citations)return[];return n4({error:$.error,traps:$.traps,reason:$.reason??"",answerable:$.answerable??"NO",citations:$.citations},q)}function i4($){let{icon:q,status:z,color:X}=YU($),Z=BU($),H=`${q} ${z}`;return Z?`${Z} ${X(H)}`:X(H)}function a4($,q){if(!$.surfaces)return[];let z=[];z.push(`${q}${P.dim("Citations scoped to active surface (compare mode)")}`);for(let X of $.surfaces){let Z=L0(X),H=s4(Z.tone),Q=P.dim(`[${X.active.join(",")}]`),J=`${H(Z.icon)} ${H(r4(Z))}`;z.push(`${q}${Q} ${J}`),z.push(...n4({traps:X.traps,reason:X.reason,answerable:X.answerable,citations:X.citations},`${q} `))}return z}function TU($){let q=0,z=0,X=0;for(let Z of $){if(Z.surfaces){for(let H of Z.surfaces)q+=H.traps.fired.length,z+=H.citations.missing.length,X+=H.citations.unknown.length;continue}if(Z.traps)q+=Z.traps.fired.length;if(Z.citations)z+=Z.citations.missing.length,X+=Z.citations.unknown.length}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 LU($,q){let z=$.summary.score,Z=`Overall: ${GU(z)(`${z}`)} / 100`;if(q===void 0||q<=0)return Z;let Q=z>=q?P.green("run passes"):P.red("run fails");return`${Z} \xB7 threshold ${q} \xB7 ${Q}`}function o4($,q={}){let{tool:z,scenarios:X,summary:Z}=$,H=X,Q=[];if(Q.push(P.bold("pickled check")),Q.push(l4),Q.push(`Tool: ${P.cyan(z.name)}`),$.docs.length>0)Q.push(`Sources: ${P.dim(Yq($.docs.map((J)=>J.id)))}`);else Q.push(`Sources: ${P.dim("none registered")}`);if(Q.push(`Scenarios: ${P.dim(String(Z.total))}`),Q.push(""),WU(H)){let J=new Map;for(let G of H){let U=G.scenario.name;if(!J.has(U))J.set(U,[]);J.get(U)?.push(G)}for(let[G,U]of J){Q.push(`Scenario: ${G}`);for(let B of U)if(B.surfaces)Q.push(...a4(B," "));else Q.push(` ${i4(B)}`),Q.push(...c4(B," "));Q.push("")}}else for(let J of H){if(Q.push(`Scenario: ${J.scenario.name}`),J.surfaces)Q.push(...a4(J," "));else Q.push(` ${i4(J)}`),Q.push(...c4(J," "));Q.push("")}return Q.push(l4),Q.push(LU($,q.threshold)),Q.push(P.dim(TU(X))),Q.join(`
224
+ `)}function r1($,q={}){console.log(o4($,q)),console.log()}function Bq($,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 _U($){if($.format&&$.format!=="terminal")return $.format;if($.json)return"json";return $.format??"terminal"}async function t4($,q){let{output:z}=q,X=_U(q),Z=VU.resolve($),H;try{H=await Qq({targetRepo:Z})}catch(Y){console.error(P.red(Y instanceof Error?Y.message:Y)),process.exit(1)}let Q;if(X==="json")Q=$q(H);else if(X==="markdown")Q=e$(H);else Q=qq(H);if(z)await Bun.write(z,Q);else await IU(`${Q}
225
+ `);let J=H.findings.filter((Y)=>Y.severity==="error").length,G=H.findings.filter((Y)=>Y.severity==="warning").length;if(X!=="json"&&!z)if(console.log(),J===0&&G===0)console.log(P.green("Audit clean. No issues found."));else{let Y=J>0?P.red:P.yellow;console.log(Y(`Audit found ${J} error(s), ${G} warning(s).`))}if((q.failOn??"error")==="warning"?J+G>0:J>0)process.exit(1)}function IU($){return new Promise((q,z)=>{process.stdout.write($,(X)=>{if(X)z(X);else q()})})}import DU from"path";async function e4($,q){let{json:z,output:X,verbose:Z}=q,H=(W)=>!z&&console.log(W),Q=DU.resolve($),J;try{J=await S0(Q)}catch(W){console.error(P.red(W instanceof Error?W.message:W)),console.error(),console.error(P.dim("Run `pickled init` to create a config file")),process.exit(1)}if(q.target){let W=J.scenarios.length;try{J=f1(J,q.target)}catch(_){console.error(P.red(_ instanceof Error?_.message:String(_))),process.exit(1)}let L=W-J.scenarios.length;if(L>0&&!z)H(P.dim(`Skipping ${L} scenario(s) with explicit target != "${q.target}"`))}let G={name:J.tool.name,description:J.tool.description,path:Q};if(Z){H(P.bold("pickled check")),H(""),H(P.dim(` Tool: ${G.name}`)),H(P.dim(` Scenarios: ${J.scenarios.length}`));for(let W of J.scenarios)H(P.dim(` - ${W.name}`))}let U=await l1(G,J,{onProgress:Z?(W)=>{if(!z)H(P.dim(` ${W}`))}:void 0}),B=q.threshold?parseInt(q.threshold,10):J.threshold??0,Y=B>0&&U.summary.score<B;if(X)await Bun.write(X,Bq(U,{verbose:Z}));else if(z)await RU(`${Bq(U,{verbose:Z})}
226
+ `);else r1(U,{threshold:B});if(Y){if(z||X)console.error(P.red(`Overall: ${U.summary.score} / 100 \xB7 threshold ${B} \xB7 run fails`)),console.error(P.dim("Review failed scenarios before trusting this surface."));process.exit(1)}}function RU($){return new Promise((q,z)=>{process.stdout.write($,(X)=>{if(X)z(X);else q()})})}import MU from"path";var wU=`# pickled.yml - Agent legibility check for your product
227
227
 
228
228
  tool:
229
229
  name: "your-product"
@@ -245,4 +245,4 @@ scenarios:
245
245
 
246
246
  # Optional: fail CI if score falls below threshold
247
247
  # threshold: 80
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();
248
+ `;async function $5($){let z=`${MU.resolve($)}/pickled.yml`;if(await Bun.file(z).exists())console.error(P.red("pickled.yml already exists")),process.exit(1);await Bun.write(z,wU),console.log(P.green("Created pickled.yml")),console.log(),console.log(P.dim("Next steps:")),console.log(P.dim(" 1. Edit pickled.yml: list your sources and scenarios")),console.log(P.dim(" 2. Run: pickled check")),console.log()}_0.name("pickled").description("Test what agents actually understand about your product").version(V2.version);_0.command("init").description("Create a pickled.yml config file").argument("[path]","Path to your project (default: current directory)",".").action($5);_0.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 Mq("--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 Mq("--fail-on <level>","Exit non-zero on this severity or higher").choices(["error","warning"]).default("error")).action(t4);_0.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(e4);await _0.parseAsync();