@pickled-dev/cli 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +64 -64
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -10,89 +10,89 @@ ${H}`)}boxWrap($,q){if(q<this.minWidthToWrap)return $;let z=$.split(/\r\n|\n/),X
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((w5)=>{function M5($,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 P5($,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=M5($,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}}D5.Option=z2;D5.DualOptions=X2});var Z2=D((P5)=>{function w5($,q){if(Math.abs($.length-q.length)>3)return Math.max($.length,q.length);let z=[];for(let X=0;X<=$.length;X++)z[X]=[X];for(let X=0;X<=q.length;X++)z[0][X]=X;for(let X=1;X<=q.length;X++)for(let Z=1;Z<=$.length;Z++){let H=1;if($[Z-1]===q[X-1])H=0;else H=1;if(z[Z][X]=Math.min(z[Z-1][X]+1,z[Z][X-1]+1,z[Z-1][X-1]+H),Z>1&&X>1&&$[Z-1]===q[X-2]&&$[Z-2]===q[X-1])z[Z][X]=Math.min(z[Z][X],z[Z-2][X-2]+1)}return z[$.length][q.length]}function M5($,q){if(!q||q.length===0)return"";q=Array.from(new Set(q));let z=$.startsWith("--");if(z)$=$.slice(2),q=q.map((Q)=>Q.slice(2));let X=[],Z=3,H=0.4;if(q.forEach((Q)=>{if(Q.length<=1)return;let J=w5($,Q),Y=Math.max($.length,Q.length);if((Y-J)/Y>H){if(J<Z)Z=J,X=[Q];else if(J===Z)X.push(Q)}}),X.sort((Q,J)=>Q.localeCompare(J)),z)X=X.map((Q)=>`--${Q}`);if(X.length>1)return`
14
14
  (Did you mean one of ${X.join(", ")}?)`;if(X.length===1)return`
15
- (Did you mean ${X[0]}?)`;return""}w5.suggestSimilar=P5});var U2=D((E5)=>{var F5=c("events").EventEmitter,Wq=c("child_process"),i=c("path"),U$=c("fs"),j=c("process"),{Argument:O5,humanReadableArgName:A5}=J$(),{CommanderError:Lq}=C0(),{Help:j5,stripColor:S5}=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)=>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:()=>Vq()??(j.stdout.isTTY&&j.stdout.hasColors?.()),getErrHasColors:()=>Vq()??(j.stderr.isTTY&&j.stderr.hasColors?.()),stripColor:(q)=>S5(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 j5,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
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
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));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 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(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.
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
19
  - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable($,q,z){if(U$.existsSync($))return;let X=q?`searched for local subcommand relative to directory '${q}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",Z=`'${$}' does not exist
20
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(j.platform!=="win32")if(z)q.unshift(H),q=J2(j.execArgv).concat(q),J=Wq.spawn(j.argv[0],q,{stdio:"inherit"});else J=Wq.spawn(H,q,{stdio:"inherit"});else this._checkForMissingExecutable(H,Q,$._name),q.unshift(H),q=J2(j.execArgv).concat(q),J=Wq.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 Y=this._exitCallback;J.on("close",(U)=>{if(U=U??1,!Y)j.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)j.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 G=i.resolve(U,B);if(U$.existsSync(G))return G;if(X.includes(i.extname(B)))return;let T=X.find((L)=>U$.existsSync(`${G}${L}`));if(T)return`${G}${T}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let H=$._executableFile||`${this._name}-${$._name}`,Q=this._executableDir||"";if(this._scriptPath){let U;try{U=U$.realpathSync(this._scriptPath)}catch{U=this._scriptPath}Q=i.resolve(i.dirname(U),Q)}if(Q){let U=Z(Q,H);if(!U&&!$._executableFile&&this._scriptPath){let B=i.basename(this._scriptPath,i.extname(this._scriptPath));if(B!==this._name)U=Z(Q,`${B}-${$._name}`)}H=U||H}z=X.includes(i.extname(H));let J;if(S.platform!=="win32")if(z)q.unshift(H),q=J2(S.execArgv).concat(q),J=Wq.spawn(S.argv[0],q,{stdio:"inherit"});else J=Wq.spawn(H,q,{stdio:"inherit"});else this._checkForMissingExecutable(H,Q,$._name),q.unshift(H),q=J2(S.execArgv).concat(q),J=Wq.spawn(S.execPath,q,{stdio:"inherit"});if(!J.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((B)=>{S.on(B,()=>{if(J.killed===!1&&J.exitCode===null)J.kill(B)})});let Y=this._exitCallback;J.on("close",(U)=>{if(U=U??1,!Y)S.exit(U);else Y(new Lq(U,"commander.executeSubCommandAsync","(close)"))}),J.on("error",(U)=>{if(U.code==="ENOENT")this._checkForMissingExecutable(H,Q,$._name);else if(U.code==="EACCES")throw Error(`'${H}' not executable`);if(!Y)S.exit(1);else{let B=new Lq(1,"commander.executeSubCommandAsync","(error)");B.nestedError=U,Y(B)}}),this.runningCommand=J}_dispatchSubcommand($,q,z){let X=this._findCommand($);if(!X)this.help({error:!0});X._prepareForParse();let Z;return Z=this._chainOrCallSubCommandHook(Z,X,"preSubcommand"),Z=this._chainOrCall(Z,()=>{if(X._executableHandler)this._executeSubCommand(X,q.concat(z));else return X._parseCommand(q,z)}),Z}_dispatchHelpCommand($){if(!$)this.help();let q=this._findCommand($);if(q&&!q._executableHandler)q.help();return this._dispatchSubcommand($,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach(($,q)=>{if($.required&&this.args[q]==null)this.missingArgument($.name())}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)return;if(this.args.length>this.registeredArguments.length)this._excessArguments(this.args)}_processArguments(){let $=(z,X,Z)=>{let H=X;if(X!==null&&z.parseArg){let Q=`error: command-argument value '${X}' is invalid for argument '${z.name()}'.`;H=this._callParseArg(z,X,Z,Q)}return H};this._checkNumberOfArguments();let q=[];this.registeredArguments.forEach((z,X)=>{let Z=z.defaultValue;if(z.variadic){if(X<this.args.length){if(Z=this.args.slice(X),z.parseArg)Z=Z.reduce((H,Q)=>{return $(z,Q,H)},z.defaultValue)}else if(Z===void 0)Z=[]}else if(X<this.args.length){if(Z=this.args[X],z.parseArg)Z=$(z,Z,z.defaultValue)}q[X]=Z}),this.processedArgs=q}_chainOrCall($,q){if($?.then&&typeof $.then==="function")return $.then(()=>q());return q()}_chainOrCallHooks($,q){let z=$,X=[];if(this._getCommandAndAncestors().reverse().filter((Z)=>Z._lifeCycleHooks[q]!==void 0).forEach((Z)=>{Z._lifeCycleHooks[q].forEach((H)=>{X.push({hookedCommand:Z,callback:H})})}),q==="postAction")X.reverse();return X.forEach((Z)=>{z=this._chainOrCall(z,()=>{return Z.callback(Z.hookedCommand,this)})}),z}_chainOrCallSubCommandHook($,q,z){let X=$;if(this._lifeCycleHooks[z]!==void 0)this._lifeCycleHooks[z].forEach((Z)=>{X=this._chainOrCall(X,()=>{return Z(this,q)})});return X}_parseCommand($,q){let z=this.parseOptions(q);if(this._parseOptionsEnv(),this._parseOptionsImplied(),$=$.concat(z.operands),q=z.unknown,this.args=$.concat(q),$&&this._findCommand($[0]))return this._dispatchSubcommand($[0],$.slice(1),q);if(this._getHelpCommand()&&$[0]===this._getHelpCommand().name())return this._dispatchHelpCommand($[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(q),this._dispatchSubcommand(this._defaultCommandName,$,q);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(z.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let X=()=>{if(z.unknown.length>0)this.unknownOption(z.unknown[0])},Z=`command:${this.name()}`;if(this._actionHandler){X(),this._processArguments();let H;if(H=this._chainOrCallHooks(H,"preAction"),H=this._chainOrCall(H,()=>this._actionHandler(this.processedArgs)),this.parent)H=this._chainOrCall(H,()=>{this.parent.emit(Z,$,q)});return H=this._chainOrCallHooks(H,"postAction"),H}if(this.parent?.listenerCount(Z))X(),this._processArguments(),this.parent.emit(Z,$,q);else if($.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",$,q);if(this.listenerCount("command:*"))this.emit("command:*",$,q);else if(this.commands.length)this.unknownCommand();else X(),this._processArguments()}else if(this.commands.length)X(),this.help({error:!0});else X(),this._processArguments()}_findCommand($){if(!$)return;return this.commands.find((q)=>q._name===$||q._aliases.includes($))}_findOption($){return this.options.find((q)=>q.is($))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(($)=>{$.options.forEach((q)=>{if(q.mandatory&&$.getOptionValue(q.attributeName())===void 0)$.missingMandatoryOptionValue(q)})})}_checkForConflictingLocalOptions(){let $=this.options.filter((z)=>{let X=z.attributeName();if(this.getOptionValue(X)===void 0)return!1;return this.getOptionValueSource(X)!=="default"});$.filter((z)=>z.conflictsWith.length>0).forEach((z)=>{let X=$.find((Z)=>z.conflictsWith.includes(Z.attributeName()));if(X)this._conflictingOption(z,X)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(($)=>{$._checkForConflictingLocalOptions()})}parseOptions($){let q=[],z=[],X=q;function Z(U){return U.length>1&&U[0]==="-"}let H=(U)=>{if(!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(U))return!1;return!this._getCommandAndAncestors().some((B)=>B.options.map((G)=>G.short).some((G)=>/^-\d$/.test(G)))},Q=null,J=null,Y=0;while(Y<$.length||J){let U=J??$[Y++];if(J=null,U==="--"){if(X===z)X.push(U);X.push(...$.slice(Y));break}if(Q&&(!Z(U)||H(U))){this.emit(`option:${Q.name()}`,U);continue}if(Q=null,Z(U)){let B=this._findOption(U);if(B){if(B.required){let G=$[Y++];if(G===void 0)this.optionMissingArgument(B);this.emit(`option:${B.name()}`,G)}else if(B.optional){let G=null;if(Y<$.length&&(!Z($[Y])||H($[Y])))G=$[Y++];this.emit(`option:${B.name()}`,G)}else this.emit(`option:${B.name()}`);Q=B.variadic?B:null;continue}}if(U.length>2&&U[0]==="-"&&U[1]!=="-"){let B=this._findOption(`-${U[1]}`);if(B){if(B.required||B.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${B.name()}`,U.slice(2));else this.emit(`option:${B.name()}`),J=`-${U.slice(2)}`;continue}}if(/^--[^=]+=/.test(U)){let B=U.indexOf("="),G=this._findOption(U.slice(0,B));if(G&&(G.required||G.optional)){this.emit(`option:${G.name()}`,U.slice(B+1));continue}}if(X===q&&Z(U)&&!(this.commands.length===0&&H(U)))X=z;if((this._enablePositionalOptions||this._passThroughOptions)&&q.length===0&&z.length===0){if(this._findCommand(U)){q.push(U),z.push(...$.slice(Y));break}else if(this._getHelpCommand()&&U===this._getHelpCommand().name()){q.push(U,...$.slice(Y));break}else if(this._defaultCommandName){z.push(U,...$.slice(Y));break}}if(this._passThroughOptions){X.push(U,...$.slice(Y));break}X.push(U)}return{operands:q,unknown:z}}opts(){if(this._storeOptionsAsProperties){let $={},q=this.options.length;for(let z=0;z<q;z++){let X=this.options[z].attributeName();$[X]=X===this._versionOptionName?this._version:this[X]}return $}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce(($,q)=>Object.assign($,q.opts()),{})}error($,q){if(this._outputConfiguration.outputError(`${$}
23
23
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==="string")this._outputConfiguration.writeErr(`${this._showHelpAfterError}
24
24
  `);else if(this._showHelpAfterError)this._outputConfiguration.writeErr(`
25
- `),this.outputHelp({error:!0});let 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 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(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.
25
+ `),this.outputHelp({error:!0});let z=q||{},X=z.exitCode||1,Z=z.code||"commander.error";this._exit(X,Z,$)}_parseOptionsEnv(){this.options.forEach(($)=>{if($.envVar&&$.envVar in S.env){let q=$.attributeName();if(this.getOptionValue(q)===void 0||["default","config","env"].includes(this.getOptionValueSource(q)))if($.required||$.optional)this.emit(`optionEnv:${$.name()}`,S.env[$.envVar]);else this.emit(`optionEnv:${$.name()}`)}})}_parseOptionsImplied(){let $=new N5(this.options),q=(z)=>{return this.getOptionValue(z)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(z))};this.options.filter((z)=>z.implied!==void 0&&q(z.attributeName())&&$.valueFromOption(this.getOptionValue(z.attributeName()),z)).forEach((z)=>{Object.keys(z.implied).filter((X)=>!q(X)).forEach((X)=>{this.setOptionValueWithSource(X,z.implied[X],"implied")})})}missingArgument($){let q=`error: missing required argument '${$}'`;this.error(q,{code:"commander.missingArgument"})}optionMissingArgument($){let q=`error: option '${$.flags}' argument missing`;this.error(q,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue($){let q=`error: required option '${$.flags}' not specified`;this.error(q,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption($,q){let z=(H)=>{let Q=H.attributeName(),J=this.getOptionValue(Q),Y=this.options.find((B)=>B.negate&&Q===B.attributeName()),U=this.options.find((B)=>!B.negate&&Q===B.attributeName());if(Y&&(Y.presetArg===void 0&&J===!1||Y.presetArg!==void 0&&J===Y.presetArg))return Y;return U||H},X=(H)=>{let Q=z(H),J=Q.attributeName();if(this.getOptionValueSource(J)==="env")return`environment variable '${Q.envVar}'`;return`option '${Q.flags}'`},Z=`error: ${X($)} cannot be used with ${X(q)}`;this.error(Z,{code:"commander.conflictingOption"})}unknownOption($){if(this._allowUnknownOption)return;let q="";if($.startsWith("--")&&this._showSuggestionAfterError){let X=[],Z=this;do{let H=Z.createHelp().visibleOptions(Z).filter((Q)=>Q.long).map((Q)=>Q.long);X=X.concat(H),Z=Z.parent}while(Z&&!Z._enablePositionalOptions);q=Q2($,X)}let z=`error: unknown option '${$}'${q}`;this.error(z,{code:"commander.unknownOption"})}_excessArguments($){if(this._allowExcessArguments)return;let q=this.registeredArguments.length,z=q===1?"":"s",Z=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${q} argument${z} but got ${$.length}.`;this.error(Z,{code:"commander.excessArguments"})}unknownCommand(){let $=this.args[0],q="";if(this._showSuggestionAfterError){let X=[];this.createHelp().visibleCommands(this).forEach((Z)=>{if(X.push(Z.name()),Z.alias())X.push(Z.alias())}),q=Q2($,X)}let z=`error: unknown command '${$}'${q}`;this.error(z,{code:"commander.unknownCommand"})}version($,q,z){if($===void 0)return this._version;this._version=$,q=q||"-V, --version",z=z||"output the version number";let X=this.createOption(q,z);return this._versionOptionName=X.attributeName(),this._registerOption(X),this.on("option:"+X.name(),()=>{this._outputConfiguration.writeOut(`${$}
26
+ `),this._exit(0,"commander.version",$)}),this}description($,q){if($===void 0&&q===void 0)return this._description;if(this._description=$,q)this._argsDescription=q;return this}summary($){if($===void 0)return this._summary;return this._summary=$,this}alias($){if($===void 0)return this._aliases[0];let q=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)q=this.commands[this.commands.length-1];if($===q._name)throw Error("Command alias can't be the same as its name");let z=this.parent?._findCommand($);if(z){let X=[z.name()].concat(z.aliases()).join("|");throw Error(`cannot add alias '${$}' to command '${this.name()}' as already have command '${X}'`)}return q._aliases.push($),this}aliases($){if($===void 0)return this._aliases;return $.forEach((q)=>this.alias(q)),this}usage($){if($===void 0){if(this._usage)return this._usage;let q=this.registeredArguments.map((z)=>{return A5(z)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?q:[]).join(" ")}return this._usage=$,this}name($){if($===void 0)return this._name;return this._name=$,this}helpGroup($){if($===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=$,this}commandsGroup($){if($===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=$,this}optionsGroup($){if($===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=$,this}_initOptionGroup($){if(this._defaultOptionGroup&&!$.helpGroupHeading)$.helpGroup(this._defaultOptionGroup)}_initCommandGroup($){if(this._defaultCommandGroup&&!$.helpGroup())$.helpGroup(this._defaultCommandGroup)}nameFromFilename($){return this._name=i.basename($,i.extname($)),this}executableDir($){if($===void 0)return this._executableDir;return this._executableDir=$,this}helpInformation($){let q=this.createHelp(),z=this._getOutputContext($);q.prepareContext({error:z.error,helpWidth:z.helpWidth,outputHasColors:z.hasColors});let X=q.formatHelp(this,q);if(z.hasColors)return X;return this._outputConfiguration.stripColor(X)}_getOutputContext($){$=$||{};let q=!!$.error,z,X,Z;if(q)z=(Q)=>this._outputConfiguration.writeErr(Q),X=this._outputConfiguration.getErrHasColors(),Z=this._outputConfiguration.getErrHelpWidth();else z=(Q)=>this._outputConfiguration.writeOut(Q),X=this._outputConfiguration.getOutHasColors(),Z=this._outputConfiguration.getOutHelpWidth();return{error:q,write:(Q)=>{if(!X)Q=this._outputConfiguration.stripColor(Q);return z(Q)},hasColors:X,helpWidth:Z}}outputHelp($){let q;if(typeof $==="function")q=$,$=void 0;let z=this._getOutputContext($),X={error:z.error,write:z.write,command:this};this._getCommandAndAncestors().reverse().forEach((H)=>H.emit("beforeAllHelp",X)),this.emit("beforeHelp",X);let Z=this.helpInformation({error:z.error});if(q){if(Z=q(Z),typeof Z!=="string"&&!Buffer.isBuffer(Z))throw Error("outputHelp callback must return a string or a Buffer")}if(z.write(Z),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",X),this._getCommandAndAncestors().forEach((H)=>H.emit("afterAllHelp",X))}helpOption($,q){if(typeof $==="boolean"){if($){if(this._helpOption===null)this._helpOption=void 0;if(this._defaultOptionGroup)this._initOptionGroup(this._getHelpOption())}else this._helpOption=null;return this}if(this._helpOption=this.createOption($??"-h, --help",q??"display help for command"),$||q)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption($){return this._helpOption=$,this._initOptionGroup($),this}help($){this.outputHelp($);let q=Number(S.exitCode??0);if(q===0&&$&&typeof $!=="function"&&$.error)q=1;this._exit(q,"commander.help","(outputHelp)")}addHelpText($,q){let z=["beforeAll","before","after","afterAll"];if(!z.includes($))throw Error(`Unexpected value for position to addHelpText.
27
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(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}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 Pq=Symbol.for("yaml.alias"),V2=Symbol.for("yaml.document"),G$=Symbol.for("yaml.map"),_2=Symbol.for("yaml.pair"),wq=Symbol.for("yaml.scalar"),Y$=Symbol.for("yaml.seq"),a=Symbol.for("yaml.node.type"),s5=($)=>!!$&&typeof $==="object"&&$[a]===Pq,r5=($)=>!!$&&typeof $==="object"&&$[a]===V2,n5=($)=>!!$&&typeof $==="object"&&$[a]===G$,o5=($)=>!!$&&typeof $==="object"&&$[a]===_2,D2=($)=>!!$&&typeof $==="object"&&$[a]===wq,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 Pq:case G$:case wq:case Y$:return!0}return!1}var $z=($)=>(D2($)||I2($))&&!!$.anchor;qz.ALIAS=Pq;qz.DOC=V2;qz.MAP=G$;qz.NODE_TYPE=a;qz.PAIR=_2;qz.SCALAR=wq;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=M2(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=P2($,q,z,X);if(f.isNode(Z)||f.isPair(Z))return w2($,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=M2(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 P2($,q,z,X);if(f.isNode(Z)||f.isPair(Z))return w2($,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 M2($){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 w2($,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(),Pz=y0(),wz={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Kz=($)=>$.replace(/[!,[\]{}]/g,(q)=>wz[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={};Pz.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 jz($){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 Sz($,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=jz;Nz.anchorNames=O2;Nz.createNodeAnchors=Sz;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 j2($,q,z){if(Array.isArray($))return $.map((X,Z)=>j2(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=j2});var L$=D((mz)=>{var vz=Fq(),S2=A(),uz=n();class N2{constructor($){Object.defineProperty(this,S2.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(!S2.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(`
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
30
  `)?Aq(z,q):z.includes(`
31
31
  `)?`
32
- `+Aq(z,q):($.endsWith(" ")?"":" ")+z;_X.indentComment=Aq;_X.lineComment=VX;_X.stringifyComment=LX});var k2=D((PX)=>{function MX($,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 w;w=$[W+=1];){if(z==="quoted"&&w==="\\"){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(w===`
33
- `){if(z==="block")W=f2($,W,q.length);G=W+q.length+Y,T=void 0}else{if(w===" "&&L&&L!==" "&&L!==`
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
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=w,w=$[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=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],F=U[w+1]||$.length;if(K===0)R=`
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
36
  ${q}${$.slice(0,F)}`;else{if(z==="quoted"&&B[K])R+=`${$[K]}\\`;R+=`
37
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}PX.FOLD_BLOCK="block";PX.FOLD_FLOW="flow";PX.FOLD_QUOTED="quoted";PX.foldFlowLines=MX});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]===`
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
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
40
 
41
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 jq($,q){if(q.options.singleQuote===!1||q.implicitKey&&$.includes(`
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
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=jq;else if(H&&!Z)X=g0;else X=z?jq:g0}return X($,q)}var Sq;try{Sq=new RegExp(`(^|(?<!
44
+ ${z}`)+"'";return q.implicitKey?X:o.foldFlowLines(X,z,o.FOLD_FLOW,I$(q,!1))}function D0($,q){let{singleQuote:z}=q.options,X;if(z===!1)X=g0;else{let Z=$.includes('"'),H=$.includes("'");if(Z&&!H)X=Sq;else if(H&&!Z)X=g0;else X=z?Sq:g0}return X($,q)}var jq;try{jq=new RegExp(`(^|(?<!
45
45
  ))
46
46
  +(?!
47
- |$)`,"g")}catch{Sq=/\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{jq=/\n+(?!\n|$)/g}function D$({comment:$,type:q,value:z},X,Z,H){let{blockQuote:Q,commentString:J,lineWidth:Y}=X.options;if(!Q||/\n[\t ]+$/.test(z))return D0(z,X);let U=X.indent||(X.forceBlockIndent||R$(z)?" ":""),B=Q==="literal"?!0:Q==="folded"||q===v.Scalar.BLOCK_FOLDED?!1:q===v.Scalar.BLOCK_LITERAL?!0:!AX(z,Y,U.length);if(!z)return B?`|
48
48
  `:`>
49
49
  `;let G,T;for(T=z.length;T>0;--T){let F=z[T-1];if(F!==`
50
50
  `&&F!=="\t"&&F!==" ")break}let L=z.substring(T),_=L.indexOf(`
51
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(Sq,`$&${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===`
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
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,S=I$(X,!0);if(Q!=="folded"&&q!==v.Scalar.BLOCK_FOLDED)S.onOverflow=()=>{O=!0};let M=o.foldFlowLines(`${R}${F}${L}`,U,o.FOLD_BLOCK,S);if(!O)return`>${K}
55
- ${U}${M}`}return z=z.replace(/\n+/g,`$&${U}`),`|${K}
56
- ${U}${R}${z}${L}`}function jX($,q,z,X){let{type:Z,value:H}=$,{actualString:Q,implicitKey:J,indent:Y,indentStep:U,inFlow:B}=q;if(J&&H.includes(`
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
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
58
  `)?D0(H,q):D$($,q,z,X);if(!J&&!B&&Z!==v.Scalar.PLAIN&&H.includes(`
59
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 SX($,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 jq(Q.value,q);case v.Scalar.PLAIN:return jX(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=SX});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}
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
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,w;if(s.isNode(q))I=!!q.spaceBefore,R=q.commentBefore,w=q.comment;else if(I=!1,R=null,w=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 S=U(R);O+=`
64
- ${m0.indentComment(S,z.indent)}`}if(F===""&&!z.inFlow){if(O===`
65
- `&&w)O=`
62
+ ${J}:`}else if(V=`${V}:`,T)V+=m0.lineComment(V,z.indent,U(T));let I,R,P;if(s.isNode(q))I=!!q.spaceBefore,R=q.commentBefore,P=q.comment;else if(I=!1,R=null,P=null,q&&typeof q==="object")q=Q.createNode(q);if(z.implicitKey=!1,!L&&!T&&s.isScalar(q))z.indentAtStart=V.length+1;if(W=!1,!B&&Y.length>=2&&!z.inFlow&&!L&&s.isSeq(q)&&!q.flow&&!q.tag&&!q.anchor)z.indent=z.indent.substring(2);let K=!1,F=h2.stringify(q,z,()=>K=!0,()=>W=!0),O=" ";if(T||I||R){if(O=I?`
63
+ `:"",R){let j=U(R);O+=`
64
+ ${m0.indentComment(j,z.indent)}`}if(F===""&&!z.inFlow){if(O===`
65
+ `&&P)O=`
66
66
 
67
67
  `}else O+=`
68
- ${z.indent}`}else if(!L&&s.isCollection(q)){let S=F[0],M=F.indexOf(`
69
- `),C=M!==-1,r=z.inFlow??q.flow??q.items.length===0;if(C||!r){let T0=!1;if(C&&(S==="&"||S==="!")){let y=F.indexOf(" ");if(S==="&"&&y!==-1&&y<M&&F[y+1]==="!")y=F.indexOf(" ",y+1);if(y===-1||M<y)T0=!0}if(!T0)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
70
  ${z.indent}`}}else if(F===""||F[0]===`
71
- `)O="";if(V+=O+F,z.inFlow){if(K&&X)X()}else if(w&&!K)V+=m0.lineComment(V,z.indent,U(w));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 w$=D((nX)=>{var d0=A(),u2=b(),M$="<<",P$={identify:($)=>$===M$||typeof $==="symbol"&&$.description===M$,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new u2.Scalar(Symbol(M$)),{addToJSMap:m2}),stringify:()=>M$},rX=($,q)=>(P$.identify(q)||d0.isScalar(q)&&(!q.type||q.type===u2.Scalar.PLAIN)&&P$.identify(q.value))&&$?.doc.schema.tags.some((z)=>z.tag===P$.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=P$});var Cq=D((Z8)=>{var $8=Nq(),d2=w$(),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?`
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
72
  ${Y}${W}`:`
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 w=J0.isNode(W.value)?W.value:null;if(w){if(w.comment)V=w.comment;if(w.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(`
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
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
76
  ${H}${Z}${W}`:`
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((P8)=>{var D8=yq(),I8=Cq(),R8=_$(),$0=A(),j$=e(),M8=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(j$.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 j$.Pair($,$?.value);else z=new j$.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)&&M8.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 j$.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})}}P8.YAMLMap=i2;P8.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 S8=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=S$($);if(typeof q!=="number")return!1;return this.items.splice(q,1).length>0}get($,q){let z=S$($);if(typeof z!=="number")return;let X=this.items[z];return!q&&N$.isScalar(X)?X.value:X}has($){let q=S$($);return typeof q==="number"&&q<this.items.length}set($,q){let z=S$($);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(S8.createNode(Q,void 0,z))}}return Z}}function S$($){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 M0=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=M0(),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=M0(),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 MZ=b(),PZ=I0(),wZ=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 MZ.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=[PZ.map,wZ.seq].concat(KZ,FZ);AZ.schema=OZ});var dq=D((EZ)=>{var c0=c("buffer"),mq=b(),SZ=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 SZ.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`${T}${Q}${G.join(" ")}${Q}${L}`}}function A$({indent:$,options:{commentString:q}},z,X,Z){if(X&&Z)X=X.replace(/^\n+/,"");if(X){let H=O$.indentComment(q(X),$);z.push(H.trimStart())}}V8.stringifyCollection=T8});var q0=D((M8)=>{var D8=yq(),I8=Cq(),R8=_$(),$0=A(),S$=e(),w8=b();function p0($,q){let z=$0.isScalar(q)?q.value:q;for(let X of $)if($0.isPair(X)){if(X.key===q||X.key===z)return X;if($0.isScalar(X.key)&&X.key.value===z)return X}return}class i2 extends R8.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor($){super($0.MAP,$);this.items=[]}static from($,q,z){let{keepUndefined:X,replacer:Z}=z,H=new this($),Q=(J,Y)=>{if(typeof Z==="function")Y=Z.call(q,J,Y);else if(Array.isArray(Z)&&!Z.includes(J))return;if(Y!==void 0||X)H.items.push(S$.createPair(J,Y,z))};if(q instanceof Map)for(let[J,Y]of q)Q(J,Y);else if(q&&typeof q==="object")for(let J of Object.keys(q))Q(J,q[J]);if(typeof $.sortMapEntries==="function")H.items.sort($.sortMapEntries);return H}add($,q){let z;if($0.isPair($))z=$;else if(!$||typeof $!=="object"||!("key"in $))z=new S$.Pair($,$?.value);else z=new S$.Pair($.key,$.value);let X=p0(this.items,z.key),Z=this.schema?.sortMapEntries;if(X){if(!q)throw Error(`Key ${z.key} already set`);if($0.isScalar(X.value)&&w8.isScalarValue(z.value))X.value.value=z.value;else X.value=z.value}else if(Z){let H=this.items.findIndex((Q)=>Z(z,Q)<0);if(H===-1)this.items.push(z);else this.items.splice(H,0,z)}else this.items.push(z)}delete($){let q=p0(this.items,$);if(!q)return!1;return this.items.splice(this.items.indexOf(q),1).length>0}get($,q){let X=p0(this.items,$)?.value;return(!q&&$0.isScalar(X)?X.value:X)??void 0}has($){return!!p0(this.items,$)}set($,q){this.add(new S$.Pair($,q),!0)}toJSON($,q,z){let X=z?new z:q?.mapAsMap?new Map:{};if(q?.onCreate)q.onCreate(X);for(let Z of this.items)I8.addPairToJSMap(q,X,Z);return X}toString($,q,z){if(!$)return JSON.stringify(this);for(let X of this.items)if(!$0.isPair(X))throw Error(`Map items must all be pairs; found ${JSON.stringify(X)} instead`);if(!$.allNullValues&&this.hasAllNullValues(!1))$=Object.assign({},$,{allNullValues:!0});return D8.stringifyCollection(this,$,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:$.indent||"",onChompKeep:z,onComment:q})}}M8.YAMLMap=i2;M8.findPair=p0});var I0=D((A8)=>{var F8=A(),a2=q0(),O8={collection:"map",default:!0,nodeClass:a2.YAMLMap,tag:"tag:yaml.org,2002:map",resolve($,q){if(!F8.isMap($))q("Expected a mapping for this tag");return $},createNode:($,q,z)=>a2.YAMLMap.from($,q,z)};A8.map=O8});var z0=D((y8)=>{var j8=x0(),N8=yq(),E8=_$(),N$=A(),b8=b(),C8=n();class s2 extends E8.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor($){super(N$.SEQ,$);this.items=[]}add($){this.items.push($)}delete($){let q=j$($);if(typeof q!=="number")return!1;return this.items.splice(q,1).length>0}get($,q){let z=j$($);if(typeof z!=="number")return;let X=this.items[z];return!q&&N$.isScalar(X)?X.value:X}has($){let q=j$($);return typeof q==="number"&&q<this.items.length}set($,q){let z=j$($);if(typeof z!=="number")throw Error(`Expected a valid index, not ${$}.`);let X=this.items[z];if(N$.isScalar(X)&&b8.isScalarValue(q))X.value=q;else this.items[z]=q}toJSON($,q){let z=[];if(q?.onCreate)q.onCreate(z);let X=0;for(let Z of this.items)z.push(C8.toJS(Z,String(X++),q));return z}toString($,q,z){if(!$)return JSON.stringify(this);return N8.stringifyCollection(this,$,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:($.indent||"")+" ",onChompKeep:z,onComment:q})}static from($,q,z){let{replacer:X}=z,Z=new this($);if(q&&Symbol.iterator in Object(q)){let H=0;for(let Q of q){if(typeof X==="function"){let J=q instanceof Set?Q:String(H++);Q=X.call(q,J,Q)}Z.items.push(j8.createNode(Q,void 0,z))}}return Z}}function j$($){let q=N$.isScalar($)?$.value:$;if(q&&typeof q==="string")q=Number(q);return typeof q==="number"&&Number.isInteger(q)&&q>=0?q:null}y8.YAMLSeq=s2});var R0=D((h8)=>{var k8=A(),r2=z0(),x8={collection:"seq",default:!0,nodeClass:r2.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve($,q){if(!k8.isSeq($))q("Expected a sequence for this tag");return $},createNode:($,q,z)=>r2.YAMLSeq.from($,q,z)};h8.seq=x8});var l0=D((m8)=>{var v8=v0(),u8={identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify($,q,z,X){return q=Object.assign({actualString:!0},q),v8.stringifyString($,q,z,X)}};m8.string=u8});var E$=D((p8)=>{var n2=b(),o2={identify:($)=>$==null,createNode:()=>new n2.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new n2.Scalar(null),stringify:({source:$},q)=>typeof $==="string"&&o2.test.test($)?$:q.options.nullStr};p8.nullTag=o2});var fq=D((i8)=>{var c8=b(),t2={identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:($)=>new c8.Scalar($[0]==="t"||$[0]==="T"),stringify({source:$,value:q},z){if($&&t2.test.test($)){let X=$[0]==="t"||$[0]==="T";if(q===X)return $}return q?z.options.trueStr:z.options.falseStr}};i8.boolTag=t2});var w0=D((r8)=>{function s8({format:$,minFractionDigits:q,tag:z,value:X}){if(typeof X==="bigint")return String(X);let Z=typeof X==="number"?X:Number(X);if(!isFinite(Z))return isNaN(Z)?".nan":Z<0?"-.inf":".inf";let H=Object.is(X,-0)?"-0":JSON.stringify(X);if(!$&&q&&(!z||z==="tag:yaml.org,2002:float")&&/^\d/.test(H)){let Q=H.indexOf(".");if(Q<0)Q=H.length,H+=".";let J=q-(H.length-Q-1);while(J-- >0)H+="0"}return H}r8.stringifyNumber=s8});var xq=D((qZ)=>{var o8=b(),kq=w0(),t8={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:($)=>$.slice(-3).toLowerCase()==="nan"?NaN:$[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:kq.stringifyNumber},e8={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:($)=>parseFloat($),stringify($){let q=Number($.value);return isFinite(q)?q.toExponential():kq.stringifyNumber($)}},$Z={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve($){let q=new o8.Scalar(parseFloat($)),z=$.indexOf(".");if(z!==-1&&$[$.length-1]==="0")q.minFractionDigits=$.length-z-1;return q},stringify:kq.stringifyNumber};qZ.float=$Z;qZ.floatExp=e8;qZ.floatNaN=t8});var gq=D((UZ)=>{var e2=w0(),b$=($)=>typeof $==="bigint"||Number.isInteger($),hq=($,q,z,{intAsBigInt:X})=>X?BigInt($):parseInt($.substring(q),z);function $9($,q,z){let{value:X}=$;if(b$(X)&&X>=0)return z+X.toString(q);return e2.stringifyNumber($)}var HZ={identify:($)=>b$($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:($,q,z)=>hq($,2,8,z),stringify:($)=>$9($,8,"0o")},QZ={identify:b$,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:($,q,z)=>hq($,0,10,z),stringify:e2.stringifyNumber},JZ={identify:($)=>b$($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:($,q,z)=>hq($,2,16,z),stringify:($)=>$9($,16,"0x")};UZ.int=QZ;UZ.intHex=JZ;UZ.intOct=HZ});var q9=D((IZ)=>{var TZ=I0(),WZ=E$(),LZ=R0(),VZ=l0(),_Z=fq(),vq=xq(),uq=gq(),DZ=[TZ.map,LZ.seq,VZ.string,WZ.nullTag,_Z.boolTag,uq.intOct,uq.int,uq.intHex,vq.floatNaN,vq.floatExp,vq.float];IZ.schema=DZ});var X9=D((AZ)=>{var wZ=b(),MZ=I0(),PZ=R0();function z9($){return typeof $==="bigint"||Number.isInteger($)}var C$=({value:$})=>JSON.stringify($),KZ=[{identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify:C$},{identify:($)=>$==null,createNode:()=>new wZ.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:C$},{identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:($)=>$==="true",stringify:C$},{identify:z9,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:($,q,{intAsBigInt:z})=>z?BigInt($):parseInt($,10),stringify:({value:$})=>z9($)?$.toString():JSON.stringify($)},{identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:($)=>parseFloat($),stringify:C$}],FZ={default:!0,tag:"",test:/^/,resolve($,q){return q(`Unresolved plain scalar ${JSON.stringify($)}`),$}},OZ=[MZ.map,PZ.seq].concat(KZ,FZ);AZ.schema=OZ});var dq=D((EZ)=>{var c0=c("buffer"),mq=b(),jZ=v0(),NZ={identify:($)=>$ instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve($,q){if(typeof c0.Buffer==="function")return c0.Buffer.from($,"base64");else if(typeof atob==="function"){let z=atob($.replace(/[\n\r]/g,"")),X=new Uint8Array(z.length);for(let Z=0;Z<z.length;++Z)X[Z]=z.charCodeAt(Z);return X}else return q("This environment does not support reading binary tags; either Buffer or atob is required"),$},stringify({comment:$,type:q,value:z},X,Z,H){if(!z)return"";let Q=z,J;if(typeof c0.Buffer==="function")J=Q instanceof c0.Buffer?Q.toString("base64"):c0.Buffer.from(Q.buffer).toString("base64");else if(typeof btoa==="function"){let Y="";for(let U=0;U<Q.length;++U)Y+=String.fromCharCode(Q[U]);J=btoa(Y)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(q??(q=mq.Scalar.BLOCK_LITERAL),q!==mq.Scalar.QUOTE_DOUBLE){let Y=Math.max(X.options.lineWidth-X.indent.length,X.options.minContentWidth),U=Math.ceil(J.length/Y),B=Array(U);for(let G=0,T=0;G<U;++G,T+=Y)B[G]=J.substr(T,Y);J=B.join(q===mq.Scalar.BLOCK_LITERAL?`
79
+ `:" ")}return jZ.stringifyString({comment:$,type:q,value:J},X,Z,H)}};EZ.binary=NZ});var f$=D((kZ)=>{var y$=A(),pq=e(),CZ=b(),yZ=z0();function Z9($,q){if(y$.isSeq($))for(let z=0;z<$.items.length;++z){let X=$.items[z];if(y$.isPair(X))continue;else if(y$.isMap(X)){if(X.items.length>1)q("Each pair must have its own sequence indicator");let Z=X.items[0]||new pq.Pair(new CZ.Scalar(null));if(X.commentBefore)Z.key.commentBefore=Z.key.commentBefore?`${X.commentBefore}
80
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=M0(),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=M0(),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=M0();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 P6=I0(),w6=E$(),K6=R0(),F6=l0(),O6=dq(),I9=T9(),oq=W9(),v$=V9(),A6=w$(),j6=cq(),S6=f$(),N6=sq(),tq=nq(),E6=[P6.map,K6.seq,F6.string,w6.nullTag,I9.trueTag,I9.falseTag,v$.intBin,v$.intOct,v$.int,v$.intHex,oq.floatNaN,oq.floatExp,oq.float,O6.binary,A6.merge,j6.omap,S6.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=w$(),A9=cq(),j9=f$(),M9=R9(),S9=sq(),u$=nq(),P9=new Map([["core",x6.schema],["failsafe",[K9.map,F9.seq,f6.string]],["json",h6.schema],["yaml11",M9.schema],["yaml-1.1",M9.schema]]),w9={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:j9.pairs,seq:F9.seq,set:S9.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":j9.pairs,"tag:yaml.org,2002:set":S9.set,"tag:yaml.org,2002:timestamp":u$.timestamp};function v6($,q,z){let X=P9.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(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(s0.merge);return Z.reduce((H,Q)=>{let J=typeof Q==="string"?w9[Q]:Q;if(!J){let Y=JSON.stringify(Q),U=Object.keys(w9).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(`
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
82
  `))z.push("..."),z.push(r0.indentComment(Y,""));else z.push(`... ${Y}`)}else z.push("...");else{let Y=$.comment;if(Y&&Q)Y=Y.replace(/^\n+/,"");if(Y){if((!Q||J)&&z[z.length-1]!=="")z.push("");z.push(r0.indentComment(H(Y),""))}}return z.join(`
83
83
  `)+`
84
- `}o6.stringifyDocument=n6});var n0=D((QH)=>{var e6=k0(),P0=_$(),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(w0(this.contents))this.contents.add($)}addIn($,q){if(w0(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 w0(this.contents)?this.contents.delete($):!1}deleteIn($){if(P0.isEmptyPath($)){if(this.contents==null)return!1;return this.contents=null,!0}return w0(this.contents)?this.contents.deleteIn($):!1}get($,q){return h.isCollection(this.contents)?this.contents.get($,q):void 0}getIn($,q){if(P0.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(P0.isEmptyPath($))return this.contents!==void 0;return h.isCollection(this.contents)?this.contents.hasIn($):!1}set($,q){if(this.contents==null)this.contents=P0.collectionFromPath(this.schema,[$],q);else if(w0(this.contents))this.contents.set($,q)}setIn($,q){if(P0.isEmptyPath($))this.contents=q;else if(this.contents==null)this.contents=P0.collectionFromPath(this.schema,Array.from($),q);else if(w0(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 w0($){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
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
85
  `;Q=J+Q}if(/[^ ]/.test(Q)){let J=1,Y=z.linePos[1];if(Y?.line===X&&Y.col>Z)J=Math.max(1,Math.min(Y.col-Z,80-H));let U=" ".repeat(H)+"^".repeat(J);z.message+=`:
86
86
 
87
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,w=null,K=null,F=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(W){if(U&&M.type!=="comment"&&M.type!=="newline")H(W,"TAB_AS_INDENT","Tabs are not allowed as indentation");W=null}switch(M.type){case"space":if(!q&&(z!=="doc-start"||X?.type!=="flow-collection")&&M.source.includes("\t"))W=M;B=!0;break;case"comment":{if(!B)H(M,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let C=M.source.substring(1)||" ";if(!G)G=C;else G+=T+C;T="",U=!1;break}case"newline":if(U){if(G)G+=M.source;else if(!K||z!=="seq-item-ind")Y=!0}else T+=M.source;if(U=!0,L=!0,V||I)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,F??(F=M.offset),U=!1,B=!1,_=!0;break;case"tag":{if(I)H(M,"MULTIPLE_TAGS","A node can have at most one tag");I=M,F??(F=M.offset),U=!1,B=!1,_=!0;break}case z:if(V||I)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 O=$[$.length-1],S=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:w,found:K,spaceBefore:Y,comment:G,hasNewline:L,anchor:V,tag:I,newlineAfterProp:R,end:S,start:F??S}}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((PH)=>{var RH=p$();function MH($,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)}}PH.flowIndentCheck=MH});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(),jH=p$(),x9=G1(),SH=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||jH.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,SH.mapIncludes(z,J.items,R))Z(I,"DUPLICATE_KEY","Map keys must be unique");let w=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=w.end,w.found){if(V){if(_?.type==="block-map"&&!w.hasNewline)Z(Y,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(z.options.strict&&W.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,Y,L,null,w,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(w.comment)if(R.comment)R.comment+=`
92
- `+w.comment;else R.comment=w.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:w,sep:K,value:F}=I,O=m9.resolveProps(R,{flow:J,indicator:"explicit-key-ind",next:w??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(w))Z(w,"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 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(mH.isPair(M))M=M.value??M.key;if(M.comment)M.comment+=`
94
- `+S;else M.comment=S;O.comment=O.comment.substring(S.length+1)}}}if(!Q&&!K&&!O.found){let S=F?$(z,F,O,Z):q(z,O.end,K,null,O,Z);if(U.items.push(S),G=S.range[2],T1(F))Z(S.range,"BLOCK_IN_FLOW",B1)}else{z.atKey=!0;let S=O.end,M=w?$(z,w,O,Z):q(z,S,R,null,O,Z);if(T1(w))Z(M.range,"BLOCK_IN_FLOW",B1);z.atKey=!1;let C=m9.resolveProps(K??[],{flow:J,indicator:"map-value-ind",next:F,offset:M.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(M.comment)M.comment+=`
95
- `+C.comment;else M.comment=C.comment;let T0=new dH.Pair(M,r);if(z.options.keepSourceTokens)T0.srcToken=I;if(Q){let y=U;if(iH.mapIncludes(z,y.items,M))Z(S,"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??M).range;y.range=[M.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+=`
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
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
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
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=`
@@ -123,7 +123,7 @@ ${U}
123
123
  `)break;if(X===`
124
124
  `)z+=`
125
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(),P3=V1(),w3=D1();function K3($,q,z,X){let{value:Z,type:H,comment:Q,range:J}=q.type==="block-scalar"?P3.resolveBlockScalar($,q,X):w3.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 S3($,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=S3});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?`
126
+ `,r:"\r",t:"\t",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function I3($,q,z,X){let Z=$.substr(q,z),Q=Z.length===z&&/^[0-9a-fA-F]+$/.test(Z)?parseInt(Z,16):NaN;if(isNaN(Q)){let J=$.substr(q-2,z+2);return X(q-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${J}`),J}return String.fromCodePoint(Q)}R3.resolveFlowScalar=T3});var i9=D((A3)=>{var Y0=A(),c9=b(),M3=V1(),P3=D1();function K3($,q,z,X){let{value:Z,type:H,comment:Q,range:J}=q.type==="block-scalar"?M3.resolveBlockScalar($,q,X):P3.resolveFlowScalar(q,$.options.strict,X),Y=z?$.directives.tagName(z.source,(G)=>X(z,"TAG_RESOLVE_FAILED",G)):null,U;if($.options.stringKeys&&$.atKey)U=$.schema[Y0.SCALAR];else if(Y)U=F3($.schema,Z,Y,z,X);else if(q.type==="scalar")U=O3($,Z,q,X);else U=$.schema[Y0.SCALAR];let B;try{let G=U.resolve(Z,(T)=>X(z??q,"TAG_RESOLVE_FAILED",T),$.options);B=Y0.isScalar(G)?G:new c9.Scalar(G)}catch(G){let T=G instanceof Error?G.message:String(G);X(z??q,"TAG_RESOLVE_FAILED",T),B=new c9.Scalar(Z)}if(B.range=J,B.source=Z,H)B.type=H;if(Y)B.tag=Y;if(U.format)B.format=U.format;if(Q)B.comment=Q;return B}function F3($,q,z,X,Z){if(z==="!")return $[Y0.SCALAR];let H=[];for(let J of $.tags)if(!J.collection&&J.tag===z)if(J.default&&J.test)H.push(J);else return J;for(let J of H)if(J.test?.test(q))return J;let Q=$.knownTags[z];if(Q&&!Q.collection)return $.tags.push(Object.assign({},Q,{default:!1,test:void 0})),Q;return Z(X,"TAG_RESOLVE_FAILED",`Unresolved tag: ${z}`,z!=="tag:yaml.org,2002:str"),$[Y0.SCALAR]}function O3({atKey:$,directives:q,schema:z},X,Z,H){let Q=z.tags.find((J)=>(J.default===!0||$&&J.default==="key")&&J.test?.test(X))||z[Y0.SCALAR];if(z.compat){let J=z.compat.find((Y)=>Y.default&&Y.test?.test(X))??z[Y0.SCALAR];if(Q.tag!==J.tag){let Y=q.tagString(Q.tag),U=q.tagString(J.tag),B=`Value may be parsed as either ${Y} or ${U}`;H(Z,"TAG_RESOLVE_FAILED",B,!0)}}return Q}A3.composeScalar=K3});var a9=D((N3)=>{function j3($,q,z){if(q){z??(z=q.length);for(let X=z-1;X>=0;--X){let Z=q[X];switch(Z.type){case"space":case"comment":case"newline":$-=Z.source.length;continue}Z=q[++X];while(Z?.type==="space")$+=Z.source.length,Z=q[++X];break}}return $}N3.emptyScalarPosition=j3});var n9=D((g3)=>{var b3=k0(),C3=A(),y3=p9(),s9=i9(),f3=K0(),k3=a9(),x3={composeNode:r9,composeEmptyNode:I1};function r9($,q,z,X){let Z=$.atKey,{spaceBefore:H,comment:Q,anchor:J,tag:Y}=z,U,B=!0;switch(q.type){case"alias":if(U=h3($,q,X),J||Y)X(q,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(U=s9.composeScalar($,q,Y,X),J)U.anchor=J.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":if(U=y3.composeCollection(x3,$,q,z,X),J)U.anchor=J.source.substring(1);break;default:{let G=q.type==="error"?q.message:`Unsupported token (type: ${q.type})`;X(q,"UNEXPECTED_TOKEN",G),U=I1($,q.offset,void 0,null,z,X),B=!1}}if(J&&U.anchor==="")X(J,"BAD_ALIAS","Anchor cannot be an empty string");if(Z&&$.options.stringKeys&&(!C3.isScalar(U)||typeof U.value!=="string"||U.tag&&U.tag!=="tag:yaml.org,2002:str"))X(Y??q,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(H)U.spaceBefore=!0;if(Q)if(q.type==="scalar"&&q.source==="")U.comment=Q;else U.commentBefore=Q;if($.options.keepSourceTokens&&B)U.srcToken=q;return U}function I1($,q,z,X,{spaceBefore:Z,comment:H,anchor:Q,tag:J,end:Y},U){let B={type:"scalar",offset:k3.emptyScalarPosition(q,z,X),indent:-1,source:""},G=s9.composeScalar($,B,J,U);if(Q){if(G.anchor=Q.source.substring(1),G.anchor==="")U(Q,"BAD_ALIAS","Anchor cannot be an empty string")}if(Z)G.spaceBefore=!0;if(H)G.comment=H,G.range[2]=Y;return G}function h3({options:$},{offset:q,source:z,end:X},Z){let H=new b3.Alias(z.substring(1));if(H.source==="")Z(q,"BAD_ALIAS","Alias cannot be an empty string");if(H.source.endsWith(":"))Z(q+z.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let Q=q+z.length,J=f3.resolveEnd(X,Q,$.strict,Z);if(H.range=[q,Q,J.offset],J.comment)H.comment=J.comment;return H}g3.composeEmptyNode=I1;g3.composeNode=r9});var t9=D((c3)=>{var m3=n0(),o9=n9(),d3=K0(),p3=t0();function l3($,q,{offset:z,start:X,value:Z,end:H},Q){let J=Object.assign({_directives:q},$),Y=new m3.Document(void 0,J),U={atKey:!1,atRoot:!0,directives:Y.directives,options:Y.options,schema:Y.schema},B=p3.resolveProps(X,{indicator:"doc-start",next:Z??H?.[0],offset:z,onError:Q,parentIndent:0,startOnNewline:!0});if(B.found){if(Y.directives.docStart=!0,Z&&(Z.type==="block-map"||Z.type==="block-seq")&&!B.hasNewline)Q(B.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}Y.contents=Z?o9.composeNode(U,Z,B,Q):o9.composeEmptyNode(U,B.end,X,null,B,Q);let G=Y.contents.range[2],T=d3.resolveEnd(H,G,!1,Q);if(T.comment)Y.comment=T.comment;return Y.range=[z,G,T.offset],Y}c3.composeDoc=l3});var R1=D((t3)=>{var a3=c("process"),s3=Kq(),r3=n0(),e0=o0(),e9=A(),n3=t9(),o3=K0();function $$($){if(typeof $==="number")return[$,$+1];if(Array.isArray($))return $.length===2?$:[$[0],$[1]];let{offset:q,source:z}=$;return[q,q+(typeof z==="string"?z.length:1)]}function $4($){let q="",z=!1,X=!1;for(let Z=0;Z<$.length;++Z){let H=$[Z];switch(H[0]){case"#":q+=(q===""?"":X?`
127
127
 
128
128
  `:`
129
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}
@@ -134,20 +134,20 @@ ${q.comment}`:q.comment}this.doc.range[2]=q.offset;break}default:this.errors.pus
134
134
  `}];switch(J[0]){case"|":case">":{let U=J.indexOf(`
135
135
  `),B=J.substring(0,U),G=J.substring(U+1)+`
136
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'"':M1($,Y,"double-quoted-scalar");break;case"'":M1($,Y,"single-quoted-scalar");break;default:M1($,Y,"scalar")}}function QQ($,q){let z=q.indexOf(`
137
+ `});return{type:"block-scalar",offset:H,indent:X,props:T,source:G}}case'"':return{type:"double-quoted-scalar",offset:H,indent:X,source:J,end:Y};case"'":return{type:"single-quoted-scalar",offset:H,indent:X,source:J,end:Y};default:return{type:"scalar",offset:H,indent:X,source:J,end:Y}}}function HQ($,q,z={}){let{afterKey:X=!1,implicitKey:Z=!1,inFlow:H=!1,type:Q}=z,J="indent"in $?$.indent:null;if(X&&typeof J==="number")J+=2;if(!Q)switch($.type){case"single-quoted-scalar":Q="QUOTE_SINGLE";break;case"double-quoted-scalar":Q="QUOTE_DOUBLE";break;case"block-scalar":{let U=$.props[0];if(U.type!=="block-scalar-header")throw Error("Invalid block scalar header");Q=U.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:Q="PLAIN"}let Y=z4.stringifyString({type:Q,value:q},{implicitKey:Z||J===null,indent:J!==null&&J>0?" ".repeat(J):"",inFlow:H,options:{blockQuote:!0,lineWidth:-1}});switch(Y[0]){case"|":case">":QQ($,Y);break;case'"':w1($,Y,"double-quoted-scalar");break;case"'":w1($,Y,"single-quoted-scalar");break;default:w1($,Y,"scalar")}}function QQ($,q){let z=q.indexOf(`
138
138
  `),X=q.substring(0,z),Z=q.substring(z+1)+`
139
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 M1($,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 P1=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=P1;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===P1)return P1;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 w1=Z4(),DQ=H4(),IQ=U4(),K1="\uFEFF",F1="\x02",O1="\x18",A1="\x1F",RQ=($)=>!!$&&("items"in $),MQ=($)=>!!$&&($.type==="scalar"||$.type==="single-quoted-scalar"||$.type==="double-quoted-scalar"||$.type==="block-scalar");function PQ($){switch($){case K1:return"<BOM>";case F1:return"<DOC>";case O1:return"<FLOW_END>";case A1:return"<SCALAR>";default:return JSON.stringify($)}}function wQ($){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`
140
+ `});for(let Y of Object.keys($))if(Y!=="type"&&Y!=="offset")delete $[Y];Object.assign($,{type:"block-scalar",indent:Q,props:J,source:Z})}}function X4($,q){if(q)for(let z of q)switch(z.type){case"space":case"comment":$.push(z);break;case"newline":return $.push(z),!0}return!1}function w1($,q,z){switch($.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":$.type=z,$.source=q;break;case"block-scalar":{let X=$.props.slice(1),Z=q.length;if($.props[0].type==="block-scalar-header")Z-=$.props[0].source.length;for(let H of X)H.offset+=Z;delete $.props,Object.assign($,{type:z,source:q,end:X});break}case"block-map":case"block-seq":{let Z={type:"newline",offset:$.offset+q.length,indent:$.indent,source:`
141
+ `};delete $.items,Object.assign($,{type:z,source:q,end:[Z]});break}default:{let X="indent"in $?$.indent:-1,Z="end"in $&&Array.isArray($.end)?$.end.filter((H)=>H.type==="space"||H.type==="comment"||H.type==="newline"):[];for(let H of Object.keys($))if(H!=="type"&&H!=="offset")delete $[H];Object.assign($,{type:z,indent:X,source:q,end:Z})}}}JQ.createScalarToken=ZQ;JQ.resolveAsScalar=XQ;JQ.setScalarValue=HQ});var H4=D((TQ)=>{var BQ=($)=>("type"in $)?c$($):l$($);function c$($){switch($.type){case"block-scalar":{let q="";for(let z of $.props)q+=c$(z);return q+$.source}case"block-map":case"block-seq":{let q="";for(let z of $.items)q+=l$(z);return q}case"flow-collection":{let q=$.start.source;for(let z of $.items)q+=l$(z);for(let z of $.end)q+=z.source;return q}case"document":{let q=l$($);if($.end)for(let z of $.end)q+=z.source;return q}default:{let q=$.source;if("end"in $&&$.end)for(let z of $.end)q+=z.source;return q}}}function l$({start:$,key:q,sep:z,value:X}){let Z="";for(let H of $)Z+=H.source;if(q)Z+=c$(q);if(z)for(let H of z)Z+=H.source;if(X)Z+=c$(X);return Z}TQ.stringify=BQ});var U4=D((VQ)=>{var M1=Symbol("break visit"),LQ=Symbol("skip children"),Q4=Symbol("remove item");function B0($,q){if("type"in $&&$.type==="document")$={start:$.start,value:$.value};J4(Object.freeze([]),$,q)}B0.BREAK=M1;B0.SKIP=LQ;B0.REMOVE=Q4;B0.itemAtPath=($,q)=>{let z=$;for(let[X,Z]of q){let H=z?.[X];if(H&&"items"in H)z=H.items[Z];else return}return z};B0.parentCollection=($,q)=>{let z=B0.itemAtPath($,q.slice(0,-1)),X=q[q.length-1][0],Z=z?.[X];if(Z&&"items"in Z)return Z;throw Error("Parent collection not found")};function J4($,q,z){let X=z(q,$);if(typeof X==="symbol")return X;for(let Z of["key","value"]){let H=q[Z];if(H&&"items"in H){for(let Q=0;Q<H.items.length;++Q){let J=J4(Object.freeze($.concat([[Z,Q]])),H.items[Q],z);if(typeof J==="number")Q=J-1;else if(J===M1)return M1;else if(J===Q4)H.items.splice(Q,1),Q-=1}if(typeof X==="function"&&Z==="key")X=X(q,$)}}return typeof X==="function"?X(q,$):X}VQ.visit=B0});var i$=D((KQ)=>{var P1=Z4(),DQ=H4(),IQ=U4(),K1="\uFEFF",F1="\x02",O1="\x18",A1="\x1F",RQ=($)=>!!$&&("items"in $),wQ=($)=>!!$&&($.type==="scalar"||$.type==="single-quoted-scalar"||$.type==="double-quoted-scalar"||$.type==="block-scalar");function MQ($){switch($){case K1:return"<BOM>";case F1:return"<DOC>";case O1:return"<FLOW_END>";case A1:return"<SCALAR>";default:return JSON.stringify($)}}function PQ($){switch($){case K1:return"byte-order-mark";case F1:return"doc-mode";case O1:return"flow-error-end";case A1:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
142
142
  `:case`\r
143
- `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch($[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=w1.createScalarToken;KQ.resolveAsScalar=w1.resolveAsScalar;KQ.setScalarValue=w1.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=MQ;KQ.prettyToken=PQ;KQ.tokenType=wQ});var S1=D((vQ)=>{var q$=i$();function u($){switch($){case void 0:case" ":case`
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
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 `),j1=($)=>!$||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===`
145
+ \r `),S1=($)=>!$||gQ.has($);class Y4{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex($,q=!1){if($){if(typeof $!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+$:$,this.lineEndPos=null}this.atEnd=!q;let z=this.next??"stream";while(z&&(q||this.hasChars(1)))z=yield*this.parseNext(z)}atLineEnd(){let $=this.pos,q=this.buffer[$];while(q===" "||q==="\t")q=this.buffer[++$];if(!q||q==="#"||q===`
146
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
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(j1),"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(j1),"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(`
150
+ `,this.pos),this.lineEndPos=$;if($===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[$-1]==="\r")$-=1;return this.buffer.substring(this.pos,$)}hasChars($){return this.pos+$<=this.buffer.length}setNext($){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=$,null}peek($){return this.buffer.substr(this.pos,$)}*parseNext($){switch($){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let $=this.getLine();if($===null)return this.setNext("stream");if($[0]===q$.BOM)yield*this.pushCount(1),$=$.substring(1);if($[0]==="%"){let q=$.length,z=$.indexOf("#");while(z!==-1){let Z=$[z-1];if(Z===" "||Z==="\t"){q=z-1;break}else z=$.indexOf("#",z+1)}while(!0){let Z=$[q-1];if(Z===" "||Z==="\t")q-=1;else break}let X=(yield*this.pushCount(q))+(yield*this.pushSpaces(!0));return yield*this.pushCount($.length-X),this.pushNewline(),"stream"}if(this.atLineEnd()){let q=yield*this.pushSpaces(!0);return yield*this.pushCount($.length-q),yield*this.pushNewline(),"stream"}return yield q$.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let $=this.charAt(0);if(!$&&!this.atEnd)return this.setNext("line-start");if($==="-"||$==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let q=this.peek(3);if((q==="---"||q==="...")&&u(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,q==="---"?"doc":"stream"}if(this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!u(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){let[$,q]=this.peek(2);if(!q&&!this.atEnd)return this.setNext("block-start");if(($==="-"||$==="?"||$===":")&&u(q)){let z=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=z,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let $=this.getLine();if($===null)return this.setNext("doc");let q=yield*this.pushIndicators();switch($[q]){case"#":yield*this.pushCount($.length-q);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(S1),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return q+=yield*this.parseBlockScalarHeader(),q+=yield*this.pushSpaces(!0),yield*this.pushCount($.length-q),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let $,q,z=-1;do{if($=yield*this.pushNewline(),$>0)q=yield*this.pushSpaces(!1),this.indentValue=z=q;else q=0;q+=yield*this.pushSpaces(!0)}while($+q>0);let X=this.getLine();if(X===null)return this.setNext("flow");if(z!==-1&&z<this.indentNext&&X[0]!=="#"||z===0&&(X.startsWith("---")||X.startsWith("..."))&&u(X[3])){if(!(z===this.indentNext-1&&this.flowLevel===1&&(X[0]==="]"||X[0]==="}")))return this.flowLevel=0,yield q$.FLOW_END,yield*this.parseLineStart()}let Z=0;while(X[Z]===",")Z+=yield*this.pushCount(1),Z+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(Z+=yield*this.pushIndicators(),X[Z]){case void 0:return"flow";case"#":return yield*this.pushCount(X.length-Z),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(S1),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let H=this.charAt(1);if(this.flowKey||u(H)||H===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let $=this.charAt(0),q=this.buffer.indexOf($,this.pos+1);if($==="'")while(q!==-1&&this.buffer[q+1]==="'")q=this.buffer.indexOf("'",q+2);else while(q!==-1){let Z=0;while(this.buffer[q-1-Z]==="\\")Z+=1;if(Z%2===0)break;q=this.buffer.indexOf('"',q+1)}let z=this.buffer.substring(0,q),X=z.indexOf(`
151
151
  `,this.pos);if(X!==-1){while(X!==-1){let Z=this.continueScalar(X+1);if(Z===-1)break;X=z.indexOf(`
152
152
  `,Z)}if(X!==-1)q=X-(z[X-1]==="\r"?2:1)}if(q===-1){if(!this.atEnd)return this.setNext("quoted-scalar");q=this.buffer.length}return yield*this.pushToIndex(q+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let $=this.pos;while(!0){let q=this.buffer[++$];if(q==="+")this.blockScalarKeep=!0;else if(q>"0"&&q<="9")this.blockScalarIndent=Number(q)-1;else if(q!=="-")break}return yield*this.pushUntil((q)=>u(q)||q==="#")}*parseBlockScalar(){let $=this.pos-1,q=0,z;$:for(let Z=this.pos;z=this.buffer[Z];++Z)switch(z){case" ":q+=1;break;case`
153
153
  `:$=Z,q=0;break;case"\r":{let H=this.buffer[Z+1];if(!H&&!this.atEnd)return this.setNext("block-scalar");if(H===`
@@ -157,13 +157,13 @@ ${q.comment}`:q.comment}this.doc.range[2]=q.offset;break}default:this.errors.pus
157
157
  `&&Z>=this.pos&&Z+1+q>Q)$=Z;else break}while(!0);return yield q$.SCALAR,yield*this.pushToIndex($+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let $=this.flowLevel>0,q=this.pos-1,z=this.pos-1,X;while(X=this.buffer[++z])if(X===":"){let Z=this.buffer[z+1];if(u(Z)||$&&a$.has(Z))break;q=z}else if(u(X)){let Z=this.buffer[z+1];if(X==="\r")if(Z===`
158
158
  `)z+=1,X=`
159
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(j1))+(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($===`
160
+ `){let H=this.continueScalar(z+1);if(H===-1)break;z=Math.max(z,H-2)}}else{if($&&a$.has(X))break;q=z}if(!X&&!this.atEnd)return this.setNext("plain-scalar");return yield q$.SCALAR,yield*this.pushToIndex(q+1,!0),$?"flow":"doc"}*pushCount($){if($>0)return yield this.buffer.substr(this.pos,$),this.pos+=$,$;return 0}*pushToIndex($,q){let z=this.buffer.slice(this.pos,$);if(z)return yield z,this.pos+=z.length,z.length;else if(q)yield"";return 0}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(S1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let $=this.flowLevel>0,q=this.charAt(1);if(u(q)||$&&a$.has(q)){if(!$)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=!1;return(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}}return 0}*pushTag(){if(this.charAt(1)==="<"){let $=this.pos+2,q=this.buffer[$];while(!u(q)&&q!==">")q=this.buffer[++$];return yield*this.pushToIndex(q===">"?$+1:$,!1)}else{let $=this.pos+1,q=this.buffer[$];while(q)if(hQ.has(q))q=this.buffer[++$];else if(q==="%"&&G4.has(this.buffer[$+1])&&G4.has(this.buffer[$+2]))q=this.buffer[$+=3];else break;return yield*this.pushToIndex($,!1)}}*pushNewline(){let $=this.buffer[this.pos];if($===`
161
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=S1();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)}}vQ.Lexer=Y4});var N1=D((mQ)=>{class B4{constructor(){this.lineStarts=[],this.addNewLine=($)=>this.lineStarts.push($),this.linePos=($)=>{let q=0,z=this.lineStarts.length;while(q<z){let Z=q+z>>1;if(this.lineStarts[Z]<$)q=Z+1;else z=Z}if(this.lineStarts[q]===$)return{line:q+1,col:1};if(q===0)return{line:0,col:$};let X=this.lineStarts[q-1];return{line:q,col:$-X+1}}}}mQ.LineCounter=B4});var E1=D((cQ)=>{var pQ=c("process"),T4=i$(),lQ=j1();function X0($,q){for(let z=0;z<$.length;++z)if($[z].type===q)return!0;return!1}function W4($){for(let q=0;q<$.length;++q)switch($[q].type){case"space":case"comment":case"newline":break;default:return q}return-1}function V4($){switch($?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function s$($){switch($.type){case"document":return $.start;case"block-map":{let q=$.items[$.items.length-1];return q.sep??q.start}case"block-seq":return $.items[$.items.length-1].start;default:return[]}}function F0($){if($.length===0)return[];let q=$.length;$:while(--q>=0)switch($[q].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break $}while($[++q]?.type==="space");return $.splice(q,$.length)}function L4($){if($.start.type==="flow-seq-start"){for(let q of $.items)if(q.sep&&!q.value&&!X0(q.start,"explicit-key-ind")&&!X0(q.sep,"map-value-ind")){if(q.key)q.value=q.key;if(delete q.key,V4(q.value))if(q.value.end)Array.prototype.push.apply(q.value.end,q.sep);else q.value.end=q.sep;else Array.prototype.push.apply(q.start,q.sep);delete q.sep}}}class _4{constructor($){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new lQ.Lexer,this.onNewLine=$}*parse($,q=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let z of this.lexer.lex($,q))yield*this.next(z);if(!q)yield*this.end()}*next($){if(this.source=$,pQ.env.LOG_TOKENS)console.log("|",T4.prettyToken($));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=$.length;return}let q=T4.tokenType($);if(!q){let z=`Not a YAML token: ${$}`;yield*this.pop({type:"error",offset:this.offset,message:z,source:$}),this.offset+=$.length}else if(q==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=q,yield*this.step(),q){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+$.length);break;case"space":if(this.atNewLine&&$[0]===" ")this.indent+=$.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=$.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=$.length}}*end(){while(this.stack.length>0)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let $=this.peek(1);if(this.type==="doc-end"&&$?.type!=="doc-end"){while(this.stack.length>0)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!$)return yield*this.stream();switch($.type){case"document":return yield*this.document($);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar($);case"block-scalar":return yield*this.blockScalar($);case"block-map":return yield*this.blockMap($);case"block-seq":return yield*this.blockSequence($);case"flow-collection":return yield*this.flowCollection($);case"doc-end":return yield*this.documentEnd($)}yield*this.pop()}peek($){return this.stack[this.stack.length-$]}*pop($){let q=$??this.stack.pop();if(!q)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield q;else{let z=this.peek(1);if(q.type==="block-scalar")q.indent="indent"in z?z.indent:0;else if(q.type==="flow-collection"&&z.type==="document")q.indent=0;if(q.type==="flow-collection")L4(q);switch(z.type){case"document":z.value=q;break;case"block-scalar":z.props.push(q);break;case"block-map":{let X=z.items[z.items.length-1];if(X.value){z.items.push({start:[],key:q,sep:[]}),this.onKeyLine=!0;return}else if(X.sep)X.value=q;else{Object.assign(X,{key:q,sep:[]}),this.onKeyLine=!X.explicitKey;return}break}case"block-seq":{let X=z.items[z.items.length-1];if(X.value)z.items.push({start:[],value:q});else X.value=q;break}case"flow-collection":{let X=z.items[z.items.length-1];if(!X||X.value)z.items.push({start:[],key:q,sep:[]});else if(X.sep)X.value=q;else Object.assign(X,{key:q,sep:[]});return}default:yield*this.pop(),yield*this.pop(q)}if((z.type==="document"||z.type==="block-map"||z.type==="block-seq")&&(q.type==="block-map"||q.type==="block-seq")){let X=q.items[q.items.length-1];if(X&&!X.sep&&!X.value&&X.start.length>0&&W4(X.start)===-1&&(q.indent===0||X.start.every((Z)=>Z.type!=="comment"||Z.indent<q.indent))){if(z.type==="document")z.end=X.start;else z.items.push({start:X.start});q.items.splice(-1,1)}}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let $={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")$.start.push(this.sourceToken);this.stack.push($);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document($){if($.value)return yield*this.lineEnd($);switch(this.type){case"doc-start":{if(W4($.start)!==-1)yield*this.pop(),yield*this.step();else $.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":$.start.push(this.sourceToken);return}let q=this.startBlockValue($);if(q)this.stack.push(q);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar($){if(this.type==="map-value-ind"){let q=s$(this.peek(2)),z=F0(q),X;if($.end)X=$.end,X.push(this.sourceToken),delete $.end;else X=[this.sourceToken];let Z={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:z,key:$,sep:X}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=Z}else yield*this.lineEnd($)}*blockScalar($){switch(this.type){case"space":case"comment":case"newline":$.props.push(this.sourceToken);return;case"scalar":if($.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let q=this.source.indexOf(`
163
163
  `)+1;while(q!==0)this.onNewLine(this.offset+q),q=this.source.indexOf(`
164
164
  `,q)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap($){let q=$.items[$.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,q.value){let z="end"in q.value?q.value.end:void 0;if((Array.isArray(z)?z[z.length-1]:void 0)?.type==="comment")z?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else if(q.sep)q.sep.push(this.sourceToken);else q.start.push(this.sourceToken);return;case"space":case"comment":if(q.value)$.items.push({start:[this.sourceToken]});else if(q.sep)q.sep.push(this.sourceToken);else{if(this.atIndentedComment(q.start,$.indent)){let X=$.items[$.items.length-2]?.value?.end;if(Array.isArray(X)){Array.prototype.push.apply(X,q.start),X.push(this.sourceToken),$.items.pop();return}}q.start.push(this.sourceToken)}return}if(this.indent>=$.indent){let z=!this.onKeyLine&&this.indent===$.indent,X=z&&(q.sep||q.explicitKey)&&this.type!=="seq-item-ind",Z=[];if(X&&q.sep&&!q.value){let H=[];for(let Q=0;Q<q.sep.length;++Q){let J=q.sep[Q];switch(J.type){case"newline":H.push(Q);break;case"space":break;case"comment":if(J.indent>$.indent)H.length=0;break;default:H.length=0}}if(H.length>=2)Z=q.sep.splice(H[1])}switch(this.type){case"anchor":case"tag":if(X||q.value)Z.push(this.sourceToken),$.items.push({start:Z}),this.onKeyLine=!0;else if(q.sep)q.sep.push(this.sourceToken);else q.start.push(this.sourceToken);return;case"explicit-key-ind":if(!q.sep&&!q.explicitKey)q.start.push(this.sourceToken),q.explicitKey=!0;else if(X||q.value)Z.push(this.sourceToken),$.items.push({start:Z,explicitKey:!0});else this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]});this.onKeyLine=!0;return;case"map-value-ind":if(q.explicitKey)if(!q.sep)if(X0(q.start,"newline"))Object.assign(q,{key:null,sep:[this.sourceToken]});else{let H=F0(q.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:H,key:null,sep:[this.sourceToken]}]})}else if(q.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(X0(q.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Z,key:null,sep:[this.sourceToken]}]});else if(V4(q.key)&&!X0(q.sep,"newline")){let H=F0(q.start),Q=q.key,J=q.sep;J.push(this.sourceToken),delete q.key,delete q.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:H,key:Q,sep:J}]})}else if(Z.length>0)q.sep=q.sep.concat(Z,this.sourceToken);else q.sep.push(this.sourceToken);else if(!q.sep)Object.assign(q,{key:null,sep:[this.sourceToken]});else if(q.value||X)$.items.push({start:Z,key:null,sep:[this.sourceToken]});else if(X0(q.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else q.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let H=this.flowScalar(this.type);if(X||q.value)$.items.push({start:Z,key:H,sep:[]}),this.onKeyLine=!0;else if(q.sep)this.stack.push(H);else Object.assign(q,{key:H,sep:[]}),this.onKeyLine=!0;return}default:{let H=this.startBlockValue($);if(H){if(H.type==="block-seq"){if(!q.explicitKey&&q.sep&&!X0(q.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else if(z)$.items.push({start:Z});this.stack.push(H);return}}}}yield*this.pop(),yield*this.step()}*blockSequence($){let q=$.items[$.items.length-1];switch(this.type){case"newline":if(q.value){let z="end"in q.value?q.value.end:void 0;if((Array.isArray(z)?z[z.length-1]:void 0)?.type==="comment")z?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else q.start.push(this.sourceToken);return;case"space":case"comment":if(q.value)$.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(q.start,$.indent)){let X=$.items[$.items.length-2]?.value?.end;if(Array.isArray(X)){Array.prototype.push.apply(X,q.start),X.push(this.sourceToken),$.items.pop();return}}q.start.push(this.sourceToken)}return;case"anchor":case"tag":if(q.value||this.indent<=$.indent)break;q.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==$.indent)break;if(q.value||X0(q.start,"seq-item-ind"))$.items.push({start:[this.sourceToken]});else q.start.push(this.sourceToken);return}if(this.indent>$.indent){let z=this.startBlockValue($);if(z){this.stack.push(z);return}}yield*this.pop(),yield*this.step()}*flowCollection($){let q=$.items[$.items.length-1];if(this.type==="flow-error-end"){let z;do yield*this.pop(),z=this.peek(1);while(z?.type==="flow-collection")}else if($.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!q||q.sep)$.items.push({start:[this.sourceToken]});else q.start.push(this.sourceToken);return;case"map-value-ind":if(!q||q.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(q.sep)q.sep.push(this.sourceToken);else Object.assign(q,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!q||q.value)$.items.push({start:[this.sourceToken]});else if(q.sep)q.sep.push(this.sourceToken);else q.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let X=this.flowScalar(this.type);if(!q||q.value)$.items.push({start:[],key:X,sep:[]});else if(q.sep)this.stack.push(X);else Object.assign(q,{key:X,sep:[]});return}case"flow-map-end":case"flow-seq-end":$.end.push(this.sourceToken);return}let z=this.startBlockValue($);if(z)this.stack.push(z);else yield*this.pop(),yield*this.step()}else{let z=this.peek(2);if(z.type==="block-map"&&(this.type==="map-value-ind"&&z.indent===$.indent||this.type==="newline"&&!z.items[z.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&z.type!=="flow-collection"){let X=s$(z),Z=F0(X);L4($);let H=$.end.splice(1,$.end.length);H.push(this.sourceToken);let Q={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:Z,key:$,sep:H}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=Q}else yield*this.lineEnd($)}}flowScalar($){if(this.onNewLine){let q=this.source.indexOf(`
165
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 P4=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 M4($,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=M4($,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=M4;$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=S1(),V7=N1(),_7=E1(),r$=P4(),w4=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=w4.visit;D7.visitAsync=w4.visitAsync});var W2=n1(T2(),1),{program:W0,createCommand:OU,createArgument:AU,createOption:jU,CommanderError:SU,InvalidArgumentError:NU,InvalidOptionArgumentError:EU,Command:bU,Argument:CU,Option:Iq,Help:yU}=W2.default;var L2={name:"@pickled-dev/cli",version:"0.9.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 YU from"path";var d={category:"cli",provider:"claude-code",model:"sonnet"},Rq=["Read","Glob","Grep","Bash"],Mq=["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))s7(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)"}`);o7(z.name,z.traps)}}function s7($,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 r7=new Set(["g","y"]),n7=new Set(["i","m","s","u","v"]);function o7($,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(r7.has(J))throw Error(`pickled.yml: scenario "${$}" trap "${X.id}" uses forbidden regex flag "${J}" (g and y are not allowed)`);if(!n7.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=s$($),z=F0(q);return z.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:z,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let q=s$($),z=F0(q);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:z,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment($,q){if(this.type!=="comment")return!1;if(this.indent<=q)return!1;return $.every((z)=>z.type==="newline"||z.type==="space")}*documentEnd($){if(this.type!=="doc-mode"){if($.end)$.end.push(this.sourceToken);else $.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd($){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:if($.end)$.end.push(this.sourceToken);else $.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}cQ.Parser=_4});var M4=D(($7)=>{var D4=R1(),aQ=n0(),z$=o0(),sQ=Nq(),rQ=A(),nQ=N1(),I4=E1();function R4($){let q=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||q&&new nQ.LineCounter||null,prettyErrors:q}}function oQ($,q={}){let{lineCounter:z,prettyErrors:X}=R4(q),Z=new I4.Parser(z?.addNewLine),H=new D4.Composer(q),Q=Array.from(H.compose(Z.parse($)));if(X&&z)for(let J of Q)J.errors.forEach(z$.prettifyError($,z)),J.warnings.forEach(z$.prettifyError($,z));if(Q.length>0)return Q;return Object.assign([],{empty:!0},H.streamInfo())}function w4($,q={}){let{lineCounter:z,prettyErrors:X}=R4(q),Z=new I4.Parser(z?.addNewLine),H=new D4.Composer(q),Q=null;for(let J of H.compose(Z.parse($),!0,$.length))if(!Q)Q=J;else if(Q.options.logLevel!=="silent"){Q.errors.push(new z$.YAMLParseError(J.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(X&&z)Q.errors.forEach(z$.prettifyError($,z)),Q.warnings.forEach(z$.prettifyError($,z));return Q}function tQ($,q,z){let X=void 0;if(typeof q==="function")X=q;else if(z===void 0&&q&&typeof q==="object")z=q;let Z=w4($,z);if(!Z)return null;if(Z.warnings.forEach((H)=>sQ.warn(Z.options.logLevel,H)),Z.errors.length>0)if(Z.options.logLevel!=="silent")throw Z.errors[0];else Z.errors=[];return Z.toJS(Object.assign({reviver:X},z))}function eQ($,q,z){let X=null;if(typeof q==="function"||Array.isArray(q))X=q;else if(z===void 0&&q)z=q;if(typeof z==="string")z=z.length;if(typeof z==="number"){let Z=Math.round(z);z=Z<1?void 0:Z>8?{indent:8}:{indent:Z}}if($===void 0){let{keepUndefined:Z}=z??q??{};if(!Z)return}if(rQ.isDocument($)&&!X)return $.toString(z);return new aQ.Document($,X,z).toString(z)}$7.parse=tQ;$7.parseAllDocuments=oQ;$7.parseDocument=w4;$7.stringify=eQ});var K4=D((D7)=>{var H7=R1(),Q7=n0(),J7=X1(),b1=o0(),U7=k0(),Z0=A(),G7=e(),Y7=b(),B7=q0(),T7=z0(),W7=i$(),L7=j1(),V7=N1(),_7=E1(),r$=M4(),P4=y0();D7.Composer=H7.Composer;D7.Document=Q7.Document;D7.Schema=J7.Schema;D7.YAMLError=b1.YAMLError;D7.YAMLParseError=b1.YAMLParseError;D7.YAMLWarning=b1.YAMLWarning;D7.Alias=U7.Alias;D7.isAlias=Z0.isAlias;D7.isCollection=Z0.isCollection;D7.isDocument=Z0.isDocument;D7.isMap=Z0.isMap;D7.isNode=Z0.isNode;D7.isPair=Z0.isPair;D7.isScalar=Z0.isScalar;D7.isSeq=Z0.isSeq;D7.Pair=G7.Pair;D7.Scalar=Y7.Scalar;D7.YAMLMap=B7.YAMLMap;D7.YAMLSeq=T7.YAMLSeq;D7.CST=W7;D7.Lexer=L7.Lexer;D7.LineCounter=V7.LineCounter;D7.Parser=_7.Parser;D7.parse=r$.parse;D7.parseAllDocuments=r$.parseAllDocuments;D7.parseDocument=r$.parseDocument;D7.stringify=r$.stringify;D7.visit=P4.visit;D7.visitAsync=P4.visitAsync});var W2=n1(T2(),1),{program:W0,createCommand:AU,createArgument:SU,createOption:jU,CommanderError:NU,InvalidArgumentError:EU,InvalidOptionArgumentError:bU,Command:CU,Argument:yU,Option:Iq,Help:fU}=W2.default;var L2={name:"@pickled-dev/cli",version:"0.10.0",description:"Test what agents actually understand about your product",module:"dist/index.js",type:"module",bin:{pickled:"./dist/index.js"},files:["dist"],scripts:{dev:"bun run ./src/index.ts",build:"bun build ./src/index.ts --outdir ./dist --target bun --minify --external @anthropic-ai/claude-agent-sdk",release:"semantic-release"},dependencies:{commander:"^14.0.2",chalk:"^5.6.2","@anthropic-ai/claude-agent-sdk":"^0.3.0"},devDependencies:{"@pickled-dev/config":"workspace:*","@pickled-dev/core":"workspace:*","semantic-release":"^25.0.2","@semantic-release/commit-analyzer":"^13.0.1","@semantic-release/exec":"^7.1.0","@semantic-release/git":"^10.0.1","@semantic-release/github":"^12.0.2","semantic-release-ai-notes":"^0.3.0"}};import BU from"path";var d={category:"cli",provider:"claude-code",model:"sonnet"},Rq=["Read","Glob","Grep","Bash"],wq=["Edit","MultiEdit","Write","NotebookEdit"];var F4=n1(K4(),1);async function O0($){let q=`${$}/pickled.yml`,z=Bun.file(q);if(!await z.exists())throw Error(`pickled.yml not found in ${$}`);let X;try{let Z=await z.text();X=F4.default.parse(Z)}catch(Z){throw Error(`Failed to parse pickled.yml: ${Z}`)}return a7(X),X}function a7($){if(!$.tool?.name)throw Error("pickled.yml: 'tool.name' is required");if(!Array.isArray($.scenarios)||$.scenarios.length===0)throw Error("pickled.yml: 'scenarios' must be a non-empty array");if($.docs?.sources)for(let[z,X]of Object.entries($.docs.sources))r7(z,X);if($.targets)for(let[z,X]of Object.entries($.targets)){if(X.systemPrompt!==void 0)throw Error(`pickled.yml: target "${z}" sets 'systemPrompt', which bypasses the citation contract. Remove it; custom prompts are not supported in citation mode.`);if(X.provider==="codex-cli"){if(!X.model)throw Error(`pickled.yml: target "${z}" (codex-cli) requires an explicit 'model' field. Codex's default model can change without notice; pin it for reproducible evals.`);if(X.maxTurns!==void 0)throw Error(`pickled.yml: target "${z}" (codex-cli) sets 'maxTurns', but the codex CLI does not support a turn cap. Remove the field.`)}}let q=new Set(Object.keys($.docs?.sources??{}));for(let z of $.scenarios){if(!z.name||!z.prompt)throw Error("pickled.yml: every scenario needs 'name' and 'prompt'");if(!Array.isArray(z.requiredSources))throw Error(`pickled.yml: scenario "${z.name}" is missing 'requiredSources' (use [] to allow any citation)`);for(let X of z.requiredSources)if(!q.has(X))throw Error(`pickled.yml: scenario "${z.name}" references unknown source "${X}". Declared sources: ${[...q].join(", ")||"(none)"}`);t7(z.name,z.traps),s7(z.name,z.compareSurfaces,q)}}function s7($,q,z){if(q===void 0)return;if(!Array.isArray(q))throw Error(`pickled.yml: scenario "${$}" compareSurfaces must be an array of source-id lists`);if(q.length===0)throw Error(`pickled.yml: scenario "${$}" compareSurfaces cannot be empty (use a non-empty list of surfaces, or remove the field)`);for(let X=0;X<q.length;X++){let Z=q[X];if(!Array.isArray(Z))throw Error(`pickled.yml: scenario "${$}" compareSurfaces[${X}] must be an array of source ids`);if(Z.length===0)throw Error(`pickled.yml: scenario "${$}" compareSurfaces[${X}] must be a non-empty list of source ids`);for(let H of Z){if(typeof H!=="string")throw Error(`pickled.yml: scenario "${$}" compareSurfaces[${X}] entries must be string source ids`);if(!z.has(H))throw Error(`pickled.yml: scenario "${$}" compareSurfaces[${X}] references unknown source "${H}". Declared sources: ${[...z].join(", ")||"(none)"}`)}}}function r7($,q){if(typeof q==="string"){if(q.length===0)throw Error(`pickled.yml: docs.sources["${$}"] string form must be a non-empty file path or URL`);return}if(!q||typeof q!=="object")throw Error(`pickled.yml: docs.sources["${$}"] must be a string (path/URL) or an object with a 'path' field`);let z=q;if(typeof z.path!=="string"||z.path.length===0)throw Error(`pickled.yml: docs.sources["${$}"] object form requires a non-empty 'path' field`);if(z.audit!==void 0){if(typeof z.audit!=="object"||z.audit===null)throw Error(`pickled.yml: docs.sources["${$}"].audit must be an object`);let X=z.audit;if(X.traps!==void 0&&typeof X.traps!=="boolean")throw Error(`pickled.yml: docs.sources["${$}"].audit.traps must be a boolean`);for(let Z of Object.keys(X))if(Z!=="traps")throw Error(`pickled.yml: docs.sources["${$}"].audit has unknown field "${Z}"`)}for(let X of Object.keys(z))if(X!=="path"&&X!=="audit")throw Error(`pickled.yml: docs.sources["${$}"] has unknown field "${X}"`)}var n7=new Set(["g","y"]),o7=new Set(["i","m","s","u","v"]);function t7($,q){if(q===void 0)return;if(!Array.isArray(q))throw Error(`pickled.yml: scenario "${$}" has non-array 'traps'`);let z=new Set;for(let X of q){if(!X.id||typeof X.id!=="string")throw Error(`pickled.yml: scenario "${$}" has a trap missing 'id'`);if(z.has(X.id))throw Error(`pickled.yml: scenario "${$}" has duplicate trap id "${X.id}"`);if(z.add(X.id),!X.reason||typeof X.reason!=="string")throw Error(`pickled.yml: scenario "${$}" trap "${X.id}" requires non-empty 'reason'`);if(X.auditSeverity!==void 0&&X.auditSeverity!=="warning"&&X.auditSeverity!=="error")throw Error(`pickled.yml: scenario "${$}" trap "${X.id}" auditSeverity must be "warning" or "error"`);let Z=typeof X.match==="string",H=typeof X.pattern==="string";if(Z===H)throw Error(`pickled.yml: scenario "${$}" trap "${X.id}" must set exactly one of 'match' or 'pattern'`);if(Z){if(X.match==="")throw Error(`pickled.yml: scenario "${$}" trap "${X.id}" has empty 'match'`);if(X.flags!==void 0)throw Error(`pickled.yml: scenario "${$}" trap "${X.id}" sets 'flags' without 'pattern'`)}else{let Q=X.pattern;if(typeof Q!=="string")throw Error(`pickled.yml: scenario "${$}" trap "${X.id}" must set 'pattern'`);if(Q==="")throw Error(`pickled.yml: scenario "${$}" trap "${X.id}" has empty 'pattern'`);if(X.flags!==void 0){if(typeof X.flags!=="string")throw Error(`pickled.yml: scenario "${$}" trap "${X.id}" has non-string 'flags'`);for(let J of X.flags){if(n7.has(J))throw Error(`pickled.yml: scenario "${$}" trap "${X.id}" uses forbidden regex flag "${J}" (g and y are not allowed)`);if(!o7.has(J))throw Error(`pickled.yml: scenario "${$}" trap "${X.id}" uses unsupported regex flag "${J}"`)}}try{new RegExp(Q,X.flags??"")}catch(J){throw Error(`pickled.yml: scenario "${$}" trap "${X.id}" has invalid regex pattern: ${J instanceof Error?J.message:J}`)}}}}function C1($,q){let z=new Set([...Object.keys($.targets??{}),"default"]);if(!z.has(q)){let X=[...z].sort().join(", ");throw Error(`Unknown target: "${q}". Available targets: ${X}`)}return{...$,matrix:{...$.matrix,target:[q]},scenarios:$.scenarios.filter((X)=>!X.target||X.target===q)}}function y1($){if(typeof $==="string")return{path:$,auditTraps:!0};return{path:$.path,auditTraps:$.audit?.traps??!0}}function n$($){let{config:q,files:z,pairs:X,findings:Z}=$,H=[],Q=Z.filter((G)=>G.severity==="error").length,J=Z.filter((G)=>G.severity==="warning").length;if(H.push(`# Agent-context audit
167
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.
@@ -182,11 +182,11 @@ ${q.comment}`:q.comment}this.doc.range[2]=q.offset;break}default:this.errors.pus
182
182
  `),H.push("| Section | Lines |"),H.push("|---|---|");for(let T of G.sections.slice(0,10))H.push(`| ${T.header} | ${T.lines} |`);H.push("")}if(H.push(`## Registered-source trap matches
183
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
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),w=W?` (${W})`:"";H.push(` ${R} ${I} lines ${V}${w}`)}}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 S0,lstatSync as E4,readFileSync as qq,readlinkSync as HJ,statSync as QJ}from"fs";import{dirname as zq,isAbsolute as JJ,join as k1,relative as UJ,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 zJ}from"fs";import{join as XJ}from"path";function j0($){let q=[],z=[];for(let X of $.traps){let Z=t7($.response,X);if(Z)q.push(Z);else z.push(X.id)}return{fired:q,avoided:z}}function t7($,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 e7($){return $.startsWith("http://")||$.startsWith("https://")}async function $J($,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 qJ($,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 j4($,q,z){let{path:X,auditTraps:Z}=y1(q);if(e7(X))return $J($,X,Z);return qJ($,X,z,Z)}async function X$($,q){let z=Object.entries($);return await Promise.all(z.map(([Z,H])=>j4(Z,H,q)))}async function S4($){if(!zJ(XJ($,"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}=j0({response:U.content,traps:[B]}),T=G[0];if(!T)continue;let L=ZJ(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 ZJ($,q){let z=1,X=Math.min(q,$.length);for(let Z=0;Z<X;Z++)if($[Z]===`
187
- `)z++;return z}var GJ=["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(!S0(z))throw Error(`targetRepo does not exist: ${z}`);let X=new Set;for(let U of GJ){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(QJ(T).isFile())X.add(G)}catch{}}}let Z=[];for(let U of[...X].sort())Z.push(await YJ(z,U,k1(z,U),q));let H=wJ(Z,q),Q=KJ(Z,H,q),{matches:J,findings:Y}=await S4(z);return{config:q,files:Z,pairs:H,findings:[...Q,...Y],sourceTrapMatches:J}}async function YJ($,q,z,X){let H=E4(z).isSymbolicLink(),Q=null,J=q;if(H){let T=HJ(z),L=JJ(T)?T:x1(zq(z),T);if(Q=L,S0(L))J=UJ($,L)}let Y=H&&Q&&S0(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:TJ(U,$,q),brokenImports:LJ(U,zq(z)),unresolvedCommands:IJ(U,$,X.knownCommands),sections:RJ(U)}}function BJ($){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 TJ($,q,z){let X=PJ($),Z=zq(z),H=BJ(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)&&!WJ(q,U,Z,H).found)Q.add(U);Y=J.exec(X)}return[...Q].sort()}function WJ($,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(S0(`${$}/${Q}`))return{found:!0,resolvedAs:Q}}return{found:!1}}function LJ($,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(!S0(Q))z.add(H);Z=X.exec($)}return[...z].sort()}var VJ=["bun","pnpm","npm","yarn"],_J=new Set(["install","add","remove","update","i","audit","list","ls","why","outdated","exec","run","create","init","x"]),DJ={bun:new Set(["build","test","link","unlink","upgrade"])};function IJ($,q,z){let X=new Set,Z=k1(q,"package.json"),H=new Set;if(S0(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 VJ){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}`)&&!_J.has(B)&&!DJ[J]?.has(B))X.add(`${J} ${B}`);U=Y.exec($)}}return[...X].sort()}function RJ($){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 wJ($,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 KJ($,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=FJ($);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 FJ($){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 OJ}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(`
185
+ `)}function o$($){return JSON.stringify($,null,2)}function t$($){let{config:q,files:z,pairs:X,findings:Z}=$,H=[],Q=Z.filter((G)=>G.severity==="error").length,J=Z.filter((G)=>G.severity==="warning").length;if(H.push("pickled audit"),H.push(`Target: ${q.targetRepo}`),H.push(`Budgets: root \u2264 ${q.budgets.rootLines} lines, nested warn at ${q.budgets.nestedWarnLines} lines.`),H.push(`Found: ${z.length} agent-doc file(s) \xB7 ${Q} error(s) \xB7 ${J} warning(s)`),H.push(""),H.push("Inventory"),z.length===0)H.push(" none");else{let G=[...z].sort((L,_)=>_.lineCount-L.lineCount),T=Math.max(...G.map((L)=>L.relPath.length));for(let L of G){let _=!L.relPath.includes("/"),W=O4(L.lineCount,_,q),V=L.isSymlink?`symlink \u2192 ${L.symlinkTarget?.replace(`${q.targetRepo}/`,"")??"?"}`:"file",I=`${L.lineCount}`.padStart(4),R=L.relPath.padEnd(T),P=W?` (${W})`:"";H.push(` ${R} ${I} lines ${V}${P}`)}}if(H.push(""),H.push("AGENTS.md / CLAUDE.md pairs"),X.length===0)H.push(" none");else for(let G of X){let T=G.dir||"(root)";H.push(` ${T}: ${G.classification} \xB7 ${G.detail}`)}H.push("");let Y=z.filter((G)=>!G.isSymlink&&G.brokenPathRefs.length+G.brokenImports.length>0);if(H.push("Broken references"),Y.length===0)H.push(" none");else for(let G of Y){H.push(` ${G.relPath}:`);for(let T of G.brokenPathRefs)H.push(` path: ${T}`);for(let T of G.brokenImports)H.push(` @-import: ${T}`)}H.push("");let U=z.filter((G)=>!G.isSymlink&&G.unresolvedCommands.length>0);if(H.push("Unresolved package-manager commands (advisory)"),U.length===0)H.push(" none");else for(let G of U){H.push(` ${G.relPath}:`);for(let T of G.unresolvedCommands)H.push(` ${T}`)}H.push("");let B=z.filter((G)=>{if(G.isSymlink)return!1;return!G.relPath.includes("/")?G.lineCount>q.budgets.rootLines:G.lineCount>q.budgets.nestedWarnLines});if(H.push("Section breakdown for files over budget"),B.length===0)H.push(" all files within budget");else for(let G of B){H.push(` ${G.relPath} (${G.lineCount} lines):`);for(let T of G.sections.slice(0,10))H.push(` ${T.header.padEnd(40)} ${T.lines} lines`)}if(H.push(""),H.push("Registered-source trap matches"),$.sourceTrapMatches.length===0)H.push(" none");else for(let G of $.sourceTrapMatches){let T=G.severity==="error"?"error":"warning";H.push(` [${T}] ${G.sourceId} (${G.sourcePath}:L${G.line}): trap ${G.trapId} matched "${G.matched}"`),H.push(` reason: ${G.trapReason}`),H.push(" fix: remove the stale claim, retire the trap, or set audit.traps: false on the source")}return H.join(`
186
+ `)}function O4($,q,z){if(q&&$>z.budgets.rootLines)return`over root budget (${$} > ${z.budgets.rootLines})`;if(!q&&$>z.budgets.nestedWarnLines)return`over nested-warn (${$} > ${z.budgets.nestedWarnLines})`;return""}import{existsSync as j0,lstatSync as E4,readFileSync as qq,readlinkSync as QJ,statSync as JJ}from"fs";import{dirname as zq,isAbsolute as UJ,join as k1,relative as GJ,resolve as x1}from"path";var{Glob:N4}=globalThis.Bun;var e$=["node_modules/**","**/node_modules/**",".git/**","**/.git/**","dist/**","**/dist/**","build/**","**/build/**",".next/**","**/.next/**",".turbo/**","**/.turbo/**",".cache/**","**/.cache/**",".runs/**","**/.runs/**","coverage/**","**/coverage/**","**/__fixtures__/**","**/tests/**/fixture/**","**/tests/**/fixtures/**","**/test/**/fixture/**","**/test/**/fixtures/**"],A0={targetRepo:".",budgets:{rootLines:120,nestedWarnLines:200},ignore:e$,intentionalDifferentPairs:[],knownCommands:[]};function $q($){if(!$)return A0;return{targetRepo:$.targetRepo??A0.targetRepo,budgets:{rootLines:$.budgets?.rootLines??A0.budgets.rootLines,nestedWarnLines:$.budgets?.nestedWarnLines??A0.budgets.nestedWarnLines},ignore:$.ignore??e$,intentionalDifferentPairs:$.intentionalDifferentPairs??[],knownCommands:$.knownCommands??[]}}import{existsSync as XJ}from"fs";import{join as ZJ}from"path";function S0($){let q=[],z=[];for(let X of $.traps){let Z=e7($.response,X);if(Z)q.push(Z);else z.push(X.id)}return{fired:q,avoided:z}}function e7($,q){if(q.match!==void 0){let z=$.indexOf(q.match);if(z===-1)return null;return{id:q.id,reason:q.reason,matched:q.match,snippet:A4($,z,q.match.length),index:z}}if(q.pattern!==void 0){let X=new RegExp(q.pattern,q.flags??"").exec($);if(!X)return null;return{id:q.id,reason:q.reason,matched:X[0],snippet:A4($,X.index,X[0].length),index:X.index}}return null}function A4($,q,z){let X=Math.max(0,q-40),Z=Math.min($.length,q+z+40),H=$.slice(X,Z).replace(/\s+/g," ").trim();if(X>0)H=`...${H}`;if(Z<$.length)H=`${H}...`;return H}import f1 from"path";function $J($){return $.startsWith("http://")||$.startsWith("https://")}async function qJ($,q,z){let X=await fetch(q);if(!X.ok)throw Error(`Failed to fetch source "${$}" from ${q}: ${X.status} ${X.statusText}`);let Z=await X.text();return{id:$,source:q,content:Z,name:new URL(q).hostname+new URL(q).pathname,type:"url",auditTraps:z}}async function zJ($,q,z,X){let Z=f1.isAbsolute(q)?q:f1.resolve(z,q),H=Bun.file(Z);if(!await H.exists())throw Error(`Source "${$}" not found at ${Z}`);let Q=await H.text();return{id:$,source:q,content:Q,name:f1.basename(Z),type:"file",auditTraps:X}}async function S4($,q,z){let{path:X,auditTraps:Z}=y1(q);if($J(X))return qJ($,X,Z);return zJ($,X,z,Z)}async function X$($,q){let z=Object.entries($);return await Promise.all(z.map(([Z,H])=>S4(Z,H,q)))}async function j4($){if(!XJ(ZJ($,"pickled.yml")))return{matches:[],findings:[]};let q=await O0($),z=q.docs?.sources;if(!z||Object.keys(z).length===0)return{matches:[],findings:[]};let X={};for(let[U,B]of Object.entries(z)){let G=typeof B==="string"?B:B.path;if(G.startsWith("http://")||G.startsWith("https://"))continue;X[U]=B}if(Object.keys(X).length===0)return{matches:[],findings:[]};let Z=[],H=new Map;for(let U of q.scenarios)for(let B of U.traps??[])Z.push(B),H.set(B,B.auditSeverity??"warning");if(Z.length===0)return{matches:[],findings:[]};let Q=await X$(X,$),J=[],Y=[];for(let U of Q){if(U.auditTraps===!1)continue;for(let B of Z){let{fired:G}=S0({response:U.content,traps:[B]}),T=G[0];if(!T)continue;let L=HJ(U.content,T.index),_=H.get(B)??"warning";J.push({sourceId:U.id,sourcePath:U.source,trapId:T.id,trapReason:T.reason,matched:T.matched,snippet:T.snippet,line:L,severity:_}),Y.push({severity:_,category:"trap-source-match",file:U.source,message:`source [${U.id}] matches trap '${T.id}' ("${T.matched}"). ${T.reason} Fix: remove the stale claim from the source, retire the trap if no longer relevant, or set audit.traps: false on the source if it is deliberately stale or test-only.`})}}return{matches:J,findings:Y}}function HJ($,q){let z=1,X=Math.min(q,$.length);for(let Z=0;Z<X;Z++)if($[Z]===`
187
+ `)z++;return z}var YJ=["AGENTS.md","CLAUDE.md","CLAUDE.local.md","llms.txt","llms-full.txt",".claude/CLAUDE.md",".claude/rules/*.md","**/AGENTS.md","**/CLAUDE.md","**/CLAUDE.local.md","**/llms.txt","**/llms-full.txt","**/.claude/CLAUDE.md","**/.claude/rules/*.md"];async function Xq($){let q=$q($),z=x1(q.targetRepo);if(!j0(z))throw Error(`targetRepo does not exist: ${z}`);let X=new Set;for(let U of YJ){let B=new N4(U);for await(let G of B.scan({cwd:z,dot:!0,onlyFiles:!1,followSymlinks:!1})){if(q.ignore.some((_)=>new N4(_).match(G)))continue;let T=k1(z,G),L=E4(T);if(L.isFile()){X.add(G);continue}if(L.isSymbolicLink())try{if(JJ(T).isFile())X.add(G)}catch{}}}let Z=[];for(let U of[...X].sort())Z.push(await BJ(z,U,k1(z,U),q));let H=KJ(Z,q),Q=FJ(Z,H,q),{matches:J,findings:Y}=await j4(z);return{config:q,files:Z,pairs:H,findings:[...Q,...Y],sourceTrapMatches:J}}async function BJ($,q,z,X){let H=E4(z).isSymbolicLink(),Q=null,J=q;if(H){let T=QJ(z),L=UJ(T)?T:x1(zq(z),T);if(Q=L,j0(L))J=GJ($,L)}let Y=H&&Q&&j0(Q)?Q:z,U=qq(Y,"utf8"),B=(U.match(/\n/g)??[]).length,G=U.endsWith(`
188
+ `)?B:B+1;return{relPath:q,absPath:z,isSymlink:H,symlinkTarget:Q,realRelPath:J,lineCount:G,brokenPathRefs:WJ(U,$,q),brokenImports:VJ(U,zq(z)),unresolvedCommands:RJ(U,$,X.knownCommands),sections:wJ(U)}}function TJ($){let q=$.split("/");if(q.length<2)return null;if(q[0]==="packages"||q[0]==="apps"||q[0]==="shared")return`${q[0]}/${q[1]}`;if(q[0]==="tests")return q.slice(0,2).join("/");return null}function WJ($,q,z){let X=PJ($),Z=zq(z),H=TJ(z),Q=new Set,J=/`([^`\n]{2,200})`/g,Y;Y=J.exec(X);while(Y!==null){let U=Y[1].trim().replace(/[#?].*$/,"");if(MJ(U)&&!LJ(q,U,Z,H).found)Q.add(U);Y=J.exec(X)}return[...Q].sort()}function LJ($,q,z,X){let Z=[q];if(z&&z!==".")Z.push(`${z}/${q}`);if(X)Z.push(`${X}/${q}`);Z.push(`packages/${q}`,`apps/${q}`,`shared/${q}`);for(let H of Z){let Q=H.replace(/\/+/g,"/");if(j0(`${$}/${Q}`))return{found:!0,resolvedAs:Q}}return{found:!1}}function VJ($,q){let z=new Set,X=/@([\w./@~-]+\.md)/g,Z;Z=X.exec($);while(Z!==null){let H=Z[1];if(H.startsWith("~/")){Z=X.exec($);continue}let Q=H.startsWith("/")?H:x1(q,H);if(!j0(Q))z.add(H);Z=X.exec($)}return[...z].sort()}var _J=["bun","pnpm","npm","yarn"],DJ=new Set(["install","add","remove","update","i","audit","list","ls","why","outdated","exec","run","create","init","x"]),IJ={bun:new Set(["build","test","link","unlink","upgrade"])};function RJ($,q,z){let X=new Set,Z=k1(q,"package.json"),H=new Set;if(j0(Z))try{let J=JSON.parse(qq(Z,"utf8"));H=new Set(Object.keys(J.scripts??{}))}catch{}let Q=new Set(z.map((J)=>J.trim()));for(let J of _J){let Y=new RegExp(`\\b${J}\\s+(?:run\\s+|--filter\\s+\\S+\\s+(?:run\\s+)?)?([a-zA-Z][\\w:.\\-]*)`,"g"),U;U=Y.exec($);while(U!==null){let B=U[1];if(!H.has(B)&&!Q.has(`${J} ${B}`)&&!Q.has(`${J} run ${B}`)&&!DJ.has(B)&&!IJ[J]?.has(B))X.add(`${J} ${B}`);U=Y.exec($)}}return[...X].sort()}function wJ($){let q=$.split(`
189
+ `),z=[],X=null;if(q.forEach((Z,H)=>{if(/^##\s+/.test(Z)){if(X)z.push({header:X.header,lines:H-X.start});X={header:Z.replace(/^##\s+/,"").trim(),start:H}}}),X){let Z=X;z.push({header:Z.header,lines:q.length-Z.start})}return z.sort((Z,H)=>H.lines-Z.lines)}function MJ($){if($.length===0||$.length>160)return!1;if(!$.includes("/"))return!1;if(/\s/.test($))return!1;if(/^https?:\/\//.test($))return!1;if(/[*?{}[\]<>]/.test($))return!1;if($.startsWith("@"))return!1;if($.startsWith("~/"))return!1;if(/^[a-z]+:\/\//i.test($))return!1;if(/^cdn\./.test($)||/^unpkg\./.test($)||/^npm\./.test($))return!1;if(/^\/[a-z]/.test($)&&/(?:icon|image|img|asset|file|path)/i.test($))return!1;if(/^(cd|pnpm|npm|yarn|bun|node|git|ls|cat|grep|find|sed|awk|mkdir|rm|mv|cp|echo|export|source|sudo|brew|docker|curl|wget)\b/.test($))return!1;return/[a-zA-Z0-9_.-]\/[a-zA-Z0-9_.-]/.test($)}function PJ($){return $.replace(/```[\s\S]*?```/g,"")}function KJ($,q){let z=new Map;for(let H of $){let Q=H.relPath.split("/").pop()??"";if(Q!=="AGENTS.md"&&Q!=="CLAUDE.md")continue;let J=zq(H.relPath),Y=z.get(J)??{};if(Q==="AGENTS.md")Y.agents=H;if(Q==="CLAUDE.md")Y.claude=H;z.set(J,Y)}let X=new Set(q.intentionalDifferentPairs),Z=[];for(let[H,Q]of z){let J=!!Q.agents,Y=!!Q.claude;if(!J&&!Y)continue;if(!J||!Y){Z.push({dir:H,agentsExists:J,claudeExists:Y,classification:"single",detail:J?"only AGENTS.md":"only CLAUDE.md"});continue}let{agents:U,claude:B}=Q,G=`${U.relPath}:${B.relPath}`,T=`${B.relPath}:${U.relPath}`;if(X.has(G)||X.has(T)){Z.push({dir:H,agentsExists:J,claudeExists:Y,classification:"intentional-different",detail:`allowlisted: ${U.lineCount}L vs ${B.lineCount}L`});continue}if(U.isSymlink&&U.symlinkTarget===B.absPath||B.isSymlink&&B.symlinkTarget===U.absPath){let V=U.isSymlink?"CLAUDE.md":"AGENTS.md";Z.push({dir:H,agentsExists:J,claudeExists:Y,classification:"linked",detail:`canonical: ${V}`});continue}let _=qq(U.absPath,"utf8"),W=qq(B.absPath,"utf8");if(_===W)Z.push({dir:H,agentsExists:J,claudeExists:Y,classification:"unexpected-duplicate",detail:`byte-for-byte duplicate (${U.lineCount}L), not symlinked`});else Z.push({dir:H,agentsExists:J,claudeExists:Y,classification:"unexpected-duplicate",detail:`divergent (${U.lineCount}L vs ${B.lineCount}L), not in intentional-different allowlist`})}return Z.sort((H,Q)=>H.dir.localeCompare(Q.dir)),Z}function FJ($,q,z){let X=[];for(let Z of $){if(Z.isSymlink)continue;for(let J of Z.brokenImports)X.push({severity:"error",category:"broken-import",file:Z.relPath,message:`broken @-import: ${J}`});for(let J of Z.brokenPathRefs)X.push({severity:"error",category:"broken-path-ref",file:Z.relPath,message:`broken path reference: ${J}`});for(let J of Z.unresolvedCommands)X.push({severity:"warning",category:"unresolved-command",file:Z.relPath,message:`unresolved command: ${J}`});let H=!Z.relPath.includes("/"),Q=H?z.budgets.rootLines:z.budgets.nestedWarnLines;if(Z.lineCount>Q)X.push({severity:"warning",category:"over-budget",file:Z.relPath,message:`${Z.lineCount} lines exceeds ${H?"root":"nested"} budget of ${Q}`})}for(let Z of q)if(Z.classification==="unexpected-duplicate"){let H=Z.detail.startsWith("divergent")?"error":"warning";X.push({severity:H,category:H==="error"?"divergent-pair":"duplicate-pair",file:Z.dir||"(root)",message:`AGENTS.md / CLAUDE.md ${Z.detail}`})}return X}function Z$($){let q=$.confidence;if($.error)return{icon:"\u2717",label:"Error",confidence:q,tone:"error"};if($.traps.fired.length>0)return{icon:"\u2717",label:"Trap fired",confidence:q,tone:"error"};if($.answerable==="YES")return{icon:"\u2713",label:q>=90?"Well grounded":"Grounded",confidence:q,tone:"success"};if($.answerable==="PARTIAL")return{icon:"\u26A0",label:"Partially grounded",confidence:q,tone:"warning"};return{icon:"\u2717",label:"Ungrounded",confidence:q,tone:"error"}}function h1($){let q=OJ($);if(q===null)return[];let z=[],X=/^\s*-\s+\[([^\]]+)\]\s*(.*)$/gm,Z=X.exec(q);while(Z!==null)z.push({id:Z[1].trim(),note:Z[2].trim()||void 0}),Z=X.exec(q);return z}function OJ($){let z=/^##\s+Sources\s*$/im.exec($);if(!z)return null;let X=z.index+z[0].length,Z=$.slice(X),H=/^##\s+/m.exec(Z);return H?Z.slice(0,H.index):Z}function Zq($){let q=h1($.response),z=new Set(q.map((T)=>T.id)),X=new Set($.registeredIds),Z=new Set($.requiredSources),H=[...z],Q=[...Z].filter((T)=>!z.has(T)),J=[...z].filter((T)=>!X.has(T)),Y=[...Z],U,B,G;if(H.length===0)U="NO",B=0,G="No citations in response";else if(J.length===H.length)U="NO",B=0,G=`All cited sources are unknown: ${J.join(", ")}`;else if(Q.length===0&&J.length===0)U="YES",B=100,G=Y.length>0?`All required sources cited: ${Y.join(", ")}`:`Cited registered sources: ${H.join(", ")}`;else{U="PARTIAL";let T=Y.length>0?Y.length:1,L=Y.length-Q.length,_=Y.length>0?L/T*100:60,W=J.length*15;B=Math.max(0,Math.min(100,Math.round(_-W)));let V=[];if(Q.length>0)V.push(`missing: ${Q.join(", ")}`);if(J.length>0)V.push(`unknown: ${J.join(", ")}`);G=V.join("; ")}return{answerable:U,confidence:B,reason:G,citations:{cited:H,required:Y,missing:Q,unknown:J}}}import{query as AJ}from"@anthropic-ai/claude-agent-sdk";function Hq($,q,z){let X=q.length>0?q.map((Q)=>`- ${Q.id}: ${Q.name} (${Q.source})`).join(`
190
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??Mq,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 OJ({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 AJ}from"crypto";import{rm as jJ}from"fs/promises";import{tmpdir as SJ}from"os";import{join as NJ}from"path";var EJ="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??fJ,this.readFileFn=z.readFile??kJ,this.binary=z.binary??EJ}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 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)}
215
215
 
216
216
  ---
217
217
 
218
- ${$}`,U=NJ(SJ(),`pickled-codex-${AJ()}.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}=bJ(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 bJ($){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=CJ(H);if(Q){let Y=q.length===0?"initial":"intermediate";q.push({type:Y,text:Q})}let J=yJ(H);if(J&&!z.includes(J))z.push(J)}return{allResponses:q,toolsUsed:z}}function CJ($){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 yJ($){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 fJ=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}},kJ=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 xJ($,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 xJ($,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 hJ($){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=hJ(q),U="";for(let{scenario:B,targetName:G,contextName:T}of Y){let L=gJ(G,T);if(B.name!==U){if(U)X?.("");X?.(`"${B.name}"`),U=B.name}try{let _=await vJ(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?.(""),uJ($,Q,Z)}function gJ($,q){if($==="default"&&q==="default")return"";if(q==="default")return`[${$}]`;return`[${$}/${q}]`}async function vJ($,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=j0({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 uJ($,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]}},XB=Object.keys(N.modifier),mJ=Object.keys(N.color),dJ=Object.keys(N.bgColor),ZB=[...mJ,...dJ];function pJ(){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 lJ=pJ(),m=lJ;import p1 from"process";import cJ 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 iJ(){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 aJ($){if($===0)return!1;return{level:$,hasBasic:!0,has256:$>=2,has16m:$>=3}}function sJ($,{streamIsTTY:q,sniffFlags:z=!0}={}){let X=iJ();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=cJ.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=sJ($,{streamIsTTY:$&&$.isTTY,...q});return aJ(z)}var rJ={stdout:x4({isTTY:k4.isatty(1)}),stderr:x4({isTTY:k4.isatty(2)})},h4=rJ;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=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
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),nJ=($,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 oJ=($)=>{let q=(...z)=>z.join(" ");return nJ(q,$),Object.setPrototypeOf(q,Q$.prototype),q};function Q$($){return oJ($)}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)},tJ=["rgb","hex","ansi256"];for(let $ of tJ){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 eJ=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)=>$U(X,Z.length===1?""+Z[0]:Z.join(" "));return Object.setPrototypeOf(X,eJ),X[l1]=$,X[E0]=q,X[H$]=z,X},$U=($,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 qU=Q$(),LB=Q$({level:m4?m4.level:0});var P=qU;var p4="\u2500".repeat(55);function zU($){if($==="success")return P.green;if($==="warning")return P.yellow;return P.red}function XU($){if($>=70)return P.green;if($>=50)return P.yellow;return P.red}function ZU($){if($.label==="Error")return $.label;return`${$.label} (${$.confidence}%)`}function HU($){let q=Z$($),z=zU(q.tone);return{icon:z(q.icon),status:ZU(q),color:z}}function QU($){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 JU($){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(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: ${Uq($.citations.cited)}`));if($.citations.missing.length>0)z.push(P.dim(`${q}missing: ${Uq($.citations.missing)}`));if($.citations.unknown.length>0)z.push(P.dim(`${q}unknown: ${Uq($.citations.unknown)}`));return z}function c4($){let{icon:q,status:z,color:X}=HU($),Z=QU($),H=`${q} ${z}`;return Z?`${Z} ${X(H)}`:X(H)}function UU($){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 GU($,q){let z=$.summary.score,Z=`Overall: ${XU(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 i4($,q={}){let{tool:z,scenarios:X,summary:Z}=$,H=X,Q=[];if(Q.push(P.bold("pickled check")),Q.push(p4),Q.push(`Tool: ${P.cyan(z.name)}`),$.docs.length>0)Q.push(`Sources: ${P.dim(Uq($.docs.map((J)=>J.id)))}`);else Q.push(`Sources: ${P.dim("none registered")}`);if(Q.push(`Scenarios: ${P.dim(String(Z.total))}`),Q.push(""),JU(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(GU($,q.threshold)),Q.push(P.dim(UU(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 BU($){if($.format&&$.format!=="terminal")return $.format;if($.json)return"json";return $.format??"terminal"}async function a4($,q){let{output:z}=q,X=BU(q),Z=YU.resolve($),H;try{H=await Xq({targetRepo:Z})}catch(G){console.error(P.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 TU(`${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(P.green("Audit clean. No issues found."));else{let G=J>0?P.red:P.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 TU($){return new Promise((q,z)=>{process.stdout.write($,(X)=>{if(X)z(X);else q()})})}import WU from"path";async function s4($,q){let{json:z,output:X,verbose:Z}=q,H=(T)=>!z&&console.log(T),Q=WU.resolve($),J;try{J=await O0(Q)}catch(T){console.error(P.red(T instanceof Error?T.message:T)),console.error(),console.error(P.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(P.red(_ instanceof Error?_.message:String(_))),process.exit(1)}let L=T-J.scenarios.length;if(L>0&&!z)H(P.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(P.bold("pickled check")),H(""),H(P.dim(` Tool: ${Y.name}`)),H(P.dim(` Scenarios: ${J.scenarios.length}`));for(let T of J.scenarios)H(P.dim(` - ${T.name}`))}let U=await d1(Y,J,{onProgress:Z?(T)=>{if(!z)H(P.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 LU(`${Gq(U,{verbose:Z})}
226
- `);else a1(U,{threshold:B});if(G){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 LU($){return new Promise((q,z)=>{process.stdout.write($,(X)=>{if(X)z(X);else q()})})}import VU from"path";var _U=`# pickled.yml - Agent legibility check for your product
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
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=`${VU.resolve($)}/pickled.yml`;if(await Bun.file(z).exists())console.error(P.red("pickled.yml already exists")),process.exit(1);await Bun.write(z,_U),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()}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 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();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pickled-dev/cli",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "description": "Test what agents actually understand about your product",
5
5
  "module": "dist/index.js",
6
6
  "type": "module",