@cartesi/cli 2.0.0-alpha.30 → 2.0.0-alpha.31

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.
package/dist/index.js CHANGED
@@ -1,17 +1,17 @@
1
1
  #!/usr/bin/env node
2
- import{createRequire as Wu}from"node:module";var $u=Object.create;var{getPrototypeOf:Ju,defineProperty:Dq,getOwnPropertyNames:Qu}=Object;var Zu=Object.prototype.hasOwnProperty;function Xu(D){return this[D]}var Yu,qu,TD=(D,F,$)=>{var J=D!=null&&typeof D==="object";if(J){var Q=F?Yu??=new WeakMap:qu??=new WeakMap,Z=Q.get(D);if(Z)return Z}$=D!=null?$u(Ju(D)):{};let X=F||!D||!D.__esModule?Dq($,"default",{value:D,enumerable:!0}):$;for(let Y of Qu(D))if(!Zu.call(X,Y))Dq(X,Y,{get:Xu.bind(D,Y),enumerable:!0});if(J)Q.set(D,X);return X};var I=(D,F)=>()=>(F||D((F={exports:{}}).exports,F),F.exports);var Gu=(D)=>D;function Bu(D,F){this[D]=Gu.bind(null,F)}var H2=(D,F)=>{for(var $ in F)Dq(D,$,{get:F[$],enumerable:!0,configurable:!0,set:Bu.bind(F,$)})};var x=(D,F)=>()=>(D&&(F=D(D=0)),F);var r=Wu(import.meta.url);var I9=I((Ku)=>{class Fq extends Error{constructor(D,F,$){super($);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=F,this.exitCode=D,this.nestedError=void 0}}class Kz extends Fq{constructor(D){super(1,"commander.invalidArgument",D);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}Ku.CommanderError=Fq;Ku.InvalidArgumentError=Kz});var z$=I((Cu)=>{var{InvalidArgumentError:Hu}=I9();class Uz{constructor(D,F){switch(this.description=F||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,D[0]){case"<":this.required=!0,this._name=D.slice(1,-1);break;case"[":this.required=!1,this._name=D.slice(1,-1);break;default:this.required=!0,this._name=D;break}if(this._name.endsWith("..."))this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_collectValue(D,F){if(F===this.defaultValue||!Array.isArray(F))return[D];return F.push(D),F}default(D,F){return this.defaultValue=D,this.defaultValueDescription=F,this}argParser(D){return this.parseArg=D,this}choices(D){return this.argChoices=D.slice(),this.parseArg=(F,$)=>{if(!this.argChoices.includes(F))throw new Hu(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(F,$);return F},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function zu(D){let F=D.name()+(D.variadic===!0?"...":"");return D.required?"<"+F+">":"["+F+"]"}Cu.Argument=Uz;Cu.humanReadableArgName=zu});var $q=I((Eu)=>{var{humanReadableArgName:Ou}=z$();class Vz{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(D){this.helpWidth=this.helpWidth??D.helpWidth??80}visibleCommands(D){let F=D.commands.filter((J)=>!J._hidden),$=D._getHelpCommand();if($&&!$._hidden)F.push($);if(this.sortSubcommands)F.sort((J,Q)=>{return J.name().localeCompare(Q.name())});return F}compareOptions(D,F){let $=(J)=>{return J.short?J.short.replace(/^-/,""):J.long.replace(/^--/,"")};return $(D).localeCompare($(F))}visibleOptions(D){let F=D.options.filter((J)=>!J.hidden),$=D._getHelpOption();if($&&!$.hidden){let J=$.short&&D._findOption($.short),Q=$.long&&D._findOption($.long);if(!J&&!Q)F.push($);else if($.long&&!Q)F.push(D.createOption($.long,$.description));else if($.short&&!J)F.push(D.createOption($.short,$.description))}if(this.sortOptions)F.sort(this.compareOptions);return F}visibleGlobalOptions(D){if(!this.showGlobalOptions)return[];let F=[];for(let $=D.parent;$;$=$.parent){let J=$.options.filter((Q)=>!Q.hidden);F.push(...J)}if(this.sortOptions)F.sort(this.compareOptions);return F}visibleArguments(D){if(D._argsDescription)D.registeredArguments.forEach((F)=>{F.description=F.description||D._argsDescription[F.name()]||""});if(D.registeredArguments.find((F)=>F.description))return D.registeredArguments;return[]}subcommandTerm(D){let F=D.registeredArguments.map(($)=>Ou($)).join(" ");return D._name+(D._aliases[0]?"|"+D._aliases[0]:"")+(D.options.length?" [options]":"")+(F?" "+F:"")}optionTerm(D){return D.flags}argumentTerm(D){return D.name()}longestSubcommandTermLength(D,F){return F.visibleCommands(D).reduce(($,J)=>{return Math.max($,this.displayWidth(F.styleSubcommandTerm(F.subcommandTerm(J))))},0)}longestOptionTermLength(D,F){return F.visibleOptions(D).reduce(($,J)=>{return Math.max($,this.displayWidth(F.styleOptionTerm(F.optionTerm(J))))},0)}longestGlobalOptionTermLength(D,F){return F.visibleGlobalOptions(D).reduce(($,J)=>{return Math.max($,this.displayWidth(F.styleOptionTerm(F.optionTerm(J))))},0)}longestArgumentTermLength(D,F){return F.visibleArguments(D).reduce(($,J)=>{return Math.max($,this.displayWidth(F.styleArgumentTerm(F.argumentTerm(J))))},0)}commandUsage(D){let F=D._name;if(D._aliases[0])F=F+"|"+D._aliases[0];let $="";for(let J=D.parent;J;J=J.parent)$=J.name()+" "+$;return $+F+" "+D.usage()}commandDescription(D){return D.description()}subcommandDescription(D){return D.summary()||D.description()}optionDescription(D){let F=[];if(D.argChoices)F.push(`choices: ${D.argChoices.map(($)=>JSON.stringify($)).join(", ")}`);if(D.defaultValue!==void 0){if(D.required||D.optional||D.isBoolean()&&typeof D.defaultValue==="boolean")F.push(`default: ${D.defaultValueDescription||JSON.stringify(D.defaultValue)}`)}if(D.presetArg!==void 0&&D.optional)F.push(`preset: ${JSON.stringify(D.presetArg)}`);if(D.envVar!==void 0)F.push(`env: ${D.envVar}`);if(F.length>0){let $=`(${F.join(", ")})`;if(D.description)return`${D.description} ${$}`;return $}return D.description}argumentDescription(D){let F=[];if(D.argChoices)F.push(`choices: ${D.argChoices.map(($)=>JSON.stringify($)).join(", ")}`);if(D.defaultValue!==void 0)F.push(`default: ${D.defaultValueDescription||JSON.stringify(D.defaultValue)}`);if(F.length>0){let $=`(${F.join(", ")})`;if(D.description)return`${D.description} ${$}`;return $}return D.description}formatItemList(D,F,$){if(F.length===0)return[];return[$.styleTitle(D),...F,""]}groupItems(D,F,$){let J=new Map;return D.forEach((Q)=>{let Z=$(Q);if(!J.has(Z))J.set(Z,[])}),F.forEach((Q)=>{let Z=$(Q);if(!J.has(Z))J.set(Z,[]);J.get(Z).push(Q)}),J}formatHelp(D,F){let $=F.padWidth(D,F),J=F.helpWidth??80;function Q(B,W){return F.formatItem(B,$,W,F)}let Z=[`${F.styleTitle("Usage:")} ${F.styleUsage(F.commandUsage(D))}`,""],X=F.commandDescription(D);if(X.length>0)Z=Z.concat([F.boxWrap(F.styleCommandDescription(X),J),""]);let Y=F.visibleArguments(D).map((B)=>{return Q(F.styleArgumentTerm(F.argumentTerm(B)),F.styleArgumentDescription(F.argumentDescription(B)))});if(Z=Z.concat(this.formatItemList("Arguments:",Y,F)),this.groupItems(D.options,F.visibleOptions(D),(B)=>B.helpGroupHeading??"Options:").forEach((B,W)=>{let K=B.map((U)=>{return Q(F.styleOptionTerm(F.optionTerm(U)),F.styleOptionDescription(F.optionDescription(U)))});Z=Z.concat(this.formatItemList(W,K,F))}),F.showGlobalOptions){let B=F.visibleGlobalOptions(D).map((W)=>{return Q(F.styleOptionTerm(F.optionTerm(W)),F.styleOptionDescription(F.optionDescription(W)))});Z=Z.concat(this.formatItemList("Global Options:",B,F))}return this.groupItems(D.commands,F.visibleCommands(D),(B)=>B.helpGroup()||"Commands:").forEach((B,W)=>{let K=B.map((U)=>{return Q(F.styleSubcommandTerm(F.subcommandTerm(U)),F.styleSubcommandDescription(F.subcommandDescription(U)))});Z=Z.concat(this.formatItemList(W,K,F))}),Z.join(`
2
+ import{createRequire as Wu}from"node:module";var $u=Object.create;var{getPrototypeOf:Ju,defineProperty:Dq,getOwnPropertyNames:Qu}=Object;var Zu=Object.prototype.hasOwnProperty;function Xu(D){return this[D]}var Yu,qu,TD=(D,F,$)=>{var J=D!=null&&typeof D==="object";if(J){var Q=F?Yu??=new WeakMap:qu??=new WeakMap,Z=Q.get(D);if(Z)return Z}$=D!=null?$u(Ju(D)):{};let X=F||!D||!D.__esModule?Dq($,"default",{value:D,enumerable:!0}):$;for(let Y of Qu(D))if(!Zu.call(X,Y))Dq(X,Y,{get:Xu.bind(D,Y),enumerable:!0});if(J)Q.set(D,X);return X};var w=(D,F)=>()=>(F||D((F={exports:{}}).exports,F),F.exports);var Gu=(D)=>D;function Bu(D,F){this[D]=Gu.bind(null,F)}var H2=(D,F)=>{for(var $ in F)Dq(D,$,{get:F[$],enumerable:!0,configurable:!0,set:Bu.bind(F,$)})};var x=(D,F)=>()=>(D&&(F=D(D=0)),F);var r=Wu(import.meta.url);var I9=w((Ku)=>{class Fq extends Error{constructor(D,F,$){super($);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=F,this.exitCode=D,this.nestedError=void 0}}class Kz extends Fq{constructor(D){super(1,"commander.invalidArgument",D);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}Ku.CommanderError=Fq;Ku.InvalidArgumentError=Kz});var z$=w((Cu)=>{var{InvalidArgumentError:Hu}=I9();class Uz{constructor(D,F){switch(this.description=F||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,D[0]){case"<":this.required=!0,this._name=D.slice(1,-1);break;case"[":this.required=!1,this._name=D.slice(1,-1);break;default:this.required=!0,this._name=D;break}if(this._name.endsWith("..."))this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_collectValue(D,F){if(F===this.defaultValue||!Array.isArray(F))return[D];return F.push(D),F}default(D,F){return this.defaultValue=D,this.defaultValueDescription=F,this}argParser(D){return this.parseArg=D,this}choices(D){return this.argChoices=D.slice(),this.parseArg=(F,$)=>{if(!this.argChoices.includes(F))throw new Hu(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(F,$);return F},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function zu(D){let F=D.name()+(D.variadic===!0?"...":"");return D.required?"<"+F+">":"["+F+"]"}Cu.Argument=Uz;Cu.humanReadableArgName=zu});var $q=w((Eu)=>{var{humanReadableArgName:Ou}=z$();class Vz{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(D){this.helpWidth=this.helpWidth??D.helpWidth??80}visibleCommands(D){let F=D.commands.filter((J)=>!J._hidden),$=D._getHelpCommand();if($&&!$._hidden)F.push($);if(this.sortSubcommands)F.sort((J,Q)=>{return J.name().localeCompare(Q.name())});return F}compareOptions(D,F){let $=(J)=>{return J.short?J.short.replace(/^-/,""):J.long.replace(/^--/,"")};return $(D).localeCompare($(F))}visibleOptions(D){let F=D.options.filter((J)=>!J.hidden),$=D._getHelpOption();if($&&!$.hidden){let J=$.short&&D._findOption($.short),Q=$.long&&D._findOption($.long);if(!J&&!Q)F.push($);else if($.long&&!Q)F.push(D.createOption($.long,$.description));else if($.short&&!J)F.push(D.createOption($.short,$.description))}if(this.sortOptions)F.sort(this.compareOptions);return F}visibleGlobalOptions(D){if(!this.showGlobalOptions)return[];let F=[];for(let $=D.parent;$;$=$.parent){let J=$.options.filter((Q)=>!Q.hidden);F.push(...J)}if(this.sortOptions)F.sort(this.compareOptions);return F}visibleArguments(D){if(D._argsDescription)D.registeredArguments.forEach((F)=>{F.description=F.description||D._argsDescription[F.name()]||""});if(D.registeredArguments.find((F)=>F.description))return D.registeredArguments;return[]}subcommandTerm(D){let F=D.registeredArguments.map(($)=>Ou($)).join(" ");return D._name+(D._aliases[0]?"|"+D._aliases[0]:"")+(D.options.length?" [options]":"")+(F?" "+F:"")}optionTerm(D){return D.flags}argumentTerm(D){return D.name()}longestSubcommandTermLength(D,F){return F.visibleCommands(D).reduce(($,J)=>{return Math.max($,this.displayWidth(F.styleSubcommandTerm(F.subcommandTerm(J))))},0)}longestOptionTermLength(D,F){return F.visibleOptions(D).reduce(($,J)=>{return Math.max($,this.displayWidth(F.styleOptionTerm(F.optionTerm(J))))},0)}longestGlobalOptionTermLength(D,F){return F.visibleGlobalOptions(D).reduce(($,J)=>{return Math.max($,this.displayWidth(F.styleOptionTerm(F.optionTerm(J))))},0)}longestArgumentTermLength(D,F){return F.visibleArguments(D).reduce(($,J)=>{return Math.max($,this.displayWidth(F.styleArgumentTerm(F.argumentTerm(J))))},0)}commandUsage(D){let F=D._name;if(D._aliases[0])F=F+"|"+D._aliases[0];let $="";for(let J=D.parent;J;J=J.parent)$=J.name()+" "+$;return $+F+" "+D.usage()}commandDescription(D){return D.description()}subcommandDescription(D){return D.summary()||D.description()}optionDescription(D){let F=[];if(D.argChoices)F.push(`choices: ${D.argChoices.map(($)=>JSON.stringify($)).join(", ")}`);if(D.defaultValue!==void 0){if(D.required||D.optional||D.isBoolean()&&typeof D.defaultValue==="boolean")F.push(`default: ${D.defaultValueDescription||JSON.stringify(D.defaultValue)}`)}if(D.presetArg!==void 0&&D.optional)F.push(`preset: ${JSON.stringify(D.presetArg)}`);if(D.envVar!==void 0)F.push(`env: ${D.envVar}`);if(F.length>0){let $=`(${F.join(", ")})`;if(D.description)return`${D.description} ${$}`;return $}return D.description}argumentDescription(D){let F=[];if(D.argChoices)F.push(`choices: ${D.argChoices.map(($)=>JSON.stringify($)).join(", ")}`);if(D.defaultValue!==void 0)F.push(`default: ${D.defaultValueDescription||JSON.stringify(D.defaultValue)}`);if(F.length>0){let $=`(${F.join(", ")})`;if(D.description)return`${D.description} ${$}`;return $}return D.description}formatItemList(D,F,$){if(F.length===0)return[];return[$.styleTitle(D),...F,""]}groupItems(D,F,$){let J=new Map;return D.forEach((Q)=>{let Z=$(Q);if(!J.has(Z))J.set(Z,[])}),F.forEach((Q)=>{let Z=$(Q);if(!J.has(Z))J.set(Z,[]);J.get(Z).push(Q)}),J}formatHelp(D,F){let $=F.padWidth(D,F),J=F.helpWidth??80;function Q(B,W){return F.formatItem(B,$,W,F)}let Z=[`${F.styleTitle("Usage:")} ${F.styleUsage(F.commandUsage(D))}`,""],X=F.commandDescription(D);if(X.length>0)Z=Z.concat([F.boxWrap(F.styleCommandDescription(X),J),""]);let Y=F.visibleArguments(D).map((B)=>{return Q(F.styleArgumentTerm(F.argumentTerm(B)),F.styleArgumentDescription(F.argumentDescription(B)))});if(Z=Z.concat(this.formatItemList("Arguments:",Y,F)),this.groupItems(D.options,F.visibleOptions(D),(B)=>B.helpGroupHeading??"Options:").forEach((B,W)=>{let K=B.map((U)=>{return Q(F.styleOptionTerm(F.optionTerm(U)),F.styleOptionDescription(F.optionDescription(U)))});Z=Z.concat(this.formatItemList(W,K,F))}),F.showGlobalOptions){let B=F.visibleGlobalOptions(D).map((W)=>{return Q(F.styleOptionTerm(F.optionTerm(W)),F.styleOptionDescription(F.optionDescription(W)))});Z=Z.concat(this.formatItemList("Global Options:",B,F))}return this.groupItems(D.commands,F.visibleCommands(D),(B)=>B.helpGroup()||"Commands:").forEach((B,W)=>{let K=B.map((U)=>{return Q(F.styleSubcommandTerm(F.subcommandTerm(U)),F.styleSubcommandDescription(F.subcommandDescription(U)))});Z=Z.concat(this.formatItemList(W,K,F))}),Z.join(`
3
3
  `)}displayWidth(D){return Hz(D).length}styleTitle(D){return D}styleUsage(D){return D.split(" ").map((F)=>{if(F==="[options]")return this.styleOptionText(F);if(F==="[command]")return this.styleSubcommandText(F);if(F[0]==="["||F[0]==="<")return this.styleArgumentText(F);return this.styleCommandText(F)}).join(" ")}styleCommandDescription(D){return this.styleDescriptionText(D)}styleOptionDescription(D){return this.styleDescriptionText(D)}styleSubcommandDescription(D){return this.styleDescriptionText(D)}styleArgumentDescription(D){return this.styleDescriptionText(D)}styleDescriptionText(D){return D}styleOptionTerm(D){return this.styleOptionText(D)}styleSubcommandTerm(D){return D.split(" ").map((F)=>{if(F==="[options]")return this.styleOptionText(F);if(F[0]==="["||F[0]==="<")return this.styleArgumentText(F);return this.styleSubcommandText(F)}).join(" ")}styleArgumentTerm(D){return this.styleArgumentText(D)}styleOptionText(D){return D}styleArgumentText(D){return D}styleSubcommandText(D){return D}styleCommandText(D){return D}padWidth(D,F){return Math.max(F.longestOptionTermLength(D,F),F.longestGlobalOptionTermLength(D,F),F.longestSubcommandTermLength(D,F),F.longestArgumentTermLength(D,F))}preformatted(D){return/\n[^\S\r\n]/.test(D)}formatItem(D,F,$,J){let Z=" ".repeat(2);if(!$)return Z+D;let X=D.padEnd(F+D.length-J.displayWidth(D)),Y=2,G=(this.helpWidth??80)-F-Y-2,B;if(G<this.minWidthToWrap||J.preformatted($))B=$;else B=J.boxWrap($,G).replace(/\n/g,`
4
4
  `+" ".repeat(F+Y));return Z+X+" ".repeat(Y)+B.replace(/\n/g,`
5
5
  ${Z}`)}boxWrap(D,F){if(F<this.minWidthToWrap)return D;let $=D.split(/\r\n|\n/),J=/[\s]*[^\s]+/g,Q=[];return $.forEach((Z)=>{let X=Z.match(J);if(X===null){Q.push("");return}let Y=[X.shift()],q=this.displayWidth(Y[0]);X.forEach((G)=>{let B=this.displayWidth(G);if(q+B<=F){Y.push(G),q+=B;return}Q.push(Y.join(""));let W=G.trimStart();Y=[W],q=this.displayWidth(W)}),Q.push(Y.join(""))}),Q.join(`
6
- `)}}function Hz(D){let F=/\x1b\[\d*(;\d*)*m/g;return D.replace(F,"")}Eu.Help=Vz;Eu.stripColor=Hz});var Jq=I((Nu)=>{var{InvalidArgumentError:Iu}=I9();class Cz{constructor(D,F){this.flags=D,this.description=F||"",this.required=D.includes("<"),this.optional=D.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(D),this.mandatory=!1;let $=wu(D);if(this.short=$.shortFlag,this.long=$.longFlag,this.negate=!1,this.long)this.negate=this.long.startsWith("--no-");this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(D,F){return this.defaultValue=D,this.defaultValueDescription=F,this}preset(D){return this.presetArg=D,this}conflicts(D){return this.conflictsWith=this.conflictsWith.concat(D),this}implies(D){let F=D;if(typeof D==="string")F={[D]:!0};return this.implied=Object.assign(this.implied||{},F),this}env(D){return this.envVar=D,this}argParser(D){return this.parseArg=D,this}makeOptionMandatory(D=!0){return this.mandatory=!!D,this}hideHelp(D=!0){return this.hidden=!!D,this}_collectValue(D,F){if(F===this.defaultValue||!Array.isArray(F))return[D];return F.push(D),F}choices(D){return this.argChoices=D.slice(),this.parseArg=(F,$)=>{if(!this.argChoices.includes(F))throw new Iu(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(F,$);return F},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return zz(this.name().replace(/^no-/,""));return zz(this.name())}helpGroup(D){return this.helpGroupHeading=D,this}is(D){return this.short===D||this.long===D}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class _z{constructor(D){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,D.forEach((F)=>{if(F.negate)this.negativeOptions.set(F.attributeName(),F);else this.positiveOptions.set(F.attributeName(),F)}),this.negativeOptions.forEach((F,$)=>{if(this.positiveOptions.has($))this.dualOptions.add($)})}valueFromOption(D,F){let $=F.attributeName();if(!this.dualOptions.has($))return!0;let J=this.negativeOptions.get($).presetArg,Q=J!==void 0?J:!1;return F.negate===(Q===D)}}function zz(D){return D.split("-").reduce((F,$)=>{return F+$[0].toUpperCase()+$.slice(1)})}function wu(D){let F,$,J=/^-[^-]$/,Q=/^--[^-]/,Z=D.split(/[ |,]+/).concat("guard");if(J.test(Z[0]))F=Z.shift();if(Q.test(Z[0]))$=Z.shift();if(!F&&J.test(Z[0]))F=Z.shift();if(!F&&Q.test(Z[0]))F=$,$=Z.shift();if(Z[0].startsWith("-")){let X=Z[0],Y=`option creation failed due to '${X}' in option flags '${D}'`;if(/^-[^-][^-]/.test(X))throw Error(`${Y}
6
+ `)}}function Hz(D){let F=/\x1b\[\d*(;\d*)*m/g;return D.replace(F,"")}Eu.Help=Vz;Eu.stripColor=Hz});var Jq=w((Nu)=>{var{InvalidArgumentError:Iu}=I9();class Cz{constructor(D,F){this.flags=D,this.description=F||"",this.required=D.includes("<"),this.optional=D.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(D),this.mandatory=!1;let $=wu(D);if(this.short=$.shortFlag,this.long=$.longFlag,this.negate=!1,this.long)this.negate=this.long.startsWith("--no-");this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(D,F){return this.defaultValue=D,this.defaultValueDescription=F,this}preset(D){return this.presetArg=D,this}conflicts(D){return this.conflictsWith=this.conflictsWith.concat(D),this}implies(D){let F=D;if(typeof D==="string")F={[D]:!0};return this.implied=Object.assign(this.implied||{},F),this}env(D){return this.envVar=D,this}argParser(D){return this.parseArg=D,this}makeOptionMandatory(D=!0){return this.mandatory=!!D,this}hideHelp(D=!0){return this.hidden=!!D,this}_collectValue(D,F){if(F===this.defaultValue||!Array.isArray(F))return[D];return F.push(D),F}choices(D){return this.argChoices=D.slice(),this.parseArg=(F,$)=>{if(!this.argChoices.includes(F))throw new Iu(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(F,$);return F},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return zz(this.name().replace(/^no-/,""));return zz(this.name())}helpGroup(D){return this.helpGroupHeading=D,this}is(D){return this.short===D||this.long===D}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class _z{constructor(D){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,D.forEach((F)=>{if(F.negate)this.negativeOptions.set(F.attributeName(),F);else this.positiveOptions.set(F.attributeName(),F)}),this.negativeOptions.forEach((F,$)=>{if(this.positiveOptions.has($))this.dualOptions.add($)})}valueFromOption(D,F){let $=F.attributeName();if(!this.dualOptions.has($))return!0;let J=this.negativeOptions.get($).presetArg,Q=J!==void 0?J:!1;return F.negate===(Q===D)}}function zz(D){return D.split("-").reduce((F,$)=>{return F+$[0].toUpperCase()+$.slice(1)})}function wu(D){let F,$,J=/^-[^-]$/,Q=/^--[^-]/,Z=D.split(/[ |,]+/).concat("guard");if(J.test(Z[0]))F=Z.shift();if(Q.test(Z[0]))$=Z.shift();if(!F&&J.test(Z[0]))F=Z.shift();if(!F&&Q.test(Z[0]))F=$,$=Z.shift();if(Z[0].startsWith("-")){let X=Z[0],Y=`option creation failed due to '${X}' in option flags '${D}'`;if(/^-[^-][^-]/.test(X))throw Error(`${Y}
7
7
  - a short flag is a single dash and a single character
8
8
  - either use a single dash and a single character (for a short flag)
9
9
  - or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(J.test(X))throw Error(`${Y}
10
10
  - too many short flags`);if(Q.test(X))throw Error(`${Y}
11
11
  - too many long flags`);throw Error(`${Y}
12
- - unrecognised flag format`)}if(F===void 0&&$===void 0)throw Error(`option creation failed due to no flags found in '${D}'.`);return{shortFlag:F,longFlag:$}}Nu.Option=Cz;Nu.DualOptions=_z});var Mz=I((Su)=>{function Pu(D,F){if(Math.abs(D.length-F.length)>3)return Math.max(D.length,F.length);let $=[];for(let J=0;J<=D.length;J++)$[J]=[J];for(let J=0;J<=F.length;J++)$[0][J]=J;for(let J=1;J<=F.length;J++)for(let Q=1;Q<=D.length;Q++){let Z=1;if(D[Q-1]===F[J-1])Z=0;else Z=1;if($[Q][J]=Math.min($[Q-1][J]+1,$[Q][J-1]+1,$[Q-1][J-1]+Z),Q>1&&J>1&&D[Q-1]===F[J-2]&&D[Q-2]===F[J-1])$[Q][J]=Math.min($[Q][J],$[Q-2][J-2]+1)}return $[D.length][F.length]}function ju(D,F){if(!F||F.length===0)return"";F=Array.from(new Set(F));let $=D.startsWith("--");if($)D=D.slice(2),F=F.map((X)=>X.slice(2));let J=[],Q=3,Z=0.4;if(F.forEach((X)=>{if(X.length<=1)return;let Y=Pu(D,X),q=Math.max(D.length,X.length);if((q-Y)/q>Z){if(Y<Q)Q=Y,J=[X];else if(Y===Q)J.push(X)}}),J.sort((X,Y)=>X.localeCompare(Y)),$)J=J.map((X)=>`--${X}`);if(J.length>1)return`
12
+ - unrecognised flag format`)}if(F===void 0&&$===void 0)throw Error(`option creation failed due to no flags found in '${D}'.`);return{shortFlag:F,longFlag:$}}Nu.Option=Cz;Nu.DualOptions=_z});var Mz=w((Su)=>{function Pu(D,F){if(Math.abs(D.length-F.length)>3)return Math.max(D.length,F.length);let $=[];for(let J=0;J<=D.length;J++)$[J]=[J];for(let J=0;J<=F.length;J++)$[0][J]=J;for(let J=1;J<=F.length;J++)for(let Q=1;Q<=D.length;Q++){let Z=1;if(D[Q-1]===F[J-1])Z=0;else Z=1;if($[Q][J]=Math.min($[Q-1][J]+1,$[Q][J-1]+1,$[Q-1][J-1]+Z),Q>1&&J>1&&D[Q-1]===F[J-2]&&D[Q-2]===F[J-1])$[Q][J]=Math.min($[Q][J],$[Q-2][J-2]+1)}return $[D.length][F.length]}function ju(D,F){if(!F||F.length===0)return"";F=Array.from(new Set(F));let $=D.startsWith("--");if($)D=D.slice(2),F=F.map((X)=>X.slice(2));let J=[],Q=3,Z=0.4;if(F.forEach((X)=>{if(X.length<=1)return;let Y=Pu(D,X),q=Math.max(D.length,X.length);if((q-Y)/q>Z){if(Y<Q)Q=Y,J=[X];else if(Y===Q)J.push(X)}}),J.sort((X,Y)=>X.localeCompare(Y)),$)J=J.map((X)=>`--${X}`);if(J.length>1)return`
13
13
  (Did you mean one of ${J.join(", ")}?)`;if(J.length===1)return`
14
- (Did you mean ${J[0]}?)`;return""}Su.suggestSimilar=ju});var Az=I((uu)=>{var ku=r("node:events").EventEmitter,Qq=r("node:child_process"),n8=r("node:path"),C$=r("node:fs"),VD=r("node:process"),{Argument:yu,humanReadableArgName:fu}=z$(),{CommanderError:Zq}=I9(),{Help:bu,stripColor:vu}=$q(),{Option:Oz,DualOptions:hu}=Jq(),{suggestSimilar:Ez}=Mz();class Yq extends ku{constructor(D){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=D||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:(F)=>VD.stdout.write(F),writeErr:(F)=>VD.stderr.write(F),outputError:(F,$)=>$(F),getOutHelpWidth:()=>VD.stdout.isTTY?VD.stdout.columns:void 0,getErrHelpWidth:()=>VD.stderr.isTTY?VD.stderr.columns:void 0,getOutHasColors:()=>Xq()??(VD.stdout.isTTY&&VD.stdout.hasColors?.()),getErrHasColors:()=>Xq()??(VD.stderr.isTTY&&VD.stderr.hasColors?.()),stripColor:(F)=>vu(F)},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(D){return this._outputConfiguration=D._outputConfiguration,this._helpOption=D._helpOption,this._helpCommand=D._helpCommand,this._helpConfiguration=D._helpConfiguration,this._exitCallback=D._exitCallback,this._storeOptionsAsProperties=D._storeOptionsAsProperties,this._combineFlagAndOptionalValue=D._combineFlagAndOptionalValue,this._allowExcessArguments=D._allowExcessArguments,this._enablePositionalOptions=D._enablePositionalOptions,this._showHelpAfterError=D._showHelpAfterError,this._showSuggestionAfterError=D._showSuggestionAfterError,this}_getCommandAndAncestors(){let D=[];for(let F=this;F;F=F.parent)D.push(F);return D}command(D,F,$){let J=F,Q=$;if(typeof J==="object"&&J!==null)Q=J,J=null;Q=Q||{};let[,Z,X]=D.match(/([^ ]+) *(.*)/),Y=this.createCommand(Z);if(J)Y.description(J),Y._executableHandler=!0;if(Q.isDefault)this._defaultCommandName=Y._name;if(Y._hidden=!!(Q.noHelp||Q.hidden),Y._executableFile=Q.executableFile||null,X)Y.arguments(X);if(this._registerCommand(Y),Y.parent=this,Y.copyInheritedSettings(this),J)return this;return Y}createCommand(D){return new Yq(D)}createHelp(){return Object.assign(new bu,this.configureHelp())}configureHelp(D){if(D===void 0)return this._helpConfiguration;return this._helpConfiguration=D,this}configureOutput(D){if(D===void 0)return this._outputConfiguration;return this._outputConfiguration={...this._outputConfiguration,...D},this}showHelpAfterError(D=!0){if(typeof D!=="string")D=!!D;return this._showHelpAfterError=D,this}showSuggestionAfterError(D=!0){return this._showSuggestionAfterError=!!D,this}addCommand(D,F){if(!D._name)throw Error(`Command passed to .addCommand() must have a name
14
+ (Did you mean ${J[0]}?)`;return""}Su.suggestSimilar=ju});var Az=w((uu)=>{var ku=r("node:events").EventEmitter,Qq=r("node:child_process"),n8=r("node:path"),C$=r("node:fs"),VD=r("node:process"),{Argument:yu,humanReadableArgName:fu}=z$(),{CommanderError:Zq}=I9(),{Help:bu,stripColor:vu}=$q(),{Option:Oz,DualOptions:hu}=Jq(),{suggestSimilar:Ez}=Mz();class Yq extends ku{constructor(D){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=D||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:(F)=>VD.stdout.write(F),writeErr:(F)=>VD.stderr.write(F),outputError:(F,$)=>$(F),getOutHelpWidth:()=>VD.stdout.isTTY?VD.stdout.columns:void 0,getErrHelpWidth:()=>VD.stderr.isTTY?VD.stderr.columns:void 0,getOutHasColors:()=>Xq()??(VD.stdout.isTTY&&VD.stdout.hasColors?.()),getErrHasColors:()=>Xq()??(VD.stderr.isTTY&&VD.stderr.hasColors?.()),stripColor:(F)=>vu(F)},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(D){return this._outputConfiguration=D._outputConfiguration,this._helpOption=D._helpOption,this._helpCommand=D._helpCommand,this._helpConfiguration=D._helpConfiguration,this._exitCallback=D._exitCallback,this._storeOptionsAsProperties=D._storeOptionsAsProperties,this._combineFlagAndOptionalValue=D._combineFlagAndOptionalValue,this._allowExcessArguments=D._allowExcessArguments,this._enablePositionalOptions=D._enablePositionalOptions,this._showHelpAfterError=D._showHelpAfterError,this._showSuggestionAfterError=D._showSuggestionAfterError,this}_getCommandAndAncestors(){let D=[];for(let F=this;F;F=F.parent)D.push(F);return D}command(D,F,$){let J=F,Q=$;if(typeof J==="object"&&J!==null)Q=J,J=null;Q=Q||{};let[,Z,X]=D.match(/([^ ]+) *(.*)/),Y=this.createCommand(Z);if(J)Y.description(J),Y._executableHandler=!0;if(Q.isDefault)this._defaultCommandName=Y._name;if(Y._hidden=!!(Q.noHelp||Q.hidden),Y._executableFile=Q.executableFile||null,X)Y.arguments(X);if(this._registerCommand(Y),Y.parent=this,Y.copyInheritedSettings(this),J)return this;return Y}createCommand(D){return new Yq(D)}createHelp(){return Object.assign(new bu,this.configureHelp())}configureHelp(D){if(D===void 0)return this._helpConfiguration;return this._helpConfiguration=D,this}configureOutput(D){if(D===void 0)return this._outputConfiguration;return this._outputConfiguration={...this._outputConfiguration,...D},this}showHelpAfterError(D=!0){if(typeof D!=="string")D=!!D;return this._showHelpAfterError=D,this}showSuggestionAfterError(D=!0){return this._showSuggestionAfterError=!!D,this}addCommand(D,F){if(!D._name)throw Error(`Command passed to .addCommand() must have a name
15
15
  - specify the name in Command constructor or using .name()`);if(F=F||{},F.isDefault)this._defaultCommandName=D._name;if(F.noHelp||F.hidden)D._hidden=!0;return this._registerCommand(D),D.parent=this,D._checkForBrokenPassThrough(),this}createArgument(D,F){return new yu(D,F)}argument(D,F,$,J){let Q=this.createArgument(D,F);if(typeof $==="function")Q.default(J).argParser($);else Q.default($);return this.addArgument(Q),this}arguments(D){return D.trim().split(/ +/).forEach((F)=>{this.argument(F)}),this}addArgument(D){let F=this.registeredArguments.slice(-1)[0];if(F?.variadic)throw Error(`only the last argument can be variadic '${F.name()}'`);if(D.required&&D.defaultValue!==void 0&&D.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${D.name()}'`);return this.registeredArguments.push(D),this}helpCommand(D,F){if(typeof D==="boolean"){if(this._addImplicitHelpCommand=D,D&&this._defaultCommandGroup)this._initCommandGroup(this._getHelpCommand());return this}let $=D??"help [command]",[,J,Q]=$.match(/([^ ]+) *(.*)/),Z=F??"display help for command",X=this.createCommand(J);if(X.helpOption(!1),Q)X.arguments(Q);if(Z)X.description(Z);if(this._addImplicitHelpCommand=!0,this._helpCommand=X,D||F)this._initCommandGroup(X);return this}addHelpCommand(D,F){if(typeof D!=="object")return this.helpCommand(D,F),this;return this._addImplicitHelpCommand=!0,this._helpCommand=D,this._initCommandGroup(D),this}_getHelpCommand(){if(this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))){if(this._helpCommand===void 0)this.helpCommand(void 0,void 0);return this._helpCommand}return null}hook(D,F){let $=["preSubcommand","preAction","postAction"];if(!$.includes(D))throw Error(`Unexpected value for event passed to hook : '${D}'.
16
16
  Expecting one of '${$.join("', '")}'`);if(this._lifeCycleHooks[D])this._lifeCycleHooks[D].push(F);else this._lifeCycleHooks[D]=[F];return this}exitOverride(D){if(D)this._exitCallback=D;else this._exitCallback=(F)=>{if(F.code!=="commander.executeSubCommandAsync")throw F};return this}_exit(D,F,$){if(this._exitCallback)this._exitCallback(new Zq(D,F,$));VD.exit(D)}action(D){let F=($)=>{let J=this.registeredArguments.length,Q=$.slice(0,J);if(this._storeOptionsAsProperties)Q[J]=this;else Q[J]=this.opts();return Q.push(this),D.apply(this,Q)};return this._actionHandler=F,this}createOption(D,F){return new Oz(D,F)}_callParseArg(D,F,$,J){try{return D.parseArg(F,$)}catch(Q){if(Q.code==="commander.invalidArgument"){let Z=`${J} ${Q.message}`;this.error(Z,{exitCode:Q.exitCode,code:Q.code})}throw Q}}_registerOption(D){let F=D.short&&this._findOption(D.short)||D.long&&this._findOption(D.long);if(F){let $=D.long&&this._findOption(D.long)?D.long:D.short;throw Error(`Cannot add option '${D.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${$}'
17
17
  - already used by option '${F.flags}'`)}this._initOptionGroup(D),this.options.push(D)}_registerCommand(D){let F=(J)=>{return[J.name()].concat(J.aliases())},$=F(D).find((J)=>this._findCommand(J));if($){let J=F(this._findCommand($)).join("|"),Q=F(D).join("|");throw Error(`cannot add command '${Q}' as already have command '${J}'`)}this._initCommandGroup(D),this.commands.push(D)}addOption(D){this._registerOption(D);let F=D.name(),$=D.attributeName();if(D.negate){let Q=D.long.replace(/^--no-/,"--");if(!this._findOption(Q))this.setOptionValueWithSource($,D.defaultValue===void 0?!0:D.defaultValue,"default")}else if(D.defaultValue!==void 0)this.setOptionValueWithSource($,D.defaultValue,"default");let J=(Q,Z,X)=>{if(Q==null&&D.presetArg!==void 0)Q=D.presetArg;let Y=this.getOptionValue($);if(Q!==null&&D.parseArg)Q=this._callParseArg(D,Q,Y,Z);else if(Q!==null&&D.variadic)Q=D._collectValue(Q,Y);if(Q==null)if(D.negate)Q=!1;else if(D.isBoolean()||D.optional)Q=!0;else Q="";this.setOptionValueWithSource($,Q,X)};if(this.on("option:"+F,(Q)=>{let Z=`error: option '${D.flags}' argument '${Q}' is invalid.`;J(Q,Z,"cli")}),D.envVar)this.on("optionEnv:"+F,(Q)=>{let Z=`error: option '${D.flags}' value '${Q}' from env '${D.envVar}' is invalid.`;J(Q,Z,"env")});return this}_optionEx(D,F,$,J,Q){if(typeof F==="object"&&F instanceof Oz)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let Z=this.createOption(F,$);if(Z.makeOptionMandatory(!!D.mandatory),typeof J==="function")Z.default(Q).argParser(J);else if(J instanceof RegExp){let X=J;J=(Y,q)=>{let G=X.exec(Y);return G?G[0]:q},Z.default(Q).argParser(J)}else Z.default(J);return this.addOption(Z)}option(D,F,$,J){return this._optionEx({},D,F,$,J)}requiredOption(D,F,$,J){return this._optionEx({mandatory:!0},D,F,$,J)}combineFlagAndOptionalValue(D=!0){return this._combineFlagAndOptionalValue=!!D,this}allowUnknownOption(D=!0){return this._allowUnknownOption=!!D,this}allowExcessArguments(D=!0){return this._allowExcessArguments=!!D,this}enablePositionalOptions(D=!0){return this._enablePositionalOptions=!!D,this}passThroughOptions(D=!0){return this._passThroughOptions=!!D,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(D=!0){if(this.options.length)throw Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!D,this}getOptionValue(D){if(this._storeOptionsAsProperties)return this[D];return this._optionValues[D]}setOptionValue(D,F){return this.setOptionValueWithSource(D,F,void 0)}setOptionValueWithSource(D,F,$){if(this._storeOptionsAsProperties)this[D]=F;else this._optionValues[D]=F;return this._optionValueSources[D]=$,this}getOptionValueSource(D){return this._optionValueSources[D]}getOptionValueSourceWithGlobals(D){let F;return this._getCommandAndAncestors().forEach(($)=>{if($.getOptionValueSource(D)!==void 0)F=$.getOptionValueSource(D)}),F}_prepareUserArgs(D,F){if(D!==void 0&&!Array.isArray(D))throw Error("first parameter to parse must be array or undefined");if(F=F||{},D===void 0&&F.from===void 0){if(VD.versions?.electron)F.from="electron";let J=VD.execArgv??[];if(J.includes("-e")||J.includes("--eval")||J.includes("-p")||J.includes("--print"))F.from="eval"}if(D===void 0)D=VD.argv;this.rawArgs=D.slice();let $;switch(F.from){case void 0:case"node":this._scriptPath=D[1],$=D.slice(2);break;case"electron":if(VD.defaultApp)this._scriptPath=D[1],$=D.slice(2);else $=D.slice(1);break;case"user":$=D.slice(0);break;case"eval":$=D.slice(1);break;default:throw Error(`unexpected parse option { from: '${F.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",$}parse(D,F){this._prepareForParse();let $=this._prepareUserArgs(D,F);return this._parseCommand([],$),this}async parseAsync(D,F){this._prepareForParse();let $=this._prepareUserArgs(D,F);return await this._parseCommand([],$),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.
@@ -24,13 +24,13 @@ Expecting one of '${$.join("', '")}'`);if(this._lifeCycleHooks[D])this._lifeCycl
24
24
  `),this.outputHelp({error:!0});let $=F||{},J=$.exitCode||1,Q=$.code||"commander.error";this._exit(J,Q,D)}_parseOptionsEnv(){this.options.forEach((D)=>{if(D.envVar&&D.envVar in VD.env){let F=D.attributeName();if(this.getOptionValue(F)===void 0||["default","config","env"].includes(this.getOptionValueSource(F)))if(D.required||D.optional)this.emit(`optionEnv:${D.name()}`,VD.env[D.envVar]);else this.emit(`optionEnv:${D.name()}`)}})}_parseOptionsImplied(){let D=new hu(this.options),F=($)=>{return this.getOptionValue($)!==void 0&&!["default","implied"].includes(this.getOptionValueSource($))};this.options.filter(($)=>$.implied!==void 0&&F($.attributeName())&&D.valueFromOption(this.getOptionValue($.attributeName()),$)).forEach(($)=>{Object.keys($.implied).filter((J)=>!F(J)).forEach((J)=>{this.setOptionValueWithSource(J,$.implied[J],"implied")})})}missingArgument(D){let F=`error: missing required argument '${D}'`;this.error(F,{code:"commander.missingArgument"})}optionMissingArgument(D){let F=`error: option '${D.flags}' argument missing`;this.error(F,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(D){let F=`error: required option '${D.flags}' not specified`;this.error(F,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(D,F){let $=(Z)=>{let X=Z.attributeName(),Y=this.getOptionValue(X),q=this.options.find((B)=>B.negate&&X===B.attributeName()),G=this.options.find((B)=>!B.negate&&X===B.attributeName());if(q&&(q.presetArg===void 0&&Y===!1||q.presetArg!==void 0&&Y===q.presetArg))return q;return G||Z},J=(Z)=>{let X=$(Z),Y=X.attributeName();if(this.getOptionValueSource(Y)==="env")return`environment variable '${X.envVar}'`;return`option '${X.flags}'`},Q=`error: ${J(D)} cannot be used with ${J(F)}`;this.error(Q,{code:"commander.conflictingOption"})}unknownOption(D){if(this._allowUnknownOption)return;let F="";if(D.startsWith("--")&&this._showSuggestionAfterError){let J=[],Q=this;do{let Z=Q.createHelp().visibleOptions(Q).filter((X)=>X.long).map((X)=>X.long);J=J.concat(Z),Q=Q.parent}while(Q&&!Q._enablePositionalOptions);F=Ez(D,J)}let $=`error: unknown option '${D}'${F}`;this.error($,{code:"commander.unknownOption"})}_excessArguments(D){if(this._allowExcessArguments)return;let F=this.registeredArguments.length,$=F===1?"":"s",Q=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${F} argument${$} but got ${D.length}.`;this.error(Q,{code:"commander.excessArguments"})}unknownCommand(){let D=this.args[0],F="";if(this._showSuggestionAfterError){let J=[];this.createHelp().visibleCommands(this).forEach((Q)=>{if(J.push(Q.name()),Q.alias())J.push(Q.alias())}),F=Ez(D,J)}let $=`error: unknown command '${D}'${F}`;this.error($,{code:"commander.unknownCommand"})}version(D,F,$){if(D===void 0)return this._version;this._version=D,F=F||"-V, --version",$=$||"output the version number";let J=this.createOption(F,$);return this._versionOptionName=J.attributeName(),this._registerOption(J),this.on("option:"+J.name(),()=>{this._outputConfiguration.writeOut(`${D}
25
25
  `),this._exit(0,"commander.version",D)}),this}description(D,F){if(D===void 0&&F===void 0)return this._description;if(this._description=D,F)this._argsDescription=F;return this}summary(D){if(D===void 0)return this._summary;return this._summary=D,this}alias(D){if(D===void 0)return this._aliases[0];let F=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)F=this.commands[this.commands.length-1];if(D===F._name)throw Error("Command alias can't be the same as its name");let $=this.parent?._findCommand(D);if($){let J=[$.name()].concat($.aliases()).join("|");throw Error(`cannot add alias '${D}' to command '${this.name()}' as already have command '${J}'`)}return F._aliases.push(D),this}aliases(D){if(D===void 0)return this._aliases;return D.forEach((F)=>this.alias(F)),this}usage(D){if(D===void 0){if(this._usage)return this._usage;let F=this.registeredArguments.map(($)=>{return fu($)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?F:[]).join(" ")}return this._usage=D,this}name(D){if(D===void 0)return this._name;return this._name=D,this}helpGroup(D){if(D===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=D,this}commandsGroup(D){if(D===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=D,this}optionsGroup(D){if(D===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=D,this}_initOptionGroup(D){if(this._defaultOptionGroup&&!D.helpGroupHeading)D.helpGroup(this._defaultOptionGroup)}_initCommandGroup(D){if(this._defaultCommandGroup&&!D.helpGroup())D.helpGroup(this._defaultCommandGroup)}nameFromFilename(D){return this._name=n8.basename(D,n8.extname(D)),this}executableDir(D){if(D===void 0)return this._executableDir;return this._executableDir=D,this}helpInformation(D){let F=this.createHelp(),$=this._getOutputContext(D);F.prepareContext({error:$.error,helpWidth:$.helpWidth,outputHasColors:$.hasColors});let J=F.formatHelp(this,F);if($.hasColors)return J;return this._outputConfiguration.stripColor(J)}_getOutputContext(D){D=D||{};let F=!!D.error,$,J,Q;if(F)$=(X)=>this._outputConfiguration.writeErr(X),J=this._outputConfiguration.getErrHasColors(),Q=this._outputConfiguration.getErrHelpWidth();else $=(X)=>this._outputConfiguration.writeOut(X),J=this._outputConfiguration.getOutHasColors(),Q=this._outputConfiguration.getOutHelpWidth();return{error:F,write:(X)=>{if(!J)X=this._outputConfiguration.stripColor(X);return $(X)},hasColors:J,helpWidth:Q}}outputHelp(D){let F;if(typeof D==="function")F=D,D=void 0;let $=this._getOutputContext(D),J={error:$.error,write:$.write,command:this};this._getCommandAndAncestors().reverse().forEach((Z)=>Z.emit("beforeAllHelp",J)),this.emit("beforeHelp",J);let Q=this.helpInformation({error:$.error});if(F){if(Q=F(Q),typeof Q!=="string"&&!Buffer.isBuffer(Q))throw Error("outputHelp callback must return a string or a Buffer")}if($.write(Q),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",J),this._getCommandAndAncestors().forEach((Z)=>Z.emit("afterAllHelp",J))}helpOption(D,F){if(typeof D==="boolean"){if(D){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(D??"-h, --help",F??"display help for command"),D||F)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption(D){return this._helpOption=D,this._initOptionGroup(D),this}help(D){this.outputHelp(D);let F=Number(VD.exitCode??0);if(F===0&&D&&typeof D!=="function"&&D.error)F=1;this._exit(F,"commander.help","(outputHelp)")}addHelpText(D,F){let $=["beforeAll","before","after","afterAll"];if(!$.includes(D))throw Error(`Unexpected value for position to addHelpText.
26
26
  Expecting one of '${$.join("', '")}'`);let J=`${D}Help`;return this.on(J,(Q)=>{let Z;if(typeof F==="function")Z=F({error:Q.error,command:Q.command});else Z=F;if(Z)Q.write(`${Z}
27
- `)}),this}_outputHelpIfRequested(D){let F=this._getHelpOption();if(F&&D.find((J)=>F.is(J)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function Rz(D){return D.map((F)=>{if(!F.startsWith("--inspect"))return F;let $,J="127.0.0.1",Q="9229",Z;if((Z=F.match(/^(--inspect(-brk)?)$/))!==null)$=Z[1];else if((Z=F.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if($=Z[1],/^\d+$/.test(Z[3]))Q=Z[3];else J=Z[3];else if((Z=F.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)$=Z[1],J=Z[3],Q=Z[4];if($&&Q!=="0")return`${$}=${J}:${parseInt(Q)+1}`;return F})}function Xq(){if(VD.env.NO_COLOR||VD.env.FORCE_COLOR==="0"||VD.env.FORCE_COLOR==="false")return!1;if(VD.env.FORCE_COLOR||VD.env.CLICOLOR_FORCE!==void 0)return!0;return}uu.Command=Yq;uu.useColor=Xq});var Tz=I((lu)=>{var{Argument:Iz}=z$(),{Command:qq}=Az(),{CommanderError:du,InvalidArgumentError:wz}=I9(),{Help:pu}=$q(),{Option:Nz}=Jq();lu.program=new qq;lu.createCommand=(D)=>new qq(D);lu.createOption=(D,F)=>new Nz(D,F);lu.createArgument=(D,F)=>new Iz(D,F);lu.Command=qq;lu.Option=Nz;lu.Argument=Iz;lu.Help=pu;lu.CommanderError=du;lu.InvalidArgumentError=wz;lu.InvalidOptionArgumentError=wz});var Pz=I((J2,Lz)=>{var f2=Tz();J2=Lz.exports={};J2.program=new f2.Command;J2.Argument=f2.Argument;J2.Command=f2.Command;J2.CommanderError=f2.CommanderError;J2.Help=f2.Help;J2.InvalidArgumentError=f2.InvalidArgumentError;J2.InvalidOptionArgumentError=f2.InvalidArgumentError;J2.Option=f2.Option;J2.createCommand=(D)=>new f2.Command(D);J2.createOption=(D,F)=>new f2.Option(D,F);J2.createArgument=(D,F)=>new f2.Argument(D,F)});var _$=I((CqD,kz)=>{var Gq=[],xz=0,M0=(D,F)=>{if(xz>=F)Gq.push(D)};M0.WARN=1;M0.INFO=2;M0.DEBUG=3;M0.reset=()=>{Gq=[]};M0.setDebugLevel=(D)=>{xz=D};M0.warn=(D)=>M0(D,M0.WARN);M0.info=(D)=>M0(D,M0.INFO);M0.debug=(D)=>M0(D,M0.DEBUG);M0.debugMessages=()=>Gq;kz.exports=M0});var fz=I((_qD,yz)=>{yz.exports=({onlyFirst:D=!1}={})=>{let F=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(F,D?void 0:"g")}});var vz=I((MqD,bz)=>{var Qg=fz();bz.exports=(D)=>typeof D==="string"?D.replace(Qg(),""):D});var uz=I((OqD,Bq)=>{var hz=(D)=>{if(Number.isNaN(D))return!1;if(D>=4352&&(D<=4447||D===9001||D===9002||11904<=D&&D<=12871&&D!==12351||12880<=D&&D<=19903||19968<=D&&D<=42182||43360<=D&&D<=43388||44032<=D&&D<=55203||63744<=D&&D<=64255||65040<=D&&D<=65049||65072<=D&&D<=65131||65281<=D&&D<=65376||65504<=D&&D<=65510||110592<=D&&D<=110593||127488<=D&&D<=127569||131072<=D&&D<=262141))return!0;return!1};Bq.exports=hz;Bq.exports.default=hz});var mz=I((EqD,gz)=>{gz.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var pz=I((RqD,Wq)=>{var Zg=vz(),Xg=uz(),Yg=mz(),dz=(D)=>{if(typeof D!=="string"||D.length===0)return 0;if(D=Zg(D),D.length===0)return 0;D=D.replace(Yg()," ");let F=0;for(let $=0;$<D.length;$++){let J=D.codePointAt($);if(J<=31||J>=127&&J<=159)continue;if(J>=768&&J<=879)continue;if(J>65535)$++;F+=Xg(J)?2:1}return F};Wq.exports=dz;Wq.exports.default=dz});var Kq=I((AqD,iz)=>{var lz=pz();function M$(D){return D?/\u001b\[((?:\d*;){0,5}\d*)m/g:/\u001b\[(?:\d*;){0,5}\d*m/g}function q8(D){let F=M$();return(""+D).replace(F,"").split(`
27
+ `)}),this}_outputHelpIfRequested(D){let F=this._getHelpOption();if(F&&D.find((J)=>F.is(J)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function Rz(D){return D.map((F)=>{if(!F.startsWith("--inspect"))return F;let $,J="127.0.0.1",Q="9229",Z;if((Z=F.match(/^(--inspect(-brk)?)$/))!==null)$=Z[1];else if((Z=F.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if($=Z[1],/^\d+$/.test(Z[3]))Q=Z[3];else J=Z[3];else if((Z=F.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)$=Z[1],J=Z[3],Q=Z[4];if($&&Q!=="0")return`${$}=${J}:${parseInt(Q)+1}`;return F})}function Xq(){if(VD.env.NO_COLOR||VD.env.FORCE_COLOR==="0"||VD.env.FORCE_COLOR==="false")return!1;if(VD.env.FORCE_COLOR||VD.env.CLICOLOR_FORCE!==void 0)return!0;return}uu.Command=Yq;uu.useColor=Xq});var Tz=w((lu)=>{var{Argument:Iz}=z$(),{Command:qq}=Az(),{CommanderError:du,InvalidArgumentError:wz}=I9(),{Help:pu}=$q(),{Option:Nz}=Jq();lu.program=new qq;lu.createCommand=(D)=>new qq(D);lu.createOption=(D,F)=>new Nz(D,F);lu.createArgument=(D,F)=>new Iz(D,F);lu.Command=qq;lu.Option=Nz;lu.Argument=Iz;lu.Help=pu;lu.CommanderError=du;lu.InvalidArgumentError=wz;lu.InvalidOptionArgumentError=wz});var Pz=w((J2,Lz)=>{var f2=Tz();J2=Lz.exports={};J2.program=new f2.Command;J2.Argument=f2.Argument;J2.Command=f2.Command;J2.CommanderError=f2.CommanderError;J2.Help=f2.Help;J2.InvalidArgumentError=f2.InvalidArgumentError;J2.InvalidOptionArgumentError=f2.InvalidArgumentError;J2.Option=f2.Option;J2.createCommand=(D)=>new f2.Command(D);J2.createOption=(D,F)=>new f2.Option(D,F);J2.createArgument=(D,F)=>new f2.Argument(D,F)});var _$=w((CqD,kz)=>{var Gq=[],xz=0,M0=(D,F)=>{if(xz>=F)Gq.push(D)};M0.WARN=1;M0.INFO=2;M0.DEBUG=3;M0.reset=()=>{Gq=[]};M0.setDebugLevel=(D)=>{xz=D};M0.warn=(D)=>M0(D,M0.WARN);M0.info=(D)=>M0(D,M0.INFO);M0.debug=(D)=>M0(D,M0.DEBUG);M0.debugMessages=()=>Gq;kz.exports=M0});var fz=w((_qD,yz)=>{yz.exports=({onlyFirst:D=!1}={})=>{let F=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(F,D?void 0:"g")}});var vz=w((MqD,bz)=>{var Qg=fz();bz.exports=(D)=>typeof D==="string"?D.replace(Qg(),""):D});var uz=w((OqD,Bq)=>{var hz=(D)=>{if(Number.isNaN(D))return!1;if(D>=4352&&(D<=4447||D===9001||D===9002||11904<=D&&D<=12871&&D!==12351||12880<=D&&D<=19903||19968<=D&&D<=42182||43360<=D&&D<=43388||44032<=D&&D<=55203||63744<=D&&D<=64255||65040<=D&&D<=65049||65072<=D&&D<=65131||65281<=D&&D<=65376||65504<=D&&D<=65510||110592<=D&&D<=110593||127488<=D&&D<=127569||131072<=D&&D<=262141))return!0;return!1};Bq.exports=hz;Bq.exports.default=hz});var mz=w((EqD,gz)=>{gz.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var pz=w((RqD,Wq)=>{var Zg=vz(),Xg=uz(),Yg=mz(),dz=(D)=>{if(typeof D!=="string"||D.length===0)return 0;if(D=Zg(D),D.length===0)return 0;D=D.replace(Yg()," ");let F=0;for(let $=0;$<D.length;$++){let J=D.codePointAt($);if(J<=31||J>=127&&J<=159)continue;if(J>=768&&J<=879)continue;if(J>65535)$++;F+=Xg(J)?2:1}return F};Wq.exports=dz;Wq.exports.default=dz});var Kq=w((AqD,iz)=>{var lz=pz();function M$(D){return D?/\u001b\[((?:\d*;){0,5}\d*)m/g:/\u001b\[(?:\d*;){0,5}\d*m/g}function q8(D){let F=M$();return(""+D).replace(F,"").split(`
28
28
  `).reduce(function(Q,Z){return lz(Z)>Q?lz(Z):Q},0)}function w9(D,F){return Array(F+1).join(D)}function qg(D,F,$,J){let Q=q8(D);if(F+1>=Q){let Z=F-Q;switch(J){case"right":{D=w9($,Z)+D;break}case"center":{let X=Math.ceil(Z/2),Y=Z-X;D=w9($,Y)+D+w9($,X);break}default:{D=D+w9($,Z);break}}}return D}var F6={};function N9(D,F,$){F="\x1B["+F+"m",$="\x1B["+$+"m",F6[F]={set:D,to:!0},F6[$]={set:D,to:!1},F6[D]={on:F,off:$}}N9("bold",1,22);N9("italics",3,23);N9("underline",4,24);N9("inverse",7,27);N9("strikethrough",9,29);function cz(D,F){let $=F[1]?parseInt(F[1].split(";")[0]):0;if($>=30&&$<=39||$>=90&&$<=97){D.lastForegroundAdded=F[0];return}if($>=40&&$<=49||$>=100&&$<=107){D.lastBackgroundAdded=F[0];return}if($===0){for(let Q in D)if(Object.prototype.hasOwnProperty.call(D,Q))delete D[Q];return}let J=F6[F[0]];if(J)D[J.set]=J.to}function Gg(D){let F=M$(!0),$=F.exec(D),J={};while($!==null)cz(J,$),$=F.exec(D);return J}function nz(D,F){let{lastBackgroundAdded:$,lastForegroundAdded:J}=D;if(delete D.lastBackgroundAdded,delete D.lastForegroundAdded,Object.keys(D).forEach(function(Q){if(D[Q])F+=F6[Q].off}),$&&$!="\x1B[49m")F+="\x1B[49m";if(J&&J!="\x1B[39m")F+="\x1B[39m";return F}function Bg(D,F){let{lastBackgroundAdded:$,lastForegroundAdded:J}=D;if(delete D.lastBackgroundAdded,delete D.lastForegroundAdded,Object.keys(D).forEach(function(Q){if(D[Q])F=F6[Q].on+F}),$&&$!="\x1B[49m")F=$+F;if(J&&J!="\x1B[39m")F=J+F;return F}function Wg(D,F){if(D.length===q8(D))return D.substr(0,F);while(q8(D)>F)D=D.slice(0,-1);return D}function Kg(D,F){let $=M$(!0),J=D.split(M$()),Q=0,Z=0,X="",Y,q={};while(Z<F){Y=$.exec(D);let G=J[Q];if(Q++,Z+q8(G)>F)G=Wg(G,F-Z);if(X+=G,Z+=q8(G),Z<F){if(!Y)break;X+=Y[0],cz(q,Y)}}return nz(q,X)}function Ug(D,F,$){if($=$||"…",q8(D)<=F)return D;F-=q8($);let Q=Kg(D,F);Q+=$;let Z="\x1B]8;;\x07";if(D.includes(Z)&&!Q.includes(Z))Q+=Z;return Q}function Vg(){return{chars:{top:"─","top-mid":"┬","top-left":"┌","top-right":"┐",bottom:"─","bottom-mid":"┴","bottom-left":"└","bottom-right":"┘",left:"│","left-mid":"├",mid:"─","mid-mid":"┼",right:"│","right-mid":"┤",middle:"│"},truncate:"…",colWidths:[],rowHeights:[],colAligns:[],rowAligns:[],style:{"padding-left":1,"padding-right":1,head:["red"],border:["grey"],compact:!1},head:[]}}function Hg(D,F){D=D||{},F=F||Vg();let $=Object.assign({},F,D);return $.chars=Object.assign({},F.chars,D.chars),$.style=Object.assign({},F.style,D.style),$}function zg(D,F){let $=[],J=F.split(/(\s+)/g),Q=[],Z=0,X;for(let Y=0;Y<J.length;Y+=2){let q=J[Y],G=Z+q8(q);if(Z>0&&X)G+=X.length;if(G>D){if(Z!==0)$.push(Q.join(""));Q=[q],Z=q8(q)}else Q.push(X||"",q),Z=G;X=J[Y+1]}if(Z)$.push(Q.join(""));return $}function Cg(D,F){let $=[],J="";function Q(X,Y){if(J.length&&Y)J+=Y;J+=X;while(J.length>D)$.push(J.slice(0,D)),J=J.slice(D)}let Z=F.split(/(\s+)/g);for(let X=0;X<Z.length;X+=2)Q(Z[X],X&&Z[X-1]);if(J.length)$.push(J);return $}function _g(D,F,$=!0){let J=[];F=F.split(`
29
- `);let Q=$?zg:Cg;for(let Z=0;Z<F.length;Z++)J.push.apply(J,Q(D,F[Z]));return J}function Mg(D){let F={},$=[];for(let J=0;J<D.length;J++){let Q=Bg(F,D[J]);F=Gg(Q);let Z=Object.assign({},F);$.push(nz(Z,Q))}return $}function Og(D,F){return["\x1B]","8",";",";",D||F,"\x07",F,"\x1B]","8",";",";","\x07"].join("")}iz.exports={strlen:q8,repeat:w9,pad:qg,truncate:Ug,mergeOptions:Hg,wordWrap:_g,colorizeLines:Mg,hyperlink:Og}});var sz=I((IqD,rz)=>{var az={};rz.exports=az;var oz={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(oz).forEach(function(D){var F=oz[D],$=az[D]=[];$.open="\x1B["+F[0]+"m",$.close="\x1B["+F[1]+"m"})});var ez=I((wqD,tz)=>{tz.exports=function(D,F){F=F||process.argv;var $=F.indexOf("--"),J=/^-{1,2}/.test(D)?"":"--",Q=F.indexOf(J+D);return Q!==-1&&($===-1?!0:Q<$)}});var FC=I((NqD,DC)=>{var Eg=r("os"),b2=ez(),x0=process.env,$6=void 0;if(b2("no-color")||b2("no-colors")||b2("color=false"))$6=!1;else if(b2("color")||b2("colors")||b2("color=true")||b2("color=always"))$6=!0;if("FORCE_COLOR"in x0)$6=x0.FORCE_COLOR.length===0||parseInt(x0.FORCE_COLOR,10)!==0;function Rg(D){if(D===0)return!1;return{level:D,hasBasic:!0,has256:D>=2,has16m:D>=3}}function Ag(D){if($6===!1)return 0;if(b2("color=16m")||b2("color=full")||b2("color=truecolor"))return 3;if(b2("color=256"))return 2;if(D&&!D.isTTY&&$6!==!0)return 0;var F=$6?1:0;if(process.platform==="win32"){var $=Eg.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number($[0])>=10&&Number($[2])>=10586)return Number($[2])>=14931?3:2;return 1}if("CI"in x0){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(Q){return Q in x0})||x0.CI_NAME==="codeship")return 1;return F}if("TEAMCITY_VERSION"in x0)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(x0.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in x0){var J=parseInt((x0.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(x0.TERM_PROGRAM){case"iTerm.app":return J>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(x0.TERM))return 2;if(/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(x0.TERM))return 1;if("COLORTERM"in x0)return 1;if(x0.TERM==="dumb")return F;return F}function Uq(D){var F=Ag(D);return Rg(F)}DC.exports={supportsColor:Uq,stdout:Uq(process.stdout),stderr:Uq(process.stderr)}});var JC=I((TqD,$C)=>{$C.exports=function(F,$){var J="";F=F||"Run the trap, drop the bass",F=F.split("");var Q={a:["@","Ą","Ⱥ","Ʌ","Δ","Λ","Д"],b:["ß","Ɓ","Ƀ","ɮ","β","฿"],c:["©","Ȼ","Ͼ"],d:["Ð","Ɗ","Ԁ","ԁ","Ԃ","ԃ"],e:["Ë","ĕ","Ǝ","ɘ","Σ","ξ","Ҽ","੬"],f:["Ӻ"],g:["ɢ"],h:["Ħ","ƕ","Ң","Һ","Ӈ","Ԋ"],i:["༏"],j:["Ĵ"],k:["ĸ","Ҡ","Ӄ","Ԟ"],l:["Ĺ"],m:["ʍ","Ӎ","ӎ","Ԡ","ԡ","൩"],n:["Ñ","ŋ","Ɲ","Ͷ","Π","Ҋ"],o:["Ø","õ","ø","Ǿ","ʘ","Ѻ","ם","۝","๏"],p:["Ƿ","Ҏ"],q:["্"],r:["®","Ʀ","Ȑ","Ɍ","ʀ","Я"],s:["§","Ϟ","ϟ","Ϩ"],t:["Ł","Ŧ","ͳ"],u:["Ʊ","Ս"],v:["ט"],w:["Ш","Ѡ","Ѽ","൰"],x:["Ҳ","Ӿ","Ӽ","ӽ"],y:["¥","Ұ","Ӌ"],z:["Ƶ","ɀ"]};return F.forEach(function(Z){Z=Z.toLowerCase();var X=Q[Z]||[" "],Y=Math.floor(Math.random()*X.length);if(typeof Q[Z]<"u")J+=Q[Z][Y];else J+=Z}),J}});var ZC=I((LqD,QC)=>{QC.exports=function(F,$){F=F||" he is here ";var J={up:["̍","̎","̄","̅","̿","̑","̆","̐","͒","͗","͑","̇","̈","̊","͂","̓","̈","͊","͋","͌","̃","̂","̌","͐","̀","́","̋","̏","̒","̓","̔","̽","̉","ͣ","ͤ","ͥ","ͦ","ͧ","ͨ","ͩ","ͪ","ͫ","ͬ","ͭ","ͮ","ͯ","̾","͛","͆","̚"],down:["̖","̗","̘","̙","̜","̝","̞","̟","̠","̤","̥","̦","̩","̪","̫","̬","̭","̮","̯","̰","̱","̲","̳","̹","̺","̻","̼","ͅ","͇","͈","͉","͍","͎","͓","͔","͕","͖","͙","͚","̣"],mid:["̕","̛","̀","́","͘","̡","̢","̧","̨","̴","̵","̶","͜","͝","͞","͟","͠","͢","̸","̷","͡"," ҉"]},Q=[].concat(J.up,J.down,J.mid);function Z(q){var G=Math.floor(Math.random()*q);return G}function X(q){var G=!1;return Q.filter(function(B){G=B===q}),G}function Y(q,G){var B="",W,K;G=G||{},G.up=typeof G.up<"u"?G.up:!0,G.mid=typeof G.mid<"u"?G.mid:!0,G.down=typeof G.down<"u"?G.down:!0,G.size=typeof G.size<"u"?G.size:"maxi",q=q.split("");for(K in q){if(X(K))continue;switch(B=B+q[K],W={up:0,down:0,mid:0},G.size){case"mini":W.up=Z(8),W.mid=Z(2),W.down=Z(8);break;case"maxi":W.up=Z(16)+3,W.mid=Z(4)+1,W.down=Z(64)+3;break;default:W.up=Z(8)+1,W.mid=Z(6)/2,W.down=Z(8)+1;break}var U=["up","mid","down"];for(var V in U){var H=U[V];for(var z=0;z<=W[H];z++)if(G[H])B=B+J[H][Z(J[H].length)]}}return B}return Y(F,$)}});var YC=I((PqD,XC)=>{XC.exports=function(D){return function(F,$,J){if(F===" ")return F;switch($%3){case 0:return D.red(F);case 1:return D.white(F);case 2:return D.blue(F)}}}});var GC=I((jqD,qC)=>{qC.exports=function(D){return function(F,$,J){return $%2===0?F:D.inverse(F)}}});var WC=I((SqD,BC)=>{BC.exports=function(D){var F=["red","yellow","green","blue","magenta"];return function($,J,Q){if($===" ")return $;else return D[F[J++%F.length]]($)}}});var UC=I((xqD,KC)=>{KC.exports=function(D){var F=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function($,J,Q){return $===" "?$:D[F[Math.round(Math.random()*(F.length-2))]]($)}}});var _C=I((yqD,CC)=>{var YD={};CC.exports=YD;YD.themes={};var Ig=r("util"),kF=YD.styles=sz(),VC=Object.defineProperties,wg=new RegExp(/[\r\n]+/g);YD.supportsColor=FC().supportsColor;if(typeof YD.enabled>"u")YD.enabled=YD.supportsColor()!==!1;YD.enable=function(){YD.enabled=!0};YD.disable=function(){YD.enabled=!1};YD.stripColors=YD.strip=function(D){return(""+D).replace(/\x1B\[\d+m/g,"")};var kqD=YD.stylize=function(F,$){if(!YD.enabled)return F+"";var J=kF[$];if(!J&&$ in YD)return YD[$](F);return J.open+F+J.close},Ng=/[|\\{}()[\]^$+*?.]/g,Tg=function(D){if(typeof D!=="string")throw TypeError("Expected a string");return D.replace(Ng,"\\$&")};function HC(D){var F=function $(){return Pg.apply($,arguments)};return F._styles=D,F.__proto__=Lg,F}var zC=function(){var D={};return kF.grey=kF.gray,Object.keys(kF).forEach(function(F){kF[F].closeRe=new RegExp(Tg(kF[F].close),"g"),D[F]={get:function(){return HC(this._styles.concat(F))}}}),D}(),Lg=VC(function(){},zC);function Pg(){var D=Array.prototype.slice.call(arguments),F=D.map(function(X){if(X!=null&&X.constructor===String)return X;else return Ig.inspect(X)}).join(" ");if(!YD.enabled||!F)return F;var $=F.indexOf(`
30
- `)!=-1,J=this._styles,Q=J.length;while(Q--){var Z=kF[J[Q]];if(F=Z.open+F.replace(Z.closeRe,Z.open)+Z.close,$)F=F.replace(wg,function(X){return Z.close+X+Z.open})}return F}YD.setTheme=function(D){if(typeof D==="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var F in D)(function($){YD[$]=function(J){if(typeof D[$]==="object"){var Q=J;for(var Z in D[$])Q=YD[D[$][Z]](Q);return Q}return YD[D[$]](J)}})(F)};function jg(){var D={};return Object.keys(zC).forEach(function(F){D[F]={get:function(){return HC([F])}}}),D}var Sg=function(F,$){var J=$.split("");return J=J.map(F),J.join("")};YD.trap=JC();YD.zalgo=ZC();YD.maps={};YD.maps.america=YC()(YD);YD.maps.zebra=GC()(YD);YD.maps.rainbow=WC()(YD);YD.maps.random=UC()(YD);for(Vq in YD.maps)(function(D){YD[D]=function(F){return Sg(YD.maps[D],F)}})(Vq);var Vq;VC(YD,jg())});var OC=I((fqD,MC)=>{var xg=_C();MC.exports=xg});var IC=I((bqD,R$)=>{var{info:kg,debug:AC}=_$(),Q2=Kq();class T9{constructor(D){this.setOptions(D),this.x=null,this.y=null}setOptions(D){if(["boolean","number","bigint","string"].indexOf(typeof D)!==-1)D={content:""+D};D=D||{},this.options=D;let F=D.content;if(["boolean","number","bigint","string"].indexOf(typeof F)!==-1)this.content=String(F);else if(!F)this.content=this.options.href||"";else throw Error("Content needs to be a primitive, got: "+typeof F);if(this.colSpan=D.colSpan||1,this.rowSpan=D.rowSpan||1,this.options.href)Object.defineProperty(this,"href",{get(){return this.options.href}})}mergeTableOptions(D,F){this.cells=F;let $=this.options.chars||{},J=D.chars,Q=this.chars={};fg.forEach(function(Y){Hq($,J,Y,Q)}),this.truncate=this.options.truncate||D.truncate;let Z=this.options.style=this.options.style||{},X=D.style;Hq(Z,X,"padding-left",this),Hq(Z,X,"padding-right",this),this.head=Z.head||X.head,this.border=Z.border||X.border,this.fixedWidth=D.colWidths[this.x],this.lines=this.computeLines(D),this.desiredWidth=Q2.strlen(this.content)+this.paddingLeft+this.paddingRight,this.desiredHeight=this.lines.length}computeLines(D){let F=D.wordWrap||D.textWrap,{wordWrap:$=F}=this.options;if(this.fixedWidth&&$){if(this.fixedWidth-=this.paddingLeft+this.paddingRight,this.colSpan){let Z=1;while(Z<this.colSpan)this.fixedWidth+=D.colWidths[this.x+Z],Z++}let{wrapOnWordBoundary:J=!0}=D,{wrapOnWordBoundary:Q=J}=this.options;return this.wrapLines(Q2.wordWrap(this.fixedWidth,this.content,Q))}return this.wrapLines(this.content.split(`
31
- `))}wrapLines(D){let F=Q2.colorizeLines(D);if(this.href)return F.map(($)=>Q2.hyperlink(this.href,$));return F}init(D){let F=this.x,$=this.y;this.widths=D.colWidths.slice(F,F+this.colSpan),this.heights=D.rowHeights.slice($,$+this.rowSpan),this.width=this.widths.reduce(RC,-1),this.height=this.heights.reduce(RC,-1),this.hAlign=this.options.hAlign||D.colAligns[F],this.vAlign=this.options.vAlign||D.rowAligns[$],this.drawRight=F+this.colSpan==D.colWidths.length}draw(D,F){if(D=="top")return this.drawTop(this.drawRight);if(D=="bottom")return this.drawBottom(this.drawRight);let $=Q2.truncate(this.content,10,this.truncate);if(!D)kg(`${this.y}-${this.x}: ${this.rowSpan-D}x${this.colSpan} Cell ${$}`);let J=Math.max(this.height-this.lines.length,0),Q;switch(this.vAlign){case"center":Q=Math.ceil(J/2);break;case"bottom":Q=J;break;default:Q=0}if(D<Q||D>=Q+this.lines.length)return this.drawEmpty(this.drawRight,F);let Z=this.lines.length>this.height&&D+1>=this.height;return this.drawLine(D-Q,this.drawRight,Z,F)}drawTop(D){let F=[];if(this.cells)this.widths.forEach(function($,J){F.push(this._topLeftChar(J)),F.push(Q2.repeat(this.chars[this.y==0?"top":"mid"],$))},this);else F.push(this._topLeftChar(0)),F.push(Q2.repeat(this.chars[this.y==0?"top":"mid"],this.width));if(D)F.push(this.chars[this.y==0?"topRight":"rightMid"]);return this.wrapWithStyleColors("border",F.join(""))}_topLeftChar(D){let F=this.x+D,$;if(this.y==0)$=F==0?"topLeft":D==0?"topMid":"top";else if(F==0)$="leftMid";else if($=D==0?"midMid":"bottomMid",this.cells){if(this.cells[this.y-1][F]instanceof T9.ColSpanCell)$=D==0?"topMid":"mid";if(D==0){let Q=1;while(this.cells[this.y][F-Q]instanceof T9.ColSpanCell)Q++;if(this.cells[this.y][F-Q]instanceof T9.RowSpanCell)$="leftMid"}}return this.chars[$]}wrapWithStyleColors(D,F){if(this[D]&&this[D].length)try{let $=OC();for(let J=this[D].length-1;J>=0;J--)$=$[this[D][J]];return $(F)}catch($){return F}else return F}drawLine(D,F,$,J){let Q=this.chars[this.x==0?"left":"middle"];if(this.x&&J&&this.cells){let W=this.cells[this.y+J][this.x-1];while(W instanceof O$)W=this.cells[W.y][W.x-1];if(!(W instanceof E$))Q=this.chars.rightMid}let Z=Q2.repeat(" ",this.paddingLeft),X=F?this.chars.right:"",Y=Q2.repeat(" ",this.paddingRight),q=this.lines[D],G=this.width-(this.paddingLeft+this.paddingRight);if($)q+=this.truncate||"…";let B=Q2.truncate(q,G,this.truncate);return B=Q2.pad(B,G," ",this.hAlign),B=Z+B+Y,this.stylizeLine(Q,B,X)}stylizeLine(D,F,$){if(D=this.wrapWithStyleColors("border",D),$=this.wrapWithStyleColors("border",$),this.y===0)F=this.wrapWithStyleColors("head",F);return D+F+$}drawBottom(D){let F=this.chars[this.x==0?"bottomLeft":"bottomMid"],$=Q2.repeat(this.chars.bottom,this.width),J=D?this.chars.bottomRight:"";return this.wrapWithStyleColors("border",F+$+J)}drawEmpty(D,F){let $=this.chars[this.x==0?"left":"middle"];if(this.x&&F&&this.cells){let Z=this.cells[this.y+F][this.x-1];while(Z instanceof O$)Z=this.cells[Z.y][Z.x-1];if(!(Z instanceof E$))$=this.chars.rightMid}let J=D?this.chars.right:"",Q=Q2.repeat(" ",this.width);return this.stylizeLine($,Q,J)}}class O${constructor(){}draw(D){if(typeof D==="number")AC(`${this.y}-${this.x}: 1x1 ColSpanCell`);return""}init(){}mergeTableOptions(){}}class E${constructor(D){this.originalCell=D}init(D){let F=this.y,$=this.originalCell.y;this.cellOffset=F-$,this.offset=yg(D.rowHeights,$,this.cellOffset)}draw(D){if(D=="top")return this.originalCell.draw(this.offset,this.cellOffset);if(D=="bottom")return this.originalCell.draw("bottom");return AC(`${this.y}-${this.x}: 1x${this.colSpan} RowSpanCell for ${this.originalCell.content}`),this.originalCell.draw(this.offset+1+D)}mergeTableOptions(){}}function EC(...D){return D.filter((F)=>F!==void 0&&F!==null).shift()}function Hq(D,F,$,J){let Q=$.split("-");if(Q.length>1)Q[1]=Q[1].charAt(0).toUpperCase()+Q[1].substr(1),Q=Q.join(""),J[Q]=EC(D[Q],D[$],F[Q],F[$]);else J[$]=EC(D[$],F[$])}function yg(D,F,$){let J=D[F];for(let Q=1;Q<$;Q++)J+=1+D[F+Q];return J}function RC(D,F){return D+F+1}var fg=["top","top-mid","top-left","top-right","bottom","bottom-mid","bottom-left","bottom-right","left","left-mid","mid","mid-mid","right","right-mid","middle"];R$.exports=T9;R$.exports.ColSpanCell=O$;R$.exports.RowSpanCell=E$});var TC=I((vqD,NC)=>{var{warn:bg,debug:vg}=_$(),zq=IC(),{ColSpanCell:hg,RowSpanCell:ug}=zq;(function(){function D(U,V){if(U[V]>0)return D(U,V+1);return V}function F(U){let V={};U.forEach(function(H,z){let _=0;H.forEach(function(O){O.y=z,O.x=z?D(V,_):_;let C=O.rowSpan||1,M=O.colSpan||1;if(C>1)for(let E=0;E<M;E++)V[O.x+E]=C;_=O.x+M}),Object.keys(V).forEach((O)=>{if(V[O]--,V[O]<1)delete V[O]})})}function $(U){let V=0;return U.forEach(function(H){H.forEach(function(z){V=Math.max(V,z.x+(z.colSpan||1))})}),V}function J(U){return U.length}function Q(U,V){let H=U.y,z=U.y-1+(U.rowSpan||1),_=V.y,O=V.y-1+(V.rowSpan||1),C=!(H>O||_>z),M=U.x,E=U.x-1+(U.colSpan||1),A=V.x,w=V.x-1+(V.colSpan||1),R=!(M>w||A>E);return C&&R}function Z(U,V,H){let z=Math.min(U.length-1,H),_={x:V,y:H};for(let O=0;O<=z;O++){let C=U[O];for(let M=0;M<C.length;M++)if(Q(_,C[M]))return!0}return!1}function X(U,V,H,z){for(let _=H;_<z;_++)if(Z(U,_,V))return!1;return!0}function Y(U){U.forEach(function(V,H){V.forEach(function(z){for(let _=1;_<z.rowSpan;_++){let O=new ug(z);O.x=z.x,O.y=z.y+_,O.colSpan=z.colSpan,G(O,U[H+_])}})})}function q(U){for(let V=U.length-1;V>=0;V--){let H=U[V];for(let z=0;z<H.length;z++){let _=H[z];for(let O=1;O<_.colSpan;O++){let C=new hg;C.x=_.x+O,C.y=_.y,H.splice(z+1,0,C)}}}}function G(U,V){let H=0;while(H<V.length&&V[H].x<U.x)H++;V.splice(H,0,U)}function B(U){let V=J(U),H=$(U);vg(`Max rows: ${V}; Max cols: ${H}`);for(let z=0;z<V;z++)for(let _=0;_<H;_++)if(!Z(U,_,z)){let O={x:_,y:z,colSpan:1,rowSpan:1};_++;while(_<H&&!Z(U,_,z))O.colSpan++,_++;let C=z+1;while(C<V&&X(U,C,O.x,O.x+O.colSpan))O.rowSpan++,C++;let M=new zq(O);M.x=O.x,M.y=O.y,bg(`Missing cell at ${M.y}-${M.x}.`),G(M,U[z])}}function W(U){return U.map(function(V){if(!Array.isArray(V)){let H=Object.keys(V)[0];if(V=V[H],Array.isArray(V))V=V.slice(),V.unshift(H);else V=[H,V]}return V.map(function(H){return new zq(H)})})}function K(U){let V=W(U);return F(V),B(V),Y(V),q(V),V}NC.exports={makeTableLayout:K,layoutTable:F,addRowSpanCells:Y,maxWidth:$,fillInTable:B,computeWidths:wC("colSpan","desiredWidth","x",1),computeHeights:wC("rowSpan","desiredHeight","y",1)}})();function wC(D,F,$,J){return function(Q,Z){let X=[],Y=[],q={};Z.forEach(function(G){G.forEach(function(B){if((B[D]||1)>1)Y.push(B);else X[B[$]]=Math.max(X[B[$]]||0,B[F]||0,J)})}),Q.forEach(function(G,B){if(typeof G==="number")X[B]=G});for(let G=Y.length-1;G>=0;G--){let B=Y[G],W=B[D],K=B[$],U=X[K],V=typeof Q[K]==="number"?0:1;if(typeof U==="number"){for(let H=1;H<W;H++)if(U+=1+X[K+H],typeof Q[K+H]!=="number")V++}else if(U=F==="desiredWidth"?B.desiredWidth-1:1,!q[K]||q[K]<U)q[K]=U;if(B[F]>U){let H=0;while(V>0&&B[F]>U){if(typeof Q[K+H]!=="number"){let z=Math.round((B[F]-U)/V);U+=z,X[K+H]+=z,V--}H++}}}Object.assign(Q,X,q);for(let G=0;G<Q.length;G++)Q[G]=Math.max(J,Q[G]||0)}}});var Oq=I((hqD,LC)=>{var i8=_$(),gg=Kq(),Cq=TC();class Mq extends Array{constructor(D){super();let F=gg.mergeOptions(D);if(Object.defineProperty(this,"options",{value:F,enumerable:F.debug}),F.debug){switch(typeof F.debug){case"boolean":i8.setDebugLevel(i8.WARN);break;case"number":i8.setDebugLevel(F.debug);break;case"string":i8.setDebugLevel(parseInt(F.debug,10));break;default:i8.setDebugLevel(i8.WARN),i8.warn(`Debug option is expected to be boolean, number, or string. Received a ${typeof F.debug}`)}Object.defineProperty(this,"messages",{get(){return i8.debugMessages()}})}}toString(){let D=this,F=this.options.head&&this.options.head.length;if(F){if(D=[this.options.head],this.length)D.push.apply(D,this)}else this.options.style.head=[];let $=Cq.makeTableLayout(D);$.forEach(function(Q){Q.forEach(function(Z){Z.mergeTableOptions(this.options,$)},this)},this),Cq.computeWidths(this.options.colWidths,$),Cq.computeHeights(this.options.rowHeights,$),$.forEach(function(Q){Q.forEach(function(Z){Z.init(this.options)},this)},this);let J=[];for(let Q=0;Q<$.length;Q++){let Z=$[Q],X=this.options.rowHeights[Q];if(Q===0||!this.options.style.compact||Q==1&&F)_q(Z,"top",J);for(let Y=0;Y<X;Y++)_q(Z,Y,J);if(Q+1==$.length)_q(Z,"bottom",J)}return J.join(`
29
+ `);let Q=$?zg:Cg;for(let Z=0;Z<F.length;Z++)J.push.apply(J,Q(D,F[Z]));return J}function Mg(D){let F={},$=[];for(let J=0;J<D.length;J++){let Q=Bg(F,D[J]);F=Gg(Q);let Z=Object.assign({},F);$.push(nz(Z,Q))}return $}function Og(D,F){return["\x1B]","8",";",";",D||F,"\x07",F,"\x1B]","8",";",";","\x07"].join("")}iz.exports={strlen:q8,repeat:w9,pad:qg,truncate:Ug,mergeOptions:Hg,wordWrap:_g,colorizeLines:Mg,hyperlink:Og}});var sz=w((IqD,rz)=>{var az={};rz.exports=az;var oz={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(oz).forEach(function(D){var F=oz[D],$=az[D]=[];$.open="\x1B["+F[0]+"m",$.close="\x1B["+F[1]+"m"})});var ez=w((wqD,tz)=>{tz.exports=function(D,F){F=F||process.argv;var $=F.indexOf("--"),J=/^-{1,2}/.test(D)?"":"--",Q=F.indexOf(J+D);return Q!==-1&&($===-1?!0:Q<$)}});var FC=w((NqD,DC)=>{var Eg=r("os"),b2=ez(),x0=process.env,$6=void 0;if(b2("no-color")||b2("no-colors")||b2("color=false"))$6=!1;else if(b2("color")||b2("colors")||b2("color=true")||b2("color=always"))$6=!0;if("FORCE_COLOR"in x0)$6=x0.FORCE_COLOR.length===0||parseInt(x0.FORCE_COLOR,10)!==0;function Rg(D){if(D===0)return!1;return{level:D,hasBasic:!0,has256:D>=2,has16m:D>=3}}function Ag(D){if($6===!1)return 0;if(b2("color=16m")||b2("color=full")||b2("color=truecolor"))return 3;if(b2("color=256"))return 2;if(D&&!D.isTTY&&$6!==!0)return 0;var F=$6?1:0;if(process.platform==="win32"){var $=Eg.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number($[0])>=10&&Number($[2])>=10586)return Number($[2])>=14931?3:2;return 1}if("CI"in x0){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(Q){return Q in x0})||x0.CI_NAME==="codeship")return 1;return F}if("TEAMCITY_VERSION"in x0)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(x0.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in x0){var J=parseInt((x0.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(x0.TERM_PROGRAM){case"iTerm.app":return J>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(x0.TERM))return 2;if(/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(x0.TERM))return 1;if("COLORTERM"in x0)return 1;if(x0.TERM==="dumb")return F;return F}function Uq(D){var F=Ag(D);return Rg(F)}DC.exports={supportsColor:Uq,stdout:Uq(process.stdout),stderr:Uq(process.stderr)}});var JC=w((TqD,$C)=>{$C.exports=function(F,$){var J="";F=F||"Run the trap, drop the bass",F=F.split("");var Q={a:["@","Ą","Ⱥ","Ʌ","Δ","Λ","Д"],b:["ß","Ɓ","Ƀ","ɮ","β","฿"],c:["©","Ȼ","Ͼ"],d:["Ð","Ɗ","Ԁ","ԁ","Ԃ","ԃ"],e:["Ë","ĕ","Ǝ","ɘ","Σ","ξ","Ҽ","੬"],f:["Ӻ"],g:["ɢ"],h:["Ħ","ƕ","Ң","Һ","Ӈ","Ԋ"],i:["༏"],j:["Ĵ"],k:["ĸ","Ҡ","Ӄ","Ԟ"],l:["Ĺ"],m:["ʍ","Ӎ","ӎ","Ԡ","ԡ","൩"],n:["Ñ","ŋ","Ɲ","Ͷ","Π","Ҋ"],o:["Ø","õ","ø","Ǿ","ʘ","Ѻ","ם","۝","๏"],p:["Ƿ","Ҏ"],q:["্"],r:["®","Ʀ","Ȑ","Ɍ","ʀ","Я"],s:["§","Ϟ","ϟ","Ϩ"],t:["Ł","Ŧ","ͳ"],u:["Ʊ","Ս"],v:["ט"],w:["Ш","Ѡ","Ѽ","൰"],x:["Ҳ","Ӿ","Ӽ","ӽ"],y:["¥","Ұ","Ӌ"],z:["Ƶ","ɀ"]};return F.forEach(function(Z){Z=Z.toLowerCase();var X=Q[Z]||[" "],Y=Math.floor(Math.random()*X.length);if(typeof Q[Z]<"u")J+=Q[Z][Y];else J+=Z}),J}});var ZC=w((LqD,QC)=>{QC.exports=function(F,$){F=F||" he is here ";var J={up:["̍","̎","̄","̅","̿","̑","̆","̐","͒","͗","͑","̇","̈","̊","͂","̓","̈","͊","͋","͌","̃","̂","̌","͐","̀","́","̋","̏","̒","̓","̔","̽","̉","ͣ","ͤ","ͥ","ͦ","ͧ","ͨ","ͩ","ͪ","ͫ","ͬ","ͭ","ͮ","ͯ","̾","͛","͆","̚"],down:["̖","̗","̘","̙","̜","̝","̞","̟","̠","̤","̥","̦","̩","̪","̫","̬","̭","̮","̯","̰","̱","̲","̳","̹","̺","̻","̼","ͅ","͇","͈","͉","͍","͎","͓","͔","͕","͖","͙","͚","̣"],mid:["̕","̛","̀","́","͘","̡","̢","̧","̨","̴","̵","̶","͜","͝","͞","͟","͠","͢","̸","̷","͡"," ҉"]},Q=[].concat(J.up,J.down,J.mid);function Z(q){var G=Math.floor(Math.random()*q);return G}function X(q){var G=!1;return Q.filter(function(B){G=B===q}),G}function Y(q,G){var B="",W,K;G=G||{},G.up=typeof G.up<"u"?G.up:!0,G.mid=typeof G.mid<"u"?G.mid:!0,G.down=typeof G.down<"u"?G.down:!0,G.size=typeof G.size<"u"?G.size:"maxi",q=q.split("");for(K in q){if(X(K))continue;switch(B=B+q[K],W={up:0,down:0,mid:0},G.size){case"mini":W.up=Z(8),W.mid=Z(2),W.down=Z(8);break;case"maxi":W.up=Z(16)+3,W.mid=Z(4)+1,W.down=Z(64)+3;break;default:W.up=Z(8)+1,W.mid=Z(6)/2,W.down=Z(8)+1;break}var U=["up","mid","down"];for(var V in U){var H=U[V];for(var z=0;z<=W[H];z++)if(G[H])B=B+J[H][Z(J[H].length)]}}return B}return Y(F,$)}});var YC=w((PqD,XC)=>{XC.exports=function(D){return function(F,$,J){if(F===" ")return F;switch($%3){case 0:return D.red(F);case 1:return D.white(F);case 2:return D.blue(F)}}}});var GC=w((jqD,qC)=>{qC.exports=function(D){return function(F,$,J){return $%2===0?F:D.inverse(F)}}});var WC=w((SqD,BC)=>{BC.exports=function(D){var F=["red","yellow","green","blue","magenta"];return function($,J,Q){if($===" ")return $;else return D[F[J++%F.length]]($)}}});var UC=w((xqD,KC)=>{KC.exports=function(D){var F=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function($,J,Q){return $===" "?$:D[F[Math.round(Math.random()*(F.length-2))]]($)}}});var _C=w((yqD,CC)=>{var YD={};CC.exports=YD;YD.themes={};var Ig=r("util"),kF=YD.styles=sz(),VC=Object.defineProperties,wg=new RegExp(/[\r\n]+/g);YD.supportsColor=FC().supportsColor;if(typeof YD.enabled>"u")YD.enabled=YD.supportsColor()!==!1;YD.enable=function(){YD.enabled=!0};YD.disable=function(){YD.enabled=!1};YD.stripColors=YD.strip=function(D){return(""+D).replace(/\x1B\[\d+m/g,"")};var kqD=YD.stylize=function(F,$){if(!YD.enabled)return F+"";var J=kF[$];if(!J&&$ in YD)return YD[$](F);return J.open+F+J.close},Ng=/[|\\{}()[\]^$+*?.]/g,Tg=function(D){if(typeof D!=="string")throw TypeError("Expected a string");return D.replace(Ng,"\\$&")};function HC(D){var F=function $(){return Pg.apply($,arguments)};return F._styles=D,F.__proto__=Lg,F}var zC=function(){var D={};return kF.grey=kF.gray,Object.keys(kF).forEach(function(F){kF[F].closeRe=new RegExp(Tg(kF[F].close),"g"),D[F]={get:function(){return HC(this._styles.concat(F))}}}),D}(),Lg=VC(function(){},zC);function Pg(){var D=Array.prototype.slice.call(arguments),F=D.map(function(X){if(X!=null&&X.constructor===String)return X;else return Ig.inspect(X)}).join(" ");if(!YD.enabled||!F)return F;var $=F.indexOf(`
30
+ `)!=-1,J=this._styles,Q=J.length;while(Q--){var Z=kF[J[Q]];if(F=Z.open+F.replace(Z.closeRe,Z.open)+Z.close,$)F=F.replace(wg,function(X){return Z.close+X+Z.open})}return F}YD.setTheme=function(D){if(typeof D==="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var F in D)(function($){YD[$]=function(J){if(typeof D[$]==="object"){var Q=J;for(var Z in D[$])Q=YD[D[$][Z]](Q);return Q}return YD[D[$]](J)}})(F)};function jg(){var D={};return Object.keys(zC).forEach(function(F){D[F]={get:function(){return HC([F])}}}),D}var Sg=function(F,$){var J=$.split("");return J=J.map(F),J.join("")};YD.trap=JC();YD.zalgo=ZC();YD.maps={};YD.maps.america=YC()(YD);YD.maps.zebra=GC()(YD);YD.maps.rainbow=WC()(YD);YD.maps.random=UC()(YD);for(Vq in YD.maps)(function(D){YD[D]=function(F){return Sg(YD.maps[D],F)}})(Vq);var Vq;VC(YD,jg())});var OC=w((fqD,MC)=>{var xg=_C();MC.exports=xg});var IC=w((bqD,R$)=>{var{info:kg,debug:AC}=_$(),Q2=Kq();class T9{constructor(D){this.setOptions(D),this.x=null,this.y=null}setOptions(D){if(["boolean","number","bigint","string"].indexOf(typeof D)!==-1)D={content:""+D};D=D||{},this.options=D;let F=D.content;if(["boolean","number","bigint","string"].indexOf(typeof F)!==-1)this.content=String(F);else if(!F)this.content=this.options.href||"";else throw Error("Content needs to be a primitive, got: "+typeof F);if(this.colSpan=D.colSpan||1,this.rowSpan=D.rowSpan||1,this.options.href)Object.defineProperty(this,"href",{get(){return this.options.href}})}mergeTableOptions(D,F){this.cells=F;let $=this.options.chars||{},J=D.chars,Q=this.chars={};fg.forEach(function(Y){Hq($,J,Y,Q)}),this.truncate=this.options.truncate||D.truncate;let Z=this.options.style=this.options.style||{},X=D.style;Hq(Z,X,"padding-left",this),Hq(Z,X,"padding-right",this),this.head=Z.head||X.head,this.border=Z.border||X.border,this.fixedWidth=D.colWidths[this.x],this.lines=this.computeLines(D),this.desiredWidth=Q2.strlen(this.content)+this.paddingLeft+this.paddingRight,this.desiredHeight=this.lines.length}computeLines(D){let F=D.wordWrap||D.textWrap,{wordWrap:$=F}=this.options;if(this.fixedWidth&&$){if(this.fixedWidth-=this.paddingLeft+this.paddingRight,this.colSpan){let Z=1;while(Z<this.colSpan)this.fixedWidth+=D.colWidths[this.x+Z],Z++}let{wrapOnWordBoundary:J=!0}=D,{wrapOnWordBoundary:Q=J}=this.options;return this.wrapLines(Q2.wordWrap(this.fixedWidth,this.content,Q))}return this.wrapLines(this.content.split(`
31
+ `))}wrapLines(D){let F=Q2.colorizeLines(D);if(this.href)return F.map(($)=>Q2.hyperlink(this.href,$));return F}init(D){let F=this.x,$=this.y;this.widths=D.colWidths.slice(F,F+this.colSpan),this.heights=D.rowHeights.slice($,$+this.rowSpan),this.width=this.widths.reduce(RC,-1),this.height=this.heights.reduce(RC,-1),this.hAlign=this.options.hAlign||D.colAligns[F],this.vAlign=this.options.vAlign||D.rowAligns[$],this.drawRight=F+this.colSpan==D.colWidths.length}draw(D,F){if(D=="top")return this.drawTop(this.drawRight);if(D=="bottom")return this.drawBottom(this.drawRight);let $=Q2.truncate(this.content,10,this.truncate);if(!D)kg(`${this.y}-${this.x}: ${this.rowSpan-D}x${this.colSpan} Cell ${$}`);let J=Math.max(this.height-this.lines.length,0),Q;switch(this.vAlign){case"center":Q=Math.ceil(J/2);break;case"bottom":Q=J;break;default:Q=0}if(D<Q||D>=Q+this.lines.length)return this.drawEmpty(this.drawRight,F);let Z=this.lines.length>this.height&&D+1>=this.height;return this.drawLine(D-Q,this.drawRight,Z,F)}drawTop(D){let F=[];if(this.cells)this.widths.forEach(function($,J){F.push(this._topLeftChar(J)),F.push(Q2.repeat(this.chars[this.y==0?"top":"mid"],$))},this);else F.push(this._topLeftChar(0)),F.push(Q2.repeat(this.chars[this.y==0?"top":"mid"],this.width));if(D)F.push(this.chars[this.y==0?"topRight":"rightMid"]);return this.wrapWithStyleColors("border",F.join(""))}_topLeftChar(D){let F=this.x+D,$;if(this.y==0)$=F==0?"topLeft":D==0?"topMid":"top";else if(F==0)$="leftMid";else if($=D==0?"midMid":"bottomMid",this.cells){if(this.cells[this.y-1][F]instanceof T9.ColSpanCell)$=D==0?"topMid":"mid";if(D==0){let Q=1;while(this.cells[this.y][F-Q]instanceof T9.ColSpanCell)Q++;if(this.cells[this.y][F-Q]instanceof T9.RowSpanCell)$="leftMid"}}return this.chars[$]}wrapWithStyleColors(D,F){if(this[D]&&this[D].length)try{let $=OC();for(let J=this[D].length-1;J>=0;J--)$=$[this[D][J]];return $(F)}catch($){return F}else return F}drawLine(D,F,$,J){let Q=this.chars[this.x==0?"left":"middle"];if(this.x&&J&&this.cells){let W=this.cells[this.y+J][this.x-1];while(W instanceof O$)W=this.cells[W.y][W.x-1];if(!(W instanceof E$))Q=this.chars.rightMid}let Z=Q2.repeat(" ",this.paddingLeft),X=F?this.chars.right:"",Y=Q2.repeat(" ",this.paddingRight),q=this.lines[D],G=this.width-(this.paddingLeft+this.paddingRight);if($)q+=this.truncate||"…";let B=Q2.truncate(q,G,this.truncate);return B=Q2.pad(B,G," ",this.hAlign),B=Z+B+Y,this.stylizeLine(Q,B,X)}stylizeLine(D,F,$){if(D=this.wrapWithStyleColors("border",D),$=this.wrapWithStyleColors("border",$),this.y===0)F=this.wrapWithStyleColors("head",F);return D+F+$}drawBottom(D){let F=this.chars[this.x==0?"bottomLeft":"bottomMid"],$=Q2.repeat(this.chars.bottom,this.width),J=D?this.chars.bottomRight:"";return this.wrapWithStyleColors("border",F+$+J)}drawEmpty(D,F){let $=this.chars[this.x==0?"left":"middle"];if(this.x&&F&&this.cells){let Z=this.cells[this.y+F][this.x-1];while(Z instanceof O$)Z=this.cells[Z.y][Z.x-1];if(!(Z instanceof E$))$=this.chars.rightMid}let J=D?this.chars.right:"",Q=Q2.repeat(" ",this.width);return this.stylizeLine($,Q,J)}}class O${constructor(){}draw(D){if(typeof D==="number")AC(`${this.y}-${this.x}: 1x1 ColSpanCell`);return""}init(){}mergeTableOptions(){}}class E${constructor(D){this.originalCell=D}init(D){let F=this.y,$=this.originalCell.y;this.cellOffset=F-$,this.offset=yg(D.rowHeights,$,this.cellOffset)}draw(D){if(D=="top")return this.originalCell.draw(this.offset,this.cellOffset);if(D=="bottom")return this.originalCell.draw("bottom");return AC(`${this.y}-${this.x}: 1x${this.colSpan} RowSpanCell for ${this.originalCell.content}`),this.originalCell.draw(this.offset+1+D)}mergeTableOptions(){}}function EC(...D){return D.filter((F)=>F!==void 0&&F!==null).shift()}function Hq(D,F,$,J){let Q=$.split("-");if(Q.length>1)Q[1]=Q[1].charAt(0).toUpperCase()+Q[1].substr(1),Q=Q.join(""),J[Q]=EC(D[Q],D[$],F[Q],F[$]);else J[$]=EC(D[$],F[$])}function yg(D,F,$){let J=D[F];for(let Q=1;Q<$;Q++)J+=1+D[F+Q];return J}function RC(D,F){return D+F+1}var fg=["top","top-mid","top-left","top-right","bottom","bottom-mid","bottom-left","bottom-right","left","left-mid","mid","mid-mid","right","right-mid","middle"];R$.exports=T9;R$.exports.ColSpanCell=O$;R$.exports.RowSpanCell=E$});var TC=w((vqD,NC)=>{var{warn:bg,debug:vg}=_$(),zq=IC(),{ColSpanCell:hg,RowSpanCell:ug}=zq;(function(){function D(U,V){if(U[V]>0)return D(U,V+1);return V}function F(U){let V={};U.forEach(function(H,z){let _=0;H.forEach(function(O){O.y=z,O.x=z?D(V,_):_;let C=O.rowSpan||1,M=O.colSpan||1;if(C>1)for(let E=0;E<M;E++)V[O.x+E]=C;_=O.x+M}),Object.keys(V).forEach((O)=>{if(V[O]--,V[O]<1)delete V[O]})})}function $(U){let V=0;return U.forEach(function(H){H.forEach(function(z){V=Math.max(V,z.x+(z.colSpan||1))})}),V}function J(U){return U.length}function Q(U,V){let H=U.y,z=U.y-1+(U.rowSpan||1),_=V.y,O=V.y-1+(V.rowSpan||1),C=!(H>O||_>z),M=U.x,E=U.x-1+(U.colSpan||1),A=V.x,I=V.x-1+(V.colSpan||1),R=!(M>I||A>E);return C&&R}function Z(U,V,H){let z=Math.min(U.length-1,H),_={x:V,y:H};for(let O=0;O<=z;O++){let C=U[O];for(let M=0;M<C.length;M++)if(Q(_,C[M]))return!0}return!1}function X(U,V,H,z){for(let _=H;_<z;_++)if(Z(U,_,V))return!1;return!0}function Y(U){U.forEach(function(V,H){V.forEach(function(z){for(let _=1;_<z.rowSpan;_++){let O=new ug(z);O.x=z.x,O.y=z.y+_,O.colSpan=z.colSpan,G(O,U[H+_])}})})}function q(U){for(let V=U.length-1;V>=0;V--){let H=U[V];for(let z=0;z<H.length;z++){let _=H[z];for(let O=1;O<_.colSpan;O++){let C=new hg;C.x=_.x+O,C.y=_.y,H.splice(z+1,0,C)}}}}function G(U,V){let H=0;while(H<V.length&&V[H].x<U.x)H++;V.splice(H,0,U)}function B(U){let V=J(U),H=$(U);vg(`Max rows: ${V}; Max cols: ${H}`);for(let z=0;z<V;z++)for(let _=0;_<H;_++)if(!Z(U,_,z)){let O={x:_,y:z,colSpan:1,rowSpan:1};_++;while(_<H&&!Z(U,_,z))O.colSpan++,_++;let C=z+1;while(C<V&&X(U,C,O.x,O.x+O.colSpan))O.rowSpan++,C++;let M=new zq(O);M.x=O.x,M.y=O.y,bg(`Missing cell at ${M.y}-${M.x}.`),G(M,U[z])}}function W(U){return U.map(function(V){if(!Array.isArray(V)){let H=Object.keys(V)[0];if(V=V[H],Array.isArray(V))V=V.slice(),V.unshift(H);else V=[H,V]}return V.map(function(H){return new zq(H)})})}function K(U){let V=W(U);return F(V),B(V),Y(V),q(V),V}NC.exports={makeTableLayout:K,layoutTable:F,addRowSpanCells:Y,maxWidth:$,fillInTable:B,computeWidths:wC("colSpan","desiredWidth","x",1),computeHeights:wC("rowSpan","desiredHeight","y",1)}})();function wC(D,F,$,J){return function(Q,Z){let X=[],Y=[],q={};Z.forEach(function(G){G.forEach(function(B){if((B[D]||1)>1)Y.push(B);else X[B[$]]=Math.max(X[B[$]]||0,B[F]||0,J)})}),Q.forEach(function(G,B){if(typeof G==="number")X[B]=G});for(let G=Y.length-1;G>=0;G--){let B=Y[G],W=B[D],K=B[$],U=X[K],V=typeof Q[K]==="number"?0:1;if(typeof U==="number"){for(let H=1;H<W;H++)if(U+=1+X[K+H],typeof Q[K+H]!=="number")V++}else if(U=F==="desiredWidth"?B.desiredWidth-1:1,!q[K]||q[K]<U)q[K]=U;if(B[F]>U){let H=0;while(V>0&&B[F]>U){if(typeof Q[K+H]!=="number"){let z=Math.round((B[F]-U)/V);U+=z,X[K+H]+=z,V--}H++}}}Object.assign(Q,X,q);for(let G=0;G<Q.length;G++)Q[G]=Math.max(J,Q[G]||0)}}});var Oq=w((hqD,LC)=>{var i8=_$(),gg=Kq(),Cq=TC();class Mq extends Array{constructor(D){super();let F=gg.mergeOptions(D);if(Object.defineProperty(this,"options",{value:F,enumerable:F.debug}),F.debug){switch(typeof F.debug){case"boolean":i8.setDebugLevel(i8.WARN);break;case"number":i8.setDebugLevel(F.debug);break;case"string":i8.setDebugLevel(parseInt(F.debug,10));break;default:i8.setDebugLevel(i8.WARN),i8.warn(`Debug option is expected to be boolean, number, or string. Received a ${typeof F.debug}`)}Object.defineProperty(this,"messages",{get(){return i8.debugMessages()}})}}toString(){let D=this,F=this.options.head&&this.options.head.length;if(F){if(D=[this.options.head],this.length)D.push.apply(D,this)}else this.options.style.head=[];let $=Cq.makeTableLayout(D);$.forEach(function(Q){Q.forEach(function(Z){Z.mergeTableOptions(this.options,$)},this)},this),Cq.computeWidths(this.options.colWidths,$),Cq.computeHeights(this.options.rowHeights,$),$.forEach(function(Q){Q.forEach(function(Z){Z.init(this.options)},this)},this);let J=[];for(let Q=0;Q<$.length;Q++){let Z=$[Q],X=this.options.rowHeights[Q];if(Q===0||!this.options.style.compact||Q==1&&F)_q(Z,"top",J);for(let Y=0;Y<X;Y++)_q(Z,Y,J);if(Q+1==$.length)_q(Z,"bottom",J)}return J.join(`
32
32
  `)}get width(){return this.toString().split(`
33
- `)[0].length}}Mq.reset=()=>i8.reset();function _q(D,F,$){let J=[];D.forEach(function(Z){J.push(Z.draw(F))});let Q=J.join("");if(Q.length)$.push(Q)}LC.exports=Mq});var B_=I((CBD,G_)=>{G_.exports=q_;q_.sync=mm;var X_=r("fs");function gm(D,F){var $=F.pathExt!==void 0?F.pathExt:process.env.PATHEXT;if(!$)return!0;if($=$.split(";"),$.indexOf("")!==-1)return!0;for(var J=0;J<$.length;J++){var Q=$[J].toLowerCase();if(Q&&D.substr(-Q.length).toLowerCase()===Q)return!0}return!1}function Y_(D,F,$){if(!D.isSymbolicLink()&&!D.isFile())return!1;return gm(F,$)}function q_(D,F,$){X_.stat(D,function(J,Q){$(J,J?!1:Y_(Q,D,F))})}function mm(D,F){return Y_(X_.statSync(D),D,F)}});var H_=I((_BD,V_)=>{V_.exports=K_;K_.sync=dm;var W_=r("fs");function K_(D,F,$){W_.stat(D,function(J,Q){$(J,J?!1:U_(Q,F))})}function dm(D,F){return U_(W_.statSync(D),F)}function U_(D,F){return D.isFile()&&pm(D,F)}function pm(D,F){var{mode:$,uid:J,gid:Q}=D,Z=F.uid!==void 0?F.uid:process.getuid&&process.getuid(),X=F.gid!==void 0?F.gid:process.getgid&&process.getgid(),Y=parseInt("100",8),q=parseInt("010",8),G=parseInt("001",8),B=Y|q,W=$&G||$&q&&Q===X||$&Y&&J===Z||$&B&&Z===0;return W}});var C_=I((OBD,z_)=>{var MBD=r("fs"),f$;if(process.platform==="win32"||global.TESTING_WINDOWS)f$=B_();else f$=H_();z_.exports=jq;jq.sync=lm;function jq(D,F,$){if(typeof F==="function")$=F,F={};if(!$){if(typeof Promise!=="function")throw TypeError("callback not provided");return new Promise(function(J,Q){jq(D,F||{},function(Z,X){if(Z)Q(Z);else J(X)})})}f$(D,F||{},function(J,Q){if(J){if(J.code==="EACCES"||F&&F.ignoreErrors)J=null,Q=!1}$(J,Q)})}function lm(D,F){try{return f$.sync(D,F||{})}catch($){if(F&&F.ignoreErrors||$.code==="EACCES")return!1;else throw $}}});var I_=I((EBD,A_)=>{var X6=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",__=r("path"),cm=X6?";":":",M_=C_(),O_=(D)=>Object.assign(Error(`not found: ${D}`),{code:"ENOENT"}),E_=(D,F)=>{let $=F.colon||cm,J=D.match(/\//)||X6&&D.match(/\\/)?[""]:[...X6?[process.cwd()]:[],...(F.path||process.env.PATH||"").split($)],Q=X6?F.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",Z=X6?Q.split($):[""];if(X6){if(D.indexOf(".")!==-1&&Z[0]!=="")Z.unshift("")}return{pathEnv:J,pathExt:Z,pathExtExe:Q}},R_=(D,F,$)=>{if(typeof F==="function")$=F,F={};if(!F)F={};let{pathEnv:J,pathExt:Q,pathExtExe:Z}=E_(D,F),X=[],Y=(G)=>new Promise((B,W)=>{if(G===J.length)return F.all&&X.length?B(X):W(O_(D));let K=J[G],U=/^".*"$/.test(K)?K.slice(1,-1):K,V=__.join(U,D),H=!U&&/^\.[\\\/]/.test(D)?D.slice(0,2)+V:V;B(q(H,G,0))}),q=(G,B,W)=>new Promise((K,U)=>{if(W===Q.length)return K(Y(B+1));let V=Q[W];M_(G+V,{pathExt:Z},(H,z)=>{if(!H&&z)if(F.all)X.push(G+V);else return K(G+V);return K(q(G,B,W+1))})});return $?Y(0).then((G)=>$(null,G),$):Y(0)},nm=(D,F)=>{F=F||{};let{pathEnv:$,pathExt:J,pathExtExe:Q}=E_(D,F),Z=[];for(let X=0;X<$.length;X++){let Y=$[X],q=/^".*"$/.test(Y)?Y.slice(1,-1):Y,G=__.join(q,D),B=!q&&/^\.[\\\/]/.test(D)?D.slice(0,2)+G:G;for(let W=0;W<J.length;W++){let K=B+J[W];try{if(M_.sync(K,{pathExt:Q}))if(F.all)Z.push(K);else return K}catch(U){}}}if(F.all&&Z.length)return Z;if(F.nothrow)return null;throw O_(D)};A_.exports=R_;R_.sync=nm});var N_=I((RBD,Sq)=>{var w_=(D={})=>{let F=D.env||process.env;if((D.platform||process.platform)!=="win32")return"PATH";return Object.keys(F).reverse().find((J)=>J.toUpperCase()==="PATH")||"Path"};Sq.exports=w_;Sq.exports.default=w_});var j_=I((ABD,P_)=>{var T_=r("path"),im=I_(),om=N_();function L_(D,F){let $=D.options.env||process.env,J=process.cwd(),Q=D.options.cwd!=null,Z=Q&&process.chdir!==void 0&&!process.chdir.disabled;if(Z)try{process.chdir(D.options.cwd)}catch(Y){}let X;try{X=im.sync(D.command,{path:$[om({env:$})],pathExt:F?T_.delimiter:void 0})}catch(Y){}finally{if(Z)process.chdir(J)}if(X)X=T_.resolve(Q?D.options.cwd:"",X);return X}function am(D){return L_(D)||L_(D,!0)}P_.exports=am});var S_=I((tm,kq)=>{var xq=/([()\][%!^"`<>&|;, *?])/g;function rm(D){return D=D.replace(xq,"^$1"),D}function sm(D,F){if(D=`${D}`,D=D.replace(/(?=(\\+?)?)\1"/g,"$1$1\\\""),D=D.replace(/(?=(\\+?)?)\1$/,"$1$1"),D=`"${D}"`,D=D.replace(xq,"^$1"),F)D=D.replace(xq,"^$1");return D}tm.command=rm;tm.argument=sm});var k_=I((IBD,x_)=>{x_.exports=/^#!(.*)/});var f_=I((wBD,y_)=>{var Fd=k_();y_.exports=(D="")=>{let F=D.match(Fd);if(!F)return null;let[$,J]=F[0].replace(/#! ?/,"").split(" "),Q=$.split("/").pop();if(Q==="env")return J;return J?`${Q} ${J}`:Q}});var v_=I((NBD,b_)=>{var yq=r("fs"),$d=f_();function Jd(D){let $=Buffer.alloc(150),J;try{J=yq.openSync(D,"r"),yq.readSync(J,$,0,150,0),yq.closeSync(J)}catch(Q){}return $d($.toString())}b_.exports=Jd});var m_=I((TBD,g_)=>{var Qd=r("path"),h_=j_(),u_=S_(),Zd=v_(),Xd=process.platform==="win32",Yd=/\.(?:com|exe)$/i,qd=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Gd(D){D.file=h_(D);let F=D.file&&Zd(D.file);if(F)return D.args.unshift(D.file),D.command=F,h_(D);return D.file}function Bd(D){if(!Xd)return D;let F=Gd(D),$=!Yd.test(F);if(D.options.forceShell||$){let J=qd.test(F);D.command=Qd.normalize(D.command),D.command=u_.command(D.command),D.args=D.args.map((Z)=>u_.argument(Z,J));let Q=[D.command].concat(D.args).join(" ");D.args=["/d","/s","/c",`"${Q}"`],D.command=process.env.comspec||"cmd.exe",D.options.windowsVerbatimArguments=!0}return D}function Wd(D,F,$){if(F&&!Array.isArray(F))$=F,F=null;F=F?F.slice(0):[],$=Object.assign({},$);let J={command:D,args:F,options:$,file:void 0,original:{command:D,args:F}};return $.shell?J:Bd(J)}g_.exports=Wd});var l_=I((LBD,p_)=>{var fq=process.platform==="win32";function bq(D,F){return Object.assign(Error(`${F} ${D.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${F} ${D.command}`,path:D.command,spawnargs:D.args})}function Kd(D,F){if(!fq)return;let $=D.emit;D.emit=function(J,Q){if(J==="exit"){let Z=d_(Q,F);if(Z)return $.call(D,"error",Z)}return $.apply(D,arguments)}}function d_(D,F){if(fq&&D===1&&!F.file)return bq(F.original,"spawn");return null}function Ud(D,F){if(fq&&D===1&&!F.file)return bq(F.original,"spawnSync");return null}p_.exports={hookChildProcess:Kd,verifyENOENT:d_,verifyENOENTSync:Ud,notFoundError:bq}});var i_=I((PBD,Y6)=>{var c_=r("child_process"),vq=m_(),hq=l_();function n_(D,F,$){let J=vq(D,F,$),Q=c_.spawn(J.command,J.args,J.options);return hq.hookChildProcess(Q,J),Q}function Vd(D,F,$){let J=vq(D,F,$),Q=c_.spawnSync(J.command,J.args,J.options);return Q.error=Q.error||hq.verifyENOENTSync(Q.status,J),Q}Y6.exports=n_;Y6.exports.spawn=n_;Y6.exports.sync=Vd;Y6.exports._parse=vq;Y6.exports._enoent=hq});var mF;var sE=x(()=>{mF=[];mF.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")mF.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")mF.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});class tE{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(NG[wG])return NG[wG];Qi(NG,wG,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(D,F){this.listeners[D].push(F)}removeListener(D,F){let $=this.listeners[D],J=$.indexOf(F);if(J===-1)return;if(J===0&&$.length===1)$.length=0;else $.splice(J,1)}emit(D,F,$){if(this.emitted[D])return!1;this.emitted[D]=!0;let J=!1;for(let Q of this.listeners[D])J=Q(F,$)===!0||J;if(D==="exit")J=this.emit("afterExit",F,$)||J;return J}}class LG{}var AJ=(D)=>!!D&&typeof D==="object"&&typeof D.removeListener==="function"&&typeof D.emit==="function"&&typeof D.reallyExit==="function"&&typeof D.listeners==="function"&&typeof D.kill==="function"&&typeof D.pid==="number"&&typeof D.on==="function",wG,NG,Qi,Zi=(D)=>{return{onExit(F,$){return D.onExit(F,$)},load(){return D.load()},unload(){return D.unload()}}},eE,DR,TG,C6,vzD,hzD;var IJ=x(()=>{sE();wG=Symbol.for("signal-exit emitter"),NG=globalThis,Qi=Object.defineProperty.bind(Object);eE=class eE extends LG{onExit(){return()=>{}}load(){}unload(){}};DR=class DR extends LG{#J=TG.platform==="win32"?"SIGINT":"SIGHUP";#$=new tE;#F;#D;#Z;#Q={};#X=!1;constructor(D){super();this.#F=D,this.#Q={};for(let F of mF)this.#Q[F]=()=>{let $=this.#F.listeners(F),{count:J}=this.#$,Q=D;if(typeof Q.__signal_exit_emitter__==="object"&&typeof Q.__signal_exit_emitter__.count==="number")J+=Q.__signal_exit_emitter__.count;if($.length===J){this.unload();let Z=this.#$.emit("exit",null,F),X=F==="SIGHUP"?this.#J:F;if(!Z)D.kill(D.pid,X)}};this.#Z=D.reallyExit,this.#D=D.emit}onExit(D,F){if(!AJ(this.#F))return()=>{};if(this.#X===!1)this.load();let $=F?.alwaysLast?"afterExit":"exit";return this.#$.on($,D),()=>{if(this.#$.removeListener($,D),this.#$.listeners.exit.length===0&&this.#$.listeners.afterExit.length===0)this.unload()}}load(){if(this.#X)return;this.#X=!0,this.#$.count+=1;for(let D of mF)try{let F=this.#Q[D];if(F)this.#F.on(D,F)}catch(F){}this.#F.emit=(D,...F)=>{return this.#W(D,...F)},this.#F.reallyExit=(D)=>{return this.#q(D)}}unload(){if(!this.#X)return;this.#X=!1,mF.forEach((D)=>{let F=this.#Q[D];if(!F)throw Error("Listener not defined for signal: "+D);try{this.#F.removeListener(D,F)}catch($){}}),this.#F.emit=this.#D,this.#F.reallyExit=this.#Z,this.#$.count-=1}#q(D){if(!AJ(this.#F))return 0;return this.#F.exitCode=D||0,this.#$.emit("exit",this.#F.exitCode,null),this.#Z.call(this.#F,this.#F.exitCode)}#W(D,...F){let $=this.#D;if(D==="exit"&&AJ(this.#F)){if(typeof F[0]==="number")this.#F.exitCode=F[0];let J=$.call(this.#F,D,...F);return this.#$.emit("exit",this.#F.exitCode,null),J}else return $.call(this.#F,D,...F)}};TG=globalThis.process,{onExit:C6,load:vzD,unload:hzD}=Zi(AJ(TG)?new DR(TG):new eE)});var mR="1.2.3";var uD;var M6=x(()=>{uD=class uD extends Error{constructor(D,F={}){let $=F.cause instanceof uD?F.cause.details:F.cause?.message?F.cause.message:F.details,J=F.cause instanceof uD?F.cause.docsPath||F.docsPath:F.docsPath,Q=[D||"An error occurred.","",...F.metaMessages?[...F.metaMessages,""]:[],...J?[`Docs: https://abitype.dev${J}`]:[],...$?[`Details: ${$}`]:[],`Version: abitype@${mR}`].join(`
33
+ `)[0].length}}Mq.reset=()=>i8.reset();function _q(D,F,$){let J=[];D.forEach(function(Z){J.push(Z.draw(F))});let Q=J.join("");if(Q.length)$.push(Q)}LC.exports=Mq});var B_=w((CBD,G_)=>{G_.exports=q_;q_.sync=mm;var X_=r("fs");function gm(D,F){var $=F.pathExt!==void 0?F.pathExt:process.env.PATHEXT;if(!$)return!0;if($=$.split(";"),$.indexOf("")!==-1)return!0;for(var J=0;J<$.length;J++){var Q=$[J].toLowerCase();if(Q&&D.substr(-Q.length).toLowerCase()===Q)return!0}return!1}function Y_(D,F,$){if(!D.isSymbolicLink()&&!D.isFile())return!1;return gm(F,$)}function q_(D,F,$){X_.stat(D,function(J,Q){$(J,J?!1:Y_(Q,D,F))})}function mm(D,F){return Y_(X_.statSync(D),D,F)}});var H_=w((_BD,V_)=>{V_.exports=K_;K_.sync=dm;var W_=r("fs");function K_(D,F,$){W_.stat(D,function(J,Q){$(J,J?!1:U_(Q,F))})}function dm(D,F){return U_(W_.statSync(D),F)}function U_(D,F){return D.isFile()&&pm(D,F)}function pm(D,F){var{mode:$,uid:J,gid:Q}=D,Z=F.uid!==void 0?F.uid:process.getuid&&process.getuid(),X=F.gid!==void 0?F.gid:process.getgid&&process.getgid(),Y=parseInt("100",8),q=parseInt("010",8),G=parseInt("001",8),B=Y|q,W=$&G||$&q&&Q===X||$&Y&&J===Z||$&B&&Z===0;return W}});var C_=w((OBD,z_)=>{var MBD=r("fs"),f$;if(process.platform==="win32"||global.TESTING_WINDOWS)f$=B_();else f$=H_();z_.exports=jq;jq.sync=lm;function jq(D,F,$){if(typeof F==="function")$=F,F={};if(!$){if(typeof Promise!=="function")throw TypeError("callback not provided");return new Promise(function(J,Q){jq(D,F||{},function(Z,X){if(Z)Q(Z);else J(X)})})}f$(D,F||{},function(J,Q){if(J){if(J.code==="EACCES"||F&&F.ignoreErrors)J=null,Q=!1}$(J,Q)})}function lm(D,F){try{return f$.sync(D,F||{})}catch($){if(F&&F.ignoreErrors||$.code==="EACCES")return!1;else throw $}}});var I_=w((EBD,A_)=>{var X6=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",__=r("path"),cm=X6?";":":",M_=C_(),O_=(D)=>Object.assign(Error(`not found: ${D}`),{code:"ENOENT"}),E_=(D,F)=>{let $=F.colon||cm,J=D.match(/\//)||X6&&D.match(/\\/)?[""]:[...X6?[process.cwd()]:[],...(F.path||process.env.PATH||"").split($)],Q=X6?F.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",Z=X6?Q.split($):[""];if(X6){if(D.indexOf(".")!==-1&&Z[0]!=="")Z.unshift("")}return{pathEnv:J,pathExt:Z,pathExtExe:Q}},R_=(D,F,$)=>{if(typeof F==="function")$=F,F={};if(!F)F={};let{pathEnv:J,pathExt:Q,pathExtExe:Z}=E_(D,F),X=[],Y=(G)=>new Promise((B,W)=>{if(G===J.length)return F.all&&X.length?B(X):W(O_(D));let K=J[G],U=/^".*"$/.test(K)?K.slice(1,-1):K,V=__.join(U,D),H=!U&&/^\.[\\\/]/.test(D)?D.slice(0,2)+V:V;B(q(H,G,0))}),q=(G,B,W)=>new Promise((K,U)=>{if(W===Q.length)return K(Y(B+1));let V=Q[W];M_(G+V,{pathExt:Z},(H,z)=>{if(!H&&z)if(F.all)X.push(G+V);else return K(G+V);return K(q(G,B,W+1))})});return $?Y(0).then((G)=>$(null,G),$):Y(0)},nm=(D,F)=>{F=F||{};let{pathEnv:$,pathExt:J,pathExtExe:Q}=E_(D,F),Z=[];for(let X=0;X<$.length;X++){let Y=$[X],q=/^".*"$/.test(Y)?Y.slice(1,-1):Y,G=__.join(q,D),B=!q&&/^\.[\\\/]/.test(D)?D.slice(0,2)+G:G;for(let W=0;W<J.length;W++){let K=B+J[W];try{if(M_.sync(K,{pathExt:Q}))if(F.all)Z.push(K);else return K}catch(U){}}}if(F.all&&Z.length)return Z;if(F.nothrow)return null;throw O_(D)};A_.exports=R_;R_.sync=nm});var N_=w((RBD,Sq)=>{var w_=(D={})=>{let F=D.env||process.env;if((D.platform||process.platform)!=="win32")return"PATH";return Object.keys(F).reverse().find((J)=>J.toUpperCase()==="PATH")||"Path"};Sq.exports=w_;Sq.exports.default=w_});var j_=w((ABD,P_)=>{var T_=r("path"),im=I_(),om=N_();function L_(D,F){let $=D.options.env||process.env,J=process.cwd(),Q=D.options.cwd!=null,Z=Q&&process.chdir!==void 0&&!process.chdir.disabled;if(Z)try{process.chdir(D.options.cwd)}catch(Y){}let X;try{X=im.sync(D.command,{path:$[om({env:$})],pathExt:F?T_.delimiter:void 0})}catch(Y){}finally{if(Z)process.chdir(J)}if(X)X=T_.resolve(Q?D.options.cwd:"",X);return X}function am(D){return L_(D)||L_(D,!0)}P_.exports=am});var S_=w((tm,kq)=>{var xq=/([()\][%!^"`<>&|;, *?])/g;function rm(D){return D=D.replace(xq,"^$1"),D}function sm(D,F){if(D=`${D}`,D=D.replace(/(?=(\\+?)?)\1"/g,"$1$1\\\""),D=D.replace(/(?=(\\+?)?)\1$/,"$1$1"),D=`"${D}"`,D=D.replace(xq,"^$1"),F)D=D.replace(xq,"^$1");return D}tm.command=rm;tm.argument=sm});var k_=w((IBD,x_)=>{x_.exports=/^#!(.*)/});var f_=w((wBD,y_)=>{var Fd=k_();y_.exports=(D="")=>{let F=D.match(Fd);if(!F)return null;let[$,J]=F[0].replace(/#! ?/,"").split(" "),Q=$.split("/").pop();if(Q==="env")return J;return J?`${Q} ${J}`:Q}});var v_=w((NBD,b_)=>{var yq=r("fs"),$d=f_();function Jd(D){let $=Buffer.alloc(150),J;try{J=yq.openSync(D,"r"),yq.readSync(J,$,0,150,0),yq.closeSync(J)}catch(Q){}return $d($.toString())}b_.exports=Jd});var m_=w((TBD,g_)=>{var Qd=r("path"),h_=j_(),u_=S_(),Zd=v_(),Xd=process.platform==="win32",Yd=/\.(?:com|exe)$/i,qd=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Gd(D){D.file=h_(D);let F=D.file&&Zd(D.file);if(F)return D.args.unshift(D.file),D.command=F,h_(D);return D.file}function Bd(D){if(!Xd)return D;let F=Gd(D),$=!Yd.test(F);if(D.options.forceShell||$){let J=qd.test(F);D.command=Qd.normalize(D.command),D.command=u_.command(D.command),D.args=D.args.map((Z)=>u_.argument(Z,J));let Q=[D.command].concat(D.args).join(" ");D.args=["/d","/s","/c",`"${Q}"`],D.command=process.env.comspec||"cmd.exe",D.options.windowsVerbatimArguments=!0}return D}function Wd(D,F,$){if(F&&!Array.isArray(F))$=F,F=null;F=F?F.slice(0):[],$=Object.assign({},$);let J={command:D,args:F,options:$,file:void 0,original:{command:D,args:F}};return $.shell?J:Bd(J)}g_.exports=Wd});var l_=w((LBD,p_)=>{var fq=process.platform==="win32";function bq(D,F){return Object.assign(Error(`${F} ${D.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${F} ${D.command}`,path:D.command,spawnargs:D.args})}function Kd(D,F){if(!fq)return;let $=D.emit;D.emit=function(J,Q){if(J==="exit"){let Z=d_(Q,F);if(Z)return $.call(D,"error",Z)}return $.apply(D,arguments)}}function d_(D,F){if(fq&&D===1&&!F.file)return bq(F.original,"spawn");return null}function Ud(D,F){if(fq&&D===1&&!F.file)return bq(F.original,"spawnSync");return null}p_.exports={hookChildProcess:Kd,verifyENOENT:d_,verifyENOENTSync:Ud,notFoundError:bq}});var i_=w((PBD,Y6)=>{var c_=r("child_process"),vq=m_(),hq=l_();function n_(D,F,$){let J=vq(D,F,$),Q=c_.spawn(J.command,J.args,J.options);return hq.hookChildProcess(Q,J),Q}function Vd(D,F,$){let J=vq(D,F,$),Q=c_.spawnSync(J.command,J.args,J.options);return Q.error=Q.error||hq.verifyENOENTSync(Q.status,J),Q}Y6.exports=n_;Y6.exports.spawn=n_;Y6.exports.sync=Vd;Y6.exports._parse=vq;Y6.exports._enoent=hq});var mF;var sE=x(()=>{mF=[];mF.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")mF.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")mF.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});class tE{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(NG[wG])return NG[wG];Qi(NG,wG,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(D,F){this.listeners[D].push(F)}removeListener(D,F){let $=this.listeners[D],J=$.indexOf(F);if(J===-1)return;if(J===0&&$.length===1)$.length=0;else $.splice(J,1)}emit(D,F,$){if(this.emitted[D])return!1;this.emitted[D]=!0;let J=!1;for(let Q of this.listeners[D])J=Q(F,$)===!0||J;if(D==="exit")J=this.emit("afterExit",F,$)||J;return J}}class LG{}var AJ=(D)=>!!D&&typeof D==="object"&&typeof D.removeListener==="function"&&typeof D.emit==="function"&&typeof D.reallyExit==="function"&&typeof D.listeners==="function"&&typeof D.kill==="function"&&typeof D.pid==="number"&&typeof D.on==="function",wG,NG,Qi,Zi=(D)=>{return{onExit(F,$){return D.onExit(F,$)},load(){return D.load()},unload(){return D.unload()}}},eE,DR,TG,C6,vzD,hzD;var IJ=x(()=>{sE();wG=Symbol.for("signal-exit emitter"),NG=globalThis,Qi=Object.defineProperty.bind(Object);eE=class eE extends LG{onExit(){return()=>{}}load(){}unload(){}};DR=class DR extends LG{#J=TG.platform==="win32"?"SIGINT":"SIGHUP";#$=new tE;#F;#D;#Z;#Q={};#X=!1;constructor(D){super();this.#F=D,this.#Q={};for(let F of mF)this.#Q[F]=()=>{let $=this.#F.listeners(F),{count:J}=this.#$,Q=D;if(typeof Q.__signal_exit_emitter__==="object"&&typeof Q.__signal_exit_emitter__.count==="number")J+=Q.__signal_exit_emitter__.count;if($.length===J){this.unload();let Z=this.#$.emit("exit",null,F),X=F==="SIGHUP"?this.#J:F;if(!Z)D.kill(D.pid,X)}};this.#Z=D.reallyExit,this.#D=D.emit}onExit(D,F){if(!AJ(this.#F))return()=>{};if(this.#X===!1)this.load();let $=F?.alwaysLast?"afterExit":"exit";return this.#$.on($,D),()=>{if(this.#$.removeListener($,D),this.#$.listeners.exit.length===0&&this.#$.listeners.afterExit.length===0)this.unload()}}load(){if(this.#X)return;this.#X=!0,this.#$.count+=1;for(let D of mF)try{let F=this.#Q[D];if(F)this.#F.on(D,F)}catch(F){}this.#F.emit=(D,...F)=>{return this.#W(D,...F)},this.#F.reallyExit=(D)=>{return this.#q(D)}}unload(){if(!this.#X)return;this.#X=!1,mF.forEach((D)=>{let F=this.#Q[D];if(!F)throw Error("Listener not defined for signal: "+D);try{this.#F.removeListener(D,F)}catch($){}}),this.#F.emit=this.#D,this.#F.reallyExit=this.#Z,this.#$.count-=1}#q(D){if(!AJ(this.#F))return 0;return this.#F.exitCode=D||0,this.#$.emit("exit",this.#F.exitCode,null),this.#Z.call(this.#F,this.#F.exitCode)}#W(D,...F){let $=this.#D;if(D==="exit"&&AJ(this.#F)){if(typeof F[0]==="number")this.#F.exitCode=F[0];let J=$.call(this.#F,D,...F);return this.#$.emit("exit",this.#F.exitCode,null),J}else return $.call(this.#F,D,...F)}};TG=globalThis.process,{onExit:C6,load:vzD,unload:hzD}=Zi(AJ(TG)?new DR(TG):new eE)});var mR="1.2.3";var uD;var M6=x(()=>{uD=class uD extends Error{constructor(D,F={}){let $=F.cause instanceof uD?F.cause.details:F.cause?.message?F.cause.message:F.details,J=F.cause instanceof uD?F.cause.docsPath||F.docsPath:F.docsPath,Q=[D||"An error occurred.","",...F.metaMessages?[...F.metaMessages,""]:[],...J?[`Docs: https://abitype.dev${J}`]:[],...$?[`Details: ${$}`]:[],`Version: abitype@${mR}`].join(`
34
34
  `);super(Q);if(Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),F.cause)this.cause=F.cause;this.details=$,this.docsPath=J,this.metaMessages=F.metaMessages,this.shortMessage=D}}});function Y2(D,F){return D.exec(F)?.groups}var oG,aG,xJ;var p9=x(()=>{oG=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,aG=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,xJ=/^\(.+?\).*?$/});function kJ(D){let F=D.type;if(dR.test(D.type)&&"components"in D){F="(";let $=D.components.length;for(let Q=0;Q<$;Q++){let Z=D.components[Q];if(F+=kJ(Z),Q<$-1)F+=", "}let J=Y2(dR,D.type);return F+=`)${J?.array||""}`,kJ({...D,type:F})}if("indexed"in D&&D.indexed)F=`${F} indexed`;if(D.name)return`${F} ${D.name}`;return F}var dR;var pR=x(()=>{p9();dR=/^tuple(?<array>(\[(\d*)\])*)$/});function e8(D){let F="",$=D.length;for(let J=0;J<$;J++){let Q=D[J];if(F+=kJ(Q),J!==$-1)F+=", "}return F}var rG=x(()=>{pR()});function dF(D){if(D.type==="function")return`function ${D.name}(${e8(D.inputs)})${D.stateMutability&&D.stateMutability!=="nonpayable"?` ${D.stateMutability}`:""}${D.outputs?.length?` returns (${e8(D.outputs)})`:""}`;if(D.type==="event")return`event ${D.name}(${e8(D.inputs)})`;if(D.type==="error")return`error ${D.name}(${e8(D.inputs)})`;if(D.type==="constructor")return`constructor(${e8(D.inputs)})${D.stateMutability==="payable"?" payable":""}`;if(D.type==="fallback")return`fallback() external${D.stateMutability==="payable"?" payable":""}`;return"receive() external payable"}var lR=x(()=>{rG()});function nR(D){return cR.test(D)}function iR(D){return Y2(cR,D)}function aR(D){return oR.test(D)}function rR(D){return Y2(oR,D)}function tR(D){return sR.test(D)}function eR(D){return Y2(sR,D)}function u1(D){return DA.test(D)}function FA(D){return Y2(DA,D)}function JA(D){return $A.test(D)}function QA(D){return Y2($A,D)}function XA(D){return ZA.test(D)}function YA(D){return Y2(ZA,D)}function qA(D){return zo.test(D)}var cR,oR,sR,DA,$A,ZA,zo,sG,GA,yJ;var O6=x(()=>{p9();cR=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;oR=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;sR=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;DA=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;$A=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;ZA=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;zo=/^receive\(\) external payable$/;sG=new Set(["memory","indexed","storage","calldata"]),GA=new Set(["indexed"]),yJ=new Set(["calldata","memory","storage"])});var fJ,bJ,tG;var vJ=x(()=>{M6();fJ=class fJ extends uD{constructor({signature:D}){super("Failed to parse ABI item.",{details:`parseAbiItem(${JSON.stringify(D,null,2)})`,docsPath:"/api/human#parseabiitem-1"});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiItemError"})}};bJ=class bJ extends uD{constructor({type:D}){super("Unknown type.",{metaMessages:[`Type "${D}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}};tG=class tG extends uD{constructor({type:D}){super("Unknown type.",{metaMessages:[`Type "${D}" is not a valid ABI type.`]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}});var hJ,uJ,gJ,mJ,dJ,pJ;var lJ=x(()=>{M6();hJ=class hJ extends uD{constructor({params:D}){super("Failed to parse ABI parameters.",{details:`parseAbiParameters(${JSON.stringify(D,null,2)})`,docsPath:"/api/human#parseabiparameters-1"});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParametersError"})}};uJ=class uJ extends uD{constructor({param:D}){super("Invalid ABI parameter.",{details:D});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}};gJ=class gJ extends uD{constructor({param:D,name:F}){super("Invalid ABI parameter.",{details:D,metaMessages:[`"${F}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}};mJ=class mJ extends uD{constructor({param:D,type:F,modifier:$}){super("Invalid ABI parameter.",{details:D,metaMessages:[`Modifier "${$}" not allowed${F?` in "${F}" type`:""}.`]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}};dJ=class dJ extends uD{constructor({param:D,type:F,modifier:$}){super("Invalid ABI parameter.",{details:D,metaMessages:[`Modifier "${$}" not allowed${F?` in "${F}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${$}" was given.`]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}};pJ=class pJ extends uD{constructor({abiParameter:D}){super("Invalid ABI parameter.",{details:JSON.stringify(D,null,2),metaMessages:["ABI parameter type is invalid."]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}});var V8,cJ,nJ;var eG=x(()=>{M6();V8=class V8 extends uD{constructor({signature:D,type:F}){super(`Invalid ${F} signature.`,{details:D});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}};cJ=class cJ extends uD{constructor({signature:D}){super("Unknown signature.",{details:D});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}};nJ=class nJ extends uD{constructor({signature:D}){super("Invalid struct signature.",{details:D,metaMessages:["No properties exist."]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}});var iJ;var BA=x(()=>{M6();iJ=class iJ extends uD{constructor({type:D}){super("Circular reference detected.",{metaMessages:[`Struct "${D}" is a circular reference.`]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}});var oJ;var WA=x(()=>{M6();oJ=class oJ extends uD{constructor({current:D,depth:F}){super("Unbalanced parentheses.",{metaMessages:[`"${D.trim()}" has too many ${F>0?"opening":"closing"} parentheses.`],details:`Depth "${F}"`});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}});function KA(D,F,$){let J="";if($)for(let Q of Object.entries($)){if(!Q)continue;let Z="";for(let X of Q[1])Z+=`[${X.type}${X.name?`:${X.name}`:""}]`;J+=`(${Q[0]}{${Z}})`}if(F)return`${F}:${D}${J}`;return`${D}${J}`}var aJ;var UA=x(()=>{aJ=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]])});function l9(D,F={}){if(tR(D))return Co(D,F);if(aR(D))return _o(D,F);if(nR(D))return Mo(D,F);if(JA(D))return Oo(D,F);if(XA(D))return Eo(D);if(qA(D))return{type:"receive",stateMutability:"payable"};throw new cJ({signature:D})}function Co(D,F={}){let $=eR(D);if(!$)throw new V8({signature:D,type:"function"});let J=c0($.parameters),Q=[],Z=J.length;for(let Y=0;Y<Z;Y++)Q.push(g2(J[Y],{modifiers:yJ,structs:F,type:"function"}));let X=[];if($.returns){let Y=c0($.returns),q=Y.length;for(let G=0;G<q;G++)X.push(g2(Y[G],{modifiers:yJ,structs:F,type:"function"}))}return{name:$.name,type:"function",stateMutability:$.stateMutability??"nonpayable",inputs:Q,outputs:X}}function _o(D,F={}){let $=rR(D);if(!$)throw new V8({signature:D,type:"event"});let J=c0($.parameters),Q=[],Z=J.length;for(let X=0;X<Z;X++)Q.push(g2(J[X],{modifiers:GA,structs:F,type:"event"}));return{name:$.name,type:"event",inputs:Q}}function Mo(D,F={}){let $=iR(D);if(!$)throw new V8({signature:D,type:"error"});let J=c0($.parameters),Q=[],Z=J.length;for(let X=0;X<Z;X++)Q.push(g2(J[X],{structs:F,type:"error"}));return{name:$.name,type:"error",inputs:Q}}function Oo(D,F={}){let $=QA(D);if(!$)throw new V8({signature:D,type:"constructor"});let J=c0($.parameters),Q=[],Z=J.length;for(let X=0;X<Z;X++)Q.push(g2(J[X],{structs:F,type:"constructor"}));return{type:"constructor",stateMutability:$.stateMutability??"nonpayable",inputs:Q}}function Eo(D){let F=YA(D);if(!F)throw new V8({signature:D,type:"fallback"});return{type:"fallback",stateMutability:F.stateMutability??"nonpayable"}}function g2(D,F){let $=KA(D,F?.type,F?.structs);if(aJ.has($))return aJ.get($);let J=xJ.test(D),Q=Y2(J?Ao:Ro,D);if(!Q)throw new uJ({param:D});if(Q.name&&No(Q.name))throw new gJ({param:D,name:Q.name});let Z=Q.name?{name:Q.name}:{},X=Q.modifier==="indexed"?{indexed:!0}:{},Y=F?.structs??{},q,G={};if(J){q="tuple";let W=c0(Q.type),K=[],U=W.length;for(let V=0;V<U;V++)K.push(g2(W[V],{structs:Y}));G={components:K}}else if(Q.type in Y)q="tuple",G={components:Y[Q.type]};else if(Io.test(Q.type))q=`${Q.type}256`;else if(Q.type==="address payable")q="address";else if(q=Q.type,F?.type!=="struct"&&!DB(q))throw new tG({type:q});if(Q.modifier){if(!F?.modifiers?.has?.(Q.modifier))throw new mJ({param:D,type:F?.type,modifier:Q.modifier});if(yJ.has(Q.modifier)&&!To(q,!!Q.array))throw new dJ({param:D,type:F?.type,modifier:Q.modifier})}let B={type:`${q}${Q.array??""}`,...Z,...X,...G};return aJ.set($,B),B}function c0(D,F=[],$="",J=0){let Q=D.trim().length;for(let Z=0;Z<Q;Z++){let X=D[Z],Y=D.slice(Z+1);switch(X){case",":return J===0?c0(Y,[...F,$.trim()]):c0(Y,F,`${$}${X}`,J);case"(":return c0(Y,F,`${$}${X}`,J+1);case")":return c0(Y,F,`${$}${X}`,J-1);default:return c0(Y,F,`${$}${X}`,J)}}if($==="")return F;if(J!==0)throw new oJ({current:$,depth:J});return F.push($.trim()),F}function DB(D){return D==="address"||D==="bool"||D==="function"||D==="string"||oG.test(D)||aG.test(D)}function No(D){return D==="address"||D==="bool"||D==="function"||D==="string"||D==="tuple"||oG.test(D)||aG.test(D)||wo.test(D)}function To(D,F){return F||D==="bytes"||D==="string"||D==="tuple"}var Ro,Ao,Io,wo;var E6=x(()=>{p9();vJ();lJ();eG();WA();UA();O6();Ro=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*(?:\spayable)?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,Ao=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,Io=/^u?int$/;wo=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/});function R6(D){let F={},$=D.length;for(let X=0;X<$;X++){let Y=D[X];if(!u1(Y))continue;let q=FA(Y);if(!q)throw new V8({signature:Y,type:"struct"});let G=q.properties.split(";"),B=[],W=G.length;for(let K=0;K<W;K++){let V=G[K].trim();if(!V)continue;let H=g2(V,{type:"struct"});B.push(H)}if(!B.length)throw new nJ({signature:Y});F[q.name]=B}let J={},Q=Object.entries(F),Z=Q.length;for(let X=0;X<Z;X++){let[Y,q]=Q[X];J[Y]=VA(q,F)}return J}function VA(D=[],F={},$=new Set){let J=[],Q=D.length;for(let Z=0;Z<Q;Z++){let X=D[Z];if(xJ.test(X.type))J.push(X);else{let q=Y2(Lo,X.type);if(!q?.type)throw new pJ({abiParameter:X});let{array:G,type:B}=q;if(B in F){if($.has(B))throw new iJ({type:B});J.push({...X,type:`tuple${G??""}`,components:VA(F[B],F,new Set([...$,B]))})}else if(DB(B))J.push(X);else throw new bJ({type:B})}}return J}var Lo;var rJ=x(()=>{p9();vJ();lJ();eG();BA();O6();E6();Lo=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/});function c9(D){let F=R6(D),$=[],J=D.length;for(let Q=0;Q<J;Q++){let Z=D[Q];if(u1(Z))continue;$.push(l9(Z,F))}return $}var HA=x(()=>{O6();rJ();E6()});function n9(D){let F;if(typeof D==="string")F=l9(D);else{let $=R6(D),J=D.length;for(let Q=0;Q<J;Q++){let Z=D[Q];if(u1(Z))continue;F=l9(Z,$);break}}if(!F)throw new fJ({signature:D});return F}var zA=x(()=>{vJ();O6();rJ();E6()});function H8(D){let F=[];if(typeof D==="string"){let $=c0(D),J=$.length;for(let Q=0;Q<J;Q++)F.push(g2($[Q],{modifiers:sG}))}else{let $=R6(D),J=D.length;for(let Q=0;Q<J;Q++){let Z=D[Q];if(u1(Z))continue;let X=c0(Z),Y=X.length;for(let q=0;q<Y;q++)F.push(g2(X[q],{modifiers:sG,structs:$}))}}if(F.length===0)throw new hJ({params:D});return F}var CA=x(()=>{lJ();O6();rJ();E6();E6()});var A6=x(()=>{lR();rG();HA();zA();CA()});function i(D){if(typeof D==="string")return{address:D,type:"json-rpc"};return D}var m2,FQ,MA,$Q,OA,FB,$B,JB,i9,I6,JQ;var z8=x(()=>{m2=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[{name:"addr",type:"address"}],name:"getEthBalance",outputs:[{name:"balance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"}],FQ=[{name:"query",type:"function",stateMutability:"view",inputs:[{type:"tuple[]",name:"queries",components:[{type:"address",name:"sender"},{type:"string[]",name:"urls"},{type:"bytes",name:"data"}]}],outputs:[{type:"bool[]",name:"failures"},{type:"bytes[]",name:"responses"}]},{name:"HttpError",type:"error",inputs:[{type:"uint16",name:"status"},{type:"string",name:"message"}]}],MA=[{inputs:[{name:"dns",type:"bytes"}],name:"DNSDecodingFailed",type:"error"},{inputs:[{name:"ens",type:"string"}],name:"DNSEncodingFailed",type:"error"},{inputs:[],name:"EmptyAddress",type:"error"},{inputs:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"HttpError",type:"error"},{inputs:[],name:"InvalidBatchGatewayResponse",type:"error"},{inputs:[{name:"errorData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{name:"name",type:"bytes"},{name:"resolver",type:"address"}],name:"ResolverNotContract",type:"error"},{inputs:[{name:"name",type:"bytes"}],name:"ResolverNotFound",type:"error"},{inputs:[{name:"primary",type:"string"},{name:"primaryAddress",type:"bytes"}],name:"ReverseAddressMismatch",type:"error"},{inputs:[{internalType:"bytes4",name:"selector",type:"bytes4"}],name:"UnsupportedResolverProfile",type:"error"}],$Q=[...MA,{name:"resolveWithGateways",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],OA=[...MA,{name:"reverseWithGateways",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"uint256",name:"coinType"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolver"},{type:"address",name:"reverseResolver"}]}],FB=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],$B=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],JB=[{name:"isValidSignature",type:"function",stateMutability:"view",inputs:[{name:"hash",type:"bytes32"},{name:"signature",type:"bytes"}],outputs:[{name:"",type:"bytes4"}]}],i9=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}],I6=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]}],JQ=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!0,name:"tokenId",type:"uint256"}]},{type:"event",name:"ApprovalForAll",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"operator",type:"address"},{indexed:!1,name:"approved",type:"bool"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!0,name:"tokenId",type:"uint256"}]},{type:"function",name:"approve",stateMutability:"payable",inputs:[{name:"spender",type:"address"},{name:"tokenId",type:"uint256"}],outputs:[]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"getApproved",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{type:"address"}]},{type:"function",name:"isApprovedForAll",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"operator",type:"address"}],outputs:[{type:"bool"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"ownerOf",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"owner",type:"address"}]},{type:"function",name:"safeTransferFrom",stateMutability:"payable",inputs:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"tokenId",type:"uint256"}],outputs:[]},{type:"function",name:"safeTransferFrom",stateMutability:"nonpayable",inputs:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"id",type:"uint256"},{name:"data",type:"bytes"}],outputs:[]},{type:"function",name:"setApprovalForAll",stateMutability:"nonpayable",inputs:[{name:"operator",type:"address"},{name:"approved",type:"bool"}],outputs:[]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"tokenByIndex",stateMutability:"view",inputs:[{name:"index",type:"uint256"}],outputs:[{type:"uint256"}]},{type:"function",name:"tokenByIndex",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"index",type:"uint256"}],outputs:[{name:"tokenId",type:"uint256"}]},{type:"function",name:"tokenURI",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transferFrom",stateMutability:"payable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"tokenId",type:"uint256"}],outputs:[]}]});function eD(D,{includeName:F=!1}={}){if(D.type!=="function"&&D.type!=="event"&&D.type!=="error")throw new QB(D.type);return`${D.name}(${o9(D.inputs,{includeName:F})})`}function o9(D,{includeName:F=!1}={}){if(!D)return"";return D.map(($)=>Po($,{includeName:F})).join(F?", ":",")}function Po(D,{includeName:F}){if(D.type.startsWith("tuple"))return`(${o9(D.components,{includeName:F})})${D.type.slice(5)}`;return D.type+(F&&D.name?` ${D.name}`:"")}var D1=x(()=>{gD()});function DD(D,{strict:F=!0}={}){if(!D)return!1;if(typeof D!=="string")return!1;return F?/^0x[0-9a-fA-F]*$/.test(D):D.startsWith("0x")}function GD(D){if(DD(D,{strict:!1}))return Math.ceil((D.length-2)/2);return D.length}var _2=()=>{};var ZB="2.46.1";function EA(D,F){if(F?.(D))return D;if(D&&typeof D==="object"&&"cause"in D&&D.cause!==void 0)return EA(D.cause,F);return F?null:D}var XB,P;var s=x(()=>{XB={getDocsUrl:({docsBaseUrl:D,docsPath:F="",docsSlug:$})=>F?`${D??"https://viem.sh"}${F}${$?`#${$}`:""}`:void 0,version:`viem@${ZB}`};P=class P extends Error{constructor(D,F={}){let $=(()=>{if(F.cause instanceof P)return F.cause.details;if(F.cause?.message)return F.cause.message;return F.details})(),J=(()=>{if(F.cause instanceof P)return F.cause.docsPath||F.docsPath;return F.docsPath})(),Q=XB.getDocsUrl?.({...F,docsPath:J}),Z=[D||"An error occurred.","",...F.metaMessages?[...F.metaMessages,""]:[],...Q?[`Docs: ${Q}`]:[],...$?[`Details: ${$}`]:[],...XB.version?[`Version: ${XB.version}`]:[]].join(`
35
35
  `);super(Z,F.cause?{cause:F.cause}:void 0);Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=$,this.docsPath=J,this.metaMessages=F.metaMessages,this.name=F.name??this.name,this.shortMessage=D,this.version=ZB}walk(D){return EA(this,D)}}});var YB,QQ,a9,d2,qB,GB,r9,BB,ZQ,s9,WB,KB,XQ,C8,t9,UB,VB,e9,g1,pF,HB,zB,D4,QB,CB;var gD=x(()=>{D1();_2();s();YB=class YB extends P{constructor({docsPath:D}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(`
36
36
  `),{docsPath:D,name:"AbiConstructorNotFoundError"})}};QQ=class QQ extends P{constructor({docsPath:D}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(`
@@ -69,13 +69,13 @@ ${BI(K)}`;super(D.shortMessage,{cause:D,docsPath:$,metaMessages:[...D.metaMessag
69
69
  `);super(q,F.cause?{cause:F.cause}:void 0);Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsOrigin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showVersion",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.cause=F.cause,this.details=$,this.docs=Z,this.docsOrigin=Q,this.docsPath=J,this.shortMessage=D,this.showVersion=X,this.version=Y}walk(D){return LI(this,D)}};Object.defineProperty(d,"defaultStaticOptions",{enumerable:!0,configurable:!0,writable:!0,value:{docsOrigin:"https://oxlib.sh",showVersion:!1,version:`ox@${NI()}`}});(()=>{d.setStaticOptions(d.defaultStaticOptions)})()});function X7(D,F){if(A2(D)>F)throw new XW({givenSize:A2(D),maxSize:F})}function PI(D,F){if(typeof F==="number"&&F>0&&F>A2(D)-1)throw new bQ({offset:F,position:"start",size:A2(D)})}function jI(D,F,$){if(typeof F==="number"&&typeof $==="number"&&A2(D)!==$-F)throw new bQ({offset:$,position:"end",size:A2(D)})}function QW(D){if(D>=H1.zero&&D<=H1.nine)return D-H1.zero;if(D>=H1.A&&D<=H1.F)return D-(H1.A-10);if(D>=H1.a&&D<=H1.f)return D-(H1.a-10);return}function SI(D,F={}){let{dir:$,size:J=32}=F;if(J===0)return D;if(D.length>J)throw new YW({size:D.length,targetSize:J,type:"Bytes"});let Q=new Uint8Array(J);for(let Z=0;Z<J;Z++){let X=$==="right";Q[X?Z:J-Z-1]=D[X?Z:D.length-Z-1]}return Q}function ZW(D,F={}){let{dir:$="left"}=F,J=D,Q=0;for(let Z=0;Z<J.length-1;Z++)if(J[$==="left"?Z:J.length-Z-1].toString()==="0")Q++;else break;return J=$==="left"?J.slice(Q):J.slice(0,J.length-Q),J}var H1;var xI=x(()=>{o1();H1={zero:48,nine:57,A:65,F:70,a:97,f:102}});function Y7(D,F){if(LD(D)>F)throw new BW({givenSize:LD(D),maxSize:F})}function kI(D,F){if(typeof F==="number"&&F>0&&F>LD(D)-1)throw new vQ({offset:F,position:"start",size:LD(D)})}function yI(D,F,$){if(typeof F==="number"&&typeof $==="number"&&LD(D)!==$-F)throw new vQ({offset:$,position:"end",size:LD(D)})}function qW(D,F={}){let{dir:$,size:J=32}=F;if(J===0)return D;let Q=D.replace("0x","");if(Q.length>J*2)throw new WW({size:Math.ceil(Q.length/2),targetSize:J,type:"Hex"});return`0x${Q[$==="right"?"padEnd":"padStart"](J*2,"0")}`}function fI(D,F={}){let{dir:$="left"}=F,J=D.replace("0x",""),Q=0;for(let Z=0;Z<J.length-1;Z++)if(J[$==="left"?Z:J.length-Z-1].toString()==="0")Q++;else break;if(J=$==="left"?J.slice(Q):J.slice(0,J.length-Q),J==="0")return"0x";if($==="right"&&J.length%2===1)return`0x${J}0`;return`0x${J}`}var GW=x(()=>{Q0()});function a1(D,F,$){return JSON.stringify(D,(J,Q)=>{if(typeof F==="function")return F(J,Q);if(typeof Q==="bigint")return Q.toString()+"#__bigint";return Q},$)}function wa(D){if(D instanceof Uint8Array)return;if(!D)throw new H4(D);if(typeof D!=="object")throw new H4(D);if(!("BYTES_PER_ELEMENT"in D))throw new H4(D);if(D.BYTES_PER_ELEMENT!==1||D.constructor.name!=="Uint8Array")throw new H4(D)}function vI(D){if(D instanceof Uint8Array)return D;if(typeof D==="string")return q7(D);return Na(D)}function Na(D){return D instanceof Uint8Array?D:new Uint8Array(D)}function q7(D,F={}){let{size:$}=F,J=D;if($)Y7(D,$),J=j8(D,$);let Q=J.slice(2);if(Q.length%2)Q=`0${Q}`;let Z=Q.length/2,X=new Uint8Array(Z);for(let Y=0,q=0;Y<Z;Y++){let G=QW(Q.charCodeAt(q++)),B=QW(Q.charCodeAt(q++));if(G===void 0||B===void 0)throw new d(`Invalid byte sequence ("${Q[q-2]}${Q[q-1]}" in "${Q}").`);X[Y]=G<<4|B}return X}function hI(D,F={}){let{size:$}=F,J=Ia.encode(D);if(typeof $==="number")return X7(J,$),Ta(J,$);return J}function Ta(D,F){return SI(D,{dir:"right",size:F})}function A2(D){return D.length}function uI(D,F,$,J={}){let{strict:Q}=J;PI(D,F);let Z=D.slice(F,$);if(Q)jI(Z,F,$);return Z}function gI(D,F={}){let{size:$}=F;if(typeof $<"u")X7(D,$);let J=dD(D,F);return UW(J,F)}function mI(D,F={}){let{size:$}=F,J=D;if(typeof $<"u")X7(J,$),J=KW(J);if(J.length>1||J[0]>1)throw new lI(J);return Boolean(J[0])}function P8(D,F={}){let{size:$}=F;if(typeof $<"u")X7(D,$);let J=dD(D,F);return uQ(J,F)}function dI(D,F={}){let{size:$}=F,J=D;if(typeof $<"u")X7(J,$),J=La(J);return Aa.decode(J)}function KW(D){return ZW(D,{dir:"left"})}function La(D){return ZW(D,{dir:"right"})}function pI(D){try{return wa(D),!0}catch{return!1}}var Aa,Ia,lI,H4,XW,bQ,YW;var o1=x(()=>{s0();Q0();xI();GW();Aa=new TextDecoder,Ia=new TextEncoder;lI=class lI extends d{constructor(D){super(`Bytes value \`${D}\` is not a valid boolean.`,{metaMessages:["The bytes array must contain a single byte of either a `0` or `1` value."]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesBooleanError"})}};H4=class H4 extends d{constructor(D){super(`Value \`${typeof D==="object"?a1(D):D}\` of type \`${typeof D}\` is an invalid Bytes value.`,{metaMessages:["Bytes values must be of type `Bytes`."]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesTypeError"})}};XW=class XW extends d{constructor({givenSize:D,maxSize:F}){super(`Size cannot exceed \`${F}\` bytes. Given size: \`${D}\` bytes.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}};bQ=class bQ extends d{constructor({offset:D,position:F,size:$}){super(`Slice ${F==="start"?"starting":"ending"} at offset \`${D}\` is out-of-bounds (size: \`${$}\`).`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SliceOffsetOutOfBoundsError"})}};YW=class YW extends d{constructor({size:D,targetSize:F,type:$}){super(`${$.charAt(0).toUpperCase()}${$.slice(1).toLowerCase()} size (\`${D}\`) exceeds padding size (\`${F}\`).`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}}});function Sa(D,F={}){let{strict:$=!1}=F;if(!D)throw new VW(D);if(typeof D!=="string")throw new VW(D);if($){if(!/^0x[0-9a-fA-F]*$/.test(D))throw new HW(D)}if(!D.startsWith("0x"))throw new HW(D)}function bD(...D){return`0x${D.reduce((F,$)=>F+$.replace("0x",""),"")}`}function G7(D){if(D instanceof Uint8Array)return dD(D);if(Array.isArray(D))return dD(new Uint8Array(D));return D}function gQ(D,F={}){let $=`0x${Number(D)}`;if(typeof F.size==="number")return Y7($,F.size),z1($,F.size);return $}function dD(D,F={}){let $="";for(let Q=0;Q<D.length;Q++)$+=ja[D[Q]];let J=`0x${$}`;if(typeof F.size==="number")return Y7(J,F.size),j8(J,F.size);return J}function KD(D,F={}){let{signed:$,size:J}=F,Q=BigInt(D),Z;if(J)if($)Z=(1n<<BigInt(J)*8n-1n)-1n;else Z=2n**(BigInt(J)*8n)-1n;else if(typeof D==="number")Z=BigInt(Number.MAX_SAFE_INTEGER);let X=typeof Z==="bigint"&&$?-Z-1n:0;if(Z&&Q>Z||Q<X){let G=typeof D==="bigint"?"n":"";throw new mQ({max:Z?`${Z}${G}`:void 0,min:`${X}${G}`,signed:$,size:J,value:`${D}${G}`})}let q=`0x${($&&Q<0?BigInt.asUintN(J*8,BigInt(Q)):Q).toString(16)}`;if(J)return z1(q,J);return q}function B7(D,F={}){return dD(Pa.encode(D),F)}function z1(D,F){return qW(D,{dir:"left",size:F})}function j8(D,F){return qW(D,{dir:"right",size:F})}function PD(D,F,$,J={}){let{strict:Q}=J;kI(D,F);let Z=`0x${D.replace("0x","").slice((F??0)*2,($??D.length)*2)}`;if(Q)yI(Z,F,$);return Z}function LD(D){return Math.ceil((D.length-2)/2)}function zW(D){return fI(D,{dir:"left"})}function UW(D,F={}){let{signed:$}=F;if(F.size)Y7(D,F.size);let J=BigInt(D);if(!$)return J;let Q=(D.length-2)/2,Z=(1n<<BigInt(Q)*8n)-1n,X=Z>>1n;if(J<=X)return J;return J-Z-1n}function uQ(D,F={}){let{signed:$,size:J}=F;if(!$&&!J)return Number(D);return Number(UW(D,F))}function z4(D,F={}){let{strict:$=!1}=F;try{return Sa(D,{strict:$}),!0}catch{return!1}}var Pa,ja,mQ,VW,HW,BW,vQ,WW;var Q0=x(()=>{s0();GW();Pa=new TextEncoder,ja=Array.from({length:256},(D,F)=>F.toString(16).padStart(2,"0"));mQ=class mQ extends d{constructor({max:D,min:F,signed:$,size:J,value:Q}){super(`Number \`${Q}\` is not in safe${J?` ${J*8}-bit`:""}${$?" signed":" unsigned"} integer range ${D?`(\`${F}\` to \`${D}\`)`:`(above \`${F}\`)`}`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}};VW=class VW extends d{constructor(D){super(`Value \`${typeof D==="object"?a1(D):D}\` of type \`${typeof D}\` is an invalid hex type.`,{metaMessages:['Hex types must be represented as `"0x${string}"`.']});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexTypeError"})}};HW=class HW extends d{constructor(D){super(`Value \`${D}\` is an invalid hex value.`,{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexValueError"})}};BW=class BW extends d{constructor({givenSize:D,maxSize:F}){super(`Size cannot exceed \`${F}\` bytes. Given size: \`${D}\` bytes.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}};vQ=class vQ extends d{constructor({offset:D,position:F,size:$}){super(`Slice ${F==="start"?"starting":"ending"} at offset \`${D}\` is out-of-bounds (size: \`${$}\`).`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}};WW=class WW extends d{constructor({size:D,targetSize:F,type:$}){super(`${$.charAt(0).toUpperCase()}${$.slice(1).toLowerCase()} size (\`${D}\`) exceeds padding size (\`${F}\`).`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}});function cI(D){return{address:D.address,amount:KD(D.amount),index:KD(D.index),validatorIndex:KD(D.validatorIndex)}}var nI=x(()=>{Q0()});function dQ(D){return{...typeof D.baseFeePerGas==="bigint"&&{baseFeePerGas:KD(D.baseFeePerGas)},...typeof D.blobBaseFee==="bigint"&&{blobBaseFee:KD(D.blobBaseFee)},...typeof D.feeRecipient==="string"&&{feeRecipient:D.feeRecipient},...typeof D.gasLimit==="bigint"&&{gasLimit:KD(D.gasLimit)},...typeof D.number==="bigint"&&{number:KD(D.number)},...typeof D.prevRandao==="bigint"&&{prevRandao:KD(D.prevRandao)},...typeof D.time==="bigint"&&{time:KD(D.time)},...D.withdrawals&&{withdrawals:D.withdrawals.map(cI)}}}var CW=x(()=>{Q0();nI()});var oI="0x82ad56cb";var pQ="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",aI="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",rI="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",W7="0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033";function q3(D){let{abi:F,args:$,bytecode:J}=D;if(!$||$.length===0)return J;let Q=F.find((X)=>("type"in X)&&X.type==="constructor");if(!Q)throw new YB({docsPath:_W});if(!("inputs"in Q))throw new QQ({docsPath:_W});if(!Q.inputs||Q.inputs.length===0)throw new QQ({docsPath:_W});let Z=iD(Q.inputs,$);return i0([J,Z])}var _W="/docs/contract/encodeDeployData";var lQ=x(()=>{gD();A8()});var r1,G3,C4,_4,M4,O4,E4,R4,A4,I4,B3,a2;var W3=x(()=>{S6();s();r1=class r1 extends P{constructor({cause:D,message:F}={}){let $=F?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${$?`with reason: ${$}`:"for an unknown reason"}.`,{cause:D,name:"ExecutionRevertedError"})}};Object.defineProperty(r1,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(r1,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted|gas required exceeds allowance/});G3=class G3 extends P{constructor({cause:D,maxFeePerGas:F}={}){super(`The fee cap (\`maxFeePerGas\`${F?` = ${$0(F)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:D,name:"FeeCapTooHighError"})}};Object.defineProperty(G3,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});C4=class C4 extends P{constructor({cause:D,maxFeePerGas:F}={}){super(`The fee cap (\`maxFeePerGas\`${F?` = ${$0(F)}`:""} gwei) cannot be lower than the block base fee.`,{cause:D,name:"FeeCapTooLowError"})}};Object.defineProperty(C4,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});_4=class _4 extends P{constructor({cause:D,nonce:F}={}){super(`Nonce provided for the transaction ${F?`(${F}) `:""}is higher than the next one expected.`,{cause:D,name:"NonceTooHighError"})}};Object.defineProperty(_4,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});M4=class M4 extends P{constructor({cause:D,nonce:F}={}){super([`Nonce provided for the transaction ${F?`(${F}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
70
70
  `),{cause:D,name:"NonceTooLowError"})}};Object.defineProperty(M4,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});O4=class O4 extends P{constructor({cause:D,nonce:F}={}){super(`Nonce provided for the transaction ${F?`(${F}) `:""}exceeds the maximum allowed nonce.`,{cause:D,name:"NonceMaxValueError"})}};Object.defineProperty(O4,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});E4=class E4 extends P{constructor({cause:D}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(`
71
71
  `),{cause:D,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}};Object.defineProperty(E4,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});R4=class R4 extends P{constructor({cause:D,gas:F}={}){super(`The amount of gas ${F?`(${F}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:D,name:"IntrinsicGasTooHighError"})}};Object.defineProperty(R4,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});A4=class A4 extends P{constructor({cause:D,gas:F}={}){super(`The amount of gas ${F?`(${F}) `:""}provided for the transaction is too low.`,{cause:D,name:"IntrinsicGasTooLowError"})}};Object.defineProperty(A4,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});I4=class I4 extends P{constructor({cause:D}){super("The transaction type is not supported for this chain.",{cause:D,name:"TransactionTypeNotSupportedError"})}};Object.defineProperty(I4,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});B3=class B3 extends P{constructor({cause:D,maxPriorityFeePerGas:F,maxFeePerGas:$}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${F?` = ${$0(F)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${$?` = ${$0($)} gwei`:""}).`].join(`
72
- `),{cause:D,name:"TipAboveFeeCapError"})}};Object.defineProperty(B3,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});a2=class a2 extends P{constructor({cause:D}){super(`An error occurred while executing: ${D?.shortMessage}`,{cause:D,name:"UnknownNodeError"})}}});function s1(D,F){let $=(D.details||"").toLowerCase(),J=D instanceof P?D.walk((Q)=>Q?.code===r1.code):D;if(J instanceof P)return new r1({cause:D,message:J.details});if(r1.nodeMessage.test($))return new r1({cause:D,message:D.details});if(G3.nodeMessage.test($))return new G3({cause:D,maxFeePerGas:F?.maxFeePerGas});if(C4.nodeMessage.test($))return new C4({cause:D,maxFeePerGas:F?.maxFeePerGas});if(_4.nodeMessage.test($))return new _4({cause:D,nonce:F?.nonce});if(M4.nodeMessage.test($))return new M4({cause:D,nonce:F?.nonce});if(O4.nodeMessage.test($))return new O4({cause:D,nonce:F?.nonce});if(E4.nodeMessage.test($))return new E4({cause:D});if(R4.nodeMessage.test($))return new R4({cause:D,gas:F?.gas});if(A4.nodeMessage.test($))return new A4({cause:D,gas:F?.gas});if(I4.nodeMessage.test($))return new I4({cause:D});if(B3.nodeMessage.test($))return new B3({cause:D,maxFeePerGas:F?.maxFeePerGas,maxPriorityFeePerGas:F?.maxPriorityFeePerGas});return new a2({cause:D})}var w4=x(()=>{s();W3()});function cQ(D,{docsPath:F,...$}){let J=(()=>{let Q=s1(D,$);if(Q instanceof a2)return D;return Q})();return new x6(J,{docsPath:F,...$})}var MW=x(()=>{q1();W3();w4()});function t0(D,{format:F}){if(!F)return{};let $={};function J(Z){let X=Object.keys(Z);for(let Y of X){if(Y in D)$[Y]=D[Y];if(Z[Y]&&typeof Z[Y]==="object"&&!Array.isArray(Z[Y]))J(Z[Y])}}let Q=F(D||{});return J(Q),$}function Z0(D,F){let $={};if(typeof D.authorizationList<"u")$.authorizationList=ya(D.authorizationList);if(typeof D.accessList<"u")$.accessList=D.accessList;if(typeof D.blobVersionedHashes<"u")$.blobVersionedHashes=D.blobVersionedHashes;if(typeof D.blobs<"u")if(typeof D.blobs[0]!=="string")$.blobs=D.blobs.map((J)=>WD(J));else $.blobs=D.blobs;if(typeof D.data<"u")$.data=D.data;if(D.account)$.from=D.account.address;if(typeof D.from<"u")$.from=D.from;if(typeof D.gas<"u")$.gas=k(D.gas);if(typeof D.gasPrice<"u")$.gasPrice=k(D.gasPrice);if(typeof D.maxFeePerBlobGas<"u")$.maxFeePerBlobGas=k(D.maxFeePerBlobGas);if(typeof D.maxFeePerGas<"u")$.maxFeePerGas=k(D.maxFeePerGas);if(typeof D.maxPriorityFeePerGas<"u")$.maxPriorityFeePerGas=k(D.maxPriorityFeePerGas);if(typeof D.nonce<"u")$.nonce=k(D.nonce);if(typeof D.to<"u")$.to=D.to;if(typeof D.type<"u")$.type=ka[D.type];if(typeof D.value<"u")$.value=k(D.value);return $}function ya(D){return D.map((F)=>({address:F.address,r:F.r?k(BigInt(F.r)):F.r,s:F.s?k(BigInt(F.s)):F.s,chainId:k(F.chainId),nonce:k(F.nonce),...typeof F.yParity<"u"?{yParity:k(F.yParity)}:{},...typeof F.v<"u"&&typeof F.yParity>"u"?{v:k(F.v)}:{}}))}var ka;var S8=x(()=>{c();ka={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"}});function K7(){let D=()=>{return},F=()=>{return};return{promise:new Promise((J,Q)=>{D=J,F=Q}),resolve:D,reject:F}}function nQ({fn:D,id:F,shouldSplitBatch:$,wait:J=0,sort:Q}){let Z=async()=>{let B=q();X();let W=B.map(({args:K})=>K);if(W.length===0)return;D(W).then((K)=>{if(Q&&Array.isArray(K))K.sort(Q);for(let U=0;U<B.length;U++){let{resolve:V}=B[U];V?.([K[U],K])}}).catch((K)=>{for(let U=0;U<B.length;U++){let{reject:V}=B[U];V?.(K)}})},X=()=>OW.delete(F),Y=()=>q().map(({args:B})=>B),q=()=>OW.get(F)||[],G=(B)=>OW.set(F,[...q(),B]);return{flush:X,async schedule(B){let{promise:W,resolve:K,reject:U}=K7();if($?.([...Y(),B]))Z();if(q().length>0)return G({args:B,resolve:K,reject:U}),W;return G({args:B,resolve:K,reject:U}),setTimeout(Z,J),W}}}var OW;var EW=x(()=>{OW=new Map});function sI(D){if(!D||D.length===0)return;return D.reduce((F,{slot:$,value:J})=>{if($.length!==66)throw new GQ({size:$.length,targetSize:66,type:"hex"});if(J.length!==66)throw new GQ({size:J.length,targetSize:66,type:"hex"});return F[$]=J,F},{})}function fa(D){let{balance:F,nonce:$,state:J,stateDiff:Q,code:Z}=D,X={};if(Z!==void 0)X.code=Z;if(F!==void 0)X.balance=k(F);if($!==void 0)X.nonce=k($);if(J!==void 0)X.state=sI(J);if(Q!==void 0){if(X.state)throw new mB;X.stateDiff=sI(Q)}return X}function U7(D){if(!D)return;let F={};for(let{address:$,...J}of D){if(!t($,{strict:!1}))throw new B0({address:$});if(F[$])throw new gB({address:$});F[$]=fa(J)}return F}var iQ=x(()=>{m1();BQ();dB();n2();c()});var nwD,iwD,owD,awD,rwD,swD,twD,ewD,DND,FND,$ND,JND,QND,ZND,XND,YND,qND,GND,BND,WND,KND,UND,VND,HND,zND,CND,_ND,MND,OND,END,RND,AND,IND,wND,NND,TND,LND,PND,jND,SND,xND,kND,yND,fND,bND,vND,hND,uND,gND,mND,dND,pND,lND,cND,nND,iND,oND,aND,rND,sND,tND,eND,DTD,FTD,$TD,JTD,QTD,ZTD,XTD,YTD,qTD,GTD,BTD,WTD,KTD,UTD,VTD,HTD,zTD,CTD,_TD,MTD,OTD,ETD,RTD,ATD,ITD,wTD,NTD,TTD,LTD,PTD,jTD,STD,xTD,tI;var eI=x(()=>{nwD=2n**(8n-1n)-1n,iwD=2n**(16n-1n)-1n,owD=2n**(24n-1n)-1n,awD=2n**(32n-1n)-1n,rwD=2n**(40n-1n)-1n,swD=2n**(48n-1n)-1n,twD=2n**(56n-1n)-1n,ewD=2n**(64n-1n)-1n,DND=2n**(72n-1n)-1n,FND=2n**(80n-1n)-1n,$ND=2n**(88n-1n)-1n,JND=2n**(96n-1n)-1n,QND=2n**(104n-1n)-1n,ZND=2n**(112n-1n)-1n,XND=2n**(120n-1n)-1n,YND=2n**(128n-1n)-1n,qND=2n**(136n-1n)-1n,GND=2n**(144n-1n)-1n,BND=2n**(152n-1n)-1n,WND=2n**(160n-1n)-1n,KND=2n**(168n-1n)-1n,UND=2n**(176n-1n)-1n,VND=2n**(184n-1n)-1n,HND=2n**(192n-1n)-1n,zND=2n**(200n-1n)-1n,CND=2n**(208n-1n)-1n,_ND=2n**(216n-1n)-1n,MND=2n**(224n-1n)-1n,OND=2n**(232n-1n)-1n,END=2n**(240n-1n)-1n,RND=2n**(248n-1n)-1n,AND=2n**(256n-1n)-1n,IND=-(2n**(8n-1n)),wND=-(2n**(16n-1n)),NND=-(2n**(24n-1n)),TND=-(2n**(32n-1n)),LND=-(2n**(40n-1n)),PND=-(2n**(48n-1n)),jND=-(2n**(56n-1n)),SND=-(2n**(64n-1n)),xND=-(2n**(72n-1n)),kND=-(2n**(80n-1n)),yND=-(2n**(88n-1n)),fND=-(2n**(96n-1n)),bND=-(2n**(104n-1n)),vND=-(2n**(112n-1n)),hND=-(2n**(120n-1n)),uND=-(2n**(128n-1n)),gND=-(2n**(136n-1n)),mND=-(2n**(144n-1n)),dND=-(2n**(152n-1n)),pND=-(2n**(160n-1n)),lND=-(2n**(168n-1n)),cND=-(2n**(176n-1n)),nND=-(2n**(184n-1n)),iND=-(2n**(192n-1n)),oND=-(2n**(200n-1n)),aND=-(2n**(208n-1n)),rND=-(2n**(216n-1n)),sND=-(2n**(224n-1n)),tND=-(2n**(232n-1n)),eND=-(2n**(240n-1n)),DTD=-(2n**(248n-1n)),FTD=-(2n**(256n-1n)),$TD=2n**8n-1n,JTD=2n**16n-1n,QTD=2n**24n-1n,ZTD=2n**32n-1n,XTD=2n**40n-1n,YTD=2n**48n-1n,qTD=2n**56n-1n,GTD=2n**64n-1n,BTD=2n**72n-1n,WTD=2n**80n-1n,KTD=2n**88n-1n,UTD=2n**96n-1n,VTD=2n**104n-1n,HTD=2n**112n-1n,zTD=2n**120n-1n,CTD=2n**128n-1n,_TD=2n**136n-1n,MTD=2n**144n-1n,OTD=2n**152n-1n,ETD=2n**160n-1n,RTD=2n**168n-1n,ATD=2n**176n-1n,ITD=2n**184n-1n,wTD=2n**192n-1n,NTD=2n**200n-1n,TTD=2n**208n-1n,LTD=2n**216n-1n,PTD=2n**224n-1n,jTD=2n**232n-1n,STD=2n**240n-1n,xTD=2n**248n-1n,tI=2n**256n-1n});function X0(D){let{account:F,maxFeePerGas:$,maxPriorityFeePerGas:J,to:Q}=D,Z=F?i(F):void 0;if(Z&&!t(Z.address))throw new B0({address:Z.address});if(Q&&!t(Q))throw new B0({address:Q});if($&&$>tI)throw new G3({maxFeePerGas:$});if(J&&$&&J>$)throw new B3({maxFeePerGas:$,maxPriorityFeePerGas:J})}var x8=x(()=>{eI();m1();W3();n2()});var RW,AW,IW;var Dw=x(()=>{s();RW=class RW extends P{constructor({callbackSelector:D,cause:F,data:$,extraData:J,sender:Q,urls:Z}){super(F.shortMessage||"An error occurred while fetching for an offchain result.",{cause:F,metaMessages:[...F.metaMessages||[],F.metaMessages?.length?"":[],"Offchain Gateway Call:",Z&&[" Gateway URL(s):",...Z.map((X)=>` ${D3(X)}`)],` Sender: ${Q}`,` Data: ${$}`,` Callback selector: ${D}`,` Extra data: ${J}`].flat(),name:"OffchainLookupError"})}};AW=class AW extends P{constructor({result:D,url:F}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${D3(F)}`,`Response: ${qD(D)}`],name:"OffchainLookupResponseMalformedError"})}};IW=class IW extends P{constructor({sender:D,to:F}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${F}`,`OffchainLookup sender address: ${D}`],name:"OffchainLookupSenderMismatchError"})}}});function I2(D,F){if(!t(D,{strict:!1}))throw new B0({address:D});if(!t(F,{strict:!1}))throw new B0({address:F});return D.toLowerCase()===F.toLowerCase()}var K3=x(()=>{m1();n2()});var Jw={};H2(Jw,{offchainLookupSignature:()=>ba,offchainLookupAbiItem:()=>Fw,offchainLookup:()=>va,ccipRequest:()=>$w});async function va(D,{blockNumber:F,blockTag:$,data:J,to:Q}){let{args:Z}=PQ({data:J,abi:[Fw]}),[X,Y,q,G,B]=Z,{ccipRead:W}=D,K=W&&typeof W?.request==="function"?W.request:$w;try{if(!I2(Q,X))throw new IW({sender:X,to:Q});let U=Y.includes(G1)?await aB({data:q,ccipRequest:K}):await K({data:q,sender:X,urls:Y}),{data:V}=await w2(D,{blockNumber:F,blockTag:$,data:ID([G,iD([{type:"bytes"},{type:"bytes"}],[U,B])]),to:Q});return V}catch(U){throw new RW({callbackSelector:G,cause:U,data:J,extraData:B,sender:X,urls:Y})}}async function $w({data:D,sender:F,urls:$}){let J=Error("An unknown error occurred.");for(let Q=0;Q<$.length;Q++){let Z=$[Q],X=Z.includes("{data}")?"GET":"POST",Y=X==="POST"?{data:D,sender:F}:void 0,q=X==="POST"?{"Content-Type":"application/json"}:{};try{let G=await fetch(Z.replace("{sender}",F.toLowerCase()).replace("{data}",D),{body:JSON.stringify(Y),headers:q,method:X}),B;if(G.headers.get("Content-Type")?.startsWith("application/json"))B=(await G.json()).data;else B=await G.text();if(!G.ok){J=new o2({body:Y,details:B?.error?qD(B.error):G.statusText,headers:G.headers,status:G.status,url:Z});continue}if(!DD(B)){J=new AW({result:B,url:Z});continue}return B}catch(G){J=new o2({body:Y,details:G.message,url:Z})}}throw J}var ba="0x556f1830",Fw;var Qw=x(()=>{U3();Dw();$3();vB();A8();K3();W4();Fw={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]}});async function w2(D,F){let{account:$=D.account,authorizationList:J,batch:Q=Boolean(D.batch?.multicall),blockNumber:Z,blockTag:X=D.experimental_blockTag??"latest",accessList:Y,blobs:q,blockOverrides:G,code:B,data:W,factory:K,factoryData:U,gas:V,gasPrice:H,maxFeePerBlobGas:z,maxFeePerGas:_,maxPriorityFeePerGas:O,nonce:C,to:M,value:E,stateOverride:A,...w}=F,R=$?i($):void 0;if(B&&(K||U))throw new P("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(B&&M)throw new P("Cannot provide both `code` & `to` as parameters.");let T=B&&W,N=K&&U&&M&&W,j=T||N,L=(()=>{if(T)return Zw({code:B,data:W});if(N)return ga({data:W,factory:K,factoryData:U,to:M});return W})();try{X0(F);let m=(typeof Z==="bigint"?k(Z):void 0)||X,S=G?dQ(G):void 0,h=U7(A),g=D.chain?.formatters?.transactionRequest?.format,u=(g||Z0)({...t0(w,{format:g}),accessList:Y,account:R,authorizationList:J,blobs:q,data:L,gas:V,gasPrice:H,maxFeePerBlobGas:z,maxFeePerGas:_,maxPriorityFeePerGas:O,nonce:C,to:j?void 0:M,value:E},"call");if(Q&&ha({request:u})&&!h&&!S)try{return await ua(D,{...u,blockNumber:Z,blockTag:X})}catch(RD){if(!(RD instanceof wQ)&&!(RD instanceof P6))throw RD}let o=(()=>{let RD=[u,m];if(h&&S)return[...RD,h,S];if(h)return[...RD,h];if(S)return[...RD,{},S];return RD})(),cD=await D.request({method:"eth_call",params:o});if(cD==="0x")return{data:void 0};return{data:cD}}catch(y){let m=ma(y),{offchainLookup:S,offchainLookupSignature:h}=await Promise.resolve().then(() => (Qw(),Jw));if(D.ccipRead!==!1&&m?.slice(0,10)===h&&M)return{data:await S(D,{data:m,to:M})};if(j&&m?.slice(0,10)==="0x101bb98d")throw new xQ({factory:K});throw cQ(y,{...F,account:R,chain:D.chain})}}function ha({request:D}){let{data:F,to:$,...J}=D;if(!F)return!1;if(F.startsWith(oI))return!1;if(!$)return!1;if(Object.values(J).filter((Q)=>typeof Q<"u").length>0)return!1;return!0}async function ua(D,F){let{batchSize:$=1024,deployless:J=!1,wait:Q=0}=typeof D.batch?.multicall==="object"?D.batch.multicall:{},{blockNumber:Z,blockTag:X=D.experimental_blockTag??"latest",data:Y,to:q}=F,G=(()=>{if(J)return null;if(F.multicallAddress)return F.multicallAddress;if(D.chain)return E2({blockNumber:Z,chain:D.chain,contract:"multicall3"});throw new wQ})(),W=(typeof Z==="bigint"?k(Z):void 0)||X,{schedule:K}=nQ({id:`${D.uid}.${W}`,wait:Q,shouldSplitBatch(H){return H.reduce((_,{data:O})=>_+(O.length-2),0)>$*2},fn:async(H)=>{let z=H.map((C)=>({allowFailure:!0,callData:C.data,target:C.to})),_=ED({abi:m2,args:[z],functionName:"aggregate3"}),O=await D.request({method:"eth_call",params:[{...G===null?{data:Zw({code:W7,data:_})}:{to:G,data:_}},W]});return O0({abi:m2,args:[z],functionName:"aggregate3",data:O||"0x"})}}),[{returnData:U,success:V}]=await K({data:Y,to:q});if(!V)throw new T8({data:U});if(U==="0x")return{data:void 0};return{data:U}}function Zw(D){let{code:F,data:$}=D;return q3({abi:c9(["constructor(bytes, bytes)"]),bytecode:pQ,args:[F,$]})}function ga(D){let{data:F,factory:$,factoryData:J,to:Q}=D;return q3({abi:c9(["constructor(address, bytes, address, bytes)"]),bytecode:aI,args:[Q,F,$,J]})}function ma(D){if(!(D instanceof P))return;let F=D.walk();return typeof F?.data==="object"?F.data?.data:F.data}var U3=x(()=>{A6();CW();z8();s();NQ();q1();Y1();lQ();a0();tF();c();MW();S8();EW();iQ();x8()});function oa(D,F,$,J){if(typeof D.setBigUint64==="function")return D.setBigUint64(F,$,J);let Q=BigInt(32),Z=BigInt(4294967295),X=Number($>>Q&Z),Y=Number($&Z),q=J?4:0,G=J?0:4;D.setUint32(F+q,X,J),D.setUint32(F+G,Y,J)}function Mw(D,F,$){return D&F^~D&$}function Ow(D,F,$){return D&F^D&$^F&$}var jW,C1;var Ew=x(()=>{d1();jW=class jW extends aF{constructor(D,F,$,J){super();this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=D,this.outputLen=F,this.padOffset=$,this.isLE=J,this.buffer=new Uint8Array(D),this.view=VQ(this.buffer)}update(D){Q1(this),D=oF(D),_8(D);let{view:F,buffer:$,blockLen:J}=this,Q=D.length;for(let Z=0;Z<Q;){let X=Math.min(J-this.pos,Q-Z);if(X===J){let Y=VQ(D);for(;J<=Q-Z;Z+=J)this.process(Y,Z);continue}if($.set(D.subarray(Z,Z+X),this.pos),this.pos+=X,Z+=X,this.pos===J)this.process(F,0),this.pos=0}return this.length+=D.length,this.roundClean(),this}digestInto(D){Q1(this),UQ(D,this),this.finished=!0;let{buffer:F,view:$,blockLen:J,isLE:Q}=this,{pos:Z}=this;if(F[Z++]=128,M8(this.buffer.subarray(Z)),this.padOffset>J-Z)this.process($,0),Z=0;for(let B=Z;B<J;B++)F[B]=0;oa($,J-8,BigInt(this.length*8),Q),this.process($,0);let X=VQ(D),Y=this.outputLen;if(Y%4)throw Error("_sha2: outputLen should be aligned to 32bit");let q=Y/4,G=this.get();if(q>G.length)throw Error("_sha2: outputLen bigger than state");for(let B=0;B<q;B++)X.setUint32(4*B,G[B],Q)}digest(){let{buffer:D,outputLen:F}=this;this.digestInto(D);let $=D.slice(0,F);return this.destroy(),$}_cloneInto(D){D||(D=new this.constructor),D.set(...this.get());let{blockLen:F,buffer:$,length:J,finished:Q,destroyed:Z,pos:X}=this;if(D.destroyed=Z,D.finished=Q,D.length=J,D.pos=X,J%F)D.buffer.set($);return D}clone(){return this._cloneInto()}};C1=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225])});var aa,e1,SW,H3;var xW=x(()=>{Ew();d1();aa=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),e1=new Uint32Array(64);SW=class SW extends jW{constructor(D=32){super(64,D,8,!1);this.A=C1[0]|0,this.B=C1[1]|0,this.C=C1[2]|0,this.D=C1[3]|0,this.E=C1[4]|0,this.F=C1[5]|0,this.G=C1[6]|0,this.H=C1[7]|0}get(){let{A:D,B:F,C:$,D:J,E:Q,F:Z,G:X,H:Y}=this;return[D,F,$,J,Q,Z,X,Y]}set(D,F,$,J,Q,Z,X,Y){this.A=D|0,this.B=F|0,this.C=$|0,this.D=J|0,this.E=Q|0,this.F=Z|0,this.G=X|0,this.H=Y|0}process(D,F){for(let B=0;B<16;B++,F+=4)e1[B]=D.getUint32(F,!1);for(let B=16;B<64;B++){let W=e1[B-15],K=e1[B-2],U=l2(W,7)^l2(W,18)^W>>>3,V=l2(K,17)^l2(K,19)^K>>>10;e1[B]=V+e1[B-7]+U+e1[B-16]|0}let{A:$,B:J,C:Q,D:Z,E:X,F:Y,G:q,H:G}=this;for(let B=0;B<64;B++){let W=l2(X,6)^l2(X,11)^l2(X,25),K=G+W+Mw(X,Y,q)+aa[B]+e1[B]|0,V=(l2($,2)^l2($,13)^l2($,22))+Ow($,J,Q)|0;G=q,q=Y,Y=X,X=Z+K|0,Z=Q,Q=J,J=$,$=K+V|0}$=$+this.A|0,J=J+this.B|0,Q=Q+this.C|0,Z=Z+this.D|0,X=X+this.E|0,Y=Y+this.F|0,q=q+this.G|0,G=G+this.H|0,this.set($,J,Q,Z,X,Y,q,G)}roundClean(){M8(e1)}destroy(){this.set(0,0,0,0,0,0,0,0),M8(this.buffer)}};H3=HQ(()=>new SW)});var kW,yW=(D,F,$)=>new kW(D,F).update($).digest();var Rw=x(()=>{d1();kW=class kW extends aF{constructor(D,F){super();this.finished=!1,this.destroyed=!1,SA(D);let $=oF(F);if(this.iHash=D.create(),typeof this.iHash.update!=="function")throw Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let J=this.blockLen,Q=new Uint8Array(J);Q.set($.length>J?D.create().update($).digest():$);for(let Z=0;Z<Q.length;Z++)Q[Z]^=54;this.iHash.update(Q),this.oHash=D.create();for(let Z=0;Z<Q.length;Z++)Q[Z]^=106;this.oHash.update(Q),M8(Q)}update(D){return Q1(this),this.iHash.update(D),this}digestInto(D){Q1(this),_8(D,this.outputLen),this.finished=!0,this.iHash.digestInto(D),this.oHash.update(D),this.oHash.digestInto(D),this.destroy()}digest(){let D=new Uint8Array(this.oHash.outputLen);return this.digestInto(D),D}_cloneInto(D){D||(D=Object.create(Object.getPrototypeOf(this),{}));let{oHash:F,iHash:$,finished:J,destroyed:Q,blockLen:Z,outputLen:X}=this;return D=D,D.finished=J,D.destroyed=Q,D.blockLen=Z,D.outputLen=X,D.oHash=F._cloneInto(D.oHash),D.iHash=$._cloneInto(D.iHash),D}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};yW.create=(D,F)=>new kW(D,F)});function pD(D,F){let $=D%F;return $>=b0?$:F+$}function K2(D,F,$){let J=D;while(F-- >b0)J*=J,J%=$;return J}function DZ(D,F){if(D===b0)throw Error("invert: expected non-zero number");if(F<=b0)throw Error("invert: expected positive modulus, got "+F);let $=pD(D,F),J=F,Q=b0,Z=E0,X=E0,Y=b0;while($!==b0){let G=J/$,B=J%$,W=Q-X*G,K=Z-Y*G;J=$,$=B,Q=X,Z=Y,X=W,Y=K}if(J!==E0)throw Error("invert: does not exist");return pD(Q,F)}function Tw(D,F){let $=(D.ORDER+E0)/Iw,J=D.pow(F,$);if(!D.eql(D.sqr(J),F))throw Error("Cannot find square root");return J}function sa(D,F){let $=(D.ORDER-ww)/Nw,J=D.mul(F,z3),Q=D.pow(J,$),Z=D.mul(F,Q),X=D.mul(D.mul(Z,z3),Q),Y=D.mul(Z,D.sub(X,D.ONE));if(!D.eql(D.sqr(Y),F))throw Error("Cannot find square root");return Y}function ta(D){if(D<BigInt(3))throw Error("sqrt is not defined for small field");let F=D-E0,$=0;while(F%z3===b0)F/=z3,$++;let J=z3,Q=T4(D);while(Aw(Q,J)===1)if(J++>1000)throw Error("Cannot find square root: probably non-prime P");if($===1)return Tw;let Z=Q.pow(J,F),X=(F+E0)/z3;return function(q,G){if(q.is0(G))return G;if(Aw(q,G)!==1)throw Error("Cannot find square root");let B=$,W=q.mul(q.ONE,Z),K=q.pow(G,F),U=q.pow(G,X);while(!q.eql(K,q.ONE)){if(q.is0(K))return q.ZERO;let V=1,H=q.sqr(K);while(!q.eql(H,q.ONE))if(V++,H=q.sqr(H),V===B)throw Error("Cannot find square root");let z=E0<<BigInt(B-V-1),_=q.pow(W,z);B=V,W=q.sqr(_),K=q.mul(K,W),U=q.mul(U,_)}return U}}function ea(D){if(D%Iw===ra)return Tw;if(D%Nw===ww)return sa;return ta(D)}function FZ(D){let F={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},$=Dr.reduce((J,Q)=>{return J[Q]="function",J},F);return V1(D,$)}function Fr(D,F,$){if($<b0)throw Error("invalid exponent, negatives unsupported");if($===b0)return D.ONE;if($===E0)return F;let J=D.ONE,Q=F;while($>b0){if($&E0)J=D.mul(J,Q);Q=D.sqr(Q),$>>=E0}return J}function V7(D,F,$=!1){let J=Array(F.length).fill($?D.ZERO:void 0),Q=F.reduce((X,Y,q)=>{if(D.is0(Y))return X;return J[q]=X,D.mul(X,Y)},D.ONE),Z=D.inv(Q);return F.reduceRight((X,Y,q)=>{if(D.is0(Y))return X;return J[q]=D.mul(X,J[q]),D.mul(X,Y)},Z),J}function Aw(D,F){let $=(D.ORDER-E0)/z3,J=D.pow(F,$),Q=D.eql(J,D.ONE),Z=D.eql(J,D.ZERO),X=D.eql(J,D.neg(D.ONE));if(!Q&&!Z&&!X)throw Error("invalid Legendre symbol result");return Q?1:Z?0:-1}function fW(D,F){if(F!==void 0)iF(F);let $=F!==void 0?F:D.toString(2).length,J=Math.ceil($/8);return{nBitLength:$,nByteLength:J}}function T4(D,F,$=!1,J={}){if(D<=b0)throw Error("invalid field: expected ORDER > 0, got "+D);let{nBitLength:Q,nByteLength:Z}=fW(D,F);if(Z>2048)throw Error("invalid field: expected ORDER of <= 2048 bytes");let X,Y=Object.freeze({ORDER:D,isLE:$,BITS:Q,BYTES:Z,MASK:X3(Q),ZERO:b0,ONE:E0,create:(q)=>pD(q,D),isValid:(q)=>{if(typeof q!=="bigint")throw Error("invalid field element: expected bigint, got "+typeof q);return b0<=q&&q<D},is0:(q)=>q===b0,isOdd:(q)=>(q&E0)===E0,neg:(q)=>pD(-q,D),eql:(q,G)=>q===G,sqr:(q)=>pD(q*q,D),add:(q,G)=>pD(q+G,D),sub:(q,G)=>pD(q-G,D),mul:(q,G)=>pD(q*G,D),pow:(q,G)=>Fr(Y,q,G),div:(q,G)=>pD(q*DZ(G,D),D),sqrN:(q)=>q*q,addN:(q,G)=>q+G,subN:(q,G)=>q-G,mulN:(q,G)=>q*G,inv:(q)=>DZ(q,D),sqrt:J.sqrt||((q)=>{if(!X)X=ea(D);return X(Y,q)}),toBytes:(q)=>$?$W(q,Z):L8(q,Z),fromBytes:(q)=>{if(q.length!==Z)throw Error("Field.fromBytes: expected "+Z+" bytes, got "+q.length);return $?FW(q):r0(q)},invertBatch:(q)=>V7(Y,q),cmov:(q,G,B)=>B?G:q});return Object.freeze(Y)}function Lw(D){if(typeof D!=="bigint")throw Error("field order must be bigint");let F=D.toString(2).length;return Math.ceil(F/8)}function bW(D){let F=Lw(D);return F+Math.ceil(F/2)}function Pw(D,F,$=!1){let J=D.length,Q=Lw(F),Z=bW(F);if(J<16||J<Z||J>1024)throw Error("expected "+Z+"-1024 bytes of input, got "+J);let X=$?FW(D):r0(D),Y=pD(X,F-E0)+E0;return $?$W(Y,Q):L8(Y,Q)}var b0,E0,z3,ra,Iw,ww,Nw,Dr;var L4=x(()=>{d1();Z7();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */b0=BigInt(0),E0=BigInt(1),z3=BigInt(2),ra=BigInt(3),Iw=BigInt(4),ww=BigInt(5),Nw=BigInt(8);Dr=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"]});function vW(D,F){let $=F.negate();return D?$:F}function xw(D,F){if(!Number.isSafeInteger(D)||D<=0||D>F)throw Error("invalid window size, expected [1.."+F+"], got W="+D)}function hW(D,F){xw(D,F);let $=Math.ceil(F/D)+1,J=2**(D-1),Q=2**D,Z=X3(D),X=BigInt(D);return{windows:$,windowSize:J,mask:Z,maxNumber:Q,shiftBy:X}}function Sw(D,F,$){let{windowSize:J,mask:Q,maxNumber:Z,shiftBy:X}=$,Y=Number(D&Q),q=D>>X;if(Y>J)Y-=Z,q+=mW;let G=F*J,B=G+Math.abs(Y)-1,W=Y===0,K=Y<0,U=F%2!==0;return{nextN:q,offset:B,isZero:W,isNeg:K,isNegF:U,offsetF:G}}function $r(D,F){if(!Array.isArray(D))throw Error("array expected");D.forEach(($,J)=>{if(!($ instanceof F))throw Error("invalid point at index "+J)})}function Jr(D,F){if(!Array.isArray(D))throw Error("array of scalars expected");D.forEach(($,J)=>{if(!F.isValid($))throw Error("invalid scalar at index "+J)})}function gW(D){return kw.get(D)||1}function yw(D,F){return{constTimeNegate:vW,hasPrecomputes($){return gW($)!==1},unsafeLadder($,J,Q=D.ZERO){let Z=$;while(J>jw){if(J&mW)Q=Q.add(Z);Z=Z.double(),J>>=mW}return Q},precomputeWindow($,J){let{windows:Q,windowSize:Z}=hW(J,F),X=[],Y=$,q=Y;for(let G=0;G<Q;G++){q=Y,X.push(q);for(let B=1;B<Z;B++)q=q.add(Y),X.push(q);Y=q.double()}return X},wNAF($,J,Q){let{ZERO:Z,BASE:X}=D,Y=hW($,F);for(let q=0;q<Y.windows;q++){let{nextN:G,offset:B,isZero:W,isNeg:K,isNegF:U,offsetF:V}=Sw(Q,q,Y);if(Q=G,W)X=X.add(vW(U,J[V]));else Z=Z.add(vW(K,J[B]))}return{p:Z,f:X}},wNAFUnsafe($,J,Q,Z=D.ZERO){let X=hW($,F);for(let Y=0;Y<X.windows;Y++){if(Q===jw)break;let{nextN:q,offset:G,isZero:B,isNeg:W}=Sw(Q,Y,X);if(Q=q,B)continue;else{let K=J[G];Z=Z.add(W?K.negate():K)}}return Z},getPrecomputes($,J,Q){let Z=uW.get(J);if(!Z){if(Z=this.precomputeWindow(J,$),$!==1)uW.set(J,Q(Z))}return Z},wNAFCached($,J,Q){let Z=gW($);return this.wNAF(Z,this.getPrecomputes(Z,$,Q),J)},wNAFCachedUnsafe($,J,Q,Z){let X=gW($);if(X===1)return this.unsafeLadder($,J,Z);return this.wNAFUnsafe(X,this.getPrecomputes(X,$,Q),J,Z)},setWindowSize($,J){xw(J,F),kw.set($,J),uW.delete($)}}}function fw(D,F,$,J){$r($,D),Jr(J,F);let Q=$.length,Z=J.length;if(Q!==Z)throw Error("arrays of points and scalars must have equal length");let X=D.ZERO,Y=AI(BigInt(Q)),q=1;if(Y>12)q=Y-3;else if(Y>4)q=Y-2;else if(Y>0)q=2;let G=X3(q),B=Array(Number(G)+1).fill(X),W=Math.floor((F.BITS-1)/q)*q,K=X;for(let U=W;U>=0;U-=q){B.fill(X);for(let H=0;H<Z;H++){let z=J[H],_=Number(z>>BigInt(U)&G);B[_]=B[_].add($[H])}let V=X;for(let H=B.length-1,z=X;H>0;H--)z=z.add(B[H]),V=V.add(z);if(K=K.add(V),U!==0)for(let H=0;H<q;H++)K=K.double()}return K}function dW(D){return FZ(D.Fp),V1(D,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...fW(D.n,D.nBitLength),...D,...{p:D.Fp.ORDER}})}var jw,mW,uW,kw;var bw=x(()=>{L4();Z7();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */jw=BigInt(0),mW=BigInt(1);uW=new WeakMap,kw=new WeakMap});function vw(D){if(D.lowS!==void 0)J7("lowS",D.lowS);if(D.prehash!==void 0)J7("prehash",D.prehash)}function Qr(D){let F=dW(D);V1(F,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});let{endo:$,Fp:J,a:Q}=F;if($){if(!J.eql(Q,J.ZERO))throw Error("invalid endo: CURVE.a must be 0");if(typeof $!=="object"||typeof $.beta!=="bigint"||typeof $.splitScalar!=="function")throw Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...F})}function pW(D,F){return Q7(L8(D,F))}function Zr(D){let F=Qr(D),{Fp:$}=F,J=T4(F.n,F.nBitLength),Q=F.toBytes||((C,M,E)=>{let A=M.toAffine();return f0(Uint8Array.from([4]),$.toBytes(A.x),$.toBytes(A.y))}),Z=F.fromBytes||((C)=>{let M=C.subarray(1),E=$.fromBytes(M.subarray(0,$.BYTES)),A=$.fromBytes(M.subarray($.BYTES,2*$.BYTES));return{x:E,y:A}});function X(C){let{a:M,b:E}=F,A=$.sqr(C),w=$.mul(A,C);return $.add($.add(w,$.mul(C,M)),E)}function Y(C,M){let E=$.sqr(M),A=X(C);return $.eql(E,A)}if(!Y(F.Gx,F.Gy))throw Error("bad curve params: generator point");let q=$.mul($.pow(F.a,P4),lW),G=$.mul($.sqr(F.b),BigInt(27));if($.is0($.add(q,G)))throw Error("bad curve params: a or b");function B(C){return Z3(C,CD,F.n)}function W(C){let{allowedPrivateKeyLengths:M,nByteLength:E,wrapPrivateKey:A,n:w}=F;if(M&&typeof C!=="bigint"){if($7(C))C=Q7(C);if(typeof C!=="string"||!M.includes(C.length))throw Error("invalid private key");C=C.padStart(E*2,"0")}let R;try{R=typeof C==="bigint"?C:r0(oD("private key",C,E))}catch(T){throw Error("invalid private key, expected hex or "+E+" bytes, got "+typeof C)}if(A)R=pD(R,w);return U1("private key",R,CD,w),R}function K(C){if(!(C instanceof H))throw Error("ProjectivePoint expected")}let U=JW((C,M)=>{let{px:E,py:A,pz:w}=C;if($.eql(w,$.ONE))return{x:E,y:A};let R=C.is0();if(M==null)M=R?$.ONE:$.inv(w);let T=$.mul(E,M),N=$.mul(A,M),j=$.mul(w,M);if(R)return{x:$.ZERO,y:$.ZERO};if(!$.eql(j,$.ONE))throw Error("invZ was invalid");return{x:T,y:N}}),V=JW((C)=>{if(C.is0()){if(F.allowInfinityPoint&&!$.is0(C.py))return;throw Error("bad point: ZERO")}let{x:M,y:E}=C.toAffine();if(!$.isValid(M)||!$.isValid(E))throw Error("bad point: x or y not FE");if(!Y(M,E))throw Error("bad point: equation left != right");if(!C.isTorsionFree())throw Error("bad point: not in prime-order subgroup");return!0});class H{constructor(C,M,E){if(C==null||!$.isValid(C))throw Error("x required");if(M==null||!$.isValid(M)||$.is0(M))throw Error("y required");if(E==null||!$.isValid(E))throw Error("z required");this.px=C,this.py=M,this.pz=E,Object.freeze(this)}static fromAffine(C){let{x:M,y:E}=C||{};if(!C||!$.isValid(M)||!$.isValid(E))throw Error("invalid affine point");if(C instanceof H)throw Error("projective point not allowed");let A=(w)=>$.eql(w,$.ZERO);if(A(M)&&A(E))return H.ZERO;return new H(M,E,$.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(C){let M=V7($,C.map((E)=>E.pz));return C.map((E,A)=>E.toAffine(M[A])).map(H.fromAffine)}static fromHex(C){let M=H.fromAffine(Z(oD("pointHex",C)));return M.assertValidity(),M}static fromPrivateKey(C){return H.BASE.multiply(W(C))}static msm(C,M){return fw(H,J,C,M)}_setWindowSize(C){O.setWindowSize(this,C)}assertValidity(){V(this)}hasEvenY(){let{y:C}=this.toAffine();if($.isOdd)return!$.isOdd(C);throw Error("Field doesn't support isOdd")}equals(C){K(C);let{px:M,py:E,pz:A}=this,{px:w,py:R,pz:T}=C,N=$.eql($.mul(M,T),$.mul(w,A)),j=$.eql($.mul(E,T),$.mul(R,A));return N&&j}negate(){return new H(this.px,$.neg(this.py),this.pz)}double(){let{a:C,b:M}=F,E=$.mul(M,P4),{px:A,py:w,pz:R}=this,T=$.ZERO,N=$.ZERO,j=$.ZERO,L=$.mul(A,A),y=$.mul(w,w),m=$.mul(R,R),S=$.mul(A,w);return S=$.add(S,S),j=$.mul(A,R),j=$.add(j,j),T=$.mul(C,j),N=$.mul(E,m),N=$.add(T,N),T=$.sub(y,N),N=$.add(y,N),N=$.mul(T,N),T=$.mul(S,T),j=$.mul(E,j),m=$.mul(C,m),S=$.sub(L,m),S=$.mul(C,S),S=$.add(S,j),j=$.add(L,L),L=$.add(j,L),L=$.add(L,m),L=$.mul(L,S),N=$.add(N,L),m=$.mul(w,R),m=$.add(m,m),L=$.mul(m,S),T=$.sub(T,L),j=$.mul(m,y),j=$.add(j,j),j=$.add(j,j),new H(T,N,j)}add(C){K(C);let{px:M,py:E,pz:A}=this,{px:w,py:R,pz:T}=C,N=$.ZERO,j=$.ZERO,L=$.ZERO,y=F.a,m=$.mul(F.b,P4),S=$.mul(M,w),h=$.mul(E,R),g=$.mul(A,T),b=$.add(M,E),u=$.add(w,R);b=$.mul(b,u),u=$.add(S,h),b=$.sub(b,u),u=$.add(M,A);let o=$.add(w,T);return u=$.mul(u,o),o=$.add(S,g),u=$.sub(u,o),o=$.add(E,A),N=$.add(R,T),o=$.mul(o,N),N=$.add(h,g),o=$.sub(o,N),L=$.mul(y,u),N=$.mul(m,g),L=$.add(N,L),N=$.sub(h,L),L=$.add(h,L),j=$.mul(N,L),h=$.add(S,S),h=$.add(h,S),g=$.mul(y,g),u=$.mul(m,u),h=$.add(h,g),g=$.sub(S,g),g=$.mul(y,g),u=$.add(u,g),S=$.mul(h,u),j=$.add(j,S),S=$.mul(o,u),N=$.mul(b,N),N=$.sub(N,S),S=$.mul(b,h),L=$.mul(o,L),L=$.add(L,S),new H(N,j,L)}subtract(C){return this.add(C.negate())}is0(){return this.equals(H.ZERO)}wNAF(C){return O.wNAFCached(this,C,H.normalizeZ)}multiplyUnsafe(C){let{endo:M,n:E}=F;U1("scalar",C,r2,E);let A=H.ZERO;if(C===r2)return A;if(this.is0()||C===CD)return this;if(!M||O.hasPrecomputes(this))return O.wNAFCachedUnsafe(this,C,H.normalizeZ);let{k1neg:w,k1:R,k2neg:T,k2:N}=M.splitScalar(C),j=A,L=A,y=this;while(R>r2||N>r2){if(R&CD)j=j.add(y);if(N&CD)L=L.add(y);y=y.double(),R>>=CD,N>>=CD}if(w)j=j.negate();if(T)L=L.negate();return L=new H($.mul(L.px,M.beta),L.py,L.pz),j.add(L)}multiply(C){let{endo:M,n:E}=F;U1("scalar",C,CD,E);let A,w;if(M){let{k1neg:R,k1:T,k2neg:N,k2:j}=M.splitScalar(C),{p:L,f:y}=this.wNAF(T),{p:m,f:S}=this.wNAF(j);L=O.constTimeNegate(R,L),m=O.constTimeNegate(N,m),m=new H($.mul(m.px,M.beta),m.py,m.pz),A=L.add(m),w=y.add(S)}else{let{p:R,f:T}=this.wNAF(C);A=R,w=T}return H.normalizeZ([A,w])[0]}multiplyAndAddUnsafe(C,M,E){let A=H.BASE,w=(T,N)=>N===r2||N===CD||!T.equals(A)?T.multiplyUnsafe(N):T.multiply(N),R=w(this,M).add(w(C,E));return R.is0()?void 0:R}toAffine(C){return U(this,C)}isTorsionFree(){let{h:C,isTorsionFree:M}=F;if(C===CD)return!0;if(M)return M(H,this);throw Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:C,clearCofactor:M}=F;if(C===CD)return this;if(M)return M(H,this);return this.multiplyUnsafe(F.h)}toRawBytes(C=!0){return J7("isCompressed",C),this.assertValidity(),Q(H,this,C)}toHex(C=!0){return J7("isCompressed",C),Q7(this.toRawBytes(C))}}H.BASE=new H(F.Gx,F.Gy,$.ONE),H.ZERO=new H($.ZERO,$.ONE,$.ZERO);let{endo:z,nBitLength:_}=F,O=yw(H,z?Math.ceil(_/2):_);return{CURVE:F,ProjectivePoint:H,normPrivateKeyToScalar:W,weierstrassEquation:X,isWithinCurveOrder:B}}function Xr(D){let F=dW(D);return V1(F,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...F})}function uw(D){let F=Xr(D),{Fp:$,n:J,nByteLength:Q,nBitLength:Z}=F,X=$.BYTES+1,Y=2*$.BYTES+1;function q(S){return pD(S,J)}function G(S){return DZ(S,J)}let{ProjectivePoint:B,normPrivateKeyToScalar:W,weierstrassEquation:K,isWithinCurveOrder:U}=Zr({...F,toBytes(S,h,g){let b=h.toAffine(),u=$.toBytes(b.x),o=f0;if(J7("isCompressed",g),g)return o(Uint8Array.from([h.hasEvenY()?2:3]),u);else return o(Uint8Array.from([4]),u,$.toBytes(b.y))},fromBytes(S){let h=S.length,g=S[0],b=S.subarray(1);if(h===X&&(g===2||g===3)){let u=r0(b);if(!Z3(u,CD,$.ORDER))throw Error("Point is not on curve");let o=K(u),cD;try{cD=$.sqrt(o)}catch($2){let _0=$2 instanceof Error?": "+$2.message:"";throw Error("Point is not on curve"+_0)}let RD=(cD&CD)===CD;if((g&1)===1!==RD)cD=$.neg(cD);return{x:u,y:cD}}else if(h===Y&&g===4){let u=$.fromBytes(b.subarray(0,$.BYTES)),o=$.fromBytes(b.subarray($.BYTES,2*$.BYTES));return{x:u,y:o}}else{let u=X,o=Y;throw Error("invalid Point, expected length of "+u+", or uncompressed "+o+", got "+h)}}});function V(S){let h=J>>CD;return S>h}function H(S){return V(S)?q(-S):S}let z=(S,h,g)=>r0(S.slice(h,g));class _{constructor(S,h,g){if(U1("r",S,CD,J),U1("s",h,CD,J),this.r=S,this.s=h,g!=null)this.recovery=g;Object.freeze(this)}static fromCompact(S){let h=Q;return S=oD("compactSignature",S,h*2),new _(z(S,0,h),z(S,h,2*h))}static fromDER(S){let{r:h,s:g}=_1.toSig(oD("DER",S));return new _(h,g)}assertValidity(){}addRecoveryBit(S){return new _(this.r,this.s,S)}recoverPublicKey(S){let{r:h,s:g,recovery:b}=this,u=w(oD("msgHash",S));if(b==null||![0,1,2,3].includes(b))throw Error("recovery id invalid");let o=b===2||b===3?h+F.n:h;if(o>=$.ORDER)throw Error("recovery id 2 or 3 invalid");let cD=(b&1)===0?"02":"03",RD=B.fromHex(cD+pW(o,$.BYTES)),V2=G(o),$2=q(-u*V2),_0=q(g*V2),y1=B.BASE.multiplyAndAddUnsafe(RD,$2,_0);if(!y1)throw Error("point at infinify");return y1.assertValidity(),y1}hasHighS(){return V(this.s)}normalizeS(){return this.hasHighS()?new _(this.r,q(-this.s),this.recovery):this}toDERRawBytes(){return V4(this.toDERHex())}toDERHex(){return _1.hexFromSig(this)}toCompactRawBytes(){return V4(this.toCompactHex())}toCompactHex(){let S=Q;return pW(this.r,S)+pW(this.s,S)}}let O={isValidPrivateKey(S){try{return W(S),!0}catch(h){return!1}},normPrivateKeyToScalar:W,randomPrivateKey:()=>{let S=bW(F.n);return Pw(F.randomBytes(S),F.n)},precompute(S=8,h=B.BASE){return h._setWindowSize(S),h.multiply(BigInt(3)),h}};function C(S,h=!0){return B.fromPrivateKey(S).toRawBytes(h)}function M(S){if(typeof S==="bigint")return!1;if(S instanceof B)return!0;let g=oD("key",S).length,b=$.BYTES,u=b+1,o=2*b+1;if(F.allowedPrivateKeyLengths||Q===u)return;else return g===u||g===o}function E(S,h,g=!0){if(M(S)===!0)throw Error("first arg must be private key");if(M(h)===!1)throw Error("second arg must be public key");return B.fromHex(h).multiply(W(S)).toRawBytes(g)}let A=F.bits2int||function(S){if(S.length>8192)throw Error("input is too large");let h=r0(S),g=S.length*8-Z;return g>0?h>>BigInt(g):h},w=F.bits2int_modN||function(S){return q(A(S))},R=X3(Z);function T(S){return U1("num < 2^"+Z,S,r2,R),L8(S,Q)}function N(S,h,g=j){if(["recovered","canonical"].some((SF)=>(SF in g)))throw Error("sign() legacy options not supported");let{hash:b,randomBytes:u}=F,{lowS:o,prehash:cD,extraEntropy:RD}=g;if(o==null)o=!0;if(S=oD("msgHash",S),vw(g),cD)S=oD("prehashed msgHash",b(S));let V2=w(S),$2=W(h),_0=[T($2),T(V2)];if(RD!=null&&RD!==!1){let SF=RD===!0?u($.BYTES):RD;_0.push(oD("extraEntropy",SF))}let y1=f0(..._0),H$=V2;function tY(SF){let e3=A(SF);if(!U(e3))return;let eY=G(e3),R9=B.BASE.multiply(e3).toAffine(),xF=q(R9.x);if(xF===r2)return;let A9=q(eY*q(H$+xF*$2));if(A9===r2)return;let D6=(R9.x===xF?0:2)|Number(R9.y&CD),Wz=A9;if(o&&V(A9))Wz=H(A9),D6^=1;return new _(xF,Wz,D6)}return{seed:y1,k2sig:tY}}let j={lowS:F.lowS,prehash:!1},L={lowS:F.lowS,prehash:!1};function y(S,h,g=j){let{seed:b,k2sig:u}=N(S,h,g),o=F;return II(o.hash.outputLen,o.nByteLength,o.hmac)(b,u)}B.BASE._setWindowSize(8);function m(S,h,g,b=L){let u=S;h=oD("msgHash",h),g=oD("publicKey",g);let{lowS:o,prehash:cD,format:RD}=b;if(vw(b),"strict"in b)throw Error("options.strict was renamed to lowS");if(RD!==void 0&&RD!=="compact"&&RD!=="der")throw Error("format must be compact or der");let V2=typeof u==="string"||$7(u),$2=!V2&&!RD&&typeof u==="object"&&u!==null&&typeof u.r==="bigint"&&typeof u.s==="bigint";if(!V2&&!$2)throw Error("invalid signature, expected Uint8Array, hex string or Signature instance");let _0=void 0,y1;try{if($2)_0=new _(u.r,u.s);if(V2){try{if(RD!=="compact")_0=_.fromDER(u)}catch(D6){if(!(D6 instanceof _1.Err))throw D6}if(!_0&&RD!=="der")_0=_.fromCompact(u)}y1=B.fromHex(g)}catch(D6){return!1}if(!_0)return!1;if(o&&_0.hasHighS())return!1;if(cD)h=F.hash(h);let{r:H$,s:tY}=_0,SF=w(h),e3=G(tY),eY=q(SF*e3),R9=q(H$*e3),xF=B.BASE.multiplyAndAddUnsafe(y1,eY,R9)?.toAffine();if(!xF)return!1;return q(xF.x)===H$}return{CURVE:F,getPublicKey:C,getSharedSecret:E,sign:y,verify:m,ProjectivePoint:B,Signature:_,utils:O}}function Yr(D,F){let $=D.ORDER,J=r2;for(let V=$-CD;V%DF===r2;V/=DF)J+=CD;let Q=J,Z=DF<<Q-CD-CD,X=Z*DF,Y=($-CD)/X,q=(Y-CD)/DF,G=X-CD,B=Z,W=D.pow(F,Y),K=D.pow(F,(Y+CD)/DF),U=(V,H)=>{let z=W,_=D.pow(H,G),O=D.sqr(_);O=D.mul(O,H);let C=D.mul(V,O);C=D.pow(C,q),C=D.mul(C,_),_=D.mul(C,H),O=D.mul(C,V);let M=D.mul(O,_);C=D.pow(M,B);let E=D.eql(C,D.ONE);_=D.mul(O,K),C=D.mul(M,z),O=D.cmov(_,O,E),M=D.cmov(C,M,E);for(let A=Q;A>CD;A--){let w=A-DF;w=DF<<w-CD;let R=D.pow(M,w),T=D.eql(R,D.ONE);_=D.mul(O,z),z=D.mul(z,z),R=D.mul(M,z),O=D.cmov(_,O,T),M=D.cmov(R,M,T)}return{isValid:E,value:O}};if(D.ORDER%lW===P4){let V=(D.ORDER-P4)/lW,H=D.sqrt(D.neg(F));U=(z,_)=>{let O=D.sqr(_),C=D.mul(z,_);O=D.mul(O,C);let M=D.pow(O,V);M=D.mul(M,C);let E=D.mul(M,H),A=D.mul(D.sqr(M),_),w=D.eql(A,z),R=D.cmov(E,M,w);return{isValid:w,value:R}}}return U}function gw(D,F){if(FZ(D),!D.isValid(F.A)||!D.isValid(F.B)||!D.isValid(F.Z))throw Error("mapToCurveSimpleSWU: invalid opts");let $=Yr(D,F.Z);if(!D.isOdd)throw Error("Fp.isOdd is not implemented!");return(J)=>{let Q,Z,X,Y,q,G,B,W;Q=D.sqr(J),Q=D.mul(Q,F.Z),Z=D.sqr(Q),Z=D.add(Z,Q),X=D.add(Z,D.ONE),X=D.mul(X,F.B),Y=D.cmov(F.Z,D.neg(Z),!D.eql(Z,D.ZERO)),Y=D.mul(Y,F.A),Z=D.sqr(X),G=D.sqr(Y),q=D.mul(G,F.A),Z=D.add(Z,q),Z=D.mul(Z,X),G=D.mul(G,Y),q=D.mul(G,F.B),Z=D.add(Z,q),B=D.mul(Q,X);let{isValid:K,value:U}=$(Z,G);W=D.mul(Q,J),W=D.mul(W,U),B=D.cmov(B,X,K),W=D.cmov(W,U,K);let V=D.isOdd(J)===D.isOdd(W);W=D.cmov(D.neg(W),W,V);let H=V7(D,[Y],!0)[0];return B=D.mul(B,H),{x:B,y:W}}}var hw,_1,r2,CD,DF,P4,lW;var cW=x(()=>{bw();L4();Z7();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */hw=class hw extends Error{constructor(D=""){super(D)}};_1={Err:hw,_tlv:{encode:(D,F)=>{let{Err:$}=_1;if(D<0||D>256)throw new $("tlv.encode: wrong tag");if(F.length&1)throw new $("tlv.encode: unpadded data");let J=F.length/2,Q=U4(J);if(Q.length/2&128)throw new $("tlv.encode: long form length too big");let Z=J>127?U4(Q.length/2|128):"";return U4(D)+Z+Q+F},decode(D,F){let{Err:$}=_1,J=0;if(D<0||D>256)throw new $("tlv.encode: wrong tag");if(F.length<2||F[J++]!==D)throw new $("tlv.decode: wrong tlv");let Q=F[J++],Z=!!(Q&128),X=0;if(!Z)X=Q;else{let q=Q&127;if(!q)throw new $("tlv.decode(long): indefinite length not supported");if(q>4)throw new $("tlv.decode(long): byte length is too big");let G=F.subarray(J,J+q);if(G.length!==q)throw new $("tlv.decode: length bytes not complete");if(G[0]===0)throw new $("tlv.decode(long): zero leftmost byte");for(let B of G)X=X<<8|B;if(J+=q,X<128)throw new $("tlv.decode(long): not minimal encoding")}let Y=F.subarray(J,J+X);if(Y.length!==X)throw new $("tlv.decode: wrong value length");return{v:Y,l:F.subarray(J+X)}}},_int:{encode(D){let{Err:F}=_1;if(D<r2)throw new F("integer: negative integers are not allowed");let $=U4(D);if(Number.parseInt($[0],16)&8)$="00"+$;if($.length&1)throw new F("unexpected DER parsing assertion: unpadded hex");return $},decode(D){let{Err:F}=_1;if(D[0]&128)throw new F("invalid signature integer: negative");if(D[0]===0&&!(D[1]&128))throw new F("invalid signature integer: unnecessary leading zero");return r0(D)}},toSig(D){let{Err:F,_int:$,_tlv:J}=_1,Q=oD("signature",D),{v:Z,l:X}=J.decode(48,Q);if(X.length)throw new F("invalid signature: left bytes after parsing");let{v:Y,l:q}=J.decode(2,Z),{v:G,l:B}=J.decode(2,q);if(B.length)throw new F("invalid signature: left bytes after parsing");return{r:$.decode(Y),s:$.decode(G)}},hexFromSig(D){let{_tlv:F,_int:$}=_1,J=F.encode(2,$.encode(D.r)),Q=F.encode(2,$.encode(D.s)),Z=J+Q;return F.encode(48,Z)}};r2=BigInt(0),CD=BigInt(1),DF=BigInt(2),P4=BigInt(3),lW=BigInt(4)});function qr(D){return{hash:D,hmac:(F,...$)=>yW(D,F,kA(...$)),randomBytes:zQ}}function mw(D,F){let $=(J)=>uw({...D,...qr(J)});return{...$(F),create:$}}var dw=x(()=>{Rw();d1();cW();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */});function FF(D,F){if(j4(D),j4(F),D<0||D>=1<<8*F)throw Error("invalid I2OSP input: "+D);let $=Array.from({length:F}).fill(0);for(let J=F-1;J>=0;J--)$[J]=D&255,D>>>=8;return new Uint8Array($)}function Br(D,F){let $=new Uint8Array(D.length);for(let J=0;J<D.length;J++)$[J]=D[J]^F[J];return $}function j4(D){if(!Number.isSafeInteger(D))throw Error("number expected")}function Wr(D,F,$,J){if(K1(D),K1(F),j4($),F.length>255)F=J(f0(fQ("H2C-OVERSIZE-DST-"),F));let{outputLen:Q,blockLen:Z}=J,X=Math.ceil($/Q);if($>65535||X>255)throw Error("expand_message_xmd: invalid lenInBytes");let Y=f0(F,FF(F.length,1)),q=FF(0,Z),G=FF($,2),B=Array(X),W=J(f0(q,D,G,FF(0,1),Y));B[0]=J(f0(W,FF(1,1),Y));for(let U=1;U<=X;U++){let V=[Br(W,B[U-1]),FF(U+1,1),Y];B[U]=J(f0(...V))}return f0(...B).slice(0,$)}function Kr(D,F,$,J,Q){if(K1(D),K1(F),j4($),F.length>255){let Z=Math.ceil(2*J/8);F=Q.create({dkLen:Z}).update(fQ("H2C-OVERSIZE-DST-")).update(F).digest()}if($>65535||F.length>255)throw Error("expand_message_xof: invalid lenInBytes");return Q.create({dkLen:$}).update(D).update(FF($,2)).update(F).update(FF(F.length,1)).digest()}function pw(D,F,$){V1($,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});let{p:J,k:Q,m:Z,hash:X,expand:Y,DST:q}=$;K1(D),j4(F);let G=typeof q==="string"?fQ(q):q,B=J.toString(2).length,W=Math.ceil((B+Q)/8),K=F*Z*W,U;if(Y==="xmd")U=Wr(D,G,K,X);else if(Y==="xof")U=Kr(D,G,K,Q,X);else if(Y==="_internal_pass")U=D;else throw Error('expand must be "xmd" or "xof"');let V=Array(F);for(let H=0;H<F;H++){let z=Array(Z);for(let _=0;_<Z;_++){let O=W*(_+H*Z),C=U.subarray(O,O+W);z[_]=pD(Gr(C),J)}V[H]=z}return V}function lw(D,F){let $=F.map((J)=>Array.from(J).reverse());return(J,Q)=>{let[Z,X,Y,q]=$.map((W)=>W.reduce((K,U)=>D.add(D.mul(K,J),U))),[G,B]=V7(D,[X,q],!0);return J=D.mul(Z,G),Q=D.mul(Q,D.mul(Y,B)),{x:J,y:Q}}}function cw(D,F,$){if(typeof F!=="function")throw Error("mapToCurve() must be defined");function J(Z){return D.fromAffine(F(Z))}function Q(Z){let X=Z.clearCofactor();if(X.equals(D.ZERO))return D.ZERO;return X.assertValidity(),X}return{defaults:$,hashToCurve(Z,X){let Y=pw(Z,2,{...$,DST:$.DST,...X}),q=J(Y[0]),G=J(Y[1]);return Q(q.add(G))},encodeToCurve(Z,X){let Y=pw(Z,1,{...$,DST:$.encodeDST,...X});return Q(J(Y[0]))},mapToCurve(Z){if(!Array.isArray(Z))throw Error("expected array of bigints");for(let X of Z)if(typeof X!=="bigint")throw Error("expected array of bigints");return Q(J(Z))}}}var Gr;var nw=x(()=>{L4();Z7();Gr=r0});var ew={};H2(ew,{secp256k1_hasher:()=>tW,secp256k1:()=>M1,schnorr:()=>zr,hashToCurve:()=>Mr,encodeToCurve:()=>Or});function aw(D){let F=k4,$=BigInt(3),J=BigInt(6),Q=BigInt(11),Z=BigInt(22),X=BigInt(23),Y=BigInt(44),q=BigInt(88),G=D*D*D%F,B=G*G*D%F,W=K2(B,$,F)*B%F,K=K2(W,$,F)*B%F,U=K2(K,JZ,F)*G%F,V=K2(U,Q,F)*U%F,H=K2(V,Z,F)*V%F,z=K2(H,Y,F)*H%F,_=K2(z,q,F)*z%F,O=K2(_,Y,F)*H%F,C=K2(O,$,F)*B%F,M=K2(C,X,F)*V%F,E=K2(M,J,F)*G%F,A=K2(E,JZ,F);if(!$F.eql($F.sqr(A),D))throw Error("Cannot find square root");return A}function QZ(D,...F){let $=ow[D];if($===void 0){let J=H3(Uint8Array.from(D,(Q)=>Q.charCodeAt(0)));$=f0(J,J),ow[D]=$}return H3(f0($,...F))}function oW(D){let F=M1.utils.normPrivateKeyToScalar(D),$=sW.fromPrivateKey(F);return{scalar:$.hasEvenY()?F:x4(-F),bytes:rW($)}}function rw(D){U1("x",D,S4,k4);let F=nW(D*D),$=nW(F*D+BigInt(7)),J=aw($);if(J%JZ!==aW)J=nW(-J);let Q=new sW(D,J,S4);return Q.assertValidity(),Q}function sw(...D){return x4(H7(QZ("BIP0340/challenge",...D)))}function Vr(D){return oW(D).bytes}function Hr(D,F,$=zQ(32)){let J=oD("message",D),{bytes:Q,scalar:Z}=oW(F),X=oD("auxRand",$,32),Y=iW(Z^H7(QZ("BIP0340/aux",X))),q=QZ("BIP0340/nonce",Y,Q,J),G=x4(H7(q));if(G===aW)throw Error("sign failed: k is zero");let{bytes:B,scalar:W}=oW(G),K=sw(B,Q,J),U=new Uint8Array(64);if(U.set(B,0),U.set(iW(x4(W+K*Z)),32),!tw(U,J,Q))throw Error("sign: Invalid signature produced");return U}function tw(D,F,$){let J=oD("signature",D,64),Q=oD("message",F),Z=oD("publicKey",$,32);try{let X=rw(H7(Z)),Y=H7(J.subarray(0,32));if(!Z3(Y,S4,k4))return!1;let q=H7(J.subarray(32,64));if(!Z3(q,S4,$Z))return!1;let G=sw(iW(Y),rW(X),Q),B=Ur(X,q,x4(-G));if(!B||!B.hasEvenY()||B.toAffine().x!==Y)return!1;return!0}catch(X){return!1}}var k4,$Z,aW,S4,JZ,iw=(D,F)=>(D+F/JZ)/F,$F,M1,ow,rW=(D)=>D.toRawBytes(!0).slice(1),iW=(D)=>L8(D,32),nW=(D)=>pD(D,k4),x4=(D)=>pD(D,$Z),sW,Ur=(D,F,$)=>sW.BASE.multiplyAndAddUnsafe(D,F,$),H7,zr,Cr,_r,tW,Mr,Or;var ZZ=x(()=>{xW();d1();dw();nw();L4();Z7();cW();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */k4=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),$Z=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),aW=BigInt(0),S4=BigInt(1),JZ=BigInt(2);$F=T4(k4,void 0,void 0,{sqrt:aw}),M1=mw({a:aW,b:BigInt(7),Fp:$F,n:$Z,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:(D)=>{let F=$Z,$=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),J=-S4*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),Q=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),Z=$,X=BigInt("0x100000000000000000000000000000000"),Y=iw(Z*D,F),q=iw(-J*D,F),G=pD(D-Y*$-q*Q,F),B=pD(-Y*J-q*Z,F),W=G>X,K=B>X;if(W)G=F-G;if(K)B=F-B;if(G>X||B>X)throw Error("splitScalar: Endomorphism failed, k="+D);return{k1neg:W,k1:G,k2neg:K,k2:B}}}},H3),ow={};sW=(()=>M1.ProjectivePoint)();H7=r0;zr=(()=>({getPublicKey:Vr,sign:Hr,verify:tw,utils:{randomPrivateKey:M1.utils.randomPrivateKey,lift_x:rw,pointToBytes:rW,numberToBytesBE:L8,bytesToNumberBE:r0,taggedHash:QZ,mod:pD}}))(),Cr=(()=>lw($F,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map((D)=>D.map((F)=>BigInt(F)))))(),_r=(()=>gw($F,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:$F.create(BigInt("-11"))}))(),tW=(()=>cw(M1.ProjectivePoint,(D)=>{let{x:F,y:$}=_r($F.create(D[0]));return Cr(F,$)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:$F.ORDER,m:1,k:128,expand:"xmd",hash:H3}))(),Mr=(()=>tW.hashToCurve)(),Or=(()=>tW.encodeToCurve)()});var aL=I((X60,hZ)=>{/*!
72
+ `),{cause:D,name:"TipAboveFeeCapError"})}};Object.defineProperty(B3,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});a2=class a2 extends P{constructor({cause:D}){super(`An error occurred while executing: ${D?.shortMessage}`,{cause:D,name:"UnknownNodeError"})}}});function s1(D,F){let $=(D.details||"").toLowerCase(),J=D instanceof P?D.walk((Q)=>Q?.code===r1.code):D;if(J instanceof P)return new r1({cause:D,message:J.details});if(r1.nodeMessage.test($))return new r1({cause:D,message:D.details});if(G3.nodeMessage.test($))return new G3({cause:D,maxFeePerGas:F?.maxFeePerGas});if(C4.nodeMessage.test($))return new C4({cause:D,maxFeePerGas:F?.maxFeePerGas});if(_4.nodeMessage.test($))return new _4({cause:D,nonce:F?.nonce});if(M4.nodeMessage.test($))return new M4({cause:D,nonce:F?.nonce});if(O4.nodeMessage.test($))return new O4({cause:D,nonce:F?.nonce});if(E4.nodeMessage.test($))return new E4({cause:D});if(R4.nodeMessage.test($))return new R4({cause:D,gas:F?.gas});if(A4.nodeMessage.test($))return new A4({cause:D,gas:F?.gas});if(I4.nodeMessage.test($))return new I4({cause:D});if(B3.nodeMessage.test($))return new B3({cause:D,maxFeePerGas:F?.maxFeePerGas,maxPriorityFeePerGas:F?.maxPriorityFeePerGas});return new a2({cause:D})}var w4=x(()=>{s();W3()});function cQ(D,{docsPath:F,...$}){let J=(()=>{let Q=s1(D,$);if(Q instanceof a2)return D;return Q})();return new x6(J,{docsPath:F,...$})}var MW=x(()=>{q1();W3();w4()});function t0(D,{format:F}){if(!F)return{};let $={};function J(Z){let X=Object.keys(Z);for(let Y of X){if(Y in D)$[Y]=D[Y];if(Z[Y]&&typeof Z[Y]==="object"&&!Array.isArray(Z[Y]))J(Z[Y])}}let Q=F(D||{});return J(Q),$}function Z0(D,F){let $={};if(typeof D.authorizationList<"u")$.authorizationList=ya(D.authorizationList);if(typeof D.accessList<"u")$.accessList=D.accessList;if(typeof D.blobVersionedHashes<"u")$.blobVersionedHashes=D.blobVersionedHashes;if(typeof D.blobs<"u")if(typeof D.blobs[0]!=="string")$.blobs=D.blobs.map((J)=>WD(J));else $.blobs=D.blobs;if(typeof D.data<"u")$.data=D.data;if(D.account)$.from=D.account.address;if(typeof D.from<"u")$.from=D.from;if(typeof D.gas<"u")$.gas=k(D.gas);if(typeof D.gasPrice<"u")$.gasPrice=k(D.gasPrice);if(typeof D.maxFeePerBlobGas<"u")$.maxFeePerBlobGas=k(D.maxFeePerBlobGas);if(typeof D.maxFeePerGas<"u")$.maxFeePerGas=k(D.maxFeePerGas);if(typeof D.maxPriorityFeePerGas<"u")$.maxPriorityFeePerGas=k(D.maxPriorityFeePerGas);if(typeof D.nonce<"u")$.nonce=k(D.nonce);if(typeof D.to<"u")$.to=D.to;if(typeof D.type<"u")$.type=ka[D.type];if(typeof D.value<"u")$.value=k(D.value);return $}function ya(D){return D.map((F)=>({address:F.address,r:F.r?k(BigInt(F.r)):F.r,s:F.s?k(BigInt(F.s)):F.s,chainId:k(F.chainId),nonce:k(F.nonce),...typeof F.yParity<"u"?{yParity:k(F.yParity)}:{},...typeof F.v<"u"&&typeof F.yParity>"u"?{v:k(F.v)}:{}}))}var ka;var S8=x(()=>{c();ka={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"}});function K7(){let D=()=>{return},F=()=>{return};return{promise:new Promise((J,Q)=>{D=J,F=Q}),resolve:D,reject:F}}function nQ({fn:D,id:F,shouldSplitBatch:$,wait:J=0,sort:Q}){let Z=async()=>{let B=q();X();let W=B.map(({args:K})=>K);if(W.length===0)return;D(W).then((K)=>{if(Q&&Array.isArray(K))K.sort(Q);for(let U=0;U<B.length;U++){let{resolve:V}=B[U];V?.([K[U],K])}}).catch((K)=>{for(let U=0;U<B.length;U++){let{reject:V}=B[U];V?.(K)}})},X=()=>OW.delete(F),Y=()=>q().map(({args:B})=>B),q=()=>OW.get(F)||[],G=(B)=>OW.set(F,[...q(),B]);return{flush:X,async schedule(B){let{promise:W,resolve:K,reject:U}=K7();if($?.([...Y(),B]))Z();if(q().length>0)return G({args:B,resolve:K,reject:U}),W;return G({args:B,resolve:K,reject:U}),setTimeout(Z,J),W}}}var OW;var EW=x(()=>{OW=new Map});function sI(D){if(!D||D.length===0)return;return D.reduce((F,{slot:$,value:J})=>{if($.length!==66)throw new GQ({size:$.length,targetSize:66,type:"hex"});if(J.length!==66)throw new GQ({size:J.length,targetSize:66,type:"hex"});return F[$]=J,F},{})}function fa(D){let{balance:F,nonce:$,state:J,stateDiff:Q,code:Z}=D,X={};if(Z!==void 0)X.code=Z;if(F!==void 0)X.balance=k(F);if($!==void 0)X.nonce=k($);if(J!==void 0)X.state=sI(J);if(Q!==void 0){if(X.state)throw new mB;X.stateDiff=sI(Q)}return X}function U7(D){if(!D)return;let F={};for(let{address:$,...J}of D){if(!t($,{strict:!1}))throw new B0({address:$});if(F[$])throw new gB({address:$});F[$]=fa(J)}return F}var iQ=x(()=>{m1();BQ();dB();n2();c()});var nwD,iwD,owD,awD,rwD,swD,twD,ewD,DND,FND,$ND,JND,QND,ZND,XND,YND,qND,GND,BND,WND,KND,UND,VND,HND,zND,CND,_ND,MND,OND,END,RND,AND,IND,wND,NND,TND,LND,PND,jND,SND,xND,kND,yND,fND,bND,vND,hND,uND,gND,mND,dND,pND,lND,cND,nND,iND,oND,aND,rND,sND,tND,eND,DTD,FTD,$TD,JTD,QTD,ZTD,XTD,YTD,qTD,GTD,BTD,WTD,KTD,UTD,VTD,HTD,zTD,CTD,_TD,MTD,OTD,ETD,RTD,ATD,ITD,wTD,NTD,TTD,LTD,PTD,jTD,STD,xTD,tI;var eI=x(()=>{nwD=2n**(8n-1n)-1n,iwD=2n**(16n-1n)-1n,owD=2n**(24n-1n)-1n,awD=2n**(32n-1n)-1n,rwD=2n**(40n-1n)-1n,swD=2n**(48n-1n)-1n,twD=2n**(56n-1n)-1n,ewD=2n**(64n-1n)-1n,DND=2n**(72n-1n)-1n,FND=2n**(80n-1n)-1n,$ND=2n**(88n-1n)-1n,JND=2n**(96n-1n)-1n,QND=2n**(104n-1n)-1n,ZND=2n**(112n-1n)-1n,XND=2n**(120n-1n)-1n,YND=2n**(128n-1n)-1n,qND=2n**(136n-1n)-1n,GND=2n**(144n-1n)-1n,BND=2n**(152n-1n)-1n,WND=2n**(160n-1n)-1n,KND=2n**(168n-1n)-1n,UND=2n**(176n-1n)-1n,VND=2n**(184n-1n)-1n,HND=2n**(192n-1n)-1n,zND=2n**(200n-1n)-1n,CND=2n**(208n-1n)-1n,_ND=2n**(216n-1n)-1n,MND=2n**(224n-1n)-1n,OND=2n**(232n-1n)-1n,END=2n**(240n-1n)-1n,RND=2n**(248n-1n)-1n,AND=2n**(256n-1n)-1n,IND=-(2n**(8n-1n)),wND=-(2n**(16n-1n)),NND=-(2n**(24n-1n)),TND=-(2n**(32n-1n)),LND=-(2n**(40n-1n)),PND=-(2n**(48n-1n)),jND=-(2n**(56n-1n)),SND=-(2n**(64n-1n)),xND=-(2n**(72n-1n)),kND=-(2n**(80n-1n)),yND=-(2n**(88n-1n)),fND=-(2n**(96n-1n)),bND=-(2n**(104n-1n)),vND=-(2n**(112n-1n)),hND=-(2n**(120n-1n)),uND=-(2n**(128n-1n)),gND=-(2n**(136n-1n)),mND=-(2n**(144n-1n)),dND=-(2n**(152n-1n)),pND=-(2n**(160n-1n)),lND=-(2n**(168n-1n)),cND=-(2n**(176n-1n)),nND=-(2n**(184n-1n)),iND=-(2n**(192n-1n)),oND=-(2n**(200n-1n)),aND=-(2n**(208n-1n)),rND=-(2n**(216n-1n)),sND=-(2n**(224n-1n)),tND=-(2n**(232n-1n)),eND=-(2n**(240n-1n)),DTD=-(2n**(248n-1n)),FTD=-(2n**(256n-1n)),$TD=2n**8n-1n,JTD=2n**16n-1n,QTD=2n**24n-1n,ZTD=2n**32n-1n,XTD=2n**40n-1n,YTD=2n**48n-1n,qTD=2n**56n-1n,GTD=2n**64n-1n,BTD=2n**72n-1n,WTD=2n**80n-1n,KTD=2n**88n-1n,UTD=2n**96n-1n,VTD=2n**104n-1n,HTD=2n**112n-1n,zTD=2n**120n-1n,CTD=2n**128n-1n,_TD=2n**136n-1n,MTD=2n**144n-1n,OTD=2n**152n-1n,ETD=2n**160n-1n,RTD=2n**168n-1n,ATD=2n**176n-1n,ITD=2n**184n-1n,wTD=2n**192n-1n,NTD=2n**200n-1n,TTD=2n**208n-1n,LTD=2n**216n-1n,PTD=2n**224n-1n,jTD=2n**232n-1n,STD=2n**240n-1n,xTD=2n**248n-1n,tI=2n**256n-1n});function X0(D){let{account:F,maxFeePerGas:$,maxPriorityFeePerGas:J,to:Q}=D,Z=F?i(F):void 0;if(Z&&!t(Z.address))throw new B0({address:Z.address});if(Q&&!t(Q))throw new B0({address:Q});if($&&$>tI)throw new G3({maxFeePerGas:$});if(J&&$&&J>$)throw new B3({maxFeePerGas:$,maxPriorityFeePerGas:J})}var x8=x(()=>{eI();m1();W3();n2()});var RW,AW,IW;var Dw=x(()=>{s();RW=class RW extends P{constructor({callbackSelector:D,cause:F,data:$,extraData:J,sender:Q,urls:Z}){super(F.shortMessage||"An error occurred while fetching for an offchain result.",{cause:F,metaMessages:[...F.metaMessages||[],F.metaMessages?.length?"":[],"Offchain Gateway Call:",Z&&[" Gateway URL(s):",...Z.map((X)=>` ${D3(X)}`)],` Sender: ${Q}`,` Data: ${$}`,` Callback selector: ${D}`,` Extra data: ${J}`].flat(),name:"OffchainLookupError"})}};AW=class AW extends P{constructor({result:D,url:F}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${D3(F)}`,`Response: ${qD(D)}`],name:"OffchainLookupResponseMalformedError"})}};IW=class IW extends P{constructor({sender:D,to:F}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${F}`,`OffchainLookup sender address: ${D}`],name:"OffchainLookupSenderMismatchError"})}}});function I2(D,F){if(!t(D,{strict:!1}))throw new B0({address:D});if(!t(F,{strict:!1}))throw new B0({address:F});return D.toLowerCase()===F.toLowerCase()}var K3=x(()=>{m1();n2()});var Jw={};H2(Jw,{offchainLookupSignature:()=>ba,offchainLookupAbiItem:()=>Fw,offchainLookup:()=>va,ccipRequest:()=>$w});async function va(D,{blockNumber:F,blockTag:$,data:J,to:Q}){let{args:Z}=PQ({data:J,abi:[Fw]}),[X,Y,q,G,B]=Z,{ccipRead:W}=D,K=W&&typeof W?.request==="function"?W.request:$w;try{if(!I2(Q,X))throw new IW({sender:X,to:Q});let U=Y.includes(G1)?await aB({data:q,ccipRequest:K}):await K({data:q,sender:X,urls:Y}),{data:V}=await w2(D,{blockNumber:F,blockTag:$,data:ID([G,iD([{type:"bytes"},{type:"bytes"}],[U,B])]),to:Q});return V}catch(U){throw new RW({callbackSelector:G,cause:U,data:J,extraData:B,sender:X,urls:Y})}}async function $w({data:D,sender:F,urls:$}){let J=Error("An unknown error occurred.");for(let Q=0;Q<$.length;Q++){let Z=$[Q],X=Z.includes("{data}")?"GET":"POST",Y=X==="POST"?{data:D,sender:F}:void 0,q=X==="POST"?{"Content-Type":"application/json"}:{};try{let G=await fetch(Z.replace("{sender}",F.toLowerCase()).replace("{data}",D),{body:JSON.stringify(Y),headers:q,method:X}),B;if(G.headers.get("Content-Type")?.startsWith("application/json"))B=(await G.json()).data;else B=await G.text();if(!G.ok){J=new o2({body:Y,details:B?.error?qD(B.error):G.statusText,headers:G.headers,status:G.status,url:Z});continue}if(!DD(B)){J=new AW({result:B,url:Z});continue}return B}catch(G){J=new o2({body:Y,details:G.message,url:Z})}}throw J}var ba="0x556f1830",Fw;var Qw=x(()=>{U3();Dw();$3();vB();A8();K3();W4();Fw={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]}});async function w2(D,F){let{account:$=D.account,authorizationList:J,batch:Q=Boolean(D.batch?.multicall),blockNumber:Z,blockTag:X=D.experimental_blockTag??"latest",accessList:Y,blobs:q,blockOverrides:G,code:B,data:W,factory:K,factoryData:U,gas:V,gasPrice:H,maxFeePerBlobGas:z,maxFeePerGas:_,maxPriorityFeePerGas:O,nonce:C,to:M,value:E,stateOverride:A,...I}=F,R=$?i($):void 0;if(B&&(K||U))throw new P("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(B&&M)throw new P("Cannot provide both `code` & `to` as parameters.");let T=B&&W,N=K&&U&&M&&W,j=T||N,L=(()=>{if(T)return Zw({code:B,data:W});if(N)return ga({data:W,factory:K,factoryData:U,to:M});return W})();try{X0(F);let m=(typeof Z==="bigint"?k(Z):void 0)||X,S=G?dQ(G):void 0,h=U7(A),g=D.chain?.formatters?.transactionRequest?.format,u=(g||Z0)({...t0(I,{format:g}),accessList:Y,account:R,authorizationList:J,blobs:q,data:L,gas:V,gasPrice:H,maxFeePerBlobGas:z,maxFeePerGas:_,maxPriorityFeePerGas:O,nonce:C,to:j?void 0:M,value:E},"call");if(Q&&ha({request:u})&&!h&&!S)try{return await ua(D,{...u,blockNumber:Z,blockTag:X})}catch(RD){if(!(RD instanceof wQ)&&!(RD instanceof P6))throw RD}let o=(()=>{let RD=[u,m];if(h&&S)return[...RD,h,S];if(h)return[...RD,h];if(S)return[...RD,{},S];return RD})(),cD=await D.request({method:"eth_call",params:o});if(cD==="0x")return{data:void 0};return{data:cD}}catch(y){let m=ma(y),{offchainLookup:S,offchainLookupSignature:h}=await Promise.resolve().then(() => (Qw(),Jw));if(D.ccipRead!==!1&&m?.slice(0,10)===h&&M)return{data:await S(D,{data:m,to:M})};if(j&&m?.slice(0,10)==="0x101bb98d")throw new xQ({factory:K});throw cQ(y,{...F,account:R,chain:D.chain})}}function ha({request:D}){let{data:F,to:$,...J}=D;if(!F)return!1;if(F.startsWith(oI))return!1;if(!$)return!1;if(Object.values(J).filter((Q)=>typeof Q<"u").length>0)return!1;return!0}async function ua(D,F){let{batchSize:$=1024,deployless:J=!1,wait:Q=0}=typeof D.batch?.multicall==="object"?D.batch.multicall:{},{blockNumber:Z,blockTag:X=D.experimental_blockTag??"latest",data:Y,to:q}=F,G=(()=>{if(J)return null;if(F.multicallAddress)return F.multicallAddress;if(D.chain)return E2({blockNumber:Z,chain:D.chain,contract:"multicall3"});throw new wQ})(),W=(typeof Z==="bigint"?k(Z):void 0)||X,{schedule:K}=nQ({id:`${D.uid}.${W}`,wait:Q,shouldSplitBatch(H){return H.reduce((_,{data:O})=>_+(O.length-2),0)>$*2},fn:async(H)=>{let z=H.map((C)=>({allowFailure:!0,callData:C.data,target:C.to})),_=ED({abi:m2,args:[z],functionName:"aggregate3"}),O=await D.request({method:"eth_call",params:[{...G===null?{data:Zw({code:W7,data:_})}:{to:G,data:_}},W]});return O0({abi:m2,args:[z],functionName:"aggregate3",data:O||"0x"})}}),[{returnData:U,success:V}]=await K({data:Y,to:q});if(!V)throw new T8({data:U});if(U==="0x")return{data:void 0};return{data:U}}function Zw(D){let{code:F,data:$}=D;return q3({abi:c9(["constructor(bytes, bytes)"]),bytecode:pQ,args:[F,$]})}function ga(D){let{data:F,factory:$,factoryData:J,to:Q}=D;return q3({abi:c9(["constructor(address, bytes, address, bytes)"]),bytecode:aI,args:[Q,F,$,J]})}function ma(D){if(!(D instanceof P))return;let F=D.walk();return typeof F?.data==="object"?F.data?.data:F.data}var U3=x(()=>{A6();CW();z8();s();NQ();q1();Y1();lQ();a0();tF();c();MW();S8();EW();iQ();x8()});function oa(D,F,$,J){if(typeof D.setBigUint64==="function")return D.setBigUint64(F,$,J);let Q=BigInt(32),Z=BigInt(4294967295),X=Number($>>Q&Z),Y=Number($&Z),q=J?4:0,G=J?0:4;D.setUint32(F+q,X,J),D.setUint32(F+G,Y,J)}function Mw(D,F,$){return D&F^~D&$}function Ow(D,F,$){return D&F^D&$^F&$}var jW,C1;var Ew=x(()=>{d1();jW=class jW extends aF{constructor(D,F,$,J){super();this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=D,this.outputLen=F,this.padOffset=$,this.isLE=J,this.buffer=new Uint8Array(D),this.view=VQ(this.buffer)}update(D){Q1(this),D=oF(D),_8(D);let{view:F,buffer:$,blockLen:J}=this,Q=D.length;for(let Z=0;Z<Q;){let X=Math.min(J-this.pos,Q-Z);if(X===J){let Y=VQ(D);for(;J<=Q-Z;Z+=J)this.process(Y,Z);continue}if($.set(D.subarray(Z,Z+X),this.pos),this.pos+=X,Z+=X,this.pos===J)this.process(F,0),this.pos=0}return this.length+=D.length,this.roundClean(),this}digestInto(D){Q1(this),UQ(D,this),this.finished=!0;let{buffer:F,view:$,blockLen:J,isLE:Q}=this,{pos:Z}=this;if(F[Z++]=128,M8(this.buffer.subarray(Z)),this.padOffset>J-Z)this.process($,0),Z=0;for(let B=Z;B<J;B++)F[B]=0;oa($,J-8,BigInt(this.length*8),Q),this.process($,0);let X=VQ(D),Y=this.outputLen;if(Y%4)throw Error("_sha2: outputLen should be aligned to 32bit");let q=Y/4,G=this.get();if(q>G.length)throw Error("_sha2: outputLen bigger than state");for(let B=0;B<q;B++)X.setUint32(4*B,G[B],Q)}digest(){let{buffer:D,outputLen:F}=this;this.digestInto(D);let $=D.slice(0,F);return this.destroy(),$}_cloneInto(D){D||(D=new this.constructor),D.set(...this.get());let{blockLen:F,buffer:$,length:J,finished:Q,destroyed:Z,pos:X}=this;if(D.destroyed=Z,D.finished=Q,D.length=J,D.pos=X,J%F)D.buffer.set($);return D}clone(){return this._cloneInto()}};C1=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225])});var aa,e1,SW,H3;var xW=x(()=>{Ew();d1();aa=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),e1=new Uint32Array(64);SW=class SW extends jW{constructor(D=32){super(64,D,8,!1);this.A=C1[0]|0,this.B=C1[1]|0,this.C=C1[2]|0,this.D=C1[3]|0,this.E=C1[4]|0,this.F=C1[5]|0,this.G=C1[6]|0,this.H=C1[7]|0}get(){let{A:D,B:F,C:$,D:J,E:Q,F:Z,G:X,H:Y}=this;return[D,F,$,J,Q,Z,X,Y]}set(D,F,$,J,Q,Z,X,Y){this.A=D|0,this.B=F|0,this.C=$|0,this.D=J|0,this.E=Q|0,this.F=Z|0,this.G=X|0,this.H=Y|0}process(D,F){for(let B=0;B<16;B++,F+=4)e1[B]=D.getUint32(F,!1);for(let B=16;B<64;B++){let W=e1[B-15],K=e1[B-2],U=l2(W,7)^l2(W,18)^W>>>3,V=l2(K,17)^l2(K,19)^K>>>10;e1[B]=V+e1[B-7]+U+e1[B-16]|0}let{A:$,B:J,C:Q,D:Z,E:X,F:Y,G:q,H:G}=this;for(let B=0;B<64;B++){let W=l2(X,6)^l2(X,11)^l2(X,25),K=G+W+Mw(X,Y,q)+aa[B]+e1[B]|0,V=(l2($,2)^l2($,13)^l2($,22))+Ow($,J,Q)|0;G=q,q=Y,Y=X,X=Z+K|0,Z=Q,Q=J,J=$,$=K+V|0}$=$+this.A|0,J=J+this.B|0,Q=Q+this.C|0,Z=Z+this.D|0,X=X+this.E|0,Y=Y+this.F|0,q=q+this.G|0,G=G+this.H|0,this.set($,J,Q,Z,X,Y,q,G)}roundClean(){M8(e1)}destroy(){this.set(0,0,0,0,0,0,0,0),M8(this.buffer)}};H3=HQ(()=>new SW)});var kW,yW=(D,F,$)=>new kW(D,F).update($).digest();var Rw=x(()=>{d1();kW=class kW extends aF{constructor(D,F){super();this.finished=!1,this.destroyed=!1,SA(D);let $=oF(F);if(this.iHash=D.create(),typeof this.iHash.update!=="function")throw Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let J=this.blockLen,Q=new Uint8Array(J);Q.set($.length>J?D.create().update($).digest():$);for(let Z=0;Z<Q.length;Z++)Q[Z]^=54;this.iHash.update(Q),this.oHash=D.create();for(let Z=0;Z<Q.length;Z++)Q[Z]^=106;this.oHash.update(Q),M8(Q)}update(D){return Q1(this),this.iHash.update(D),this}digestInto(D){Q1(this),_8(D,this.outputLen),this.finished=!0,this.iHash.digestInto(D),this.oHash.update(D),this.oHash.digestInto(D),this.destroy()}digest(){let D=new Uint8Array(this.oHash.outputLen);return this.digestInto(D),D}_cloneInto(D){D||(D=Object.create(Object.getPrototypeOf(this),{}));let{oHash:F,iHash:$,finished:J,destroyed:Q,blockLen:Z,outputLen:X}=this;return D=D,D.finished=J,D.destroyed=Q,D.blockLen=Z,D.outputLen=X,D.oHash=F._cloneInto(D.oHash),D.iHash=$._cloneInto(D.iHash),D}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};yW.create=(D,F)=>new kW(D,F)});function pD(D,F){let $=D%F;return $>=b0?$:F+$}function K2(D,F,$){let J=D;while(F-- >b0)J*=J,J%=$;return J}function DZ(D,F){if(D===b0)throw Error("invert: expected non-zero number");if(F<=b0)throw Error("invert: expected positive modulus, got "+F);let $=pD(D,F),J=F,Q=b0,Z=E0,X=E0,Y=b0;while($!==b0){let G=J/$,B=J%$,W=Q-X*G,K=Z-Y*G;J=$,$=B,Q=X,Z=Y,X=W,Y=K}if(J!==E0)throw Error("invert: does not exist");return pD(Q,F)}function Tw(D,F){let $=(D.ORDER+E0)/Iw,J=D.pow(F,$);if(!D.eql(D.sqr(J),F))throw Error("Cannot find square root");return J}function sa(D,F){let $=(D.ORDER-ww)/Nw,J=D.mul(F,z3),Q=D.pow(J,$),Z=D.mul(F,Q),X=D.mul(D.mul(Z,z3),Q),Y=D.mul(Z,D.sub(X,D.ONE));if(!D.eql(D.sqr(Y),F))throw Error("Cannot find square root");return Y}function ta(D){if(D<BigInt(3))throw Error("sqrt is not defined for small field");let F=D-E0,$=0;while(F%z3===b0)F/=z3,$++;let J=z3,Q=T4(D);while(Aw(Q,J)===1)if(J++>1000)throw Error("Cannot find square root: probably non-prime P");if($===1)return Tw;let Z=Q.pow(J,F),X=(F+E0)/z3;return function(q,G){if(q.is0(G))return G;if(Aw(q,G)!==1)throw Error("Cannot find square root");let B=$,W=q.mul(q.ONE,Z),K=q.pow(G,F),U=q.pow(G,X);while(!q.eql(K,q.ONE)){if(q.is0(K))return q.ZERO;let V=1,H=q.sqr(K);while(!q.eql(H,q.ONE))if(V++,H=q.sqr(H),V===B)throw Error("Cannot find square root");let z=E0<<BigInt(B-V-1),_=q.pow(W,z);B=V,W=q.sqr(_),K=q.mul(K,W),U=q.mul(U,_)}return U}}function ea(D){if(D%Iw===ra)return Tw;if(D%Nw===ww)return sa;return ta(D)}function FZ(D){let F={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},$=Dr.reduce((J,Q)=>{return J[Q]="function",J},F);return V1(D,$)}function Fr(D,F,$){if($<b0)throw Error("invalid exponent, negatives unsupported");if($===b0)return D.ONE;if($===E0)return F;let J=D.ONE,Q=F;while($>b0){if($&E0)J=D.mul(J,Q);Q=D.sqr(Q),$>>=E0}return J}function V7(D,F,$=!1){let J=Array(F.length).fill($?D.ZERO:void 0),Q=F.reduce((X,Y,q)=>{if(D.is0(Y))return X;return J[q]=X,D.mul(X,Y)},D.ONE),Z=D.inv(Q);return F.reduceRight((X,Y,q)=>{if(D.is0(Y))return X;return J[q]=D.mul(X,J[q]),D.mul(X,Y)},Z),J}function Aw(D,F){let $=(D.ORDER-E0)/z3,J=D.pow(F,$),Q=D.eql(J,D.ONE),Z=D.eql(J,D.ZERO),X=D.eql(J,D.neg(D.ONE));if(!Q&&!Z&&!X)throw Error("invalid Legendre symbol result");return Q?1:Z?0:-1}function fW(D,F){if(F!==void 0)iF(F);let $=F!==void 0?F:D.toString(2).length,J=Math.ceil($/8);return{nBitLength:$,nByteLength:J}}function T4(D,F,$=!1,J={}){if(D<=b0)throw Error("invalid field: expected ORDER > 0, got "+D);let{nBitLength:Q,nByteLength:Z}=fW(D,F);if(Z>2048)throw Error("invalid field: expected ORDER of <= 2048 bytes");let X,Y=Object.freeze({ORDER:D,isLE:$,BITS:Q,BYTES:Z,MASK:X3(Q),ZERO:b0,ONE:E0,create:(q)=>pD(q,D),isValid:(q)=>{if(typeof q!=="bigint")throw Error("invalid field element: expected bigint, got "+typeof q);return b0<=q&&q<D},is0:(q)=>q===b0,isOdd:(q)=>(q&E0)===E0,neg:(q)=>pD(-q,D),eql:(q,G)=>q===G,sqr:(q)=>pD(q*q,D),add:(q,G)=>pD(q+G,D),sub:(q,G)=>pD(q-G,D),mul:(q,G)=>pD(q*G,D),pow:(q,G)=>Fr(Y,q,G),div:(q,G)=>pD(q*DZ(G,D),D),sqrN:(q)=>q*q,addN:(q,G)=>q+G,subN:(q,G)=>q-G,mulN:(q,G)=>q*G,inv:(q)=>DZ(q,D),sqrt:J.sqrt||((q)=>{if(!X)X=ea(D);return X(Y,q)}),toBytes:(q)=>$?$W(q,Z):L8(q,Z),fromBytes:(q)=>{if(q.length!==Z)throw Error("Field.fromBytes: expected "+Z+" bytes, got "+q.length);return $?FW(q):r0(q)},invertBatch:(q)=>V7(Y,q),cmov:(q,G,B)=>B?G:q});return Object.freeze(Y)}function Lw(D){if(typeof D!=="bigint")throw Error("field order must be bigint");let F=D.toString(2).length;return Math.ceil(F/8)}function bW(D){let F=Lw(D);return F+Math.ceil(F/2)}function Pw(D,F,$=!1){let J=D.length,Q=Lw(F),Z=bW(F);if(J<16||J<Z||J>1024)throw Error("expected "+Z+"-1024 bytes of input, got "+J);let X=$?FW(D):r0(D),Y=pD(X,F-E0)+E0;return $?$W(Y,Q):L8(Y,Q)}var b0,E0,z3,ra,Iw,ww,Nw,Dr;var L4=x(()=>{d1();Z7();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */b0=BigInt(0),E0=BigInt(1),z3=BigInt(2),ra=BigInt(3),Iw=BigInt(4),ww=BigInt(5),Nw=BigInt(8);Dr=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"]});function vW(D,F){let $=F.negate();return D?$:F}function xw(D,F){if(!Number.isSafeInteger(D)||D<=0||D>F)throw Error("invalid window size, expected [1.."+F+"], got W="+D)}function hW(D,F){xw(D,F);let $=Math.ceil(F/D)+1,J=2**(D-1),Q=2**D,Z=X3(D),X=BigInt(D);return{windows:$,windowSize:J,mask:Z,maxNumber:Q,shiftBy:X}}function Sw(D,F,$){let{windowSize:J,mask:Q,maxNumber:Z,shiftBy:X}=$,Y=Number(D&Q),q=D>>X;if(Y>J)Y-=Z,q+=mW;let G=F*J,B=G+Math.abs(Y)-1,W=Y===0,K=Y<0,U=F%2!==0;return{nextN:q,offset:B,isZero:W,isNeg:K,isNegF:U,offsetF:G}}function $r(D,F){if(!Array.isArray(D))throw Error("array expected");D.forEach(($,J)=>{if(!($ instanceof F))throw Error("invalid point at index "+J)})}function Jr(D,F){if(!Array.isArray(D))throw Error("array of scalars expected");D.forEach(($,J)=>{if(!F.isValid($))throw Error("invalid scalar at index "+J)})}function gW(D){return kw.get(D)||1}function yw(D,F){return{constTimeNegate:vW,hasPrecomputes($){return gW($)!==1},unsafeLadder($,J,Q=D.ZERO){let Z=$;while(J>jw){if(J&mW)Q=Q.add(Z);Z=Z.double(),J>>=mW}return Q},precomputeWindow($,J){let{windows:Q,windowSize:Z}=hW(J,F),X=[],Y=$,q=Y;for(let G=0;G<Q;G++){q=Y,X.push(q);for(let B=1;B<Z;B++)q=q.add(Y),X.push(q);Y=q.double()}return X},wNAF($,J,Q){let{ZERO:Z,BASE:X}=D,Y=hW($,F);for(let q=0;q<Y.windows;q++){let{nextN:G,offset:B,isZero:W,isNeg:K,isNegF:U,offsetF:V}=Sw(Q,q,Y);if(Q=G,W)X=X.add(vW(U,J[V]));else Z=Z.add(vW(K,J[B]))}return{p:Z,f:X}},wNAFUnsafe($,J,Q,Z=D.ZERO){let X=hW($,F);for(let Y=0;Y<X.windows;Y++){if(Q===jw)break;let{nextN:q,offset:G,isZero:B,isNeg:W}=Sw(Q,Y,X);if(Q=q,B)continue;else{let K=J[G];Z=Z.add(W?K.negate():K)}}return Z},getPrecomputes($,J,Q){let Z=uW.get(J);if(!Z){if(Z=this.precomputeWindow(J,$),$!==1)uW.set(J,Q(Z))}return Z},wNAFCached($,J,Q){let Z=gW($);return this.wNAF(Z,this.getPrecomputes(Z,$,Q),J)},wNAFCachedUnsafe($,J,Q,Z){let X=gW($);if(X===1)return this.unsafeLadder($,J,Z);return this.wNAFUnsafe(X,this.getPrecomputes(X,$,Q),J,Z)},setWindowSize($,J){xw(J,F),kw.set($,J),uW.delete($)}}}function fw(D,F,$,J){$r($,D),Jr(J,F);let Q=$.length,Z=J.length;if(Q!==Z)throw Error("arrays of points and scalars must have equal length");let X=D.ZERO,Y=AI(BigInt(Q)),q=1;if(Y>12)q=Y-3;else if(Y>4)q=Y-2;else if(Y>0)q=2;let G=X3(q),B=Array(Number(G)+1).fill(X),W=Math.floor((F.BITS-1)/q)*q,K=X;for(let U=W;U>=0;U-=q){B.fill(X);for(let H=0;H<Z;H++){let z=J[H],_=Number(z>>BigInt(U)&G);B[_]=B[_].add($[H])}let V=X;for(let H=B.length-1,z=X;H>0;H--)z=z.add(B[H]),V=V.add(z);if(K=K.add(V),U!==0)for(let H=0;H<q;H++)K=K.double()}return K}function dW(D){return FZ(D.Fp),V1(D,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...fW(D.n,D.nBitLength),...D,...{p:D.Fp.ORDER}})}var jw,mW,uW,kw;var bw=x(()=>{L4();Z7();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */jw=BigInt(0),mW=BigInt(1);uW=new WeakMap,kw=new WeakMap});function vw(D){if(D.lowS!==void 0)J7("lowS",D.lowS);if(D.prehash!==void 0)J7("prehash",D.prehash)}function Qr(D){let F=dW(D);V1(F,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});let{endo:$,Fp:J,a:Q}=F;if($){if(!J.eql(Q,J.ZERO))throw Error("invalid endo: CURVE.a must be 0");if(typeof $!=="object"||typeof $.beta!=="bigint"||typeof $.splitScalar!=="function")throw Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...F})}function pW(D,F){return Q7(L8(D,F))}function Zr(D){let F=Qr(D),{Fp:$}=F,J=T4(F.n,F.nBitLength),Q=F.toBytes||((C,M,E)=>{let A=M.toAffine();return f0(Uint8Array.from([4]),$.toBytes(A.x),$.toBytes(A.y))}),Z=F.fromBytes||((C)=>{let M=C.subarray(1),E=$.fromBytes(M.subarray(0,$.BYTES)),A=$.fromBytes(M.subarray($.BYTES,2*$.BYTES));return{x:E,y:A}});function X(C){let{a:M,b:E}=F,A=$.sqr(C),I=$.mul(A,C);return $.add($.add(I,$.mul(C,M)),E)}function Y(C,M){let E=$.sqr(M),A=X(C);return $.eql(E,A)}if(!Y(F.Gx,F.Gy))throw Error("bad curve params: generator point");let q=$.mul($.pow(F.a,P4),lW),G=$.mul($.sqr(F.b),BigInt(27));if($.is0($.add(q,G)))throw Error("bad curve params: a or b");function B(C){return Z3(C,CD,F.n)}function W(C){let{allowedPrivateKeyLengths:M,nByteLength:E,wrapPrivateKey:A,n:I}=F;if(M&&typeof C!=="bigint"){if($7(C))C=Q7(C);if(typeof C!=="string"||!M.includes(C.length))throw Error("invalid private key");C=C.padStart(E*2,"0")}let R;try{R=typeof C==="bigint"?C:r0(oD("private key",C,E))}catch(T){throw Error("invalid private key, expected hex or "+E+" bytes, got "+typeof C)}if(A)R=pD(R,I);return U1("private key",R,CD,I),R}function K(C){if(!(C instanceof H))throw Error("ProjectivePoint expected")}let U=JW((C,M)=>{let{px:E,py:A,pz:I}=C;if($.eql(I,$.ONE))return{x:E,y:A};let R=C.is0();if(M==null)M=R?$.ONE:$.inv(I);let T=$.mul(E,M),N=$.mul(A,M),j=$.mul(I,M);if(R)return{x:$.ZERO,y:$.ZERO};if(!$.eql(j,$.ONE))throw Error("invZ was invalid");return{x:T,y:N}}),V=JW((C)=>{if(C.is0()){if(F.allowInfinityPoint&&!$.is0(C.py))return;throw Error("bad point: ZERO")}let{x:M,y:E}=C.toAffine();if(!$.isValid(M)||!$.isValid(E))throw Error("bad point: x or y not FE");if(!Y(M,E))throw Error("bad point: equation left != right");if(!C.isTorsionFree())throw Error("bad point: not in prime-order subgroup");return!0});class H{constructor(C,M,E){if(C==null||!$.isValid(C))throw Error("x required");if(M==null||!$.isValid(M)||$.is0(M))throw Error("y required");if(E==null||!$.isValid(E))throw Error("z required");this.px=C,this.py=M,this.pz=E,Object.freeze(this)}static fromAffine(C){let{x:M,y:E}=C||{};if(!C||!$.isValid(M)||!$.isValid(E))throw Error("invalid affine point");if(C instanceof H)throw Error("projective point not allowed");let A=(I)=>$.eql(I,$.ZERO);if(A(M)&&A(E))return H.ZERO;return new H(M,E,$.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(C){let M=V7($,C.map((E)=>E.pz));return C.map((E,A)=>E.toAffine(M[A])).map(H.fromAffine)}static fromHex(C){let M=H.fromAffine(Z(oD("pointHex",C)));return M.assertValidity(),M}static fromPrivateKey(C){return H.BASE.multiply(W(C))}static msm(C,M){return fw(H,J,C,M)}_setWindowSize(C){O.setWindowSize(this,C)}assertValidity(){V(this)}hasEvenY(){let{y:C}=this.toAffine();if($.isOdd)return!$.isOdd(C);throw Error("Field doesn't support isOdd")}equals(C){K(C);let{px:M,py:E,pz:A}=this,{px:I,py:R,pz:T}=C,N=$.eql($.mul(M,T),$.mul(I,A)),j=$.eql($.mul(E,T),$.mul(R,A));return N&&j}negate(){return new H(this.px,$.neg(this.py),this.pz)}double(){let{a:C,b:M}=F,E=$.mul(M,P4),{px:A,py:I,pz:R}=this,T=$.ZERO,N=$.ZERO,j=$.ZERO,L=$.mul(A,A),y=$.mul(I,I),m=$.mul(R,R),S=$.mul(A,I);return S=$.add(S,S),j=$.mul(A,R),j=$.add(j,j),T=$.mul(C,j),N=$.mul(E,m),N=$.add(T,N),T=$.sub(y,N),N=$.add(y,N),N=$.mul(T,N),T=$.mul(S,T),j=$.mul(E,j),m=$.mul(C,m),S=$.sub(L,m),S=$.mul(C,S),S=$.add(S,j),j=$.add(L,L),L=$.add(j,L),L=$.add(L,m),L=$.mul(L,S),N=$.add(N,L),m=$.mul(I,R),m=$.add(m,m),L=$.mul(m,S),T=$.sub(T,L),j=$.mul(m,y),j=$.add(j,j),j=$.add(j,j),new H(T,N,j)}add(C){K(C);let{px:M,py:E,pz:A}=this,{px:I,py:R,pz:T}=C,N=$.ZERO,j=$.ZERO,L=$.ZERO,y=F.a,m=$.mul(F.b,P4),S=$.mul(M,I),h=$.mul(E,R),g=$.mul(A,T),b=$.add(M,E),u=$.add(I,R);b=$.mul(b,u),u=$.add(S,h),b=$.sub(b,u),u=$.add(M,A);let o=$.add(I,T);return u=$.mul(u,o),o=$.add(S,g),u=$.sub(u,o),o=$.add(E,A),N=$.add(R,T),o=$.mul(o,N),N=$.add(h,g),o=$.sub(o,N),L=$.mul(y,u),N=$.mul(m,g),L=$.add(N,L),N=$.sub(h,L),L=$.add(h,L),j=$.mul(N,L),h=$.add(S,S),h=$.add(h,S),g=$.mul(y,g),u=$.mul(m,u),h=$.add(h,g),g=$.sub(S,g),g=$.mul(y,g),u=$.add(u,g),S=$.mul(h,u),j=$.add(j,S),S=$.mul(o,u),N=$.mul(b,N),N=$.sub(N,S),S=$.mul(b,h),L=$.mul(o,L),L=$.add(L,S),new H(N,j,L)}subtract(C){return this.add(C.negate())}is0(){return this.equals(H.ZERO)}wNAF(C){return O.wNAFCached(this,C,H.normalizeZ)}multiplyUnsafe(C){let{endo:M,n:E}=F;U1("scalar",C,r2,E);let A=H.ZERO;if(C===r2)return A;if(this.is0()||C===CD)return this;if(!M||O.hasPrecomputes(this))return O.wNAFCachedUnsafe(this,C,H.normalizeZ);let{k1neg:I,k1:R,k2neg:T,k2:N}=M.splitScalar(C),j=A,L=A,y=this;while(R>r2||N>r2){if(R&CD)j=j.add(y);if(N&CD)L=L.add(y);y=y.double(),R>>=CD,N>>=CD}if(I)j=j.negate();if(T)L=L.negate();return L=new H($.mul(L.px,M.beta),L.py,L.pz),j.add(L)}multiply(C){let{endo:M,n:E}=F;U1("scalar",C,CD,E);let A,I;if(M){let{k1neg:R,k1:T,k2neg:N,k2:j}=M.splitScalar(C),{p:L,f:y}=this.wNAF(T),{p:m,f:S}=this.wNAF(j);L=O.constTimeNegate(R,L),m=O.constTimeNegate(N,m),m=new H($.mul(m.px,M.beta),m.py,m.pz),A=L.add(m),I=y.add(S)}else{let{p:R,f:T}=this.wNAF(C);A=R,I=T}return H.normalizeZ([A,I])[0]}multiplyAndAddUnsafe(C,M,E){let A=H.BASE,I=(T,N)=>N===r2||N===CD||!T.equals(A)?T.multiplyUnsafe(N):T.multiply(N),R=I(this,M).add(I(C,E));return R.is0()?void 0:R}toAffine(C){return U(this,C)}isTorsionFree(){let{h:C,isTorsionFree:M}=F;if(C===CD)return!0;if(M)return M(H,this);throw Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:C,clearCofactor:M}=F;if(C===CD)return this;if(M)return M(H,this);return this.multiplyUnsafe(F.h)}toRawBytes(C=!0){return J7("isCompressed",C),this.assertValidity(),Q(H,this,C)}toHex(C=!0){return J7("isCompressed",C),Q7(this.toRawBytes(C))}}H.BASE=new H(F.Gx,F.Gy,$.ONE),H.ZERO=new H($.ZERO,$.ONE,$.ZERO);let{endo:z,nBitLength:_}=F,O=yw(H,z?Math.ceil(_/2):_);return{CURVE:F,ProjectivePoint:H,normPrivateKeyToScalar:W,weierstrassEquation:X,isWithinCurveOrder:B}}function Xr(D){let F=dW(D);return V1(F,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...F})}function uw(D){let F=Xr(D),{Fp:$,n:J,nByteLength:Q,nBitLength:Z}=F,X=$.BYTES+1,Y=2*$.BYTES+1;function q(S){return pD(S,J)}function G(S){return DZ(S,J)}let{ProjectivePoint:B,normPrivateKeyToScalar:W,weierstrassEquation:K,isWithinCurveOrder:U}=Zr({...F,toBytes(S,h,g){let b=h.toAffine(),u=$.toBytes(b.x),o=f0;if(J7("isCompressed",g),g)return o(Uint8Array.from([h.hasEvenY()?2:3]),u);else return o(Uint8Array.from([4]),u,$.toBytes(b.y))},fromBytes(S){let h=S.length,g=S[0],b=S.subarray(1);if(h===X&&(g===2||g===3)){let u=r0(b);if(!Z3(u,CD,$.ORDER))throw Error("Point is not on curve");let o=K(u),cD;try{cD=$.sqrt(o)}catch($2){let _0=$2 instanceof Error?": "+$2.message:"";throw Error("Point is not on curve"+_0)}let RD=(cD&CD)===CD;if((g&1)===1!==RD)cD=$.neg(cD);return{x:u,y:cD}}else if(h===Y&&g===4){let u=$.fromBytes(b.subarray(0,$.BYTES)),o=$.fromBytes(b.subarray($.BYTES,2*$.BYTES));return{x:u,y:o}}else{let u=X,o=Y;throw Error("invalid Point, expected length of "+u+", or uncompressed "+o+", got "+h)}}});function V(S){let h=J>>CD;return S>h}function H(S){return V(S)?q(-S):S}let z=(S,h,g)=>r0(S.slice(h,g));class _{constructor(S,h,g){if(U1("r",S,CD,J),U1("s",h,CD,J),this.r=S,this.s=h,g!=null)this.recovery=g;Object.freeze(this)}static fromCompact(S){let h=Q;return S=oD("compactSignature",S,h*2),new _(z(S,0,h),z(S,h,2*h))}static fromDER(S){let{r:h,s:g}=_1.toSig(oD("DER",S));return new _(h,g)}assertValidity(){}addRecoveryBit(S){return new _(this.r,this.s,S)}recoverPublicKey(S){let{r:h,s:g,recovery:b}=this,u=I(oD("msgHash",S));if(b==null||![0,1,2,3].includes(b))throw Error("recovery id invalid");let o=b===2||b===3?h+F.n:h;if(o>=$.ORDER)throw Error("recovery id 2 or 3 invalid");let cD=(b&1)===0?"02":"03",RD=B.fromHex(cD+pW(o,$.BYTES)),V2=G(o),$2=q(-u*V2),_0=q(g*V2),y1=B.BASE.multiplyAndAddUnsafe(RD,$2,_0);if(!y1)throw Error("point at infinify");return y1.assertValidity(),y1}hasHighS(){return V(this.s)}normalizeS(){return this.hasHighS()?new _(this.r,q(-this.s),this.recovery):this}toDERRawBytes(){return V4(this.toDERHex())}toDERHex(){return _1.hexFromSig(this)}toCompactRawBytes(){return V4(this.toCompactHex())}toCompactHex(){let S=Q;return pW(this.r,S)+pW(this.s,S)}}let O={isValidPrivateKey(S){try{return W(S),!0}catch(h){return!1}},normPrivateKeyToScalar:W,randomPrivateKey:()=>{let S=bW(F.n);return Pw(F.randomBytes(S),F.n)},precompute(S=8,h=B.BASE){return h._setWindowSize(S),h.multiply(BigInt(3)),h}};function C(S,h=!0){return B.fromPrivateKey(S).toRawBytes(h)}function M(S){if(typeof S==="bigint")return!1;if(S instanceof B)return!0;let g=oD("key",S).length,b=$.BYTES,u=b+1,o=2*b+1;if(F.allowedPrivateKeyLengths||Q===u)return;else return g===u||g===o}function E(S,h,g=!0){if(M(S)===!0)throw Error("first arg must be private key");if(M(h)===!1)throw Error("second arg must be public key");return B.fromHex(h).multiply(W(S)).toRawBytes(g)}let A=F.bits2int||function(S){if(S.length>8192)throw Error("input is too large");let h=r0(S),g=S.length*8-Z;return g>0?h>>BigInt(g):h},I=F.bits2int_modN||function(S){return q(A(S))},R=X3(Z);function T(S){return U1("num < 2^"+Z,S,r2,R),L8(S,Q)}function N(S,h,g=j){if(["recovered","canonical"].some((SF)=>(SF in g)))throw Error("sign() legacy options not supported");let{hash:b,randomBytes:u}=F,{lowS:o,prehash:cD,extraEntropy:RD}=g;if(o==null)o=!0;if(S=oD("msgHash",S),vw(g),cD)S=oD("prehashed msgHash",b(S));let V2=I(S),$2=W(h),_0=[T($2),T(V2)];if(RD!=null&&RD!==!1){let SF=RD===!0?u($.BYTES):RD;_0.push(oD("extraEntropy",SF))}let y1=f0(..._0),H$=V2;function tY(SF){let e3=A(SF);if(!U(e3))return;let eY=G(e3),R9=B.BASE.multiply(e3).toAffine(),xF=q(R9.x);if(xF===r2)return;let A9=q(eY*q(H$+xF*$2));if(A9===r2)return;let D6=(R9.x===xF?0:2)|Number(R9.y&CD),Wz=A9;if(o&&V(A9))Wz=H(A9),D6^=1;return new _(xF,Wz,D6)}return{seed:y1,k2sig:tY}}let j={lowS:F.lowS,prehash:!1},L={lowS:F.lowS,prehash:!1};function y(S,h,g=j){let{seed:b,k2sig:u}=N(S,h,g),o=F;return II(o.hash.outputLen,o.nByteLength,o.hmac)(b,u)}B.BASE._setWindowSize(8);function m(S,h,g,b=L){let u=S;h=oD("msgHash",h),g=oD("publicKey",g);let{lowS:o,prehash:cD,format:RD}=b;if(vw(b),"strict"in b)throw Error("options.strict was renamed to lowS");if(RD!==void 0&&RD!=="compact"&&RD!=="der")throw Error("format must be compact or der");let V2=typeof u==="string"||$7(u),$2=!V2&&!RD&&typeof u==="object"&&u!==null&&typeof u.r==="bigint"&&typeof u.s==="bigint";if(!V2&&!$2)throw Error("invalid signature, expected Uint8Array, hex string or Signature instance");let _0=void 0,y1;try{if($2)_0=new _(u.r,u.s);if(V2){try{if(RD!=="compact")_0=_.fromDER(u)}catch(D6){if(!(D6 instanceof _1.Err))throw D6}if(!_0&&RD!=="der")_0=_.fromCompact(u)}y1=B.fromHex(g)}catch(D6){return!1}if(!_0)return!1;if(o&&_0.hasHighS())return!1;if(cD)h=F.hash(h);let{r:H$,s:tY}=_0,SF=I(h),e3=G(tY),eY=q(SF*e3),R9=q(H$*e3),xF=B.BASE.multiplyAndAddUnsafe(y1,eY,R9)?.toAffine();if(!xF)return!1;return q(xF.x)===H$}return{CURVE:F,getPublicKey:C,getSharedSecret:E,sign:y,verify:m,ProjectivePoint:B,Signature:_,utils:O}}function Yr(D,F){let $=D.ORDER,J=r2;for(let V=$-CD;V%DF===r2;V/=DF)J+=CD;let Q=J,Z=DF<<Q-CD-CD,X=Z*DF,Y=($-CD)/X,q=(Y-CD)/DF,G=X-CD,B=Z,W=D.pow(F,Y),K=D.pow(F,(Y+CD)/DF),U=(V,H)=>{let z=W,_=D.pow(H,G),O=D.sqr(_);O=D.mul(O,H);let C=D.mul(V,O);C=D.pow(C,q),C=D.mul(C,_),_=D.mul(C,H),O=D.mul(C,V);let M=D.mul(O,_);C=D.pow(M,B);let E=D.eql(C,D.ONE);_=D.mul(O,K),C=D.mul(M,z),O=D.cmov(_,O,E),M=D.cmov(C,M,E);for(let A=Q;A>CD;A--){let I=A-DF;I=DF<<I-CD;let R=D.pow(M,I),T=D.eql(R,D.ONE);_=D.mul(O,z),z=D.mul(z,z),R=D.mul(M,z),O=D.cmov(_,O,T),M=D.cmov(R,M,T)}return{isValid:E,value:O}};if(D.ORDER%lW===P4){let V=(D.ORDER-P4)/lW,H=D.sqrt(D.neg(F));U=(z,_)=>{let O=D.sqr(_),C=D.mul(z,_);O=D.mul(O,C);let M=D.pow(O,V);M=D.mul(M,C);let E=D.mul(M,H),A=D.mul(D.sqr(M),_),I=D.eql(A,z),R=D.cmov(E,M,I);return{isValid:I,value:R}}}return U}function gw(D,F){if(FZ(D),!D.isValid(F.A)||!D.isValid(F.B)||!D.isValid(F.Z))throw Error("mapToCurveSimpleSWU: invalid opts");let $=Yr(D,F.Z);if(!D.isOdd)throw Error("Fp.isOdd is not implemented!");return(J)=>{let Q,Z,X,Y,q,G,B,W;Q=D.sqr(J),Q=D.mul(Q,F.Z),Z=D.sqr(Q),Z=D.add(Z,Q),X=D.add(Z,D.ONE),X=D.mul(X,F.B),Y=D.cmov(F.Z,D.neg(Z),!D.eql(Z,D.ZERO)),Y=D.mul(Y,F.A),Z=D.sqr(X),G=D.sqr(Y),q=D.mul(G,F.A),Z=D.add(Z,q),Z=D.mul(Z,X),G=D.mul(G,Y),q=D.mul(G,F.B),Z=D.add(Z,q),B=D.mul(Q,X);let{isValid:K,value:U}=$(Z,G);W=D.mul(Q,J),W=D.mul(W,U),B=D.cmov(B,X,K),W=D.cmov(W,U,K);let V=D.isOdd(J)===D.isOdd(W);W=D.cmov(D.neg(W),W,V);let H=V7(D,[Y],!0)[0];return B=D.mul(B,H),{x:B,y:W}}}var hw,_1,r2,CD,DF,P4,lW;var cW=x(()=>{bw();L4();Z7();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */hw=class hw extends Error{constructor(D=""){super(D)}};_1={Err:hw,_tlv:{encode:(D,F)=>{let{Err:$}=_1;if(D<0||D>256)throw new $("tlv.encode: wrong tag");if(F.length&1)throw new $("tlv.encode: unpadded data");let J=F.length/2,Q=U4(J);if(Q.length/2&128)throw new $("tlv.encode: long form length too big");let Z=J>127?U4(Q.length/2|128):"";return U4(D)+Z+Q+F},decode(D,F){let{Err:$}=_1,J=0;if(D<0||D>256)throw new $("tlv.encode: wrong tag");if(F.length<2||F[J++]!==D)throw new $("tlv.decode: wrong tlv");let Q=F[J++],Z=!!(Q&128),X=0;if(!Z)X=Q;else{let q=Q&127;if(!q)throw new $("tlv.decode(long): indefinite length not supported");if(q>4)throw new $("tlv.decode(long): byte length is too big");let G=F.subarray(J,J+q);if(G.length!==q)throw new $("tlv.decode: length bytes not complete");if(G[0]===0)throw new $("tlv.decode(long): zero leftmost byte");for(let B of G)X=X<<8|B;if(J+=q,X<128)throw new $("tlv.decode(long): not minimal encoding")}let Y=F.subarray(J,J+X);if(Y.length!==X)throw new $("tlv.decode: wrong value length");return{v:Y,l:F.subarray(J+X)}}},_int:{encode(D){let{Err:F}=_1;if(D<r2)throw new F("integer: negative integers are not allowed");let $=U4(D);if(Number.parseInt($[0],16)&8)$="00"+$;if($.length&1)throw new F("unexpected DER parsing assertion: unpadded hex");return $},decode(D){let{Err:F}=_1;if(D[0]&128)throw new F("invalid signature integer: negative");if(D[0]===0&&!(D[1]&128))throw new F("invalid signature integer: unnecessary leading zero");return r0(D)}},toSig(D){let{Err:F,_int:$,_tlv:J}=_1,Q=oD("signature",D),{v:Z,l:X}=J.decode(48,Q);if(X.length)throw new F("invalid signature: left bytes after parsing");let{v:Y,l:q}=J.decode(2,Z),{v:G,l:B}=J.decode(2,q);if(B.length)throw new F("invalid signature: left bytes after parsing");return{r:$.decode(Y),s:$.decode(G)}},hexFromSig(D){let{_tlv:F,_int:$}=_1,J=F.encode(2,$.encode(D.r)),Q=F.encode(2,$.encode(D.s)),Z=J+Q;return F.encode(48,Z)}};r2=BigInt(0),CD=BigInt(1),DF=BigInt(2),P4=BigInt(3),lW=BigInt(4)});function qr(D){return{hash:D,hmac:(F,...$)=>yW(D,F,kA(...$)),randomBytes:zQ}}function mw(D,F){let $=(J)=>uw({...D,...qr(J)});return{...$(F),create:$}}var dw=x(()=>{Rw();d1();cW();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */});function FF(D,F){if(j4(D),j4(F),D<0||D>=1<<8*F)throw Error("invalid I2OSP input: "+D);let $=Array.from({length:F}).fill(0);for(let J=F-1;J>=0;J--)$[J]=D&255,D>>>=8;return new Uint8Array($)}function Br(D,F){let $=new Uint8Array(D.length);for(let J=0;J<D.length;J++)$[J]=D[J]^F[J];return $}function j4(D){if(!Number.isSafeInteger(D))throw Error("number expected")}function Wr(D,F,$,J){if(K1(D),K1(F),j4($),F.length>255)F=J(f0(fQ("H2C-OVERSIZE-DST-"),F));let{outputLen:Q,blockLen:Z}=J,X=Math.ceil($/Q);if($>65535||X>255)throw Error("expand_message_xmd: invalid lenInBytes");let Y=f0(F,FF(F.length,1)),q=FF(0,Z),G=FF($,2),B=Array(X),W=J(f0(q,D,G,FF(0,1),Y));B[0]=J(f0(W,FF(1,1),Y));for(let U=1;U<=X;U++){let V=[Br(W,B[U-1]),FF(U+1,1),Y];B[U]=J(f0(...V))}return f0(...B).slice(0,$)}function Kr(D,F,$,J,Q){if(K1(D),K1(F),j4($),F.length>255){let Z=Math.ceil(2*J/8);F=Q.create({dkLen:Z}).update(fQ("H2C-OVERSIZE-DST-")).update(F).digest()}if($>65535||F.length>255)throw Error("expand_message_xof: invalid lenInBytes");return Q.create({dkLen:$}).update(D).update(FF($,2)).update(F).update(FF(F.length,1)).digest()}function pw(D,F,$){V1($,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});let{p:J,k:Q,m:Z,hash:X,expand:Y,DST:q}=$;K1(D),j4(F);let G=typeof q==="string"?fQ(q):q,B=J.toString(2).length,W=Math.ceil((B+Q)/8),K=F*Z*W,U;if(Y==="xmd")U=Wr(D,G,K,X);else if(Y==="xof")U=Kr(D,G,K,Q,X);else if(Y==="_internal_pass")U=D;else throw Error('expand must be "xmd" or "xof"');let V=Array(F);for(let H=0;H<F;H++){let z=Array(Z);for(let _=0;_<Z;_++){let O=W*(_+H*Z),C=U.subarray(O,O+W);z[_]=pD(Gr(C),J)}V[H]=z}return V}function lw(D,F){let $=F.map((J)=>Array.from(J).reverse());return(J,Q)=>{let[Z,X,Y,q]=$.map((W)=>W.reduce((K,U)=>D.add(D.mul(K,J),U))),[G,B]=V7(D,[X,q],!0);return J=D.mul(Z,G),Q=D.mul(Q,D.mul(Y,B)),{x:J,y:Q}}}function cw(D,F,$){if(typeof F!=="function")throw Error("mapToCurve() must be defined");function J(Z){return D.fromAffine(F(Z))}function Q(Z){let X=Z.clearCofactor();if(X.equals(D.ZERO))return D.ZERO;return X.assertValidity(),X}return{defaults:$,hashToCurve(Z,X){let Y=pw(Z,2,{...$,DST:$.DST,...X}),q=J(Y[0]),G=J(Y[1]);return Q(q.add(G))},encodeToCurve(Z,X){let Y=pw(Z,1,{...$,DST:$.encodeDST,...X});return Q(J(Y[0]))},mapToCurve(Z){if(!Array.isArray(Z))throw Error("expected array of bigints");for(let X of Z)if(typeof X!=="bigint")throw Error("expected array of bigints");return Q(J(Z))}}}var Gr;var nw=x(()=>{L4();Z7();Gr=r0});var ew={};H2(ew,{secp256k1_hasher:()=>tW,secp256k1:()=>M1,schnorr:()=>zr,hashToCurve:()=>Mr,encodeToCurve:()=>Or});function aw(D){let F=k4,$=BigInt(3),J=BigInt(6),Q=BigInt(11),Z=BigInt(22),X=BigInt(23),Y=BigInt(44),q=BigInt(88),G=D*D*D%F,B=G*G*D%F,W=K2(B,$,F)*B%F,K=K2(W,$,F)*B%F,U=K2(K,JZ,F)*G%F,V=K2(U,Q,F)*U%F,H=K2(V,Z,F)*V%F,z=K2(H,Y,F)*H%F,_=K2(z,q,F)*z%F,O=K2(_,Y,F)*H%F,C=K2(O,$,F)*B%F,M=K2(C,X,F)*V%F,E=K2(M,J,F)*G%F,A=K2(E,JZ,F);if(!$F.eql($F.sqr(A),D))throw Error("Cannot find square root");return A}function QZ(D,...F){let $=ow[D];if($===void 0){let J=H3(Uint8Array.from(D,(Q)=>Q.charCodeAt(0)));$=f0(J,J),ow[D]=$}return H3(f0($,...F))}function oW(D){let F=M1.utils.normPrivateKeyToScalar(D),$=sW.fromPrivateKey(F);return{scalar:$.hasEvenY()?F:x4(-F),bytes:rW($)}}function rw(D){U1("x",D,S4,k4);let F=nW(D*D),$=nW(F*D+BigInt(7)),J=aw($);if(J%JZ!==aW)J=nW(-J);let Q=new sW(D,J,S4);return Q.assertValidity(),Q}function sw(...D){return x4(H7(QZ("BIP0340/challenge",...D)))}function Vr(D){return oW(D).bytes}function Hr(D,F,$=zQ(32)){let J=oD("message",D),{bytes:Q,scalar:Z}=oW(F),X=oD("auxRand",$,32),Y=iW(Z^H7(QZ("BIP0340/aux",X))),q=QZ("BIP0340/nonce",Y,Q,J),G=x4(H7(q));if(G===aW)throw Error("sign failed: k is zero");let{bytes:B,scalar:W}=oW(G),K=sw(B,Q,J),U=new Uint8Array(64);if(U.set(B,0),U.set(iW(x4(W+K*Z)),32),!tw(U,J,Q))throw Error("sign: Invalid signature produced");return U}function tw(D,F,$){let J=oD("signature",D,64),Q=oD("message",F),Z=oD("publicKey",$,32);try{let X=rw(H7(Z)),Y=H7(J.subarray(0,32));if(!Z3(Y,S4,k4))return!1;let q=H7(J.subarray(32,64));if(!Z3(q,S4,$Z))return!1;let G=sw(iW(Y),rW(X),Q),B=Ur(X,q,x4(-G));if(!B||!B.hasEvenY()||B.toAffine().x!==Y)return!1;return!0}catch(X){return!1}}var k4,$Z,aW,S4,JZ,iw=(D,F)=>(D+F/JZ)/F,$F,M1,ow,rW=(D)=>D.toRawBytes(!0).slice(1),iW=(D)=>L8(D,32),nW=(D)=>pD(D,k4),x4=(D)=>pD(D,$Z),sW,Ur=(D,F,$)=>sW.BASE.multiplyAndAddUnsafe(D,F,$),H7,zr,Cr,_r,tW,Mr,Or;var ZZ=x(()=>{xW();d1();dw();nw();L4();Z7();cW();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */k4=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),$Z=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),aW=BigInt(0),S4=BigInt(1),JZ=BigInt(2);$F=T4(k4,void 0,void 0,{sqrt:aw}),M1=mw({a:aW,b:BigInt(7),Fp:$F,n:$Z,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:(D)=>{let F=$Z,$=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),J=-S4*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),Q=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),Z=$,X=BigInt("0x100000000000000000000000000000000"),Y=iw(Z*D,F),q=iw(-J*D,F),G=pD(D-Y*$-q*Q,F),B=pD(-Y*J-q*Z,F),W=G>X,K=B>X;if(W)G=F-G;if(K)B=F-B;if(G>X||B>X)throw Error("splitScalar: Endomorphism failed, k="+D);return{k1neg:W,k1:G,k2neg:K,k2:B}}}},H3),ow={};sW=(()=>M1.ProjectivePoint)();H7=r0;zr=(()=>({getPublicKey:Vr,sign:Hr,verify:tw,utils:{randomPrivateKey:M1.utils.randomPrivateKey,lift_x:rw,pointToBytes:rW,numberToBytesBE:L8,bytesToNumberBE:r0,taggedHash:QZ,mod:pD}}))(),Cr=(()=>lw($F,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map((D)=>D.map((F)=>BigInt(F)))))(),_r=(()=>gw($F,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:$F.create(BigInt("-11"))}))(),tW=(()=>cw(M1.ProjectivePoint,(D)=>{let{x:F,y:$}=_r($F.create(D[0]));return Cr(F,$)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:$F.ORDER,m:1,k:128,expand:"xmd",hash:H3}))(),Mr=(()=>tW.hashToCurve)(),Or=(()=>tW.encodeToCurve)()});var aL=w((X60,hZ)=>{/*!
73
73
  * bytes
74
74
  * Copyright(c) 2012-2014 TJ Holowaychuk
75
75
  * Copyright(c) 2015 Jed Watson
76
76
  * MIT Licensed
77
- */hZ.exports=ls;hZ.exports.format=iL;hZ.exports.parse=oL;var ms=/\B(?=(\d{3})+(?!\d))/g,ds=/(?:\.0*|(\.[^0]+)0+)$/,WF={b:1,kb:1024,mb:1048576,gb:1073741824,tb:Math.pow(1024,4),pb:Math.pow(1024,5)},ps=/^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;function ls(D,F){if(typeof D==="string")return oL(D);if(typeof D==="number")return iL(D,F);return null}function iL(D,F){if(!Number.isFinite(D))return null;var $=Math.abs(D),J=F&&F.thousandsSeparator||"",Q=F&&F.unitSeparator||"",Z=F&&F.decimalPlaces!==void 0?F.decimalPlaces:2,X=Boolean(F&&F.fixedDecimals),Y=F&&F.unit||"";if(!Y||!WF[Y.toLowerCase()])if($>=WF.pb)Y="PB";else if($>=WF.tb)Y="TB";else if($>=WF.gb)Y="GB";else if($>=WF.mb)Y="MB";else if($>=WF.kb)Y="KB";else Y="B";var q=D/WF[Y.toLowerCase()],G=q.toFixed(Z);if(!X)G=G.replace(ds,"$1");if(J)G=G.split(".").map(function(B,W){return W===0?B.replace(ms,J):B}).join(".");return G+Q+Y}function oL(D){if(typeof D==="number"&&!isNaN(D))return D;if(typeof D!=="string")return null;var F=ps.exec(D),$,J="b";if(!F)$=parseInt(D,10),J="b";else $=parseFloat(F[1]),J=F[4].toLowerCase();if(isNaN($))return null;return Math.floor(WF[J]*$)}});var yP=I((D70,WU)=>{var Nt=Object.prototype.hasOwnProperty,v0="~";function Q5(){}if(Object.create){if(Q5.prototype=Object.create(null),!new Q5().__proto__)v0=!1}function Tt(D,F,$){this.fn=D,this.context=F,this.once=$||!1}function kP(D,F,$,J,Q){if(typeof $!=="function")throw TypeError("The listener must be a function");var Z=new Tt($,J||D,Q),X=v0?v0+F:F;if(!D._events[X])D._events[X]=Z,D._eventsCount++;else if(!D._events[X].fn)D._events[X].push(Z);else D._events[X]=[D._events[X],Z];return D}function sZ(D,F){if(--D._eventsCount===0)D._events=new Q5;else delete D._events[F]}function w0(){this._events=new Q5,this._eventsCount=0}w0.prototype.eventNames=function(){var F=[],$,J;if(this._eventsCount===0)return F;for(J in $=this._events)if(Nt.call($,J))F.push(v0?J.slice(1):J);if(Object.getOwnPropertySymbols)return F.concat(Object.getOwnPropertySymbols($));return F};w0.prototype.listeners=function(F){var $=v0?v0+F:F,J=this._events[$];if(!J)return[];if(J.fn)return[J.fn];for(var Q=0,Z=J.length,X=Array(Z);Q<Z;Q++)X[Q]=J[Q].fn;return X};w0.prototype.listenerCount=function(F){var $=v0?v0+F:F,J=this._events[$];if(!J)return 0;if(J.fn)return 1;return J.length};w0.prototype.emit=function(F,$,J,Q,Z,X){var Y=v0?v0+F:F;if(!this._events[Y])return!1;var q=this._events[Y],G=arguments.length,B,W;if(q.fn){if(q.once)this.removeListener(F,q.fn,void 0,!0);switch(G){case 1:return q.fn.call(q.context),!0;case 2:return q.fn.call(q.context,$),!0;case 3:return q.fn.call(q.context,$,J),!0;case 4:return q.fn.call(q.context,$,J,Q),!0;case 5:return q.fn.call(q.context,$,J,Q,Z),!0;case 6:return q.fn.call(q.context,$,J,Q,Z,X),!0}for(W=1,B=Array(G-1);W<G;W++)B[W-1]=arguments[W];q.fn.apply(q.context,B)}else{var K=q.length,U;for(W=0;W<K;W++){if(q[W].once)this.removeListener(F,q[W].fn,void 0,!0);switch(G){case 1:q[W].fn.call(q[W].context);break;case 2:q[W].fn.call(q[W].context,$);break;case 3:q[W].fn.call(q[W].context,$,J);break;case 4:q[W].fn.call(q[W].context,$,J,Q);break;default:if(!B)for(U=1,B=Array(G-1);U<G;U++)B[U-1]=arguments[U];q[W].fn.apply(q[W].context,B)}}}return!0};w0.prototype.on=function(F,$,J){return kP(this,F,$,J,!1)};w0.prototype.once=function(F,$,J){return kP(this,F,$,J,!0)};w0.prototype.removeListener=function(F,$,J,Q){var Z=v0?v0+F:F;if(!this._events[Z])return this;if(!$)return sZ(this,Z),this;var X=this._events[Z];if(X.fn){if(X.fn===$&&(!Q||X.once)&&(!J||X.context===J))sZ(this,Z)}else{for(var Y=0,q=[],G=X.length;Y<G;Y++)if(X[Y].fn!==$||Q&&!X[Y].once||J&&X[Y].context!==J)q.push(X[Y]);if(q.length)this._events[Z]=q.length===1?q[0]:q;else sZ(this,Z)}return this};w0.prototype.removeAllListeners=function(F){var $;if(F){if($=v0?v0+F:F,this._events[$])sZ(this,$)}else this._events=new Q5,this._eventsCount=0;return this};w0.prototype.off=w0.prototype.removeListener;w0.prototype.addListener=w0.prototype.on;w0.prefixed=v0;w0.EventEmitter=w0;if(typeof WU<"u")WU.exports=w0});var dP=I((l70,mP)=>{mP.exports=vt;function g7(D){if(D instanceof Buffer)return Buffer.from(D);return new D.constructor(D.buffer.slice(),D.byteOffset,D.length)}function vt(D){if(D=D||{},D.circles)return ht(D);let F=new Map;if(F.set(Date,(X)=>new Date(X)),F.set(Map,(X,Y)=>new Map(J(Array.from(X),Y))),F.set(Set,(X,Y)=>new Set(J(Array.from(X),Y))),D.constructorHandlers)for(let X of D.constructorHandlers)F.set(X[0],X[1]);let $=null;return D.proto?Z:Q;function J(X,Y){let q=Object.keys(X),G=Array(q.length);for(let B=0;B<q.length;B++){let W=q[B],K=X[W];if(typeof K!=="object"||K===null)G[W]=K;else if(K.constructor!==Object&&($=F.get(K.constructor)))G[W]=$(K,Y);else if(ArrayBuffer.isView(K))G[W]=g7(K);else G[W]=Y(K)}return G}function Q(X){if(typeof X!=="object"||X===null)return X;if(Array.isArray(X))return J(X,Q);if(X.constructor!==Object&&($=F.get(X.constructor)))return $(X,Q);let Y={};for(let q in X){if(Object.hasOwnProperty.call(X,q)===!1)continue;let G=X[q];if(typeof G!=="object"||G===null)Y[q]=G;else if(G.constructor!==Object&&($=F.get(G.constructor)))Y[q]=$(G,Q);else if(ArrayBuffer.isView(G))Y[q]=g7(G);else Y[q]=Q(G)}return Y}function Z(X){if(typeof X!=="object"||X===null)return X;if(Array.isArray(X))return J(X,Z);if(X.constructor!==Object&&($=F.get(X.constructor)))return $(X,Z);let Y={};for(let q in X){let G=X[q];if(typeof G!=="object"||G===null)Y[q]=G;else if(G.constructor!==Object&&($=F.get(G.constructor)))Y[q]=$(G,Z);else if(ArrayBuffer.isView(G))Y[q]=g7(G);else Y[q]=Z(G)}return Y}}function ht(D){let F=[],$=[],J=new Map;if(J.set(Date,(q)=>new Date(q)),J.set(Map,(q,G)=>new Map(Z(Array.from(q),G))),J.set(Set,(q,G)=>new Set(Z(Array.from(q),G))),D.constructorHandlers)for(let q of D.constructorHandlers)J.set(q[0],q[1]);let Q=null;return D.proto?Y:X;function Z(q,G){let B=Object.keys(q),W=Array(B.length);for(let K=0;K<B.length;K++){let U=B[K],V=q[U];if(typeof V!=="object"||V===null)W[U]=V;else if(V.constructor!==Object&&(Q=J.get(V.constructor)))W[U]=Q(V,G);else if(ArrayBuffer.isView(V))W[U]=g7(V);else{let H=F.indexOf(V);if(H!==-1)W[U]=$[H];else W[U]=G(V)}}return W}function X(q){if(typeof q!=="object"||q===null)return q;if(Array.isArray(q))return Z(q,X);if(q.constructor!==Object&&(Q=J.get(q.constructor)))return Q(q,X);let G={};F.push(q),$.push(G);for(let B in q){if(Object.hasOwnProperty.call(q,B)===!1)continue;let W=q[B];if(typeof W!=="object"||W===null)G[B]=W;else if(W.constructor!==Object&&(Q=J.get(W.constructor)))G[B]=Q(W,X);else if(ArrayBuffer.isView(W))G[B]=g7(W);else{let K=F.indexOf(W);if(K!==-1)G[B]=$[K];else G[B]=X(W)}}return F.pop(),$.pop(),G}function Y(q){if(typeof q!=="object"||q===null)return q;if(Array.isArray(q))return Z(q,Y);if(q.constructor!==Object&&(Q=J.get(q.constructor)))return Q(q,Y);let G={};F.push(q),$.push(G);for(let B in q){let W=q[B];if(typeof W!=="object"||W===null)G[B]=W;else if(W.constructor!==Object&&(Q=J.get(W.constructor)))G[B]=Q(W,Y);else if(ArrayBuffer.isView(W))G[B]=g7(W);else{let K=F.indexOf(W);if(K!==-1)G[B]=$[K];else G[B]=Y(W)}}return F.pop(),$.pop(),G}}});var m7,c70,n70,i70,o70,a70,r70,s70,t70,e70,Z5,D90,F90,$90,J90,Q90;var pP=x(()=>{m7=globalThis.window?.document!==void 0,c70=globalThis.process?.versions?.node!==void 0,n70=globalThis.process?.versions?.bun!==void 0,i70=globalThis.Deno?.version?.deno!==void 0,o70=globalThis.process?.versions?.electron!==void 0,a70=globalThis.navigator?.userAgent?.includes("jsdom")===!0,r70=typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope,s70=typeof DedicatedWorkerGlobalScope<"u"&&globalThis instanceof DedicatedWorkerGlobalScope,t70=typeof SharedWorkerGlobalScope<"u"&&globalThis instanceof SharedWorkerGlobalScope,e70=typeof ServiceWorkerGlobalScope<"u"&&globalThis instanceof ServiceWorkerGlobalScope,Z5=globalThis.navigator?.userAgentData?.platform,D90=Z5==="macOS"||globalThis.navigator?.platform==="MacIntel"||globalThis.navigator?.userAgent?.includes(" Mac ")===!0||globalThis.process?.platform==="darwin",F90=Z5==="Windows"||globalThis.navigator?.platform==="Win32"||globalThis.process?.platform==="win32",$90=Z5==="Linux"||globalThis.navigator?.platform?.startsWith("Linux")===!0||globalThis.navigator?.userAgent?.includes(" Linux ")===!0||globalThis.process?.platform==="linux",J90=Z5==="iOS"||globalThis.navigator?.platform==="MacIntel"&&globalThis.navigator?.maxTouchPoints>1||/iPad|iPhone|iPod/.test(globalThis.navigator?.platform),Q90=Z5==="Android"||globalThis.navigator?.platform==="Android"||globalThis.navigator?.userAgent?.includes(" Android ")===!0||globalThis.process?.platform==="android"});var h0={};H2(h0,{setCwd:()=>ze,scrollUp:()=>Ze,scrollDown:()=>Xe,link:()=>Ve,image:()=>He,iTerm:()=>oP,exitAlternativeScreen:()=>Ke,eraseUp:()=>Qe,eraseStartLine:()=>$e,eraseScreen:()=>eZ,eraseLines:()=>De,eraseLine:()=>iP,eraseEndLine:()=>Fe,eraseDown:()=>Je,enterAlternativeScreen:()=>We,cursorUp:()=>cP,cursorTo:()=>dt,cursorShow:()=>et,cursorSavePosition:()=>it,cursorRestorePosition:()=>ot,cursorPrevLine:()=>st,cursorNextLine:()=>rt,cursorMove:()=>pt,cursorLeft:()=>nP,cursorHide:()=>tt,cursorGetPosition:()=>at,cursorForward:()=>ct,cursorDown:()=>lt,cursorBackward:()=>nt,clearViewport:()=>qe,clearTerminal:()=>Be,clearScreen:()=>Ye,beep:()=>Ue,ConEmu:()=>aP});import d7 from"node:process";import ut from"node:os";var UD="\x1B[",p7="\x1B]",L3="\x07",X5=";",lP,gt,mt,UU,l7=(D)=>{if(mt)return"\x1BPtmux;"+D.replaceAll("\x1B","\x1B\x1B")+"\x1B\\";return D},dt=(D,F)=>{if(typeof D!=="number")throw TypeError("The `x` argument is required");if(typeof F!=="number")return UD+(D+1)+"G";return UD+(F+1)+X5+(D+1)+"H"},pt=(D,F)=>{if(typeof D!=="number")throw TypeError("The `x` argument is required");let $="";if(D<0)$+=UD+-D+"D";else if(D>0)$+=UD+D+"C";if(F<0)$+=UD+-F+"A";else if(F>0)$+=UD+F+"B";return $},cP=(D=1)=>UD+D+"A",lt=(D=1)=>UD+D+"B",ct=(D=1)=>UD+D+"C",nt=(D=1)=>UD+D+"D",nP,it,ot,at,rt,st,tt,et,De=(D)=>{let F="";for(let $=0;$<D;$++)F+=iP+($<D-1?cP():"");if(D)F+=nP;return F},Fe,$e,iP,Je,Qe,eZ,Ze,Xe,Ye="\x1Bc",qe,Ge=()=>{if(m7||!gt)return!1;let D=ut.release().split("."),F=Number(D[0]),$=Number(D[2]??0);if(F<10)return!0;if(F===10&&$<10586)return!0;return!1},Be,We,Ke,Ue,Ve=(D,F)=>{let $=l7(`${p7}8${X5}${X5}${F}${L3}`),J=l7(`${p7}8${X5}${X5}${L3}`);return $+D+J},He=(D,F={})=>{let $=`${p7}1337;File=inline=1`;if(F.width)$+=`;width=${F.width}`;if(F.height)$+=`;height=${F.height}`;if(F.preserveAspectRatio===!1)$+=";preserveAspectRatio=0";let J=Buffer.from(D);return l7($+`;size=${J.byteLength}:`+J.toString("base64")+L3)},oP,aP,ze=(D=UU())=>oP.setCwd(D)+aP.setCwd(D);var VU=x(()=>{pP();lP=!m7&&d7.env.TERM_PROGRAM==="Apple_Terminal",gt=!m7&&d7.platform==="win32",mt=!m7&&(d7.env.TERM?.startsWith("screen")||d7.env.TERM?.startsWith("tmux")||d7.env.TMUX!==void 0),UU=m7?()=>{throw Error("`process.cwd()` only works in Node.js, not the browser.")}:d7.cwd,nP=UD+"G",it=lP?"\x1B7":UD+"s",ot=lP?"\x1B8":UD+"u",at=UD+"6n",rt=UD+"E",st=UD+"F",tt=UD+"?25l",et=UD+"?25h",Fe=UD+"K",$e=UD+"1K",iP=UD+"2K",Je=UD+"J",Qe=UD+"1J",eZ=UD+"2J",Ze=UD+"S",Xe=UD+"T",qe=`${eZ}${UD}H`,Be=Ge()?`${eZ}${UD}0f`:`${eZ}${UD}3J${UD}H`,We=UD+"?1049h",Ke=UD+"?1049l",Ue=L3,oP={setCwd:(D=UU())=>l7(`${p7}50;CurrentDir=${D}${L3}`),annotation(D,F={}){let $=`${p7}1337;`,J=F.x!==void 0,Q=F.y!==void 0;if((J||Q)&&!(J&&Q&&F.length!==void 0))throw Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");if(D=D.replaceAll("|",""),$+=F.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",F.length>0)$+=(J?[D,F.length,F.x,F.y]:[F.length,D]).join("|");else $+=D;return l7($+L3)}},aP={setCwd:(D=UU())=>l7(`${p7}9;9;${D}${L3}`)}});var rP=x(()=>{VU();VU()});function HU(D,F,{ignoreNonConfigurable:$=!1}={}){let{name:J}=D;for(let Q of Reflect.ownKeys(F))Ce(D,F,Q,$);return Me(D,F),Ae(D,F,J),D}var Ce=(D,F,$,J)=>{if($==="length"||$==="prototype")return;if($==="arguments"||$==="caller")return;let Q=Object.getOwnPropertyDescriptor(D,$),Z=Object.getOwnPropertyDescriptor(F,$);if(!_e(Q,Z)&&J)return;Object.defineProperty(D,$,Z)},_e=function(D,F){return D===void 0||D.configurable||D.writable===F.writable&&D.enumerable===F.enumerable&&D.configurable===F.configurable&&(D.writable||D.value===F.value)},Me=(D,F)=>{let $=Object.getPrototypeOf(F);if($===Object.getPrototypeOf(D))return;Object.setPrototypeOf(D,$)},Oe=(D,F)=>`/* Wrapped ${D}*/
78
- ${F}`,Ee,Re,Ae=(D,F,$)=>{let J=$===""?"":`with ${$.trim()}() `,Q=Oe.bind(null,J,F.toString());Object.defineProperty(Q,"name",Re);let{writable:Z,enumerable:X,configurable:Y}=Ee;Object.defineProperty(D,"toString",{value:Q,writable:Z,enumerable:X,configurable:Y})};var sP=x(()=>{Ee=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Re=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name")});var DX,tP=(D,F={})=>{if(typeof D!=="function")throw TypeError("Expected a function");let $,J=0,Q=D.displayName||D.name||"<anonymous>",Z=function(...X){if(DX.set(Z,++J),J===1)$=D.apply(this,X),D=void 0;else if(F.throw===!0)throw Error(`Function \`${Q}\` can only be called once`);return $};return HU(Z,D),DX.set(Z,J),Z},eP;var Dj=x(()=>{sP();DX=new WeakMap;tP.callCount=(D)=>{if(!DX.has(D))throw Error(`The given function \`${D.name}\` is not wrapped by the \`onetime\` package`);return DX.get(D)};eP=tP});import FX from"node:process";var Fj,Ie,$j;var Jj=x(()=>{Dj();IJ();Fj=FX.stderr.isTTY?FX.stderr:FX.stdout.isTTY?FX.stdout:void 0,Ie=Fj?eP(()=>{C6(()=>{Fj.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},$j=Ie});import Qj from"node:process";var $X=!1,c7,n7;var zU=x(()=>{Jj();c7={};c7.show=(D=Qj.stderr)=>{if(!D.isTTY)return;$X=!1,D.write("\x1B[?25h")};c7.hide=(D=Qj.stderr)=>{if(!D.isTTY)return;$j(),$X=!0,D.write("\x1B[?25l")};c7.toggle=(D,F)=>{if(D!==void 0)$X=D;if($X)c7.show(F);else c7.hide(F)};n7=c7});function CU({onlyFirst:D=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",D?void 0:"g")}function O1(D){if(typeof D!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof D}\``);return D.replace(we,"")}var we;var Y5=x(()=>{we=CU()});function Zj(D){return D===161||D===164||D===167||D===168||D===170||D===173||D===174||D>=176&&D<=180||D>=182&&D<=186||D>=188&&D<=191||D===198||D===208||D===215||D===216||D>=222&&D<=225||D===230||D>=232&&D<=234||D===236||D===237||D===240||D===242||D===243||D>=247&&D<=250||D===252||D===254||D===257||D===273||D===275||D===283||D===294||D===295||D===299||D>=305&&D<=307||D===312||D>=319&&D<=322||D===324||D>=328&&D<=331||D===333||D===338||D===339||D===358||D===359||D===363||D===462||D===464||D===466||D===468||D===470||D===472||D===474||D===476||D===593||D===609||D===708||D===711||D>=713&&D<=715||D===717||D===720||D>=728&&D<=731||D===733||D===735||D>=768&&D<=879||D>=913&&D<=929||D>=931&&D<=937||D>=945&&D<=961||D>=963&&D<=969||D===1025||D>=1040&&D<=1103||D===1105||D===8208||D>=8211&&D<=8214||D===8216||D===8217||D===8220||D===8221||D>=8224&&D<=8226||D>=8228&&D<=8231||D===8240||D===8242||D===8243||D===8245||D===8251||D===8254||D===8308||D===8319||D>=8321&&D<=8324||D===8364||D===8451||D===8453||D===8457||D===8467||D===8470||D===8481||D===8482||D===8486||D===8491||D===8531||D===8532||D>=8539&&D<=8542||D>=8544&&D<=8555||D>=8560&&D<=8569||D===8585||D>=8592&&D<=8601||D===8632||D===8633||D===8658||D===8660||D===8679||D===8704||D===8706||D===8707||D===8711||D===8712||D===8715||D===8719||D===8721||D===8725||D===8730||D>=8733&&D<=8736||D===8739||D===8741||D>=8743&&D<=8748||D===8750||D>=8756&&D<=8759||D===8764||D===8765||D===8776||D===8780||D===8786||D===8800||D===8801||D>=8804&&D<=8807||D===8810||D===8811||D===8814||D===8815||D===8834||D===8835||D===8838||D===8839||D===8853||D===8857||D===8869||D===8895||D===8978||D>=9312&&D<=9449||D>=9451&&D<=9547||D>=9552&&D<=9587||D>=9600&&D<=9615||D>=9618&&D<=9621||D===9632||D===9633||D>=9635&&D<=9641||D===9650||D===9651||D===9654||D===9655||D===9660||D===9661||D===9664||D===9665||D>=9670&&D<=9672||D===9675||D>=9678&&D<=9681||D>=9698&&D<=9701||D===9711||D===9733||D===9734||D===9737||D===9742||D===9743||D===9756||D===9758||D===9792||D===9794||D===9824||D===9825||D>=9827&&D<=9829||D>=9831&&D<=9834||D===9836||D===9837||D===9839||D===9886||D===9887||D===9919||D>=9926&&D<=9933||D>=9935&&D<=9939||D>=9941&&D<=9953||D===9955||D===9960||D===9961||D>=9963&&D<=9969||D===9972||D>=9974&&D<=9977||D===9979||D===9980||D===9982||D===9983||D===10045||D>=10102&&D<=10111||D>=11094&&D<=11097||D>=12872&&D<=12879||D>=57344&&D<=63743||D>=65024&&D<=65039||D===65533||D>=127232&&D<=127242||D>=127248&&D<=127277||D>=127280&&D<=127337||D>=127344&&D<=127373||D===127375||D===127376||D>=127387&&D<=127404||D>=917760&&D<=917999||D>=983040&&D<=1048573||D>=1048576&&D<=1114109}function q5(D){return D===12288||D>=65281&&D<=65376||D>=65504&&D<=65510}function G5(D){return D>=4352&&D<=4447||D===8986||D===8987||D===9001||D===9002||D>=9193&&D<=9196||D===9200||D===9203||D===9725||D===9726||D===9748||D===9749||D>=9776&&D<=9783||D>=9800&&D<=9811||D===9855||D>=9866&&D<=9871||D===9875||D===9889||D===9898||D===9899||D===9917||D===9918||D===9924||D===9925||D===9934||D===9940||D===9962||D===9970||D===9971||D===9973||D===9978||D===9981||D===9989||D===9994||D===9995||D===10024||D===10060||D===10062||D>=10067&&D<=10069||D===10071||D>=10133&&D<=10135||D===10160||D===10175||D===11035||D===11036||D===11088||D===11093||D>=11904&&D<=11929||D>=11931&&D<=12019||D>=12032&&D<=12245||D>=12272&&D<=12287||D>=12289&&D<=12350||D>=12353&&D<=12438||D>=12441&&D<=12543||D>=12549&&D<=12591||D>=12593&&D<=12686||D>=12688&&D<=12773||D>=12783&&D<=12830||D>=12832&&D<=12871||D>=12880&&D<=42124||D>=42128&&D<=42182||D>=43360&&D<=43388||D>=44032&&D<=55203||D>=63744&&D<=64255||D>=65040&&D<=65049||D>=65072&&D<=65106||D>=65108&&D<=65126||D>=65128&&D<=65131||D>=94176&&D<=94180||D>=94192&&D<=94198||D>=94208&&D<=101589||D>=101631&&D<=101662||D>=101760&&D<=101874||D>=110576&&D<=110579||D>=110581&&D<=110587||D===110589||D===110590||D>=110592&&D<=110882||D===110898||D>=110928&&D<=110930||D===110933||D>=110948&&D<=110951||D>=110960&&D<=111355||D>=119552&&D<=119638||D>=119648&&D<=119670||D===126980||D===127183||D===127374||D>=127377&&D<=127386||D>=127488&&D<=127490||D>=127504&&D<=127547||D>=127552&&D<=127560||D===127568||D===127569||D>=127584&&D<=127589||D>=127744&&D<=127776||D>=127789&&D<=127797||D>=127799&&D<=127868||D>=127870&&D<=127891||D>=127904&&D<=127946||D>=127951&&D<=127955||D>=127968&&D<=127984||D===127988||D>=127992&&D<=128062||D===128064||D>=128066&&D<=128252||D>=128255&&D<=128317||D>=128331&&D<=128334||D>=128336&&D<=128359||D===128378||D===128405||D===128406||D===128420||D>=128507&&D<=128591||D>=128640&&D<=128709||D===128716||D>=128720&&D<=128722||D>=128725&&D<=128728||D>=128732&&D<=128735||D===128747||D===128748||D>=128756&&D<=128764||D>=128992&&D<=129003||D===129008||D>=129292&&D<=129338||D>=129340&&D<=129349||D>=129351&&D<=129535||D>=129648&&D<=129660||D>=129664&&D<=129674||D>=129678&&D<=129734||D===129736||D>=129741&&D<=129756||D>=129759&&D<=129770||D>=129775&&D<=129784||D>=131072&&D<=196605||D>=196608&&D<=262141}var _U=()=>{};function Ne(D){if(!Number.isSafeInteger(D))throw TypeError(`Expected a code point, got \`${typeof D}\`.`)}function B5(D,{ambiguousAsWide:F=!1}={}){if(Ne(D),q5(D)||G5(D)||F&&Zj(D))return 2;return 1}var JX=x(()=>{_U();_U()});var Yj=I((P90,Xj)=>{Xj.exports=()=>{return/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g}});function P3(D,F={}){if(typeof D!=="string"||D.length===0)return 0;let{ambiguousIsNarrow:$=!0,countAnsiEscapeCodes:J=!1}=F;if(!J)D=O1(D);if(D.length===0)return 0;let Q=0,Z={ambiguousAsWide:!$};for(let{segment:X}of Te.segment(D)){let Y=X.codePointAt(0);if(Y<=31||Y>=127&&Y<=159)continue;if(Y>=8203&&Y<=8207||Y===65279)continue;if(Y>=768&&Y<=879||Y>=6832&&Y<=6911||Y>=7616&&Y<=7679||Y>=8400&&Y<=8447||Y>=65056&&Y<=65071)continue;if(Y>=55296&&Y<=57343)continue;if(Y>=65024&&Y<=65039)continue;if(Le.test(X))continue;if(qj.default().test(X)){Q+=2;continue}Q+=B5(Y,Z)}return Q}var qj,Te,Le;var Gj=x(()=>{Y5();JX();qj=TD(Yj(),1),Te=new Intl.Segmenter,Le=/^\p{Default_Ignorable_Code_Point}$/u});function Se(){let D=new Map;for(let[F,$]of Object.entries(xD)){for(let[J,Q]of Object.entries($))xD[J]={open:`\x1B[${Q[0]}m`,close:`\x1B[${Q[1]}m`},$[J]=xD[J],D.set(Q[0],Q[1]);Object.defineProperty(xD,F,{value:$,enumerable:!1})}return Object.defineProperty(xD,"codes",{value:D,enumerable:!1}),xD.color.close="\x1B[39m",xD.bgColor.close="\x1B[49m",xD.color.ansi=Bj(),xD.color.ansi256=Wj(),xD.color.ansi16m=Kj(),xD.bgColor.ansi=Bj(10),xD.bgColor.ansi256=Wj(10),xD.bgColor.ansi16m=Kj(10),Object.defineProperties(xD,{rgbToAnsi256:{value(F,$,J){if(F===$&&$===J){if(F<8)return 16;if(F>248)return 231;return Math.round((F-8)/247*24)+232}return 16+36*Math.round(F/255*5)+6*Math.round($/255*5)+Math.round(J/255*5)},enumerable:!1},hexToRgb:{value(F){let $=/[a-f\d]{6}|[a-f\d]{3}/i.exec(F.toString(16));if(!$)return[0,0,0];let[J]=$;if(J.length===3)J=[...J].map((Z)=>Z+Z).join("");let Q=Number.parseInt(J,16);return[Q>>16&255,Q>>8&255,Q&255]},enumerable:!1},hexToAnsi256:{value:(F)=>xD.rgbToAnsi256(...xD.hexToRgb(F)),enumerable:!1},ansi256ToAnsi:{value(F){if(F<8)return 30+F;if(F<16)return 90+(F-8);let $,J,Q;if(F>=232)$=((F-232)*10+8)/255,J=$,Q=$;else{F-=16;let Y=F%36;$=Math.floor(F/36)/5,J=Math.floor(Y/6)/5,Q=Y%6/5}let Z=Math.max($,J,Q)*2;if(Z===0)return 30;let X=30+(Math.round(Q)<<2|Math.round(J)<<1|Math.round($));if(Z===2)X+=60;return X},enumerable:!1},rgbToAnsi:{value:(F,$,J)=>xD.ansi256ToAnsi(xD.rgbToAnsi256(F,$,J)),enumerable:!1},hexToAnsi:{value:(F)=>xD.ansi256ToAnsi(xD.hexToAnsi256(F)),enumerable:!1}}),xD}var Bj=(D=0)=>(F)=>`\x1B[${F+D}m`,Wj=(D=0)=>(F)=>`\x1B[${38+D};5;${F}m`,Kj=(D=0)=>(F,$,J)=>`\x1B[${38+D};2;${F};${$};${J}m`,xD,k90,Pe,je,y90,xe,D8;var MU=x(()=>{xD={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]}},k90=Object.keys(xD.modifier),Pe=Object.keys(xD.color),je=Object.keys(xD.bgColor),y90=[...Pe,...je];xe=Se(),D8=xe});var Cj={};H2(Cj,{default:()=>XX});function XX(D,F,$){return String(D).normalize().replaceAll(`\r
77
+ */hZ.exports=ls;hZ.exports.format=iL;hZ.exports.parse=oL;var ms=/\B(?=(\d{3})+(?!\d))/g,ds=/(?:\.0*|(\.[^0]+)0+)$/,WF={b:1,kb:1024,mb:1048576,gb:1073741824,tb:Math.pow(1024,4),pb:Math.pow(1024,5)},ps=/^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;function ls(D,F){if(typeof D==="string")return oL(D);if(typeof D==="number")return iL(D,F);return null}function iL(D,F){if(!Number.isFinite(D))return null;var $=Math.abs(D),J=F&&F.thousandsSeparator||"",Q=F&&F.unitSeparator||"",Z=F&&F.decimalPlaces!==void 0?F.decimalPlaces:2,X=Boolean(F&&F.fixedDecimals),Y=F&&F.unit||"";if(!Y||!WF[Y.toLowerCase()])if($>=WF.pb)Y="PB";else if($>=WF.tb)Y="TB";else if($>=WF.gb)Y="GB";else if($>=WF.mb)Y="MB";else if($>=WF.kb)Y="KB";else Y="B";var q=D/WF[Y.toLowerCase()],G=q.toFixed(Z);if(!X)G=G.replace(ds,"$1");if(J)G=G.split(".").map(function(B,W){return W===0?B.replace(ms,J):B}).join(".");return G+Q+Y}function oL(D){if(typeof D==="number"&&!isNaN(D))return D;if(typeof D!=="string")return null;var F=ps.exec(D),$,J="b";if(!F)$=parseInt(D,10),J="b";else $=parseFloat(F[1]),J=F[4].toLowerCase();if(isNaN($))return null;return Math.floor(WF[J]*$)}});var yP=w((D70,WU)=>{var Nt=Object.prototype.hasOwnProperty,v0="~";function Q5(){}if(Object.create){if(Q5.prototype=Object.create(null),!new Q5().__proto__)v0=!1}function Tt(D,F,$){this.fn=D,this.context=F,this.once=$||!1}function kP(D,F,$,J,Q){if(typeof $!=="function")throw TypeError("The listener must be a function");var Z=new Tt($,J||D,Q),X=v0?v0+F:F;if(!D._events[X])D._events[X]=Z,D._eventsCount++;else if(!D._events[X].fn)D._events[X].push(Z);else D._events[X]=[D._events[X],Z];return D}function sZ(D,F){if(--D._eventsCount===0)D._events=new Q5;else delete D._events[F]}function w0(){this._events=new Q5,this._eventsCount=0}w0.prototype.eventNames=function(){var F=[],$,J;if(this._eventsCount===0)return F;for(J in $=this._events)if(Nt.call($,J))F.push(v0?J.slice(1):J);if(Object.getOwnPropertySymbols)return F.concat(Object.getOwnPropertySymbols($));return F};w0.prototype.listeners=function(F){var $=v0?v0+F:F,J=this._events[$];if(!J)return[];if(J.fn)return[J.fn];for(var Q=0,Z=J.length,X=Array(Z);Q<Z;Q++)X[Q]=J[Q].fn;return X};w0.prototype.listenerCount=function(F){var $=v0?v0+F:F,J=this._events[$];if(!J)return 0;if(J.fn)return 1;return J.length};w0.prototype.emit=function(F,$,J,Q,Z,X){var Y=v0?v0+F:F;if(!this._events[Y])return!1;var q=this._events[Y],G=arguments.length,B,W;if(q.fn){if(q.once)this.removeListener(F,q.fn,void 0,!0);switch(G){case 1:return q.fn.call(q.context),!0;case 2:return q.fn.call(q.context,$),!0;case 3:return q.fn.call(q.context,$,J),!0;case 4:return q.fn.call(q.context,$,J,Q),!0;case 5:return q.fn.call(q.context,$,J,Q,Z),!0;case 6:return q.fn.call(q.context,$,J,Q,Z,X),!0}for(W=1,B=Array(G-1);W<G;W++)B[W-1]=arguments[W];q.fn.apply(q.context,B)}else{var K=q.length,U;for(W=0;W<K;W++){if(q[W].once)this.removeListener(F,q[W].fn,void 0,!0);switch(G){case 1:q[W].fn.call(q[W].context);break;case 2:q[W].fn.call(q[W].context,$);break;case 3:q[W].fn.call(q[W].context,$,J);break;case 4:q[W].fn.call(q[W].context,$,J,Q);break;default:if(!B)for(U=1,B=Array(G-1);U<G;U++)B[U-1]=arguments[U];q[W].fn.apply(q[W].context,B)}}}return!0};w0.prototype.on=function(F,$,J){return kP(this,F,$,J,!1)};w0.prototype.once=function(F,$,J){return kP(this,F,$,J,!0)};w0.prototype.removeListener=function(F,$,J,Q){var Z=v0?v0+F:F;if(!this._events[Z])return this;if(!$)return sZ(this,Z),this;var X=this._events[Z];if(X.fn){if(X.fn===$&&(!Q||X.once)&&(!J||X.context===J))sZ(this,Z)}else{for(var Y=0,q=[],G=X.length;Y<G;Y++)if(X[Y].fn!==$||Q&&!X[Y].once||J&&X[Y].context!==J)q.push(X[Y]);if(q.length)this._events[Z]=q.length===1?q[0]:q;else sZ(this,Z)}return this};w0.prototype.removeAllListeners=function(F){var $;if(F){if($=v0?v0+F:F,this._events[$])sZ(this,$)}else this._events=new Q5,this._eventsCount=0;return this};w0.prototype.off=w0.prototype.removeListener;w0.prototype.addListener=w0.prototype.on;w0.prefixed=v0;w0.EventEmitter=w0;if(typeof WU<"u")WU.exports=w0});var dP=w((l70,mP)=>{mP.exports=vt;function g7(D){if(D instanceof Buffer)return Buffer.from(D);return new D.constructor(D.buffer.slice(),D.byteOffset,D.length)}function vt(D){if(D=D||{},D.circles)return ht(D);let F=new Map;if(F.set(Date,(X)=>new Date(X)),F.set(Map,(X,Y)=>new Map(J(Array.from(X),Y))),F.set(Set,(X,Y)=>new Set(J(Array.from(X),Y))),D.constructorHandlers)for(let X of D.constructorHandlers)F.set(X[0],X[1]);let $=null;return D.proto?Z:Q;function J(X,Y){let q=Object.keys(X),G=Array(q.length);for(let B=0;B<q.length;B++){let W=q[B],K=X[W];if(typeof K!=="object"||K===null)G[W]=K;else if(K.constructor!==Object&&($=F.get(K.constructor)))G[W]=$(K,Y);else if(ArrayBuffer.isView(K))G[W]=g7(K);else G[W]=Y(K)}return G}function Q(X){if(typeof X!=="object"||X===null)return X;if(Array.isArray(X))return J(X,Q);if(X.constructor!==Object&&($=F.get(X.constructor)))return $(X,Q);let Y={};for(let q in X){if(Object.hasOwnProperty.call(X,q)===!1)continue;let G=X[q];if(typeof G!=="object"||G===null)Y[q]=G;else if(G.constructor!==Object&&($=F.get(G.constructor)))Y[q]=$(G,Q);else if(ArrayBuffer.isView(G))Y[q]=g7(G);else Y[q]=Q(G)}return Y}function Z(X){if(typeof X!=="object"||X===null)return X;if(Array.isArray(X))return J(X,Z);if(X.constructor!==Object&&($=F.get(X.constructor)))return $(X,Z);let Y={};for(let q in X){let G=X[q];if(typeof G!=="object"||G===null)Y[q]=G;else if(G.constructor!==Object&&($=F.get(G.constructor)))Y[q]=$(G,Z);else if(ArrayBuffer.isView(G))Y[q]=g7(G);else Y[q]=Z(G)}return Y}}function ht(D){let F=[],$=[],J=new Map;if(J.set(Date,(q)=>new Date(q)),J.set(Map,(q,G)=>new Map(Z(Array.from(q),G))),J.set(Set,(q,G)=>new Set(Z(Array.from(q),G))),D.constructorHandlers)for(let q of D.constructorHandlers)J.set(q[0],q[1]);let Q=null;return D.proto?Y:X;function Z(q,G){let B=Object.keys(q),W=Array(B.length);for(let K=0;K<B.length;K++){let U=B[K],V=q[U];if(typeof V!=="object"||V===null)W[U]=V;else if(V.constructor!==Object&&(Q=J.get(V.constructor)))W[U]=Q(V,G);else if(ArrayBuffer.isView(V))W[U]=g7(V);else{let H=F.indexOf(V);if(H!==-1)W[U]=$[H];else W[U]=G(V)}}return W}function X(q){if(typeof q!=="object"||q===null)return q;if(Array.isArray(q))return Z(q,X);if(q.constructor!==Object&&(Q=J.get(q.constructor)))return Q(q,X);let G={};F.push(q),$.push(G);for(let B in q){if(Object.hasOwnProperty.call(q,B)===!1)continue;let W=q[B];if(typeof W!=="object"||W===null)G[B]=W;else if(W.constructor!==Object&&(Q=J.get(W.constructor)))G[B]=Q(W,X);else if(ArrayBuffer.isView(W))G[B]=g7(W);else{let K=F.indexOf(W);if(K!==-1)G[B]=$[K];else G[B]=X(W)}}return F.pop(),$.pop(),G}function Y(q){if(typeof q!=="object"||q===null)return q;if(Array.isArray(q))return Z(q,Y);if(q.constructor!==Object&&(Q=J.get(q.constructor)))return Q(q,Y);let G={};F.push(q),$.push(G);for(let B in q){let W=q[B];if(typeof W!=="object"||W===null)G[B]=W;else if(W.constructor!==Object&&(Q=J.get(W.constructor)))G[B]=Q(W,Y);else if(ArrayBuffer.isView(W))G[B]=g7(W);else{let K=F.indexOf(W);if(K!==-1)G[B]=$[K];else G[B]=Y(W)}}return F.pop(),$.pop(),G}}});var m7,c70,n70,i70,o70,a70,r70,s70,t70,e70,Z5,D90,F90,$90,J90,Q90;var pP=x(()=>{m7=globalThis.window?.document!==void 0,c70=globalThis.process?.versions?.node!==void 0,n70=globalThis.process?.versions?.bun!==void 0,i70=globalThis.Deno?.version?.deno!==void 0,o70=globalThis.process?.versions?.electron!==void 0,a70=globalThis.navigator?.userAgent?.includes("jsdom")===!0,r70=typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope,s70=typeof DedicatedWorkerGlobalScope<"u"&&globalThis instanceof DedicatedWorkerGlobalScope,t70=typeof SharedWorkerGlobalScope<"u"&&globalThis instanceof SharedWorkerGlobalScope,e70=typeof ServiceWorkerGlobalScope<"u"&&globalThis instanceof ServiceWorkerGlobalScope,Z5=globalThis.navigator?.userAgentData?.platform,D90=Z5==="macOS"||globalThis.navigator?.platform==="MacIntel"||globalThis.navigator?.userAgent?.includes(" Mac ")===!0||globalThis.process?.platform==="darwin",F90=Z5==="Windows"||globalThis.navigator?.platform==="Win32"||globalThis.process?.platform==="win32",$90=Z5==="Linux"||globalThis.navigator?.platform?.startsWith("Linux")===!0||globalThis.navigator?.userAgent?.includes(" Linux ")===!0||globalThis.process?.platform==="linux",J90=Z5==="iOS"||globalThis.navigator?.platform==="MacIntel"&&globalThis.navigator?.maxTouchPoints>1||/iPad|iPhone|iPod/.test(globalThis.navigator?.platform),Q90=Z5==="Android"||globalThis.navigator?.platform==="Android"||globalThis.navigator?.userAgent?.includes(" Android ")===!0||globalThis.process?.platform==="android"});var h0={};H2(h0,{setCwd:()=>ze,scrollUp:()=>Ze,scrollDown:()=>Xe,link:()=>Ve,image:()=>He,iTerm:()=>oP,exitAlternativeScreen:()=>Ke,eraseUp:()=>Qe,eraseStartLine:()=>$e,eraseScreen:()=>eZ,eraseLines:()=>De,eraseLine:()=>iP,eraseEndLine:()=>Fe,eraseDown:()=>Je,enterAlternativeScreen:()=>We,cursorUp:()=>cP,cursorTo:()=>dt,cursorShow:()=>et,cursorSavePosition:()=>it,cursorRestorePosition:()=>ot,cursorPrevLine:()=>st,cursorNextLine:()=>rt,cursorMove:()=>pt,cursorLeft:()=>nP,cursorHide:()=>tt,cursorGetPosition:()=>at,cursorForward:()=>ct,cursorDown:()=>lt,cursorBackward:()=>nt,clearViewport:()=>qe,clearTerminal:()=>Be,clearScreen:()=>Ye,beep:()=>Ue,ConEmu:()=>aP});import d7 from"node:process";import ut from"node:os";var UD="\x1B[",p7="\x1B]",L3="\x07",X5=";",lP,gt,mt,UU,l7=(D)=>{if(mt)return"\x1BPtmux;"+D.replaceAll("\x1B","\x1B\x1B")+"\x1B\\";return D},dt=(D,F)=>{if(typeof D!=="number")throw TypeError("The `x` argument is required");if(typeof F!=="number")return UD+(D+1)+"G";return UD+(F+1)+X5+(D+1)+"H"},pt=(D,F)=>{if(typeof D!=="number")throw TypeError("The `x` argument is required");let $="";if(D<0)$+=UD+-D+"D";else if(D>0)$+=UD+D+"C";if(F<0)$+=UD+-F+"A";else if(F>0)$+=UD+F+"B";return $},cP=(D=1)=>UD+D+"A",lt=(D=1)=>UD+D+"B",ct=(D=1)=>UD+D+"C",nt=(D=1)=>UD+D+"D",nP,it,ot,at,rt,st,tt,et,De=(D)=>{let F="";for(let $=0;$<D;$++)F+=iP+($<D-1?cP():"");if(D)F+=nP;return F},Fe,$e,iP,Je,Qe,eZ,Ze,Xe,Ye="\x1Bc",qe,Ge=()=>{if(m7||!gt)return!1;let D=ut.release().split("."),F=Number(D[0]),$=Number(D[2]??0);if(F<10)return!0;if(F===10&&$<10586)return!0;return!1},Be,We,Ke,Ue,Ve=(D,F)=>{let $=l7(`${p7}8${X5}${X5}${F}${L3}`),J=l7(`${p7}8${X5}${X5}${L3}`);return $+D+J},He=(D,F={})=>{let $=`${p7}1337;File=inline=1`;if(F.width)$+=`;width=${F.width}`;if(F.height)$+=`;height=${F.height}`;if(F.preserveAspectRatio===!1)$+=";preserveAspectRatio=0";let J=Buffer.from(D);return l7($+`;size=${J.byteLength}:`+J.toString("base64")+L3)},oP,aP,ze=(D=UU())=>oP.setCwd(D)+aP.setCwd(D);var VU=x(()=>{pP();lP=!m7&&d7.env.TERM_PROGRAM==="Apple_Terminal",gt=!m7&&d7.platform==="win32",mt=!m7&&(d7.env.TERM?.startsWith("screen")||d7.env.TERM?.startsWith("tmux")||d7.env.TMUX!==void 0),UU=m7?()=>{throw Error("`process.cwd()` only works in Node.js, not the browser.")}:d7.cwd,nP=UD+"G",it=lP?"\x1B7":UD+"s",ot=lP?"\x1B8":UD+"u",at=UD+"6n",rt=UD+"E",st=UD+"F",tt=UD+"?25l",et=UD+"?25h",Fe=UD+"K",$e=UD+"1K",iP=UD+"2K",Je=UD+"J",Qe=UD+"1J",eZ=UD+"2J",Ze=UD+"S",Xe=UD+"T",qe=`${eZ}${UD}H`,Be=Ge()?`${eZ}${UD}0f`:`${eZ}${UD}3J${UD}H`,We=UD+"?1049h",Ke=UD+"?1049l",Ue=L3,oP={setCwd:(D=UU())=>l7(`${p7}50;CurrentDir=${D}${L3}`),annotation(D,F={}){let $=`${p7}1337;`,J=F.x!==void 0,Q=F.y!==void 0;if((J||Q)&&!(J&&Q&&F.length!==void 0))throw Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");if(D=D.replaceAll("|",""),$+=F.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",F.length>0)$+=(J?[D,F.length,F.x,F.y]:[F.length,D]).join("|");else $+=D;return l7($+L3)}},aP={setCwd:(D=UU())=>l7(`${p7}9;9;${D}${L3}`)}});var rP=x(()=>{VU();VU()});function HU(D,F,{ignoreNonConfigurable:$=!1}={}){let{name:J}=D;for(let Q of Reflect.ownKeys(F))Ce(D,F,Q,$);return Me(D,F),Ae(D,F,J),D}var Ce=(D,F,$,J)=>{if($==="length"||$==="prototype")return;if($==="arguments"||$==="caller")return;let Q=Object.getOwnPropertyDescriptor(D,$),Z=Object.getOwnPropertyDescriptor(F,$);if(!_e(Q,Z)&&J)return;Object.defineProperty(D,$,Z)},_e=function(D,F){return D===void 0||D.configurable||D.writable===F.writable&&D.enumerable===F.enumerable&&D.configurable===F.configurable&&(D.writable||D.value===F.value)},Me=(D,F)=>{let $=Object.getPrototypeOf(F);if($===Object.getPrototypeOf(D))return;Object.setPrototypeOf(D,$)},Oe=(D,F)=>`/* Wrapped ${D}*/
78
+ ${F}`,Ee,Re,Ae=(D,F,$)=>{let J=$===""?"":`with ${$.trim()}() `,Q=Oe.bind(null,J,F.toString());Object.defineProperty(Q,"name",Re);let{writable:Z,enumerable:X,configurable:Y}=Ee;Object.defineProperty(D,"toString",{value:Q,writable:Z,enumerable:X,configurable:Y})};var sP=x(()=>{Ee=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Re=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name")});var DX,tP=(D,F={})=>{if(typeof D!=="function")throw TypeError("Expected a function");let $,J=0,Q=D.displayName||D.name||"<anonymous>",Z=function(...X){if(DX.set(Z,++J),J===1)$=D.apply(this,X),D=void 0;else if(F.throw===!0)throw Error(`Function \`${Q}\` can only be called once`);return $};return HU(Z,D),DX.set(Z,J),Z},eP;var Dj=x(()=>{sP();DX=new WeakMap;tP.callCount=(D)=>{if(!DX.has(D))throw Error(`The given function \`${D.name}\` is not wrapped by the \`onetime\` package`);return DX.get(D)};eP=tP});import FX from"node:process";var Fj,Ie,$j;var Jj=x(()=>{Dj();IJ();Fj=FX.stderr.isTTY?FX.stderr:FX.stdout.isTTY?FX.stdout:void 0,Ie=Fj?eP(()=>{C6(()=>{Fj.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},$j=Ie});import Qj from"node:process";var $X=!1,c7,n7;var zU=x(()=>{Jj();c7={};c7.show=(D=Qj.stderr)=>{if(!D.isTTY)return;$X=!1,D.write("\x1B[?25h")};c7.hide=(D=Qj.stderr)=>{if(!D.isTTY)return;$j(),$X=!0,D.write("\x1B[?25l")};c7.toggle=(D,F)=>{if(D!==void 0)$X=D;if($X)c7.show(F);else c7.hide(F)};n7=c7});function CU({onlyFirst:D=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",D?void 0:"g")}function O1(D){if(typeof D!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof D}\``);return D.replace(we,"")}var we;var Y5=x(()=>{we=CU()});function Zj(D){return D===161||D===164||D===167||D===168||D===170||D===173||D===174||D>=176&&D<=180||D>=182&&D<=186||D>=188&&D<=191||D===198||D===208||D===215||D===216||D>=222&&D<=225||D===230||D>=232&&D<=234||D===236||D===237||D===240||D===242||D===243||D>=247&&D<=250||D===252||D===254||D===257||D===273||D===275||D===283||D===294||D===295||D===299||D>=305&&D<=307||D===312||D>=319&&D<=322||D===324||D>=328&&D<=331||D===333||D===338||D===339||D===358||D===359||D===363||D===462||D===464||D===466||D===468||D===470||D===472||D===474||D===476||D===593||D===609||D===708||D===711||D>=713&&D<=715||D===717||D===720||D>=728&&D<=731||D===733||D===735||D>=768&&D<=879||D>=913&&D<=929||D>=931&&D<=937||D>=945&&D<=961||D>=963&&D<=969||D===1025||D>=1040&&D<=1103||D===1105||D===8208||D>=8211&&D<=8214||D===8216||D===8217||D===8220||D===8221||D>=8224&&D<=8226||D>=8228&&D<=8231||D===8240||D===8242||D===8243||D===8245||D===8251||D===8254||D===8308||D===8319||D>=8321&&D<=8324||D===8364||D===8451||D===8453||D===8457||D===8467||D===8470||D===8481||D===8482||D===8486||D===8491||D===8531||D===8532||D>=8539&&D<=8542||D>=8544&&D<=8555||D>=8560&&D<=8569||D===8585||D>=8592&&D<=8601||D===8632||D===8633||D===8658||D===8660||D===8679||D===8704||D===8706||D===8707||D===8711||D===8712||D===8715||D===8719||D===8721||D===8725||D===8730||D>=8733&&D<=8736||D===8739||D===8741||D>=8743&&D<=8748||D===8750||D>=8756&&D<=8759||D===8764||D===8765||D===8776||D===8780||D===8786||D===8800||D===8801||D>=8804&&D<=8807||D===8810||D===8811||D===8814||D===8815||D===8834||D===8835||D===8838||D===8839||D===8853||D===8857||D===8869||D===8895||D===8978||D>=9312&&D<=9449||D>=9451&&D<=9547||D>=9552&&D<=9587||D>=9600&&D<=9615||D>=9618&&D<=9621||D===9632||D===9633||D>=9635&&D<=9641||D===9650||D===9651||D===9654||D===9655||D===9660||D===9661||D===9664||D===9665||D>=9670&&D<=9672||D===9675||D>=9678&&D<=9681||D>=9698&&D<=9701||D===9711||D===9733||D===9734||D===9737||D===9742||D===9743||D===9756||D===9758||D===9792||D===9794||D===9824||D===9825||D>=9827&&D<=9829||D>=9831&&D<=9834||D===9836||D===9837||D===9839||D===9886||D===9887||D===9919||D>=9926&&D<=9933||D>=9935&&D<=9939||D>=9941&&D<=9953||D===9955||D===9960||D===9961||D>=9963&&D<=9969||D===9972||D>=9974&&D<=9977||D===9979||D===9980||D===9982||D===9983||D===10045||D>=10102&&D<=10111||D>=11094&&D<=11097||D>=12872&&D<=12879||D>=57344&&D<=63743||D>=65024&&D<=65039||D===65533||D>=127232&&D<=127242||D>=127248&&D<=127277||D>=127280&&D<=127337||D>=127344&&D<=127373||D===127375||D===127376||D>=127387&&D<=127404||D>=917760&&D<=917999||D>=983040&&D<=1048573||D>=1048576&&D<=1114109}function q5(D){return D===12288||D>=65281&&D<=65376||D>=65504&&D<=65510}function G5(D){return D>=4352&&D<=4447||D===8986||D===8987||D===9001||D===9002||D>=9193&&D<=9196||D===9200||D===9203||D===9725||D===9726||D===9748||D===9749||D>=9776&&D<=9783||D>=9800&&D<=9811||D===9855||D>=9866&&D<=9871||D===9875||D===9889||D===9898||D===9899||D===9917||D===9918||D===9924||D===9925||D===9934||D===9940||D===9962||D===9970||D===9971||D===9973||D===9978||D===9981||D===9989||D===9994||D===9995||D===10024||D===10060||D===10062||D>=10067&&D<=10069||D===10071||D>=10133&&D<=10135||D===10160||D===10175||D===11035||D===11036||D===11088||D===11093||D>=11904&&D<=11929||D>=11931&&D<=12019||D>=12032&&D<=12245||D>=12272&&D<=12287||D>=12289&&D<=12350||D>=12353&&D<=12438||D>=12441&&D<=12543||D>=12549&&D<=12591||D>=12593&&D<=12686||D>=12688&&D<=12773||D>=12783&&D<=12830||D>=12832&&D<=12871||D>=12880&&D<=42124||D>=42128&&D<=42182||D>=43360&&D<=43388||D>=44032&&D<=55203||D>=63744&&D<=64255||D>=65040&&D<=65049||D>=65072&&D<=65106||D>=65108&&D<=65126||D>=65128&&D<=65131||D>=94176&&D<=94180||D>=94192&&D<=94198||D>=94208&&D<=101589||D>=101631&&D<=101662||D>=101760&&D<=101874||D>=110576&&D<=110579||D>=110581&&D<=110587||D===110589||D===110590||D>=110592&&D<=110882||D===110898||D>=110928&&D<=110930||D===110933||D>=110948&&D<=110951||D>=110960&&D<=111355||D>=119552&&D<=119638||D>=119648&&D<=119670||D===126980||D===127183||D===127374||D>=127377&&D<=127386||D>=127488&&D<=127490||D>=127504&&D<=127547||D>=127552&&D<=127560||D===127568||D===127569||D>=127584&&D<=127589||D>=127744&&D<=127776||D>=127789&&D<=127797||D>=127799&&D<=127868||D>=127870&&D<=127891||D>=127904&&D<=127946||D>=127951&&D<=127955||D>=127968&&D<=127984||D===127988||D>=127992&&D<=128062||D===128064||D>=128066&&D<=128252||D>=128255&&D<=128317||D>=128331&&D<=128334||D>=128336&&D<=128359||D===128378||D===128405||D===128406||D===128420||D>=128507&&D<=128591||D>=128640&&D<=128709||D===128716||D>=128720&&D<=128722||D>=128725&&D<=128728||D>=128732&&D<=128735||D===128747||D===128748||D>=128756&&D<=128764||D>=128992&&D<=129003||D===129008||D>=129292&&D<=129338||D>=129340&&D<=129349||D>=129351&&D<=129535||D>=129648&&D<=129660||D>=129664&&D<=129674||D>=129678&&D<=129734||D===129736||D>=129741&&D<=129756||D>=129759&&D<=129770||D>=129775&&D<=129784||D>=131072&&D<=196605||D>=196608&&D<=262141}var _U=()=>{};function Ne(D){if(!Number.isSafeInteger(D))throw TypeError(`Expected a code point, got \`${typeof D}\`.`)}function B5(D,{ambiguousAsWide:F=!1}={}){if(Ne(D),q5(D)||G5(D)||F&&Zj(D))return 2;return 1}var JX=x(()=>{_U();_U()});var Yj=w((P90,Xj)=>{Xj.exports=()=>{return/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g}});function P3(D,F={}){if(typeof D!=="string"||D.length===0)return 0;let{ambiguousIsNarrow:$=!0,countAnsiEscapeCodes:J=!1}=F;if(!J)D=O1(D);if(D.length===0)return 0;let Q=0,Z={ambiguousAsWide:!$};for(let{segment:X}of Te.segment(D)){let Y=X.codePointAt(0);if(Y<=31||Y>=127&&Y<=159)continue;if(Y>=8203&&Y<=8207||Y===65279)continue;if(Y>=768&&Y<=879||Y>=6832&&Y<=6911||Y>=7616&&Y<=7679||Y>=8400&&Y<=8447||Y>=65056&&Y<=65071)continue;if(Y>=55296&&Y<=57343)continue;if(Y>=65024&&Y<=65039)continue;if(Le.test(X))continue;if(qj.default().test(X)){Q+=2;continue}Q+=B5(Y,Z)}return Q}var qj,Te,Le;var Gj=x(()=>{Y5();JX();qj=TD(Yj(),1),Te=new Intl.Segmenter,Le=/^\p{Default_Ignorable_Code_Point}$/u});function Se(){let D=new Map;for(let[F,$]of Object.entries(xD)){for(let[J,Q]of Object.entries($))xD[J]={open:`\x1B[${Q[0]}m`,close:`\x1B[${Q[1]}m`},$[J]=xD[J],D.set(Q[0],Q[1]);Object.defineProperty(xD,F,{value:$,enumerable:!1})}return Object.defineProperty(xD,"codes",{value:D,enumerable:!1}),xD.color.close="\x1B[39m",xD.bgColor.close="\x1B[49m",xD.color.ansi=Bj(),xD.color.ansi256=Wj(),xD.color.ansi16m=Kj(),xD.bgColor.ansi=Bj(10),xD.bgColor.ansi256=Wj(10),xD.bgColor.ansi16m=Kj(10),Object.defineProperties(xD,{rgbToAnsi256:{value(F,$,J){if(F===$&&$===J){if(F<8)return 16;if(F>248)return 231;return Math.round((F-8)/247*24)+232}return 16+36*Math.round(F/255*5)+6*Math.round($/255*5)+Math.round(J/255*5)},enumerable:!1},hexToRgb:{value(F){let $=/[a-f\d]{6}|[a-f\d]{3}/i.exec(F.toString(16));if(!$)return[0,0,0];let[J]=$;if(J.length===3)J=[...J].map((Z)=>Z+Z).join("");let Q=Number.parseInt(J,16);return[Q>>16&255,Q>>8&255,Q&255]},enumerable:!1},hexToAnsi256:{value:(F)=>xD.rgbToAnsi256(...xD.hexToRgb(F)),enumerable:!1},ansi256ToAnsi:{value(F){if(F<8)return 30+F;if(F<16)return 90+(F-8);let $,J,Q;if(F>=232)$=((F-232)*10+8)/255,J=$,Q=$;else{F-=16;let Y=F%36;$=Math.floor(F/36)/5,J=Math.floor(Y/6)/5,Q=Y%6/5}let Z=Math.max($,J,Q)*2;if(Z===0)return 30;let X=30+(Math.round(Q)<<2|Math.round(J)<<1|Math.round($));if(Z===2)X+=60;return X},enumerable:!1},rgbToAnsi:{value:(F,$,J)=>xD.ansi256ToAnsi(xD.rgbToAnsi256(F,$,J)),enumerable:!1},hexToAnsi:{value:(F)=>xD.ansi256ToAnsi(xD.hexToAnsi256(F)),enumerable:!1}}),xD}var Bj=(D=0)=>(F)=>`\x1B[${F+D}m`,Wj=(D=0)=>(F)=>`\x1B[${38+D};5;${F}m`,Kj=(D=0)=>(F,$,J)=>`\x1B[${38+D};2;${F};${$};${J}m`,xD,k90,Pe,je,y90,xe,D8;var MU=x(()=>{xD={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]}},k90=Object.keys(xD.modifier),Pe=Object.keys(xD.color),je=Object.keys(xD.bgColor),y90=[...Pe,...je];xe=Se(),D8=xe});var Cj={};H2(Cj,{default:()=>XX});function XX(D,F,$){return String(D).normalize().replaceAll(`\r
79
79
  `,`
80
80
  `).split(`
81
81
  `).map((J)=>ve(J,F,$)).join(`
@@ -92,17 +92,17 @@ ${F}`,Ee,Re,Ae=(D,F,$)=>{let J=$===""?"":`with ${$.trim()}() `,Q=Oe.bind(null,J,
92
92
  `){if(q++,q===Y){G=B+1;break}}return{text:L2(F,G),wasClipped:!0}},re=(D,F)=>{let $=0;for(;$<D.length&&$<F.length;$++)if(D[$]!==F[$])break;let J=D.length-1,Q=F.length-1;while(J>=$&&Q>=$&&D[J]===F[Q])J--,Q--;return{start:$,endPrevious:J,endNext:Q}},se=({prevCount:D,start:F,endPrevious:$,endNext:J,nextLines:Q,nextWrappedEndsWithNewline:Z})=>{let X="",Y=Math.max(0,D-1-F);if(Y>0)X+=h0.cursorUp(Y);X+=h0.cursorLeft;let q=Math.max(0,$-F+1);for(let U=0;U<q;U++)if(X+=h0.eraseLine,U<q-1)X+=h0.cursorDown();if(q>1)X+=h0.cursorUp(q-1);X+=h0.cursorLeft;let G=Q.slice(F,J+1);if(G.length>0){let U=G.join(`
93
93
  `);if(X+=U,X+=h0.eraseEndLine,Z&&!U.endsWith(`
94
94
  `))X+=`
95
- `}let B=F+G.length,K=Q.length-1-B;if(K>0)X+=h0.cursorDown(K);return X},te,DDD,ee;var Rj=x(()=>{rP();zU();RU();NU();Y5();te=TU(Oj.stdout),DDD=te,ee=TU(Oj.stderr)});function ZDD(D){return D.replace(JDD,"")}function XDD(D){return $DD.test(D)}function YDD(D,F){let $=0;if(D.length>1){for(let J of D.slice(1))if(J>="＀"&&J<="￯")$+=B5(J.codePointAt(0),F)}return $}function VF(D,F={}){if(typeof D!=="string"||D.length===0)return 0;let{ambiguousIsNarrow:$=!0,countAnsiEscapeCodes:J=!1}=F,Q=D;if(!J)Q=O1(Q);if(Q.length===0)return 0;let Z=0,X={ambiguousAsWide:!$};for(let{segment:Y}of FDD.segment(Q)){if(XDD(Y))continue;if(QDD.test(Y)){Z+=2;continue}let q=ZDD(Y).codePointAt(0);Z+=B5(q,X),Z+=YDD(Y,X)}return Z}var FDD,$DD,JDD,QDD;var LU=x(()=>{Y5();JX();FDD=new Intl.Segmenter,$DD=/^(?:\p{Default_Ignorable_Code_Point}|\p{Control}|\p{Mark}|\p{Surrogate})+$/v,JDD=/^[\p{Default_Ignorable_Code_Point}\p{Control}\p{Format}\p{Mark}\p{Surrogate}]+/v,QDD=/^\p{RGI_Emoji}$/v});var Ij={};H2(Ij,{default:()=>Aj});function qX(D,F,$){if(D.charAt(F)===" ")return F;let J=$?1:-1;for(let Q=0;Q<=3;Q++){let Z=F+Q*J;if(D.charAt(Z)===" ")return Z}return F}function Aj(D,F,$={}){let{position:J="end",space:Q=!1,preferTruncationOnSpace:Z=!1}=$,{truncationCharacter:X="…"}=$;if(typeof D!=="string")throw TypeError(`Expected \`input\` to be a string, got ${typeof D}`);if(typeof F!=="number")throw TypeError(`Expected \`columns\` to be a number, got ${typeof F}`);if(F<1)return"";let Y=VF(D);if(Y<=F)return D;if(F===1)return X;let q={ESC:27,LEFT_BRACKET:91,LETTER_M:109},G=(V)=>V>=48&&V<=57||V===59;function B(V){let H=0;while(H+2<V.length&&V.codePointAt(H)===q.ESC&&V.codePointAt(H+1)===q.LEFT_BRACKET){let z=H+2;while(z<V.length&&G(V.codePointAt(z)))z++;if(z<V.length&&V.codePointAt(z)===q.LETTER_M){H=z+1;continue}break}return H}function W(V){let H=V.length;while(H>1&&V.codePointAt(H-1)===q.LETTER_M){let z=H-2;while(z>=0&&G(V.codePointAt(z)))z--;if(z>=1&&V.codePointAt(z-1)===q.ESC&&V.codePointAt(z)===q.LEFT_BRACKET){H=z-1;continue}break}return H}function K(V,H){let z=W(V);if(z===V.length)return V+H;return V.slice(0,z)+H+V.slice(z)}function U(V,H){let z=B(H);if(z===0)return V+H;return H.slice(0,z)+V+H.slice(z)}if(J==="start"){if(Z){let H=qX(D,Y-F+1,!0),z=L2(D,H,Y).trim();return U(X,z)}if(Q)X+=" ";let V=L2(D,Y-F+VF(X),Y);return U(X,V)}if(J==="middle"){if(Q)X=` ${X} `;let V=Math.floor(F/2);if(Z){let H=qX(D,V),z=qX(D,Y-(F-V)+1,!0);return L2(D,0,H)+X+L2(D,z,Y).trim()}return L2(D,0,V)+X+L2(D,Y-(F-V)+VF(X),Y)}if(J==="end"){if(Z){let H=qX(D,F-1),z=L2(D,0,H);return K(z,X)}if(Q)X=` ${X}`;let V=L2(D,0,F-VF(X));return K(V,X)}throw Error(`Expected \`options.position\` to be either \`start\`, \`middle\` or \`end\`, got ${J}`)}var wj=x(()=>{NU();LU()});var BD=I((rDD)=>{var fU=Symbol.for("yaml.alias"),mj=Symbol.for("yaml.document"),UX=Symbol.for("yaml.map"),dj=Symbol.for("yaml.pair"),bU=Symbol.for("yaml.scalar"),VX=Symbol.for("yaml.seq"),E1=Symbol.for("yaml.node.type"),pDD=(D)=>!!D&&typeof D==="object"&&D[E1]===fU,lDD=(D)=>!!D&&typeof D==="object"&&D[E1]===mj,cDD=(D)=>!!D&&typeof D==="object"&&D[E1]===UX,nDD=(D)=>!!D&&typeof D==="object"&&D[E1]===dj,pj=(D)=>!!D&&typeof D==="object"&&D[E1]===bU,iDD=(D)=>!!D&&typeof D==="object"&&D[E1]===VX;function lj(D){if(D&&typeof D==="object")switch(D[E1]){case UX:case VX:return!0}return!1}function oDD(D){if(D&&typeof D==="object")switch(D[E1]){case fU:case UX:case bU:case VX:return!0}return!1}var aDD=(D)=>(pj(D)||lj(D))&&!!D.anchor;rDD.ALIAS=fU;rDD.DOC=mj;rDD.MAP=UX;rDD.NODE_TYPE=E1;rDD.PAIR=dj;rDD.SCALAR=bU;rDD.SEQ=VX;rDD.hasAnchor=aDD;rDD.isAlias=pDD;rDD.isCollection=lj;rDD.isDocument=lDD;rDD.isMap=cDD;rDD.isNode=oDD;rDD.isPair=nDD;rDD.isScalar=pj;rDD.isSeq=iDD});var H5=I((U0D)=>{var J0=BD(),D2=Symbol("break visit"),cj=Symbol("skip children"),h8=Symbol("remove node");function HX(D,F){let $=nj(F);if(J0.isDocument(D)){if(a7(null,D.contents,$,Object.freeze([D]))===h8)D.contents=null}else a7(null,D,$,Object.freeze([]))}HX.BREAK=D2;HX.SKIP=cj;HX.REMOVE=h8;function a7(D,F,$,J){let Q=ij(D,F,$,J);if(J0.isNode(Q)||J0.isPair(Q))return oj(D,J,Q),a7(D,Q,$,J);if(typeof Q!=="symbol"){if(J0.isCollection(F)){J=Object.freeze(J.concat(F));for(let Z=0;Z<F.items.length;++Z){let X=a7(Z,F.items[Z],$,J);if(typeof X==="number")Z=X-1;else if(X===D2)return D2;else if(X===h8)F.items.splice(Z,1),Z-=1}}else if(J0.isPair(F)){J=Object.freeze(J.concat(F));let Z=a7("key",F.key,$,J);if(Z===D2)return D2;else if(Z===h8)F.key=null;let X=a7("value",F.value,$,J);if(X===D2)return D2;else if(X===h8)F.value=null}}return Q}async function zX(D,F){let $=nj(F);if(J0.isDocument(D)){if(await r7(null,D.contents,$,Object.freeze([D]))===h8)D.contents=null}else await r7(null,D,$,Object.freeze([]))}zX.BREAK=D2;zX.SKIP=cj;zX.REMOVE=h8;async function r7(D,F,$,J){let Q=await ij(D,F,$,J);if(J0.isNode(Q)||J0.isPair(Q))return oj(D,J,Q),r7(D,Q,$,J);if(typeof Q!=="symbol"){if(J0.isCollection(F)){J=Object.freeze(J.concat(F));for(let Z=0;Z<F.items.length;++Z){let X=await r7(Z,F.items[Z],$,J);if(typeof X==="number")Z=X-1;else if(X===D2)return D2;else if(X===h8)F.items.splice(Z,1),Z-=1}}else if(J0.isPair(F)){J=Object.freeze(J.concat(F));let Z=await r7("key",F.key,$,J);if(Z===D2)return D2;else if(Z===h8)F.key=null;let X=await r7("value",F.value,$,J);if(X===D2)return D2;else if(X===h8)F.value=null}}return Q}function nj(D){if(typeof D==="object"&&(D.Collection||D.Node||D.Value))return Object.assign({Alias:D.Node,Map:D.Node,Scalar:D.Node,Seq:D.Node},D.Value&&{Map:D.Value,Scalar:D.Value,Seq:D.Value},D.Collection&&{Map:D.Collection,Seq:D.Collection},D);return D}function ij(D,F,$,J){if(typeof $==="function")return $(D,F,J);if(J0.isMap(F))return $.Map?.(D,F,J);if(J0.isSeq(F))return $.Seq?.(D,F,J);if(J0.isPair(F))return $.Pair?.(D,F,J);if(J0.isScalar(F))return $.Scalar?.(D,F,J);if(J0.isAlias(F))return $.Alias?.(D,F,J);return}function oj(D,F,$){let J=F[F.length-1];if(J0.isCollection(J))J.items[D]=$;else if(J0.isPair(J))if(D==="key")J.key=$;else J.value=$;else if(J0.isDocument(J))J.contents=$;else{let Q=J0.isAlias(J)?"alias":"scalar";throw Error(`Cannot replace node with ${Q} parent`)}}U0D.visit=HX;U0D.visitAsync=zX});var vU=I((M0D)=>{var aj=BD(),z0D=H5(),C0D={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},_0D=(D)=>D.replace(/[!,[\]{}]/g,(F)=>C0D[F]);class P2{constructor(D,F){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},P2.defaultYaml,D),this.tags=Object.assign({},P2.defaultTags,F)}clone(){let D=new P2(this.yaml,this.tags);return D.docStart=this.docStart,D}atDocument(){let D=new P2(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:P2.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},P2.defaultTags);break}return D}add(D,F){if(this.atNextDocument)this.yaml={explicit:P2.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},P2.defaultTags),this.atNextDocument=!1;let $=D.trim().split(/[ \t]+/),J=$.shift();switch(J){case"%TAG":{if($.length!==2){if(F(0,"%TAG directive should contain exactly two parts"),$.length<2)return!1}let[Q,Z]=$;return this.tags[Q]=Z,!0}case"%YAML":{if(this.yaml.explicit=!0,$.length!==1)return F(0,"%YAML directive should contain exactly one part"),!1;let[Q]=$;if(Q==="1.1"||Q==="1.2")return this.yaml.version=Q,!0;else{let Z=/^\d+\.\d+$/.test(Q);return F(6,`Unsupported YAML version ${Q}`,Z),!1}}default:return F(0,`Unknown directive ${J}`,!0),!1}}tagName(D,F){if(D==="!")return"!";if(D[0]!=="!")return F(`Not a valid tag: ${D}`),null;if(D[1]==="<"){let Z=D.slice(2,-1);if(Z==="!"||Z==="!!")return F(`Verbatim tags aren't resolved, so ${D} is invalid.`),null;if(D[D.length-1]!==">")F("Verbatim tags must end with a >");return Z}let[,$,J]=D.match(/^(.*!)([^!]*)$/s);if(!J)F(`The ${D} tag has no suffix`);let Q=this.tags[$];if(Q)try{return Q+decodeURIComponent(J)}catch(Z){return F(String(Z)),null}if($==="!")return D;return F(`Could not resolve tag: ${D}`),null}tagString(D){for(let[F,$]of Object.entries(this.tags))if(D.startsWith($))return F+_0D(D.substring($.length));return D[0]==="!"?D:`!<${D}>`}toString(D){let F=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],$=Object.entries(this.tags),J;if(D&&$.length>0&&aj.isNode(D.contents)){let Q={};z0D.visit(D.contents,(Z,X)=>{if(aj.isNode(X)&&X.tag)Q[X.tag]=!0}),J=Object.keys(Q)}else J=[];for(let[Q,Z]of $){if(Q==="!!"&&Z==="tag:yaml.org,2002:")continue;if(!D||J.some((X)=>X.startsWith(Z)))F.push(`%TAG ${Q} ${Z}`)}return F.join(`
96
- `)}}P2.defaultYaml={explicit:!1,version:"1.2"};P2.defaultTags={"!!":"tag:yaml.org,2002:"};M0D.Directives=P2});var CX=I((I0D)=>{var rj=BD(),E0D=H5();function R0D(D){if(/[\x00-\x19\s,[\]{}]/.test(D)){let $=`Anchor must not contain whitespace or control characters: ${JSON.stringify(D)}`;throw Error($)}return!0}function sj(D){let F=new Set;return E0D.visit(D,{Value($,J){if(J.anchor)F.add(J.anchor)}}),F}function tj(D,F){for(let $=1;;++$){let J=`${D}${$}`;if(!F.has(J))return J}}function A0D(D,F){let $=[],J=new Map,Q=null;return{onAnchor:(Z)=>{$.push(Z),Q??(Q=sj(D));let X=tj(F,Q);return Q.add(X),X},setAnchors:()=>{for(let Z of $){let X=J.get(Z);if(typeof X==="object"&&X.anchor&&(rj.isScalar(X.node)||rj.isCollection(X.node)))X.node.anchor=X.anchor;else{let Y=Error("Failed to resolve repeated object (this should not happen)");throw Y.source=Z,Y}}},sourceObjects:J}}I0D.anchorIsValid=R0D;I0D.anchorNames=sj;I0D.createNodeAnchors=A0D;I0D.findNewAnchor=tj});var hU=I((P0D)=>{function z5(D,F,$,J){if(J&&typeof J==="object")if(Array.isArray(J))for(let Q=0,Z=J.length;Q<Z;++Q){let X=J[Q],Y=z5(D,J,String(Q),X);if(Y===void 0)delete J[Q];else if(Y!==X)J[Q]=Y}else if(J instanceof Map)for(let Q of Array.from(J.keys())){let Z=J.get(Q),X=z5(D,J,Q,Z);if(X===void 0)J.delete(Q);else if(X!==Z)J.set(Q,X)}else if(J instanceof Set)for(let Q of Array.from(J)){let Z=z5(D,J,Q,Q);if(Z===void 0)J.delete(Q);else if(Z!==Q)J.delete(Q),J.add(Z)}else for(let[Q,Z]of Object.entries(J)){let X=z5(D,J,Q,Z);if(X===void 0)delete J[Q];else if(X!==Z)J[Q]=X}return D.call(F,$,J)}P0D.applyReviver=z5});var zF=I((x0D)=>{var S0D=BD();function ej(D,F,$){if(Array.isArray(D))return D.map((J,Q)=>ej(J,String(Q),$));if(D&&typeof D.toJSON==="function"){if(!$||!S0D.hasAnchor(D))return D.toJSON(F,$);let J={aliasCount:0,count:1,res:void 0};$.anchors.set(D,J),$.onCreate=(Z)=>{J.res=Z,delete $.onCreate};let Q=D.toJSON(F,$);if($.onCreate)$.onCreate(Q);return Q}if(typeof D==="bigint"&&!$?.keep)return Number(D);return D}x0D.toJS=ej});var _X=I((b0D)=>{var y0D=hU(),DS=BD(),f0D=zF();class FS{constructor(D){Object.defineProperty(this,DS.NODE_TYPE,{value:D})}clone(){let D=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)D.range=this.range.slice();return D}toJS(D,{mapAsMap:F,maxAliasCount:$,onAnchor:J,reviver:Q}={}){if(!DS.isDocument(D))throw TypeError("A document argument is required");let Z={anchors:new Map,doc:D,keep:!0,mapAsMap:F===!0,mapKeyWarned:!1,maxAliasCount:typeof $==="number"?$:100},X=f0D.toJS(this,"",Z);if(typeof J==="function")for(let{count:Y,res:q}of Z.anchors.values())J(q,Y);return typeof Q==="function"?y0D.applyReviver(Q,{"":X},"",X):X}}b0D.NodeBase=FS});var C5=I((d0D)=>{var h0D=CX(),u0D=H5(),s7=BD(),g0D=_X(),m0D=zF();class $S extends g0D.NodeBase{constructor(D){super(s7.ALIAS);this.source=D,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(D,F){let $;if(F?.aliasResolveCache)$=F.aliasResolveCache;else if($=[],u0D.visit(D,{Node:(Q,Z)=>{if(s7.isAlias(Z)||s7.hasAnchor(Z))$.push(Z)}}),F)F.aliasResolveCache=$;let J=void 0;for(let Q of $){if(Q===this)break;if(Q.anchor===this.source)J=Q}return J}toJSON(D,F){if(!F)return{source:this.source};let{anchors:$,doc:J,maxAliasCount:Q}=F,Z=this.resolve(J,F);if(!Z){let Y=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(Y)}let X=$.get(Z);if(!X)m0D.toJS(Z,null,F),X=$.get(Z);if(X?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(Q>=0){if(X.count+=1,X.aliasCount===0)X.aliasCount=MX(J,Z,$);if(X.count*X.aliasCount>Q)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return X.res}toString(D,F,$){let J=`*${this.source}`;if(D){if(h0D.anchorIsValid(this.source),D.options.verifyAliasOrder&&!D.anchors.has(this.source)){let Q=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(Q)}if(D.implicitKey)return`${J} `}return J}}function MX(D,F,$){if(s7.isAlias(F)){let J=F.resolve(D),Q=$&&J&&$.get(J);return Q?Q.count*Q.aliasCount:0}else if(s7.isCollection(F)){let J=0;for(let Q of F.items){let Z=MX(D,Q,$);if(Z>J)J=Z}return J}else if(s7.isPair(F)){let J=MX(D,F.key,$),Q=MX(D,F.value,$);return Math.max(J,Q)}return 1}d0D.Alias=$S});var rD=I((o0D)=>{var l0D=BD(),c0D=_X(),n0D=zF(),i0D=(D)=>!D||typeof D!=="function"&&typeof D!=="object";class j3 extends c0D.NodeBase{constructor(D){super(l0D.SCALAR);this.value=D}toJSON(D,F){return F?.keep?this.value:n0D.toJS(this.value,D,F)}toString(){return String(this.value)}}j3.BLOCK_FOLDED="BLOCK_FOLDED";j3.BLOCK_LITERAL="BLOCK_LITERAL";j3.PLAIN="PLAIN";j3.QUOTE_DOUBLE="QUOTE_DOUBLE";j3.QUOTE_SINGLE="QUOTE_SINGLE";o0D.Scalar=j3;o0D.isScalarValue=i0D});var _5=I((F2D)=>{var s0D=C5(),S3=BD(),JS=rD(),t0D="tag:yaml.org,2002:";function e0D(D,F,$){if(F){let J=$.filter((Z)=>Z.tag===F),Q=J.find((Z)=>!Z.format)??J[0];if(!Q)throw Error(`Tag ${F} not found`);return Q}return $.find((J)=>J.identify?.(D)&&!J.format)}function D2D(D,F,$){if(S3.isDocument(D))D=D.contents;if(S3.isNode(D))return D;if(S3.isPair(D)){let W=$.schema[S3.MAP].createNode?.($.schema,null,$);return W.items.push(D),W}if(D instanceof String||D instanceof Number||D instanceof Boolean||typeof BigInt<"u"&&D instanceof BigInt)D=D.valueOf();let{aliasDuplicateObjects:J,onAnchor:Q,onTagObj:Z,schema:X,sourceObjects:Y}=$,q=void 0;if(J&&D&&typeof D==="object")if(q=Y.get(D),q)return q.anchor??(q.anchor=Q(D)),new s0D.Alias(q.anchor);else q={anchor:null,node:null},Y.set(D,q);if(F?.startsWith("!!"))F=t0D+F.slice(2);let G=e0D(D,F,X.tags);if(!G){if(D&&typeof D.toJSON==="function")D=D.toJSON();if(!D||typeof D!=="object"){let W=new JS.Scalar(D);if(q)q.node=W;return W}G=D instanceof Map?X[S3.MAP]:(Symbol.iterator in Object(D))?X[S3.SEQ]:X[S3.MAP]}if(Z)Z(G),delete $.onTagObj;let B=G?.createNode?G.createNode($.schema,D,$):typeof G?.nodeClass?.from==="function"?G.nodeClass.from($.schema,D,$):new JS.Scalar(D);if(F)B.tag=F;else if(!G.default)B.tag=G.tag;if(q)q.node=B;return B}F2D.createNode=D2D});var OX=I((Z2D)=>{var J2D=_5(),u8=BD(),Q2D=_X();function uU(D,F,$){let J=$;for(let Q=F.length-1;Q>=0;--Q){let Z=F[Q];if(typeof Z==="number"&&Number.isInteger(Z)&&Z>=0){let X=[];X[Z]=J,J=X}else J=new Map([[Z,J]])}return J2D.createNode(J,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:D,sourceObjects:new Map})}var QS=(D)=>D==null||typeof D==="object"&&!!D[Symbol.iterator]().next().done;class ZS extends Q2D.NodeBase{constructor(D,F){super(D);Object.defineProperty(this,"schema",{value:F,configurable:!0,enumerable:!1,writable:!0})}clone(D){let F=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(D)F.schema=D;if(F.items=F.items.map(($)=>u8.isNode($)||u8.isPair($)?$.clone(D):$),this.range)F.range=this.range.slice();return F}addIn(D,F){if(QS(D))this.add(F);else{let[$,...J]=D,Q=this.get($,!0);if(u8.isCollection(Q))Q.addIn(J,F);else if(Q===void 0&&this.schema)this.set($,uU(this.schema,J,F));else throw Error(`Expected YAML collection at ${$}. Remaining path: ${J}`)}}deleteIn(D){let[F,...$]=D;if($.length===0)return this.delete(F);let J=this.get(F,!0);if(u8.isCollection(J))return J.deleteIn($);else throw Error(`Expected YAML collection at ${F}. Remaining path: ${$}`)}getIn(D,F){let[$,...J]=D,Q=this.get($,!0);if(J.length===0)return!F&&u8.isScalar(Q)?Q.value:Q;else return u8.isCollection(Q)?Q.getIn(J,F):void 0}hasAllNullValues(D){return this.items.every((F)=>{if(!u8.isPair(F))return!1;let $=F.value;return $==null||D&&u8.isScalar($)&&$.value==null&&!$.commentBefore&&!$.comment&&!$.tag})}hasIn(D){let[F,...$]=D;if($.length===0)return this.has(F);let J=this.get(F,!0);return u8.isCollection(J)?J.hasIn($):!1}setIn(D,F){let[$,...J]=D;if(J.length===0)this.set($,F);else{let Q=this.get($,!0);if(u8.isCollection(Q))Q.setIn(J,F);else if(Q===void 0&&this.schema)this.set($,uU(this.schema,J,F));else throw Error(`Expected YAML collection at ${$}. Remaining path: ${J}`)}}}Z2D.Collection=ZS;Z2D.collectionFromPath=uU;Z2D.isEmptyPath=QS});var M5=I((W2D)=>{var G2D=(D)=>D.replace(/^(?!$)(?: $)?/gm,"#");function gU(D,F){if(/^\n+$/.test(D))return D.substring(1);return F?D.replace(/^(?! *$)/gm,F):D}var B2D=(D,F,$)=>D.endsWith(`
95
+ `}let B=F+G.length,K=Q.length-1-B;if(K>0)X+=h0.cursorDown(K);return X},te,DDD,ee;var Rj=x(()=>{rP();zU();RU();NU();Y5();te=TU(Oj.stdout),DDD=te,ee=TU(Oj.stderr)});function ZDD(D){return D.replace(JDD,"")}function XDD(D){return $DD.test(D)}function YDD(D,F){let $=0;if(D.length>1){for(let J of D.slice(1))if(J>="＀"&&J<="￯")$+=B5(J.codePointAt(0),F)}return $}function VF(D,F={}){if(typeof D!=="string"||D.length===0)return 0;let{ambiguousIsNarrow:$=!0,countAnsiEscapeCodes:J=!1}=F,Q=D;if(!J)Q=O1(Q);if(Q.length===0)return 0;let Z=0,X={ambiguousAsWide:!$};for(let{segment:Y}of FDD.segment(Q)){if(XDD(Y))continue;if(QDD.test(Y)){Z+=2;continue}let q=ZDD(Y).codePointAt(0);Z+=B5(q,X),Z+=YDD(Y,X)}return Z}var FDD,$DD,JDD,QDD;var LU=x(()=>{Y5();JX();FDD=new Intl.Segmenter,$DD=/^(?:\p{Default_Ignorable_Code_Point}|\p{Control}|\p{Mark}|\p{Surrogate})+$/v,JDD=/^[\p{Default_Ignorable_Code_Point}\p{Control}\p{Format}\p{Mark}\p{Surrogate}]+/v,QDD=/^\p{RGI_Emoji}$/v});var Ij={};H2(Ij,{default:()=>Aj});function qX(D,F,$){if(D.charAt(F)===" ")return F;let J=$?1:-1;for(let Q=0;Q<=3;Q++){let Z=F+Q*J;if(D.charAt(Z)===" ")return Z}return F}function Aj(D,F,$={}){let{position:J="end",space:Q=!1,preferTruncationOnSpace:Z=!1}=$,{truncationCharacter:X="…"}=$;if(typeof D!=="string")throw TypeError(`Expected \`input\` to be a string, got ${typeof D}`);if(typeof F!=="number")throw TypeError(`Expected \`columns\` to be a number, got ${typeof F}`);if(F<1)return"";let Y=VF(D);if(Y<=F)return D;if(F===1)return X;let q={ESC:27,LEFT_BRACKET:91,LETTER_M:109},G=(V)=>V>=48&&V<=57||V===59;function B(V){let H=0;while(H+2<V.length&&V.codePointAt(H)===q.ESC&&V.codePointAt(H+1)===q.LEFT_BRACKET){let z=H+2;while(z<V.length&&G(V.codePointAt(z)))z++;if(z<V.length&&V.codePointAt(z)===q.LETTER_M){H=z+1;continue}break}return H}function W(V){let H=V.length;while(H>1&&V.codePointAt(H-1)===q.LETTER_M){let z=H-2;while(z>=0&&G(V.codePointAt(z)))z--;if(z>=1&&V.codePointAt(z-1)===q.ESC&&V.codePointAt(z)===q.LEFT_BRACKET){H=z-1;continue}break}return H}function K(V,H){let z=W(V);if(z===V.length)return V+H;return V.slice(0,z)+H+V.slice(z)}function U(V,H){let z=B(H);if(z===0)return V+H;return H.slice(0,z)+V+H.slice(z)}if(J==="start"){if(Z){let H=qX(D,Y-F+1,!0),z=L2(D,H,Y).trim();return U(X,z)}if(Q)X+=" ";let V=L2(D,Y-F+VF(X),Y);return U(X,V)}if(J==="middle"){if(Q)X=` ${X} `;let V=Math.floor(F/2);if(Z){let H=qX(D,V),z=qX(D,Y-(F-V)+1,!0);return L2(D,0,H)+X+L2(D,z,Y).trim()}return L2(D,0,V)+X+L2(D,Y-(F-V)+VF(X),Y)}if(J==="end"){if(Z){let H=qX(D,F-1),z=L2(D,0,H);return K(z,X)}if(Q)X=` ${X}`;let V=L2(D,0,F-VF(X));return K(V,X)}throw Error(`Expected \`options.position\` to be either \`start\`, \`middle\` or \`end\`, got ${J}`)}var wj=x(()=>{NU();LU()});var BD=w((rDD)=>{var fU=Symbol.for("yaml.alias"),mj=Symbol.for("yaml.document"),UX=Symbol.for("yaml.map"),dj=Symbol.for("yaml.pair"),bU=Symbol.for("yaml.scalar"),VX=Symbol.for("yaml.seq"),E1=Symbol.for("yaml.node.type"),pDD=(D)=>!!D&&typeof D==="object"&&D[E1]===fU,lDD=(D)=>!!D&&typeof D==="object"&&D[E1]===mj,cDD=(D)=>!!D&&typeof D==="object"&&D[E1]===UX,nDD=(D)=>!!D&&typeof D==="object"&&D[E1]===dj,pj=(D)=>!!D&&typeof D==="object"&&D[E1]===bU,iDD=(D)=>!!D&&typeof D==="object"&&D[E1]===VX;function lj(D){if(D&&typeof D==="object")switch(D[E1]){case UX:case VX:return!0}return!1}function oDD(D){if(D&&typeof D==="object")switch(D[E1]){case fU:case UX:case bU:case VX:return!0}return!1}var aDD=(D)=>(pj(D)||lj(D))&&!!D.anchor;rDD.ALIAS=fU;rDD.DOC=mj;rDD.MAP=UX;rDD.NODE_TYPE=E1;rDD.PAIR=dj;rDD.SCALAR=bU;rDD.SEQ=VX;rDD.hasAnchor=aDD;rDD.isAlias=pDD;rDD.isCollection=lj;rDD.isDocument=lDD;rDD.isMap=cDD;rDD.isNode=oDD;rDD.isPair=nDD;rDD.isScalar=pj;rDD.isSeq=iDD});var H5=w((U0D)=>{var J0=BD(),D2=Symbol("break visit"),cj=Symbol("skip children"),h8=Symbol("remove node");function HX(D,F){let $=nj(F);if(J0.isDocument(D)){if(a7(null,D.contents,$,Object.freeze([D]))===h8)D.contents=null}else a7(null,D,$,Object.freeze([]))}HX.BREAK=D2;HX.SKIP=cj;HX.REMOVE=h8;function a7(D,F,$,J){let Q=ij(D,F,$,J);if(J0.isNode(Q)||J0.isPair(Q))return oj(D,J,Q),a7(D,Q,$,J);if(typeof Q!=="symbol"){if(J0.isCollection(F)){J=Object.freeze(J.concat(F));for(let Z=0;Z<F.items.length;++Z){let X=a7(Z,F.items[Z],$,J);if(typeof X==="number")Z=X-1;else if(X===D2)return D2;else if(X===h8)F.items.splice(Z,1),Z-=1}}else if(J0.isPair(F)){J=Object.freeze(J.concat(F));let Z=a7("key",F.key,$,J);if(Z===D2)return D2;else if(Z===h8)F.key=null;let X=a7("value",F.value,$,J);if(X===D2)return D2;else if(X===h8)F.value=null}}return Q}async function zX(D,F){let $=nj(F);if(J0.isDocument(D)){if(await r7(null,D.contents,$,Object.freeze([D]))===h8)D.contents=null}else await r7(null,D,$,Object.freeze([]))}zX.BREAK=D2;zX.SKIP=cj;zX.REMOVE=h8;async function r7(D,F,$,J){let Q=await ij(D,F,$,J);if(J0.isNode(Q)||J0.isPair(Q))return oj(D,J,Q),r7(D,Q,$,J);if(typeof Q!=="symbol"){if(J0.isCollection(F)){J=Object.freeze(J.concat(F));for(let Z=0;Z<F.items.length;++Z){let X=await r7(Z,F.items[Z],$,J);if(typeof X==="number")Z=X-1;else if(X===D2)return D2;else if(X===h8)F.items.splice(Z,1),Z-=1}}else if(J0.isPair(F)){J=Object.freeze(J.concat(F));let Z=await r7("key",F.key,$,J);if(Z===D2)return D2;else if(Z===h8)F.key=null;let X=await r7("value",F.value,$,J);if(X===D2)return D2;else if(X===h8)F.value=null}}return Q}function nj(D){if(typeof D==="object"&&(D.Collection||D.Node||D.Value))return Object.assign({Alias:D.Node,Map:D.Node,Scalar:D.Node,Seq:D.Node},D.Value&&{Map:D.Value,Scalar:D.Value,Seq:D.Value},D.Collection&&{Map:D.Collection,Seq:D.Collection},D);return D}function ij(D,F,$,J){if(typeof $==="function")return $(D,F,J);if(J0.isMap(F))return $.Map?.(D,F,J);if(J0.isSeq(F))return $.Seq?.(D,F,J);if(J0.isPair(F))return $.Pair?.(D,F,J);if(J0.isScalar(F))return $.Scalar?.(D,F,J);if(J0.isAlias(F))return $.Alias?.(D,F,J);return}function oj(D,F,$){let J=F[F.length-1];if(J0.isCollection(J))J.items[D]=$;else if(J0.isPair(J))if(D==="key")J.key=$;else J.value=$;else if(J0.isDocument(J))J.contents=$;else{let Q=J0.isAlias(J)?"alias":"scalar";throw Error(`Cannot replace node with ${Q} parent`)}}U0D.visit=HX;U0D.visitAsync=zX});var vU=w((M0D)=>{var aj=BD(),z0D=H5(),C0D={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},_0D=(D)=>D.replace(/[!,[\]{}]/g,(F)=>C0D[F]);class P2{constructor(D,F){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},P2.defaultYaml,D),this.tags=Object.assign({},P2.defaultTags,F)}clone(){let D=new P2(this.yaml,this.tags);return D.docStart=this.docStart,D}atDocument(){let D=new P2(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:P2.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},P2.defaultTags);break}return D}add(D,F){if(this.atNextDocument)this.yaml={explicit:P2.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},P2.defaultTags),this.atNextDocument=!1;let $=D.trim().split(/[ \t]+/),J=$.shift();switch(J){case"%TAG":{if($.length!==2){if(F(0,"%TAG directive should contain exactly two parts"),$.length<2)return!1}let[Q,Z]=$;return this.tags[Q]=Z,!0}case"%YAML":{if(this.yaml.explicit=!0,$.length!==1)return F(0,"%YAML directive should contain exactly one part"),!1;let[Q]=$;if(Q==="1.1"||Q==="1.2")return this.yaml.version=Q,!0;else{let Z=/^\d+\.\d+$/.test(Q);return F(6,`Unsupported YAML version ${Q}`,Z),!1}}default:return F(0,`Unknown directive ${J}`,!0),!1}}tagName(D,F){if(D==="!")return"!";if(D[0]!=="!")return F(`Not a valid tag: ${D}`),null;if(D[1]==="<"){let Z=D.slice(2,-1);if(Z==="!"||Z==="!!")return F(`Verbatim tags aren't resolved, so ${D} is invalid.`),null;if(D[D.length-1]!==">")F("Verbatim tags must end with a >");return Z}let[,$,J]=D.match(/^(.*!)([^!]*)$/s);if(!J)F(`The ${D} tag has no suffix`);let Q=this.tags[$];if(Q)try{return Q+decodeURIComponent(J)}catch(Z){return F(String(Z)),null}if($==="!")return D;return F(`Could not resolve tag: ${D}`),null}tagString(D){for(let[F,$]of Object.entries(this.tags))if(D.startsWith($))return F+_0D(D.substring($.length));return D[0]==="!"?D:`!<${D}>`}toString(D){let F=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],$=Object.entries(this.tags),J;if(D&&$.length>0&&aj.isNode(D.contents)){let Q={};z0D.visit(D.contents,(Z,X)=>{if(aj.isNode(X)&&X.tag)Q[X.tag]=!0}),J=Object.keys(Q)}else J=[];for(let[Q,Z]of $){if(Q==="!!"&&Z==="tag:yaml.org,2002:")continue;if(!D||J.some((X)=>X.startsWith(Z)))F.push(`%TAG ${Q} ${Z}`)}return F.join(`
96
+ `)}}P2.defaultYaml={explicit:!1,version:"1.2"};P2.defaultTags={"!!":"tag:yaml.org,2002:"};M0D.Directives=P2});var CX=w((I0D)=>{var rj=BD(),E0D=H5();function R0D(D){if(/[\x00-\x19\s,[\]{}]/.test(D)){let $=`Anchor must not contain whitespace or control characters: ${JSON.stringify(D)}`;throw Error($)}return!0}function sj(D){let F=new Set;return E0D.visit(D,{Value($,J){if(J.anchor)F.add(J.anchor)}}),F}function tj(D,F){for(let $=1;;++$){let J=`${D}${$}`;if(!F.has(J))return J}}function A0D(D,F){let $=[],J=new Map,Q=null;return{onAnchor:(Z)=>{$.push(Z),Q??(Q=sj(D));let X=tj(F,Q);return Q.add(X),X},setAnchors:()=>{for(let Z of $){let X=J.get(Z);if(typeof X==="object"&&X.anchor&&(rj.isScalar(X.node)||rj.isCollection(X.node)))X.node.anchor=X.anchor;else{let Y=Error("Failed to resolve repeated object (this should not happen)");throw Y.source=Z,Y}}},sourceObjects:J}}I0D.anchorIsValid=R0D;I0D.anchorNames=sj;I0D.createNodeAnchors=A0D;I0D.findNewAnchor=tj});var hU=w((P0D)=>{function z5(D,F,$,J){if(J&&typeof J==="object")if(Array.isArray(J))for(let Q=0,Z=J.length;Q<Z;++Q){let X=J[Q],Y=z5(D,J,String(Q),X);if(Y===void 0)delete J[Q];else if(Y!==X)J[Q]=Y}else if(J instanceof Map)for(let Q of Array.from(J.keys())){let Z=J.get(Q),X=z5(D,J,Q,Z);if(X===void 0)J.delete(Q);else if(X!==Z)J.set(Q,X)}else if(J instanceof Set)for(let Q of Array.from(J)){let Z=z5(D,J,Q,Q);if(Z===void 0)J.delete(Q);else if(Z!==Q)J.delete(Q),J.add(Z)}else for(let[Q,Z]of Object.entries(J)){let X=z5(D,J,Q,Z);if(X===void 0)delete J[Q];else if(X!==Z)J[Q]=X}return D.call(F,$,J)}P0D.applyReviver=z5});var zF=w((x0D)=>{var S0D=BD();function ej(D,F,$){if(Array.isArray(D))return D.map((J,Q)=>ej(J,String(Q),$));if(D&&typeof D.toJSON==="function"){if(!$||!S0D.hasAnchor(D))return D.toJSON(F,$);let J={aliasCount:0,count:1,res:void 0};$.anchors.set(D,J),$.onCreate=(Z)=>{J.res=Z,delete $.onCreate};let Q=D.toJSON(F,$);if($.onCreate)$.onCreate(Q);return Q}if(typeof D==="bigint"&&!$?.keep)return Number(D);return D}x0D.toJS=ej});var _X=w((b0D)=>{var y0D=hU(),DS=BD(),f0D=zF();class FS{constructor(D){Object.defineProperty(this,DS.NODE_TYPE,{value:D})}clone(){let D=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)D.range=this.range.slice();return D}toJS(D,{mapAsMap:F,maxAliasCount:$,onAnchor:J,reviver:Q}={}){if(!DS.isDocument(D))throw TypeError("A document argument is required");let Z={anchors:new Map,doc:D,keep:!0,mapAsMap:F===!0,mapKeyWarned:!1,maxAliasCount:typeof $==="number"?$:100},X=f0D.toJS(this,"",Z);if(typeof J==="function")for(let{count:Y,res:q}of Z.anchors.values())J(q,Y);return typeof Q==="function"?y0D.applyReviver(Q,{"":X},"",X):X}}b0D.NodeBase=FS});var C5=w((d0D)=>{var h0D=CX(),u0D=H5(),s7=BD(),g0D=_X(),m0D=zF();class $S extends g0D.NodeBase{constructor(D){super(s7.ALIAS);this.source=D,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(D,F){let $;if(F?.aliasResolveCache)$=F.aliasResolveCache;else if($=[],u0D.visit(D,{Node:(Q,Z)=>{if(s7.isAlias(Z)||s7.hasAnchor(Z))$.push(Z)}}),F)F.aliasResolveCache=$;let J=void 0;for(let Q of $){if(Q===this)break;if(Q.anchor===this.source)J=Q}return J}toJSON(D,F){if(!F)return{source:this.source};let{anchors:$,doc:J,maxAliasCount:Q}=F,Z=this.resolve(J,F);if(!Z){let Y=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(Y)}let X=$.get(Z);if(!X)m0D.toJS(Z,null,F),X=$.get(Z);if(X?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(Q>=0){if(X.count+=1,X.aliasCount===0)X.aliasCount=MX(J,Z,$);if(X.count*X.aliasCount>Q)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return X.res}toString(D,F,$){let J=`*${this.source}`;if(D){if(h0D.anchorIsValid(this.source),D.options.verifyAliasOrder&&!D.anchors.has(this.source)){let Q=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(Q)}if(D.implicitKey)return`${J} `}return J}}function MX(D,F,$){if(s7.isAlias(F)){let J=F.resolve(D),Q=$&&J&&$.get(J);return Q?Q.count*Q.aliasCount:0}else if(s7.isCollection(F)){let J=0;for(let Q of F.items){let Z=MX(D,Q,$);if(Z>J)J=Z}return J}else if(s7.isPair(F)){let J=MX(D,F.key,$),Q=MX(D,F.value,$);return Math.max(J,Q)}return 1}d0D.Alias=$S});var rD=w((o0D)=>{var l0D=BD(),c0D=_X(),n0D=zF(),i0D=(D)=>!D||typeof D!=="function"&&typeof D!=="object";class j3 extends c0D.NodeBase{constructor(D){super(l0D.SCALAR);this.value=D}toJSON(D,F){return F?.keep?this.value:n0D.toJS(this.value,D,F)}toString(){return String(this.value)}}j3.BLOCK_FOLDED="BLOCK_FOLDED";j3.BLOCK_LITERAL="BLOCK_LITERAL";j3.PLAIN="PLAIN";j3.QUOTE_DOUBLE="QUOTE_DOUBLE";j3.QUOTE_SINGLE="QUOTE_SINGLE";o0D.Scalar=j3;o0D.isScalarValue=i0D});var _5=w((F2D)=>{var s0D=C5(),S3=BD(),JS=rD(),t0D="tag:yaml.org,2002:";function e0D(D,F,$){if(F){let J=$.filter((Z)=>Z.tag===F),Q=J.find((Z)=>!Z.format)??J[0];if(!Q)throw Error(`Tag ${F} not found`);return Q}return $.find((J)=>J.identify?.(D)&&!J.format)}function D2D(D,F,$){if(S3.isDocument(D))D=D.contents;if(S3.isNode(D))return D;if(S3.isPair(D)){let W=$.schema[S3.MAP].createNode?.($.schema,null,$);return W.items.push(D),W}if(D instanceof String||D instanceof Number||D instanceof Boolean||typeof BigInt<"u"&&D instanceof BigInt)D=D.valueOf();let{aliasDuplicateObjects:J,onAnchor:Q,onTagObj:Z,schema:X,sourceObjects:Y}=$,q=void 0;if(J&&D&&typeof D==="object")if(q=Y.get(D),q)return q.anchor??(q.anchor=Q(D)),new s0D.Alias(q.anchor);else q={anchor:null,node:null},Y.set(D,q);if(F?.startsWith("!!"))F=t0D+F.slice(2);let G=e0D(D,F,X.tags);if(!G){if(D&&typeof D.toJSON==="function")D=D.toJSON();if(!D||typeof D!=="object"){let W=new JS.Scalar(D);if(q)q.node=W;return W}G=D instanceof Map?X[S3.MAP]:(Symbol.iterator in Object(D))?X[S3.SEQ]:X[S3.MAP]}if(Z)Z(G),delete $.onTagObj;let B=G?.createNode?G.createNode($.schema,D,$):typeof G?.nodeClass?.from==="function"?G.nodeClass.from($.schema,D,$):new JS.Scalar(D);if(F)B.tag=F;else if(!G.default)B.tag=G.tag;if(q)q.node=B;return B}F2D.createNode=D2D});var OX=w((Z2D)=>{var J2D=_5(),u8=BD(),Q2D=_X();function uU(D,F,$){let J=$;for(let Q=F.length-1;Q>=0;--Q){let Z=F[Q];if(typeof Z==="number"&&Number.isInteger(Z)&&Z>=0){let X=[];X[Z]=J,J=X}else J=new Map([[Z,J]])}return J2D.createNode(J,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:D,sourceObjects:new Map})}var QS=(D)=>D==null||typeof D==="object"&&!!D[Symbol.iterator]().next().done;class ZS extends Q2D.NodeBase{constructor(D,F){super(D);Object.defineProperty(this,"schema",{value:F,configurable:!0,enumerable:!1,writable:!0})}clone(D){let F=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(D)F.schema=D;if(F.items=F.items.map(($)=>u8.isNode($)||u8.isPair($)?$.clone(D):$),this.range)F.range=this.range.slice();return F}addIn(D,F){if(QS(D))this.add(F);else{let[$,...J]=D,Q=this.get($,!0);if(u8.isCollection(Q))Q.addIn(J,F);else if(Q===void 0&&this.schema)this.set($,uU(this.schema,J,F));else throw Error(`Expected YAML collection at ${$}. Remaining path: ${J}`)}}deleteIn(D){let[F,...$]=D;if($.length===0)return this.delete(F);let J=this.get(F,!0);if(u8.isCollection(J))return J.deleteIn($);else throw Error(`Expected YAML collection at ${F}. Remaining path: ${$}`)}getIn(D,F){let[$,...J]=D,Q=this.get($,!0);if(J.length===0)return!F&&u8.isScalar(Q)?Q.value:Q;else return u8.isCollection(Q)?Q.getIn(J,F):void 0}hasAllNullValues(D){return this.items.every((F)=>{if(!u8.isPair(F))return!1;let $=F.value;return $==null||D&&u8.isScalar($)&&$.value==null&&!$.commentBefore&&!$.comment&&!$.tag})}hasIn(D){let[F,...$]=D;if($.length===0)return this.has(F);let J=this.get(F,!0);return u8.isCollection(J)?J.hasIn($):!1}setIn(D,F){let[$,...J]=D;if(J.length===0)this.set($,F);else{let Q=this.get($,!0);if(u8.isCollection(Q))Q.setIn(J,F);else if(Q===void 0&&this.schema)this.set($,uU(this.schema,J,F));else throw Error(`Expected YAML collection at ${$}. Remaining path: ${J}`)}}}Z2D.Collection=ZS;Z2D.collectionFromPath=uU;Z2D.isEmptyPath=QS});var M5=w((W2D)=>{var G2D=(D)=>D.replace(/^(?!$)(?: $)?/gm,"#");function gU(D,F){if(/^\n+$/.test(D))return D.substring(1);return F?D.replace(/^(?! *$)/gm,F):D}var B2D=(D,F,$)=>D.endsWith(`
97
97
  `)?gU($,F):$.includes(`
98
98
  `)?`
99
- `+gU($,F):(D.endsWith(" ")?"":" ")+$;W2D.indentComment=gU;W2D.lineComment=B2D;W2D.stringifyComment=G2D});var YS=I((z2D)=>{function H2D(D,F,$="flow",{indentAtStart:J,lineWidth:Q=80,minContentWidth:Z=20,onFold:X,onOverflow:Y}={}){if(!Q||Q<0)return D;if(Q<Z)Z=0;let q=Math.max(1+Z,1+Q-F.length);if(D.length<=q)return D;let G=[],B={},W=Q-F.length;if(typeof J==="number")if(J>Q-Math.max(2,Z))G.push(0);else W=Q-J;let K=void 0,U=void 0,V=!1,H=-1,z=-1,_=-1;if($==="block"){if(H=XS(D,H,F.length),H!==-1)W=H+q}for(let C;C=D[H+=1];){if($==="quoted"&&C==="\\"){switch(z=H,D[H+1]){case"x":H+=3;break;case"u":H+=5;break;case"U":H+=9;break;default:H+=1}_=H}if(C===`
99
+ `+gU($,F):(D.endsWith(" ")?"":" ")+$;W2D.indentComment=gU;W2D.lineComment=B2D;W2D.stringifyComment=G2D});var YS=w((z2D)=>{function H2D(D,F,$="flow",{indentAtStart:J,lineWidth:Q=80,minContentWidth:Z=20,onFold:X,onOverflow:Y}={}){if(!Q||Q<0)return D;if(Q<Z)Z=0;let q=Math.max(1+Z,1+Q-F.length);if(D.length<=q)return D;let G=[],B={},W=Q-F.length;if(typeof J==="number")if(J>Q-Math.max(2,Z))G.push(0);else W=Q-J;let K=void 0,U=void 0,V=!1,H=-1,z=-1,_=-1;if($==="block"){if(H=XS(D,H,F.length),H!==-1)W=H+q}for(let C;C=D[H+=1];){if($==="quoted"&&C==="\\"){switch(z=H,D[H+1]){case"x":H+=3;break;case"u":H+=5;break;case"U":H+=9;break;default:H+=1}_=H}if(C===`
100
100
  `){if($==="block")H=XS(D,H,F.length);W=H+F.length+q,K=void 0}else{if(C===" "&&U&&U!==" "&&U!==`
101
101
  `&&U!=="\t"){let M=D[H+1];if(M&&M!==" "&&M!==`
102
102
  `&&M!=="\t")K=H}if(H>=W)if(K)G.push(K),W=K+q,K=void 0;else if($==="quoted"){while(U===" "||U==="\t")U=C,C=D[H+=1],V=!0;let M=H>_+1?H-2:z-1;if(B[M])return D;G.push(M),B[M]=!0,W=M+q,K=void 0}else V=!0}U=C}if(V&&Y)Y();if(G.length===0)return D;if(X)X();let O=D.slice(0,G[0]);for(let C=0;C<G.length;++C){let M=G[C],E=G[C+1]||D.length;if(M===0)O=`
103
103
  ${F}${D.slice(0,E)}`;else{if($==="quoted"&&B[M])O+=`${D[M]}\\`;O+=`
104
104
  ${F}${D.slice(M+1,E)}`}}return O}function XS(D,F,$){let J=F,Q=F+1,Z=D[Q];while(Z===" "||Z==="\t")if(F<Q+$)Z=D[++F];else{do Z=D[++F];while(Z&&Z!==`
105
- `);J=F,Q=F+1,Z=D[Q]}return J}z2D.FOLD_BLOCK="block";z2D.FOLD_FLOW="flow";z2D.FOLD_QUOTED="quoted";z2D.foldFlowLines=H2D});var E5=I((I2D)=>{var F8=rD(),CF=YS(),RX=(D,F)=>({indentAtStart:F?D.indent.length:D.indentAtStart,lineWidth:D.options.lineWidth,minContentWidth:D.options.minContentWidth}),AX=(D)=>/^(%|---|\.\.\.)/m.test(D);function E2D(D,F,$){if(!F||F<0)return!1;let J=F-$,Q=D.length;if(Q<=J)return!1;for(let Z=0,X=0;Z<Q;++Z)if(D[Z]===`
105
+ `);J=F,Q=F+1,Z=D[Q]}return J}z2D.FOLD_BLOCK="block";z2D.FOLD_FLOW="flow";z2D.FOLD_QUOTED="quoted";z2D.foldFlowLines=H2D});var E5=w((I2D)=>{var F8=rD(),CF=YS(),RX=(D,F)=>({indentAtStart:F?D.indent.length:D.indentAtStart,lineWidth:D.options.lineWidth,minContentWidth:D.options.minContentWidth}),AX=(D)=>/^(%|---|\.\.\.)/m.test(D);function E2D(D,F,$){if(!F||F<0)return!1;let J=F-$,Q=D.length;if(Q<=J)return!1;for(let Z=0,X=0;Z<Q;++Z)if(D[Z]===`
106
106
  `){if(Z-X>J)return!0;if(X=Z+1,Q-X<=J)return!1}return!0}function O5(D,F){let $=JSON.stringify(D);if(F.options.doubleQuotedAsJSON)return $;let{implicitKey:J}=F,Q=F.options.doubleQuotedMinMultiLineLength,Z=F.indent||(AX(D)?" ":""),X="",Y=0;for(let q=0,G=$[q];G;G=$[++q]){if(G===" "&&$[q+1]==="\\"&&$[q+2]==="n")X+=$.slice(Y,q)+"\\ ",q+=1,Y=q,G="\\";if(G==="\\")switch($[q+1]){case"u":{X+=$.slice(Y,q);let B=$.substr(q+2,4);switch(B){case"0000":X+="\\0";break;case"0007":X+="\\a";break;case"000b":X+="\\v";break;case"001b":X+="\\e";break;case"0085":X+="\\N";break;case"00a0":X+="\\_";break;case"2028":X+="\\L";break;case"2029":X+="\\P";break;default:if(B.substr(0,2)==="00")X+="\\x"+B.substr(2);else X+=$.substr(q,6)}q+=5,Y=q+1}break;case"n":if(J||$[q+2]==='"'||$.length<Q)q+=1;else{X+=$.slice(Y,q)+`
107
107
 
108
108
  `;while($[q+2]==="\\"&&$[q+3]==="n"&&$[q+4]!=='"')X+=`
@@ -118,49 +118,49 @@ ${$}`)+"'";return F.implicitKey?J:CF.foldFlowLines(J,$,CF.FOLD_FLOW,RX(F,!1))}fu
118
118
  `);if(V===-1)W="-";else if($===U||V!==U.length-1){if(W="+",Z)Z()}else W="";if(U){if($=$.slice(0,-U.length),U[U.length-1]===`
119
119
  `)U=U.slice(0,-1);U=U.replace(dU,`$&${G}`)}let H=!1,z,_=-1;for(z=0;z<$.length;++z){let E=$[z];if(E===" ")H=!0;else if(E===`
120
120
  `)_=z;else break}let O=$.substring(0,_<z?_+1:z);if(O)$=$.substring(O.length),O=O.replace(/\n+/g,`$&${G}`);let M=(H?G?"2":"1":"")+W;if(D){if(M+=" "+Y(D.replace(/ ?[\r\n]+/g," ")),Q)Q()}if(!B){let E=$.replace(/\n+/g,`
121
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${G}`),A=!1,w=RX(J,!0);if(X!=="folded"&&F!==F8.Scalar.BLOCK_FOLDED)w.onOverflow=()=>{A=!0};let R=CF.foldFlowLines(`${O}${E}${U}`,G,CF.FOLD_BLOCK,w);if(!A)return`>${M}
121
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${G}`),A=!1,I=RX(J,!0);if(X!=="folded"&&F!==F8.Scalar.BLOCK_FOLDED)I.onOverflow=()=>{A=!0};let R=CF.foldFlowLines(`${O}${E}${U}`,G,CF.FOLD_BLOCK,I);if(!A)return`>${M}
122
122
  ${G}${R}`}return $=$.replace(/\n+/g,`$&${G}`),`|${M}
123
123
  ${G}${O}${$}${U}`}function R2D(D,F,$,J){let{type:Q,value:Z}=D,{actualString:X,implicitKey:Y,indent:q,indentStep:G,inFlow:B}=F;if(Y&&Z.includes(`
124
124
  `)||B&&/[[\]{},]/.test(Z))return t7(Z,F);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(Z))return Y||B||!Z.includes(`
125
125
  `)?t7(Z,F):EX(D,F,$,J);if(!Y&&!B&&Q!==F8.Scalar.PLAIN&&Z.includes(`
126
126
  `))return EX(D,F,$,J);if(AX(Z)){if(q==="")return F.forceBlockIndent=!0,EX(D,F,$,J);else if(Y&&q===G)return t7(Z,F)}let W=Z.replace(/\n+/g,`$&
127
- ${q}`);if(X){let K=(H)=>H.default&&H.tag!=="tag:yaml.org,2002:str"&&H.test?.test(W),{compat:U,tags:V}=F.doc.schema;if(V.some(K)||U?.some(K))return t7(Z,F)}return Y?W:CF.foldFlowLines(W,q,CF.FOLD_FLOW,RX(F,!1))}function A2D(D,F,$,J){let{implicitKey:Q,inFlow:Z}=F,X=typeof D.value==="string"?D:Object.assign({},D,{value:String(D.value)}),{type:Y}=D;if(Y!==F8.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(X.value))Y=F8.Scalar.QUOTE_DOUBLE}let q=(B)=>{switch(B){case F8.Scalar.BLOCK_FOLDED:case F8.Scalar.BLOCK_LITERAL:return Q||Z?t7(X.value,F):EX(X,F,$,J);case F8.Scalar.QUOTE_DOUBLE:return O5(X.value,F);case F8.Scalar.QUOTE_SINGLE:return mU(X.value,F);case F8.Scalar.PLAIN:return R2D(X,F,$,J);default:return null}},G=q(Y);if(G===null){let{defaultKeyType:B,defaultStringType:W}=F.options,K=Q&&B||W;if(G=q(K),G===null)throw Error(`Unsupported default string type ${K}`)}return G}I2D.stringifyString=A2D});var R5=I((k2D)=>{var N2D=CX(),_F=BD(),T2D=M5(),L2D=E5();function P2D(D,F){let $=Object.assign({blockQuote:!0,commentString:T2D.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},D.schema.toStringOptions,F),J;switch($.collectionStyle){case"block":J=!1;break;case"flow":J=!0;break;default:J=null}return{anchors:new Set,doc:D,flowCollectionPadding:$.flowCollectionPadding?" ":"",indent:"",indentStep:typeof $.indent==="number"?" ".repeat($.indent):" ",inFlow:J,options:$}}function j2D(D,F){if(F.tag){let Q=D.filter((Z)=>Z.tag===F.tag);if(Q.length>0)return Q.find((Z)=>Z.format===F.format)??Q[0]}let $=void 0,J;if(_F.isScalar(F)){J=F.value;let Q=D.filter((Z)=>Z.identify?.(J));if(Q.length>1){let Z=Q.filter((X)=>X.test);if(Z.length>0)Q=Z}$=Q.find((Z)=>Z.format===F.format)??Q.find((Z)=>!Z.format)}else J=F,$=D.find((Q)=>Q.nodeClass&&J instanceof Q.nodeClass);if(!$){let Q=J?.constructor?.name??(J===null?"null":typeof J);throw Error(`Tag not resolved for ${Q} value`)}return $}function S2D(D,F,{anchors:$,doc:J}){if(!J.directives)return"";let Q=[],Z=(_F.isScalar(D)||_F.isCollection(D))&&D.anchor;if(Z&&N2D.anchorIsValid(Z))$.add(Z),Q.push(`&${Z}`);let X=D.tag??(F.default?null:F.tag);if(X)Q.push(J.directives.tagString(X));return Q.join(" ")}function x2D(D,F,$,J){if(_F.isPair(D))return D.toString(F,$,J);if(_F.isAlias(D)){if(F.doc.directives)return D.toString(F);if(F.resolvedAliases?.has(D))throw TypeError("Cannot stringify circular structure without alias nodes");else{if(F.resolvedAliases)F.resolvedAliases.add(D);else F.resolvedAliases=new Set([D]);D=D.resolve(F.doc)}}let Q=void 0,Z=_F.isNode(D)?D:F.doc.createNode(D,{onTagObj:(q)=>Q=q});Q??(Q=j2D(F.doc.schema.tags,Z));let X=S2D(Z,Q,F);if(X.length>0)F.indentAtStart=(F.indentAtStart??0)+X.length+1;let Y=typeof Q.stringify==="function"?Q.stringify(Z,F,$,J):_F.isScalar(Z)?L2D.stringifyString(Z,F,$,J):Z.toString(F,$,J);if(!X)return Y;return _F.isScalar(Z)||Y[0]==="{"||Y[0]==="["?`${X} ${Y}`:`${X}
128
- ${F.indent}${Y}`}k2D.createStringifyContext=P2D;k2D.stringify=x2D});var BS=I((v2D)=>{var R1=BD(),qS=rD(),GS=R5(),A5=M5();function b2D({key:D,value:F},$,J,Q){let{allNullValues:Z,doc:X,indent:Y,indentStep:q,options:{commentString:G,indentSeq:B,simpleKeys:W}}=$,K=R1.isNode(D)&&D.comment||null;if(W){if(K)throw Error("With simple keys, key nodes cannot have comments");if(R1.isCollection(D)||!R1.isNode(D)&&typeof D==="object")throw Error("With simple keys, collection cannot be used as a key value")}let U=!W&&(!D||K&&F==null&&!$.inFlow||R1.isCollection(D)||(R1.isScalar(D)?D.type===qS.Scalar.BLOCK_FOLDED||D.type===qS.Scalar.BLOCK_LITERAL:typeof D==="object"));$=Object.assign({},$,{allNullValues:!1,implicitKey:!U&&(W||!Z),indent:Y+q});let V=!1,H=!1,z=GS.stringify(D,$,()=>V=!0,()=>H=!0);if(!U&&!$.inFlow&&z.length>1024){if(W)throw Error("With simple keys, single line scalar must not span more than 1024 characters");U=!0}if($.inFlow){if(Z||F==null){if(V&&J)J();return z===""?"?":U?`? ${z}`:z}}else if(Z&&!W||F==null&&U){if(z=`? ${z}`,K&&!V)z+=A5.lineComment(z,$.indent,G(K));else if(H&&Q)Q();return z}if(V)K=null;if(U){if(K)z+=A5.lineComment(z,$.indent,G(K));z=`? ${z}
127
+ ${q}`);if(X){let K=(H)=>H.default&&H.tag!=="tag:yaml.org,2002:str"&&H.test?.test(W),{compat:U,tags:V}=F.doc.schema;if(V.some(K)||U?.some(K))return t7(Z,F)}return Y?W:CF.foldFlowLines(W,q,CF.FOLD_FLOW,RX(F,!1))}function A2D(D,F,$,J){let{implicitKey:Q,inFlow:Z}=F,X=typeof D.value==="string"?D:Object.assign({},D,{value:String(D.value)}),{type:Y}=D;if(Y!==F8.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(X.value))Y=F8.Scalar.QUOTE_DOUBLE}let q=(B)=>{switch(B){case F8.Scalar.BLOCK_FOLDED:case F8.Scalar.BLOCK_LITERAL:return Q||Z?t7(X.value,F):EX(X,F,$,J);case F8.Scalar.QUOTE_DOUBLE:return O5(X.value,F);case F8.Scalar.QUOTE_SINGLE:return mU(X.value,F);case F8.Scalar.PLAIN:return R2D(X,F,$,J);default:return null}},G=q(Y);if(G===null){let{defaultKeyType:B,defaultStringType:W}=F.options,K=Q&&B||W;if(G=q(K),G===null)throw Error(`Unsupported default string type ${K}`)}return G}I2D.stringifyString=A2D});var R5=w((k2D)=>{var N2D=CX(),_F=BD(),T2D=M5(),L2D=E5();function P2D(D,F){let $=Object.assign({blockQuote:!0,commentString:T2D.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},D.schema.toStringOptions,F),J;switch($.collectionStyle){case"block":J=!1;break;case"flow":J=!0;break;default:J=null}return{anchors:new Set,doc:D,flowCollectionPadding:$.flowCollectionPadding?" ":"",indent:"",indentStep:typeof $.indent==="number"?" ".repeat($.indent):" ",inFlow:J,options:$}}function j2D(D,F){if(F.tag){let Q=D.filter((Z)=>Z.tag===F.tag);if(Q.length>0)return Q.find((Z)=>Z.format===F.format)??Q[0]}let $=void 0,J;if(_F.isScalar(F)){J=F.value;let Q=D.filter((Z)=>Z.identify?.(J));if(Q.length>1){let Z=Q.filter((X)=>X.test);if(Z.length>0)Q=Z}$=Q.find((Z)=>Z.format===F.format)??Q.find((Z)=>!Z.format)}else J=F,$=D.find((Q)=>Q.nodeClass&&J instanceof Q.nodeClass);if(!$){let Q=J?.constructor?.name??(J===null?"null":typeof J);throw Error(`Tag not resolved for ${Q} value`)}return $}function S2D(D,F,{anchors:$,doc:J}){if(!J.directives)return"";let Q=[],Z=(_F.isScalar(D)||_F.isCollection(D))&&D.anchor;if(Z&&N2D.anchorIsValid(Z))$.add(Z),Q.push(`&${Z}`);let X=D.tag??(F.default?null:F.tag);if(X)Q.push(J.directives.tagString(X));return Q.join(" ")}function x2D(D,F,$,J){if(_F.isPair(D))return D.toString(F,$,J);if(_F.isAlias(D)){if(F.doc.directives)return D.toString(F);if(F.resolvedAliases?.has(D))throw TypeError("Cannot stringify circular structure without alias nodes");else{if(F.resolvedAliases)F.resolvedAliases.add(D);else F.resolvedAliases=new Set([D]);D=D.resolve(F.doc)}}let Q=void 0,Z=_F.isNode(D)?D:F.doc.createNode(D,{onTagObj:(q)=>Q=q});Q??(Q=j2D(F.doc.schema.tags,Z));let X=S2D(Z,Q,F);if(X.length>0)F.indentAtStart=(F.indentAtStart??0)+X.length+1;let Y=typeof Q.stringify==="function"?Q.stringify(Z,F,$,J):_F.isScalar(Z)?L2D.stringifyString(Z,F,$,J):Z.toString(F,$,J);if(!X)return Y;return _F.isScalar(Z)||Y[0]==="{"||Y[0]==="["?`${X} ${Y}`:`${X}
128
+ ${F.indent}${Y}`}k2D.createStringifyContext=P2D;k2D.stringify=x2D});var BS=w((v2D)=>{var R1=BD(),qS=rD(),GS=R5(),A5=M5();function b2D({key:D,value:F},$,J,Q){let{allNullValues:Z,doc:X,indent:Y,indentStep:q,options:{commentString:G,indentSeq:B,simpleKeys:W}}=$,K=R1.isNode(D)&&D.comment||null;if(W){if(K)throw Error("With simple keys, key nodes cannot have comments");if(R1.isCollection(D)||!R1.isNode(D)&&typeof D==="object")throw Error("With simple keys, collection cannot be used as a key value")}let U=!W&&(!D||K&&F==null&&!$.inFlow||R1.isCollection(D)||(R1.isScalar(D)?D.type===qS.Scalar.BLOCK_FOLDED||D.type===qS.Scalar.BLOCK_LITERAL:typeof D==="object"));$=Object.assign({},$,{allNullValues:!1,implicitKey:!U&&(W||!Z),indent:Y+q});let V=!1,H=!1,z=GS.stringify(D,$,()=>V=!0,()=>H=!0);if(!U&&!$.inFlow&&z.length>1024){if(W)throw Error("With simple keys, single line scalar must not span more than 1024 characters");U=!0}if($.inFlow){if(Z||F==null){if(V&&J)J();return z===""?"?":U?`? ${z}`:z}}else if(Z&&!W||F==null&&U){if(z=`? ${z}`,K&&!V)z+=A5.lineComment(z,$.indent,G(K));else if(H&&Q)Q();return z}if(V)K=null;if(U){if(K)z+=A5.lineComment(z,$.indent,G(K));z=`? ${z}
129
129
  ${Y}:`}else if(z=`${z}:`,K)z+=A5.lineComment(z,$.indent,G(K));let _,O,C;if(R1.isNode(F))_=!!F.spaceBefore,O=F.commentBefore,C=F.comment;else if(_=!1,O=null,C=null,F&&typeof F==="object")F=X.createNode(F);if($.implicitKey=!1,!U&&!K&&R1.isScalar(F))$.indentAtStart=z.length+1;if(H=!1,!B&&q.length>=2&&!$.inFlow&&!U&&R1.isSeq(F)&&!F.flow&&!F.tag&&!F.anchor)$.indent=$.indent.substring(2);let M=!1,E=GS.stringify(F,$,()=>M=!0,()=>H=!0),A=" ";if(K||_||O){if(A=_?`
130
- `:"",O){let w=G(O);A+=`
131
- ${A5.indentComment(w,$.indent)}`}if(E===""&&!$.inFlow){if(A===`
130
+ `:"",O){let I=G(O);A+=`
131
+ ${A5.indentComment(I,$.indent)}`}if(E===""&&!$.inFlow){if(A===`
132
132
  `&&C)A=`
133
133
 
134
134
  `}else A+=`
135
- ${$.indent}`}else if(!U&&R1.isCollection(F)){let w=E[0],R=E.indexOf(`
136
- `),T=R!==-1,N=$.inFlow??F.flow??F.items.length===0;if(T||!N){let j=!1;if(T&&(w==="&"||w==="!")){let L=E.indexOf(" ");if(w==="&"&&L!==-1&&L<R&&E[L+1]==="!")L=E.indexOf(" ",L+1);if(L===-1||R<L)j=!0}if(!j)A=`
135
+ ${$.indent}`}else if(!U&&R1.isCollection(F)){let I=E[0],R=E.indexOf(`
136
+ `),T=R!==-1,N=$.inFlow??F.flow??F.items.length===0;if(T||!N){let j=!1;if(T&&(I==="&"||I==="!")){let L=E.indexOf(" ");if(I==="&"&&L!==-1&&L<R&&E[L+1]==="!")L=E.indexOf(" ",L+1);if(L===-1||R<L)j=!0}if(!j)A=`
137
137
  ${$.indent}`}}else if(E===""||E[0]===`
138
- `)A="";if(z+=A+E,$.inFlow){if(M&&J)J()}else if(C&&!M)z+=A5.lineComment(z,$.indent,G(C));else if(H&&Q)Q();return z}v2D.stringifyPair=b2D});var pU=I((m2D)=>{var WS=r("process");function u2D(D,...F){if(D==="debug")console.log(...F)}function g2D(D,F){if(D==="debug"||D==="warn")if(typeof WS.emitWarning==="function")WS.emitWarning(F);else console.warn(F)}m2D.debug=u2D;m2D.warn=g2D});var NX=I((c2D)=>{var I5=BD(),KS=rD(),IX="<<",wX={identify:(D)=>D===IX||typeof D==="symbol"&&D.description===IX,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new KS.Scalar(Symbol(IX)),{addToJSMap:US}),stringify:()=>IX},l2D=(D,F)=>(wX.identify(F)||I5.isScalar(F)&&(!F.type||F.type===KS.Scalar.PLAIN)&&wX.identify(F.value))&&D?.doc.schema.tags.some(($)=>$.tag===wX.tag&&$.default);function US(D,F,$){if($=D&&I5.isAlias($)?$.resolve(D.doc):$,I5.isSeq($))for(let J of $.items)lU(D,F,J);else if(Array.isArray($))for(let J of $)lU(D,F,J);else lU(D,F,$)}function lU(D,F,$){let J=D&&I5.isAlias($)?$.resolve(D.doc):$;if(!I5.isMap(J))throw Error("Merge sources must be maps or map aliases");let Q=J.toJSON(null,D,Map);for(let[Z,X]of Q)if(F instanceof Map){if(!F.has(Z))F.set(Z,X)}else if(F instanceof Set)F.add(Z);else if(!Object.prototype.hasOwnProperty.call(F,Z))Object.defineProperty(F,Z,{value:X,writable:!0,enumerable:!0,configurable:!0});return F}c2D.addMergeToJSMap=US;c2D.isMergeKey=l2D;c2D.merge=wX});var nU=I((e2D)=>{var a2D=pU(),VS=NX(),r2D=R5(),HS=BD(),cU=zF();function s2D(D,F,{key:$,value:J}){if(HS.isNode($)&&$.addToJSMap)$.addToJSMap(D,F,J);else if(VS.isMergeKey(D,$))VS.addMergeToJSMap(D,F,J);else{let Q=cU.toJS($,"",D);if(F instanceof Map)F.set(Q,cU.toJS(J,Q,D));else if(F instanceof Set)F.add(Q);else{let Z=t2D($,Q,D),X=cU.toJS(J,Z,D);if(Z in F)Object.defineProperty(F,Z,{value:X,writable:!0,enumerable:!0,configurable:!0});else F[Z]=X}}return F}function t2D(D,F,$){if(F===null)return"";if(typeof F!=="object")return String(F);if(HS.isNode(D)&&$?.doc){let J=r2D.createStringifyContext($.doc,{});J.anchors=new Set;for(let Z of $.anchors.keys())J.anchors.add(Z.anchor);J.inFlow=!0,J.inStringifyKey=!0;let Q=D.toString(J);if(!$.mapKeyWarned){let Z=JSON.stringify(Q);if(Z.length>40)Z=Z.substring(0,36)+'..."';a2D.warn($.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${Z}. Set mapAsMap: true to use object keys.`),$.mapKeyWarned=!0}return Q}return JSON.stringify(F)}e2D.addPairToJSMap=s2D});var MF=I((Q8D)=>{var zS=_5(),F8D=BS(),$8D=nU(),TX=BD();function J8D(D,F,$){let J=zS.createNode(D,void 0,$),Q=zS.createNode(F,void 0,$);return new LX(J,Q)}class LX{constructor(D,F=null){Object.defineProperty(this,TX.NODE_TYPE,{value:TX.PAIR}),this.key=D,this.value=F}clone(D){let{key:F,value:$}=this;if(TX.isNode(F))F=F.clone(D);if(TX.isNode($))$=$.clone(D);return new LX(F,$)}toJSON(D,F){let $=F?.mapAsMap?new Map:{};return $8D.addPairToJSMap(F,$,this)}toString(D,F,$){return D?.doc?F8D.stringifyPair(this,D,F,$):JSON.stringify(this)}}Q8D.Pair=LX;Q8D.createPair=J8D});var iU=I((B8D)=>{var x3=BD(),CS=R5(),PX=M5();function Y8D(D,F,$){return(F.inFlow??D.flow?G8D:q8D)(D,F,$)}function q8D({comment:D,items:F},$,{blockItemPrefix:J,flowChars:Q,itemIndent:Z,onChompKeep:X,onComment:Y}){let{indent:q,options:{commentString:G}}=$,B=Object.assign({},$,{indent:Z,type:null}),W=!1,K=[];for(let V=0;V<F.length;++V){let H=F[V],z=null;if(x3.isNode(H)){if(!W&&H.spaceBefore)K.push("");if(jX($,K,H.commentBefore,W),H.comment)z=H.comment}else if(x3.isPair(H)){let O=x3.isNode(H.key)?H.key:null;if(O){if(!W&&O.spaceBefore)K.push("");jX($,K,O.commentBefore,W)}}W=!1;let _=CS.stringify(H,B,()=>z=null,()=>W=!0);if(z)_+=PX.lineComment(_,Z,G(z));if(W&&z)W=!1;K.push(J+_)}let U;if(K.length===0)U=Q.start+Q.end;else{U=K[0];for(let V=1;V<K.length;++V){let H=K[V];U+=H?`
138
+ `)A="";if(z+=A+E,$.inFlow){if(M&&J)J()}else if(C&&!M)z+=A5.lineComment(z,$.indent,G(C));else if(H&&Q)Q();return z}v2D.stringifyPair=b2D});var pU=w((m2D)=>{var WS=r("process");function u2D(D,...F){if(D==="debug")console.log(...F)}function g2D(D,F){if(D==="debug"||D==="warn")if(typeof WS.emitWarning==="function")WS.emitWarning(F);else console.warn(F)}m2D.debug=u2D;m2D.warn=g2D});var NX=w((c2D)=>{var I5=BD(),KS=rD(),IX="<<",wX={identify:(D)=>D===IX||typeof D==="symbol"&&D.description===IX,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new KS.Scalar(Symbol(IX)),{addToJSMap:US}),stringify:()=>IX},l2D=(D,F)=>(wX.identify(F)||I5.isScalar(F)&&(!F.type||F.type===KS.Scalar.PLAIN)&&wX.identify(F.value))&&D?.doc.schema.tags.some(($)=>$.tag===wX.tag&&$.default);function US(D,F,$){if($=D&&I5.isAlias($)?$.resolve(D.doc):$,I5.isSeq($))for(let J of $.items)lU(D,F,J);else if(Array.isArray($))for(let J of $)lU(D,F,J);else lU(D,F,$)}function lU(D,F,$){let J=D&&I5.isAlias($)?$.resolve(D.doc):$;if(!I5.isMap(J))throw Error("Merge sources must be maps or map aliases");let Q=J.toJSON(null,D,Map);for(let[Z,X]of Q)if(F instanceof Map){if(!F.has(Z))F.set(Z,X)}else if(F instanceof Set)F.add(Z);else if(!Object.prototype.hasOwnProperty.call(F,Z))Object.defineProperty(F,Z,{value:X,writable:!0,enumerable:!0,configurable:!0});return F}c2D.addMergeToJSMap=US;c2D.isMergeKey=l2D;c2D.merge=wX});var nU=w((e2D)=>{var a2D=pU(),VS=NX(),r2D=R5(),HS=BD(),cU=zF();function s2D(D,F,{key:$,value:J}){if(HS.isNode($)&&$.addToJSMap)$.addToJSMap(D,F,J);else if(VS.isMergeKey(D,$))VS.addMergeToJSMap(D,F,J);else{let Q=cU.toJS($,"",D);if(F instanceof Map)F.set(Q,cU.toJS(J,Q,D));else if(F instanceof Set)F.add(Q);else{let Z=t2D($,Q,D),X=cU.toJS(J,Z,D);if(Z in F)Object.defineProperty(F,Z,{value:X,writable:!0,enumerable:!0,configurable:!0});else F[Z]=X}}return F}function t2D(D,F,$){if(F===null)return"";if(typeof F!=="object")return String(F);if(HS.isNode(D)&&$?.doc){let J=r2D.createStringifyContext($.doc,{});J.anchors=new Set;for(let Z of $.anchors.keys())J.anchors.add(Z.anchor);J.inFlow=!0,J.inStringifyKey=!0;let Q=D.toString(J);if(!$.mapKeyWarned){let Z=JSON.stringify(Q);if(Z.length>40)Z=Z.substring(0,36)+'..."';a2D.warn($.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${Z}. Set mapAsMap: true to use object keys.`),$.mapKeyWarned=!0}return Q}return JSON.stringify(F)}e2D.addPairToJSMap=s2D});var MF=w((Q8D)=>{var zS=_5(),F8D=BS(),$8D=nU(),TX=BD();function J8D(D,F,$){let J=zS.createNode(D,void 0,$),Q=zS.createNode(F,void 0,$);return new LX(J,Q)}class LX{constructor(D,F=null){Object.defineProperty(this,TX.NODE_TYPE,{value:TX.PAIR}),this.key=D,this.value=F}clone(D){let{key:F,value:$}=this;if(TX.isNode(F))F=F.clone(D);if(TX.isNode($))$=$.clone(D);return new LX(F,$)}toJSON(D,F){let $=F?.mapAsMap?new Map:{};return $8D.addPairToJSMap(F,$,this)}toString(D,F,$){return D?.doc?F8D.stringifyPair(this,D,F,$):JSON.stringify(this)}}Q8D.Pair=LX;Q8D.createPair=J8D});var iU=w((B8D)=>{var x3=BD(),CS=R5(),PX=M5();function Y8D(D,F,$){return(F.inFlow??D.flow?G8D:q8D)(D,F,$)}function q8D({comment:D,items:F},$,{blockItemPrefix:J,flowChars:Q,itemIndent:Z,onChompKeep:X,onComment:Y}){let{indent:q,options:{commentString:G}}=$,B=Object.assign({},$,{indent:Z,type:null}),W=!1,K=[];for(let V=0;V<F.length;++V){let H=F[V],z=null;if(x3.isNode(H)){if(!W&&H.spaceBefore)K.push("");if(jX($,K,H.commentBefore,W),H.comment)z=H.comment}else if(x3.isPair(H)){let O=x3.isNode(H.key)?H.key:null;if(O){if(!W&&O.spaceBefore)K.push("");jX($,K,O.commentBefore,W)}}W=!1;let _=CS.stringify(H,B,()=>z=null,()=>W=!0);if(z)_+=PX.lineComment(_,Z,G(z));if(W&&z)W=!1;K.push(J+_)}let U;if(K.length===0)U=Q.start+Q.end;else{U=K[0];for(let V=1;V<K.length;++V){let H=K[V];U+=H?`
139
139
  ${q}${H}`:`
140
140
  `}}if(D){if(U+=`
141
141
  `+PX.indentComment(G(D),q),Y)Y()}else if(W&&X)X();return U}function G8D({items:D},F,{flowChars:$,itemIndent:J}){let{indent:Q,indentStep:Z,flowCollectionPadding:X,options:{commentString:Y}}=F;J+=Z;let q=Object.assign({},F,{indent:J,inFlow:!0,type:null}),G=!1,B=0,W=[];for(let V=0;V<D.length;++V){let H=D[V],z=null;if(x3.isNode(H)){if(H.spaceBefore)W.push("");if(jX(F,W,H.commentBefore,!1),H.comment)z=H.comment}else if(x3.isPair(H)){let O=x3.isNode(H.key)?H.key:null;if(O){if(O.spaceBefore)W.push("");if(jX(F,W,O.commentBefore,!1),O.comment)G=!0}let C=x3.isNode(H.value)?H.value:null;if(C){if(C.comment)z=C.comment;if(C.commentBefore)G=!0}else if(H.value==null&&O?.comment)z=O.comment}if(z)G=!0;let _=CS.stringify(H,q,()=>z=null);if(V<D.length-1)_+=",";if(z)_+=PX.lineComment(_,J,Y(z));if(!G&&(W.length>B||_.includes(`
142
142
  `)))G=!0;W.push(_),B=W.length}let{start:K,end:U}=$;if(W.length===0)return K+U;else{if(!G){let V=W.reduce((H,z)=>H+z.length+2,2);G=F.options.lineWidth>0&&V>F.options.lineWidth}if(G){let V=K;for(let H of W)V+=H?`
143
143
  ${Z}${Q}${H}`:`
144
144
  `;return`${V}
145
- ${Q}${U}`}else return`${K}${X}${W.join(" ")}${X}${U}`}}function jX({indent:D,options:{commentString:F}},$,J,Q){if(J&&Q)J=J.replace(/^\n+/,"");if(J){let Z=PX.indentComment(F(J),D);$.push(Z.trimStart())}}B8D.stringifyCollection=Y8D});var EF=I((z8D)=>{var K8D=iU(),U8D=nU(),V8D=OX(),OF=BD(),SX=MF(),H8D=rD();function w5(D,F){let $=OF.isScalar(F)?F.value:F;for(let J of D)if(OF.isPair(J)){if(J.key===F||J.key===$)return J;if(OF.isScalar(J.key)&&J.key.value===$)return J}return}class _S extends V8D.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(D){super(OF.MAP,D);this.items=[]}static from(D,F,$){let{keepUndefined:J,replacer:Q}=$,Z=new this(D),X=(Y,q)=>{if(typeof Q==="function")q=Q.call(F,Y,q);else if(Array.isArray(Q)&&!Q.includes(Y))return;if(q!==void 0||J)Z.items.push(SX.createPair(Y,q,$))};if(F instanceof Map)for(let[Y,q]of F)X(Y,q);else if(F&&typeof F==="object")for(let Y of Object.keys(F))X(Y,F[Y]);if(typeof D.sortMapEntries==="function")Z.items.sort(D.sortMapEntries);return Z}add(D,F){let $;if(OF.isPair(D))$=D;else if(!D||typeof D!=="object"||!("key"in D))$=new SX.Pair(D,D?.value);else $=new SX.Pair(D.key,D.value);let J=w5(this.items,$.key),Q=this.schema?.sortMapEntries;if(J){if(!F)throw Error(`Key ${$.key} already set`);if(OF.isScalar(J.value)&&H8D.isScalarValue($.value))J.value.value=$.value;else J.value=$.value}else if(Q){let Z=this.items.findIndex((X)=>Q($,X)<0);if(Z===-1)this.items.push($);else this.items.splice(Z,0,$)}else this.items.push($)}delete(D){let F=w5(this.items,D);if(!F)return!1;return this.items.splice(this.items.indexOf(F),1).length>0}get(D,F){let J=w5(this.items,D)?.value;return(!F&&OF.isScalar(J)?J.value:J)??void 0}has(D){return!!w5(this.items,D)}set(D,F){this.add(new SX.Pair(D,F),!0)}toJSON(D,F,$){let J=$?new $:F?.mapAsMap?new Map:{};if(F?.onCreate)F.onCreate(J);for(let Q of this.items)U8D.addPairToJSMap(F,J,Q);return J}toString(D,F,$){if(!D)return JSON.stringify(this);for(let J of this.items)if(!OF.isPair(J))throw Error(`Map items must all be pairs; found ${JSON.stringify(J)} instead`);if(!D.allNullValues&&this.hasAllNullValues(!1))D=Object.assign({},D,{allNullValues:!0});return K8D.stringifyCollection(this,D,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:D.indent||"",onChompKeep:$,onComment:F})}}z8D.YAMLMap=_S;z8D.findPair=w5});var e7=I((E8D)=>{var M8D=BD(),MS=EF(),O8D={collection:"map",default:!0,nodeClass:MS.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(D,F){if(!M8D.isMap(D))F("Expected a mapping for this tag");return D},createNode:(D,F,$)=>MS.YAMLMap.from(D,F,$)};E8D.map=O8D});var RF=I((L8D)=>{var A8D=_5(),I8D=iU(),w8D=OX(),kX=BD(),N8D=rD(),T8D=zF();class OS extends w8D.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(D){super(kX.SEQ,D);this.items=[]}add(D){this.items.push(D)}delete(D){let F=xX(D);if(typeof F!=="number")return!1;return this.items.splice(F,1).length>0}get(D,F){let $=xX(D);if(typeof $!=="number")return;let J=this.items[$];return!F&&kX.isScalar(J)?J.value:J}has(D){let F=xX(D);return typeof F==="number"&&F<this.items.length}set(D,F){let $=xX(D);if(typeof $!=="number")throw Error(`Expected a valid index, not ${D}.`);let J=this.items[$];if(kX.isScalar(J)&&N8D.isScalarValue(F))J.value=F;else this.items[$]=F}toJSON(D,F){let $=[];if(F?.onCreate)F.onCreate($);let J=0;for(let Q of this.items)$.push(T8D.toJS(Q,String(J++),F));return $}toString(D,F,$){if(!D)return JSON.stringify(this);return I8D.stringifyCollection(this,D,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(D.indent||"")+" ",onChompKeep:$,onComment:F})}static from(D,F,$){let{replacer:J}=$,Q=new this(D);if(F&&Symbol.iterator in Object(F)){let Z=0;for(let X of F){if(typeof J==="function"){let Y=F instanceof Set?X:String(Z++);X=J.call(F,Y,X)}Q.items.push(A8D.createNode(X,void 0,$))}}return Q}}function xX(D){let F=kX.isScalar(D)?D.value:D;if(F&&typeof F==="string")F=Number(F);return typeof F==="number"&&Number.isInteger(F)&&F>=0?F:null}L8D.YAMLSeq=OS});var D9=I((x8D)=>{var j8D=BD(),ES=RF(),S8D={collection:"seq",default:!0,nodeClass:ES.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(D,F){if(!j8D.isSeq(D))F("Expected a sequence for this tag");return D},createNode:(D,F,$)=>ES.YAMLSeq.from(D,F,$)};x8D.seq=S8D});var N5=I((b8D)=>{var y8D=E5(),f8D={identify:(D)=>typeof D==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(D)=>D,stringify(D,F,$,J){return F=Object.assign({actualString:!0},F),y8D.stringifyString(D,F,$,J)}};b8D.string=f8D});var yX=I((h8D)=>{var RS=rD(),AS={identify:(D)=>D==null,createNode:()=>new RS.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new RS.Scalar(null),stringify:({source:D},F)=>typeof D==="string"&&AS.test.test(D)?D:F.options.nullStr};h8D.nullTag=AS});var oU=I((m8D)=>{var g8D=rD(),IS={identify:(D)=>typeof D==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:(D)=>new g8D.Scalar(D[0]==="t"||D[0]==="T"),stringify({source:D,value:F},$){if(D&&IS.test.test(D)){let J=D[0]==="t"||D[0]==="T";if(F===J)return D}return F?$.options.trueStr:$.options.falseStr}};m8D.boolTag=IS});var F9=I((l8D)=>{function p8D({format:D,minFractionDigits:F,tag:$,value:J}){if(typeof J==="bigint")return String(J);let Q=typeof J==="number"?J:Number(J);if(!isFinite(Q))return isNaN(Q)?".nan":Q<0?"-.inf":".inf";let Z=Object.is(J,-0)?"-0":JSON.stringify(J);if(!D&&F&&(!$||$==="tag:yaml.org,2002:float")&&/^\d/.test(Z)){let X=Z.indexOf(".");if(X<0)X=Z.length,Z+=".";let Y=F-(Z.length-X-1);while(Y-- >0)Z+="0"}return Z}l8D.stringifyNumber=p8D});var rU=I((r8D)=>{var n8D=rD(),aU=F9(),i8D={identify:(D)=>typeof D==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(D)=>D.slice(-3).toLowerCase()==="nan"?NaN:D[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:aU.stringifyNumber},o8D={identify:(D)=>typeof D==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:(D)=>parseFloat(D),stringify(D){let F=Number(D.value);return isFinite(F)?F.toExponential():aU.stringifyNumber(D)}},a8D={identify:(D)=>typeof D==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(D){let F=new n8D.Scalar(parseFloat(D)),$=D.indexOf(".");if($!==-1&&D[D.length-1]==="0")F.minFractionDigits=D.length-$-1;return F},stringify:aU.stringifyNumber};r8D.float=a8D;r8D.floatExp=o8D;r8D.floatNaN=i8D});var tU=I((J1D)=>{var wS=F9(),fX=(D)=>typeof D==="bigint"||Number.isInteger(D),sU=(D,F,$,{intAsBigInt:J})=>J?BigInt(D):parseInt(D.substring(F),$);function NS(D,F,$){let{value:J}=D;if(fX(J)&&J>=0)return $+J.toString(F);return wS.stringifyNumber(D)}var D1D={identify:(D)=>fX(D)&&D>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(D,F,$)=>sU(D,2,8,$),stringify:(D)=>NS(D,8,"0o")},F1D={identify:fX,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(D,F,$)=>sU(D,0,10,$),stringify:wS.stringifyNumber},$1D={identify:(D)=>fX(D)&&D>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(D,F,$)=>sU(D,2,16,$),stringify:(D)=>NS(D,16,"0x")};J1D.int=F1D;J1D.intHex=$1D;J1D.intOct=D1D});var TS=I((U1D)=>{var Y1D=e7(),q1D=yX(),G1D=D9(),B1D=N5(),W1D=oU(),eU=rU(),DV=tU(),K1D=[Y1D.map,G1D.seq,B1D.string,q1D.nullTag,W1D.boolTag,DV.intOct,DV.int,DV.intHex,eU.floatNaN,eU.floatExp,eU.float];U1D.schema=K1D});var PS=I((E1D)=>{var H1D=rD(),z1D=e7(),C1D=D9();function LS(D){return typeof D==="bigint"||Number.isInteger(D)}var bX=({value:D})=>JSON.stringify(D),_1D=[{identify:(D)=>typeof D==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(D)=>D,stringify:bX},{identify:(D)=>D==null,createNode:()=>new H1D.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:bX},{identify:(D)=>typeof D==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:(D)=>D==="true",stringify:bX},{identify:LS,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(D,F,{intAsBigInt:$})=>$?BigInt(D):parseInt(D,10),stringify:({value:D})=>LS(D)?D.toString():JSON.stringify(D)},{identify:(D)=>typeof D==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:(D)=>parseFloat(D),stringify:bX}],M1D={default:!0,tag:"",test:/^/,resolve(D,F){return F(`Unresolved plain scalar ${JSON.stringify(D)}`),D}},O1D=[z1D.map,C1D.seq].concat(_1D,M1D);E1D.schema=O1D});var $V=I((w1D)=>{var T5=r("buffer"),FV=rD(),A1D=E5(),I1D={identify:(D)=>D instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(D,F){if(typeof T5.Buffer==="function")return T5.Buffer.from(D,"base64");else if(typeof atob==="function"){let $=atob(D.replace(/[\n\r]/g,"")),J=new Uint8Array($.length);for(let Q=0;Q<$.length;++Q)J[Q]=$.charCodeAt(Q);return J}else return F("This environment does not support reading binary tags; either Buffer or atob is required"),D},stringify({comment:D,type:F,value:$},J,Q,Z){if(!$)return"";let X=$,Y;if(typeof T5.Buffer==="function")Y=X instanceof T5.Buffer?X.toString("base64"):T5.Buffer.from(X.buffer).toString("base64");else if(typeof btoa==="function"){let q="";for(let G=0;G<X.length;++G)q+=String.fromCharCode(X[G]);Y=btoa(q)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(F??(F=FV.Scalar.BLOCK_LITERAL),F!==FV.Scalar.QUOTE_DOUBLE){let q=Math.max(J.options.lineWidth-J.indent.length,J.options.minContentWidth),G=Math.ceil(Y.length/q),B=Array(G);for(let W=0,K=0;W<G;++W,K+=q)B[W]=Y.substr(K,q);Y=B.join(F===FV.Scalar.BLOCK_LITERAL?`
146
- `:" ")}return A1D.stringifyString({comment:D,type:F,value:Y},J,Q,Z)}};w1D.binary=I1D});var hX=I((j1D)=>{var vX=BD(),JV=MF(),T1D=rD(),L1D=RF();function jS(D,F){if(vX.isSeq(D))for(let $=0;$<D.items.length;++$){let J=D.items[$];if(vX.isPair(J))continue;else if(vX.isMap(J)){if(J.items.length>1)F("Each pair must have its own sequence indicator");let Q=J.items[0]||new JV.Pair(new T1D.Scalar(null));if(J.commentBefore)Q.key.commentBefore=Q.key.commentBefore?`${J.commentBefore}
145
+ ${Q}${U}`}else return`${K}${X}${W.join(" ")}${X}${U}`}}function jX({indent:D,options:{commentString:F}},$,J,Q){if(J&&Q)J=J.replace(/^\n+/,"");if(J){let Z=PX.indentComment(F(J),D);$.push(Z.trimStart())}}B8D.stringifyCollection=Y8D});var EF=w((z8D)=>{var K8D=iU(),U8D=nU(),V8D=OX(),OF=BD(),SX=MF(),H8D=rD();function w5(D,F){let $=OF.isScalar(F)?F.value:F;for(let J of D)if(OF.isPair(J)){if(J.key===F||J.key===$)return J;if(OF.isScalar(J.key)&&J.key.value===$)return J}return}class _S extends V8D.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(D){super(OF.MAP,D);this.items=[]}static from(D,F,$){let{keepUndefined:J,replacer:Q}=$,Z=new this(D),X=(Y,q)=>{if(typeof Q==="function")q=Q.call(F,Y,q);else if(Array.isArray(Q)&&!Q.includes(Y))return;if(q!==void 0||J)Z.items.push(SX.createPair(Y,q,$))};if(F instanceof Map)for(let[Y,q]of F)X(Y,q);else if(F&&typeof F==="object")for(let Y of Object.keys(F))X(Y,F[Y]);if(typeof D.sortMapEntries==="function")Z.items.sort(D.sortMapEntries);return Z}add(D,F){let $;if(OF.isPair(D))$=D;else if(!D||typeof D!=="object"||!("key"in D))$=new SX.Pair(D,D?.value);else $=new SX.Pair(D.key,D.value);let J=w5(this.items,$.key),Q=this.schema?.sortMapEntries;if(J){if(!F)throw Error(`Key ${$.key} already set`);if(OF.isScalar(J.value)&&H8D.isScalarValue($.value))J.value.value=$.value;else J.value=$.value}else if(Q){let Z=this.items.findIndex((X)=>Q($,X)<0);if(Z===-1)this.items.push($);else this.items.splice(Z,0,$)}else this.items.push($)}delete(D){let F=w5(this.items,D);if(!F)return!1;return this.items.splice(this.items.indexOf(F),1).length>0}get(D,F){let J=w5(this.items,D)?.value;return(!F&&OF.isScalar(J)?J.value:J)??void 0}has(D){return!!w5(this.items,D)}set(D,F){this.add(new SX.Pair(D,F),!0)}toJSON(D,F,$){let J=$?new $:F?.mapAsMap?new Map:{};if(F?.onCreate)F.onCreate(J);for(let Q of this.items)U8D.addPairToJSMap(F,J,Q);return J}toString(D,F,$){if(!D)return JSON.stringify(this);for(let J of this.items)if(!OF.isPair(J))throw Error(`Map items must all be pairs; found ${JSON.stringify(J)} instead`);if(!D.allNullValues&&this.hasAllNullValues(!1))D=Object.assign({},D,{allNullValues:!0});return K8D.stringifyCollection(this,D,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:D.indent||"",onChompKeep:$,onComment:F})}}z8D.YAMLMap=_S;z8D.findPair=w5});var e7=w((E8D)=>{var M8D=BD(),MS=EF(),O8D={collection:"map",default:!0,nodeClass:MS.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(D,F){if(!M8D.isMap(D))F("Expected a mapping for this tag");return D},createNode:(D,F,$)=>MS.YAMLMap.from(D,F,$)};E8D.map=O8D});var RF=w((L8D)=>{var A8D=_5(),I8D=iU(),w8D=OX(),kX=BD(),N8D=rD(),T8D=zF();class OS extends w8D.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(D){super(kX.SEQ,D);this.items=[]}add(D){this.items.push(D)}delete(D){let F=xX(D);if(typeof F!=="number")return!1;return this.items.splice(F,1).length>0}get(D,F){let $=xX(D);if(typeof $!=="number")return;let J=this.items[$];return!F&&kX.isScalar(J)?J.value:J}has(D){let F=xX(D);return typeof F==="number"&&F<this.items.length}set(D,F){let $=xX(D);if(typeof $!=="number")throw Error(`Expected a valid index, not ${D}.`);let J=this.items[$];if(kX.isScalar(J)&&N8D.isScalarValue(F))J.value=F;else this.items[$]=F}toJSON(D,F){let $=[];if(F?.onCreate)F.onCreate($);let J=0;for(let Q of this.items)$.push(T8D.toJS(Q,String(J++),F));return $}toString(D,F,$){if(!D)return JSON.stringify(this);return I8D.stringifyCollection(this,D,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(D.indent||"")+" ",onChompKeep:$,onComment:F})}static from(D,F,$){let{replacer:J}=$,Q=new this(D);if(F&&Symbol.iterator in Object(F)){let Z=0;for(let X of F){if(typeof J==="function"){let Y=F instanceof Set?X:String(Z++);X=J.call(F,Y,X)}Q.items.push(A8D.createNode(X,void 0,$))}}return Q}}function xX(D){let F=kX.isScalar(D)?D.value:D;if(F&&typeof F==="string")F=Number(F);return typeof F==="number"&&Number.isInteger(F)&&F>=0?F:null}L8D.YAMLSeq=OS});var D9=w((x8D)=>{var j8D=BD(),ES=RF(),S8D={collection:"seq",default:!0,nodeClass:ES.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(D,F){if(!j8D.isSeq(D))F("Expected a sequence for this tag");return D},createNode:(D,F,$)=>ES.YAMLSeq.from(D,F,$)};x8D.seq=S8D});var N5=w((b8D)=>{var y8D=E5(),f8D={identify:(D)=>typeof D==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(D)=>D,stringify(D,F,$,J){return F=Object.assign({actualString:!0},F),y8D.stringifyString(D,F,$,J)}};b8D.string=f8D});var yX=w((h8D)=>{var RS=rD(),AS={identify:(D)=>D==null,createNode:()=>new RS.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new RS.Scalar(null),stringify:({source:D},F)=>typeof D==="string"&&AS.test.test(D)?D:F.options.nullStr};h8D.nullTag=AS});var oU=w((m8D)=>{var g8D=rD(),IS={identify:(D)=>typeof D==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:(D)=>new g8D.Scalar(D[0]==="t"||D[0]==="T"),stringify({source:D,value:F},$){if(D&&IS.test.test(D)){let J=D[0]==="t"||D[0]==="T";if(F===J)return D}return F?$.options.trueStr:$.options.falseStr}};m8D.boolTag=IS});var F9=w((l8D)=>{function p8D({format:D,minFractionDigits:F,tag:$,value:J}){if(typeof J==="bigint")return String(J);let Q=typeof J==="number"?J:Number(J);if(!isFinite(Q))return isNaN(Q)?".nan":Q<0?"-.inf":".inf";let Z=Object.is(J,-0)?"-0":JSON.stringify(J);if(!D&&F&&(!$||$==="tag:yaml.org,2002:float")&&/^\d/.test(Z)){let X=Z.indexOf(".");if(X<0)X=Z.length,Z+=".";let Y=F-(Z.length-X-1);while(Y-- >0)Z+="0"}return Z}l8D.stringifyNumber=p8D});var rU=w((r8D)=>{var n8D=rD(),aU=F9(),i8D={identify:(D)=>typeof D==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(D)=>D.slice(-3).toLowerCase()==="nan"?NaN:D[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:aU.stringifyNumber},o8D={identify:(D)=>typeof D==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:(D)=>parseFloat(D),stringify(D){let F=Number(D.value);return isFinite(F)?F.toExponential():aU.stringifyNumber(D)}},a8D={identify:(D)=>typeof D==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(D){let F=new n8D.Scalar(parseFloat(D)),$=D.indexOf(".");if($!==-1&&D[D.length-1]==="0")F.minFractionDigits=D.length-$-1;return F},stringify:aU.stringifyNumber};r8D.float=a8D;r8D.floatExp=o8D;r8D.floatNaN=i8D});var tU=w((J1D)=>{var wS=F9(),fX=(D)=>typeof D==="bigint"||Number.isInteger(D),sU=(D,F,$,{intAsBigInt:J})=>J?BigInt(D):parseInt(D.substring(F),$);function NS(D,F,$){let{value:J}=D;if(fX(J)&&J>=0)return $+J.toString(F);return wS.stringifyNumber(D)}var D1D={identify:(D)=>fX(D)&&D>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(D,F,$)=>sU(D,2,8,$),stringify:(D)=>NS(D,8,"0o")},F1D={identify:fX,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(D,F,$)=>sU(D,0,10,$),stringify:wS.stringifyNumber},$1D={identify:(D)=>fX(D)&&D>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(D,F,$)=>sU(D,2,16,$),stringify:(D)=>NS(D,16,"0x")};J1D.int=F1D;J1D.intHex=$1D;J1D.intOct=D1D});var TS=w((U1D)=>{var Y1D=e7(),q1D=yX(),G1D=D9(),B1D=N5(),W1D=oU(),eU=rU(),DV=tU(),K1D=[Y1D.map,G1D.seq,B1D.string,q1D.nullTag,W1D.boolTag,DV.intOct,DV.int,DV.intHex,eU.floatNaN,eU.floatExp,eU.float];U1D.schema=K1D});var PS=w((E1D)=>{var H1D=rD(),z1D=e7(),C1D=D9();function LS(D){return typeof D==="bigint"||Number.isInteger(D)}var bX=({value:D})=>JSON.stringify(D),_1D=[{identify:(D)=>typeof D==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(D)=>D,stringify:bX},{identify:(D)=>D==null,createNode:()=>new H1D.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:bX},{identify:(D)=>typeof D==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:(D)=>D==="true",stringify:bX},{identify:LS,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(D,F,{intAsBigInt:$})=>$?BigInt(D):parseInt(D,10),stringify:({value:D})=>LS(D)?D.toString():JSON.stringify(D)},{identify:(D)=>typeof D==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:(D)=>parseFloat(D),stringify:bX}],M1D={default:!0,tag:"",test:/^/,resolve(D,F){return F(`Unresolved plain scalar ${JSON.stringify(D)}`),D}},O1D=[z1D.map,C1D.seq].concat(_1D,M1D);E1D.schema=O1D});var $V=w((w1D)=>{var T5=r("buffer"),FV=rD(),A1D=E5(),I1D={identify:(D)=>D instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(D,F){if(typeof T5.Buffer==="function")return T5.Buffer.from(D,"base64");else if(typeof atob==="function"){let $=atob(D.replace(/[\n\r]/g,"")),J=new Uint8Array($.length);for(let Q=0;Q<$.length;++Q)J[Q]=$.charCodeAt(Q);return J}else return F("This environment does not support reading binary tags; either Buffer or atob is required"),D},stringify({comment:D,type:F,value:$},J,Q,Z){if(!$)return"";let X=$,Y;if(typeof T5.Buffer==="function")Y=X instanceof T5.Buffer?X.toString("base64"):T5.Buffer.from(X.buffer).toString("base64");else if(typeof btoa==="function"){let q="";for(let G=0;G<X.length;++G)q+=String.fromCharCode(X[G]);Y=btoa(q)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(F??(F=FV.Scalar.BLOCK_LITERAL),F!==FV.Scalar.QUOTE_DOUBLE){let q=Math.max(J.options.lineWidth-J.indent.length,J.options.minContentWidth),G=Math.ceil(Y.length/q),B=Array(G);for(let W=0,K=0;W<G;++W,K+=q)B[W]=Y.substr(K,q);Y=B.join(F===FV.Scalar.BLOCK_LITERAL?`
146
+ `:" ")}return A1D.stringifyString({comment:D,type:F,value:Y},J,Q,Z)}};w1D.binary=I1D});var hX=w((j1D)=>{var vX=BD(),JV=MF(),T1D=rD(),L1D=RF();function jS(D,F){if(vX.isSeq(D))for(let $=0;$<D.items.length;++$){let J=D.items[$];if(vX.isPair(J))continue;else if(vX.isMap(J)){if(J.items.length>1)F("Each pair must have its own sequence indicator");let Q=J.items[0]||new JV.Pair(new T1D.Scalar(null));if(J.commentBefore)Q.key.commentBefore=Q.key.commentBefore?`${J.commentBefore}
147
147
  ${Q.key.commentBefore}`:J.commentBefore;if(J.comment){let Z=Q.value??Q.key;Z.comment=Z.comment?`${J.comment}
148
- ${Z.comment}`:J.comment}J=Q}D.items[$]=vX.isPair(J)?J:new JV.Pair(J)}else F("Expected a sequence for this tag");return D}function SS(D,F,$){let{replacer:J}=$,Q=new L1D.YAMLSeq(D);Q.tag="tag:yaml.org,2002:pairs";let Z=0;if(F&&Symbol.iterator in Object(F))for(let X of F){if(typeof J==="function")X=J.call(F,String(Z++),X);let Y,q;if(Array.isArray(X))if(X.length===2)Y=X[0],q=X[1];else throw TypeError(`Expected [key, value] tuple: ${X}`);else if(X&&X instanceof Object){let G=Object.keys(X);if(G.length===1)Y=G[0],q=X[Y];else throw TypeError(`Expected tuple with one key, not ${G.length} keys`)}else Y=X;Q.items.push(JV.createPair(Y,q,$))}return Q}var P1D={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:jS,createNode:SS};j1D.createPairs=SS;j1D.pairs=P1D;j1D.resolvePairs=jS});var ZV=I((b1D)=>{var xS=BD(),QV=zF(),L5=EF(),y1D=RF(),kS=hX();class k3 extends y1D.YAMLSeq{constructor(){super();this.add=L5.YAMLMap.prototype.add.bind(this),this.delete=L5.YAMLMap.prototype.delete.bind(this),this.get=L5.YAMLMap.prototype.get.bind(this),this.has=L5.YAMLMap.prototype.has.bind(this),this.set=L5.YAMLMap.prototype.set.bind(this),this.tag=k3.tag}toJSON(D,F){if(!F)return super.toJSON(D);let $=new Map;if(F?.onCreate)F.onCreate($);for(let J of this.items){let Q,Z;if(xS.isPair(J))Q=QV.toJS(J.key,"",F),Z=QV.toJS(J.value,Q,F);else Q=QV.toJS(J,"",F);if($.has(Q))throw Error("Ordered maps must not include duplicate keys");$.set(Q,Z)}return $}static from(D,F,$){let J=kS.createPairs(D,F,$),Q=new this;return Q.items=J.items,Q}}k3.tag="tag:yaml.org,2002:omap";var f1D={collection:"seq",identify:(D)=>D instanceof Map,nodeClass:k3,default:!1,tag:"tag:yaml.org,2002:omap",resolve(D,F){let $=kS.resolvePairs(D,F),J=[];for(let{key:Q}of $.items)if(xS.isScalar(Q))if(J.includes(Q.value))F(`Ordered maps must not include duplicate keys: ${Q.value}`);else J.push(Q.value);return Object.assign(new k3,$)},createNode:(D,F,$)=>k3.from(D,F,$)};b1D.YAMLOMap=k3;b1D.omap=f1D});var hS=I((u1D)=>{var yS=rD();function fS({value:D,source:F},$){if(F&&(D?bS:vS).test.test(F))return F;return D?$.options.trueStr:$.options.falseStr}var bS={identify:(D)=>D===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new yS.Scalar(!0),stringify:fS},vS={identify:(D)=>D===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new yS.Scalar(!1),stringify:fS};u1D.falseTag=vS;u1D.trueTag=bS});var uS=I((n1D)=>{var d1D=rD(),XV=F9(),p1D={identify:(D)=>typeof D==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(D)=>D.slice(-3).toLowerCase()==="nan"?NaN:D[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:XV.stringifyNumber},l1D={identify:(D)=>typeof D==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:(D)=>parseFloat(D.replace(/_/g,"")),stringify(D){let F=Number(D.value);return isFinite(F)?F.toExponential():XV.stringifyNumber(D)}},c1D={identify:(D)=>typeof D==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(D){let F=new d1D.Scalar(parseFloat(D.replace(/_/g,""))),$=D.indexOf(".");if($!==-1){let J=D.substring($+1).replace(/_/g,"");if(J[J.length-1]==="0")F.minFractionDigits=J.length}return F},stringify:XV.stringifyNumber};n1D.float=c1D;n1D.floatExp=l1D;n1D.floatNaN=p1D});var mS=I((DFD)=>{var gS=F9(),P5=(D)=>typeof D==="bigint"||Number.isInteger(D);function uX(D,F,$,{intAsBigInt:J}){let Q=D[0];if(Q==="-"||Q==="+")F+=1;if(D=D.substring(F).replace(/_/g,""),J){switch($){case 2:D=`0b${D}`;break;case 8:D=`0o${D}`;break;case 16:D=`0x${D}`;break}let X=BigInt(D);return Q==="-"?BigInt(-1)*X:X}let Z=parseInt(D,$);return Q==="-"?-1*Z:Z}function YV(D,F,$){let{value:J}=D;if(P5(J)){let Q=J.toString(F);return J<0?"-"+$+Q.substr(1):$+Q}return gS.stringifyNumber(D)}var r1D={identify:P5,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(D,F,$)=>uX(D,2,2,$),stringify:(D)=>YV(D,2,"0b")},s1D={identify:P5,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(D,F,$)=>uX(D,1,8,$),stringify:(D)=>YV(D,8,"0")},t1D={identify:P5,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(D,F,$)=>uX(D,0,10,$),stringify:gS.stringifyNumber},e1D={identify:P5,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(D,F,$)=>uX(D,2,16,$),stringify:(D)=>YV(D,16,"0x")};DFD.int=t1D;DFD.intBin=r1D;DFD.intHex=e1D;DFD.intOct=s1D});var qV=I((XFD)=>{var dX=BD(),gX=MF(),mX=EF();class y3 extends mX.YAMLMap{constructor(D){super(D);this.tag=y3.tag}add(D){let F;if(dX.isPair(D))F=D;else if(D&&typeof D==="object"&&"key"in D&&"value"in D&&D.value===null)F=new gX.Pair(D.key,null);else F=new gX.Pair(D,null);if(!mX.findPair(this.items,F.key))this.items.push(F)}get(D,F){let $=mX.findPair(this.items,D);return!F&&dX.isPair($)?dX.isScalar($.key)?$.key.value:$.key:$}set(D,F){if(typeof F!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof F}`);let $=mX.findPair(this.items,D);if($&&!F)this.items.splice(this.items.indexOf($),1);else if(!$&&F)this.items.push(new gX.Pair(D))}toJSON(D,F){return super.toJSON(D,F,Set)}toString(D,F,$){if(!D)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},D,{allNullValues:!0}),F,$);else throw Error("Set items must all have null values")}static from(D,F,$){let{replacer:J}=$,Q=new this(D);if(F&&Symbol.iterator in Object(F))for(let Z of F){if(typeof J==="function")Z=J.call(F,Z,Z);Q.items.push(gX.createPair(Z,null,$))}return Q}}y3.tag="tag:yaml.org,2002:set";var ZFD={collection:"map",identify:(D)=>D instanceof Set,nodeClass:y3,default:!1,tag:"tag:yaml.org,2002:set",createNode:(D,F,$)=>y3.from(D,F,$),resolve(D,F){if(dX.isMap(D))if(D.hasAllNullValues(!0))return Object.assign(new y3,D);else F("Set items must all have null values");else F("Expected a mapping for this tag");return D}};XFD.YAMLSet=y3;XFD.set=ZFD});var BV=I((KFD)=>{var GFD=F9();function GV(D,F){let $=D[0],J=$==="-"||$==="+"?D.substring(1):D,Q=(X)=>F?BigInt(X):Number(X),Z=J.replace(/_/g,"").split(":").reduce((X,Y)=>X*Q(60)+Q(Y),Q(0));return $==="-"?Q(-1)*Z:Z}function dS(D){let{value:F}=D,$=(X)=>X;if(typeof F==="bigint")$=(X)=>BigInt(X);else if(isNaN(F)||!isFinite(F))return GFD.stringifyNumber(D);let J="";if(F<0)J="-",F*=$(-1);let Q=$(60),Z=[F%Q];if(F<60)Z.unshift(0);else if(F=(F-Z[0])/Q,Z.unshift(F%Q),F>=60)F=(F-Z[0])/Q,Z.unshift(F);return J+Z.map((X)=>String(X).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var BFD={identify:(D)=>typeof D==="bigint"||Number.isInteger(D),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(D,F,{intAsBigInt:$})=>GV(D,$),stringify:dS},WFD={identify:(D)=>typeof D==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:(D)=>GV(D,!1),stringify:dS},pS={identify:(D)=>D 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(D){let F=D.match(pS.test);if(!F)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,$,J,Q,Z,X,Y]=F.map(Number),q=F[7]?Number((F[7]+"00").substr(1,3)):0,G=Date.UTC($,J-1,Q,Z||0,X||0,Y||0,q),B=F[8];if(B&&B!=="Z"){let W=GV(B,!1);if(Math.abs(W)<30)W*=60;G-=60000*W}return new Date(G)},stringify:({value:D})=>D?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};KFD.floatTime=WFD;KFD.intTime=BFD;KFD.timestamp=pS});var cS=I((NFD)=>{var zFD=e7(),CFD=yX(),_FD=D9(),MFD=N5(),OFD=$V(),lS=hS(),WV=uS(),pX=mS(),EFD=NX(),RFD=ZV(),AFD=hX(),IFD=qV(),KV=BV(),wFD=[zFD.map,_FD.seq,MFD.string,CFD.nullTag,lS.trueTag,lS.falseTag,pX.intBin,pX.intOct,pX.int,pX.intHex,WV.floatNaN,WV.floatExp,WV.float,OFD.binary,EFD.merge,RFD.omap,AFD.pairs,IFD.set,KV.intTime,KV.floatTime,KV.timestamp];NFD.schema=wFD});var Fx=I((fFD)=>{var aS=e7(),LFD=yX(),rS=D9(),PFD=N5(),jFD=oU(),UV=rU(),VV=tU(),SFD=TS(),xFD=PS(),sS=$V(),j5=NX(),tS=ZV(),eS=hX(),nS=cS(),Dx=qV(),lX=BV(),iS=new Map([["core",SFD.schema],["failsafe",[aS.map,rS.seq,PFD.string]],["json",xFD.schema],["yaml11",nS.schema],["yaml-1.1",nS.schema]]),oS={binary:sS.binary,bool:jFD.boolTag,float:UV.float,floatExp:UV.floatExp,floatNaN:UV.floatNaN,floatTime:lX.floatTime,int:VV.int,intHex:VV.intHex,intOct:VV.intOct,intTime:lX.intTime,map:aS.map,merge:j5.merge,null:LFD.nullTag,omap:tS.omap,pairs:eS.pairs,seq:rS.seq,set:Dx.set,timestamp:lX.timestamp},kFD={"tag:yaml.org,2002:binary":sS.binary,"tag:yaml.org,2002:merge":j5.merge,"tag:yaml.org,2002:omap":tS.omap,"tag:yaml.org,2002:pairs":eS.pairs,"tag:yaml.org,2002:set":Dx.set,"tag:yaml.org,2002:timestamp":lX.timestamp};function yFD(D,F,$){let J=iS.get(F);if(J&&!D)return $&&!J.includes(j5.merge)?J.concat(j5.merge):J.slice();let Q=J;if(!Q)if(Array.isArray(D))Q=[];else{let Z=Array.from(iS.keys()).filter((X)=>X!=="yaml11").map((X)=>JSON.stringify(X)).join(", ");throw Error(`Unknown schema "${F}"; use one of ${Z} or define customTags array`)}if(Array.isArray(D))for(let Z of D)Q=Q.concat(Z);else if(typeof D==="function")Q=D(Q.slice());if($)Q=Q.concat(j5.merge);return Q.reduce((Z,X)=>{let Y=typeof X==="string"?oS[X]:X;if(!Y){let q=JSON.stringify(X),G=Object.keys(oS).map((B)=>JSON.stringify(B)).join(", ");throw Error(`Unknown custom tag ${q}; use one of ${G}`)}if(!Z.includes(Y))Z.push(Y);return Z},[])}fFD.coreKnownTags=kFD;fFD.getTags=yFD});var CV=I((dFD)=>{var HV=BD(),hFD=e7(),uFD=D9(),gFD=N5(),cX=Fx(),mFD=(D,F)=>D.key<F.key?-1:D.key>F.key?1:0;class zV{constructor({compat:D,customTags:F,merge:$,resolveKnownTags:J,schema:Q,sortMapEntries:Z,toStringDefaults:X}){this.compat=Array.isArray(D)?cX.getTags(D,"compat"):D?cX.getTags(null,D):null,this.name=typeof Q==="string"&&Q||"core",this.knownTags=J?cX.coreKnownTags:{},this.tags=cX.getTags(F,this.name,$),this.toStringOptions=X??null,Object.defineProperty(this,HV.MAP,{value:hFD.map}),Object.defineProperty(this,HV.SCALAR,{value:gFD.string}),Object.defineProperty(this,HV.SEQ,{value:uFD.seq}),this.sortMapEntries=typeof Z==="function"?Z:Z===!0?mFD:null}clone(){let D=Object.create(zV.prototype,Object.getOwnPropertyDescriptors(this));return D.tags=this.tags.slice(),D}}dFD.Schema=zV});var $x=I((nFD)=>{var lFD=BD(),_V=R5(),S5=M5();function cFD(D,F){let $=[],J=F.directives===!0;if(F.directives!==!1&&D.directives){let q=D.directives.toString(D);if(q)$.push(q),J=!0;else if(D.directives.docStart)J=!0}if(J)$.push("---");let Q=_V.createStringifyContext(D,F),{commentString:Z}=Q.options;if(D.commentBefore){if($.length!==1)$.unshift("");let q=Z(D.commentBefore);$.unshift(S5.indentComment(q,""))}let X=!1,Y=null;if(D.contents){if(lFD.isNode(D.contents)){if(D.contents.spaceBefore&&J)$.push("");if(D.contents.commentBefore){let B=Z(D.contents.commentBefore);$.push(S5.indentComment(B,""))}Q.forceBlockIndent=!!D.comment,Y=D.contents.comment}let q=Y?void 0:()=>X=!0,G=_V.stringify(D.contents,Q,()=>Y=null,q);if(Y)G+=S5.lineComment(G,"",Z(Y));if((G[0]==="|"||G[0]===">")&&$[$.length-1]==="---")$[$.length-1]=`--- ${G}`;else $.push(G)}else $.push(_V.stringify(D.contents,Q));if(D.directives?.docEnd)if(D.comment){let q=Z(D.comment);if(q.includes(`
148
+ ${Z.comment}`:J.comment}J=Q}D.items[$]=vX.isPair(J)?J:new JV.Pair(J)}else F("Expected a sequence for this tag");return D}function SS(D,F,$){let{replacer:J}=$,Q=new L1D.YAMLSeq(D);Q.tag="tag:yaml.org,2002:pairs";let Z=0;if(F&&Symbol.iterator in Object(F))for(let X of F){if(typeof J==="function")X=J.call(F,String(Z++),X);let Y,q;if(Array.isArray(X))if(X.length===2)Y=X[0],q=X[1];else throw TypeError(`Expected [key, value] tuple: ${X}`);else if(X&&X instanceof Object){let G=Object.keys(X);if(G.length===1)Y=G[0],q=X[Y];else throw TypeError(`Expected tuple with one key, not ${G.length} keys`)}else Y=X;Q.items.push(JV.createPair(Y,q,$))}return Q}var P1D={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:jS,createNode:SS};j1D.createPairs=SS;j1D.pairs=P1D;j1D.resolvePairs=jS});var ZV=w((b1D)=>{var xS=BD(),QV=zF(),L5=EF(),y1D=RF(),kS=hX();class k3 extends y1D.YAMLSeq{constructor(){super();this.add=L5.YAMLMap.prototype.add.bind(this),this.delete=L5.YAMLMap.prototype.delete.bind(this),this.get=L5.YAMLMap.prototype.get.bind(this),this.has=L5.YAMLMap.prototype.has.bind(this),this.set=L5.YAMLMap.prototype.set.bind(this),this.tag=k3.tag}toJSON(D,F){if(!F)return super.toJSON(D);let $=new Map;if(F?.onCreate)F.onCreate($);for(let J of this.items){let Q,Z;if(xS.isPair(J))Q=QV.toJS(J.key,"",F),Z=QV.toJS(J.value,Q,F);else Q=QV.toJS(J,"",F);if($.has(Q))throw Error("Ordered maps must not include duplicate keys");$.set(Q,Z)}return $}static from(D,F,$){let J=kS.createPairs(D,F,$),Q=new this;return Q.items=J.items,Q}}k3.tag="tag:yaml.org,2002:omap";var f1D={collection:"seq",identify:(D)=>D instanceof Map,nodeClass:k3,default:!1,tag:"tag:yaml.org,2002:omap",resolve(D,F){let $=kS.resolvePairs(D,F),J=[];for(let{key:Q}of $.items)if(xS.isScalar(Q))if(J.includes(Q.value))F(`Ordered maps must not include duplicate keys: ${Q.value}`);else J.push(Q.value);return Object.assign(new k3,$)},createNode:(D,F,$)=>k3.from(D,F,$)};b1D.YAMLOMap=k3;b1D.omap=f1D});var hS=w((u1D)=>{var yS=rD();function fS({value:D,source:F},$){if(F&&(D?bS:vS).test.test(F))return F;return D?$.options.trueStr:$.options.falseStr}var bS={identify:(D)=>D===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new yS.Scalar(!0),stringify:fS},vS={identify:(D)=>D===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new yS.Scalar(!1),stringify:fS};u1D.falseTag=vS;u1D.trueTag=bS});var uS=w((n1D)=>{var d1D=rD(),XV=F9(),p1D={identify:(D)=>typeof D==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(D)=>D.slice(-3).toLowerCase()==="nan"?NaN:D[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:XV.stringifyNumber},l1D={identify:(D)=>typeof D==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:(D)=>parseFloat(D.replace(/_/g,"")),stringify(D){let F=Number(D.value);return isFinite(F)?F.toExponential():XV.stringifyNumber(D)}},c1D={identify:(D)=>typeof D==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(D){let F=new d1D.Scalar(parseFloat(D.replace(/_/g,""))),$=D.indexOf(".");if($!==-1){let J=D.substring($+1).replace(/_/g,"");if(J[J.length-1]==="0")F.minFractionDigits=J.length}return F},stringify:XV.stringifyNumber};n1D.float=c1D;n1D.floatExp=l1D;n1D.floatNaN=p1D});var mS=w((DFD)=>{var gS=F9(),P5=(D)=>typeof D==="bigint"||Number.isInteger(D);function uX(D,F,$,{intAsBigInt:J}){let Q=D[0];if(Q==="-"||Q==="+")F+=1;if(D=D.substring(F).replace(/_/g,""),J){switch($){case 2:D=`0b${D}`;break;case 8:D=`0o${D}`;break;case 16:D=`0x${D}`;break}let X=BigInt(D);return Q==="-"?BigInt(-1)*X:X}let Z=parseInt(D,$);return Q==="-"?-1*Z:Z}function YV(D,F,$){let{value:J}=D;if(P5(J)){let Q=J.toString(F);return J<0?"-"+$+Q.substr(1):$+Q}return gS.stringifyNumber(D)}var r1D={identify:P5,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(D,F,$)=>uX(D,2,2,$),stringify:(D)=>YV(D,2,"0b")},s1D={identify:P5,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(D,F,$)=>uX(D,1,8,$),stringify:(D)=>YV(D,8,"0")},t1D={identify:P5,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(D,F,$)=>uX(D,0,10,$),stringify:gS.stringifyNumber},e1D={identify:P5,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(D,F,$)=>uX(D,2,16,$),stringify:(D)=>YV(D,16,"0x")};DFD.int=t1D;DFD.intBin=r1D;DFD.intHex=e1D;DFD.intOct=s1D});var qV=w((XFD)=>{var dX=BD(),gX=MF(),mX=EF();class y3 extends mX.YAMLMap{constructor(D){super(D);this.tag=y3.tag}add(D){let F;if(dX.isPair(D))F=D;else if(D&&typeof D==="object"&&"key"in D&&"value"in D&&D.value===null)F=new gX.Pair(D.key,null);else F=new gX.Pair(D,null);if(!mX.findPair(this.items,F.key))this.items.push(F)}get(D,F){let $=mX.findPair(this.items,D);return!F&&dX.isPair($)?dX.isScalar($.key)?$.key.value:$.key:$}set(D,F){if(typeof F!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof F}`);let $=mX.findPair(this.items,D);if($&&!F)this.items.splice(this.items.indexOf($),1);else if(!$&&F)this.items.push(new gX.Pair(D))}toJSON(D,F){return super.toJSON(D,F,Set)}toString(D,F,$){if(!D)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},D,{allNullValues:!0}),F,$);else throw Error("Set items must all have null values")}static from(D,F,$){let{replacer:J}=$,Q=new this(D);if(F&&Symbol.iterator in Object(F))for(let Z of F){if(typeof J==="function")Z=J.call(F,Z,Z);Q.items.push(gX.createPair(Z,null,$))}return Q}}y3.tag="tag:yaml.org,2002:set";var ZFD={collection:"map",identify:(D)=>D instanceof Set,nodeClass:y3,default:!1,tag:"tag:yaml.org,2002:set",createNode:(D,F,$)=>y3.from(D,F,$),resolve(D,F){if(dX.isMap(D))if(D.hasAllNullValues(!0))return Object.assign(new y3,D);else F("Set items must all have null values");else F("Expected a mapping for this tag");return D}};XFD.YAMLSet=y3;XFD.set=ZFD});var BV=w((KFD)=>{var GFD=F9();function GV(D,F){let $=D[0],J=$==="-"||$==="+"?D.substring(1):D,Q=(X)=>F?BigInt(X):Number(X),Z=J.replace(/_/g,"").split(":").reduce((X,Y)=>X*Q(60)+Q(Y),Q(0));return $==="-"?Q(-1)*Z:Z}function dS(D){let{value:F}=D,$=(X)=>X;if(typeof F==="bigint")$=(X)=>BigInt(X);else if(isNaN(F)||!isFinite(F))return GFD.stringifyNumber(D);let J="";if(F<0)J="-",F*=$(-1);let Q=$(60),Z=[F%Q];if(F<60)Z.unshift(0);else if(F=(F-Z[0])/Q,Z.unshift(F%Q),F>=60)F=(F-Z[0])/Q,Z.unshift(F);return J+Z.map((X)=>String(X).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var BFD={identify:(D)=>typeof D==="bigint"||Number.isInteger(D),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(D,F,{intAsBigInt:$})=>GV(D,$),stringify:dS},WFD={identify:(D)=>typeof D==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:(D)=>GV(D,!1),stringify:dS},pS={identify:(D)=>D 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(D){let F=D.match(pS.test);if(!F)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,$,J,Q,Z,X,Y]=F.map(Number),q=F[7]?Number((F[7]+"00").substr(1,3)):0,G=Date.UTC($,J-1,Q,Z||0,X||0,Y||0,q),B=F[8];if(B&&B!=="Z"){let W=GV(B,!1);if(Math.abs(W)<30)W*=60;G-=60000*W}return new Date(G)},stringify:({value:D})=>D?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};KFD.floatTime=WFD;KFD.intTime=BFD;KFD.timestamp=pS});var cS=w((NFD)=>{var zFD=e7(),CFD=yX(),_FD=D9(),MFD=N5(),OFD=$V(),lS=hS(),WV=uS(),pX=mS(),EFD=NX(),RFD=ZV(),AFD=hX(),IFD=qV(),KV=BV(),wFD=[zFD.map,_FD.seq,MFD.string,CFD.nullTag,lS.trueTag,lS.falseTag,pX.intBin,pX.intOct,pX.int,pX.intHex,WV.floatNaN,WV.floatExp,WV.float,OFD.binary,EFD.merge,RFD.omap,AFD.pairs,IFD.set,KV.intTime,KV.floatTime,KV.timestamp];NFD.schema=wFD});var Fx=w((fFD)=>{var aS=e7(),LFD=yX(),rS=D9(),PFD=N5(),jFD=oU(),UV=rU(),VV=tU(),SFD=TS(),xFD=PS(),sS=$V(),j5=NX(),tS=ZV(),eS=hX(),nS=cS(),Dx=qV(),lX=BV(),iS=new Map([["core",SFD.schema],["failsafe",[aS.map,rS.seq,PFD.string]],["json",xFD.schema],["yaml11",nS.schema],["yaml-1.1",nS.schema]]),oS={binary:sS.binary,bool:jFD.boolTag,float:UV.float,floatExp:UV.floatExp,floatNaN:UV.floatNaN,floatTime:lX.floatTime,int:VV.int,intHex:VV.intHex,intOct:VV.intOct,intTime:lX.intTime,map:aS.map,merge:j5.merge,null:LFD.nullTag,omap:tS.omap,pairs:eS.pairs,seq:rS.seq,set:Dx.set,timestamp:lX.timestamp},kFD={"tag:yaml.org,2002:binary":sS.binary,"tag:yaml.org,2002:merge":j5.merge,"tag:yaml.org,2002:omap":tS.omap,"tag:yaml.org,2002:pairs":eS.pairs,"tag:yaml.org,2002:set":Dx.set,"tag:yaml.org,2002:timestamp":lX.timestamp};function yFD(D,F,$){let J=iS.get(F);if(J&&!D)return $&&!J.includes(j5.merge)?J.concat(j5.merge):J.slice();let Q=J;if(!Q)if(Array.isArray(D))Q=[];else{let Z=Array.from(iS.keys()).filter((X)=>X!=="yaml11").map((X)=>JSON.stringify(X)).join(", ");throw Error(`Unknown schema "${F}"; use one of ${Z} or define customTags array`)}if(Array.isArray(D))for(let Z of D)Q=Q.concat(Z);else if(typeof D==="function")Q=D(Q.slice());if($)Q=Q.concat(j5.merge);return Q.reduce((Z,X)=>{let Y=typeof X==="string"?oS[X]:X;if(!Y){let q=JSON.stringify(X),G=Object.keys(oS).map((B)=>JSON.stringify(B)).join(", ");throw Error(`Unknown custom tag ${q}; use one of ${G}`)}if(!Z.includes(Y))Z.push(Y);return Z},[])}fFD.coreKnownTags=kFD;fFD.getTags=yFD});var CV=w((dFD)=>{var HV=BD(),hFD=e7(),uFD=D9(),gFD=N5(),cX=Fx(),mFD=(D,F)=>D.key<F.key?-1:D.key>F.key?1:0;class zV{constructor({compat:D,customTags:F,merge:$,resolveKnownTags:J,schema:Q,sortMapEntries:Z,toStringDefaults:X}){this.compat=Array.isArray(D)?cX.getTags(D,"compat"):D?cX.getTags(null,D):null,this.name=typeof Q==="string"&&Q||"core",this.knownTags=J?cX.coreKnownTags:{},this.tags=cX.getTags(F,this.name,$),this.toStringOptions=X??null,Object.defineProperty(this,HV.MAP,{value:hFD.map}),Object.defineProperty(this,HV.SCALAR,{value:gFD.string}),Object.defineProperty(this,HV.SEQ,{value:uFD.seq}),this.sortMapEntries=typeof Z==="function"?Z:Z===!0?mFD:null}clone(){let D=Object.create(zV.prototype,Object.getOwnPropertyDescriptors(this));return D.tags=this.tags.slice(),D}}dFD.Schema=zV});var $x=w((nFD)=>{var lFD=BD(),_V=R5(),S5=M5();function cFD(D,F){let $=[],J=F.directives===!0;if(F.directives!==!1&&D.directives){let q=D.directives.toString(D);if(q)$.push(q),J=!0;else if(D.directives.docStart)J=!0}if(J)$.push("---");let Q=_V.createStringifyContext(D,F),{commentString:Z}=Q.options;if(D.commentBefore){if($.length!==1)$.unshift("");let q=Z(D.commentBefore);$.unshift(S5.indentComment(q,""))}let X=!1,Y=null;if(D.contents){if(lFD.isNode(D.contents)){if(D.contents.spaceBefore&&J)$.push("");if(D.contents.commentBefore){let B=Z(D.contents.commentBefore);$.push(S5.indentComment(B,""))}Q.forceBlockIndent=!!D.comment,Y=D.contents.comment}let q=Y?void 0:()=>X=!0,G=_V.stringify(D.contents,Q,()=>Y=null,q);if(Y)G+=S5.lineComment(G,"",Z(Y));if((G[0]==="|"||G[0]===">")&&$[$.length-1]==="---")$[$.length-1]=`--- ${G}`;else $.push(G)}else $.push(_V.stringify(D.contents,Q));if(D.directives?.docEnd)if(D.comment){let q=Z(D.comment);if(q.includes(`
149
149
  `))$.push("..."),$.push(S5.indentComment(q,""));else $.push(`... ${q}`)}else $.push("...");else{let q=D.comment;if(q&&X)q=q.replace(/^\n+/,"");if(q){if((!X||Y)&&$[$.length-1]!=="")$.push("");$.push(S5.indentComment(Z(q),""))}}return $.join(`
150
150
  `)+`
151
- `}nFD.stringifyDocument=cFD});var x5=I((F3D)=>{var oFD=C5(),$9=OX(),j2=BD(),aFD=MF(),rFD=zF(),sFD=CV(),tFD=$x(),MV=CX(),eFD=hU(),D3D=_5(),OV=vU();class EV{constructor(D,F,$){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,j2.NODE_TYPE,{value:j2.DOC});let J=null;if(typeof F==="function"||Array.isArray(F))J=F;else if($===void 0&&F)$=F,F=void 0;let Q=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},$);this.options=Q;let{version:Z}=Q;if($?._directives){if(this.directives=$._directives.atDocument(),this.directives.yaml.explicit)Z=this.directives.yaml.version}else this.directives=new OV.Directives({version:Z});this.setSchema(Z,$),this.contents=D===void 0?null:this.createNode(D,J,$)}clone(){let D=Object.create(EV.prototype,{[j2.NODE_TYPE]:{value:j2.DOC}});if(D.commentBefore=this.commentBefore,D.comment=this.comment,D.errors=this.errors.slice(),D.warnings=this.warnings.slice(),D.options=Object.assign({},this.options),this.directives)D.directives=this.directives.clone();if(D.schema=this.schema.clone(),D.contents=j2.isNode(this.contents)?this.contents.clone(D.schema):this.contents,this.range)D.range=this.range.slice();return D}add(D){if(J9(this.contents))this.contents.add(D)}addIn(D,F){if(J9(this.contents))this.contents.addIn(D,F)}createAlias(D,F){if(!D.anchor){let $=MV.anchorNames(this);D.anchor=!F||$.has(F)?MV.findNewAnchor(F||"a",$):F}return new oFD.Alias(D.anchor)}createNode(D,F,$){let J=void 0;if(typeof F==="function")D=F.call({"":D},"",D),J=F;else if(Array.isArray(F)){let H=(_)=>typeof _==="number"||_ instanceof String||_ instanceof Number,z=F.filter(H).map(String);if(z.length>0)F=F.concat(z);J=F}else if($===void 0&&F)$=F,F=void 0;let{aliasDuplicateObjects:Q,anchorPrefix:Z,flow:X,keepUndefined:Y,onTagObj:q,tag:G}=$??{},{onAnchor:B,setAnchors:W,sourceObjects:K}=MV.createNodeAnchors(this,Z||"a"),U={aliasDuplicateObjects:Q??!0,keepUndefined:Y??!1,onAnchor:B,onTagObj:q,replacer:J,schema:this.schema,sourceObjects:K},V=D3D.createNode(D,G,U);if(X&&j2.isCollection(V))V.flow=!0;return W(),V}createPair(D,F,$={}){let J=this.createNode(D,null,$),Q=this.createNode(F,null,$);return new aFD.Pair(J,Q)}delete(D){return J9(this.contents)?this.contents.delete(D):!1}deleteIn(D){if($9.isEmptyPath(D)){if(this.contents==null)return!1;return this.contents=null,!0}return J9(this.contents)?this.contents.deleteIn(D):!1}get(D,F){return j2.isCollection(this.contents)?this.contents.get(D,F):void 0}getIn(D,F){if($9.isEmptyPath(D))return!F&&j2.isScalar(this.contents)?this.contents.value:this.contents;return j2.isCollection(this.contents)?this.contents.getIn(D,F):void 0}has(D){return j2.isCollection(this.contents)?this.contents.has(D):!1}hasIn(D){if($9.isEmptyPath(D))return this.contents!==void 0;return j2.isCollection(this.contents)?this.contents.hasIn(D):!1}set(D,F){if(this.contents==null)this.contents=$9.collectionFromPath(this.schema,[D],F);else if(J9(this.contents))this.contents.set(D,F)}setIn(D,F){if($9.isEmptyPath(D))this.contents=F;else if(this.contents==null)this.contents=$9.collectionFromPath(this.schema,Array.from(D),F);else if(J9(this.contents))this.contents.setIn(D,F)}setSchema(D,F={}){if(typeof D==="number")D=String(D);let $;switch(D){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new OV.Directives({version:"1.1"});$={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=D;else this.directives=new OV.Directives({version:D});$={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;$=null;break;default:{let J=JSON.stringify(D);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${J}`)}}if(F.schema instanceof Object)this.schema=F.schema;else if($)this.schema=new sFD.Schema(Object.assign($,F));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:D,jsonArg:F,mapAsMap:$,maxAliasCount:J,onAnchor:Q,reviver:Z}={}){let X={anchors:new Map,doc:this,keep:!D,mapAsMap:$===!0,mapKeyWarned:!1,maxAliasCount:typeof J==="number"?J:100},Y=rFD.toJS(this.contents,F??"",X);if(typeof Q==="function")for(let{count:q,res:G}of X.anchors.values())Q(G,q);return typeof Z==="function"?eFD.applyReviver(Z,{"":Y},"",Y):Y}toJSON(D,F){return this.toJS({json:!0,jsonArg:D,mapAsMap:!1,onAnchor:F})}toString(D={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in D&&(!Number.isInteger(D.indent)||Number(D.indent)<=0)){let F=JSON.stringify(D.indent);throw Error(`"indent" option must be a positive integer, not ${F}`)}return tFD.stringifyDocument(this,D)}}function J9(D){if(j2.isCollection(D))return!0;throw Error("Expected a YAML collection as document contents")}F3D.Document=EV});var k5=I((Q3D)=>{class nX extends Error{constructor(D,F,$,J){super();this.name=D,this.code=$,this.message=J,this.pos=F}}class Jx extends nX{constructor(D,F,$){super("YAMLParseError",D,F,$)}}class Qx extends nX{constructor(D,F,$){super("YAMLWarning",D,F,$)}}var J3D=(D,F)=>($)=>{if($.pos[0]===-1)return;$.linePos=$.pos.map((Y)=>F.linePos(Y));let{line:J,col:Q}=$.linePos[0];$.message+=` at line ${J}, column ${Q}`;let Z=Q-1,X=D.substring(F.lineStarts[J-1],F.lineStarts[J]).replace(/[\n\r]+$/,"");if(Z>=60&&X.length>80){let Y=Math.min(Z-39,X.length-79);X="…"+X.substring(Y),Z-=Y-1}if(X.length>80)X=X.substring(0,79)+"…";if(J>1&&/^ *$/.test(X.substring(0,Z))){let Y=D.substring(F.lineStarts[J-2],F.lineStarts[J-1]);if(Y.length>80)Y=Y.substring(0,79)+`…
151
+ `}nFD.stringifyDocument=cFD});var x5=w((F3D)=>{var oFD=C5(),$9=OX(),j2=BD(),aFD=MF(),rFD=zF(),sFD=CV(),tFD=$x(),MV=CX(),eFD=hU(),D3D=_5(),OV=vU();class EV{constructor(D,F,$){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,j2.NODE_TYPE,{value:j2.DOC});let J=null;if(typeof F==="function"||Array.isArray(F))J=F;else if($===void 0&&F)$=F,F=void 0;let Q=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},$);this.options=Q;let{version:Z}=Q;if($?._directives){if(this.directives=$._directives.atDocument(),this.directives.yaml.explicit)Z=this.directives.yaml.version}else this.directives=new OV.Directives({version:Z});this.setSchema(Z,$),this.contents=D===void 0?null:this.createNode(D,J,$)}clone(){let D=Object.create(EV.prototype,{[j2.NODE_TYPE]:{value:j2.DOC}});if(D.commentBefore=this.commentBefore,D.comment=this.comment,D.errors=this.errors.slice(),D.warnings=this.warnings.slice(),D.options=Object.assign({},this.options),this.directives)D.directives=this.directives.clone();if(D.schema=this.schema.clone(),D.contents=j2.isNode(this.contents)?this.contents.clone(D.schema):this.contents,this.range)D.range=this.range.slice();return D}add(D){if(J9(this.contents))this.contents.add(D)}addIn(D,F){if(J9(this.contents))this.contents.addIn(D,F)}createAlias(D,F){if(!D.anchor){let $=MV.anchorNames(this);D.anchor=!F||$.has(F)?MV.findNewAnchor(F||"a",$):F}return new oFD.Alias(D.anchor)}createNode(D,F,$){let J=void 0;if(typeof F==="function")D=F.call({"":D},"",D),J=F;else if(Array.isArray(F)){let H=(_)=>typeof _==="number"||_ instanceof String||_ instanceof Number,z=F.filter(H).map(String);if(z.length>0)F=F.concat(z);J=F}else if($===void 0&&F)$=F,F=void 0;let{aliasDuplicateObjects:Q,anchorPrefix:Z,flow:X,keepUndefined:Y,onTagObj:q,tag:G}=$??{},{onAnchor:B,setAnchors:W,sourceObjects:K}=MV.createNodeAnchors(this,Z||"a"),U={aliasDuplicateObjects:Q??!0,keepUndefined:Y??!1,onAnchor:B,onTagObj:q,replacer:J,schema:this.schema,sourceObjects:K},V=D3D.createNode(D,G,U);if(X&&j2.isCollection(V))V.flow=!0;return W(),V}createPair(D,F,$={}){let J=this.createNode(D,null,$),Q=this.createNode(F,null,$);return new aFD.Pair(J,Q)}delete(D){return J9(this.contents)?this.contents.delete(D):!1}deleteIn(D){if($9.isEmptyPath(D)){if(this.contents==null)return!1;return this.contents=null,!0}return J9(this.contents)?this.contents.deleteIn(D):!1}get(D,F){return j2.isCollection(this.contents)?this.contents.get(D,F):void 0}getIn(D,F){if($9.isEmptyPath(D))return!F&&j2.isScalar(this.contents)?this.contents.value:this.contents;return j2.isCollection(this.contents)?this.contents.getIn(D,F):void 0}has(D){return j2.isCollection(this.contents)?this.contents.has(D):!1}hasIn(D){if($9.isEmptyPath(D))return this.contents!==void 0;return j2.isCollection(this.contents)?this.contents.hasIn(D):!1}set(D,F){if(this.contents==null)this.contents=$9.collectionFromPath(this.schema,[D],F);else if(J9(this.contents))this.contents.set(D,F)}setIn(D,F){if($9.isEmptyPath(D))this.contents=F;else if(this.contents==null)this.contents=$9.collectionFromPath(this.schema,Array.from(D),F);else if(J9(this.contents))this.contents.setIn(D,F)}setSchema(D,F={}){if(typeof D==="number")D=String(D);let $;switch(D){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new OV.Directives({version:"1.1"});$={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=D;else this.directives=new OV.Directives({version:D});$={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;$=null;break;default:{let J=JSON.stringify(D);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${J}`)}}if(F.schema instanceof Object)this.schema=F.schema;else if($)this.schema=new sFD.Schema(Object.assign($,F));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:D,jsonArg:F,mapAsMap:$,maxAliasCount:J,onAnchor:Q,reviver:Z}={}){let X={anchors:new Map,doc:this,keep:!D,mapAsMap:$===!0,mapKeyWarned:!1,maxAliasCount:typeof J==="number"?J:100},Y=rFD.toJS(this.contents,F??"",X);if(typeof Q==="function")for(let{count:q,res:G}of X.anchors.values())Q(G,q);return typeof Z==="function"?eFD.applyReviver(Z,{"":Y},"",Y):Y}toJSON(D,F){return this.toJS({json:!0,jsonArg:D,mapAsMap:!1,onAnchor:F})}toString(D={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in D&&(!Number.isInteger(D.indent)||Number(D.indent)<=0)){let F=JSON.stringify(D.indent);throw Error(`"indent" option must be a positive integer, not ${F}`)}return tFD.stringifyDocument(this,D)}}function J9(D){if(j2.isCollection(D))return!0;throw Error("Expected a YAML collection as document contents")}F3D.Document=EV});var k5=w((Q3D)=>{class nX extends Error{constructor(D,F,$,J){super();this.name=D,this.code=$,this.message=J,this.pos=F}}class Jx extends nX{constructor(D,F,$){super("YAMLParseError",D,F,$)}}class Qx extends nX{constructor(D,F,$){super("YAMLWarning",D,F,$)}}var J3D=(D,F)=>($)=>{if($.pos[0]===-1)return;$.linePos=$.pos.map((Y)=>F.linePos(Y));let{line:J,col:Q}=$.linePos[0];$.message+=` at line ${J}, column ${Q}`;let Z=Q-1,X=D.substring(F.lineStarts[J-1],F.lineStarts[J]).replace(/[\n\r]+$/,"");if(Z>=60&&X.length>80){let Y=Math.min(Z-39,X.length-79);X="…"+X.substring(Y),Z-=Y-1}if(X.length>80)X=X.substring(0,79)+"…";if(J>1&&/^ *$/.test(X.substring(0,Z))){let Y=D.substring(F.lineStarts[J-2],F.lineStarts[J-1]);if(Y.length>80)Y=Y.substring(0,79)+`…
152
152
  `;X=Y+X}if(/[^ ]/.test(X)){let Y=1,q=$.linePos[1];if(q?.line===J&&q.col>Q)Y=Math.max(1,Math.min(q.col-Q,80-Z));let G=" ".repeat(Z)+"^".repeat(Y);$.message+=`:
153
153
 
154
154
  ${X}
155
155
  ${G}
156
- `}};Q3D.YAMLError=nX;Q3D.YAMLParseError=Jx;Q3D.YAMLWarning=Qx;Q3D.prettifyError=J3D});var y5=I((B3D)=>{function G3D(D,{flow:F,indicator:$,next:J,offset:Q,onError:Z,parentIndent:X,startOnNewline:Y}){let q=!1,G=Y,B=Y,W="",K="",U=!1,V=!1,H=null,z=null,_=null,O=null,C=null,M=null,E=null;for(let R of D){if(V){if(R.type!=="space"&&R.type!=="newline"&&R.type!=="comma")Z(R.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");V=!1}if(H){if(G&&R.type!=="comment"&&R.type!=="newline")Z(H,"TAB_AS_INDENT","Tabs are not allowed as indentation");H=null}switch(R.type){case"space":if(!F&&($!=="doc-start"||J?.type!=="flow-collection")&&R.source.includes("\t"))H=R;B=!0;break;case"comment":{if(!B)Z(R,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let T=R.source.substring(1)||" ";if(!W)W=T;else W+=K+T;K="",G=!1;break}case"newline":if(G){if(W)W+=R.source;else if(!M||$!=="seq-item-ind")q=!0}else K+=R.source;if(G=!0,U=!0,z||_)O=R;B=!0;break;case"anchor":if(z)Z(R,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(R.source.endsWith(":"))Z(R.offset+R.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);z=R,E??(E=R.offset),G=!1,B=!1,V=!0;break;case"tag":{if(_)Z(R,"MULTIPLE_TAGS","A node can have at most one tag");_=R,E??(E=R.offset),G=!1,B=!1,V=!0;break}case $:if(z||_)Z(R,"BAD_PROP_ORDER",`Anchors and tags must be after the ${R.source} indicator`);if(M)Z(R,"UNEXPECTED_TOKEN",`Unexpected ${R.source} in ${F??"collection"}`);M=R,G=$==="seq-item-ind"||$==="explicit-key-ind",B=!1;break;case"comma":if(F){if(C)Z(R,"UNEXPECTED_TOKEN",`Unexpected , in ${F}`);C=R,G=!1,B=!1;break}default:Z(R,"UNEXPECTED_TOKEN",`Unexpected ${R.type} token`),G=!1,B=!1}}let A=D[D.length-1],w=A?A.offset+A.source.length:Q;if(V&&J&&J.type!=="space"&&J.type!=="newline"&&J.type!=="comma"&&(J.type!=="scalar"||J.source!==""))Z(J.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(H&&(G&&H.indent<=X||J?.type==="block-map"||J?.type==="block-seq"))Z(H,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:C,found:M,spaceBefore:q,comment:W,hasNewline:U,anchor:z,tag:_,newlineAfterProp:O,end:w,start:E??w}}B3D.resolveProps=G3D});var iX=I((K3D)=>{function RV(D){if(!D)return null;switch(D.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(D.source.includes(`
157
- `))return!0;if(D.end){for(let F of D.end)if(F.type==="newline")return!0}return!1;case"flow-collection":for(let F of D.items){for(let $ of F.start)if($.type==="newline")return!0;if(F.sep){for(let $ of F.sep)if($.type==="newline")return!0}if(RV(F.key)||RV(F.value))return!0}return!1;default:return!0}}K3D.containsNewline=RV});var AV=I((z3D)=>{var V3D=iX();function H3D(D,F,$){if(F?.type==="flow-collection"){let J=F.end[0];if(J.indent===D&&(J.source==="]"||J.source==="}")&&V3D.containsNewline(F))$(J,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}z3D.flowIndentCheck=H3D});var IV=I((M3D)=>{var Zx=BD();function _3D(D,F,$){let{uniqueKeys:J}=D.options;if(J===!1)return!1;let Q=typeof J==="function"?J:(Z,X)=>Z===X||Zx.isScalar(Z)&&Zx.isScalar(X)&&Z.value===X.value;return F.some((Z)=>Q(Z.key,$))}M3D.mapIncludes=_3D});var Bx=I((w3D)=>{var Xx=MF(),E3D=EF(),Yx=y5(),R3D=iX(),qx=AV(),A3D=IV(),Gx="All mapping items must start at the same column";function I3D({composeNode:D,composeEmptyNode:F},$,J,Q,Z){let Y=new(Z?.nodeClass??E3D.YAMLMap)($.schema);if($.atRoot)$.atRoot=!1;let q=J.offset,G=null;for(let B of J.items){let{start:W,key:K,sep:U,value:V}=B,H=Yx.resolveProps(W,{indicator:"explicit-key-ind",next:K??U?.[0],offset:q,onError:Q,parentIndent:J.indent,startOnNewline:!0}),z=!H.found;if(z){if(K){if(K.type==="block-seq")Q(q,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in K&&K.indent!==J.indent)Q(q,"BAD_INDENT",Gx)}if(!H.anchor&&!H.tag&&!U){if(G=H.end,H.comment)if(Y.comment)Y.comment+=`
156
+ `}};Q3D.YAMLError=nX;Q3D.YAMLParseError=Jx;Q3D.YAMLWarning=Qx;Q3D.prettifyError=J3D});var y5=w((B3D)=>{function G3D(D,{flow:F,indicator:$,next:J,offset:Q,onError:Z,parentIndent:X,startOnNewline:Y}){let q=!1,G=Y,B=Y,W="",K="",U=!1,V=!1,H=null,z=null,_=null,O=null,C=null,M=null,E=null;for(let R of D){if(V){if(R.type!=="space"&&R.type!=="newline"&&R.type!=="comma")Z(R.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");V=!1}if(H){if(G&&R.type!=="comment"&&R.type!=="newline")Z(H,"TAB_AS_INDENT","Tabs are not allowed as indentation");H=null}switch(R.type){case"space":if(!F&&($!=="doc-start"||J?.type!=="flow-collection")&&R.source.includes("\t"))H=R;B=!0;break;case"comment":{if(!B)Z(R,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let T=R.source.substring(1)||" ";if(!W)W=T;else W+=K+T;K="",G=!1;break}case"newline":if(G){if(W)W+=R.source;else if(!M||$!=="seq-item-ind")q=!0}else K+=R.source;if(G=!0,U=!0,z||_)O=R;B=!0;break;case"anchor":if(z)Z(R,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(R.source.endsWith(":"))Z(R.offset+R.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);z=R,E??(E=R.offset),G=!1,B=!1,V=!0;break;case"tag":{if(_)Z(R,"MULTIPLE_TAGS","A node can have at most one tag");_=R,E??(E=R.offset),G=!1,B=!1,V=!0;break}case $:if(z||_)Z(R,"BAD_PROP_ORDER",`Anchors and tags must be after the ${R.source} indicator`);if(M)Z(R,"UNEXPECTED_TOKEN",`Unexpected ${R.source} in ${F??"collection"}`);M=R,G=$==="seq-item-ind"||$==="explicit-key-ind",B=!1;break;case"comma":if(F){if(C)Z(R,"UNEXPECTED_TOKEN",`Unexpected , in ${F}`);C=R,G=!1,B=!1;break}default:Z(R,"UNEXPECTED_TOKEN",`Unexpected ${R.type} token`),G=!1,B=!1}}let A=D[D.length-1],I=A?A.offset+A.source.length:Q;if(V&&J&&J.type!=="space"&&J.type!=="newline"&&J.type!=="comma"&&(J.type!=="scalar"||J.source!==""))Z(J.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(H&&(G&&H.indent<=X||J?.type==="block-map"||J?.type==="block-seq"))Z(H,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:C,found:M,spaceBefore:q,comment:W,hasNewline:U,anchor:z,tag:_,newlineAfterProp:O,end:I,start:E??I}}B3D.resolveProps=G3D});var iX=w((K3D)=>{function RV(D){if(!D)return null;switch(D.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(D.source.includes(`
157
+ `))return!0;if(D.end){for(let F of D.end)if(F.type==="newline")return!0}return!1;case"flow-collection":for(let F of D.items){for(let $ of F.start)if($.type==="newline")return!0;if(F.sep){for(let $ of F.sep)if($.type==="newline")return!0}if(RV(F.key)||RV(F.value))return!0}return!1;default:return!0}}K3D.containsNewline=RV});var AV=w((z3D)=>{var V3D=iX();function H3D(D,F,$){if(F?.type==="flow-collection"){let J=F.end[0];if(J.indent===D&&(J.source==="]"||J.source==="}")&&V3D.containsNewline(F))$(J,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}z3D.flowIndentCheck=H3D});var IV=w((M3D)=>{var Zx=BD();function _3D(D,F,$){let{uniqueKeys:J}=D.options;if(J===!1)return!1;let Q=typeof J==="function"?J:(Z,X)=>Z===X||Zx.isScalar(Z)&&Zx.isScalar(X)&&Z.value===X.value;return F.some((Z)=>Q(Z.key,$))}M3D.mapIncludes=_3D});var Bx=w((w3D)=>{var Xx=MF(),E3D=EF(),Yx=y5(),R3D=iX(),qx=AV(),A3D=IV(),Gx="All mapping items must start at the same column";function I3D({composeNode:D,composeEmptyNode:F},$,J,Q,Z){let Y=new(Z?.nodeClass??E3D.YAMLMap)($.schema);if($.atRoot)$.atRoot=!1;let q=J.offset,G=null;for(let B of J.items){let{start:W,key:K,sep:U,value:V}=B,H=Yx.resolveProps(W,{indicator:"explicit-key-ind",next:K??U?.[0],offset:q,onError:Q,parentIndent:J.indent,startOnNewline:!0}),z=!H.found;if(z){if(K){if(K.type==="block-seq")Q(q,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in K&&K.indent!==J.indent)Q(q,"BAD_INDENT",Gx)}if(!H.anchor&&!H.tag&&!U){if(G=H.end,H.comment)if(Y.comment)Y.comment+=`
158
158
  `+H.comment;else Y.comment=H.comment;continue}if(H.newlineAfterProp||R3D.containsNewline(K))Q(K??W[W.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(H.found?.indent!==J.indent)Q(q,"BAD_INDENT",Gx);$.atKey=!0;let _=H.end,O=K?D($,K,H,Q):F($,_,W,null,H,Q);if($.schema.compat)qx.flowIndentCheck(J.indent,K,Q);if($.atKey=!1,A3D.mapIncludes($,Y.items,O))Q(_,"DUPLICATE_KEY","Map keys must be unique");let C=Yx.resolveProps(U??[],{indicator:"map-value-ind",next:V,offset:O.range[2],onError:Q,parentIndent:J.indent,startOnNewline:!K||K.type==="block-scalar"});if(q=C.end,C.found){if(z){if(V?.type==="block-map"&&!C.hasNewline)Q(q,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if($.options.strict&&H.start<C.found.offset-1024)Q(O.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let M=V?D($,V,C,Q):F($,q,U,null,C,Q);if($.schema.compat)qx.flowIndentCheck(J.indent,V,Q);q=M.range[2];let E=new Xx.Pair(O,M);if($.options.keepSourceTokens)E.srcToken=B;Y.items.push(E)}else{if(z)Q(O.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(C.comment)if(O.comment)O.comment+=`
159
- `+C.comment;else O.comment=C.comment;let M=new Xx.Pair(O);if($.options.keepSourceTokens)M.srcToken=B;Y.items.push(M)}}if(G&&G<q)Q(G,"IMPOSSIBLE","Map comment with trailing content");return Y.range=[J.offset,q,G??q],Y}w3D.resolveBlockMap=I3D});var Wx=I((S3D)=>{var T3D=RF(),L3D=y5(),P3D=AV();function j3D({composeNode:D,composeEmptyNode:F},$,J,Q,Z){let Y=new(Z?.nodeClass??T3D.YAMLSeq)($.schema);if($.atRoot)$.atRoot=!1;if($.atKey)$.atKey=!1;let q=J.offset,G=null;for(let{start:B,value:W}of J.items){let K=L3D.resolveProps(B,{indicator:"seq-item-ind",next:W,offset:q,onError:Q,parentIndent:J.indent,startOnNewline:!0});if(!K.found)if(K.anchor||K.tag||W)if(W?.type==="block-seq")Q(K.end,"BAD_INDENT","All sequence items must start at the same column");else Q(q,"MISSING_CHAR","Sequence item without - indicator");else{if(G=K.end,K.comment)Y.comment=K.comment;continue}let U=W?D($,W,K,Q):F($,K.end,B,null,K,Q);if($.schema.compat)P3D.flowIndentCheck(J.indent,W,Q);q=U.range[2],Y.items.push(U)}return Y.range=[J.offset,q,G??q],Y}S3D.resolveBlockSeq=j3D});var Q9=I((y3D)=>{function k3D(D,F,$,J){let Q="";if(D){let Z=!1,X="";for(let Y of D){let{source:q,type:G}=Y;switch(G){case"space":Z=!0;break;case"comment":{if($&&!Z)J(Y,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let B=q.substring(1)||" ";if(!Q)Q=B;else Q+=X+B;X="";break}case"newline":if(Q)X+=q;Z=!0;break;default:J(Y,"UNEXPECTED_TOKEN",`Unexpected ${G} at node end`)}F+=q.length}}return{comment:Q,offset:F}}y3D.resolveEnd=k3D});var Vx=I((p3D)=>{var b3D=BD(),v3D=MF(),Kx=EF(),h3D=RF(),u3D=Q9(),Ux=y5(),g3D=iX(),m3D=IV(),wV="Block collections are not allowed within flow collections",NV=(D)=>D&&(D.type==="block-map"||D.type==="block-seq");function d3D({composeNode:D,composeEmptyNode:F},$,J,Q,Z){let X=J.start.source==="{",Y=X?"flow map":"flow sequence",G=new(Z?.nodeClass??(X?Kx.YAMLMap:h3D.YAMLSeq))($.schema);G.flow=!0;let B=$.atRoot;if(B)$.atRoot=!1;if($.atKey)$.atKey=!1;let W=J.offset+J.start.source.length;for(let z=0;z<J.items.length;++z){let _=J.items[z],{start:O,key:C,sep:M,value:E}=_,A=Ux.resolveProps(O,{flow:Y,indicator:"explicit-key-ind",next:C??M?.[0],offset:W,onError:Q,parentIndent:J.indent,startOnNewline:!1});if(!A.found){if(!A.anchor&&!A.tag&&!M&&!E){if(z===0&&A.comma)Q(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${Y}`);else if(z<J.items.length-1)Q(A.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${Y}`);if(A.comment)if(G.comment)G.comment+=`
160
- `+A.comment;else G.comment=A.comment;W=A.end;continue}if(!X&&$.options.strict&&g3D.containsNewline(C))Q(C,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(z===0){if(A.comma)Q(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${Y}`)}else{if(!A.comma)Q(A.start,"MISSING_CHAR",`Missing , between ${Y} items`);if(A.comment){let w="";D:for(let R of O)switch(R.type){case"comma":case"space":break;case"comment":w=R.source.substring(1);break D;default:break D}if(w){let R=G.items[G.items.length-1];if(b3D.isPair(R))R=R.value??R.key;if(R.comment)R.comment+=`
161
- `+w;else R.comment=w;A.comment=A.comment.substring(w.length+1)}}}if(!X&&!M&&!A.found){let w=E?D($,E,A,Q):F($,A.end,M,null,A,Q);if(G.items.push(w),W=w.range[2],NV(E))Q(w.range,"BLOCK_IN_FLOW",wV)}else{$.atKey=!0;let w=A.end,R=C?D($,C,A,Q):F($,w,O,null,A,Q);if(NV(C))Q(R.range,"BLOCK_IN_FLOW",wV);$.atKey=!1;let T=Ux.resolveProps(M??[],{flow:Y,indicator:"map-value-ind",next:E,offset:R.range[2],onError:Q,parentIndent:J.indent,startOnNewline:!1});if(T.found){if(!X&&!A.found&&$.options.strict){if(M)for(let L of M){if(L===T.found)break;if(L.type==="newline"){Q(L,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(A.start<T.found.offset-1024)Q(T.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(E)if("source"in E&&E.source?.[0]===":")Q(E,"MISSING_CHAR",`Missing space after : in ${Y}`);else Q(T.start,"MISSING_CHAR",`Missing , or : between ${Y} items`);let N=E?D($,E,T,Q):T.found?F($,T.end,M,null,T,Q):null;if(N){if(NV(E))Q(N.range,"BLOCK_IN_FLOW",wV)}else if(T.comment)if(R.comment)R.comment+=`
162
- `+T.comment;else R.comment=T.comment;let j=new v3D.Pair(R,N);if($.options.keepSourceTokens)j.srcToken=_;if(X){let L=G;if(m3D.mapIncludes($,L.items,R))Q(w,"DUPLICATE_KEY","Map keys must be unique");L.items.push(j)}else{let L=new Kx.YAMLMap($.schema);L.flow=!0,L.items.push(j);let y=(N??R).range;L.range=[R.range[0],y[1],y[2]],G.items.push(L)}W=N?N.range[2]:T.end}}let K=X?"}":"]",[U,...V]=J.end,H=W;if(U?.source===K)H=U.offset+U.source.length;else{let z=Y[0].toUpperCase()+Y.substring(1),_=B?`${z} must end with a ${K}`:`${z} in block collection must be sufficiently indented and end with a ${K}`;if(Q(W,B?"MISSING_CHAR":"BAD_INDENT",_),U&&U.source.length!==1)V.unshift(U)}if(V.length>0){let z=u3D.resolveEnd(V,H,$.options.strict,Q);if(z.comment)if(G.comment)G.comment+=`
163
- `+z.comment;else G.comment=z.comment;G.range=[J.offset,H,z.offset]}else G.range=[J.offset,H,H];return G}p3D.resolveFlowCollection=d3D});var Hx=I((e3D)=>{var c3D=BD(),n3D=rD(),i3D=EF(),o3D=RF(),a3D=Bx(),r3D=Wx(),s3D=Vx();function TV(D,F,$,J,Q,Z){let X=$.type==="block-map"?a3D.resolveBlockMap(D,F,$,J,Z):$.type==="block-seq"?r3D.resolveBlockSeq(D,F,$,J,Z):s3D.resolveFlowCollection(D,F,$,J,Z),Y=X.constructor;if(Q==="!"||Q===Y.tagName)return X.tag=Y.tagName,X;if(Q)X.tag=Q;return X}function t3D(D,F,$,J,Q){let Z=J.tag,X=!Z?null:F.directives.tagName(Z.source,(K)=>Q(Z,"TAG_RESOLVE_FAILED",K));if($.type==="block-seq"){let{anchor:K,newlineAfterProp:U}=J,V=K&&Z?K.offset>Z.offset?K:Z:K??Z;if(V&&(!U||U.offset<V.offset))Q(V,"MISSING_CHAR","Missing newline after block sequence props")}let Y=$.type==="block-map"?"map":$.type==="block-seq"?"seq":$.start.source==="{"?"map":"seq";if(!Z||!X||X==="!"||X===i3D.YAMLMap.tagName&&Y==="map"||X===o3D.YAMLSeq.tagName&&Y==="seq")return TV(D,F,$,Q,X);let q=F.schema.tags.find((K)=>K.tag===X&&K.collection===Y);if(!q){let K=F.schema.knownTags[X];if(K?.collection===Y)F.schema.tags.push(Object.assign({},K,{default:!1})),q=K;else{if(K)Q(Z,"BAD_COLLECTION_TYPE",`${K.tag} used for ${Y} collection, but expects ${K.collection??"scalar"}`,!0);else Q(Z,"TAG_RESOLVE_FAILED",`Unresolved tag: ${X}`,!0);return TV(D,F,$,Q,X)}}let G=TV(D,F,$,Q,X,q),B=q.resolve?.(G,(K)=>Q(Z,"TAG_RESOLVE_FAILED",K),F.options)??G,W=c3D.isNode(B)?B:new n3D.Scalar(B);if(W.range=G.range,W.tag=X,q?.format)W.format=q.format;return W}e3D.composeCollection=t3D});var PV=I((Q6D)=>{var LV=rD();function F6D(D,F,$){let J=F.offset,Q=$6D(F,D.options.strict,$);if(!Q)return{value:"",type:null,comment:"",range:[J,J,J]};let Z=Q.mode===">"?LV.Scalar.BLOCK_FOLDED:LV.Scalar.BLOCK_LITERAL,X=F.source?J6D(F.source):[],Y=X.length;for(let H=X.length-1;H>=0;--H){let z=X[H][1];if(z===""||z==="\r")Y=H;else break}if(Y===0){let H=Q.chomp==="+"&&X.length>0?`
159
+ `+C.comment;else O.comment=C.comment;let M=new Xx.Pair(O);if($.options.keepSourceTokens)M.srcToken=B;Y.items.push(M)}}if(G&&G<q)Q(G,"IMPOSSIBLE","Map comment with trailing content");return Y.range=[J.offset,q,G??q],Y}w3D.resolveBlockMap=I3D});var Wx=w((S3D)=>{var T3D=RF(),L3D=y5(),P3D=AV();function j3D({composeNode:D,composeEmptyNode:F},$,J,Q,Z){let Y=new(Z?.nodeClass??T3D.YAMLSeq)($.schema);if($.atRoot)$.atRoot=!1;if($.atKey)$.atKey=!1;let q=J.offset,G=null;for(let{start:B,value:W}of J.items){let K=L3D.resolveProps(B,{indicator:"seq-item-ind",next:W,offset:q,onError:Q,parentIndent:J.indent,startOnNewline:!0});if(!K.found)if(K.anchor||K.tag||W)if(W?.type==="block-seq")Q(K.end,"BAD_INDENT","All sequence items must start at the same column");else Q(q,"MISSING_CHAR","Sequence item without - indicator");else{if(G=K.end,K.comment)Y.comment=K.comment;continue}let U=W?D($,W,K,Q):F($,K.end,B,null,K,Q);if($.schema.compat)P3D.flowIndentCheck(J.indent,W,Q);q=U.range[2],Y.items.push(U)}return Y.range=[J.offset,q,G??q],Y}S3D.resolveBlockSeq=j3D});var Q9=w((y3D)=>{function k3D(D,F,$,J){let Q="";if(D){let Z=!1,X="";for(let Y of D){let{source:q,type:G}=Y;switch(G){case"space":Z=!0;break;case"comment":{if($&&!Z)J(Y,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let B=q.substring(1)||" ";if(!Q)Q=B;else Q+=X+B;X="";break}case"newline":if(Q)X+=q;Z=!0;break;default:J(Y,"UNEXPECTED_TOKEN",`Unexpected ${G} at node end`)}F+=q.length}}return{comment:Q,offset:F}}y3D.resolveEnd=k3D});var Vx=w((p3D)=>{var b3D=BD(),v3D=MF(),Kx=EF(),h3D=RF(),u3D=Q9(),Ux=y5(),g3D=iX(),m3D=IV(),wV="Block collections are not allowed within flow collections",NV=(D)=>D&&(D.type==="block-map"||D.type==="block-seq");function d3D({composeNode:D,composeEmptyNode:F},$,J,Q,Z){let X=J.start.source==="{",Y=X?"flow map":"flow sequence",G=new(Z?.nodeClass??(X?Kx.YAMLMap:h3D.YAMLSeq))($.schema);G.flow=!0;let B=$.atRoot;if(B)$.atRoot=!1;if($.atKey)$.atKey=!1;let W=J.offset+J.start.source.length;for(let z=0;z<J.items.length;++z){let _=J.items[z],{start:O,key:C,sep:M,value:E}=_,A=Ux.resolveProps(O,{flow:Y,indicator:"explicit-key-ind",next:C??M?.[0],offset:W,onError:Q,parentIndent:J.indent,startOnNewline:!1});if(!A.found){if(!A.anchor&&!A.tag&&!M&&!E){if(z===0&&A.comma)Q(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${Y}`);else if(z<J.items.length-1)Q(A.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${Y}`);if(A.comment)if(G.comment)G.comment+=`
160
+ `+A.comment;else G.comment=A.comment;W=A.end;continue}if(!X&&$.options.strict&&g3D.containsNewline(C))Q(C,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(z===0){if(A.comma)Q(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${Y}`)}else{if(!A.comma)Q(A.start,"MISSING_CHAR",`Missing , between ${Y} items`);if(A.comment){let I="";D:for(let R of O)switch(R.type){case"comma":case"space":break;case"comment":I=R.source.substring(1);break D;default:break D}if(I){let R=G.items[G.items.length-1];if(b3D.isPair(R))R=R.value??R.key;if(R.comment)R.comment+=`
161
+ `+I;else R.comment=I;A.comment=A.comment.substring(I.length+1)}}}if(!X&&!M&&!A.found){let I=E?D($,E,A,Q):F($,A.end,M,null,A,Q);if(G.items.push(I),W=I.range[2],NV(E))Q(I.range,"BLOCK_IN_FLOW",wV)}else{$.atKey=!0;let I=A.end,R=C?D($,C,A,Q):F($,I,O,null,A,Q);if(NV(C))Q(R.range,"BLOCK_IN_FLOW",wV);$.atKey=!1;let T=Ux.resolveProps(M??[],{flow:Y,indicator:"map-value-ind",next:E,offset:R.range[2],onError:Q,parentIndent:J.indent,startOnNewline:!1});if(T.found){if(!X&&!A.found&&$.options.strict){if(M)for(let L of M){if(L===T.found)break;if(L.type==="newline"){Q(L,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(A.start<T.found.offset-1024)Q(T.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(E)if("source"in E&&E.source?.[0]===":")Q(E,"MISSING_CHAR",`Missing space after : in ${Y}`);else Q(T.start,"MISSING_CHAR",`Missing , or : between ${Y} items`);let N=E?D($,E,T,Q):T.found?F($,T.end,M,null,T,Q):null;if(N){if(NV(E))Q(N.range,"BLOCK_IN_FLOW",wV)}else if(T.comment)if(R.comment)R.comment+=`
162
+ `+T.comment;else R.comment=T.comment;let j=new v3D.Pair(R,N);if($.options.keepSourceTokens)j.srcToken=_;if(X){let L=G;if(m3D.mapIncludes($,L.items,R))Q(I,"DUPLICATE_KEY","Map keys must be unique");L.items.push(j)}else{let L=new Kx.YAMLMap($.schema);L.flow=!0,L.items.push(j);let y=(N??R).range;L.range=[R.range[0],y[1],y[2]],G.items.push(L)}W=N?N.range[2]:T.end}}let K=X?"}":"]",[U,...V]=J.end,H=W;if(U?.source===K)H=U.offset+U.source.length;else{let z=Y[0].toUpperCase()+Y.substring(1),_=B?`${z} must end with a ${K}`:`${z} in block collection must be sufficiently indented and end with a ${K}`;if(Q(W,B?"MISSING_CHAR":"BAD_INDENT",_),U&&U.source.length!==1)V.unshift(U)}if(V.length>0){let z=u3D.resolveEnd(V,H,$.options.strict,Q);if(z.comment)if(G.comment)G.comment+=`
163
+ `+z.comment;else G.comment=z.comment;G.range=[J.offset,H,z.offset]}else G.range=[J.offset,H,H];return G}p3D.resolveFlowCollection=d3D});var Hx=w((e3D)=>{var c3D=BD(),n3D=rD(),i3D=EF(),o3D=RF(),a3D=Bx(),r3D=Wx(),s3D=Vx();function TV(D,F,$,J,Q,Z){let X=$.type==="block-map"?a3D.resolveBlockMap(D,F,$,J,Z):$.type==="block-seq"?r3D.resolveBlockSeq(D,F,$,J,Z):s3D.resolveFlowCollection(D,F,$,J,Z),Y=X.constructor;if(Q==="!"||Q===Y.tagName)return X.tag=Y.tagName,X;if(Q)X.tag=Q;return X}function t3D(D,F,$,J,Q){let Z=J.tag,X=!Z?null:F.directives.tagName(Z.source,(K)=>Q(Z,"TAG_RESOLVE_FAILED",K));if($.type==="block-seq"){let{anchor:K,newlineAfterProp:U}=J,V=K&&Z?K.offset>Z.offset?K:Z:K??Z;if(V&&(!U||U.offset<V.offset))Q(V,"MISSING_CHAR","Missing newline after block sequence props")}let Y=$.type==="block-map"?"map":$.type==="block-seq"?"seq":$.start.source==="{"?"map":"seq";if(!Z||!X||X==="!"||X===i3D.YAMLMap.tagName&&Y==="map"||X===o3D.YAMLSeq.tagName&&Y==="seq")return TV(D,F,$,Q,X);let q=F.schema.tags.find((K)=>K.tag===X&&K.collection===Y);if(!q){let K=F.schema.knownTags[X];if(K?.collection===Y)F.schema.tags.push(Object.assign({},K,{default:!1})),q=K;else{if(K)Q(Z,"BAD_COLLECTION_TYPE",`${K.tag} used for ${Y} collection, but expects ${K.collection??"scalar"}`,!0);else Q(Z,"TAG_RESOLVE_FAILED",`Unresolved tag: ${X}`,!0);return TV(D,F,$,Q,X)}}let G=TV(D,F,$,Q,X,q),B=q.resolve?.(G,(K)=>Q(Z,"TAG_RESOLVE_FAILED",K),F.options)??G,W=c3D.isNode(B)?B:new n3D.Scalar(B);if(W.range=G.range,W.tag=X,q?.format)W.format=q.format;return W}e3D.composeCollection=t3D});var PV=w((Q6D)=>{var LV=rD();function F6D(D,F,$){let J=F.offset,Q=$6D(F,D.options.strict,$);if(!Q)return{value:"",type:null,comment:"",range:[J,J,J]};let Z=Q.mode===">"?LV.Scalar.BLOCK_FOLDED:LV.Scalar.BLOCK_LITERAL,X=F.source?J6D(F.source):[],Y=X.length;for(let H=X.length-1;H>=0;--H){let z=X[H][1];if(z===""||z==="\r")Y=H;else break}if(Y===0){let H=Q.chomp==="+"&&X.length>0?`
164
164
  `.repeat(Math.max(1,X.length-1)):"",z=J+Q.length;if(F.source)z+=F.source.length;return{value:H,type:Z,comment:Q.comment,range:[J,z,z]}}let q=F.indent+Q.indent,G=F.offset+Q.length,B=0;for(let H=0;H<Y;++H){let[z,_]=X[H];if(_===""||_==="\r"){if(Q.indent===0&&z.length>q)q=z.length}else{if(z.length<q)$(G+z.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(Q.indent===0)q=z.length;if(B=H,q===0&&!D.atRoot)$(G,"BAD_INDENT","Block scalar values in collections must be indented");break}G+=z.length+_.length+1}for(let H=X.length-1;H>=Y;--H)if(X[H][0].length>q)Y=H+1;let W="",K="",U=!1;for(let H=0;H<B;++H)W+=X[H][0].slice(q)+`
165
165
  `;for(let H=B;H<Y;++H){let[z,_]=X[H];G+=z.length+_.length+1;let O=_[_.length-1]==="\r";if(O)_=_.slice(0,-1);if(_&&z.length<q){let M=`Block scalar lines must not be less indented than their ${Q.indent?"explicit indentation indicator":"first line"}`;$(G-_.length-(O?2:1),"BAD_INDENT",M),z=""}if(Z===LV.Scalar.BLOCK_LITERAL)W+=K+z.slice(q)+_,K=`
166
166
  `;else if(z.length>q||_[0]==="\t"){if(K===" ")K=`
@@ -175,7 +175,7 @@ ${G}
175
175
  `+X[H][0].slice(q);if(W[W.length-1]!==`
176
176
  `)W+=`
177
177
  `;break;default:W+=`
178
- `}let V=J+Q.length+F.source.length;return{value:W,type:Z,comment:Q.comment,range:[J,V,V]}}function $6D({offset:D,props:F},$,J){if(F[0].type!=="block-scalar-header")return J(F[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:Q}=F[0],Z=Q[0],X=0,Y="",q=-1;for(let K=1;K<Q.length;++K){let U=Q[K];if(!Y&&(U==="-"||U==="+"))Y=U;else{let V=Number(U);if(!X&&V)X=V;else if(q===-1)q=D+K}}if(q!==-1)J(q,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${Q}`);let G=!1,B="",W=Q.length;for(let K=1;K<F.length;++K){let U=F[K];switch(U.type){case"space":G=!0;case"newline":W+=U.source.length;break;case"comment":if($&&!G)J(U,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");W+=U.source.length,B=U.source.substring(1);break;case"error":J(U,"UNEXPECTED_TOKEN",U.message),W+=U.source.length;break;default:{let V=`Unexpected token in block scalar header: ${U.type}`;J(U,"UNEXPECTED_TOKEN",V);let H=U.source;if(H&&typeof H==="string")W+=H.length}}}return{mode:Z,indent:X,chomp:Y,comment:B,length:W}}function J6D(D){let F=D.split(/\n( *)/),$=F[0],J=$.match(/^( *)/),Z=[J?.[1]?[J[1],$.slice(J[1].length)]:["",$]];for(let X=1;X<F.length;X+=2)Z.push([F[X],F[X+1]]);return Z}Q6D.resolveBlockScalar=F6D});var SV=I((V6D)=>{var jV=rD(),X6D=Q9();function Y6D(D,F,$){let{offset:J,type:Q,source:Z,end:X}=D,Y,q,G=(K,U,V)=>$(J+K,U,V);switch(Q){case"scalar":Y=jV.Scalar.PLAIN,q=q6D(Z,G);break;case"single-quoted-scalar":Y=jV.Scalar.QUOTE_SINGLE,q=G6D(Z,G);break;case"double-quoted-scalar":Y=jV.Scalar.QUOTE_DOUBLE,q=B6D(Z,G);break;default:return $(D,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${Q}`),{value:"",type:null,comment:"",range:[J,J+Z.length,J+Z.length]}}let B=J+Z.length,W=X6D.resolveEnd(X,B,F,$);return{value:q,type:Y,comment:W.comment,range:[J,B,W.offset]}}function q6D(D,F){let $="";switch(D[0]){case"\t":$="a tab character";break;case",":$="flow indicator character ,";break;case"%":$="directive indicator character %";break;case"|":case">":{$=`block scalar indicator ${D[0]}`;break}case"@":case"`":{$=`reserved character ${D[0]}`;break}}if($)F(0,"BAD_SCALAR_START",`Plain value cannot start with ${$}`);return zx(D)}function G6D(D,F){if(D[D.length-1]!=="'"||D.length===1)F(D.length,"MISSING_CHAR","Missing closing 'quote");return zx(D.slice(1,-1)).replace(/''/g,"'")}function zx(D){let F,$;try{F=new RegExp(`(.*?)(?<![ ])[ ]*\r?
178
+ `}let V=J+Q.length+F.source.length;return{value:W,type:Z,comment:Q.comment,range:[J,V,V]}}function $6D({offset:D,props:F},$,J){if(F[0].type!=="block-scalar-header")return J(F[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:Q}=F[0],Z=Q[0],X=0,Y="",q=-1;for(let K=1;K<Q.length;++K){let U=Q[K];if(!Y&&(U==="-"||U==="+"))Y=U;else{let V=Number(U);if(!X&&V)X=V;else if(q===-1)q=D+K}}if(q!==-1)J(q,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${Q}`);let G=!1,B="",W=Q.length;for(let K=1;K<F.length;++K){let U=F[K];switch(U.type){case"space":G=!0;case"newline":W+=U.source.length;break;case"comment":if($&&!G)J(U,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");W+=U.source.length,B=U.source.substring(1);break;case"error":J(U,"UNEXPECTED_TOKEN",U.message),W+=U.source.length;break;default:{let V=`Unexpected token in block scalar header: ${U.type}`;J(U,"UNEXPECTED_TOKEN",V);let H=U.source;if(H&&typeof H==="string")W+=H.length}}}return{mode:Z,indent:X,chomp:Y,comment:B,length:W}}function J6D(D){let F=D.split(/\n( *)/),$=F[0],J=$.match(/^( *)/),Z=[J?.[1]?[J[1],$.slice(J[1].length)]:["",$]];for(let X=1;X<F.length;X+=2)Z.push([F[X],F[X+1]]);return Z}Q6D.resolveBlockScalar=F6D});var SV=w((V6D)=>{var jV=rD(),X6D=Q9();function Y6D(D,F,$){let{offset:J,type:Q,source:Z,end:X}=D,Y,q,G=(K,U,V)=>$(J+K,U,V);switch(Q){case"scalar":Y=jV.Scalar.PLAIN,q=q6D(Z,G);break;case"single-quoted-scalar":Y=jV.Scalar.QUOTE_SINGLE,q=G6D(Z,G);break;case"double-quoted-scalar":Y=jV.Scalar.QUOTE_DOUBLE,q=B6D(Z,G);break;default:return $(D,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${Q}`),{value:"",type:null,comment:"",range:[J,J+Z.length,J+Z.length]}}let B=J+Z.length,W=X6D.resolveEnd(X,B,F,$);return{value:q,type:Y,comment:W.comment,range:[J,B,W.offset]}}function q6D(D,F){let $="";switch(D[0]){case"\t":$="a tab character";break;case",":$="flow indicator character ,";break;case"%":$="directive indicator character %";break;case"|":case">":{$=`block scalar indicator ${D[0]}`;break}case"@":case"`":{$=`reserved character ${D[0]}`;break}}if($)F(0,"BAD_SCALAR_START",`Plain value cannot start with ${$}`);return zx(D)}function G6D(D,F){if(D[D.length-1]!=="'"||D.length===1)F(D.length,"MISSING_CHAR","Missing closing 'quote");return zx(D.slice(1,-1)).replace(/''/g,"'")}function zx(D){let F,$;try{F=new RegExp(`(.*?)(?<![ ])[ ]*\r?
179
179
  `,"sy"),$=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
180
180
  `,"sy")}catch{F=/(.*?)[ \t]*\r?\n/sy,$=/[ \t]*(.*?)[ \t]*\r?\n/sy}let J=F.exec(D);if(!J)return D;let Q=J[1],Z=" ",X=F.lastIndex;$.lastIndex=X;while(J=$.exec(D)){if(J[1]==="")if(Z===`
181
181
  `)Q+=Z;else Z=`
@@ -190,14 +190,14 @@ ${G}
190
190
  `)break;if(J===`
191
191
  `)$+=`
192
192
  `;F+=1,J=D[F+1]}if(!$)$=" ";return{fold:$,offset:F}}var K6D={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
193
- `,r:"\r",t:"\t",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function U6D(D,F,$,J){let Q=D.substr(F,$),X=Q.length===$&&/^[0-9a-fA-F]+$/.test(Q)?parseInt(Q,16):NaN;if(isNaN(X)){let Y=D.substr(F-2,$+2);return J(F-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${Y}`),Y}return String.fromCodePoint(X)}V6D.resolveFlowScalar=Y6D});var _x=I((E6D)=>{var f3=BD(),Cx=rD(),z6D=PV(),C6D=SV();function _6D(D,F,$,J){let{value:Q,type:Z,comment:X,range:Y}=F.type==="block-scalar"?z6D.resolveBlockScalar(D,F,J):C6D.resolveFlowScalar(F,D.options.strict,J),q=$?D.directives.tagName($.source,(W)=>J($,"TAG_RESOLVE_FAILED",W)):null,G;if(D.options.stringKeys&&D.atKey)G=D.schema[f3.SCALAR];else if(q)G=M6D(D.schema,Q,q,$,J);else if(F.type==="scalar")G=O6D(D,Q,F,J);else G=D.schema[f3.SCALAR];let B;try{let W=G.resolve(Q,(K)=>J($??F,"TAG_RESOLVE_FAILED",K),D.options);B=f3.isScalar(W)?W:new Cx.Scalar(W)}catch(W){let K=W instanceof Error?W.message:String(W);J($??F,"TAG_RESOLVE_FAILED",K),B=new Cx.Scalar(Q)}if(B.range=Y,B.source=Q,Z)B.type=Z;if(q)B.tag=q;if(G.format)B.format=G.format;if(X)B.comment=X;return B}function M6D(D,F,$,J,Q){if($==="!")return D[f3.SCALAR];let Z=[];for(let Y of D.tags)if(!Y.collection&&Y.tag===$)if(Y.default&&Y.test)Z.push(Y);else return Y;for(let Y of Z)if(Y.test?.test(F))return Y;let X=D.knownTags[$];if(X&&!X.collection)return D.tags.push(Object.assign({},X,{default:!1,test:void 0})),X;return Q(J,"TAG_RESOLVE_FAILED",`Unresolved tag: ${$}`,$!=="tag:yaml.org,2002:str"),D[f3.SCALAR]}function O6D({atKey:D,directives:F,schema:$},J,Q,Z){let X=$.tags.find((Y)=>(Y.default===!0||D&&Y.default==="key")&&Y.test?.test(J))||$[f3.SCALAR];if($.compat){let Y=$.compat.find((q)=>q.default&&q.test?.test(J))??$[f3.SCALAR];if(X.tag!==Y.tag){let q=F.tagString(X.tag),G=F.tagString(Y.tag),B=`Value may be parsed as either ${q} or ${G}`;Z(Q,"TAG_RESOLVE_FAILED",B,!0)}}return X}E6D.composeScalar=_6D});var Mx=I((I6D)=>{function A6D(D,F,$){if(F){$??($=F.length);for(let J=$-1;J>=0;--J){let Q=F[J];switch(Q.type){case"space":case"comment":case"newline":D-=Q.source.length;continue}Q=F[++J];while(Q?.type==="space")D+=Q.source.length,Q=F[++J];break}}return D}I6D.emptyScalarPosition=A6D});var Rx=I((k6D)=>{var N6D=C5(),T6D=BD(),L6D=Hx(),Ox=_x(),P6D=Q9(),j6D=Mx(),S6D={composeNode:Ex,composeEmptyNode:xV};function Ex(D,F,$,J){let Q=D.atKey,{spaceBefore:Z,comment:X,anchor:Y,tag:q}=$,G,B=!0;switch(F.type){case"alias":if(G=x6D(D,F,J),Y||q)J(F,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(G=Ox.composeScalar(D,F,q,J),Y)G.anchor=Y.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":if(G=L6D.composeCollection(S6D,D,F,$,J),Y)G.anchor=Y.source.substring(1);break;default:{let W=F.type==="error"?F.message:`Unsupported token (type: ${F.type})`;J(F,"UNEXPECTED_TOKEN",W),G=xV(D,F.offset,void 0,null,$,J),B=!1}}if(Y&&G.anchor==="")J(Y,"BAD_ALIAS","Anchor cannot be an empty string");if(Q&&D.options.stringKeys&&(!T6D.isScalar(G)||typeof G.value!=="string"||G.tag&&G.tag!=="tag:yaml.org,2002:str"))J(q??F,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(Z)G.spaceBefore=!0;if(X)if(F.type==="scalar"&&F.source==="")G.comment=X;else G.commentBefore=X;if(D.options.keepSourceTokens&&B)G.srcToken=F;return G}function xV(D,F,$,J,{spaceBefore:Q,comment:Z,anchor:X,tag:Y,end:q},G){let B={type:"scalar",offset:j6D.emptyScalarPosition(F,$,J),indent:-1,source:""},W=Ox.composeScalar(D,B,Y,G);if(X){if(W.anchor=X.source.substring(1),W.anchor==="")G(X,"BAD_ALIAS","Anchor cannot be an empty string")}if(Q)W.spaceBefore=!0;if(Z)W.comment=Z,W.range[2]=q;return W}function x6D({options:D},{offset:F,source:$,end:J},Q){let Z=new N6D.Alias($.substring(1));if(Z.source==="")Q(F,"BAD_ALIAS","Alias cannot be an empty string");if(Z.source.endsWith(":"))Q(F+$.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let X=F+$.length,Y=P6D.resolveEnd(J,X,D.strict,Q);if(Z.range=[F,X,Y.offset],Y.comment)Z.comment=Y.comment;return Z}k6D.composeEmptyNode=xV;k6D.composeNode=Ex});var Ix=I((g6D)=>{var b6D=x5(),Ax=Rx(),v6D=Q9(),h6D=y5();function u6D(D,F,{offset:$,start:J,value:Q,end:Z},X){let Y=Object.assign({_directives:F},D),q=new b6D.Document(void 0,Y),G={atKey:!1,atRoot:!0,directives:q.directives,options:q.options,schema:q.schema},B=h6D.resolveProps(J,{indicator:"doc-start",next:Q??Z?.[0],offset:$,onError:X,parentIndent:0,startOnNewline:!0});if(B.found){if(q.directives.docStart=!0,Q&&(Q.type==="block-map"||Q.type==="block-seq")&&!B.hasNewline)X(B.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}q.contents=Q?Ax.composeNode(G,Q,B,X):Ax.composeEmptyNode(G,B.end,J,null,B,X);let W=q.contents.range[2],K=v6D.resolveEnd(Z,W,!1,X);if(K.comment)q.comment=K.comment;return q.range=[$,W,K.offset],q}g6D.composeDoc=u6D});var kV=I((i6D)=>{var d6D=r("process"),p6D=vU(),l6D=x5(),f5=k5(),wx=BD(),c6D=Ix(),n6D=Q9();function b5(D){if(typeof D==="number")return[D,D+1];if(Array.isArray(D))return D.length===2?D:[D[0],D[1]];let{offset:F,source:$}=D;return[F,F+(typeof $==="string"?$.length:1)]}function Nx(D){let F="",$=!1,J=!1;for(let Q=0;Q<D.length;++Q){let Z=D[Q];switch(Z[0]){case"#":F+=(F===""?"":J?`
193
+ `,r:"\r",t:"\t",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function U6D(D,F,$,J){let Q=D.substr(F,$),X=Q.length===$&&/^[0-9a-fA-F]+$/.test(Q)?parseInt(Q,16):NaN;if(isNaN(X)){let Y=D.substr(F-2,$+2);return J(F-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${Y}`),Y}return String.fromCodePoint(X)}V6D.resolveFlowScalar=Y6D});var _x=w((E6D)=>{var f3=BD(),Cx=rD(),z6D=PV(),C6D=SV();function _6D(D,F,$,J){let{value:Q,type:Z,comment:X,range:Y}=F.type==="block-scalar"?z6D.resolveBlockScalar(D,F,J):C6D.resolveFlowScalar(F,D.options.strict,J),q=$?D.directives.tagName($.source,(W)=>J($,"TAG_RESOLVE_FAILED",W)):null,G;if(D.options.stringKeys&&D.atKey)G=D.schema[f3.SCALAR];else if(q)G=M6D(D.schema,Q,q,$,J);else if(F.type==="scalar")G=O6D(D,Q,F,J);else G=D.schema[f3.SCALAR];let B;try{let W=G.resolve(Q,(K)=>J($??F,"TAG_RESOLVE_FAILED",K),D.options);B=f3.isScalar(W)?W:new Cx.Scalar(W)}catch(W){let K=W instanceof Error?W.message:String(W);J($??F,"TAG_RESOLVE_FAILED",K),B=new Cx.Scalar(Q)}if(B.range=Y,B.source=Q,Z)B.type=Z;if(q)B.tag=q;if(G.format)B.format=G.format;if(X)B.comment=X;return B}function M6D(D,F,$,J,Q){if($==="!")return D[f3.SCALAR];let Z=[];for(let Y of D.tags)if(!Y.collection&&Y.tag===$)if(Y.default&&Y.test)Z.push(Y);else return Y;for(let Y of Z)if(Y.test?.test(F))return Y;let X=D.knownTags[$];if(X&&!X.collection)return D.tags.push(Object.assign({},X,{default:!1,test:void 0})),X;return Q(J,"TAG_RESOLVE_FAILED",`Unresolved tag: ${$}`,$!=="tag:yaml.org,2002:str"),D[f3.SCALAR]}function O6D({atKey:D,directives:F,schema:$},J,Q,Z){let X=$.tags.find((Y)=>(Y.default===!0||D&&Y.default==="key")&&Y.test?.test(J))||$[f3.SCALAR];if($.compat){let Y=$.compat.find((q)=>q.default&&q.test?.test(J))??$[f3.SCALAR];if(X.tag!==Y.tag){let q=F.tagString(X.tag),G=F.tagString(Y.tag),B=`Value may be parsed as either ${q} or ${G}`;Z(Q,"TAG_RESOLVE_FAILED",B,!0)}}return X}E6D.composeScalar=_6D});var Mx=w((I6D)=>{function A6D(D,F,$){if(F){$??($=F.length);for(let J=$-1;J>=0;--J){let Q=F[J];switch(Q.type){case"space":case"comment":case"newline":D-=Q.source.length;continue}Q=F[++J];while(Q?.type==="space")D+=Q.source.length,Q=F[++J];break}}return D}I6D.emptyScalarPosition=A6D});var Rx=w((k6D)=>{var N6D=C5(),T6D=BD(),L6D=Hx(),Ox=_x(),P6D=Q9(),j6D=Mx(),S6D={composeNode:Ex,composeEmptyNode:xV};function Ex(D,F,$,J){let Q=D.atKey,{spaceBefore:Z,comment:X,anchor:Y,tag:q}=$,G,B=!0;switch(F.type){case"alias":if(G=x6D(D,F,J),Y||q)J(F,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(G=Ox.composeScalar(D,F,q,J),Y)G.anchor=Y.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":if(G=L6D.composeCollection(S6D,D,F,$,J),Y)G.anchor=Y.source.substring(1);break;default:{let W=F.type==="error"?F.message:`Unsupported token (type: ${F.type})`;J(F,"UNEXPECTED_TOKEN",W),G=xV(D,F.offset,void 0,null,$,J),B=!1}}if(Y&&G.anchor==="")J(Y,"BAD_ALIAS","Anchor cannot be an empty string");if(Q&&D.options.stringKeys&&(!T6D.isScalar(G)||typeof G.value!=="string"||G.tag&&G.tag!=="tag:yaml.org,2002:str"))J(q??F,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(Z)G.spaceBefore=!0;if(X)if(F.type==="scalar"&&F.source==="")G.comment=X;else G.commentBefore=X;if(D.options.keepSourceTokens&&B)G.srcToken=F;return G}function xV(D,F,$,J,{spaceBefore:Q,comment:Z,anchor:X,tag:Y,end:q},G){let B={type:"scalar",offset:j6D.emptyScalarPosition(F,$,J),indent:-1,source:""},W=Ox.composeScalar(D,B,Y,G);if(X){if(W.anchor=X.source.substring(1),W.anchor==="")G(X,"BAD_ALIAS","Anchor cannot be an empty string")}if(Q)W.spaceBefore=!0;if(Z)W.comment=Z,W.range[2]=q;return W}function x6D({options:D},{offset:F,source:$,end:J},Q){let Z=new N6D.Alias($.substring(1));if(Z.source==="")Q(F,"BAD_ALIAS","Alias cannot be an empty string");if(Z.source.endsWith(":"))Q(F+$.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let X=F+$.length,Y=P6D.resolveEnd(J,X,D.strict,Q);if(Z.range=[F,X,Y.offset],Y.comment)Z.comment=Y.comment;return Z}k6D.composeEmptyNode=xV;k6D.composeNode=Ex});var Ix=w((g6D)=>{var b6D=x5(),Ax=Rx(),v6D=Q9(),h6D=y5();function u6D(D,F,{offset:$,start:J,value:Q,end:Z},X){let Y=Object.assign({_directives:F},D),q=new b6D.Document(void 0,Y),G={atKey:!1,atRoot:!0,directives:q.directives,options:q.options,schema:q.schema},B=h6D.resolveProps(J,{indicator:"doc-start",next:Q??Z?.[0],offset:$,onError:X,parentIndent:0,startOnNewline:!0});if(B.found){if(q.directives.docStart=!0,Q&&(Q.type==="block-map"||Q.type==="block-seq")&&!B.hasNewline)X(B.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}q.contents=Q?Ax.composeNode(G,Q,B,X):Ax.composeEmptyNode(G,B.end,J,null,B,X);let W=q.contents.range[2],K=v6D.resolveEnd(Z,W,!1,X);if(K.comment)q.comment=K.comment;return q.range=[$,W,K.offset],q}g6D.composeDoc=u6D});var kV=w((i6D)=>{var d6D=r("process"),p6D=vU(),l6D=x5(),f5=k5(),wx=BD(),c6D=Ix(),n6D=Q9();function b5(D){if(typeof D==="number")return[D,D+1];if(Array.isArray(D))return D.length===2?D:[D[0],D[1]];let{offset:F,source:$}=D;return[F,F+(typeof $==="string"?$.length:1)]}function Nx(D){let F="",$=!1,J=!1;for(let Q=0;Q<D.length;++Q){let Z=D[Q];switch(Z[0]){case"#":F+=(F===""?"":J?`
194
194
 
195
195
  `:`
196
196
  `)+(Z.substring(1)||" "),$=!0,J=!1;break;case"%":if(D[Q+1]?.[0]!=="#")Q+=1;$=!1;break;default:if(!$)J=!0;$=!1}}return{comment:F,afterEmptyLine:J}}class Tx{constructor(D={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(F,$,J,Q)=>{let Z=b5(F);if(Q)this.warnings.push(new f5.YAMLWarning(Z,$,J));else this.errors.push(new f5.YAMLParseError(Z,$,J))},this.directives=new p6D.Directives({version:D.version||"1.2"}),this.options=D}decorate(D,F){let{comment:$,afterEmptyLine:J}=Nx(this.prelude);if($){let Q=D.contents;if(F)D.comment=D.comment?`${D.comment}
197
197
  ${$}`:$;else if(J||D.directives.docStart||!Q)D.commentBefore=$;else if(wx.isCollection(Q)&&!Q.flow&&Q.items.length>0){let Z=Q.items[0];if(wx.isPair(Z))Z=Z.key;let X=Z.commentBefore;Z.commentBefore=X?`${$}
198
198
  ${X}`:$}else{let Z=Q.commentBefore;Q.commentBefore=Z?`${$}
199
199
  ${Z}`:$}}if(F)Array.prototype.push.apply(D.errors,this.errors),Array.prototype.push.apply(D.warnings,this.warnings);else D.errors=this.errors,D.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Nx(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(D,F=!1,$=-1){for(let J of D)yield*this.next(J);yield*this.end(F,$)}*next(D){if(d6D.env.LOG_STREAM)console.dir(D,{depth:null});switch(D.type){case"directive":this.directives.add(D.source,(F,$,J)=>{let Q=b5(D);Q[0]+=F,this.onError(Q,"BAD_DIRECTIVE",$,J)}),this.prelude.push(D.source),this.atDirectives=!0;break;case"document":{let F=c6D.composeDoc(this.options,this.directives,D,this.onError);if(this.atDirectives&&!F.directives.docStart)this.onError(D,"MISSING_CHAR","Missing directives-end/doc-start indicator line");if(this.decorate(F,!1),this.doc)yield this.doc;this.doc=F,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(D.source);break;case"error":{let F=D.source?`${D.message}: ${JSON.stringify(D.source)}`:D.message,$=new f5.YAMLParseError(b5(D),"UNEXPECTED_TOKEN",F);if(this.atDirectives||!this.doc)this.errors.push($);else this.doc.errors.push($);break}case"doc-end":{if(!this.doc){this.errors.push(new f5.YAMLParseError(b5(D),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let F=n6D.resolveEnd(D.end,D.offset+D.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),F.comment){let $=this.doc.comment;this.doc.comment=$?`${$}
200
- ${F.comment}`:F.comment}this.doc.range[2]=F.offset;break}default:this.errors.push(new f5.YAMLParseError(b5(D),"UNEXPECTED_TOKEN",`Unsupported token ${D.type}`))}}*end(D=!1,F=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(D){let $=Object.assign({_directives:this.directives},this.options),J=new l6D.Document(void 0,$);if(this.atDirectives)this.onError(F,"MISSING_CHAR","Missing directives-end indicator line");J.range=[0,F,F],this.decorate(J,!1),yield J}}}i6D.Composer=Tx});var jx=I(($7D)=>{var a6D=PV(),r6D=SV(),s6D=k5(),Lx=E5();function t6D(D,F=!0,$){if(D){let J=(Q,Z,X)=>{let Y=typeof Q==="number"?Q:Array.isArray(Q)?Q[0]:Q.offset;if($)$(Y,Z,X);else throw new s6D.YAMLParseError([Y,Y+1],Z,X)};switch(D.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return r6D.resolveFlowScalar(D,F,J);case"block-scalar":return a6D.resolveBlockScalar({options:{strict:F}},D,J)}}return null}function e6D(D,F){let{implicitKey:$=!1,indent:J,inFlow:Q=!1,offset:Z=-1,type:X="PLAIN"}=F,Y=Lx.stringifyString({type:X,value:D},{implicitKey:$,indent:J>0?" ".repeat(J):"",inFlow:Q,options:{blockQuote:!0,lineWidth:-1}}),q=F.end??[{type:"newline",offset:-1,indent:J,source:`
200
+ ${F.comment}`:F.comment}this.doc.range[2]=F.offset;break}default:this.errors.push(new f5.YAMLParseError(b5(D),"UNEXPECTED_TOKEN",`Unsupported token ${D.type}`))}}*end(D=!1,F=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(D){let $=Object.assign({_directives:this.directives},this.options),J=new l6D.Document(void 0,$);if(this.atDirectives)this.onError(F,"MISSING_CHAR","Missing directives-end indicator line");J.range=[0,F,F],this.decorate(J,!1),yield J}}}i6D.Composer=Tx});var jx=w(($7D)=>{var a6D=PV(),r6D=SV(),s6D=k5(),Lx=E5();function t6D(D,F=!0,$){if(D){let J=(Q,Z,X)=>{let Y=typeof Q==="number"?Q:Array.isArray(Q)?Q[0]:Q.offset;if($)$(Y,Z,X);else throw new s6D.YAMLParseError([Y,Y+1],Z,X)};switch(D.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return r6D.resolveFlowScalar(D,F,J);case"block-scalar":return a6D.resolveBlockScalar({options:{strict:F}},D,J)}}return null}function e6D(D,F){let{implicitKey:$=!1,indent:J,inFlow:Q=!1,offset:Z=-1,type:X="PLAIN"}=F,Y=Lx.stringifyString({type:X,value:D},{implicitKey:$,indent:J>0?" ".repeat(J):"",inFlow:Q,options:{blockQuote:!0,lineWidth:-1}}),q=F.end??[{type:"newline",offset:-1,indent:J,source:`
201
201
  `}];switch(Y[0]){case"|":case">":{let G=Y.indexOf(`
202
202
  `),B=Y.substring(0,G),W=Y.substring(G+1)+`
203
203
  `,K=[{type:"block-scalar-header",offset:Z,indent:J,source:B}];if(!Px(K,q))K.push({type:"newline",offset:-1,indent:J,source:`
@@ -205,9 +205,9 @@ ${F.comment}`:F.comment}this.doc.range[2]=F.offset;break}default:this.errors.pus
205
205
  `),J=F.substring(0,$),Q=F.substring($+1)+`
206
206
  `;if(D.type==="block-scalar"){let Z=D.props[0];if(Z.type!=="block-scalar-header")throw Error("Invalid block scalar header");Z.source=J,D.source=Q}else{let{offset:Z}=D,X="indent"in D?D.indent:-1,Y=[{type:"block-scalar-header",offset:Z,indent:X,source:J}];if(!Px(Y,"end"in D?D.end:void 0))Y.push({type:"newline",offset:-1,indent:X,source:`
207
207
  `});for(let q of Object.keys(D))if(q!=="type"&&q!=="offset")delete D[q];Object.assign(D,{type:"block-scalar",indent:X,props:Y,source:Q})}}function Px(D,F){if(F)for(let $ of F)switch($.type){case"space":case"comment":D.push($);break;case"newline":return D.push($),!0}return!1}function yV(D,F,$){switch(D.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":D.type=$,D.source=F;break;case"block-scalar":{let J=D.props.slice(1),Q=F.length;if(D.props[0].type==="block-scalar-header")Q-=D.props[0].source.length;for(let Z of J)Z.offset+=Q;delete D.props,Object.assign(D,{type:$,source:F,end:J});break}case"block-map":case"block-seq":{let Q={type:"newline",offset:D.offset+F.length,indent:D.indent,source:`
208
- `};delete D.items,Object.assign(D,{type:$,source:F,end:[Q]});break}default:{let J="indent"in D?D.indent:-1,Q="end"in D&&Array.isArray(D.end)?D.end.filter((Z)=>Z.type==="space"||Z.type==="comment"||Z.type==="newline"):[];for(let Z of Object.keys(D))if(Z!=="type"&&Z!=="offset")delete D[Z];Object.assign(D,{type:$,indent:J,source:F,end:Q})}}}$7D.createScalarToken=e6D;$7D.resolveAsScalar=t6D;$7D.setScalarValue=D7D});var Sx=I((Y7D)=>{var X7D=(D)=>("type"in D)?aX(D):oX(D);function aX(D){switch(D.type){case"block-scalar":{let F="";for(let $ of D.props)F+=aX($);return F+D.source}case"block-map":case"block-seq":{let F="";for(let $ of D.items)F+=oX($);return F}case"flow-collection":{let F=D.start.source;for(let $ of D.items)F+=oX($);for(let $ of D.end)F+=$.source;return F}case"document":{let F=oX(D);if(D.end)for(let $ of D.end)F+=$.source;return F}default:{let F=D.source;if("end"in D&&D.end)for(let $ of D.end)F+=$.source;return F}}}function oX({start:D,key:F,sep:$,value:J}){let Q="";for(let Z of D)Q+=Z.source;if(F)Q+=aX(F);if($)for(let Z of $)Q+=Z.source;if(J)Q+=aX(J);return Q}Y7D.stringify=X7D});var yx=I((B7D)=>{var fV=Symbol("break visit"),G7D=Symbol("skip children"),xx=Symbol("remove item");function b3(D,F){if("type"in D&&D.type==="document")D={start:D.start,value:D.value};kx(Object.freeze([]),D,F)}b3.BREAK=fV;b3.SKIP=G7D;b3.REMOVE=xx;b3.itemAtPath=(D,F)=>{let $=D;for(let[J,Q]of F){let Z=$?.[J];if(Z&&"items"in Z)$=Z.items[Q];else return}return $};b3.parentCollection=(D,F)=>{let $=b3.itemAtPath(D,F.slice(0,-1)),J=F[F.length-1][0],Q=$?.[J];if(Q&&"items"in Q)return Q;throw Error("Parent collection not found")};function kx(D,F,$){let J=$(F,D);if(typeof J==="symbol")return J;for(let Q of["key","value"]){let Z=F[Q];if(Z&&"items"in Z){for(let X=0;X<Z.items.length;++X){let Y=kx(Object.freeze(D.concat([[Q,X]])),Z.items[X],$);if(typeof Y==="number")X=Y-1;else if(Y===fV)return fV;else if(Y===xx)Z.items.splice(X,1),X-=1}if(typeof J==="function"&&Q==="key")J=J(F,D)}}return typeof J==="function"?J(F,D):J}B7D.visit=b3});var rX=I((_7D)=>{var bV=jx(),K7D=Sx(),U7D=yx(),vV="\uFEFF",hV="\x02",uV="\x18",gV="\x1F",V7D=(D)=>!!D&&("items"in D),H7D=(D)=>!!D&&(D.type==="scalar"||D.type==="single-quoted-scalar"||D.type==="double-quoted-scalar"||D.type==="block-scalar");function z7D(D){switch(D){case vV:return"<BOM>";case hV:return"<DOC>";case uV:return"<FLOW_END>";case gV:return"<SCALAR>";default:return JSON.stringify(D)}}function C7D(D){switch(D){case vV:return"byte-order-mark";case hV:return"doc-mode";case uV:return"flow-error-end";case gV:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
208
+ `};delete D.items,Object.assign(D,{type:$,source:F,end:[Q]});break}default:{let J="indent"in D?D.indent:-1,Q="end"in D&&Array.isArray(D.end)?D.end.filter((Z)=>Z.type==="space"||Z.type==="comment"||Z.type==="newline"):[];for(let Z of Object.keys(D))if(Z!=="type"&&Z!=="offset")delete D[Z];Object.assign(D,{type:$,indent:J,source:F,end:Q})}}}$7D.createScalarToken=e6D;$7D.resolveAsScalar=t6D;$7D.setScalarValue=D7D});var Sx=w((Y7D)=>{var X7D=(D)=>("type"in D)?aX(D):oX(D);function aX(D){switch(D.type){case"block-scalar":{let F="";for(let $ of D.props)F+=aX($);return F+D.source}case"block-map":case"block-seq":{let F="";for(let $ of D.items)F+=oX($);return F}case"flow-collection":{let F=D.start.source;for(let $ of D.items)F+=oX($);for(let $ of D.end)F+=$.source;return F}case"document":{let F=oX(D);if(D.end)for(let $ of D.end)F+=$.source;return F}default:{let F=D.source;if("end"in D&&D.end)for(let $ of D.end)F+=$.source;return F}}}function oX({start:D,key:F,sep:$,value:J}){let Q="";for(let Z of D)Q+=Z.source;if(F)Q+=aX(F);if($)for(let Z of $)Q+=Z.source;if(J)Q+=aX(J);return Q}Y7D.stringify=X7D});var yx=w((B7D)=>{var fV=Symbol("break visit"),G7D=Symbol("skip children"),xx=Symbol("remove item");function b3(D,F){if("type"in D&&D.type==="document")D={start:D.start,value:D.value};kx(Object.freeze([]),D,F)}b3.BREAK=fV;b3.SKIP=G7D;b3.REMOVE=xx;b3.itemAtPath=(D,F)=>{let $=D;for(let[J,Q]of F){let Z=$?.[J];if(Z&&"items"in Z)$=Z.items[Q];else return}return $};b3.parentCollection=(D,F)=>{let $=b3.itemAtPath(D,F.slice(0,-1)),J=F[F.length-1][0],Q=$?.[J];if(Q&&"items"in Q)return Q;throw Error("Parent collection not found")};function kx(D,F,$){let J=$(F,D);if(typeof J==="symbol")return J;for(let Q of["key","value"]){let Z=F[Q];if(Z&&"items"in Z){for(let X=0;X<Z.items.length;++X){let Y=kx(Object.freeze(D.concat([[Q,X]])),Z.items[X],$);if(typeof Y==="number")X=Y-1;else if(Y===fV)return fV;else if(Y===xx)Z.items.splice(X,1),X-=1}if(typeof J==="function"&&Q==="key")J=J(F,D)}}return typeof J==="function"?J(F,D):J}B7D.visit=b3});var rX=w((_7D)=>{var bV=jx(),K7D=Sx(),U7D=yx(),vV="\uFEFF",hV="\x02",uV="\x18",gV="\x1F",V7D=(D)=>!!D&&("items"in D),H7D=(D)=>!!D&&(D.type==="scalar"||D.type==="single-quoted-scalar"||D.type==="double-quoted-scalar"||D.type==="block-scalar");function z7D(D){switch(D){case vV:return"<BOM>";case hV:return"<DOC>";case uV:return"<FLOW_END>";case gV:return"<SCALAR>";default:return JSON.stringify(D)}}function C7D(D){switch(D){case vV:return"byte-order-mark";case hV:return"doc-mode";case uV:return"flow-error-end";case gV:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
209
209
  `:case`\r
210
- `: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(D[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}_7D.createScalarToken=bV.createScalarToken;_7D.resolveAsScalar=bV.resolveAsScalar;_7D.setScalarValue=bV.setScalarValue;_7D.stringify=K7D.stringify;_7D.visit=U7D.visit;_7D.BOM=vV;_7D.DOCUMENT=hV;_7D.FLOW_END=uV;_7D.SCALAR=gV;_7D.isCollection=V7D;_7D.isScalar=H7D;_7D.prettyToken=z7D;_7D.tokenType=C7D});var dV=I((y7D)=>{var v5=rX();function $8(D){switch(D){case void 0:case" ":case`
210
+ `: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(D[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}_7D.createScalarToken=bV.createScalarToken;_7D.resolveAsScalar=bV.resolveAsScalar;_7D.setScalarValue=bV.setScalarValue;_7D.stringify=K7D.stringify;_7D.visit=U7D.visit;_7D.BOM=vV;_7D.DOCUMENT=hV;_7D.FLOW_END=uV;_7D.SCALAR=gV;_7D.isCollection=V7D;_7D.isScalar=H7D;_7D.prettyToken=z7D;_7D.tokenType=C7D});var dV=w((y7D)=>{var v5=rX();function $8(D){switch(D){case void 0:case" ":case`
211
211
  `:case"\r":case"\t":return!0;default:return!1}}var fx=new Set("0123456789ABCDEFabcdef"),x7D=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),sX=new Set(",[]{}"),k7D=new Set(` ,[]{}
212
212
  \r `),mV=(D)=>!D||k7D.has(D);class bx{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(D,F=!1){if(D){if(typeof D!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+D:D,this.lineEndPos=null}this.atEnd=!F;let $=this.next??"stream";while($&&(F||this.hasChars(1)))$=yield*this.parseNext($)}atLineEnd(){let D=this.pos,F=this.buffer[D];while(F===" "||F==="\t")F=this.buffer[++D];if(!F||F==="#"||F===`
213
213
  `)return!0;if(F==="\r")return this.buffer[D+1]===`
@@ -226,23 +226,23 @@ ${F.comment}`:F.comment}this.doc.range[2]=F.offset;break}default:this.errors.pus
226
226
  `,Q=this.buffer[$+1];else F=$;if(Q==="#"||D&&sX.has(Q))break;if(J===`
227
227
  `){let Z=this.continueScalar($+1);if(Z===-1)break;$=Math.max($,Z-2)}}else{if(D&&sX.has(J))break;F=$}if(!J&&!this.atEnd)return this.setNext("plain-scalar");return yield v5.SCALAR,yield*this.pushToIndex(F+1,!0),D?"flow":"doc"}*pushCount(D){if(D>0)return yield this.buffer.substr(this.pos,D),this.pos+=D,D;return 0}*pushToIndex(D,F){let $=this.buffer.slice(this.pos,D);if($)return yield $,this.pos+=$.length,$.length;else if(F)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(mV))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let D=this.flowLevel>0,F=this.charAt(1);if($8(F)||D&&sX.has(F)){if(!D)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 D=this.pos+2,F=this.buffer[D];while(!$8(F)&&F!==">")F=this.buffer[++D];return yield*this.pushToIndex(F===">"?D+1:D,!1)}else{let D=this.pos+1,F=this.buffer[D];while(F)if(x7D.has(F))F=this.buffer[++D];else if(F==="%"&&fx.has(this.buffer[D+1])&&fx.has(this.buffer[D+2]))F=this.buffer[D+=3];else break;return yield*this.pushToIndex(D,!1)}}*pushNewline(){let D=this.buffer[this.pos];if(D===`
228
228
  `)return yield*this.pushCount(1);else if(D==="\r"&&this.charAt(1)===`
229
- `)return yield*this.pushCount(2);else return 0}*pushSpaces(D){let F=this.pos-1,$;do $=this.buffer[++F];while($===" "||D&&$==="\t");let J=F-this.pos;if(J>0)yield this.buffer.substr(this.pos,J),this.pos=F;return J}*pushUntil(D){let F=this.pos,$=this.buffer[F];while(!D($))$=this.buffer[++F];return yield*this.pushToIndex(F,!1)}}y7D.Lexer=bx});var pV=I((b7D)=>{class vx{constructor(){this.lineStarts=[],this.addNewLine=(D)=>this.lineStarts.push(D),this.linePos=(D)=>{let F=0,$=this.lineStarts.length;while(F<$){let Q=F+$>>1;if(this.lineStarts[Q]<D)F=Q+1;else $=Q}if(this.lineStarts[F]===D)return{line:F+1,col:1};if(F===0)return{line:0,col:D};let J=this.lineStarts[F-1];return{line:F,col:D-J+1}}}}b7D.LineCounter=vx});var lV=I((g7D)=>{var h7D=r("process"),hx=rX(),u7D=dV();function AF(D,F){for(let $=0;$<D.length;++$)if(D[$].type===F)return!0;return!1}function ux(D){for(let F=0;F<D.length;++F)switch(D[F].type){case"space":case"comment":case"newline":break;default:return F}return-1}function mx(D){switch(D?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function tX(D){switch(D.type){case"document":return D.start;case"block-map":{let F=D.items[D.items.length-1];return F.sep??F.start}case"block-seq":return D.items[D.items.length-1].start;default:return[]}}function Z9(D){if(D.length===0)return[];let F=D.length;D:while(--F>=0)switch(D[F].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break D}while(D[++F]?.type==="space");return D.splice(F,D.length)}function gx(D){if(D.start.type==="flow-seq-start"){for(let F of D.items)if(F.sep&&!F.value&&!AF(F.start,"explicit-key-ind")&&!AF(F.sep,"map-value-ind")){if(F.key)F.value=F.key;if(delete F.key,mx(F.value))if(F.value.end)Array.prototype.push.apply(F.value.end,F.sep);else F.value.end=F.sep;else Array.prototype.push.apply(F.start,F.sep);delete F.sep}}}class dx{constructor(D){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new u7D.Lexer,this.onNewLine=D}*parse(D,F=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let $ of this.lexer.lex(D,F))yield*this.next($);if(!F)yield*this.end()}*next(D){if(this.source=D,h7D.env.LOG_TOKENS)console.log("|",hx.prettyToken(D));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=D.length;return}let F=hx.tokenType(D);if(!F){let $=`Not a YAML token: ${D}`;yield*this.pop({type:"error",offset:this.offset,message:$,source:D}),this.offset+=D.length}else if(F==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=F,yield*this.step(),F){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+D.length);break;case"space":if(this.atNewLine&&D[0]===" ")this.indent+=D.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=D.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=D.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 D=this.peek(1);if(this.type==="doc-end"&&D?.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(!D)return yield*this.stream();switch(D.type){case"document":return yield*this.document(D);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(D);case"block-scalar":return yield*this.blockScalar(D);case"block-map":return yield*this.blockMap(D);case"block-seq":return yield*this.blockSequence(D);case"flow-collection":return yield*this.flowCollection(D);case"doc-end":return yield*this.documentEnd(D)}yield*this.pop()}peek(D){return this.stack[this.stack.length-D]}*pop(D){let F=D??this.stack.pop();if(!F)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield F;else{let $=this.peek(1);if(F.type==="block-scalar")F.indent="indent"in $?$.indent:0;else if(F.type==="flow-collection"&&$.type==="document")F.indent=0;if(F.type==="flow-collection")gx(F);switch($.type){case"document":$.value=F;break;case"block-scalar":$.props.push(F);break;case"block-map":{let J=$.items[$.items.length-1];if(J.value){$.items.push({start:[],key:F,sep:[]}),this.onKeyLine=!0;return}else if(J.sep)J.value=F;else{Object.assign(J,{key:F,sep:[]}),this.onKeyLine=!J.explicitKey;return}break}case"block-seq":{let J=$.items[$.items.length-1];if(J.value)$.items.push({start:[],value:F});else J.value=F;break}case"flow-collection":{let J=$.items[$.items.length-1];if(!J||J.value)$.items.push({start:[],key:F,sep:[]});else if(J.sep)J.value=F;else Object.assign(J,{key:F,sep:[]});return}default:yield*this.pop(),yield*this.pop(F)}if(($.type==="document"||$.type==="block-map"||$.type==="block-seq")&&(F.type==="block-map"||F.type==="block-seq")){let J=F.items[F.items.length-1];if(J&&!J.sep&&!J.value&&J.start.length>0&&ux(J.start)===-1&&(F.indent===0||J.start.every((Q)=>Q.type!=="comment"||Q.indent<F.indent))){if($.type==="document")$.end=J.start;else $.items.push({start:J.start});F.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 D={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")D.start.push(this.sourceToken);this.stack.push(D);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(D){if(D.value)return yield*this.lineEnd(D);switch(this.type){case"doc-start":{if(ux(D.start)!==-1)yield*this.pop(),yield*this.step();else D.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":D.start.push(this.sourceToken);return}let F=this.startBlockValue(D);if(F)this.stack.push(F);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(D){if(this.type==="map-value-ind"){let F=tX(this.peek(2)),$=Z9(F),J;if(D.end)J=D.end,J.push(this.sourceToken),delete D.end;else J=[this.sourceToken];let Q={type:"block-map",offset:D.offset,indent:D.indent,items:[{start:$,key:D,sep:J}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=Q}else yield*this.lineEnd(D)}*blockScalar(D){switch(this.type){case"space":case"comment":case"newline":D.props.push(this.sourceToken);return;case"scalar":if(D.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let F=this.source.indexOf(`
229
+ `)return yield*this.pushCount(2);else return 0}*pushSpaces(D){let F=this.pos-1,$;do $=this.buffer[++F];while($===" "||D&&$==="\t");let J=F-this.pos;if(J>0)yield this.buffer.substr(this.pos,J),this.pos=F;return J}*pushUntil(D){let F=this.pos,$=this.buffer[F];while(!D($))$=this.buffer[++F];return yield*this.pushToIndex(F,!1)}}y7D.Lexer=bx});var pV=w((b7D)=>{class vx{constructor(){this.lineStarts=[],this.addNewLine=(D)=>this.lineStarts.push(D),this.linePos=(D)=>{let F=0,$=this.lineStarts.length;while(F<$){let Q=F+$>>1;if(this.lineStarts[Q]<D)F=Q+1;else $=Q}if(this.lineStarts[F]===D)return{line:F+1,col:1};if(F===0)return{line:0,col:D};let J=this.lineStarts[F-1];return{line:F,col:D-J+1}}}}b7D.LineCounter=vx});var lV=w((g7D)=>{var h7D=r("process"),hx=rX(),u7D=dV();function AF(D,F){for(let $=0;$<D.length;++$)if(D[$].type===F)return!0;return!1}function ux(D){for(let F=0;F<D.length;++F)switch(D[F].type){case"space":case"comment":case"newline":break;default:return F}return-1}function mx(D){switch(D?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function tX(D){switch(D.type){case"document":return D.start;case"block-map":{let F=D.items[D.items.length-1];return F.sep??F.start}case"block-seq":return D.items[D.items.length-1].start;default:return[]}}function Z9(D){if(D.length===0)return[];let F=D.length;D:while(--F>=0)switch(D[F].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break D}while(D[++F]?.type==="space");return D.splice(F,D.length)}function gx(D){if(D.start.type==="flow-seq-start"){for(let F of D.items)if(F.sep&&!F.value&&!AF(F.start,"explicit-key-ind")&&!AF(F.sep,"map-value-ind")){if(F.key)F.value=F.key;if(delete F.key,mx(F.value))if(F.value.end)Array.prototype.push.apply(F.value.end,F.sep);else F.value.end=F.sep;else Array.prototype.push.apply(F.start,F.sep);delete F.sep}}}class dx{constructor(D){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new u7D.Lexer,this.onNewLine=D}*parse(D,F=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let $ of this.lexer.lex(D,F))yield*this.next($);if(!F)yield*this.end()}*next(D){if(this.source=D,h7D.env.LOG_TOKENS)console.log("|",hx.prettyToken(D));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=D.length;return}let F=hx.tokenType(D);if(!F){let $=`Not a YAML token: ${D}`;yield*this.pop({type:"error",offset:this.offset,message:$,source:D}),this.offset+=D.length}else if(F==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=F,yield*this.step(),F){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+D.length);break;case"space":if(this.atNewLine&&D[0]===" ")this.indent+=D.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=D.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=D.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 D=this.peek(1);if(this.type==="doc-end"&&D?.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(!D)return yield*this.stream();switch(D.type){case"document":return yield*this.document(D);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(D);case"block-scalar":return yield*this.blockScalar(D);case"block-map":return yield*this.blockMap(D);case"block-seq":return yield*this.blockSequence(D);case"flow-collection":return yield*this.flowCollection(D);case"doc-end":return yield*this.documentEnd(D)}yield*this.pop()}peek(D){return this.stack[this.stack.length-D]}*pop(D){let F=D??this.stack.pop();if(!F)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield F;else{let $=this.peek(1);if(F.type==="block-scalar")F.indent="indent"in $?$.indent:0;else if(F.type==="flow-collection"&&$.type==="document")F.indent=0;if(F.type==="flow-collection")gx(F);switch($.type){case"document":$.value=F;break;case"block-scalar":$.props.push(F);break;case"block-map":{let J=$.items[$.items.length-1];if(J.value){$.items.push({start:[],key:F,sep:[]}),this.onKeyLine=!0;return}else if(J.sep)J.value=F;else{Object.assign(J,{key:F,sep:[]}),this.onKeyLine=!J.explicitKey;return}break}case"block-seq":{let J=$.items[$.items.length-1];if(J.value)$.items.push({start:[],value:F});else J.value=F;break}case"flow-collection":{let J=$.items[$.items.length-1];if(!J||J.value)$.items.push({start:[],key:F,sep:[]});else if(J.sep)J.value=F;else Object.assign(J,{key:F,sep:[]});return}default:yield*this.pop(),yield*this.pop(F)}if(($.type==="document"||$.type==="block-map"||$.type==="block-seq")&&(F.type==="block-map"||F.type==="block-seq")){let J=F.items[F.items.length-1];if(J&&!J.sep&&!J.value&&J.start.length>0&&ux(J.start)===-1&&(F.indent===0||J.start.every((Q)=>Q.type!=="comment"||Q.indent<F.indent))){if($.type==="document")$.end=J.start;else $.items.push({start:J.start});F.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 D={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")D.start.push(this.sourceToken);this.stack.push(D);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(D){if(D.value)return yield*this.lineEnd(D);switch(this.type){case"doc-start":{if(ux(D.start)!==-1)yield*this.pop(),yield*this.step();else D.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":D.start.push(this.sourceToken);return}let F=this.startBlockValue(D);if(F)this.stack.push(F);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(D){if(this.type==="map-value-ind"){let F=tX(this.peek(2)),$=Z9(F),J;if(D.end)J=D.end,J.push(this.sourceToken),delete D.end;else J=[this.sourceToken];let Q={type:"block-map",offset:D.offset,indent:D.indent,items:[{start:$,key:D,sep:J}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=Q}else yield*this.lineEnd(D)}*blockScalar(D){switch(this.type){case"space":case"comment":case"newline":D.props.push(this.sourceToken);return;case"scalar":if(D.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let F=this.source.indexOf(`
230
230
  `)+1;while(F!==0)this.onNewLine(this.offset+F),F=this.source.indexOf(`
231
231
  `,F)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(D){let F=D.items[D.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,F.value){let $="end"in F.value?F.value.end:void 0;if((Array.isArray($)?$[$.length-1]:void 0)?.type==="comment")$?.push(this.sourceToken);else D.items.push({start:[this.sourceToken]})}else if(F.sep)F.sep.push(this.sourceToken);else F.start.push(this.sourceToken);return;case"space":case"comment":if(F.value)D.items.push({start:[this.sourceToken]});else if(F.sep)F.sep.push(this.sourceToken);else{if(this.atIndentedComment(F.start,D.indent)){let J=D.items[D.items.length-2]?.value?.end;if(Array.isArray(J)){Array.prototype.push.apply(J,F.start),J.push(this.sourceToken),D.items.pop();return}}F.start.push(this.sourceToken)}return}if(this.indent>=D.indent){let $=!this.onKeyLine&&this.indent===D.indent,J=$&&(F.sep||F.explicitKey)&&this.type!=="seq-item-ind",Q=[];if(J&&F.sep&&!F.value){let Z=[];for(let X=0;X<F.sep.length;++X){let Y=F.sep[X];switch(Y.type){case"newline":Z.push(X);break;case"space":break;case"comment":if(Y.indent>D.indent)Z.length=0;break;default:Z.length=0}}if(Z.length>=2)Q=F.sep.splice(Z[1])}switch(this.type){case"anchor":case"tag":if(J||F.value)Q.push(this.sourceToken),D.items.push({start:Q}),this.onKeyLine=!0;else if(F.sep)F.sep.push(this.sourceToken);else F.start.push(this.sourceToken);return;case"explicit-key-ind":if(!F.sep&&!F.explicitKey)F.start.push(this.sourceToken),F.explicitKey=!0;else if(J||F.value)Q.push(this.sourceToken),D.items.push({start:Q,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(F.explicitKey)if(!F.sep)if(AF(F.start,"newline"))Object.assign(F,{key:null,sep:[this.sourceToken]});else{let Z=Z9(F.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Z,key:null,sep:[this.sourceToken]}]})}else if(F.value)D.items.push({start:[],key:null,sep:[this.sourceToken]});else if(AF(F.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Q,key:null,sep:[this.sourceToken]}]});else if(mx(F.key)&&!AF(F.sep,"newline")){let Z=Z9(F.start),X=F.key,Y=F.sep;Y.push(this.sourceToken),delete F.key,delete F.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Z,key:X,sep:Y}]})}else if(Q.length>0)F.sep=F.sep.concat(Q,this.sourceToken);else F.sep.push(this.sourceToken);else if(!F.sep)Object.assign(F,{key:null,sep:[this.sourceToken]});else if(F.value||J)D.items.push({start:Q,key:null,sep:[this.sourceToken]});else if(AF(F.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else F.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let Z=this.flowScalar(this.type);if(J||F.value)D.items.push({start:Q,key:Z,sep:[]}),this.onKeyLine=!0;else if(F.sep)this.stack.push(Z);else Object.assign(F,{key:Z,sep:[]}),this.onKeyLine=!0;return}default:{let Z=this.startBlockValue(D);if(Z){if(Z.type==="block-seq"){if(!F.explicitKey&&F.sep&&!AF(F.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($)D.items.push({start:Q});this.stack.push(Z);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(D){let F=D.items[D.items.length-1];switch(this.type){case"newline":if(F.value){let $="end"in F.value?F.value.end:void 0;if((Array.isArray($)?$[$.length-1]:void 0)?.type==="comment")$?.push(this.sourceToken);else D.items.push({start:[this.sourceToken]})}else F.start.push(this.sourceToken);return;case"space":case"comment":if(F.value)D.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(F.start,D.indent)){let J=D.items[D.items.length-2]?.value?.end;if(Array.isArray(J)){Array.prototype.push.apply(J,F.start),J.push(this.sourceToken),D.items.pop();return}}F.start.push(this.sourceToken)}return;case"anchor":case"tag":if(F.value||this.indent<=D.indent)break;F.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==D.indent)break;if(F.value||AF(F.start,"seq-item-ind"))D.items.push({start:[this.sourceToken]});else F.start.push(this.sourceToken);return}if(this.indent>D.indent){let $=this.startBlockValue(D);if($){this.stack.push($);return}}yield*this.pop(),yield*this.step()}*flowCollection(D){let F=D.items[D.items.length-1];if(this.type==="flow-error-end"){let $;do yield*this.pop(),$=this.peek(1);while($?.type==="flow-collection")}else if(D.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!F||F.sep)D.items.push({start:[this.sourceToken]});else F.start.push(this.sourceToken);return;case"map-value-ind":if(!F||F.value)D.items.push({start:[],key:null,sep:[this.sourceToken]});else if(F.sep)F.sep.push(this.sourceToken);else Object.assign(F,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!F||F.value)D.items.push({start:[this.sourceToken]});else if(F.sep)F.sep.push(this.sourceToken);else F.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let J=this.flowScalar(this.type);if(!F||F.value)D.items.push({start:[],key:J,sep:[]});else if(F.sep)this.stack.push(J);else Object.assign(F,{key:J,sep:[]});return}case"flow-map-end":case"flow-seq-end":D.end.push(this.sourceToken);return}let $=this.startBlockValue(D);if($)this.stack.push($);else yield*this.pop(),yield*this.step()}else{let $=this.peek(2);if($.type==="block-map"&&(this.type==="map-value-ind"&&$.indent===D.indent||this.type==="newline"&&!$.items[$.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&$.type!=="flow-collection"){let J=tX($),Q=Z9(J);gx(D);let Z=D.end.splice(1,D.end.length);Z.push(this.sourceToken);let X={type:"block-map",offset:D.offset,indent:D.indent,items:[{start:Q,key:D,sep:Z}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=X}else yield*this.lineEnd(D)}}flowScalar(D){if(this.onNewLine){let F=this.source.indexOf(`
232
232
  `)+1;while(F!==0)this.onNewLine(this.offset+F),F=this.source.indexOf(`
233
- `,F)+1}return{type:D,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(D){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 F=tX(D),$=Z9(F);return $.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:$,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let F=tX(D),$=Z9(F);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:$,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(D,F){if(this.type!=="comment")return!1;if(this.indent<=F)return!1;return D.every(($)=>$.type==="newline"||$.type==="space")}*documentEnd(D){if(this.type!=="doc-mode"){if(D.end)D.end.push(this.sourceToken);else D.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd(D){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(D.end)D.end.push(this.sourceToken);else D.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}g7D.Parser=dx});var ix=I((a7D)=>{var px=kV(),d7D=x5(),h5=k5(),p7D=pU(),l7D=BD(),c7D=pV(),lx=lV();function cx(D){let F=D.prettyErrors!==!1;return{lineCounter:D.lineCounter||F&&new c7D.LineCounter||null,prettyErrors:F}}function n7D(D,F={}){let{lineCounter:$,prettyErrors:J}=cx(F),Q=new lx.Parser($?.addNewLine),Z=new px.Composer(F),X=Array.from(Z.compose(Q.parse(D)));if(J&&$)for(let Y of X)Y.errors.forEach(h5.prettifyError(D,$)),Y.warnings.forEach(h5.prettifyError(D,$));if(X.length>0)return X;return Object.assign([],{empty:!0},Z.streamInfo())}function nx(D,F={}){let{lineCounter:$,prettyErrors:J}=cx(F),Q=new lx.Parser($?.addNewLine),Z=new px.Composer(F),X=null;for(let Y of Z.compose(Q.parse(D),!0,D.length))if(!X)X=Y;else if(X.options.logLevel!=="silent"){X.errors.push(new h5.YAMLParseError(Y.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(J&&$)X.errors.forEach(h5.prettifyError(D,$)),X.warnings.forEach(h5.prettifyError(D,$));return X}function i7D(D,F,$){let J=void 0;if(typeof F==="function")J=F;else if($===void 0&&F&&typeof F==="object")$=F;let Q=nx(D,$);if(!Q)return null;if(Q.warnings.forEach((Z)=>p7D.warn(Q.options.logLevel,Z)),Q.errors.length>0)if(Q.options.logLevel!=="silent")throw Q.errors[0];else Q.errors=[];return Q.toJS(Object.assign({reviver:J},$))}function o7D(D,F,$){let J=null;if(typeof F==="function"||Array.isArray(F))J=F;else if($===void 0&&F)$=F;if(typeof $==="string")$=$.length;if(typeof $==="number"){let Q=Math.round($);$=Q<1?void 0:Q>8?{indent:8}:{indent:Q}}if(D===void 0){let{keepUndefined:Q}=$??F??{};if(!Q)return}if(l7D.isDocument(D)&&!J)return D.toString($);return new d7D.Document(D,J,$).toString($)}a7D.parse=i7D;a7D.parseAllDocuments=n7D;a7D.parseDocument=nx;a7D.stringify=o7D});var q0=I((H4D)=>{H4D.fromCallback=function(D){return Object.defineProperty(function(...F){if(typeof F[F.length-1]==="function")D.apply(this,F);else return new Promise(($,J)=>{F.push((Q,Z)=>Q!=null?J(Q):$(Z)),D.apply(this,F)})},"name",{value:D.name})};H4D.fromPromise=function(D){return Object.defineProperty(function(...F){let $=F[F.length-1];if(typeof $!=="function")return D.apply(this,F);else F.pop(),D.apply(this,F).then((J)=>$(null,J),$)},"name",{value:D.name})}});var Ok=I((fL0,Mk)=>{var wF=r("constants"),_4D=process.cwd,ZY=null,M4D=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!ZY)ZY=_4D.call(process);return ZY};try{process.cwd()}catch(D){}if(typeof process.chdir==="function"){if(XY=process.chdir,process.chdir=function(D){ZY=null,XY.call(process,D)},Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,XY)}var XY;Mk.exports=O4D;function O4D(D){if(wF.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./))F(D);if(!D.lutimes)$(D);if(D.chown=Z(D.chown),D.fchown=Z(D.fchown),D.lchown=Z(D.lchown),D.chmod=J(D.chmod),D.fchmod=J(D.fchmod),D.lchmod=J(D.lchmod),D.chownSync=X(D.chownSync),D.fchownSync=X(D.fchownSync),D.lchownSync=X(D.lchownSync),D.chmodSync=Q(D.chmodSync),D.fchmodSync=Q(D.fchmodSync),D.lchmodSync=Q(D.lchmodSync),D.stat=Y(D.stat),D.fstat=Y(D.fstat),D.lstat=Y(D.lstat),D.statSync=q(D.statSync),D.fstatSync=q(D.fstatSync),D.lstatSync=q(D.lstatSync),D.chmod&&!D.lchmod)D.lchmod=function(B,W,K){if(K)process.nextTick(K)},D.lchmodSync=function(){};if(D.chown&&!D.lchown)D.lchown=function(B,W,K,U){if(U)process.nextTick(U)},D.lchownSync=function(){};if(M4D==="win32")D.rename=typeof D.rename!=="function"?D.rename:function(B){function W(K,U,V){var H=Date.now(),z=0;B(K,U,function _(O){if(O&&(O.code==="EACCES"||O.code==="EPERM"||O.code==="EBUSY")&&Date.now()-H<60000){if(setTimeout(function(){D.stat(U,function(C,M){if(C&&C.code==="ENOENT")B(K,U,_);else V(O)})},z),z<100)z+=10;return}if(V)V(O)})}if(Object.setPrototypeOf)Object.setPrototypeOf(W,B);return W}(D.rename);D.read=typeof D.read!=="function"?D.read:function(B){function W(K,U,V,H,z,_){var O;if(_&&typeof _==="function"){var C=0;O=function(M,E,A){if(M&&M.code==="EAGAIN"&&C<10)return C++,B.call(D,K,U,V,H,z,O);_.apply(this,arguments)}}return B.call(D,K,U,V,H,z,O)}if(Object.setPrototypeOf)Object.setPrototypeOf(W,B);return W}(D.read),D.readSync=typeof D.readSync!=="function"?D.readSync:function(B){return function(W,K,U,V,H){var z=0;while(!0)try{return B.call(D,W,K,U,V,H)}catch(_){if(_.code==="EAGAIN"&&z<10){z++;continue}throw _}}}(D.readSync);function F(B){B.lchmod=function(W,K,U){B.open(W,wF.O_WRONLY|wF.O_SYMLINK,K,function(V,H){if(V){if(U)U(V);return}B.fchmod(H,K,function(z){B.close(H,function(_){if(U)U(z||_)})})})},B.lchmodSync=function(W,K){var U=B.openSync(W,wF.O_WRONLY|wF.O_SYMLINK,K),V=!0,H;try{H=B.fchmodSync(U,K),V=!1}finally{if(V)try{B.closeSync(U)}catch(z){}else B.closeSync(U)}return H}}function $(B){if(wF.hasOwnProperty("O_SYMLINK")&&B.futimes)B.lutimes=function(W,K,U,V){B.open(W,wF.O_SYMLINK,function(H,z){if(H){if(V)V(H);return}B.futimes(z,K,U,function(_){B.close(z,function(O){if(V)V(_||O)})})})},B.lutimesSync=function(W,K,U){var V=B.openSync(W,wF.O_SYMLINK),H,z=!0;try{H=B.futimesSync(V,K,U),z=!1}finally{if(z)try{B.closeSync(V)}catch(_){}else B.closeSync(V)}return H};else if(B.futimes)B.lutimes=function(W,K,U,V){if(V)process.nextTick(V)},B.lutimesSync=function(){}}function J(B){if(!B)return B;return function(W,K,U){return B.call(D,W,K,function(V){if(G(V))V=null;if(U)U.apply(this,arguments)})}}function Q(B){if(!B)return B;return function(W,K){try{return B.call(D,W,K)}catch(U){if(!G(U))throw U}}}function Z(B){if(!B)return B;return function(W,K,U,V){return B.call(D,W,K,U,function(H){if(G(H))H=null;if(V)V.apply(this,arguments)})}}function X(B){if(!B)return B;return function(W,K,U){try{return B.call(D,W,K,U)}catch(V){if(!G(V))throw V}}}function Y(B){if(!B)return B;return function(W,K,U){if(typeof K==="function")U=K,K=null;function V(H,z){if(z){if(z.uid<0)z.uid+=4294967296;if(z.gid<0)z.gid+=4294967296}if(U)U.apply(this,arguments)}return K?B.call(D,W,K,V):B.call(D,W,V)}}function q(B){if(!B)return B;return function(W,K){var U=K?B.call(D,W,K):B.call(D,W);if(U){if(U.uid<0)U.uid+=4294967296;if(U.gid<0)U.gid+=4294967296}return U}}function G(B){if(!B)return!0;if(B.code==="ENOSYS")return!0;var W=!process.getuid||process.getuid()!==0;if(W){if(B.code==="EINVAL"||B.code==="EPERM")return!0}return!1}}});var Ak=I((bL0,Rk)=>{var Ek=r("stream").Stream;Rk.exports=E4D;function E4D(D){return{ReadStream:F,WriteStream:$};function F(J,Q){if(!(this instanceof F))return new F(J,Q);Ek.call(this);var Z=this;this.path=J,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,Q=Q||{};var X=Object.keys(Q);for(var Y=0,q=X.length;Y<q;Y++){var G=X[Y];this[G]=Q[G]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!=="number")throw TypeError("end must be a Number");if(this.start>this.end)throw Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){Z._read()});return}D.open(this.path,this.flags,this.mode,function(B,W){if(B){Z.emit("error",B),Z.readable=!1;return}Z.fd=W,Z.emit("open",W),Z._read()})}function $(J,Q){if(!(this instanceof $))return new $(J,Q);Ek.call(this),this.path=J,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,Q=Q||{};var Z=Object.keys(Q);for(var X=0,Y=Z.length;X<Y;X++){var q=Z[X];this[q]=Q[q]}if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.start<0)throw Error("start must be >= zero");this.pos=this.start}if(this.busy=!1,this._queue=[],this.fd===null)this._open=D.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush()}}});var wk=I((vL0,Ik)=>{Ik.exports=A4D;var R4D=Object.getPrototypeOf||function(D){return D.__proto__};function A4D(D){if(D===null||typeof D!=="object")return D;if(D instanceof Object)var F={__proto__:R4D(D)};else var F=Object.create(null);return Object.getOwnPropertyNames(D).forEach(function($){Object.defineProperty(F,$,Object.getOwnPropertyDescriptor(D,$))}),F}});var q9=I((hL0,FH)=>{var vD=r("fs"),I4D=Ok(),w4D=Ak(),N4D=wk(),YY=r("util"),H0,GY;if(typeof Symbol==="function"&&typeof Symbol.for==="function")H0=Symbol.for("graceful-fs.queue"),GY=Symbol.for("graceful-fs.previous");else H0="___graceful-fs.queue",GY="___graceful-fs.previous";function T4D(){}function Tk(D,F){Object.defineProperty(D,H0,{get:function(){return F}})}var u3=T4D;if(YY.debuglog)u3=YY.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))u3=function(){var D=YY.format.apply(YY,arguments);D="GFS4: "+D.split(/\n/).join(`
234
- GFS4: `),console.error(D)};if(!vD[H0]){if(tV=global[H0]||[],Tk(vD,tV),vD.close=function(D){function F($,J){return D.call(vD,$,function(Q){if(!Q)Nk();if(typeof J==="function")J.apply(this,arguments)})}return Object.defineProperty(F,GY,{value:D}),F}(vD.close),vD.closeSync=function(D){function F($){D.apply(vD,arguments),Nk()}return Object.defineProperty(F,GY,{value:D}),F}(vD.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){u3(vD[H0]),r("assert").equal(vD[H0].length,0)})}var tV;if(!global[H0])Tk(global,vD[H0]);FH.exports=eV(N4D(vD));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!vD.__patched)FH.exports=eV(vD),vD.__patched=!0;function eV(D){I4D(D),D.gracefulify=eV,D.createReadStream=E,D.createWriteStream=A;var F=D.readFile;D.readFile=$;function $(T,N,j){if(typeof N==="function")j=N,N=null;return L(T,N,j);function L(y,m,S,h){return F(y,m,function(g){if(g&&(g.code==="EMFILE"||g.code==="ENFILE"))Y9([L,[y,m,S],g,h||Date.now(),Date.now()]);else if(typeof S==="function")S.apply(this,arguments)})}}var J=D.writeFile;D.writeFile=Q;function Q(T,N,j,L){if(typeof j==="function")L=j,j=null;return y(T,N,j,L);function y(m,S,h,g,b){return J(m,S,h,function(u){if(u&&(u.code==="EMFILE"||u.code==="ENFILE"))Y9([y,[m,S,h,g],u,b||Date.now(),Date.now()]);else if(typeof g==="function")g.apply(this,arguments)})}}var Z=D.appendFile;if(Z)D.appendFile=X;function X(T,N,j,L){if(typeof j==="function")L=j,j=null;return y(T,N,j,L);function y(m,S,h,g,b){return Z(m,S,h,function(u){if(u&&(u.code==="EMFILE"||u.code==="ENFILE"))Y9([y,[m,S,h,g],u,b||Date.now(),Date.now()]);else if(typeof g==="function")g.apply(this,arguments)})}}var Y=D.copyFile;if(Y)D.copyFile=q;function q(T,N,j,L){if(typeof j==="function")L=j,j=0;return y(T,N,j,L);function y(m,S,h,g,b){return Y(m,S,h,function(u){if(u&&(u.code==="EMFILE"||u.code==="ENFILE"))Y9([y,[m,S,h,g],u,b||Date.now(),Date.now()]);else if(typeof g==="function")g.apply(this,arguments)})}}var G=D.readdir;D.readdir=W;var B=/^v[0-5]\./;function W(T,N,j){if(typeof N==="function")j=N,N=null;var L=B.test(process.version)?function(S,h,g,b){return G(S,y(S,h,g,b))}:function(S,h,g,b){return G(S,h,y(S,h,g,b))};return L(T,N,j);function y(m,S,h,g){return function(b,u){if(b&&(b.code==="EMFILE"||b.code==="ENFILE"))Y9([L,[m,S,h],b,g||Date.now(),Date.now()]);else{if(u&&u.sort)u.sort();if(typeof h==="function")h.call(this,b,u)}}}}if(process.version.substr(0,4)==="v0.8"){var K=w4D(D);_=K.ReadStream,C=K.WriteStream}var U=D.ReadStream;if(U)_.prototype=Object.create(U.prototype),_.prototype.open=O;var V=D.WriteStream;if(V)C.prototype=Object.create(V.prototype),C.prototype.open=M;Object.defineProperty(D,"ReadStream",{get:function(){return _},set:function(T){_=T},enumerable:!0,configurable:!0}),Object.defineProperty(D,"WriteStream",{get:function(){return C},set:function(T){C=T},enumerable:!0,configurable:!0});var H=_;Object.defineProperty(D,"FileReadStream",{get:function(){return H},set:function(T){H=T},enumerable:!0,configurable:!0});var z=C;Object.defineProperty(D,"FileWriteStream",{get:function(){return z},set:function(T){z=T},enumerable:!0,configurable:!0});function _(T,N){if(this instanceof _)return U.apply(this,arguments),this;else return _.apply(Object.create(_.prototype),arguments)}function O(){var T=this;R(T.path,T.flags,T.mode,function(N,j){if(N){if(T.autoClose)T.destroy();T.emit("error",N)}else T.fd=j,T.emit("open",j),T.read()})}function C(T,N){if(this instanceof C)return V.apply(this,arguments),this;else return C.apply(Object.create(C.prototype),arguments)}function M(){var T=this;R(T.path,T.flags,T.mode,function(N,j){if(N)T.destroy(),T.emit("error",N);else T.fd=j,T.emit("open",j)})}function E(T,N){return new D.ReadStream(T,N)}function A(T,N){return new D.WriteStream(T,N)}var w=D.open;D.open=R;function R(T,N,j,L){if(typeof j==="function")L=j,j=null;return y(T,N,j,L);function y(m,S,h,g,b){return w(m,S,h,function(u,o){if(u&&(u.code==="EMFILE"||u.code==="ENFILE"))Y9([y,[m,S,h,g],u,b||Date.now(),Date.now()]);else if(typeof g==="function")g.apply(this,arguments)})}}return D}function Y9(D){u3("ENQUEUE",D[0].name,D[1]),vD[H0].push(D),DH()}var qY;function Nk(){var D=Date.now();for(var F=0;F<vD[H0].length;++F)if(vD[H0][F].length>2)vD[H0][F][3]=D,vD[H0][F][4]=D;DH()}function DH(){if(clearTimeout(qY),qY=void 0,vD[H0].length===0)return;var D=vD[H0].shift(),F=D[0],$=D[1],J=D[2],Q=D[3],Z=D[4];if(Q===void 0)u3("RETRY",F.name,$),F.apply(null,$);else if(Date.now()-Q>=60000){u3("TIMEOUT",F.name,$);var X=$.pop();if(typeof X==="function")X.call(null,J)}else{var Y=Date.now()-Z,q=Math.max(Z-Q,1),G=Math.min(q*1.2,100);if(Y>=G)u3("RETRY",F.name,$),F.apply(null,$.concat([Q]));else vD[H0].push(D)}if(qY===void 0)qY=setTimeout(DH,0)}});var g0=I(($H)=>{var Lk=q0().fromCallback,u0=q9(),L4D=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter((D)=>{return typeof u0[D]==="function"});Object.assign($H,u0);L4D.forEach((D)=>{$H[D]=Lk(u0[D])});$H.exists=function(D,F){if(typeof F==="function")return u0.exists(D,F);return new Promise(($)=>{return u0.exists(D,$)})};$H.read=function(D,F,$,J,Q,Z){if(typeof Z==="function")return u0.read(D,F,$,J,Q,Z);return new Promise((X,Y)=>{u0.read(D,F,$,J,Q,(q,G,B)=>{if(q)return Y(q);X({bytesRead:G,buffer:B})})})};$H.write=function(D,F,...$){if(typeof $[$.length-1]==="function")return u0.write(D,F,...$);return new Promise((J,Q)=>{u0.write(D,F,...$,(Z,X,Y)=>{if(Z)return Q(Z);J({bytesWritten:X,buffer:Y})})})};$H.readv=function(D,F,...$){if(typeof $[$.length-1]==="function")return u0.readv(D,F,...$);return new Promise((J,Q)=>{u0.readv(D,F,...$,(Z,X,Y)=>{if(Z)return Q(Z);J({bytesRead:X,buffers:Y})})})};$H.writev=function(D,F,...$){if(typeof $[$.length-1]==="function")return u0.writev(D,F,...$);return new Promise((J,Q)=>{u0.writev(D,F,...$,(Z,X,Y)=>{if(Z)return Q(Z);J({bytesWritten:X,buffers:Y})})})};if(typeof u0.realpath.native==="function")$H.realpath.native=Lk(u0.realpath.native);else process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var jk=I((f4D,Pk)=>{var y4D=r("path");f4D.checkPath=function(F){if(process.platform==="win32"){if(/[<>:"|?*]/.test(F.replace(y4D.parse(F).root,""))){let J=Error(`Path contains invalid characters: ${F}`);throw J.code="EINVAL",J}}}});var yk=I((v4D,JH)=>{var Sk=g0(),{checkPath:xk}=jk(),kk=(D)=>{let F={mode:511};if(typeof D==="number")return D;return{...F,...D}.mode};v4D.makeDir=async(D,F)=>{return xk(D),Sk.mkdir(D,{mode:kk(F),recursive:!0})};v4D.makeDirSync=(D,F)=>{return xk(D),Sk.mkdirSync(D,{mode:kk(F),recursive:!0})}});var J8=I((mL0,fk)=>{var g4D=q0().fromPromise,{makeDir:m4D,makeDirSync:QH}=yk(),ZH=g4D(m4D);fk.exports={mkdirs:ZH,mkdirsSync:QH,mkdirp:ZH,mkdirpSync:QH,ensureDir:ZH,ensureDirSync:QH}});var NF=I((dL0,vk)=>{var d4D=q0().fromPromise,bk=g0();function p4D(D){return bk.access(D).then(()=>!0).catch(()=>!1)}vk.exports={pathExists:d4D(p4D),pathExistsSync:bk.existsSync}});var XH=I((pL0,hk)=>{var G9=g0(),l4D=q0().fromPromise;async function c4D(D,F,$){let J=await G9.open(D,"r+"),Q=null;try{await G9.futimes(J,F,$)}finally{try{await G9.close(J)}catch(Z){Q=Z}}if(Q)throw Q}function n4D(D,F,$){let J=G9.openSync(D,"r+");return G9.futimesSync(J,F,$),G9.closeSync(J)}hk.exports={utimesMillis:l4D(c4D),utimesMillisSync:n4D}});var g3=I((lL0,dk)=>{var B9=g0(),G0=r("path"),uk=q0().fromPromise;function i4D(D,F,$){let J=$.dereference?(Q)=>B9.stat(Q,{bigint:!0}):(Q)=>B9.lstat(Q,{bigint:!0});return Promise.all([J(D),J(F).catch((Q)=>{if(Q.code==="ENOENT")return null;throw Q})]).then(([Q,Z])=>({srcStat:Q,destStat:Z}))}function o4D(D,F,$){let J,Q=$.dereference?(X)=>B9.statSync(X,{bigint:!0}):(X)=>B9.lstatSync(X,{bigint:!0}),Z=Q(D);try{J=Q(F)}catch(X){if(X.code==="ENOENT")return{srcStat:Z,destStat:null};throw X}return{srcStat:Z,destStat:J}}async function a4D(D,F,$,J){let{srcStat:Q,destStat:Z}=await i4D(D,F,J);if(Z){if(u5(Q,Z)){let X=G0.basename(D),Y=G0.basename(F);if($==="move"&&X!==Y&&X.toLowerCase()===Y.toLowerCase())return{srcStat:Q,destStat:Z,isChangingCase:!0};throw Error("Source and destination must not be the same.")}if(Q.isDirectory()&&!Z.isDirectory())throw Error(`Cannot overwrite non-directory '${F}' with directory '${D}'.`);if(!Q.isDirectory()&&Z.isDirectory())throw Error(`Cannot overwrite directory '${F}' with non-directory '${D}'.`)}if(Q.isDirectory()&&YH(D,F))throw Error(BY(D,F,$));return{srcStat:Q,destStat:Z}}function r4D(D,F,$,J){let{srcStat:Q,destStat:Z}=o4D(D,F,J);if(Z){if(u5(Q,Z)){let X=G0.basename(D),Y=G0.basename(F);if($==="move"&&X!==Y&&X.toLowerCase()===Y.toLowerCase())return{srcStat:Q,destStat:Z,isChangingCase:!0};throw Error("Source and destination must not be the same.")}if(Q.isDirectory()&&!Z.isDirectory())throw Error(`Cannot overwrite non-directory '${F}' with directory '${D}'.`);if(!Q.isDirectory()&&Z.isDirectory())throw Error(`Cannot overwrite directory '${F}' with non-directory '${D}'.`)}if(Q.isDirectory()&&YH(D,F))throw Error(BY(D,F,$));return{srcStat:Q,destStat:Z}}async function gk(D,F,$,J){let Q=G0.resolve(G0.dirname(D)),Z=G0.resolve(G0.dirname($));if(Z===Q||Z===G0.parse(Z).root)return;let X;try{X=await B9.stat(Z,{bigint:!0})}catch(Y){if(Y.code==="ENOENT")return;throw Y}if(u5(F,X))throw Error(BY(D,$,J));return gk(D,F,Z,J)}function mk(D,F,$,J){let Q=G0.resolve(G0.dirname(D)),Z=G0.resolve(G0.dirname($));if(Z===Q||Z===G0.parse(Z).root)return;let X;try{X=B9.statSync(Z,{bigint:!0})}catch(Y){if(Y.code==="ENOENT")return;throw Y}if(u5(F,X))throw Error(BY(D,$,J));return mk(D,F,Z,J)}function u5(D,F){return F.ino!==void 0&&F.dev!==void 0&&F.ino===D.ino&&F.dev===D.dev}function YH(D,F){let $=G0.resolve(D).split(G0.sep).filter((Q)=>Q),J=G0.resolve(F).split(G0.sep).filter((Q)=>Q);return $.every((Q,Z)=>J[Z]===Q)}function BY(D,F,$){return`Cannot ${$} '${D}' to a subdirectory of itself, '${F}'.`}dk.exports={checkPaths:uk(a4D),checkPathsSync:r4D,checkParentPaths:uk(gk),checkParentPathsSync:mk,isSrcSubdir:YH,areIdentical:u5}});var lk=I((cL0,pk)=>{async function s4D(D,F){let $=[];for await(let J of D)$.push(F(J).then(()=>null,(Q)=>Q??Error("unknown error")));await Promise.all($.map((J)=>J.then((Q)=>{if(Q!==null)throw Q})))}pk.exports={asyncIteratorConcurrentProcess:s4D}});var ak=I((nL0,ok)=>{var T0=g0(),g5=r("path"),{mkdirs:t4D}=J8(),{pathExists:e4D}=NF(),{utimesMillis:D5D}=XH(),m5=g3(),{asyncIteratorConcurrentProcess:F5D}=lk();async function $5D(D,F,$={}){if(typeof $==="function")$={filter:$};if($.clobber="clobber"in $?!!$.clobber:!0,$.overwrite="overwrite"in $?!!$.overwrite:$.clobber,$.preserveTimestamps&&process.arch==="ia32")process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
233
+ `,F)+1}return{type:D,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(D){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 F=tX(D),$=Z9(F);return $.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:$,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let F=tX(D),$=Z9(F);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:$,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(D,F){if(this.type!=="comment")return!1;if(this.indent<=F)return!1;return D.every(($)=>$.type==="newline"||$.type==="space")}*documentEnd(D){if(this.type!=="doc-mode"){if(D.end)D.end.push(this.sourceToken);else D.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd(D){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(D.end)D.end.push(this.sourceToken);else D.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}g7D.Parser=dx});var ix=w((a7D)=>{var px=kV(),d7D=x5(),h5=k5(),p7D=pU(),l7D=BD(),c7D=pV(),lx=lV();function cx(D){let F=D.prettyErrors!==!1;return{lineCounter:D.lineCounter||F&&new c7D.LineCounter||null,prettyErrors:F}}function n7D(D,F={}){let{lineCounter:$,prettyErrors:J}=cx(F),Q=new lx.Parser($?.addNewLine),Z=new px.Composer(F),X=Array.from(Z.compose(Q.parse(D)));if(J&&$)for(let Y of X)Y.errors.forEach(h5.prettifyError(D,$)),Y.warnings.forEach(h5.prettifyError(D,$));if(X.length>0)return X;return Object.assign([],{empty:!0},Z.streamInfo())}function nx(D,F={}){let{lineCounter:$,prettyErrors:J}=cx(F),Q=new lx.Parser($?.addNewLine),Z=new px.Composer(F),X=null;for(let Y of Z.compose(Q.parse(D),!0,D.length))if(!X)X=Y;else if(X.options.logLevel!=="silent"){X.errors.push(new h5.YAMLParseError(Y.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(J&&$)X.errors.forEach(h5.prettifyError(D,$)),X.warnings.forEach(h5.prettifyError(D,$));return X}function i7D(D,F,$){let J=void 0;if(typeof F==="function")J=F;else if($===void 0&&F&&typeof F==="object")$=F;let Q=nx(D,$);if(!Q)return null;if(Q.warnings.forEach((Z)=>p7D.warn(Q.options.logLevel,Z)),Q.errors.length>0)if(Q.options.logLevel!=="silent")throw Q.errors[0];else Q.errors=[];return Q.toJS(Object.assign({reviver:J},$))}function o7D(D,F,$){let J=null;if(typeof F==="function"||Array.isArray(F))J=F;else if($===void 0&&F)$=F;if(typeof $==="string")$=$.length;if(typeof $==="number"){let Q=Math.round($);$=Q<1?void 0:Q>8?{indent:8}:{indent:Q}}if(D===void 0){let{keepUndefined:Q}=$??F??{};if(!Q)return}if(l7D.isDocument(D)&&!J)return D.toString($);return new d7D.Document(D,J,$).toString($)}a7D.parse=i7D;a7D.parseAllDocuments=n7D;a7D.parseDocument=nx;a7D.stringify=o7D});var q0=w((H4D)=>{H4D.fromCallback=function(D){return Object.defineProperty(function(...F){if(typeof F[F.length-1]==="function")D.apply(this,F);else return new Promise(($,J)=>{F.push((Q,Z)=>Q!=null?J(Q):$(Z)),D.apply(this,F)})},"name",{value:D.name})};H4D.fromPromise=function(D){return Object.defineProperty(function(...F){let $=F[F.length-1];if(typeof $!=="function")return D.apply(this,F);else F.pop(),D.apply(this,F).then((J)=>$(null,J),$)},"name",{value:D.name})}});var Ok=w((fL0,Mk)=>{var wF=r("constants"),_4D=process.cwd,ZY=null,M4D=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!ZY)ZY=_4D.call(process);return ZY};try{process.cwd()}catch(D){}if(typeof process.chdir==="function"){if(XY=process.chdir,process.chdir=function(D){ZY=null,XY.call(process,D)},Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,XY)}var XY;Mk.exports=O4D;function O4D(D){if(wF.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./))F(D);if(!D.lutimes)$(D);if(D.chown=Z(D.chown),D.fchown=Z(D.fchown),D.lchown=Z(D.lchown),D.chmod=J(D.chmod),D.fchmod=J(D.fchmod),D.lchmod=J(D.lchmod),D.chownSync=X(D.chownSync),D.fchownSync=X(D.fchownSync),D.lchownSync=X(D.lchownSync),D.chmodSync=Q(D.chmodSync),D.fchmodSync=Q(D.fchmodSync),D.lchmodSync=Q(D.lchmodSync),D.stat=Y(D.stat),D.fstat=Y(D.fstat),D.lstat=Y(D.lstat),D.statSync=q(D.statSync),D.fstatSync=q(D.fstatSync),D.lstatSync=q(D.lstatSync),D.chmod&&!D.lchmod)D.lchmod=function(B,W,K){if(K)process.nextTick(K)},D.lchmodSync=function(){};if(D.chown&&!D.lchown)D.lchown=function(B,W,K,U){if(U)process.nextTick(U)},D.lchownSync=function(){};if(M4D==="win32")D.rename=typeof D.rename!=="function"?D.rename:function(B){function W(K,U,V){var H=Date.now(),z=0;B(K,U,function _(O){if(O&&(O.code==="EACCES"||O.code==="EPERM"||O.code==="EBUSY")&&Date.now()-H<60000){if(setTimeout(function(){D.stat(U,function(C,M){if(C&&C.code==="ENOENT")B(K,U,_);else V(O)})},z),z<100)z+=10;return}if(V)V(O)})}if(Object.setPrototypeOf)Object.setPrototypeOf(W,B);return W}(D.rename);D.read=typeof D.read!=="function"?D.read:function(B){function W(K,U,V,H,z,_){var O;if(_&&typeof _==="function"){var C=0;O=function(M,E,A){if(M&&M.code==="EAGAIN"&&C<10)return C++,B.call(D,K,U,V,H,z,O);_.apply(this,arguments)}}return B.call(D,K,U,V,H,z,O)}if(Object.setPrototypeOf)Object.setPrototypeOf(W,B);return W}(D.read),D.readSync=typeof D.readSync!=="function"?D.readSync:function(B){return function(W,K,U,V,H){var z=0;while(!0)try{return B.call(D,W,K,U,V,H)}catch(_){if(_.code==="EAGAIN"&&z<10){z++;continue}throw _}}}(D.readSync);function F(B){B.lchmod=function(W,K,U){B.open(W,wF.O_WRONLY|wF.O_SYMLINK,K,function(V,H){if(V){if(U)U(V);return}B.fchmod(H,K,function(z){B.close(H,function(_){if(U)U(z||_)})})})},B.lchmodSync=function(W,K){var U=B.openSync(W,wF.O_WRONLY|wF.O_SYMLINK,K),V=!0,H;try{H=B.fchmodSync(U,K),V=!1}finally{if(V)try{B.closeSync(U)}catch(z){}else B.closeSync(U)}return H}}function $(B){if(wF.hasOwnProperty("O_SYMLINK")&&B.futimes)B.lutimes=function(W,K,U,V){B.open(W,wF.O_SYMLINK,function(H,z){if(H){if(V)V(H);return}B.futimes(z,K,U,function(_){B.close(z,function(O){if(V)V(_||O)})})})},B.lutimesSync=function(W,K,U){var V=B.openSync(W,wF.O_SYMLINK),H,z=!0;try{H=B.futimesSync(V,K,U),z=!1}finally{if(z)try{B.closeSync(V)}catch(_){}else B.closeSync(V)}return H};else if(B.futimes)B.lutimes=function(W,K,U,V){if(V)process.nextTick(V)},B.lutimesSync=function(){}}function J(B){if(!B)return B;return function(W,K,U){return B.call(D,W,K,function(V){if(G(V))V=null;if(U)U.apply(this,arguments)})}}function Q(B){if(!B)return B;return function(W,K){try{return B.call(D,W,K)}catch(U){if(!G(U))throw U}}}function Z(B){if(!B)return B;return function(W,K,U,V){return B.call(D,W,K,U,function(H){if(G(H))H=null;if(V)V.apply(this,arguments)})}}function X(B){if(!B)return B;return function(W,K,U){try{return B.call(D,W,K,U)}catch(V){if(!G(V))throw V}}}function Y(B){if(!B)return B;return function(W,K,U){if(typeof K==="function")U=K,K=null;function V(H,z){if(z){if(z.uid<0)z.uid+=4294967296;if(z.gid<0)z.gid+=4294967296}if(U)U.apply(this,arguments)}return K?B.call(D,W,K,V):B.call(D,W,V)}}function q(B){if(!B)return B;return function(W,K){var U=K?B.call(D,W,K):B.call(D,W);if(U){if(U.uid<0)U.uid+=4294967296;if(U.gid<0)U.gid+=4294967296}return U}}function G(B){if(!B)return!0;if(B.code==="ENOSYS")return!0;var W=!process.getuid||process.getuid()!==0;if(W){if(B.code==="EINVAL"||B.code==="EPERM")return!0}return!1}}});var Ak=w((bL0,Rk)=>{var Ek=r("stream").Stream;Rk.exports=E4D;function E4D(D){return{ReadStream:F,WriteStream:$};function F(J,Q){if(!(this instanceof F))return new F(J,Q);Ek.call(this);var Z=this;this.path=J,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,Q=Q||{};var X=Object.keys(Q);for(var Y=0,q=X.length;Y<q;Y++){var G=X[Y];this[G]=Q[G]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!=="number")throw TypeError("end must be a Number");if(this.start>this.end)throw Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){Z._read()});return}D.open(this.path,this.flags,this.mode,function(B,W){if(B){Z.emit("error",B),Z.readable=!1;return}Z.fd=W,Z.emit("open",W),Z._read()})}function $(J,Q){if(!(this instanceof $))return new $(J,Q);Ek.call(this),this.path=J,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,Q=Q||{};var Z=Object.keys(Q);for(var X=0,Y=Z.length;X<Y;X++){var q=Z[X];this[q]=Q[q]}if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.start<0)throw Error("start must be >= zero");this.pos=this.start}if(this.busy=!1,this._queue=[],this.fd===null)this._open=D.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush()}}});var wk=w((vL0,Ik)=>{Ik.exports=A4D;var R4D=Object.getPrototypeOf||function(D){return D.__proto__};function A4D(D){if(D===null||typeof D!=="object")return D;if(D instanceof Object)var F={__proto__:R4D(D)};else var F=Object.create(null);return Object.getOwnPropertyNames(D).forEach(function($){Object.defineProperty(F,$,Object.getOwnPropertyDescriptor(D,$))}),F}});var q9=w((hL0,FH)=>{var vD=r("fs"),I4D=Ok(),w4D=Ak(),N4D=wk(),YY=r("util"),H0,GY;if(typeof Symbol==="function"&&typeof Symbol.for==="function")H0=Symbol.for("graceful-fs.queue"),GY=Symbol.for("graceful-fs.previous");else H0="___graceful-fs.queue",GY="___graceful-fs.previous";function T4D(){}function Tk(D,F){Object.defineProperty(D,H0,{get:function(){return F}})}var u3=T4D;if(YY.debuglog)u3=YY.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))u3=function(){var D=YY.format.apply(YY,arguments);D="GFS4: "+D.split(/\n/).join(`
234
+ GFS4: `),console.error(D)};if(!vD[H0]){if(tV=global[H0]||[],Tk(vD,tV),vD.close=function(D){function F($,J){return D.call(vD,$,function(Q){if(!Q)Nk();if(typeof J==="function")J.apply(this,arguments)})}return Object.defineProperty(F,GY,{value:D}),F}(vD.close),vD.closeSync=function(D){function F($){D.apply(vD,arguments),Nk()}return Object.defineProperty(F,GY,{value:D}),F}(vD.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){u3(vD[H0]),r("assert").equal(vD[H0].length,0)})}var tV;if(!global[H0])Tk(global,vD[H0]);FH.exports=eV(N4D(vD));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!vD.__patched)FH.exports=eV(vD),vD.__patched=!0;function eV(D){I4D(D),D.gracefulify=eV,D.createReadStream=E,D.createWriteStream=A;var F=D.readFile;D.readFile=$;function $(T,N,j){if(typeof N==="function")j=N,N=null;return L(T,N,j);function L(y,m,S,h){return F(y,m,function(g){if(g&&(g.code==="EMFILE"||g.code==="ENFILE"))Y9([L,[y,m,S],g,h||Date.now(),Date.now()]);else if(typeof S==="function")S.apply(this,arguments)})}}var J=D.writeFile;D.writeFile=Q;function Q(T,N,j,L){if(typeof j==="function")L=j,j=null;return y(T,N,j,L);function y(m,S,h,g,b){return J(m,S,h,function(u){if(u&&(u.code==="EMFILE"||u.code==="ENFILE"))Y9([y,[m,S,h,g],u,b||Date.now(),Date.now()]);else if(typeof g==="function")g.apply(this,arguments)})}}var Z=D.appendFile;if(Z)D.appendFile=X;function X(T,N,j,L){if(typeof j==="function")L=j,j=null;return y(T,N,j,L);function y(m,S,h,g,b){return Z(m,S,h,function(u){if(u&&(u.code==="EMFILE"||u.code==="ENFILE"))Y9([y,[m,S,h,g],u,b||Date.now(),Date.now()]);else if(typeof g==="function")g.apply(this,arguments)})}}var Y=D.copyFile;if(Y)D.copyFile=q;function q(T,N,j,L){if(typeof j==="function")L=j,j=0;return y(T,N,j,L);function y(m,S,h,g,b){return Y(m,S,h,function(u){if(u&&(u.code==="EMFILE"||u.code==="ENFILE"))Y9([y,[m,S,h,g],u,b||Date.now(),Date.now()]);else if(typeof g==="function")g.apply(this,arguments)})}}var G=D.readdir;D.readdir=W;var B=/^v[0-5]\./;function W(T,N,j){if(typeof N==="function")j=N,N=null;var L=B.test(process.version)?function(S,h,g,b){return G(S,y(S,h,g,b))}:function(S,h,g,b){return G(S,h,y(S,h,g,b))};return L(T,N,j);function y(m,S,h,g){return function(b,u){if(b&&(b.code==="EMFILE"||b.code==="ENFILE"))Y9([L,[m,S,h],b,g||Date.now(),Date.now()]);else{if(u&&u.sort)u.sort();if(typeof h==="function")h.call(this,b,u)}}}}if(process.version.substr(0,4)==="v0.8"){var K=w4D(D);_=K.ReadStream,C=K.WriteStream}var U=D.ReadStream;if(U)_.prototype=Object.create(U.prototype),_.prototype.open=O;var V=D.WriteStream;if(V)C.prototype=Object.create(V.prototype),C.prototype.open=M;Object.defineProperty(D,"ReadStream",{get:function(){return _},set:function(T){_=T},enumerable:!0,configurable:!0}),Object.defineProperty(D,"WriteStream",{get:function(){return C},set:function(T){C=T},enumerable:!0,configurable:!0});var H=_;Object.defineProperty(D,"FileReadStream",{get:function(){return H},set:function(T){H=T},enumerable:!0,configurable:!0});var z=C;Object.defineProperty(D,"FileWriteStream",{get:function(){return z},set:function(T){z=T},enumerable:!0,configurable:!0});function _(T,N){if(this instanceof _)return U.apply(this,arguments),this;else return _.apply(Object.create(_.prototype),arguments)}function O(){var T=this;R(T.path,T.flags,T.mode,function(N,j){if(N){if(T.autoClose)T.destroy();T.emit("error",N)}else T.fd=j,T.emit("open",j),T.read()})}function C(T,N){if(this instanceof C)return V.apply(this,arguments),this;else return C.apply(Object.create(C.prototype),arguments)}function M(){var T=this;R(T.path,T.flags,T.mode,function(N,j){if(N)T.destroy(),T.emit("error",N);else T.fd=j,T.emit("open",j)})}function E(T,N){return new D.ReadStream(T,N)}function A(T,N){return new D.WriteStream(T,N)}var I=D.open;D.open=R;function R(T,N,j,L){if(typeof j==="function")L=j,j=null;return y(T,N,j,L);function y(m,S,h,g,b){return I(m,S,h,function(u,o){if(u&&(u.code==="EMFILE"||u.code==="ENFILE"))Y9([y,[m,S,h,g],u,b||Date.now(),Date.now()]);else if(typeof g==="function")g.apply(this,arguments)})}}return D}function Y9(D){u3("ENQUEUE",D[0].name,D[1]),vD[H0].push(D),DH()}var qY;function Nk(){var D=Date.now();for(var F=0;F<vD[H0].length;++F)if(vD[H0][F].length>2)vD[H0][F][3]=D,vD[H0][F][4]=D;DH()}function DH(){if(clearTimeout(qY),qY=void 0,vD[H0].length===0)return;var D=vD[H0].shift(),F=D[0],$=D[1],J=D[2],Q=D[3],Z=D[4];if(Q===void 0)u3("RETRY",F.name,$),F.apply(null,$);else if(Date.now()-Q>=60000){u3("TIMEOUT",F.name,$);var X=$.pop();if(typeof X==="function")X.call(null,J)}else{var Y=Date.now()-Z,q=Math.max(Z-Q,1),G=Math.min(q*1.2,100);if(Y>=G)u3("RETRY",F.name,$),F.apply(null,$.concat([Q]));else vD[H0].push(D)}if(qY===void 0)qY=setTimeout(DH,0)}});var g0=w(($H)=>{var Lk=q0().fromCallback,u0=q9(),L4D=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter((D)=>{return typeof u0[D]==="function"});Object.assign($H,u0);L4D.forEach((D)=>{$H[D]=Lk(u0[D])});$H.exists=function(D,F){if(typeof F==="function")return u0.exists(D,F);return new Promise(($)=>{return u0.exists(D,$)})};$H.read=function(D,F,$,J,Q,Z){if(typeof Z==="function")return u0.read(D,F,$,J,Q,Z);return new Promise((X,Y)=>{u0.read(D,F,$,J,Q,(q,G,B)=>{if(q)return Y(q);X({bytesRead:G,buffer:B})})})};$H.write=function(D,F,...$){if(typeof $[$.length-1]==="function")return u0.write(D,F,...$);return new Promise((J,Q)=>{u0.write(D,F,...$,(Z,X,Y)=>{if(Z)return Q(Z);J({bytesWritten:X,buffer:Y})})})};$H.readv=function(D,F,...$){if(typeof $[$.length-1]==="function")return u0.readv(D,F,...$);return new Promise((J,Q)=>{u0.readv(D,F,...$,(Z,X,Y)=>{if(Z)return Q(Z);J({bytesRead:X,buffers:Y})})})};$H.writev=function(D,F,...$){if(typeof $[$.length-1]==="function")return u0.writev(D,F,...$);return new Promise((J,Q)=>{u0.writev(D,F,...$,(Z,X,Y)=>{if(Z)return Q(Z);J({bytesWritten:X,buffers:Y})})})};if(typeof u0.realpath.native==="function")$H.realpath.native=Lk(u0.realpath.native);else process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var jk=w((f4D,Pk)=>{var y4D=r("path");f4D.checkPath=function(F){if(process.platform==="win32"){if(/[<>:"|?*]/.test(F.replace(y4D.parse(F).root,""))){let J=Error(`Path contains invalid characters: ${F}`);throw J.code="EINVAL",J}}}});var yk=w((v4D,JH)=>{var Sk=g0(),{checkPath:xk}=jk(),kk=(D)=>{let F={mode:511};if(typeof D==="number")return D;return{...F,...D}.mode};v4D.makeDir=async(D,F)=>{return xk(D),Sk.mkdir(D,{mode:kk(F),recursive:!0})};v4D.makeDirSync=(D,F)=>{return xk(D),Sk.mkdirSync(D,{mode:kk(F),recursive:!0})}});var J8=w((mL0,fk)=>{var g4D=q0().fromPromise,{makeDir:m4D,makeDirSync:QH}=yk(),ZH=g4D(m4D);fk.exports={mkdirs:ZH,mkdirsSync:QH,mkdirp:ZH,mkdirpSync:QH,ensureDir:ZH,ensureDirSync:QH}});var NF=w((dL0,vk)=>{var d4D=q0().fromPromise,bk=g0();function p4D(D){return bk.access(D).then(()=>!0).catch(()=>!1)}vk.exports={pathExists:d4D(p4D),pathExistsSync:bk.existsSync}});var XH=w((pL0,hk)=>{var G9=g0(),l4D=q0().fromPromise;async function c4D(D,F,$){let J=await G9.open(D,"r+"),Q=null;try{await G9.futimes(J,F,$)}finally{try{await G9.close(J)}catch(Z){Q=Z}}if(Q)throw Q}function n4D(D,F,$){let J=G9.openSync(D,"r+");return G9.futimesSync(J,F,$),G9.closeSync(J)}hk.exports={utimesMillis:l4D(c4D),utimesMillisSync:n4D}});var g3=w((lL0,dk)=>{var B9=g0(),G0=r("path"),uk=q0().fromPromise;function i4D(D,F,$){let J=$.dereference?(Q)=>B9.stat(Q,{bigint:!0}):(Q)=>B9.lstat(Q,{bigint:!0});return Promise.all([J(D),J(F).catch((Q)=>{if(Q.code==="ENOENT")return null;throw Q})]).then(([Q,Z])=>({srcStat:Q,destStat:Z}))}function o4D(D,F,$){let J,Q=$.dereference?(X)=>B9.statSync(X,{bigint:!0}):(X)=>B9.lstatSync(X,{bigint:!0}),Z=Q(D);try{J=Q(F)}catch(X){if(X.code==="ENOENT")return{srcStat:Z,destStat:null};throw X}return{srcStat:Z,destStat:J}}async function a4D(D,F,$,J){let{srcStat:Q,destStat:Z}=await i4D(D,F,J);if(Z){if(u5(Q,Z)){let X=G0.basename(D),Y=G0.basename(F);if($==="move"&&X!==Y&&X.toLowerCase()===Y.toLowerCase())return{srcStat:Q,destStat:Z,isChangingCase:!0};throw Error("Source and destination must not be the same.")}if(Q.isDirectory()&&!Z.isDirectory())throw Error(`Cannot overwrite non-directory '${F}' with directory '${D}'.`);if(!Q.isDirectory()&&Z.isDirectory())throw Error(`Cannot overwrite directory '${F}' with non-directory '${D}'.`)}if(Q.isDirectory()&&YH(D,F))throw Error(BY(D,F,$));return{srcStat:Q,destStat:Z}}function r4D(D,F,$,J){let{srcStat:Q,destStat:Z}=o4D(D,F,J);if(Z){if(u5(Q,Z)){let X=G0.basename(D),Y=G0.basename(F);if($==="move"&&X!==Y&&X.toLowerCase()===Y.toLowerCase())return{srcStat:Q,destStat:Z,isChangingCase:!0};throw Error("Source and destination must not be the same.")}if(Q.isDirectory()&&!Z.isDirectory())throw Error(`Cannot overwrite non-directory '${F}' with directory '${D}'.`);if(!Q.isDirectory()&&Z.isDirectory())throw Error(`Cannot overwrite directory '${F}' with non-directory '${D}'.`)}if(Q.isDirectory()&&YH(D,F))throw Error(BY(D,F,$));return{srcStat:Q,destStat:Z}}async function gk(D,F,$,J){let Q=G0.resolve(G0.dirname(D)),Z=G0.resolve(G0.dirname($));if(Z===Q||Z===G0.parse(Z).root)return;let X;try{X=await B9.stat(Z,{bigint:!0})}catch(Y){if(Y.code==="ENOENT")return;throw Y}if(u5(F,X))throw Error(BY(D,$,J));return gk(D,F,Z,J)}function mk(D,F,$,J){let Q=G0.resolve(G0.dirname(D)),Z=G0.resolve(G0.dirname($));if(Z===Q||Z===G0.parse(Z).root)return;let X;try{X=B9.statSync(Z,{bigint:!0})}catch(Y){if(Y.code==="ENOENT")return;throw Y}if(u5(F,X))throw Error(BY(D,$,J));return mk(D,F,Z,J)}function u5(D,F){return F.ino!==void 0&&F.dev!==void 0&&F.ino===D.ino&&F.dev===D.dev}function YH(D,F){let $=G0.resolve(D).split(G0.sep).filter((Q)=>Q),J=G0.resolve(F).split(G0.sep).filter((Q)=>Q);return $.every((Q,Z)=>J[Z]===Q)}function BY(D,F,$){return`Cannot ${$} '${D}' to a subdirectory of itself, '${F}'.`}dk.exports={checkPaths:uk(a4D),checkPathsSync:r4D,checkParentPaths:uk(gk),checkParentPathsSync:mk,isSrcSubdir:YH,areIdentical:u5}});var lk=w((cL0,pk)=>{async function s4D(D,F){let $=[];for await(let J of D)$.push(F(J).then(()=>null,(Q)=>Q??Error("unknown error")));await Promise.all($.map((J)=>J.then((Q)=>{if(Q!==null)throw Q})))}pk.exports={asyncIteratorConcurrentProcess:s4D}});var ak=w((nL0,ok)=>{var T0=g0(),g5=r("path"),{mkdirs:t4D}=J8(),{pathExists:e4D}=NF(),{utimesMillis:D5D}=XH(),m5=g3(),{asyncIteratorConcurrentProcess:F5D}=lk();async function $5D(D,F,$={}){if(typeof $==="function")$={filter:$};if($.clobber="clobber"in $?!!$.clobber:!0,$.overwrite="overwrite"in $?!!$.overwrite:$.clobber,$.preserveTimestamps&&process.arch==="ia32")process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
235
235
 
236
- see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:J,destStat:Q}=await m5.checkPaths(D,F,"copy",$);if(await m5.checkParentPaths(D,J,F,"copy"),!await nk(D,F,$))return;let X=g5.dirname(F);if(!await e4D(X))await t4D(X);await ik(Q,D,F,$)}async function nk(D,F,$){if(!$.filter)return!0;return $.filter(D,F)}async function ik(D,F,$,J){let Z=await(J.dereference?T0.stat:T0.lstat)(F);if(Z.isDirectory())return X5D(Z,D,F,$,J);if(Z.isFile()||Z.isCharacterDevice()||Z.isBlockDevice())return J5D(Z,D,F,$,J);if(Z.isSymbolicLink())return Y5D(D,F,$,J);if(Z.isSocket())throw Error(`Cannot copy a socket file: ${F}`);if(Z.isFIFO())throw Error(`Cannot copy a FIFO pipe: ${F}`);throw Error(`Unknown file: ${F}`)}async function J5D(D,F,$,J,Q){if(!F)return ck(D,$,J,Q);if(Q.overwrite)return await T0.unlink(J),ck(D,$,J,Q);if(Q.errorOnExist)throw Error(`'${J}' already exists`)}async function ck(D,F,$,J){if(await T0.copyFile(F,$),J.preserveTimestamps){if(Q5D(D.mode))await Z5D($,D.mode);let Q=await T0.stat(F);await D5D($,Q.atime,Q.mtime)}return T0.chmod($,D.mode)}function Q5D(D){return(D&128)===0}function Z5D(D,F){return T0.chmod(D,F|128)}async function X5D(D,F,$,J,Q){if(!F)await T0.mkdir(J);if(await F5D(await T0.opendir($),async(Z)=>{let X=g5.join($,Z.name),Y=g5.join(J,Z.name);if(await nk(X,Y,Q)){let{destStat:G}=await m5.checkPaths(X,Y,"copy",Q);await ik(G,X,Y,Q)}}),!F)await T0.chmod(J,D.mode)}async function Y5D(D,F,$,J){let Q=await T0.readlink(F);if(J.dereference)Q=g5.resolve(process.cwd(),Q);if(!D)return T0.symlink(Q,$);let Z=null;try{Z=await T0.readlink($)}catch(X){if(X.code==="EINVAL"||X.code==="UNKNOWN")return T0.symlink(Q,$);throw X}if(J.dereference)Z=g5.resolve(process.cwd(),Z);if(Q!==Z){if(m5.isSrcSubdir(Q,Z))throw Error(`Cannot copy '${Q}' to a subdirectory of itself, '${Z}'.`);if(m5.isSrcSubdir(Z,Q))throw Error(`Cannot overwrite '${Z}' with '${Q}'.`)}return await T0.unlink($),T0.symlink(Q,$)}ok.exports=$5D});var Dy=I((iL0,ek)=>{var m0=q9(),d5=r("path"),q5D=J8().mkdirsSync,G5D=XH().utimesMillisSync,p5=g3();function B5D(D,F,$){if(typeof $==="function")$={filter:$};if($=$||{},$.clobber="clobber"in $?!!$.clobber:!0,$.overwrite="overwrite"in $?!!$.overwrite:$.clobber,$.preserveTimestamps&&process.arch==="ia32")process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
236
+ see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:J,destStat:Q}=await m5.checkPaths(D,F,"copy",$);if(await m5.checkParentPaths(D,J,F,"copy"),!await nk(D,F,$))return;let X=g5.dirname(F);if(!await e4D(X))await t4D(X);await ik(Q,D,F,$)}async function nk(D,F,$){if(!$.filter)return!0;return $.filter(D,F)}async function ik(D,F,$,J){let Z=await(J.dereference?T0.stat:T0.lstat)(F);if(Z.isDirectory())return X5D(Z,D,F,$,J);if(Z.isFile()||Z.isCharacterDevice()||Z.isBlockDevice())return J5D(Z,D,F,$,J);if(Z.isSymbolicLink())return Y5D(D,F,$,J);if(Z.isSocket())throw Error(`Cannot copy a socket file: ${F}`);if(Z.isFIFO())throw Error(`Cannot copy a FIFO pipe: ${F}`);throw Error(`Unknown file: ${F}`)}async function J5D(D,F,$,J,Q){if(!F)return ck(D,$,J,Q);if(Q.overwrite)return await T0.unlink(J),ck(D,$,J,Q);if(Q.errorOnExist)throw Error(`'${J}' already exists`)}async function ck(D,F,$,J){if(await T0.copyFile(F,$),J.preserveTimestamps){if(Q5D(D.mode))await Z5D($,D.mode);let Q=await T0.stat(F);await D5D($,Q.atime,Q.mtime)}return T0.chmod($,D.mode)}function Q5D(D){return(D&128)===0}function Z5D(D,F){return T0.chmod(D,F|128)}async function X5D(D,F,$,J,Q){if(!F)await T0.mkdir(J);if(await F5D(await T0.opendir($),async(Z)=>{let X=g5.join($,Z.name),Y=g5.join(J,Z.name);if(await nk(X,Y,Q)){let{destStat:G}=await m5.checkPaths(X,Y,"copy",Q);await ik(G,X,Y,Q)}}),!F)await T0.chmod(J,D.mode)}async function Y5D(D,F,$,J){let Q=await T0.readlink(F);if(J.dereference)Q=g5.resolve(process.cwd(),Q);if(!D)return T0.symlink(Q,$);let Z=null;try{Z=await T0.readlink($)}catch(X){if(X.code==="EINVAL"||X.code==="UNKNOWN")return T0.symlink(Q,$);throw X}if(J.dereference)Z=g5.resolve(process.cwd(),Z);if(Q!==Z){if(m5.isSrcSubdir(Q,Z))throw Error(`Cannot copy '${Q}' to a subdirectory of itself, '${Z}'.`);if(m5.isSrcSubdir(Z,Q))throw Error(`Cannot overwrite '${Z}' with '${Q}'.`)}return await T0.unlink($),T0.symlink(Q,$)}ok.exports=$5D});var Dy=w((iL0,ek)=>{var m0=q9(),d5=r("path"),q5D=J8().mkdirsSync,G5D=XH().utimesMillisSync,p5=g3();function B5D(D,F,$){if(typeof $==="function")$={filter:$};if($=$||{},$.clobber="clobber"in $?!!$.clobber:!0,$.overwrite="overwrite"in $?!!$.overwrite:$.clobber,$.preserveTimestamps&&process.arch==="ia32")process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
237
237
 
238
- see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:J,destStat:Q}=p5.checkPathsSync(D,F,"copy",$);if(p5.checkParentPathsSync(D,J,F,"copy"),$.filter&&!$.filter(D,F))return;let Z=d5.dirname(F);if(!m0.existsSync(Z))q5D(Z);return rk(Q,D,F,$)}function rk(D,F,$,J){let Z=(J.dereference?m0.statSync:m0.lstatSync)(F);if(Z.isDirectory())return C5D(Z,D,F,$,J);else if(Z.isFile()||Z.isCharacterDevice()||Z.isBlockDevice())return W5D(Z,D,F,$,J);else if(Z.isSymbolicLink())return O5D(D,F,$,J);else if(Z.isSocket())throw Error(`Cannot copy a socket file: ${F}`);else if(Z.isFIFO())throw Error(`Cannot copy a FIFO pipe: ${F}`);throw Error(`Unknown file: ${F}`)}function W5D(D,F,$,J,Q){if(!F)return sk(D,$,J,Q);return K5D(D,$,J,Q)}function K5D(D,F,$,J){if(J.overwrite)return m0.unlinkSync($),sk(D,F,$,J);else if(J.errorOnExist)throw Error(`'${$}' already exists`)}function sk(D,F,$,J){if(m0.copyFileSync(F,$),J.preserveTimestamps)U5D(D.mode,F,$);return qH($,D.mode)}function U5D(D,F,$){if(V5D(D))H5D($,D);return z5D(F,$)}function V5D(D){return(D&128)===0}function H5D(D,F){return qH(D,F|128)}function qH(D,F){return m0.chmodSync(D,F)}function z5D(D,F){let $=m0.statSync(D);return G5D(F,$.atime,$.mtime)}function C5D(D,F,$,J,Q){if(!F)return _5D(D.mode,$,J,Q);return tk($,J,Q)}function _5D(D,F,$,J){return m0.mkdirSync($),tk(F,$,J),qH($,D)}function tk(D,F,$){let J=m0.opendirSync(D);try{let Q;while((Q=J.readSync())!==null)M5D(Q.name,D,F,$)}finally{J.closeSync()}}function M5D(D,F,$,J){let Q=d5.join(F,D),Z=d5.join($,D);if(J.filter&&!J.filter(Q,Z))return;let{destStat:X}=p5.checkPathsSync(Q,Z,"copy",J);return rk(X,Q,Z,J)}function O5D(D,F,$,J){let Q=m0.readlinkSync(F);if(J.dereference)Q=d5.resolve(process.cwd(),Q);if(!D)return m0.symlinkSync(Q,$);else{let Z;try{Z=m0.readlinkSync($)}catch(X){if(X.code==="EINVAL"||X.code==="UNKNOWN")return m0.symlinkSync(Q,$);throw X}if(J.dereference)Z=d5.resolve(process.cwd(),Z);if(Q!==Z){if(p5.isSrcSubdir(Q,Z))throw Error(`Cannot copy '${Q}' to a subdirectory of itself, '${Z}'.`);if(p5.isSrcSubdir(Z,Q))throw Error(`Cannot overwrite '${Z}' with '${Q}'.`)}return E5D(Q,$)}}function E5D(D,F){return m0.unlinkSync(F),m0.symlinkSync(D,F)}ek.exports=B5D});var WY=I((oL0,Fy)=>{var R5D=q0().fromPromise;Fy.exports={copy:R5D(ak()),copySync:Dy()}});var l5=I((aL0,Jy)=>{var $y=q9(),A5D=q0().fromCallback;function I5D(D,F){$y.rm(D,{recursive:!0,force:!0},F)}function w5D(D){$y.rmSync(D,{recursive:!0,force:!0})}Jy.exports={remove:A5D(I5D),removeSync:w5D}});var Wy=I((rL0,By)=>{var N5D=q0().fromPromise,Xy=g0(),Yy=r("path"),qy=J8(),Gy=l5(),Qy=N5D(async function(F){let $;try{$=await Xy.readdir(F)}catch{return qy.mkdirs(F)}return Promise.all($.map((J)=>Gy.remove(Yy.join(F,J))))});function Zy(D){let F;try{F=Xy.readdirSync(D)}catch{return qy.mkdirsSync(D)}F.forEach(($)=>{$=Yy.join(D,$),Gy.removeSync($)})}By.exports={emptyDirSync:Zy,emptydirSync:Zy,emptyDir:Qy,emptydir:Qy}});var Hy=I((sL0,Vy)=>{var T5D=q0().fromPromise,Ky=r("path"),w1=g0(),Uy=J8();async function L5D(D){let F;try{F=await w1.stat(D)}catch{}if(F&&F.isFile())return;let $=Ky.dirname(D),J=null;try{J=await w1.stat($)}catch(Q){if(Q.code==="ENOENT"){await Uy.mkdirs($),await w1.writeFile(D,"");return}else throw Q}if(J.isDirectory())await w1.writeFile(D,"");else await w1.readdir($)}function P5D(D){let F;try{F=w1.statSync(D)}catch{}if(F&&F.isFile())return;let $=Ky.dirname(D);try{if(!w1.statSync($).isDirectory())w1.readdirSync($)}catch(J){if(J&&J.code==="ENOENT")Uy.mkdirsSync($);else throw J}w1.writeFileSync(D,"")}Vy.exports={createFile:T5D(L5D),createFileSync:P5D}});var Oy=I((tL0,My)=>{var j5D=q0().fromPromise,zy=r("path"),TF=g0(),Cy=J8(),{pathExists:S5D}=NF(),{areIdentical:_y}=g3();async function x5D(D,F){let $;try{$=await TF.lstat(F)}catch{}let J;try{J=await TF.lstat(D)}catch(X){throw X.message=X.message.replace("lstat","ensureLink"),X}if($&&_y(J,$))return;let Q=zy.dirname(F);if(!await S5D(Q))await Cy.mkdirs(Q);await TF.link(D,F)}function k5D(D,F){let $;try{$=TF.lstatSync(F)}catch{}try{let Z=TF.lstatSync(D);if($&&_y(Z,$))return}catch(Z){throw Z.message=Z.message.replace("lstat","ensureLink"),Z}let J=zy.dirname(F);if(TF.existsSync(J))return TF.linkSync(D,F);return Cy.mkdirsSync(J),TF.linkSync(D,F)}My.exports={createLink:j5D(x5D),createLinkSync:k5D}});var Ry=I((eL0,Ey)=>{var LF=r("path"),c5=g0(),{pathExists:y5D}=NF(),f5D=q0().fromPromise;async function b5D(D,F){if(LF.isAbsolute(D)){try{await c5.lstat(D)}catch(Z){throw Z.message=Z.message.replace("lstat","ensureSymlink"),Z}return{toCwd:D,toDst:D}}let $=LF.dirname(F),J=LF.join($,D);if(await y5D(J))return{toCwd:J,toDst:D};try{await c5.lstat(D)}catch(Z){throw Z.message=Z.message.replace("lstat","ensureSymlink"),Z}return{toCwd:D,toDst:LF.relative($,D)}}function v5D(D,F){if(LF.isAbsolute(D)){if(!c5.existsSync(D))throw Error("absolute srcpath does not exist");return{toCwd:D,toDst:D}}let $=LF.dirname(F),J=LF.join($,D);if(c5.existsSync(J))return{toCwd:J,toDst:D};if(!c5.existsSync(D))throw Error("relative srcpath does not exist");return{toCwd:D,toDst:LF.relative($,D)}}Ey.exports={symlinkPaths:f5D(b5D),symlinkPathsSync:v5D}});var wy=I((DP0,Iy)=>{var Ay=g0(),h5D=q0().fromPromise;async function u5D(D,F){if(F)return F;let $;try{$=await Ay.lstat(D)}catch{return"file"}return $&&$.isDirectory()?"dir":"file"}function g5D(D,F){if(F)return F;let $;try{$=Ay.lstatSync(D)}catch{return"file"}return $&&$.isDirectory()?"dir":"file"}Iy.exports={symlinkType:h5D(u5D),symlinkTypeSync:g5D}});var Py=I((FP0,Ly)=>{var m5D=q0().fromPromise,Ny=r("path"),g8=g0(),{mkdirs:d5D,mkdirsSync:p5D}=J8(),{symlinkPaths:l5D,symlinkPathsSync:c5D}=Ry(),{symlinkType:n5D,symlinkTypeSync:i5D}=wy(),{pathExists:o5D}=NF(),{areIdentical:Ty}=g3();async function a5D(D,F,$){let J;try{J=await g8.lstat(F)}catch{}if(J&&J.isSymbolicLink()){let[Y,q]=await Promise.all([g8.stat(D),g8.stat(F)]);if(Ty(Y,q))return}let Q=await l5D(D,F);D=Q.toDst;let Z=await n5D(Q.toCwd,$),X=Ny.dirname(F);if(!await o5D(X))await d5D(X);return g8.symlink(D,F,Z)}function r5D(D,F,$){let J;try{J=g8.lstatSync(F)}catch{}if(J&&J.isSymbolicLink()){let Y=g8.statSync(D),q=g8.statSync(F);if(Ty(Y,q))return}let Q=c5D(D,F);D=Q.toDst,$=i5D(Q.toCwd,$);let Z=Ny.dirname(F);if(g8.existsSync(Z))return g8.symlinkSync(D,F,$);return p5D(Z),g8.symlinkSync(D,F,$)}Ly.exports={createSymlink:m5D(a5D),createSymlinkSync:r5D}});var vy=I(($P0,by)=>{var{createFile:jy,createFileSync:Sy}=Hy(),{createLink:xy,createLinkSync:ky}=Oy(),{createSymlink:yy,createSymlinkSync:fy}=Py();by.exports={createFile:jy,createFileSync:Sy,ensureFile:jy,ensureFileSync:Sy,createLink:xy,createLinkSync:ky,ensureLink:xy,ensureLinkSync:ky,createSymlink:yy,createSymlinkSync:fy,ensureSymlink:yy,ensureSymlinkSync:fy}});var KY=I((JP0,hy)=>{function s5D(D,{EOL:F=`
239
- `,finalEOL:$=!0,replacer:J=null,spaces:Q}={}){let Z=$?F:"";return JSON.stringify(D,J,Q).replace(/\n/g,F)+Z}function t5D(D){if(Buffer.isBuffer(D))D=D.toString("utf8");return D.replace(/^\uFEFF/,"")}hy.exports={stringify:s5D,stripBom:t5D}});var dy=I((QP0,my)=>{var W9;try{W9=q9()}catch(D){W9=r("fs")}var UY=q0(),{stringify:uy,stripBom:gy}=KY();async function e5D(D,F={}){if(typeof F==="string")F={encoding:F};let $=F.fs||W9,J="throws"in F?F.throws:!0,Q=await UY.fromCallback($.readFile)(D,F);Q=gy(Q);let Z;try{Z=JSON.parse(Q,F?F.reviver:null)}catch(X){if(J)throw X.message=`${D}: ${X.message}`,X;else return null}return Z}var D$D=UY.fromPromise(e5D);function F$D(D,F={}){if(typeof F==="string")F={encoding:F};let $=F.fs||W9,J="throws"in F?F.throws:!0;try{let Q=$.readFileSync(D,F);return Q=gy(Q),JSON.parse(Q,F.reviver)}catch(Q){if(J)throw Q.message=`${D}: ${Q.message}`,Q;else return null}}async function $$D(D,F,$={}){let J=$.fs||W9,Q=uy(F,$);await UY.fromCallback(J.writeFile)(D,Q,$)}var J$D=UY.fromPromise($$D);function Q$D(D,F,$={}){let J=$.fs||W9,Q=uy(F,$);return J.writeFileSync(D,Q,$)}my.exports={readFile:D$D,readFileSync:F$D,writeFile:J$D,writeFileSync:Q$D}});var ly=I((ZP0,py)=>{var VY=dy();py.exports={readJson:VY.readFile,readJsonSync:VY.readFileSync,writeJson:VY.writeFile,writeJsonSync:VY.writeFileSync}});var HY=I((XP0,iy)=>{var Z$D=q0().fromPromise,GH=g0(),cy=r("path"),ny=J8(),X$D=NF().pathExists;async function Y$D(D,F,$="utf-8"){let J=cy.dirname(D);if(!await X$D(J))await ny.mkdirs(J);return GH.writeFile(D,F,$)}function q$D(D,...F){let $=cy.dirname(D);if(!GH.existsSync($))ny.mkdirsSync($);GH.writeFileSync(D,...F)}iy.exports={outputFile:Z$D(Y$D),outputFileSync:q$D}});var ay=I((YP0,oy)=>{var{stringify:G$D}=KY(),{outputFile:B$D}=HY();async function W$D(D,F,$={}){let J=G$D(F,$);await B$D(D,J,$)}oy.exports=W$D});var sy=I((qP0,ry)=>{var{stringify:K$D}=KY(),{outputFileSync:U$D}=HY();function V$D(D,F,$){let J=K$D(F,$);U$D(D,J,$)}ry.exports=V$D});var ey=I((GP0,ty)=>{var H$D=q0().fromPromise,d0=ly();d0.outputJson=H$D(ay());d0.outputJsonSync=sy();d0.outputJSON=d0.outputJson;d0.outputJSONSync=d0.outputJsonSync;d0.writeJSON=d0.writeJson;d0.writeJSONSync=d0.writeJsonSync;d0.readJSON=d0.readJson;d0.readJSONSync=d0.readJsonSync;ty.exports=d0});var Qf=I((BP0,Jf)=>{var z$D=g0(),Df=r("path"),{copy:C$D}=WY(),{remove:$f}=l5(),{mkdirp:_$D}=J8(),{pathExists:M$D}=NF(),Ff=g3();async function O$D(D,F,$={}){let J=$.overwrite||$.clobber||!1,{srcStat:Q,isChangingCase:Z=!1}=await Ff.checkPaths(D,F,"move",$);await Ff.checkParentPaths(D,Q,F,"move");let X=Df.dirname(F);if(Df.parse(X).root!==X)await _$D(X);return E$D(D,F,J,Z)}async function E$D(D,F,$,J){if(!J){if($)await $f(F);else if(await M$D(F))throw Error("dest already exists.")}try{await z$D.rename(D,F)}catch(Q){if(Q.code!=="EXDEV")throw Q;await R$D(D,F,$)}}async function R$D(D,F,$){return await C$D(D,F,{overwrite:$,errorOnExist:!0,preserveTimestamps:!0}),$f(D)}Jf.exports=O$D});var Gf=I((WP0,qf)=>{var Xf=q9(),WH=r("path"),A$D=WY().copySync,Yf=l5().removeSync,I$D=J8().mkdirpSync,Zf=g3();function w$D(D,F,$){$=$||{};let J=$.overwrite||$.clobber||!1,{srcStat:Q,isChangingCase:Z=!1}=Zf.checkPathsSync(D,F,"move",$);if(Zf.checkParentPathsSync(D,Q,F,"move"),!N$D(F))I$D(WH.dirname(F));return T$D(D,F,J,Z)}function N$D(D){let F=WH.dirname(D);return WH.parse(F).root===F}function T$D(D,F,$,J){if(J)return BH(D,F,$);if($)return Yf(F),BH(D,F,$);if(Xf.existsSync(F))throw Error("dest already exists.");return BH(D,F,$)}function BH(D,F,$){try{Xf.renameSync(D,F)}catch(J){if(J.code!=="EXDEV")throw J;return L$D(D,F,$)}}function L$D(D,F,$){return A$D(D,F,{overwrite:$,errorOnExist:!0,preserveTimestamps:!0}),Yf(D)}qf.exports=w$D});var Wf=I((KP0,Bf)=>{var P$D=q0().fromPromise;Bf.exports={move:P$D(Qf()),moveSync:Gf()}});var m8=I((UP0,Kf)=>{Kf.exports={...g0(),...WY(),...Wy(),...vy(),...ey(),...J8(),...Wf(),...HY(),...NF(),...l5()}});var Tf=I((o$D,N1)=>{/*!
238
+ see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:J,destStat:Q}=p5.checkPathsSync(D,F,"copy",$);if(p5.checkParentPathsSync(D,J,F,"copy"),$.filter&&!$.filter(D,F))return;let Z=d5.dirname(F);if(!m0.existsSync(Z))q5D(Z);return rk(Q,D,F,$)}function rk(D,F,$,J){let Z=(J.dereference?m0.statSync:m0.lstatSync)(F);if(Z.isDirectory())return C5D(Z,D,F,$,J);else if(Z.isFile()||Z.isCharacterDevice()||Z.isBlockDevice())return W5D(Z,D,F,$,J);else if(Z.isSymbolicLink())return O5D(D,F,$,J);else if(Z.isSocket())throw Error(`Cannot copy a socket file: ${F}`);else if(Z.isFIFO())throw Error(`Cannot copy a FIFO pipe: ${F}`);throw Error(`Unknown file: ${F}`)}function W5D(D,F,$,J,Q){if(!F)return sk(D,$,J,Q);return K5D(D,$,J,Q)}function K5D(D,F,$,J){if(J.overwrite)return m0.unlinkSync($),sk(D,F,$,J);else if(J.errorOnExist)throw Error(`'${$}' already exists`)}function sk(D,F,$,J){if(m0.copyFileSync(F,$),J.preserveTimestamps)U5D(D.mode,F,$);return qH($,D.mode)}function U5D(D,F,$){if(V5D(D))H5D($,D);return z5D(F,$)}function V5D(D){return(D&128)===0}function H5D(D,F){return qH(D,F|128)}function qH(D,F){return m0.chmodSync(D,F)}function z5D(D,F){let $=m0.statSync(D);return G5D(F,$.atime,$.mtime)}function C5D(D,F,$,J,Q){if(!F)return _5D(D.mode,$,J,Q);return tk($,J,Q)}function _5D(D,F,$,J){return m0.mkdirSync($),tk(F,$,J),qH($,D)}function tk(D,F,$){let J=m0.opendirSync(D);try{let Q;while((Q=J.readSync())!==null)M5D(Q.name,D,F,$)}finally{J.closeSync()}}function M5D(D,F,$,J){let Q=d5.join(F,D),Z=d5.join($,D);if(J.filter&&!J.filter(Q,Z))return;let{destStat:X}=p5.checkPathsSync(Q,Z,"copy",J);return rk(X,Q,Z,J)}function O5D(D,F,$,J){let Q=m0.readlinkSync(F);if(J.dereference)Q=d5.resolve(process.cwd(),Q);if(!D)return m0.symlinkSync(Q,$);else{let Z;try{Z=m0.readlinkSync($)}catch(X){if(X.code==="EINVAL"||X.code==="UNKNOWN")return m0.symlinkSync(Q,$);throw X}if(J.dereference)Z=d5.resolve(process.cwd(),Z);if(Q!==Z){if(p5.isSrcSubdir(Q,Z))throw Error(`Cannot copy '${Q}' to a subdirectory of itself, '${Z}'.`);if(p5.isSrcSubdir(Z,Q))throw Error(`Cannot overwrite '${Z}' with '${Q}'.`)}return E5D(Q,$)}}function E5D(D,F){return m0.unlinkSync(F),m0.symlinkSync(D,F)}ek.exports=B5D});var WY=w((oL0,Fy)=>{var R5D=q0().fromPromise;Fy.exports={copy:R5D(ak()),copySync:Dy()}});var l5=w((aL0,Jy)=>{var $y=q9(),A5D=q0().fromCallback;function I5D(D,F){$y.rm(D,{recursive:!0,force:!0},F)}function w5D(D){$y.rmSync(D,{recursive:!0,force:!0})}Jy.exports={remove:A5D(I5D),removeSync:w5D}});var Wy=w((rL0,By)=>{var N5D=q0().fromPromise,Xy=g0(),Yy=r("path"),qy=J8(),Gy=l5(),Qy=N5D(async function(F){let $;try{$=await Xy.readdir(F)}catch{return qy.mkdirs(F)}return Promise.all($.map((J)=>Gy.remove(Yy.join(F,J))))});function Zy(D){let F;try{F=Xy.readdirSync(D)}catch{return qy.mkdirsSync(D)}F.forEach(($)=>{$=Yy.join(D,$),Gy.removeSync($)})}By.exports={emptyDirSync:Zy,emptydirSync:Zy,emptyDir:Qy,emptydir:Qy}});var Hy=w((sL0,Vy)=>{var T5D=q0().fromPromise,Ky=r("path"),w1=g0(),Uy=J8();async function L5D(D){let F;try{F=await w1.stat(D)}catch{}if(F&&F.isFile())return;let $=Ky.dirname(D),J=null;try{J=await w1.stat($)}catch(Q){if(Q.code==="ENOENT"){await Uy.mkdirs($),await w1.writeFile(D,"");return}else throw Q}if(J.isDirectory())await w1.writeFile(D,"");else await w1.readdir($)}function P5D(D){let F;try{F=w1.statSync(D)}catch{}if(F&&F.isFile())return;let $=Ky.dirname(D);try{if(!w1.statSync($).isDirectory())w1.readdirSync($)}catch(J){if(J&&J.code==="ENOENT")Uy.mkdirsSync($);else throw J}w1.writeFileSync(D,"")}Vy.exports={createFile:T5D(L5D),createFileSync:P5D}});var Oy=w((tL0,My)=>{var j5D=q0().fromPromise,zy=r("path"),TF=g0(),Cy=J8(),{pathExists:S5D}=NF(),{areIdentical:_y}=g3();async function x5D(D,F){let $;try{$=await TF.lstat(F)}catch{}let J;try{J=await TF.lstat(D)}catch(X){throw X.message=X.message.replace("lstat","ensureLink"),X}if($&&_y(J,$))return;let Q=zy.dirname(F);if(!await S5D(Q))await Cy.mkdirs(Q);await TF.link(D,F)}function k5D(D,F){let $;try{$=TF.lstatSync(F)}catch{}try{let Z=TF.lstatSync(D);if($&&_y(Z,$))return}catch(Z){throw Z.message=Z.message.replace("lstat","ensureLink"),Z}let J=zy.dirname(F);if(TF.existsSync(J))return TF.linkSync(D,F);return Cy.mkdirsSync(J),TF.linkSync(D,F)}My.exports={createLink:j5D(x5D),createLinkSync:k5D}});var Ry=w((eL0,Ey)=>{var LF=r("path"),c5=g0(),{pathExists:y5D}=NF(),f5D=q0().fromPromise;async function b5D(D,F){if(LF.isAbsolute(D)){try{await c5.lstat(D)}catch(Z){throw Z.message=Z.message.replace("lstat","ensureSymlink"),Z}return{toCwd:D,toDst:D}}let $=LF.dirname(F),J=LF.join($,D);if(await y5D(J))return{toCwd:J,toDst:D};try{await c5.lstat(D)}catch(Z){throw Z.message=Z.message.replace("lstat","ensureSymlink"),Z}return{toCwd:D,toDst:LF.relative($,D)}}function v5D(D,F){if(LF.isAbsolute(D)){if(!c5.existsSync(D))throw Error("absolute srcpath does not exist");return{toCwd:D,toDst:D}}let $=LF.dirname(F),J=LF.join($,D);if(c5.existsSync(J))return{toCwd:J,toDst:D};if(!c5.existsSync(D))throw Error("relative srcpath does not exist");return{toCwd:D,toDst:LF.relative($,D)}}Ey.exports={symlinkPaths:f5D(b5D),symlinkPathsSync:v5D}});var wy=w((DP0,Iy)=>{var Ay=g0(),h5D=q0().fromPromise;async function u5D(D,F){if(F)return F;let $;try{$=await Ay.lstat(D)}catch{return"file"}return $&&$.isDirectory()?"dir":"file"}function g5D(D,F){if(F)return F;let $;try{$=Ay.lstatSync(D)}catch{return"file"}return $&&$.isDirectory()?"dir":"file"}Iy.exports={symlinkType:h5D(u5D),symlinkTypeSync:g5D}});var Py=w((FP0,Ly)=>{var m5D=q0().fromPromise,Ny=r("path"),g8=g0(),{mkdirs:d5D,mkdirsSync:p5D}=J8(),{symlinkPaths:l5D,symlinkPathsSync:c5D}=Ry(),{symlinkType:n5D,symlinkTypeSync:i5D}=wy(),{pathExists:o5D}=NF(),{areIdentical:Ty}=g3();async function a5D(D,F,$){let J;try{J=await g8.lstat(F)}catch{}if(J&&J.isSymbolicLink()){let[Y,q]=await Promise.all([g8.stat(D),g8.stat(F)]);if(Ty(Y,q))return}let Q=await l5D(D,F);D=Q.toDst;let Z=await n5D(Q.toCwd,$),X=Ny.dirname(F);if(!await o5D(X))await d5D(X);return g8.symlink(D,F,Z)}function r5D(D,F,$){let J;try{J=g8.lstatSync(F)}catch{}if(J&&J.isSymbolicLink()){let Y=g8.statSync(D),q=g8.statSync(F);if(Ty(Y,q))return}let Q=c5D(D,F);D=Q.toDst,$=i5D(Q.toCwd,$);let Z=Ny.dirname(F);if(g8.existsSync(Z))return g8.symlinkSync(D,F,$);return p5D(Z),g8.symlinkSync(D,F,$)}Ly.exports={createSymlink:m5D(a5D),createSymlinkSync:r5D}});var vy=w(($P0,by)=>{var{createFile:jy,createFileSync:Sy}=Hy(),{createLink:xy,createLinkSync:ky}=Oy(),{createSymlink:yy,createSymlinkSync:fy}=Py();by.exports={createFile:jy,createFileSync:Sy,ensureFile:jy,ensureFileSync:Sy,createLink:xy,createLinkSync:ky,ensureLink:xy,ensureLinkSync:ky,createSymlink:yy,createSymlinkSync:fy,ensureSymlink:yy,ensureSymlinkSync:fy}});var KY=w((JP0,hy)=>{function s5D(D,{EOL:F=`
239
+ `,finalEOL:$=!0,replacer:J=null,spaces:Q}={}){let Z=$?F:"";return JSON.stringify(D,J,Q).replace(/\n/g,F)+Z}function t5D(D){if(Buffer.isBuffer(D))D=D.toString("utf8");return D.replace(/^\uFEFF/,"")}hy.exports={stringify:s5D,stripBom:t5D}});var dy=w((QP0,my)=>{var W9;try{W9=q9()}catch(D){W9=r("fs")}var UY=q0(),{stringify:uy,stripBom:gy}=KY();async function e5D(D,F={}){if(typeof F==="string")F={encoding:F};let $=F.fs||W9,J="throws"in F?F.throws:!0,Q=await UY.fromCallback($.readFile)(D,F);Q=gy(Q);let Z;try{Z=JSON.parse(Q,F?F.reviver:null)}catch(X){if(J)throw X.message=`${D}: ${X.message}`,X;else return null}return Z}var D$D=UY.fromPromise(e5D);function F$D(D,F={}){if(typeof F==="string")F={encoding:F};let $=F.fs||W9,J="throws"in F?F.throws:!0;try{let Q=$.readFileSync(D,F);return Q=gy(Q),JSON.parse(Q,F.reviver)}catch(Q){if(J)throw Q.message=`${D}: ${Q.message}`,Q;else return null}}async function $$D(D,F,$={}){let J=$.fs||W9,Q=uy(F,$);await UY.fromCallback(J.writeFile)(D,Q,$)}var J$D=UY.fromPromise($$D);function Q$D(D,F,$={}){let J=$.fs||W9,Q=uy(F,$);return J.writeFileSync(D,Q,$)}my.exports={readFile:D$D,readFileSync:F$D,writeFile:J$D,writeFileSync:Q$D}});var ly=w((ZP0,py)=>{var VY=dy();py.exports={readJson:VY.readFile,readJsonSync:VY.readFileSync,writeJson:VY.writeFile,writeJsonSync:VY.writeFileSync}});var HY=w((XP0,iy)=>{var Z$D=q0().fromPromise,GH=g0(),cy=r("path"),ny=J8(),X$D=NF().pathExists;async function Y$D(D,F,$="utf-8"){let J=cy.dirname(D);if(!await X$D(J))await ny.mkdirs(J);return GH.writeFile(D,F,$)}function q$D(D,...F){let $=cy.dirname(D);if(!GH.existsSync($))ny.mkdirsSync($);GH.writeFileSync(D,...F)}iy.exports={outputFile:Z$D(Y$D),outputFileSync:q$D}});var ay=w((YP0,oy)=>{var{stringify:G$D}=KY(),{outputFile:B$D}=HY();async function W$D(D,F,$={}){let J=G$D(F,$);await B$D(D,J,$)}oy.exports=W$D});var sy=w((qP0,ry)=>{var{stringify:K$D}=KY(),{outputFileSync:U$D}=HY();function V$D(D,F,$){let J=K$D(F,$);U$D(D,J,$)}ry.exports=V$D});var ey=w((GP0,ty)=>{var H$D=q0().fromPromise,d0=ly();d0.outputJson=H$D(ay());d0.outputJsonSync=sy();d0.outputJSON=d0.outputJson;d0.outputJSONSync=d0.outputJsonSync;d0.writeJSON=d0.writeJson;d0.writeJSONSync=d0.writeJsonSync;d0.readJSON=d0.readJson;d0.readJSONSync=d0.readJsonSync;ty.exports=d0});var Qf=w((BP0,Jf)=>{var z$D=g0(),Df=r("path"),{copy:C$D}=WY(),{remove:$f}=l5(),{mkdirp:_$D}=J8(),{pathExists:M$D}=NF(),Ff=g3();async function O$D(D,F,$={}){let J=$.overwrite||$.clobber||!1,{srcStat:Q,isChangingCase:Z=!1}=await Ff.checkPaths(D,F,"move",$);await Ff.checkParentPaths(D,Q,F,"move");let X=Df.dirname(F);if(Df.parse(X).root!==X)await _$D(X);return E$D(D,F,J,Z)}async function E$D(D,F,$,J){if(!J){if($)await $f(F);else if(await M$D(F))throw Error("dest already exists.")}try{await z$D.rename(D,F)}catch(Q){if(Q.code!=="EXDEV")throw Q;await R$D(D,F,$)}}async function R$D(D,F,$){return await C$D(D,F,{overwrite:$,errorOnExist:!0,preserveTimestamps:!0}),$f(D)}Jf.exports=O$D});var Gf=w((WP0,qf)=>{var Xf=q9(),WH=r("path"),A$D=WY().copySync,Yf=l5().removeSync,I$D=J8().mkdirpSync,Zf=g3();function w$D(D,F,$){$=$||{};let J=$.overwrite||$.clobber||!1,{srcStat:Q,isChangingCase:Z=!1}=Zf.checkPathsSync(D,F,"move",$);if(Zf.checkParentPathsSync(D,Q,F,"move"),!N$D(F))I$D(WH.dirname(F));return T$D(D,F,J,Z)}function N$D(D){let F=WH.dirname(D);return WH.parse(F).root===F}function T$D(D,F,$,J){if(J)return BH(D,F,$);if($)return Yf(F),BH(D,F,$);if(Xf.existsSync(F))throw Error("dest already exists.");return BH(D,F,$)}function BH(D,F,$){try{Xf.renameSync(D,F)}catch(J){if(J.code!=="EXDEV")throw J;return L$D(D,F,$)}}function L$D(D,F,$){return A$D(D,F,{overwrite:$,errorOnExist:!0,preserveTimestamps:!0}),Yf(D)}qf.exports=w$D});var Wf=w((KP0,Bf)=>{var P$D=q0().fromPromise;Bf.exports={move:P$D(Qf()),moveSync:Gf()}});var m8=w((UP0,Kf)=>{Kf.exports={...g0(),...WY(),...Wy(),...vy(),...ey(),...J8(),...Wf(),...HY(),...NF(),...l5()}});var Tf=w((o$D,N1)=>{/*!
240
240
  * Tmp
241
241
  *
242
242
  * Copyright (c) 2011-2017 KARASZI Istvan <github@spam.raszi.hu>
243
243
  *
244
244
  * MIT Licensed
245
- */var _D=r("fs"),CY=r("os"),z0=r("path"),Uf=r("crypto"),d8={fs:_D.constants,os:CY.constants},Cf=/XXXXXX/,_f=(d8.O_CREAT||d8.fs.O_CREAT)|(d8.O_EXCL||d8.fs.O_EXCL)|(d8.O_RDWR||d8.fs.O_RDWR),j$D=CY.platform()==="win32",S$D=d8.EBADF||d8.os.errno.EBADF,x$D=d8.ENOENT||d8.os.errno.ENOENT,K9=[],Mf=_D.rmdirSync.bind(_D),Of=!1;function k$D(D,F){return _D.rm(D,{recursive:!0},F)}function Ef(D){return _D.rmSync(D,{recursive:!0})}function VH(D,F){let $=U9(D,F),J=$[0],Q=$[1];p$D(J,function(Z,X){if(Z)return Q(Z);let Y=X.tries;(function q(){try{let G=Af(X);_D.stat(G,function(B){if(!B){if(Y-- >0)return q();return Q(Error("Could not get a unique tmp filename, max tries reached "+G))}Q(null,G)})}catch(G){Q(G)}})()})}function HH(D){let F=U9(D),$=F[0],J=l$D($),Q=J.tries;do{let Z=Af(J);try{_D.statSync(Z)}catch(X){return Z}}while(Q-- >0);throw Error("Could not get a unique tmp filename, max tries reached")}function y$D(D,F){let $=U9(D,F),J=$[0],Q=$[1];VH(J,function(X,Y){if(X)return Q(X);_D.open(Y,_f,J.mode||384,function(G,B){if(G)return Q(G);if(J.discardDescriptor)return _D.close(B,function(K){return Q(K,Y,void 0,KH(Y,-1,J,!1))});else{let W=J.discardDescriptor||J.detachDescriptor;Q(null,Y,B,KH(Y,W?-1:B,J,!1))}})})}function f$D(D){let F=U9(D),$=F[0],J=$.discardDescriptor||$.detachDescriptor,Q=HH($),Z=_D.openSync(Q,_f,$.mode||384);if($.discardDescriptor)_D.closeSync(Z),Z=void 0;return{name:Q,fd:Z,removeCallback:KH(Q,J?-1:Z,$,!0)}}function b$D(D,F){let $=U9(D,F),J=$[0],Q=$[1];VH(J,function(X,Y){if(X)return Q(X);_D.mkdir(Y,J.mode||448,function(G){if(G)return Q(G);Q(null,Y,Rf(Y,J,!1))})})}function v$D(D){let F=U9(D),$=F[0],J=HH($);return _D.mkdirSync(J,$.mode||448),{name:J,removeCallback:Rf(J,$,!0)}}function h$D(D,F){let $=function(J){if(J&&!UH(J))return F(J);F()};if(0<=D[0])_D.close(D[0],function(){_D.unlink(D[1],$)});else _D.unlink(D[1],$)}function u$D(D){let F=null;try{if(0<=D[0])_D.closeSync(D[0])}catch($){if(!c$D($)&&!UH($))throw $}finally{try{_D.unlinkSync(D[1])}catch($){if(!UH($))F=$}}if(F!==null)throw F}function KH(D,F,$,J){let Q=zY(u$D,[F,D],J),Z=zY(h$D,[F,D],J,Q);if(!$.keep)K9.unshift(Q);return J?Q:Z}function Rf(D,F,$){let J=F.unsafeCleanup?k$D:_D.rmdir.bind(_D),Q=F.unsafeCleanup?Ef:Mf,Z=zY(Q,D,$),X=zY(J,D,$,Z);if(!F.keep)K9.unshift(Z);return $?Z:X}function zY(D,F,$,J){let Q=!1;return function Z(X){if(!Q){let Y=J||Z,q=K9.indexOf(Y);if(q>=0)K9.splice(q,1);if(Q=!0,$||D===Mf||D===Ef)return D(F);else return D(F,X||function(){})}}}function g$D(){if(!Of)return;while(K9.length)try{K9[0]()}catch(D){}}function Vf(D){let F=[],$=null;try{$=Uf.randomBytes(D)}catch(J){$=Uf.pseudoRandomBytes(D)}for(let J=0;J<D;J++)F.push("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"[$[J]%62]);return F.join("")}function U2(D){return typeof D>"u"}function U9(D,F){if(typeof D==="function")return[{},D];if(U2(D))return[{},F];let $={};for(let J of Object.getOwnPropertyNames(D))$[J]=D[J];return[$,F]}function m$D(D,F,$){let J=z0.isAbsolute(D)?D:z0.join(F,D);_D.stat(J,function(Q){if(Q)_D.realpath(z0.dirname(J),function(Z,X){if(Z)return $(Z);$(null,z0.join(X,z0.basename(J)))});else _D.realpath(J,$)})}function d$D(D,F){let $=z0.isAbsolute(D)?D:z0.join(F,D);try{return _D.statSync($),_D.realpathSync($)}catch(J){let Q=_D.realpathSync(z0.dirname($));return z0.join(Q,z0.basename($))}}function Af(D){let F=D.tmpdir;if(!U2(D.name))return z0.join(F,D.dir,D.name);if(!U2(D.template))return z0.join(F,D.dir,D.template).replace(Cf,Vf(6));let $=[D.prefix?D.prefix:"tmp","-",process.pid,"-",Vf(12),D.postfix?"-"+D.postfix:""].join("");return z0.join(F,D.dir,$)}function If(D){if(!U2(D.name)){let F=D.name;if(z0.isAbsolute(F))throw Error(`name option must not contain an absolute path, found "${F}".`);let $=z0.basename(F);if($===".."||$==="."||$!==F)throw Error(`name option must not contain a path, found "${F}".`)}if(!U2(D.template)&&!D.template.match(Cf))throw Error(`Invalid template, found "${D.template}".`);if(!U2(D.tries)&&isNaN(D.tries)||D.tries<0)throw Error(`Invalid tries, found "${D.tries}".`);D.tries=U2(D.name)?D.tries||3:1,D.keep=!!D.keep,D.detachDescriptor=!!D.detachDescriptor,D.discardDescriptor=!!D.discardDescriptor,D.unsafeCleanup=!!D.unsafeCleanup,D.prefix=U2(D.prefix)?"":D.prefix,D.postfix=U2(D.postfix)?"":D.postfix}function Hf(D,F,$,J){if(U2(F))return J(null);m$D(F,$,function(Q,Z){if(Q)return J(Q);let X=z0.relative($,Z);if(!Z.startsWith($))return J(Error(`${D} option must be relative to "${$}", found "${X}".`));J(null,X)})}function zf(D,F,$){if(U2(F))return;let J=d$D(F,$),Q=z0.relative($,J);if(!J.startsWith($))throw Error(`${D} option must be relative to "${$}", found "${Q}".`);return Q}function p$D(D,F){i$D(D,function($,J){if($)return F($);D.tmpdir=J;try{If(D,J)}catch(Q){return F(Q)}Hf("dir",D.dir,J,function(Q,Z){if(Q)return F(Q);D.dir=U2(Z)?"":Z,Hf("template",D.template,J,function(X,Y){if(X)return F(X);D.template=Y,F(null,D)})})})}function l$D(D){let F=D.tmpdir=Nf(D);If(D,F);let $=zf("dir",D.dir,F);return D.dir=U2($)?"":$,D.template=zf("template",D.template,F),D}function c$D(D){return wf(D,-S$D,"EBADF")}function UH(D){return wf(D,-x$D,"ENOENT")}function wf(D,F,$){return j$D?D.code===$:D.code===$&&D.errno===F}function n$D(){Of=!0}function i$D(D,F){return _D.realpath(D&&D.tmpdir||CY.tmpdir(),F)}function Nf(D){return _D.realpathSync(D&&D.tmpdir||CY.tmpdir())}process.addListener("exit",g$D);Object.defineProperty(o$D,"tmpdir",{enumerable:!0,configurable:!1,get:function(){return Nf()}});o$D.dir=b$D;o$D.dirSync=v$D;o$D.file=y$D;o$D.fileSync=f$D;o$D.tmpName=VH;o$D.tmpNameSync=HH;o$D.setGracefulCleanup=n$D});var n5=I((VP0,Lf)=>{var $JD=Number.MAX_SAFE_INTEGER||9007199254740991,JJD=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Lf.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:$JD,RELEASE_TYPES:JJD,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var i5=I((HP0,Pf)=>{var QJD=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...D)=>console.error("SEMVER",...D):()=>{};Pf.exports=QJD});var V9=I((p8,jf)=>{var{MAX_SAFE_COMPONENT_LENGTH:zH,MAX_SAFE_BUILD_LENGTH:ZJD,MAX_LENGTH:XJD}=n5(),YJD=i5();p8=jf.exports={};var qJD=p8.re=[],GJD=p8.safeRe=[],p=p8.src=[],BJD=p8.safeSrc=[],l=p8.t={},WJD=0,CH="[a-zA-Z0-9-]",KJD=[["\\s",1],["\\d",XJD],[CH,ZJD]],UJD=(D)=>{for(let[F,$]of KJD)D=D.split(`${F}*`).join(`${F}{0,${$}}`).split(`${F}+`).join(`${F}{1,${$}}`);return D},e=(D,F,$)=>{let J=UJD(F),Q=WJD++;YJD(D,Q,F),l[D]=Q,p[Q]=F,BJD[Q]=J,qJD[Q]=new RegExp(F,$?"g":void 0),GJD[Q]=new RegExp(J,$?"g":void 0)};e("NUMERICIDENTIFIER","0|[1-9]\\d*");e("NUMERICIDENTIFIERLOOSE","\\d+");e("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${CH}*`);e("MAINVERSION",`(${p[l.NUMERICIDENTIFIER]})\\.(${p[l.NUMERICIDENTIFIER]})\\.(${p[l.NUMERICIDENTIFIER]})`);e("MAINVERSIONLOOSE",`(${p[l.NUMERICIDENTIFIERLOOSE]})\\.(${p[l.NUMERICIDENTIFIERLOOSE]})\\.(${p[l.NUMERICIDENTIFIERLOOSE]})`);e("PRERELEASEIDENTIFIER",`(?:${p[l.NONNUMERICIDENTIFIER]}|${p[l.NUMERICIDENTIFIER]})`);e("PRERELEASEIDENTIFIERLOOSE",`(?:${p[l.NONNUMERICIDENTIFIER]}|${p[l.NUMERICIDENTIFIERLOOSE]})`);e("PRERELEASE",`(?:-(${p[l.PRERELEASEIDENTIFIER]}(?:\\.${p[l.PRERELEASEIDENTIFIER]})*))`);e("PRERELEASELOOSE",`(?:-?(${p[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${p[l.PRERELEASEIDENTIFIERLOOSE]})*))`);e("BUILDIDENTIFIER",`${CH}+`);e("BUILD",`(?:\\+(${p[l.BUILDIDENTIFIER]}(?:\\.${p[l.BUILDIDENTIFIER]})*))`);e("FULLPLAIN",`v?${p[l.MAINVERSION]}${p[l.PRERELEASE]}?${p[l.BUILD]}?`);e("FULL",`^${p[l.FULLPLAIN]}$`);e("LOOSEPLAIN",`[v=\\s]*${p[l.MAINVERSIONLOOSE]}${p[l.PRERELEASELOOSE]}?${p[l.BUILD]}?`);e("LOOSE",`^${p[l.LOOSEPLAIN]}$`);e("GTLT","((?:<|>)?=?)");e("XRANGEIDENTIFIERLOOSE",`${p[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);e("XRANGEIDENTIFIER",`${p[l.NUMERICIDENTIFIER]}|x|X|\\*`);e("XRANGEPLAIN",`[v=\\s]*(${p[l.XRANGEIDENTIFIER]})(?:\\.(${p[l.XRANGEIDENTIFIER]})(?:\\.(${p[l.XRANGEIDENTIFIER]})(?:${p[l.PRERELEASE]})?${p[l.BUILD]}?)?)?`);e("XRANGEPLAINLOOSE",`[v=\\s]*(${p[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${p[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${p[l.XRANGEIDENTIFIERLOOSE]})(?:${p[l.PRERELEASELOOSE]})?${p[l.BUILD]}?)?)?`);e("XRANGE",`^${p[l.GTLT]}\\s*${p[l.XRANGEPLAIN]}$`);e("XRANGELOOSE",`^${p[l.GTLT]}\\s*${p[l.XRANGEPLAINLOOSE]}$`);e("COERCEPLAIN",`(^|[^\\d])(\\d{1,${zH}})(?:\\.(\\d{1,${zH}}))?(?:\\.(\\d{1,${zH}}))?`);e("COERCE",`${p[l.COERCEPLAIN]}(?:$|[^\\d])`);e("COERCEFULL",p[l.COERCEPLAIN]+`(?:${p[l.PRERELEASE]})?(?:${p[l.BUILD]})?(?:$|[^\\d])`);e("COERCERTL",p[l.COERCE],!0);e("COERCERTLFULL",p[l.COERCEFULL],!0);e("LONETILDE","(?:~>?)");e("TILDETRIM",`(\\s*)${p[l.LONETILDE]}\\s+`,!0);p8.tildeTrimReplace="$1~";e("TILDE",`^${p[l.LONETILDE]}${p[l.XRANGEPLAIN]}$`);e("TILDELOOSE",`^${p[l.LONETILDE]}${p[l.XRANGEPLAINLOOSE]}$`);e("LONECARET","(?:\\^)");e("CARETTRIM",`(\\s*)${p[l.LONECARET]}\\s+`,!0);p8.caretTrimReplace="$1^";e("CARET",`^${p[l.LONECARET]}${p[l.XRANGEPLAIN]}$`);e("CARETLOOSE",`^${p[l.LONECARET]}${p[l.XRANGEPLAINLOOSE]}$`);e("COMPARATORLOOSE",`^${p[l.GTLT]}\\s*(${p[l.LOOSEPLAIN]})$|^$`);e("COMPARATOR",`^${p[l.GTLT]}\\s*(${p[l.FULLPLAIN]})$|^$`);e("COMPARATORTRIM",`(\\s*)${p[l.GTLT]}\\s*(${p[l.LOOSEPLAIN]}|${p[l.XRANGEPLAIN]})`,!0);p8.comparatorTrimReplace="$1$2$3";e("HYPHENRANGE",`^\\s*(${p[l.XRANGEPLAIN]})\\s+-\\s+(${p[l.XRANGEPLAIN]})\\s*$`);e("HYPHENRANGELOOSE",`^\\s*(${p[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${p[l.XRANGEPLAINLOOSE]})\\s*$`);e("STAR","(<|>)?=?\\s*\\*");e("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");e("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var _Y=I((zP0,Sf)=>{var VJD=Object.freeze({loose:!0}),HJD=Object.freeze({}),zJD=(D)=>{if(!D)return HJD;if(typeof D!=="object")return VJD;return D};Sf.exports=zJD});var _H=I((CP0,yf)=>{var xf=/^[0-9]+$/,kf=(D,F)=>{if(typeof D==="number"&&typeof F==="number")return D===F?0:D<F?-1:1;let $=xf.test(D),J=xf.test(F);if($&&J)D=+D,F=+F;return D===F?0:$&&!J?-1:J&&!$?1:D<F?-1:1},CJD=(D,F)=>kf(F,D);yf.exports={compareIdentifiers:kf,rcompareIdentifiers:CJD}});var L0=I((_P0,bf)=>{var MY=i5(),{MAX_LENGTH:ff,MAX_SAFE_INTEGER:OY}=n5(),{safeRe:EY,t:RY}=V9(),_JD=_Y(),{compareIdentifiers:MH}=_H();class Q8{constructor(D,F){if(F=_JD(F),D instanceof Q8)if(D.loose===!!F.loose&&D.includePrerelease===!!F.includePrerelease)return D;else D=D.version;else if(typeof D!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof D}".`);if(D.length>ff)throw TypeError(`version is longer than ${ff} characters`);MY("SemVer",D,F),this.options=F,this.loose=!!F.loose,this.includePrerelease=!!F.includePrerelease;let $=D.trim().match(F.loose?EY[RY.LOOSE]:EY[RY.FULL]);if(!$)throw TypeError(`Invalid Version: ${D}`);if(this.raw=D,this.major=+$[1],this.minor=+$[2],this.patch=+$[3],this.major>OY||this.major<0)throw TypeError("Invalid major version");if(this.minor>OY||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>OY||this.patch<0)throw TypeError("Invalid patch version");if(!$[4])this.prerelease=[];else this.prerelease=$[4].split(".").map((J)=>{if(/^[0-9]+$/.test(J)){let Q=+J;if(Q>=0&&Q<OY)return Q}return J});this.build=$[5]?$[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(D){if(MY("SemVer.compare",this.version,this.options,D),!(D instanceof Q8)){if(typeof D==="string"&&D===this.version)return 0;D=new Q8(D,this.options)}if(D.version===this.version)return 0;return this.compareMain(D)||this.comparePre(D)}compareMain(D){if(!(D instanceof Q8))D=new Q8(D,this.options);if(this.major<D.major)return-1;if(this.major>D.major)return 1;if(this.minor<D.minor)return-1;if(this.minor>D.minor)return 1;if(this.patch<D.patch)return-1;if(this.patch>D.patch)return 1;return 0}comparePre(D){if(!(D instanceof Q8))D=new Q8(D,this.options);if(this.prerelease.length&&!D.prerelease.length)return-1;else if(!this.prerelease.length&&D.prerelease.length)return 1;else if(!this.prerelease.length&&!D.prerelease.length)return 0;let F=0;do{let $=this.prerelease[F],J=D.prerelease[F];if(MY("prerelease compare",F,$,J),$===void 0&&J===void 0)return 0;else if(J===void 0)return 1;else if($===void 0)return-1;else if($===J)continue;else return MH($,J)}while(++F)}compareBuild(D){if(!(D instanceof Q8))D=new Q8(D,this.options);let F=0;do{let $=this.build[F],J=D.build[F];if(MY("build compare",F,$,J),$===void 0&&J===void 0)return 0;else if(J===void 0)return 1;else if($===void 0)return-1;else if($===J)continue;else return MH($,J)}while(++F)}inc(D,F,$){if(D.startsWith("pre")){if(!F&&$===!1)throw Error("invalid increment argument: identifier is empty");if(F){let J=`-${F}`.match(this.options.loose?EY[RY.PRERELEASELOOSE]:EY[RY.PRERELEASE]);if(!J||J[1]!==F)throw Error(`invalid identifier: ${F}`)}}switch(D){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",F,$);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",F,$);break;case"prepatch":this.prerelease.length=0,this.inc("patch",F,$),this.inc("pre",F,$);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",F,$);this.inc("pre",F,$);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let J=Number($)?1:0;if(this.prerelease.length===0)this.prerelease=[J];else{let Q=this.prerelease.length;while(--Q>=0)if(typeof this.prerelease[Q]==="number")this.prerelease[Q]++,Q=-2;if(Q===-1){if(F===this.prerelease.join(".")&&$===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(J)}}if(F){let Q=[F,J];if($===!1)Q=[F];if(MH(this.prerelease[0],F)===0){if(isNaN(this.prerelease[1]))this.prerelease=Q}else this.prerelease=Q}break}default:throw Error(`invalid increment argument: ${D}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}bf.exports=Q8});var m3=I((MP0,hf)=>{var vf=L0(),MJD=(D,F,$=!1)=>{if(D instanceof vf)return D;try{return new vf(D,F)}catch(J){if(!$)return null;throw J}};hf.exports=MJD});var gf=I((OP0,uf)=>{var OJD=m3(),EJD=(D,F)=>{let $=OJD(D,F);return $?$.version:null};uf.exports=EJD});var df=I((EP0,mf)=>{var RJD=m3(),AJD=(D,F)=>{let $=RJD(D.trim().replace(/^[=v]+/,""),F);return $?$.version:null};mf.exports=AJD});var cf=I((RP0,lf)=>{var pf=L0(),IJD=(D,F,$,J,Q)=>{if(typeof $==="string")Q=J,J=$,$=void 0;try{return new pf(D instanceof pf?D.version:D,$).inc(F,J,Q).version}catch(Z){return null}};lf.exports=IJD});var af=I((AP0,of)=>{var nf=m3(),wJD=(D,F)=>{let $=nf(D,null,!0),J=nf(F,null,!0),Q=$.compare(J);if(Q===0)return null;let Z=Q>0,X=Z?$:J,Y=Z?J:$,q=!!X.prerelease.length;if(!!Y.prerelease.length&&!q){if(!Y.patch&&!Y.minor)return"major";if(Y.compareMain(X)===0){if(Y.minor&&!Y.patch)return"minor";return"patch"}}let B=q?"pre":"";if($.major!==J.major)return B+"major";if($.minor!==J.minor)return B+"minor";if($.patch!==J.patch)return B+"patch";return"prerelease"};of.exports=wJD});var sf=I((IP0,rf)=>{var NJD=L0(),TJD=(D,F)=>new NJD(D,F).major;rf.exports=TJD});var ef=I((wP0,tf)=>{var LJD=L0(),PJD=(D,F)=>new LJD(D,F).minor;tf.exports=PJD});var Fb=I((NP0,Db)=>{var jJD=L0(),SJD=(D,F)=>new jJD(D,F).patch;Db.exports=SJD});var Jb=I((TP0,$b)=>{var xJD=m3(),kJD=(D,F)=>{let $=xJD(D,F);return $&&$.prerelease.length?$.prerelease:null};$b.exports=kJD});var x2=I((LP0,Zb)=>{var Qb=L0(),yJD=(D,F,$)=>new Qb(D,$).compare(new Qb(F,$));Zb.exports=yJD});var Yb=I((PP0,Xb)=>{var fJD=x2(),bJD=(D,F,$)=>fJD(F,D,$);Xb.exports=bJD});var Gb=I((jP0,qb)=>{var vJD=x2(),hJD=(D,F)=>vJD(D,F,!0);qb.exports=hJD});var AY=I((SP0,Wb)=>{var Bb=L0(),uJD=(D,F,$)=>{let J=new Bb(D,$),Q=new Bb(F,$);return J.compare(Q)||J.compareBuild(Q)};Wb.exports=uJD});var Ub=I((xP0,Kb)=>{var gJD=AY(),mJD=(D,F)=>D.sort(($,J)=>gJD($,J,F));Kb.exports=mJD});var Hb=I((kP0,Vb)=>{var dJD=AY(),pJD=(D,F)=>D.sort(($,J)=>dJD(J,$,F));Vb.exports=pJD});var o5=I((yP0,zb)=>{var lJD=x2(),cJD=(D,F,$)=>lJD(D,F,$)>0;zb.exports=cJD});var IY=I((fP0,Cb)=>{var nJD=x2(),iJD=(D,F,$)=>nJD(D,F,$)<0;Cb.exports=iJD});var OH=I((bP0,_b)=>{var oJD=x2(),aJD=(D,F,$)=>oJD(D,F,$)===0;_b.exports=aJD});var EH=I((vP0,Mb)=>{var rJD=x2(),sJD=(D,F,$)=>rJD(D,F,$)!==0;Mb.exports=sJD});var wY=I((hP0,Ob)=>{var tJD=x2(),eJD=(D,F,$)=>tJD(D,F,$)>=0;Ob.exports=eJD});var NY=I((uP0,Eb)=>{var DQD=x2(),FQD=(D,F,$)=>DQD(D,F,$)<=0;Eb.exports=FQD});var RH=I((gP0,Rb)=>{var $QD=OH(),JQD=EH(),QQD=o5(),ZQD=wY(),XQD=IY(),YQD=NY(),qQD=(D,F,$,J)=>{switch(F){case"===":if(typeof D==="object")D=D.version;if(typeof $==="object")$=$.version;return D===$;case"!==":if(typeof D==="object")D=D.version;if(typeof $==="object")$=$.version;return D!==$;case"":case"=":case"==":return $QD(D,$,J);case"!=":return JQD(D,$,J);case">":return QQD(D,$,J);case">=":return ZQD(D,$,J);case"<":return XQD(D,$,J);case"<=":return YQD(D,$,J);default:throw TypeError(`Invalid operator: ${F}`)}};Rb.exports=qQD});var Ib=I((mP0,Ab)=>{var GQD=L0(),BQD=m3(),{safeRe:TY,t:LY}=V9(),WQD=(D,F)=>{if(D instanceof GQD)return D;if(typeof D==="number")D=String(D);if(typeof D!=="string")return null;F=F||{};let $=null;if(!F.rtl)$=D.match(F.includePrerelease?TY[LY.COERCEFULL]:TY[LY.COERCE]);else{let q=F.includePrerelease?TY[LY.COERCERTLFULL]:TY[LY.COERCERTL],G;while((G=q.exec(D))&&(!$||$.index+$[0].length!==D.length)){if(!$||G.index+G[0].length!==$.index+$[0].length)$=G;q.lastIndex=G.index+G[1].length+G[2].length}q.lastIndex=-1}if($===null)return null;let J=$[2],Q=$[3]||"0",Z=$[4]||"0",X=F.includePrerelease&&$[5]?`-${$[5]}`:"",Y=F.includePrerelease&&$[6]?`+${$[6]}`:"";return BQD(`${J}.${Q}.${Z}${X}${Y}`,F)};Ab.exports=WQD});var Tb=I((dP0,Nb)=>{class wb{constructor(){this.max=1000,this.map=new Map}get(D){let F=this.map.get(D);if(F===void 0)return;else return this.map.delete(D),this.map.set(D,F),F}delete(D){return this.map.delete(D)}set(D,F){if(!this.delete(D)&&F!==void 0){if(this.map.size>=this.max){let J=this.map.keys().next().value;this.delete(J)}this.map.set(D,F)}return this}}Nb.exports=wb});var k2=I((pP0,Sb)=>{var KQD=/\s+/g;class a5{constructor(D,F){if(F=VQD(F),D instanceof a5)if(D.loose===!!F.loose&&D.includePrerelease===!!F.includePrerelease)return D;else return new a5(D.raw,F);if(D instanceof AH)return this.raw=D.value,this.set=[[D]],this.formatted=void 0,this;if(this.options=F,this.loose=!!F.loose,this.includePrerelease=!!F.includePrerelease,this.raw=D.trim().replace(KQD," "),this.set=this.raw.split("||").map(($)=>this.parseRange($.trim())).filter(($)=>$.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let $=this.set[0];if(this.set=this.set.filter((J)=>!Pb(J[0])),this.set.length===0)this.set=[$];else if(this.set.length>1){for(let J of this.set)if(J.length===1&&EQD(J[0])){this.set=[J];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let D=0;D<this.set.length;D++){if(D>0)this.formatted+="||";let F=this.set[D];for(let $=0;$<F.length;$++){if($>0)this.formatted+=" ";this.formatted+=F[$].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(D){let $=((this.options.includePrerelease&&MQD)|(this.options.loose&&OQD))+":"+D,J=Lb.get($);if(J)return J;let Q=this.options.loose,Z=Q?p0[P0.HYPHENRANGELOOSE]:p0[P0.HYPHENRANGE];D=D.replace(Z,SQD(this.options.includePrerelease)),ND("hyphen replace",D),D=D.replace(p0[P0.COMPARATORTRIM],zQD),ND("comparator trim",D),D=D.replace(p0[P0.TILDETRIM],CQD),ND("tilde trim",D),D=D.replace(p0[P0.CARETTRIM],_QD),ND("caret trim",D);let X=D.split(" ").map((B)=>RQD(B,this.options)).join(" ").split(/\s+/).map((B)=>jQD(B,this.options));if(Q)X=X.filter((B)=>{return ND("loose invalid filter",B,this.options),!!B.match(p0[P0.COMPARATORLOOSE])});ND("range list",X);let Y=new Map,q=X.map((B)=>new AH(B,this.options));for(let B of q){if(Pb(B))return[B];Y.set(B.value,B)}if(Y.size>1&&Y.has(""))Y.delete("");let G=[...Y.values()];return Lb.set($,G),G}intersects(D,F){if(!(D instanceof a5))throw TypeError("a Range is required");return this.set.some(($)=>{return jb($,F)&&D.set.some((J)=>{return jb(J,F)&&$.every((Q)=>{return J.every((Z)=>{return Q.intersects(Z,F)})})})})}test(D){if(!D)return!1;if(typeof D==="string")try{D=new HQD(D,this.options)}catch(F){return!1}for(let F=0;F<this.set.length;F++)if(xQD(this.set[F],D,this.options))return!0;return!1}}Sb.exports=a5;var UQD=Tb(),Lb=new UQD,VQD=_Y(),AH=r5(),ND=i5(),HQD=L0(),{safeRe:p0,t:P0,comparatorTrimReplace:zQD,tildeTrimReplace:CQD,caretTrimReplace:_QD}=V9(),{FLAG_INCLUDE_PRERELEASE:MQD,FLAG_LOOSE:OQD}=n5(),Pb=(D)=>D.value==="<0.0.0-0",EQD=(D)=>D.value==="",jb=(D,F)=>{let $=!0,J=D.slice(),Q=J.pop();while($&&J.length)$=J.every((Z)=>{return Q.intersects(Z,F)}),Q=J.pop();return $},RQD=(D,F)=>{return D=D.replace(p0[P0.BUILD],""),ND("comp",D,F),D=wQD(D,F),ND("caret",D),D=AQD(D,F),ND("tildes",D),D=TQD(D,F),ND("xrange",D),D=PQD(D,F),ND("stars",D),D},l0=(D)=>!D||D.toLowerCase()==="x"||D==="*",AQD=(D,F)=>{return D.trim().split(/\s+/).map(($)=>IQD($,F)).join(" ")},IQD=(D,F)=>{let $=F.loose?p0[P0.TILDELOOSE]:p0[P0.TILDE];return D.replace($,(J,Q,Z,X,Y)=>{ND("tilde",D,J,Q,Z,X,Y);let q;if(l0(Q))q="";else if(l0(Z))q=`>=${Q}.0.0 <${+Q+1}.0.0-0`;else if(l0(X))q=`>=${Q}.${Z}.0 <${Q}.${+Z+1}.0-0`;else if(Y)ND("replaceTilde pr",Y),q=`>=${Q}.${Z}.${X}-${Y} <${Q}.${+Z+1}.0-0`;else q=`>=${Q}.${Z}.${X} <${Q}.${+Z+1}.0-0`;return ND("tilde return",q),q})},wQD=(D,F)=>{return D.trim().split(/\s+/).map(($)=>NQD($,F)).join(" ")},NQD=(D,F)=>{ND("caret",D,F);let $=F.loose?p0[P0.CARETLOOSE]:p0[P0.CARET],J=F.includePrerelease?"-0":"";return D.replace($,(Q,Z,X,Y,q)=>{ND("caret",D,Q,Z,X,Y,q);let G;if(l0(Z))G="";else if(l0(X))G=`>=${Z}.0.0${J} <${+Z+1}.0.0-0`;else if(l0(Y))if(Z==="0")G=`>=${Z}.${X}.0${J} <${Z}.${+X+1}.0-0`;else G=`>=${Z}.${X}.0${J} <${+Z+1}.0.0-0`;else if(q)if(ND("replaceCaret pr",q),Z==="0")if(X==="0")G=`>=${Z}.${X}.${Y}-${q} <${Z}.${X}.${+Y+1}-0`;else G=`>=${Z}.${X}.${Y}-${q} <${Z}.${+X+1}.0-0`;else G=`>=${Z}.${X}.${Y}-${q} <${+Z+1}.0.0-0`;else if(ND("no pr"),Z==="0")if(X==="0")G=`>=${Z}.${X}.${Y}${J} <${Z}.${X}.${+Y+1}-0`;else G=`>=${Z}.${X}.${Y}${J} <${Z}.${+X+1}.0-0`;else G=`>=${Z}.${X}.${Y} <${+Z+1}.0.0-0`;return ND("caret return",G),G})},TQD=(D,F)=>{return ND("replaceXRanges",D,F),D.split(/\s+/).map(($)=>LQD($,F)).join(" ")},LQD=(D,F)=>{D=D.trim();let $=F.loose?p0[P0.XRANGELOOSE]:p0[P0.XRANGE];return D.replace($,(J,Q,Z,X,Y,q)=>{ND("xRange",D,J,Q,Z,X,Y,q);let G=l0(Z),B=G||l0(X),W=B||l0(Y),K=W;if(Q==="="&&K)Q="";if(q=F.includePrerelease?"-0":"",G)if(Q===">"||Q==="<")J="<0.0.0-0";else J="*";else if(Q&&K){if(B)X=0;if(Y=0,Q===">")if(Q=">=",B)Z=+Z+1,X=0,Y=0;else X=+X+1,Y=0;else if(Q==="<=")if(Q="<",B)Z=+Z+1;else X=+X+1;if(Q==="<")q="-0";J=`${Q+Z}.${X}.${Y}${q}`}else if(B)J=`>=${Z}.0.0${q} <${+Z+1}.0.0-0`;else if(W)J=`>=${Z}.${X}.0${q} <${Z}.${+X+1}.0-0`;return ND("xRange return",J),J})},PQD=(D,F)=>{return ND("replaceStars",D,F),D.trim().replace(p0[P0.STAR],"")},jQD=(D,F)=>{return ND("replaceGTE0",D,F),D.trim().replace(p0[F.includePrerelease?P0.GTE0PRE:P0.GTE0],"")},SQD=(D)=>(F,$,J,Q,Z,X,Y,q,G,B,W,K)=>{if(l0(J))$="";else if(l0(Q))$=`>=${J}.0.0${D?"-0":""}`;else if(l0(Z))$=`>=${J}.${Q}.0${D?"-0":""}`;else if(X)$=`>=${$}`;else $=`>=${$}${D?"-0":""}`;if(l0(G))q="";else if(l0(B))q=`<${+G+1}.0.0-0`;else if(l0(W))q=`<${G}.${+B+1}.0-0`;else if(K)q=`<=${G}.${B}.${W}-${K}`;else if(D)q=`<${G}.${B}.${+W+1}-0`;else q=`<=${q}`;return`${$} ${q}`.trim()},xQD=(D,F,$)=>{for(let J=0;J<D.length;J++)if(!D[J].test(F))return!1;if(F.prerelease.length&&!$.includePrerelease){for(let J=0;J<D.length;J++){if(ND(D[J].semver),D[J].semver===AH.ANY)continue;if(D[J].semver.prerelease.length>0){let Q=D[J].semver;if(Q.major===F.major&&Q.minor===F.minor&&Q.patch===F.patch)return!0}}return!1}return!0}});var r5=I((lP0,vb)=>{var s5=Symbol("SemVer ANY");class PY{static get ANY(){return s5}constructor(D,F){if(F=xb(F),D instanceof PY)if(D.loose===!!F.loose)return D;else D=D.value;if(D=D.trim().split(/\s+/).join(" "),wH("comparator",D,F),this.options=F,this.loose=!!F.loose,this.parse(D),this.semver===s5)this.value="";else this.value=this.operator+this.semver.version;wH("comp",this)}parse(D){let F=this.options.loose?kb[yb.COMPARATORLOOSE]:kb[yb.COMPARATOR],$=D.match(F);if(!$)throw TypeError(`Invalid comparator: ${D}`);if(this.operator=$[1]!==void 0?$[1]:"",this.operator==="=")this.operator="";if(!$[2])this.semver=s5;else this.semver=new fb($[2],this.options.loose)}toString(){return this.value}test(D){if(wH("Comparator.test",D,this.options.loose),this.semver===s5||D===s5)return!0;if(typeof D==="string")try{D=new fb(D,this.options)}catch(F){return!1}return IH(D,this.operator,this.semver,this.options)}intersects(D,F){if(!(D instanceof PY))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new bb(D.value,F).test(this.value)}else if(D.operator===""){if(D.value==="")return!0;return new bb(this.value,F).test(D.semver)}if(F=xb(F),F.includePrerelease&&(this.value==="<0.0.0-0"||D.value==="<0.0.0-0"))return!1;if(!F.includePrerelease&&(this.value.startsWith("<0.0.0")||D.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&D.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&D.operator.startsWith("<"))return!0;if(this.semver.version===D.semver.version&&this.operator.includes("=")&&D.operator.includes("="))return!0;if(IH(this.semver,"<",D.semver,F)&&this.operator.startsWith(">")&&D.operator.startsWith("<"))return!0;if(IH(this.semver,">",D.semver,F)&&this.operator.startsWith("<")&&D.operator.startsWith(">"))return!0;return!1}}vb.exports=PY;var xb=_Y(),{safeRe:kb,t:yb}=V9(),IH=RH(),wH=i5(),fb=L0(),bb=k2()});var t5=I((cP0,hb)=>{var kQD=k2(),yQD=(D,F,$)=>{try{F=new kQD(F,$)}catch(J){return!1}return F.test(D)};hb.exports=yQD});var gb=I((nP0,ub)=>{var fQD=k2(),bQD=(D,F)=>new fQD(D,F).set.map(($)=>$.map((J)=>J.value).join(" ").trim().split(" "));ub.exports=bQD});var db=I((iP0,mb)=>{var vQD=L0(),hQD=k2(),uQD=(D,F,$)=>{let J=null,Q=null,Z=null;try{Z=new hQD(F,$)}catch(X){return null}return D.forEach((X)=>{if(Z.test(X)){if(!J||Q.compare(X)===-1)J=X,Q=new vQD(J,$)}}),J};mb.exports=uQD});var lb=I((oP0,pb)=>{var gQD=L0(),mQD=k2(),dQD=(D,F,$)=>{let J=null,Q=null,Z=null;try{Z=new mQD(F,$)}catch(X){return null}return D.forEach((X)=>{if(Z.test(X)){if(!J||Q.compare(X)===1)J=X,Q=new gQD(J,$)}}),J};pb.exports=dQD});var ib=I((aP0,nb)=>{var NH=L0(),pQD=k2(),cb=o5(),lQD=(D,F)=>{D=new pQD(D,F);let $=new NH("0.0.0");if(D.test($))return $;if($=new NH("0.0.0-0"),D.test($))return $;$=null;for(let J=0;J<D.set.length;++J){let Q=D.set[J],Z=null;if(Q.forEach((X)=>{let Y=new NH(X.semver.version);switch(X.operator){case">":if(Y.prerelease.length===0)Y.patch++;else Y.prerelease.push(0);Y.raw=Y.format();case"":case">=":if(!Z||cb(Y,Z))Z=Y;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${X.operator}`)}}),Z&&(!$||cb($,Z)))$=Z}if($&&D.test($))return $;return null};nb.exports=lQD});var ab=I((rP0,ob)=>{var cQD=k2(),nQD=(D,F)=>{try{return new cQD(D,F).range||"*"}catch($){return null}};ob.exports=nQD});var jY=I((sP0,eb)=>{var iQD=L0(),tb=r5(),{ANY:oQD}=tb,aQD=k2(),rQD=t5(),rb=o5(),sb=IY(),sQD=NY(),tQD=wY(),eQD=(D,F,$,J)=>{D=new iQD(D,J),F=new aQD(F,J);let Q,Z,X,Y,q;switch($){case">":Q=rb,Z=sQD,X=sb,Y=">",q=">=";break;case"<":Q=sb,Z=tQD,X=rb,Y="<",q="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(rQD(D,F,J))return!1;for(let G=0;G<F.set.length;++G){let B=F.set[G],W=null,K=null;if(B.forEach((U)=>{if(U.semver===oQD)U=new tb(">=0.0.0");if(W=W||U,K=K||U,Q(U.semver,W.semver,J))W=U;else if(X(U.semver,K.semver,J))K=U}),W.operator===Y||W.operator===q)return!1;if((!K.operator||K.operator===Y)&&Z(D,K.semver))return!1;else if(K.operator===q&&X(D,K.semver))return!1}return!0};eb.exports=eQD});var Fv=I((tP0,Dv)=>{var DZD=jY(),FZD=(D,F,$)=>DZD(D,F,">",$);Dv.exports=FZD});var Jv=I((eP0,$v)=>{var $ZD=jY(),JZD=(D,F,$)=>$ZD(D,F,"<",$);$v.exports=JZD});var Xv=I((Dj0,Zv)=>{var Qv=k2(),QZD=(D,F,$)=>{return D=new Qv(D,$),F=new Qv(F,$),D.intersects(F,$)};Zv.exports=QZD});var qv=I((Fj0,Yv)=>{var ZZD=t5(),XZD=x2();Yv.exports=(D,F,$)=>{let J=[],Q=null,Z=null,X=D.sort((B,W)=>XZD(B,W,$));for(let B of X)if(ZZD(B,F,$)){if(Z=B,!Q)Q=B}else{if(Z)J.push([Q,Z]);Z=null,Q=null}if(Q)J.push([Q,null]);let Y=[];for(let[B,W]of J)if(B===W)Y.push(B);else if(!W&&B===X[0])Y.push("*");else if(!W)Y.push(`>=${B}`);else if(B===X[0])Y.push(`<=${W}`);else Y.push(`${B} - ${W}`);let q=Y.join(" || "),G=typeof F.raw==="string"?F.raw:String(F);return q.length<G.length?q:F}});var Vv=I(($j0,Uv)=>{var Gv=k2(),LH=r5(),{ANY:TH}=LH,e5=t5(),PH=x2(),YZD=(D,F,$={})=>{if(D===F)return!0;D=new Gv(D,$),F=new Gv(F,$);let J=!1;D:for(let Q of D.set){for(let Z of F.set){let X=GZD(Q,Z,$);if(J=J||X!==null,X)continue D}if(J)return!1}return!0},qZD=[new LH(">=0.0.0-0")],Bv=[new LH(">=0.0.0")],GZD=(D,F,$)=>{if(D===F)return!0;if(D.length===1&&D[0].semver===TH)if(F.length===1&&F[0].semver===TH)return!0;else if($.includePrerelease)D=qZD;else D=Bv;if(F.length===1&&F[0].semver===TH)if($.includePrerelease)return!0;else F=Bv;let J=new Set,Q,Z;for(let U of D)if(U.operator===">"||U.operator===">=")Q=Wv(Q,U,$);else if(U.operator==="<"||U.operator==="<=")Z=Kv(Z,U,$);else J.add(U.semver);if(J.size>1)return null;let X;if(Q&&Z){if(X=PH(Q.semver,Z.semver,$),X>0)return null;else if(X===0&&(Q.operator!==">="||Z.operator!=="<="))return null}for(let U of J){if(Q&&!e5(U,String(Q),$))return null;if(Z&&!e5(U,String(Z),$))return null;for(let V of F)if(!e5(U,String(V),$))return!1;return!0}let Y,q,G,B,W=Z&&!$.includePrerelease&&Z.semver.prerelease.length?Z.semver:!1,K=Q&&!$.includePrerelease&&Q.semver.prerelease.length?Q.semver:!1;if(W&&W.prerelease.length===1&&Z.operator==="<"&&W.prerelease[0]===0)W=!1;for(let U of F){if(B=B||U.operator===">"||U.operator===">=",G=G||U.operator==="<"||U.operator==="<=",Q){if(K){if(U.semver.prerelease&&U.semver.prerelease.length&&U.semver.major===K.major&&U.semver.minor===K.minor&&U.semver.patch===K.patch)K=!1}if(U.operator===">"||U.operator===">="){if(Y=Wv(Q,U,$),Y===U&&Y!==Q)return!1}else if(Q.operator===">="&&!e5(Q.semver,String(U),$))return!1}if(Z){if(W){if(U.semver.prerelease&&U.semver.prerelease.length&&U.semver.major===W.major&&U.semver.minor===W.minor&&U.semver.patch===W.patch)W=!1}if(U.operator==="<"||U.operator==="<="){if(q=Kv(Z,U,$),q===U&&q!==Z)return!1}else if(Z.operator==="<="&&!e5(Z.semver,String(U),$))return!1}if(!U.operator&&(Z||Q)&&X!==0)return!1}if(Q&&G&&!Z&&X!==0)return!1;if(Z&&B&&!Q&&X!==0)return!1;if(K||W)return!1;return!0},Wv=(D,F,$)=>{if(!D)return F;let J=PH(D.semver,F.semver,$);return J>0?D:J<0?F:F.operator===">"&&D.operator===">="?F:D},Kv=(D,F,$)=>{if(!D)return F;let J=PH(D.semver,F.semver,$);return J<0?D:J>0?F:F.operator==="<"&&D.operator==="<="?F:D};Uv.exports=YZD});var D$=I((Jj0,Cv)=>{var jH=V9(),Hv=n5(),BZD=L0(),zv=_H(),WZD=m3(),KZD=gf(),UZD=df(),VZD=cf(),HZD=af(),zZD=sf(),CZD=ef(),_ZD=Fb(),MZD=Jb(),OZD=x2(),EZD=Yb(),RZD=Gb(),AZD=AY(),IZD=Ub(),wZD=Hb(),NZD=o5(),TZD=IY(),LZD=OH(),PZD=EH(),jZD=wY(),SZD=NY(),xZD=RH(),kZD=Ib(),yZD=r5(),fZD=k2(),bZD=t5(),vZD=gb(),hZD=db(),uZD=lb(),gZD=ib(),mZD=ab(),dZD=jY(),pZD=Fv(),lZD=Jv(),cZD=Xv(),nZD=qv(),iZD=Vv();Cv.exports={parse:WZD,valid:KZD,clean:UZD,inc:VZD,diff:HZD,major:zZD,minor:CZD,patch:_ZD,prerelease:MZD,compare:OZD,rcompare:EZD,compareLoose:RZD,compareBuild:AZD,sort:IZD,rsort:wZD,gt:NZD,lt:TZD,eq:LZD,neq:PZD,gte:jZD,lte:SZD,cmp:xZD,coerce:kZD,Comparator:yZD,Range:fZD,satisfies:bZD,toComparators:vZD,maxSatisfying:hZD,minSatisfying:uZD,minVersion:gZD,validRange:mZD,outside:dZD,gtr:pZD,ltr:lZD,intersects:cZD,simplifyRange:nZD,subset:iZD,SemVer:BZD,re:jH.re,src:jH.src,tokens:jH.t,SEMVER_SPEC_VERSION:Hv.SEMVER_SPEC_VERSION,RELEASE_TYPES:Hv.RELEASE_TYPES,compareIdentifiers:zv.compareIdentifiers,rcompareIdentifiers:zv.rcompareIdentifiers}});var $h=I((zx0,Fh)=>{Fh.exports=QYD;function JYD(D){let F={defaultWidth:0,output:process.stdout,tty:r("tty")};if(!D)return F;return Object.keys(F).forEach(function($){if(!D[$])D[$]=F[$]}),D}function QYD(D){let F=JYD(D);if(F.output.getWindowSize)return F.output.getWindowSize()[0]||F.defaultWidth;if(F.tty.getWindowSize)return F.tty.getWindowSize()[1]||F.defaultWidth;if(F.output.columns)return F.output.columns;if(process.env.CLI_WIDTH){let $=parseInt(process.env.CLI_WIDTH,10);if(!isNaN($)&&$!==0)return $}return F.defaultWidth}});var Eh=I((jx0,Oh)=>{var MYD=r("stream");class Mh extends MYD{#J=null;constructor(D={}){super(D);this.writable=this.readable=!0,this.muted=!1,this.on("pipe",this._onpipe),this.replace=D.replace,this._prompt=D.prompt||null,this._hadControl=!1}#$(D,F){if(this._dest)return this._dest[D];if(this._src)return this._src[D];return F}#F(D,...F){if(typeof this._dest?.[D]==="function")this._dest[D](...F);if(typeof this._src?.[D]==="function")this._src[D](...F)}get isTTY(){if(this.#J!==null)return this.#J;return this.#$("isTTY",!1)}set isTTY(D){this.#J=D}get rows(){return this.#$("rows")}get columns(){return this.#$("columns")}mute(){this.muted=!0}unmute(){this.muted=!1}_onpipe(D){this._src=D}pipe(D,F){return this._dest=D,super.pipe(D,F)}pause(){if(this._src)return this._src.pause()}resume(){if(this._src)return this._src.resume()}write(D){if(this.muted){if(!this.replace)return!0;if(D.match(/^\u001b/)){if(D.indexOf(this._prompt)===0)D=D.slice(this._prompt.length),D=D.replace(/./g,this.replace),D=this._prompt+D;return this._hadControl=!0,this.emit("data",D)}else{if(this._prompt&&this._hadControl&&D.indexOf(this._prompt)===0)this._hadControl=!1,this.emit("data",this._prompt),D=D.slice(this._prompt.length);D=D.toString().replace(/./g,this.replace)}}this.emit("data",D)}end(D){if(this.muted)if(D&&this.replace)D=D.toString().replace(/./g,this.replace);else D=null;if(D)this.emit("data",D);this.emit("end")}destroy(...D){return this.#F("destroy",...D)}destroySoon(...D){return this.#F("destroySoon",...D)}close(...D){return this.#F("close",...D)}}Oh.exports=Mh});var jz=TD(Pz(),1),{program:YqD,createCommand:qqD,createArgument:GqD,createOption:BqD,CommanderError:WqD,InvalidArgumentError:$g,InvalidOptionArgumentError:KqD,Command:ZD,Argument:UqD,Option:S0,Help:VqD}=jz.default;var Sz={name:"@cartesi/cli",version:"2.0.0-alpha.30",description:"Cartesi CLI",author:"Danilo Tuler <tuler@pobox.com>",bin:{cartesi:"./dist/index.js"},type:"module",homepage:"https://github.com/cartesi/cli",license:"Apache-2.0",exports:"./dist/index.js",repository:"cartesi/cli",files:["/dist"],dependencies:{"@commander-js/extra-typings":"^14.0.0","@inquirer/confirm":"^6.0.6","@inquirer/core":"^11.1.3","@inquirer/input":"^5.0.6","@inquirer/select":"^5.0.6","@inquirer/type":"^4.0.3",bytes:"^3.1.2",chalk:"^5.6.2","cli-table3":"^0.6.5",commander:"^14.0.3",execa:"^9.6.0","fs-extra":"^11.3.2","get-port":"^7.1.0",listr2:"^10.1.0",lookpath:"^1.2.3","modern-tar":"^0.7.3",ora:"^9.0.0","p-retry":"^7.0.0","progress-stream":"^2.0.0",semver:"^7.7.4","smol-toml":"^1.4.2",tmp:"^0.2.5",viem:"^2.46.1",yaml:"^2.8.2"},devDependencies:{"@cartesi/devnet":"2.0.0-alpha.10","@cartesi/rollups":"2.1.1","@sunodo/wagmi-plugin-hardhat-deploy":"^0.4.0","@types/bun":"^1.3.6","@types/bytes":"^3.1.5","@types/fs-extra":"^11.0.4","@types/inquirer":"^9.0.9","@types/node":"^25.2.3","@types/node-fetch":"^2.6.13","@types/progress-stream":"^2.0.5","@types/prompts":"^2.4.9","@types/semver":"^7.7.1","@types/tmp":"^0.2.6","@wagmi/cli":"^2.10.0","npm-run-all":"^4.1.5",rimraf:"^6.1.3","ts-node":"^10.9.2",tslib:"^2.8.1",typescript:"^5.9.2"},scripts:{build:"run-s clean codegen compile",clean:"rimraf dist",codegen:"run-p codegen:wagmi","codegen:wagmi":"wagmi generate",compile:"bun build.ts",lint:"biome lint",posttest:"bun lint",test:"bun test"},engines:{node:">=20.0.0"},bugs:"https://github.com/cartesi/cli/issues",types:"dist/index.d.ts"};var Ck=TD(Oq(),1);function mD(D){if(typeof D!=="object"||D===null)return!1;let F=Object.getPrototypeOf(D);return(F===null||F===Object.prototype||Object.getPrototypeOf(F)===null)&&!(Symbol.toStringTag in D)&&!(Symbol.iterator in D)}import{fileURLToPath as mg}from"node:url";var J6=(D,F)=>{let $=Rq(dg(D));if(typeof $!=="string")throw TypeError(`${F} must be a string or a file URL: ${$}.`);return $},dg=(D)=>Eq(D)?D.toString():D,Eq=(D)=>typeof D!=="string"&&D&&Object.getPrototypeOf(D)===String.prototype,Rq=(D)=>D instanceof URL?mg(D):D;var A$=(D,F=[],$={})=>{let J=J6(D,"First argument"),[Q,Z]=mD(F)?[[],F]:[F,$];if(!Array.isArray(Q))throw TypeError(`Second argument must be either an array of arguments or an options object: ${Q}`);if(Q.some((q)=>typeof q==="object"&&q!==null))throw TypeError(`Second argument must be an array of strings: ${Q}`);let X=Q.map(String),Y=X.find((q)=>q.includes("\x00"));if(Y!==void 0)throw TypeError(`Arguments cannot contain null bytes ("\\0"): ${Y}`);if(!mD(Z))throw TypeError(`Last argument must be an options object: ${Z}`);return[J,X,Z]};import{ChildProcess as ag}from"node:child_process";import{StringDecoder as pg}from"node:string_decoder";var{toString:PC}=Object.prototype,jC=(D)=>PC.call(D)==="[object ArrayBuffer]",tD=(D)=>PC.call(D)==="[object Uint8Array]",o8=(D)=>new Uint8Array(D.buffer,D.byteOffset,D.byteLength),lg=new TextEncoder,SC=(D)=>lg.encode(D),cg=new TextDecoder,I$=(D)=>cg.decode(D),xC=(D,F)=>{return ng(D,F).join("")},ng=(D,F)=>{if(F==="utf8"&&D.every((Z)=>typeof Z==="string"))return D;let $=new pg(F),J=D.map((Z)=>typeof Z==="string"?SC(Z):Z).map((Z)=>$.write(Z)),Q=$.end();return Q===""?J:[...J,Q]},L9=(D)=>{if(D.length===1&&tD(D[0]))return D[0];return Aq(ig(D))},ig=(D)=>D.map((F)=>typeof F==="string"?SC(F):F),Aq=(D)=>{let F=new Uint8Array(og(D)),$=0;for(let J of D)F.set(J,$),$+=J.length;return F},og=(D)=>{let F=0;for(let $ of D)F+=$.length;return F};var bC=(D)=>Array.isArray(D)&&Array.isArray(D.raw),vC=(D,F)=>{let $=[];for(let[Z,X]of D.entries())$=rg({templates:D,expressions:F,tokens:$,index:Z,template:X});if($.length===0)throw TypeError("Template script must not be empty");let[J,...Q]=$;return[J,Q,{}]},rg=({templates:D,expressions:F,tokens:$,index:J,template:Q})=>{if(Q===void 0)throw TypeError(`Invalid backslash sequence: ${D.raw[J]}`);let{nextTokens:Z,leadingWhitespaces:X,trailingWhitespaces:Y}=sg(Q,D.raw[J]),q=yC($,Z,X);if(J===F.length)return q;let G=F[J],B=Array.isArray(G)?G.map((W)=>fC(W)):[fC(G)];return yC(q,B,Y)},sg=(D,F)=>{if(F.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let $=[],J=0,Q=kC.has(F[0]);for(let X=0,Y=0;X<D.length;X+=1,Y+=1){let q=F[Y];if(kC.has(q)){if(J!==X)$.push(D.slice(J,X));J=X+1}else if(q==="\\"){let G=F[Y+1];if(G===`
245
+ */var _D=r("fs"),CY=r("os"),z0=r("path"),Uf=r("crypto"),d8={fs:_D.constants,os:CY.constants},Cf=/XXXXXX/,_f=(d8.O_CREAT||d8.fs.O_CREAT)|(d8.O_EXCL||d8.fs.O_EXCL)|(d8.O_RDWR||d8.fs.O_RDWR),j$D=CY.platform()==="win32",S$D=d8.EBADF||d8.os.errno.EBADF,x$D=d8.ENOENT||d8.os.errno.ENOENT,K9=[],Mf=_D.rmdirSync.bind(_D),Of=!1;function k$D(D,F){return _D.rm(D,{recursive:!0},F)}function Ef(D){return _D.rmSync(D,{recursive:!0})}function VH(D,F){let $=U9(D,F),J=$[0],Q=$[1];p$D(J,function(Z,X){if(Z)return Q(Z);let Y=X.tries;(function q(){try{let G=Af(X);_D.stat(G,function(B){if(!B){if(Y-- >0)return q();return Q(Error("Could not get a unique tmp filename, max tries reached "+G))}Q(null,G)})}catch(G){Q(G)}})()})}function HH(D){let F=U9(D),$=F[0],J=l$D($),Q=J.tries;do{let Z=Af(J);try{_D.statSync(Z)}catch(X){return Z}}while(Q-- >0);throw Error("Could not get a unique tmp filename, max tries reached")}function y$D(D,F){let $=U9(D,F),J=$[0],Q=$[1];VH(J,function(X,Y){if(X)return Q(X);_D.open(Y,_f,J.mode||384,function(G,B){if(G)return Q(G);if(J.discardDescriptor)return _D.close(B,function(K){return Q(K,Y,void 0,KH(Y,-1,J,!1))});else{let W=J.discardDescriptor||J.detachDescriptor;Q(null,Y,B,KH(Y,W?-1:B,J,!1))}})})}function f$D(D){let F=U9(D),$=F[0],J=$.discardDescriptor||$.detachDescriptor,Q=HH($),Z=_D.openSync(Q,_f,$.mode||384);if($.discardDescriptor)_D.closeSync(Z),Z=void 0;return{name:Q,fd:Z,removeCallback:KH(Q,J?-1:Z,$,!0)}}function b$D(D,F){let $=U9(D,F),J=$[0],Q=$[1];VH(J,function(X,Y){if(X)return Q(X);_D.mkdir(Y,J.mode||448,function(G){if(G)return Q(G);Q(null,Y,Rf(Y,J,!1))})})}function v$D(D){let F=U9(D),$=F[0],J=HH($);return _D.mkdirSync(J,$.mode||448),{name:J,removeCallback:Rf(J,$,!0)}}function h$D(D,F){let $=function(J){if(J&&!UH(J))return F(J);F()};if(0<=D[0])_D.close(D[0],function(){_D.unlink(D[1],$)});else _D.unlink(D[1],$)}function u$D(D){let F=null;try{if(0<=D[0])_D.closeSync(D[0])}catch($){if(!c$D($)&&!UH($))throw $}finally{try{_D.unlinkSync(D[1])}catch($){if(!UH($))F=$}}if(F!==null)throw F}function KH(D,F,$,J){let Q=zY(u$D,[F,D],J),Z=zY(h$D,[F,D],J,Q);if(!$.keep)K9.unshift(Q);return J?Q:Z}function Rf(D,F,$){let J=F.unsafeCleanup?k$D:_D.rmdir.bind(_D),Q=F.unsafeCleanup?Ef:Mf,Z=zY(Q,D,$),X=zY(J,D,$,Z);if(!F.keep)K9.unshift(Z);return $?Z:X}function zY(D,F,$,J){let Q=!1;return function Z(X){if(!Q){let Y=J||Z,q=K9.indexOf(Y);if(q>=0)K9.splice(q,1);if(Q=!0,$||D===Mf||D===Ef)return D(F);else return D(F,X||function(){})}}}function g$D(){if(!Of)return;while(K9.length)try{K9[0]()}catch(D){}}function Vf(D){let F=[],$=null;try{$=Uf.randomBytes(D)}catch(J){$=Uf.pseudoRandomBytes(D)}for(let J=0;J<D;J++)F.push("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"[$[J]%62]);return F.join("")}function U2(D){return typeof D>"u"}function U9(D,F){if(typeof D==="function")return[{},D];if(U2(D))return[{},F];let $={};for(let J of Object.getOwnPropertyNames(D))$[J]=D[J];return[$,F]}function m$D(D,F,$){let J=z0.isAbsolute(D)?D:z0.join(F,D);_D.stat(J,function(Q){if(Q)_D.realpath(z0.dirname(J),function(Z,X){if(Z)return $(Z);$(null,z0.join(X,z0.basename(J)))});else _D.realpath(J,$)})}function d$D(D,F){let $=z0.isAbsolute(D)?D:z0.join(F,D);try{return _D.statSync($),_D.realpathSync($)}catch(J){let Q=_D.realpathSync(z0.dirname($));return z0.join(Q,z0.basename($))}}function Af(D){let F=D.tmpdir;if(!U2(D.name))return z0.join(F,D.dir,D.name);if(!U2(D.template))return z0.join(F,D.dir,D.template).replace(Cf,Vf(6));let $=[D.prefix?D.prefix:"tmp","-",process.pid,"-",Vf(12),D.postfix?"-"+D.postfix:""].join("");return z0.join(F,D.dir,$)}function If(D){if(!U2(D.name)){let F=D.name;if(z0.isAbsolute(F))throw Error(`name option must not contain an absolute path, found "${F}".`);let $=z0.basename(F);if($===".."||$==="."||$!==F)throw Error(`name option must not contain a path, found "${F}".`)}if(!U2(D.template)&&!D.template.match(Cf))throw Error(`Invalid template, found "${D.template}".`);if(!U2(D.tries)&&isNaN(D.tries)||D.tries<0)throw Error(`Invalid tries, found "${D.tries}".`);D.tries=U2(D.name)?D.tries||3:1,D.keep=!!D.keep,D.detachDescriptor=!!D.detachDescriptor,D.discardDescriptor=!!D.discardDescriptor,D.unsafeCleanup=!!D.unsafeCleanup,D.prefix=U2(D.prefix)?"":D.prefix,D.postfix=U2(D.postfix)?"":D.postfix}function Hf(D,F,$,J){if(U2(F))return J(null);m$D(F,$,function(Q,Z){if(Q)return J(Q);let X=z0.relative($,Z);if(!Z.startsWith($))return J(Error(`${D} option must be relative to "${$}", found "${X}".`));J(null,X)})}function zf(D,F,$){if(U2(F))return;let J=d$D(F,$),Q=z0.relative($,J);if(!J.startsWith($))throw Error(`${D} option must be relative to "${$}", found "${Q}".`);return Q}function p$D(D,F){i$D(D,function($,J){if($)return F($);D.tmpdir=J;try{If(D,J)}catch(Q){return F(Q)}Hf("dir",D.dir,J,function(Q,Z){if(Q)return F(Q);D.dir=U2(Z)?"":Z,Hf("template",D.template,J,function(X,Y){if(X)return F(X);D.template=Y,F(null,D)})})})}function l$D(D){let F=D.tmpdir=Nf(D);If(D,F);let $=zf("dir",D.dir,F);return D.dir=U2($)?"":$,D.template=zf("template",D.template,F),D}function c$D(D){return wf(D,-S$D,"EBADF")}function UH(D){return wf(D,-x$D,"ENOENT")}function wf(D,F,$){return j$D?D.code===$:D.code===$&&D.errno===F}function n$D(){Of=!0}function i$D(D,F){return _D.realpath(D&&D.tmpdir||CY.tmpdir(),F)}function Nf(D){return _D.realpathSync(D&&D.tmpdir||CY.tmpdir())}process.addListener("exit",g$D);Object.defineProperty(o$D,"tmpdir",{enumerable:!0,configurable:!1,get:function(){return Nf()}});o$D.dir=b$D;o$D.dirSync=v$D;o$D.file=y$D;o$D.fileSync=f$D;o$D.tmpName=VH;o$D.tmpNameSync=HH;o$D.setGracefulCleanup=n$D});var n5=w((VP0,Lf)=>{var $JD=Number.MAX_SAFE_INTEGER||9007199254740991,JJD=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Lf.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:$JD,RELEASE_TYPES:JJD,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var i5=w((HP0,Pf)=>{var QJD=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...D)=>console.error("SEMVER",...D):()=>{};Pf.exports=QJD});var V9=w((p8,jf)=>{var{MAX_SAFE_COMPONENT_LENGTH:zH,MAX_SAFE_BUILD_LENGTH:ZJD,MAX_LENGTH:XJD}=n5(),YJD=i5();p8=jf.exports={};var qJD=p8.re=[],GJD=p8.safeRe=[],p=p8.src=[],BJD=p8.safeSrc=[],l=p8.t={},WJD=0,CH="[a-zA-Z0-9-]",KJD=[["\\s",1],["\\d",XJD],[CH,ZJD]],UJD=(D)=>{for(let[F,$]of KJD)D=D.split(`${F}*`).join(`${F}{0,${$}}`).split(`${F}+`).join(`${F}{1,${$}}`);return D},e=(D,F,$)=>{let J=UJD(F),Q=WJD++;YJD(D,Q,F),l[D]=Q,p[Q]=F,BJD[Q]=J,qJD[Q]=new RegExp(F,$?"g":void 0),GJD[Q]=new RegExp(J,$?"g":void 0)};e("NUMERICIDENTIFIER","0|[1-9]\\d*");e("NUMERICIDENTIFIERLOOSE","\\d+");e("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${CH}*`);e("MAINVERSION",`(${p[l.NUMERICIDENTIFIER]})\\.(${p[l.NUMERICIDENTIFIER]})\\.(${p[l.NUMERICIDENTIFIER]})`);e("MAINVERSIONLOOSE",`(${p[l.NUMERICIDENTIFIERLOOSE]})\\.(${p[l.NUMERICIDENTIFIERLOOSE]})\\.(${p[l.NUMERICIDENTIFIERLOOSE]})`);e("PRERELEASEIDENTIFIER",`(?:${p[l.NONNUMERICIDENTIFIER]}|${p[l.NUMERICIDENTIFIER]})`);e("PRERELEASEIDENTIFIERLOOSE",`(?:${p[l.NONNUMERICIDENTIFIER]}|${p[l.NUMERICIDENTIFIERLOOSE]})`);e("PRERELEASE",`(?:-(${p[l.PRERELEASEIDENTIFIER]}(?:\\.${p[l.PRERELEASEIDENTIFIER]})*))`);e("PRERELEASELOOSE",`(?:-?(${p[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${p[l.PRERELEASEIDENTIFIERLOOSE]})*))`);e("BUILDIDENTIFIER",`${CH}+`);e("BUILD",`(?:\\+(${p[l.BUILDIDENTIFIER]}(?:\\.${p[l.BUILDIDENTIFIER]})*))`);e("FULLPLAIN",`v?${p[l.MAINVERSION]}${p[l.PRERELEASE]}?${p[l.BUILD]}?`);e("FULL",`^${p[l.FULLPLAIN]}$`);e("LOOSEPLAIN",`[v=\\s]*${p[l.MAINVERSIONLOOSE]}${p[l.PRERELEASELOOSE]}?${p[l.BUILD]}?`);e("LOOSE",`^${p[l.LOOSEPLAIN]}$`);e("GTLT","((?:<|>)?=?)");e("XRANGEIDENTIFIERLOOSE",`${p[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);e("XRANGEIDENTIFIER",`${p[l.NUMERICIDENTIFIER]}|x|X|\\*`);e("XRANGEPLAIN",`[v=\\s]*(${p[l.XRANGEIDENTIFIER]})(?:\\.(${p[l.XRANGEIDENTIFIER]})(?:\\.(${p[l.XRANGEIDENTIFIER]})(?:${p[l.PRERELEASE]})?${p[l.BUILD]}?)?)?`);e("XRANGEPLAINLOOSE",`[v=\\s]*(${p[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${p[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${p[l.XRANGEIDENTIFIERLOOSE]})(?:${p[l.PRERELEASELOOSE]})?${p[l.BUILD]}?)?)?`);e("XRANGE",`^${p[l.GTLT]}\\s*${p[l.XRANGEPLAIN]}$`);e("XRANGELOOSE",`^${p[l.GTLT]}\\s*${p[l.XRANGEPLAINLOOSE]}$`);e("COERCEPLAIN",`(^|[^\\d])(\\d{1,${zH}})(?:\\.(\\d{1,${zH}}))?(?:\\.(\\d{1,${zH}}))?`);e("COERCE",`${p[l.COERCEPLAIN]}(?:$|[^\\d])`);e("COERCEFULL",p[l.COERCEPLAIN]+`(?:${p[l.PRERELEASE]})?(?:${p[l.BUILD]})?(?:$|[^\\d])`);e("COERCERTL",p[l.COERCE],!0);e("COERCERTLFULL",p[l.COERCEFULL],!0);e("LONETILDE","(?:~>?)");e("TILDETRIM",`(\\s*)${p[l.LONETILDE]}\\s+`,!0);p8.tildeTrimReplace="$1~";e("TILDE",`^${p[l.LONETILDE]}${p[l.XRANGEPLAIN]}$`);e("TILDELOOSE",`^${p[l.LONETILDE]}${p[l.XRANGEPLAINLOOSE]}$`);e("LONECARET","(?:\\^)");e("CARETTRIM",`(\\s*)${p[l.LONECARET]}\\s+`,!0);p8.caretTrimReplace="$1^";e("CARET",`^${p[l.LONECARET]}${p[l.XRANGEPLAIN]}$`);e("CARETLOOSE",`^${p[l.LONECARET]}${p[l.XRANGEPLAINLOOSE]}$`);e("COMPARATORLOOSE",`^${p[l.GTLT]}\\s*(${p[l.LOOSEPLAIN]})$|^$`);e("COMPARATOR",`^${p[l.GTLT]}\\s*(${p[l.FULLPLAIN]})$|^$`);e("COMPARATORTRIM",`(\\s*)${p[l.GTLT]}\\s*(${p[l.LOOSEPLAIN]}|${p[l.XRANGEPLAIN]})`,!0);p8.comparatorTrimReplace="$1$2$3";e("HYPHENRANGE",`^\\s*(${p[l.XRANGEPLAIN]})\\s+-\\s+(${p[l.XRANGEPLAIN]})\\s*$`);e("HYPHENRANGELOOSE",`^\\s*(${p[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${p[l.XRANGEPLAINLOOSE]})\\s*$`);e("STAR","(<|>)?=?\\s*\\*");e("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");e("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var _Y=w((zP0,Sf)=>{var VJD=Object.freeze({loose:!0}),HJD=Object.freeze({}),zJD=(D)=>{if(!D)return HJD;if(typeof D!=="object")return VJD;return D};Sf.exports=zJD});var _H=w((CP0,yf)=>{var xf=/^[0-9]+$/,kf=(D,F)=>{if(typeof D==="number"&&typeof F==="number")return D===F?0:D<F?-1:1;let $=xf.test(D),J=xf.test(F);if($&&J)D=+D,F=+F;return D===F?0:$&&!J?-1:J&&!$?1:D<F?-1:1},CJD=(D,F)=>kf(F,D);yf.exports={compareIdentifiers:kf,rcompareIdentifiers:CJD}});var L0=w((_P0,bf)=>{var MY=i5(),{MAX_LENGTH:ff,MAX_SAFE_INTEGER:OY}=n5(),{safeRe:EY,t:RY}=V9(),_JD=_Y(),{compareIdentifiers:MH}=_H();class Q8{constructor(D,F){if(F=_JD(F),D instanceof Q8)if(D.loose===!!F.loose&&D.includePrerelease===!!F.includePrerelease)return D;else D=D.version;else if(typeof D!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof D}".`);if(D.length>ff)throw TypeError(`version is longer than ${ff} characters`);MY("SemVer",D,F),this.options=F,this.loose=!!F.loose,this.includePrerelease=!!F.includePrerelease;let $=D.trim().match(F.loose?EY[RY.LOOSE]:EY[RY.FULL]);if(!$)throw TypeError(`Invalid Version: ${D}`);if(this.raw=D,this.major=+$[1],this.minor=+$[2],this.patch=+$[3],this.major>OY||this.major<0)throw TypeError("Invalid major version");if(this.minor>OY||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>OY||this.patch<0)throw TypeError("Invalid patch version");if(!$[4])this.prerelease=[];else this.prerelease=$[4].split(".").map((J)=>{if(/^[0-9]+$/.test(J)){let Q=+J;if(Q>=0&&Q<OY)return Q}return J});this.build=$[5]?$[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(D){if(MY("SemVer.compare",this.version,this.options,D),!(D instanceof Q8)){if(typeof D==="string"&&D===this.version)return 0;D=new Q8(D,this.options)}if(D.version===this.version)return 0;return this.compareMain(D)||this.comparePre(D)}compareMain(D){if(!(D instanceof Q8))D=new Q8(D,this.options);if(this.major<D.major)return-1;if(this.major>D.major)return 1;if(this.minor<D.minor)return-1;if(this.minor>D.minor)return 1;if(this.patch<D.patch)return-1;if(this.patch>D.patch)return 1;return 0}comparePre(D){if(!(D instanceof Q8))D=new Q8(D,this.options);if(this.prerelease.length&&!D.prerelease.length)return-1;else if(!this.prerelease.length&&D.prerelease.length)return 1;else if(!this.prerelease.length&&!D.prerelease.length)return 0;let F=0;do{let $=this.prerelease[F],J=D.prerelease[F];if(MY("prerelease compare",F,$,J),$===void 0&&J===void 0)return 0;else if(J===void 0)return 1;else if($===void 0)return-1;else if($===J)continue;else return MH($,J)}while(++F)}compareBuild(D){if(!(D instanceof Q8))D=new Q8(D,this.options);let F=0;do{let $=this.build[F],J=D.build[F];if(MY("build compare",F,$,J),$===void 0&&J===void 0)return 0;else if(J===void 0)return 1;else if($===void 0)return-1;else if($===J)continue;else return MH($,J)}while(++F)}inc(D,F,$){if(D.startsWith("pre")){if(!F&&$===!1)throw Error("invalid increment argument: identifier is empty");if(F){let J=`-${F}`.match(this.options.loose?EY[RY.PRERELEASELOOSE]:EY[RY.PRERELEASE]);if(!J||J[1]!==F)throw Error(`invalid identifier: ${F}`)}}switch(D){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",F,$);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",F,$);break;case"prepatch":this.prerelease.length=0,this.inc("patch",F,$),this.inc("pre",F,$);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",F,$);this.inc("pre",F,$);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let J=Number($)?1:0;if(this.prerelease.length===0)this.prerelease=[J];else{let Q=this.prerelease.length;while(--Q>=0)if(typeof this.prerelease[Q]==="number")this.prerelease[Q]++,Q=-2;if(Q===-1){if(F===this.prerelease.join(".")&&$===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(J)}}if(F){let Q=[F,J];if($===!1)Q=[F];if(MH(this.prerelease[0],F)===0){if(isNaN(this.prerelease[1]))this.prerelease=Q}else this.prerelease=Q}break}default:throw Error(`invalid increment argument: ${D}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}bf.exports=Q8});var m3=w((MP0,hf)=>{var vf=L0(),MJD=(D,F,$=!1)=>{if(D instanceof vf)return D;try{return new vf(D,F)}catch(J){if(!$)return null;throw J}};hf.exports=MJD});var gf=w((OP0,uf)=>{var OJD=m3(),EJD=(D,F)=>{let $=OJD(D,F);return $?$.version:null};uf.exports=EJD});var df=w((EP0,mf)=>{var RJD=m3(),AJD=(D,F)=>{let $=RJD(D.trim().replace(/^[=v]+/,""),F);return $?$.version:null};mf.exports=AJD});var cf=w((RP0,lf)=>{var pf=L0(),IJD=(D,F,$,J,Q)=>{if(typeof $==="string")Q=J,J=$,$=void 0;try{return new pf(D instanceof pf?D.version:D,$).inc(F,J,Q).version}catch(Z){return null}};lf.exports=IJD});var af=w((AP0,of)=>{var nf=m3(),wJD=(D,F)=>{let $=nf(D,null,!0),J=nf(F,null,!0),Q=$.compare(J);if(Q===0)return null;let Z=Q>0,X=Z?$:J,Y=Z?J:$,q=!!X.prerelease.length;if(!!Y.prerelease.length&&!q){if(!Y.patch&&!Y.minor)return"major";if(Y.compareMain(X)===0){if(Y.minor&&!Y.patch)return"minor";return"patch"}}let B=q?"pre":"";if($.major!==J.major)return B+"major";if($.minor!==J.minor)return B+"minor";if($.patch!==J.patch)return B+"patch";return"prerelease"};of.exports=wJD});var sf=w((IP0,rf)=>{var NJD=L0(),TJD=(D,F)=>new NJD(D,F).major;rf.exports=TJD});var ef=w((wP0,tf)=>{var LJD=L0(),PJD=(D,F)=>new LJD(D,F).minor;tf.exports=PJD});var Fb=w((NP0,Db)=>{var jJD=L0(),SJD=(D,F)=>new jJD(D,F).patch;Db.exports=SJD});var Jb=w((TP0,$b)=>{var xJD=m3(),kJD=(D,F)=>{let $=xJD(D,F);return $&&$.prerelease.length?$.prerelease:null};$b.exports=kJD});var x2=w((LP0,Zb)=>{var Qb=L0(),yJD=(D,F,$)=>new Qb(D,$).compare(new Qb(F,$));Zb.exports=yJD});var Yb=w((PP0,Xb)=>{var fJD=x2(),bJD=(D,F,$)=>fJD(F,D,$);Xb.exports=bJD});var Gb=w((jP0,qb)=>{var vJD=x2(),hJD=(D,F)=>vJD(D,F,!0);qb.exports=hJD});var AY=w((SP0,Wb)=>{var Bb=L0(),uJD=(D,F,$)=>{let J=new Bb(D,$),Q=new Bb(F,$);return J.compare(Q)||J.compareBuild(Q)};Wb.exports=uJD});var Ub=w((xP0,Kb)=>{var gJD=AY(),mJD=(D,F)=>D.sort(($,J)=>gJD($,J,F));Kb.exports=mJD});var Hb=w((kP0,Vb)=>{var dJD=AY(),pJD=(D,F)=>D.sort(($,J)=>dJD(J,$,F));Vb.exports=pJD});var o5=w((yP0,zb)=>{var lJD=x2(),cJD=(D,F,$)=>lJD(D,F,$)>0;zb.exports=cJD});var IY=w((fP0,Cb)=>{var nJD=x2(),iJD=(D,F,$)=>nJD(D,F,$)<0;Cb.exports=iJD});var OH=w((bP0,_b)=>{var oJD=x2(),aJD=(D,F,$)=>oJD(D,F,$)===0;_b.exports=aJD});var EH=w((vP0,Mb)=>{var rJD=x2(),sJD=(D,F,$)=>rJD(D,F,$)!==0;Mb.exports=sJD});var wY=w((hP0,Ob)=>{var tJD=x2(),eJD=(D,F,$)=>tJD(D,F,$)>=0;Ob.exports=eJD});var NY=w((uP0,Eb)=>{var DQD=x2(),FQD=(D,F,$)=>DQD(D,F,$)<=0;Eb.exports=FQD});var RH=w((gP0,Rb)=>{var $QD=OH(),JQD=EH(),QQD=o5(),ZQD=wY(),XQD=IY(),YQD=NY(),qQD=(D,F,$,J)=>{switch(F){case"===":if(typeof D==="object")D=D.version;if(typeof $==="object")$=$.version;return D===$;case"!==":if(typeof D==="object")D=D.version;if(typeof $==="object")$=$.version;return D!==$;case"":case"=":case"==":return $QD(D,$,J);case"!=":return JQD(D,$,J);case">":return QQD(D,$,J);case">=":return ZQD(D,$,J);case"<":return XQD(D,$,J);case"<=":return YQD(D,$,J);default:throw TypeError(`Invalid operator: ${F}`)}};Rb.exports=qQD});var Ib=w((mP0,Ab)=>{var GQD=L0(),BQD=m3(),{safeRe:TY,t:LY}=V9(),WQD=(D,F)=>{if(D instanceof GQD)return D;if(typeof D==="number")D=String(D);if(typeof D!=="string")return null;F=F||{};let $=null;if(!F.rtl)$=D.match(F.includePrerelease?TY[LY.COERCEFULL]:TY[LY.COERCE]);else{let q=F.includePrerelease?TY[LY.COERCERTLFULL]:TY[LY.COERCERTL],G;while((G=q.exec(D))&&(!$||$.index+$[0].length!==D.length)){if(!$||G.index+G[0].length!==$.index+$[0].length)$=G;q.lastIndex=G.index+G[1].length+G[2].length}q.lastIndex=-1}if($===null)return null;let J=$[2],Q=$[3]||"0",Z=$[4]||"0",X=F.includePrerelease&&$[5]?`-${$[5]}`:"",Y=F.includePrerelease&&$[6]?`+${$[6]}`:"";return BQD(`${J}.${Q}.${Z}${X}${Y}`,F)};Ab.exports=WQD});var Tb=w((dP0,Nb)=>{class wb{constructor(){this.max=1000,this.map=new Map}get(D){let F=this.map.get(D);if(F===void 0)return;else return this.map.delete(D),this.map.set(D,F),F}delete(D){return this.map.delete(D)}set(D,F){if(!this.delete(D)&&F!==void 0){if(this.map.size>=this.max){let J=this.map.keys().next().value;this.delete(J)}this.map.set(D,F)}return this}}Nb.exports=wb});var k2=w((pP0,Sb)=>{var KQD=/\s+/g;class a5{constructor(D,F){if(F=VQD(F),D instanceof a5)if(D.loose===!!F.loose&&D.includePrerelease===!!F.includePrerelease)return D;else return new a5(D.raw,F);if(D instanceof AH)return this.raw=D.value,this.set=[[D]],this.formatted=void 0,this;if(this.options=F,this.loose=!!F.loose,this.includePrerelease=!!F.includePrerelease,this.raw=D.trim().replace(KQD," "),this.set=this.raw.split("||").map(($)=>this.parseRange($.trim())).filter(($)=>$.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let $=this.set[0];if(this.set=this.set.filter((J)=>!Pb(J[0])),this.set.length===0)this.set=[$];else if(this.set.length>1){for(let J of this.set)if(J.length===1&&EQD(J[0])){this.set=[J];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let D=0;D<this.set.length;D++){if(D>0)this.formatted+="||";let F=this.set[D];for(let $=0;$<F.length;$++){if($>0)this.formatted+=" ";this.formatted+=F[$].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(D){let $=((this.options.includePrerelease&&MQD)|(this.options.loose&&OQD))+":"+D,J=Lb.get($);if(J)return J;let Q=this.options.loose,Z=Q?p0[P0.HYPHENRANGELOOSE]:p0[P0.HYPHENRANGE];D=D.replace(Z,SQD(this.options.includePrerelease)),ND("hyphen replace",D),D=D.replace(p0[P0.COMPARATORTRIM],zQD),ND("comparator trim",D),D=D.replace(p0[P0.TILDETRIM],CQD),ND("tilde trim",D),D=D.replace(p0[P0.CARETTRIM],_QD),ND("caret trim",D);let X=D.split(" ").map((B)=>RQD(B,this.options)).join(" ").split(/\s+/).map((B)=>jQD(B,this.options));if(Q)X=X.filter((B)=>{return ND("loose invalid filter",B,this.options),!!B.match(p0[P0.COMPARATORLOOSE])});ND("range list",X);let Y=new Map,q=X.map((B)=>new AH(B,this.options));for(let B of q){if(Pb(B))return[B];Y.set(B.value,B)}if(Y.size>1&&Y.has(""))Y.delete("");let G=[...Y.values()];return Lb.set($,G),G}intersects(D,F){if(!(D instanceof a5))throw TypeError("a Range is required");return this.set.some(($)=>{return jb($,F)&&D.set.some((J)=>{return jb(J,F)&&$.every((Q)=>{return J.every((Z)=>{return Q.intersects(Z,F)})})})})}test(D){if(!D)return!1;if(typeof D==="string")try{D=new HQD(D,this.options)}catch(F){return!1}for(let F=0;F<this.set.length;F++)if(xQD(this.set[F],D,this.options))return!0;return!1}}Sb.exports=a5;var UQD=Tb(),Lb=new UQD,VQD=_Y(),AH=r5(),ND=i5(),HQD=L0(),{safeRe:p0,t:P0,comparatorTrimReplace:zQD,tildeTrimReplace:CQD,caretTrimReplace:_QD}=V9(),{FLAG_INCLUDE_PRERELEASE:MQD,FLAG_LOOSE:OQD}=n5(),Pb=(D)=>D.value==="<0.0.0-0",EQD=(D)=>D.value==="",jb=(D,F)=>{let $=!0,J=D.slice(),Q=J.pop();while($&&J.length)$=J.every((Z)=>{return Q.intersects(Z,F)}),Q=J.pop();return $},RQD=(D,F)=>{return D=D.replace(p0[P0.BUILD],""),ND("comp",D,F),D=wQD(D,F),ND("caret",D),D=AQD(D,F),ND("tildes",D),D=TQD(D,F),ND("xrange",D),D=PQD(D,F),ND("stars",D),D},l0=(D)=>!D||D.toLowerCase()==="x"||D==="*",AQD=(D,F)=>{return D.trim().split(/\s+/).map(($)=>IQD($,F)).join(" ")},IQD=(D,F)=>{let $=F.loose?p0[P0.TILDELOOSE]:p0[P0.TILDE];return D.replace($,(J,Q,Z,X,Y)=>{ND("tilde",D,J,Q,Z,X,Y);let q;if(l0(Q))q="";else if(l0(Z))q=`>=${Q}.0.0 <${+Q+1}.0.0-0`;else if(l0(X))q=`>=${Q}.${Z}.0 <${Q}.${+Z+1}.0-0`;else if(Y)ND("replaceTilde pr",Y),q=`>=${Q}.${Z}.${X}-${Y} <${Q}.${+Z+1}.0-0`;else q=`>=${Q}.${Z}.${X} <${Q}.${+Z+1}.0-0`;return ND("tilde return",q),q})},wQD=(D,F)=>{return D.trim().split(/\s+/).map(($)=>NQD($,F)).join(" ")},NQD=(D,F)=>{ND("caret",D,F);let $=F.loose?p0[P0.CARETLOOSE]:p0[P0.CARET],J=F.includePrerelease?"-0":"";return D.replace($,(Q,Z,X,Y,q)=>{ND("caret",D,Q,Z,X,Y,q);let G;if(l0(Z))G="";else if(l0(X))G=`>=${Z}.0.0${J} <${+Z+1}.0.0-0`;else if(l0(Y))if(Z==="0")G=`>=${Z}.${X}.0${J} <${Z}.${+X+1}.0-0`;else G=`>=${Z}.${X}.0${J} <${+Z+1}.0.0-0`;else if(q)if(ND("replaceCaret pr",q),Z==="0")if(X==="0")G=`>=${Z}.${X}.${Y}-${q} <${Z}.${X}.${+Y+1}-0`;else G=`>=${Z}.${X}.${Y}-${q} <${Z}.${+X+1}.0-0`;else G=`>=${Z}.${X}.${Y}-${q} <${+Z+1}.0.0-0`;else if(ND("no pr"),Z==="0")if(X==="0")G=`>=${Z}.${X}.${Y}${J} <${Z}.${X}.${+Y+1}-0`;else G=`>=${Z}.${X}.${Y}${J} <${Z}.${+X+1}.0-0`;else G=`>=${Z}.${X}.${Y} <${+Z+1}.0.0-0`;return ND("caret return",G),G})},TQD=(D,F)=>{return ND("replaceXRanges",D,F),D.split(/\s+/).map(($)=>LQD($,F)).join(" ")},LQD=(D,F)=>{D=D.trim();let $=F.loose?p0[P0.XRANGELOOSE]:p0[P0.XRANGE];return D.replace($,(J,Q,Z,X,Y,q)=>{ND("xRange",D,J,Q,Z,X,Y,q);let G=l0(Z),B=G||l0(X),W=B||l0(Y),K=W;if(Q==="="&&K)Q="";if(q=F.includePrerelease?"-0":"",G)if(Q===">"||Q==="<")J="<0.0.0-0";else J="*";else if(Q&&K){if(B)X=0;if(Y=0,Q===">")if(Q=">=",B)Z=+Z+1,X=0,Y=0;else X=+X+1,Y=0;else if(Q==="<=")if(Q="<",B)Z=+Z+1;else X=+X+1;if(Q==="<")q="-0";J=`${Q+Z}.${X}.${Y}${q}`}else if(B)J=`>=${Z}.0.0${q} <${+Z+1}.0.0-0`;else if(W)J=`>=${Z}.${X}.0${q} <${Z}.${+X+1}.0-0`;return ND("xRange return",J),J})},PQD=(D,F)=>{return ND("replaceStars",D,F),D.trim().replace(p0[P0.STAR],"")},jQD=(D,F)=>{return ND("replaceGTE0",D,F),D.trim().replace(p0[F.includePrerelease?P0.GTE0PRE:P0.GTE0],"")},SQD=(D)=>(F,$,J,Q,Z,X,Y,q,G,B,W,K)=>{if(l0(J))$="";else if(l0(Q))$=`>=${J}.0.0${D?"-0":""}`;else if(l0(Z))$=`>=${J}.${Q}.0${D?"-0":""}`;else if(X)$=`>=${$}`;else $=`>=${$}${D?"-0":""}`;if(l0(G))q="";else if(l0(B))q=`<${+G+1}.0.0-0`;else if(l0(W))q=`<${G}.${+B+1}.0-0`;else if(K)q=`<=${G}.${B}.${W}-${K}`;else if(D)q=`<${G}.${B}.${+W+1}-0`;else q=`<=${q}`;return`${$} ${q}`.trim()},xQD=(D,F,$)=>{for(let J=0;J<D.length;J++)if(!D[J].test(F))return!1;if(F.prerelease.length&&!$.includePrerelease){for(let J=0;J<D.length;J++){if(ND(D[J].semver),D[J].semver===AH.ANY)continue;if(D[J].semver.prerelease.length>0){let Q=D[J].semver;if(Q.major===F.major&&Q.minor===F.minor&&Q.patch===F.patch)return!0}}return!1}return!0}});var r5=w((lP0,vb)=>{var s5=Symbol("SemVer ANY");class PY{static get ANY(){return s5}constructor(D,F){if(F=xb(F),D instanceof PY)if(D.loose===!!F.loose)return D;else D=D.value;if(D=D.trim().split(/\s+/).join(" "),wH("comparator",D,F),this.options=F,this.loose=!!F.loose,this.parse(D),this.semver===s5)this.value="";else this.value=this.operator+this.semver.version;wH("comp",this)}parse(D){let F=this.options.loose?kb[yb.COMPARATORLOOSE]:kb[yb.COMPARATOR],$=D.match(F);if(!$)throw TypeError(`Invalid comparator: ${D}`);if(this.operator=$[1]!==void 0?$[1]:"",this.operator==="=")this.operator="";if(!$[2])this.semver=s5;else this.semver=new fb($[2],this.options.loose)}toString(){return this.value}test(D){if(wH("Comparator.test",D,this.options.loose),this.semver===s5||D===s5)return!0;if(typeof D==="string")try{D=new fb(D,this.options)}catch(F){return!1}return IH(D,this.operator,this.semver,this.options)}intersects(D,F){if(!(D instanceof PY))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new bb(D.value,F).test(this.value)}else if(D.operator===""){if(D.value==="")return!0;return new bb(this.value,F).test(D.semver)}if(F=xb(F),F.includePrerelease&&(this.value==="<0.0.0-0"||D.value==="<0.0.0-0"))return!1;if(!F.includePrerelease&&(this.value.startsWith("<0.0.0")||D.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&D.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&D.operator.startsWith("<"))return!0;if(this.semver.version===D.semver.version&&this.operator.includes("=")&&D.operator.includes("="))return!0;if(IH(this.semver,"<",D.semver,F)&&this.operator.startsWith(">")&&D.operator.startsWith("<"))return!0;if(IH(this.semver,">",D.semver,F)&&this.operator.startsWith("<")&&D.operator.startsWith(">"))return!0;return!1}}vb.exports=PY;var xb=_Y(),{safeRe:kb,t:yb}=V9(),IH=RH(),wH=i5(),fb=L0(),bb=k2()});var t5=w((cP0,hb)=>{var kQD=k2(),yQD=(D,F,$)=>{try{F=new kQD(F,$)}catch(J){return!1}return F.test(D)};hb.exports=yQD});var gb=w((nP0,ub)=>{var fQD=k2(),bQD=(D,F)=>new fQD(D,F).set.map(($)=>$.map((J)=>J.value).join(" ").trim().split(" "));ub.exports=bQD});var db=w((iP0,mb)=>{var vQD=L0(),hQD=k2(),uQD=(D,F,$)=>{let J=null,Q=null,Z=null;try{Z=new hQD(F,$)}catch(X){return null}return D.forEach((X)=>{if(Z.test(X)){if(!J||Q.compare(X)===-1)J=X,Q=new vQD(J,$)}}),J};mb.exports=uQD});var lb=w((oP0,pb)=>{var gQD=L0(),mQD=k2(),dQD=(D,F,$)=>{let J=null,Q=null,Z=null;try{Z=new mQD(F,$)}catch(X){return null}return D.forEach((X)=>{if(Z.test(X)){if(!J||Q.compare(X)===1)J=X,Q=new gQD(J,$)}}),J};pb.exports=dQD});var ib=w((aP0,nb)=>{var NH=L0(),pQD=k2(),cb=o5(),lQD=(D,F)=>{D=new pQD(D,F);let $=new NH("0.0.0");if(D.test($))return $;if($=new NH("0.0.0-0"),D.test($))return $;$=null;for(let J=0;J<D.set.length;++J){let Q=D.set[J],Z=null;if(Q.forEach((X)=>{let Y=new NH(X.semver.version);switch(X.operator){case">":if(Y.prerelease.length===0)Y.patch++;else Y.prerelease.push(0);Y.raw=Y.format();case"":case">=":if(!Z||cb(Y,Z))Z=Y;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${X.operator}`)}}),Z&&(!$||cb($,Z)))$=Z}if($&&D.test($))return $;return null};nb.exports=lQD});var ab=w((rP0,ob)=>{var cQD=k2(),nQD=(D,F)=>{try{return new cQD(D,F).range||"*"}catch($){return null}};ob.exports=nQD});var jY=w((sP0,eb)=>{var iQD=L0(),tb=r5(),{ANY:oQD}=tb,aQD=k2(),rQD=t5(),rb=o5(),sb=IY(),sQD=NY(),tQD=wY(),eQD=(D,F,$,J)=>{D=new iQD(D,J),F=new aQD(F,J);let Q,Z,X,Y,q;switch($){case">":Q=rb,Z=sQD,X=sb,Y=">",q=">=";break;case"<":Q=sb,Z=tQD,X=rb,Y="<",q="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(rQD(D,F,J))return!1;for(let G=0;G<F.set.length;++G){let B=F.set[G],W=null,K=null;if(B.forEach((U)=>{if(U.semver===oQD)U=new tb(">=0.0.0");if(W=W||U,K=K||U,Q(U.semver,W.semver,J))W=U;else if(X(U.semver,K.semver,J))K=U}),W.operator===Y||W.operator===q)return!1;if((!K.operator||K.operator===Y)&&Z(D,K.semver))return!1;else if(K.operator===q&&X(D,K.semver))return!1}return!0};eb.exports=eQD});var Fv=w((tP0,Dv)=>{var DZD=jY(),FZD=(D,F,$)=>DZD(D,F,">",$);Dv.exports=FZD});var Jv=w((eP0,$v)=>{var $ZD=jY(),JZD=(D,F,$)=>$ZD(D,F,"<",$);$v.exports=JZD});var Xv=w((Dj0,Zv)=>{var Qv=k2(),QZD=(D,F,$)=>{return D=new Qv(D,$),F=new Qv(F,$),D.intersects(F,$)};Zv.exports=QZD});var qv=w((Fj0,Yv)=>{var ZZD=t5(),XZD=x2();Yv.exports=(D,F,$)=>{let J=[],Q=null,Z=null,X=D.sort((B,W)=>XZD(B,W,$));for(let B of X)if(ZZD(B,F,$)){if(Z=B,!Q)Q=B}else{if(Z)J.push([Q,Z]);Z=null,Q=null}if(Q)J.push([Q,null]);let Y=[];for(let[B,W]of J)if(B===W)Y.push(B);else if(!W&&B===X[0])Y.push("*");else if(!W)Y.push(`>=${B}`);else if(B===X[0])Y.push(`<=${W}`);else Y.push(`${B} - ${W}`);let q=Y.join(" || "),G=typeof F.raw==="string"?F.raw:String(F);return q.length<G.length?q:F}});var Vv=w(($j0,Uv)=>{var Gv=k2(),LH=r5(),{ANY:TH}=LH,e5=t5(),PH=x2(),YZD=(D,F,$={})=>{if(D===F)return!0;D=new Gv(D,$),F=new Gv(F,$);let J=!1;D:for(let Q of D.set){for(let Z of F.set){let X=GZD(Q,Z,$);if(J=J||X!==null,X)continue D}if(J)return!1}return!0},qZD=[new LH(">=0.0.0-0")],Bv=[new LH(">=0.0.0")],GZD=(D,F,$)=>{if(D===F)return!0;if(D.length===1&&D[0].semver===TH)if(F.length===1&&F[0].semver===TH)return!0;else if($.includePrerelease)D=qZD;else D=Bv;if(F.length===1&&F[0].semver===TH)if($.includePrerelease)return!0;else F=Bv;let J=new Set,Q,Z;for(let U of D)if(U.operator===">"||U.operator===">=")Q=Wv(Q,U,$);else if(U.operator==="<"||U.operator==="<=")Z=Kv(Z,U,$);else J.add(U.semver);if(J.size>1)return null;let X;if(Q&&Z){if(X=PH(Q.semver,Z.semver,$),X>0)return null;else if(X===0&&(Q.operator!==">="||Z.operator!=="<="))return null}for(let U of J){if(Q&&!e5(U,String(Q),$))return null;if(Z&&!e5(U,String(Z),$))return null;for(let V of F)if(!e5(U,String(V),$))return!1;return!0}let Y,q,G,B,W=Z&&!$.includePrerelease&&Z.semver.prerelease.length?Z.semver:!1,K=Q&&!$.includePrerelease&&Q.semver.prerelease.length?Q.semver:!1;if(W&&W.prerelease.length===1&&Z.operator==="<"&&W.prerelease[0]===0)W=!1;for(let U of F){if(B=B||U.operator===">"||U.operator===">=",G=G||U.operator==="<"||U.operator==="<=",Q){if(K){if(U.semver.prerelease&&U.semver.prerelease.length&&U.semver.major===K.major&&U.semver.minor===K.minor&&U.semver.patch===K.patch)K=!1}if(U.operator===">"||U.operator===">="){if(Y=Wv(Q,U,$),Y===U&&Y!==Q)return!1}else if(Q.operator===">="&&!e5(Q.semver,String(U),$))return!1}if(Z){if(W){if(U.semver.prerelease&&U.semver.prerelease.length&&U.semver.major===W.major&&U.semver.minor===W.minor&&U.semver.patch===W.patch)W=!1}if(U.operator==="<"||U.operator==="<="){if(q=Kv(Z,U,$),q===U&&q!==Z)return!1}else if(Z.operator==="<="&&!e5(Z.semver,String(U),$))return!1}if(!U.operator&&(Z||Q)&&X!==0)return!1}if(Q&&G&&!Z&&X!==0)return!1;if(Z&&B&&!Q&&X!==0)return!1;if(K||W)return!1;return!0},Wv=(D,F,$)=>{if(!D)return F;let J=PH(D.semver,F.semver,$);return J>0?D:J<0?F:F.operator===">"&&D.operator===">="?F:D},Kv=(D,F,$)=>{if(!D)return F;let J=PH(D.semver,F.semver,$);return J<0?D:J>0?F:F.operator==="<"&&D.operator==="<="?F:D};Uv.exports=YZD});var D$=w((Jj0,Cv)=>{var jH=V9(),Hv=n5(),BZD=L0(),zv=_H(),WZD=m3(),KZD=gf(),UZD=df(),VZD=cf(),HZD=af(),zZD=sf(),CZD=ef(),_ZD=Fb(),MZD=Jb(),OZD=x2(),EZD=Yb(),RZD=Gb(),AZD=AY(),IZD=Ub(),wZD=Hb(),NZD=o5(),TZD=IY(),LZD=OH(),PZD=EH(),jZD=wY(),SZD=NY(),xZD=RH(),kZD=Ib(),yZD=r5(),fZD=k2(),bZD=t5(),vZD=gb(),hZD=db(),uZD=lb(),gZD=ib(),mZD=ab(),dZD=jY(),pZD=Fv(),lZD=Jv(),cZD=Xv(),nZD=qv(),iZD=Vv();Cv.exports={parse:WZD,valid:KZD,clean:UZD,inc:VZD,diff:HZD,major:zZD,minor:CZD,patch:_ZD,prerelease:MZD,compare:OZD,rcompare:EZD,compareLoose:RZD,compareBuild:AZD,sort:IZD,rsort:wZD,gt:NZD,lt:TZD,eq:LZD,neq:PZD,gte:jZD,lte:SZD,cmp:xZD,coerce:kZD,Comparator:yZD,Range:fZD,satisfies:bZD,toComparators:vZD,maxSatisfying:hZD,minSatisfying:uZD,minVersion:gZD,validRange:mZD,outside:dZD,gtr:pZD,ltr:lZD,intersects:cZD,simplifyRange:nZD,subset:iZD,SemVer:BZD,re:jH.re,src:jH.src,tokens:jH.t,SEMVER_SPEC_VERSION:Hv.SEMVER_SPEC_VERSION,RELEASE_TYPES:Hv.RELEASE_TYPES,compareIdentifiers:zv.compareIdentifiers,rcompareIdentifiers:zv.rcompareIdentifiers}});var $h=w((zx0,Fh)=>{Fh.exports=QYD;function JYD(D){let F={defaultWidth:0,output:process.stdout,tty:r("tty")};if(!D)return F;return Object.keys(F).forEach(function($){if(!D[$])D[$]=F[$]}),D}function QYD(D){let F=JYD(D);if(F.output.getWindowSize)return F.output.getWindowSize()[0]||F.defaultWidth;if(F.tty.getWindowSize)return F.tty.getWindowSize()[1]||F.defaultWidth;if(F.output.columns)return F.output.columns;if(process.env.CLI_WIDTH){let $=parseInt(process.env.CLI_WIDTH,10);if(!isNaN($)&&$!==0)return $}return F.defaultWidth}});var Eh=w((jx0,Oh)=>{var MYD=r("stream");class Mh extends MYD{#J=null;constructor(D={}){super(D);this.writable=this.readable=!0,this.muted=!1,this.on("pipe",this._onpipe),this.replace=D.replace,this._prompt=D.prompt||null,this._hadControl=!1}#$(D,F){if(this._dest)return this._dest[D];if(this._src)return this._src[D];return F}#F(D,...F){if(typeof this._dest?.[D]==="function")this._dest[D](...F);if(typeof this._src?.[D]==="function")this._src[D](...F)}get isTTY(){if(this.#J!==null)return this.#J;return this.#$("isTTY",!1)}set isTTY(D){this.#J=D}get rows(){return this.#$("rows")}get columns(){return this.#$("columns")}mute(){this.muted=!0}unmute(){this.muted=!1}_onpipe(D){this._src=D}pipe(D,F){return this._dest=D,super.pipe(D,F)}pause(){if(this._src)return this._src.pause()}resume(){if(this._src)return this._src.resume()}write(D){if(this.muted){if(!this.replace)return!0;if(D.match(/^\u001b/)){if(D.indexOf(this._prompt)===0)D=D.slice(this._prompt.length),D=D.replace(/./g,this.replace),D=this._prompt+D;return this._hadControl=!0,this.emit("data",D)}else{if(this._prompt&&this._hadControl&&D.indexOf(this._prompt)===0)this._hadControl=!1,this.emit("data",this._prompt),D=D.slice(this._prompt.length);D=D.toString().replace(/./g,this.replace)}}this.emit("data",D)}end(D){if(this.muted)if(D&&this.replace)D=D.toString().replace(/./g,this.replace);else D=null;if(D)this.emit("data",D);this.emit("end")}destroy(...D){return this.#F("destroy",...D)}destroySoon(...D){return this.#F("destroySoon",...D)}close(...D){return this.#F("close",...D)}}Oh.exports=Mh});var jz=TD(Pz(),1),{program:YqD,createCommand:qqD,createArgument:GqD,createOption:BqD,CommanderError:WqD,InvalidArgumentError:$g,InvalidOptionArgumentError:KqD,Command:ZD,Argument:UqD,Option:S0,Help:VqD}=jz.default;var Sz={name:"@cartesi/cli",version:"2.0.0-alpha.31",description:"Cartesi CLI",author:"Danilo Tuler <tuler@pobox.com>",bin:{cartesi:"./dist/index.js"},type:"module",homepage:"https://github.com/cartesi/cli",license:"Apache-2.0",exports:"./dist/index.js",repository:"cartesi/cli",files:["/dist"],dependencies:{"@commander-js/extra-typings":"^14.0.0","@inquirer/confirm":"^6.0.6","@inquirer/core":"^11.1.3","@inquirer/input":"^5.0.6","@inquirer/select":"^5.0.6","@inquirer/type":"^4.0.3",bytes:"^3.1.2",chalk:"^5.6.2","cli-table3":"^0.6.5",commander:"^14.0.3",execa:"^9.6.0","fs-extra":"^11.3.2","get-port":"^7.1.0",listr2:"^10.1.0",lookpath:"^1.2.3","modern-tar":"^0.7.3",ora:"^9.0.0","p-retry":"^7.0.0","progress-stream":"^2.0.0",semver:"^7.7.4","smol-toml":"^1.4.2",tmp:"^0.2.5",viem:"^2.46.1",yaml:"^2.8.2"},devDependencies:{"@cartesi/devnet":"2.0.0-alpha.10","@cartesi/rollups":"2.1.1","@sunodo/wagmi-plugin-hardhat-deploy":"^0.4.0","@types/bun":"^1.3.6","@types/bytes":"^3.1.5","@types/fs-extra":"^11.0.4","@types/inquirer":"^9.0.9","@types/node":"^25.2.3","@types/node-fetch":"^2.6.13","@types/progress-stream":"^2.0.5","@types/prompts":"^2.4.9","@types/semver":"^7.7.1","@types/tmp":"^0.2.6","@wagmi/cli":"^2.10.0","npm-run-all":"^4.1.5",rimraf:"^6.1.3","ts-node":"^10.9.2",tslib:"^2.8.1",typescript:"^5.9.2"},scripts:{build:"run-s clean codegen compile",clean:"rimraf dist",codegen:"run-p codegen:wagmi","codegen:wagmi":"wagmi generate",compile:"bun build.ts",lint:"biome lint",posttest:"bun lint",test:"bun test"},engines:{node:">=20.0.0"},bugs:"https://github.com/cartesi/cli/issues",types:"dist/index.d.ts"};var Ck=TD(Oq(),1);function mD(D){if(typeof D!=="object"||D===null)return!1;let F=Object.getPrototypeOf(D);return(F===null||F===Object.prototype||Object.getPrototypeOf(F)===null)&&!(Symbol.toStringTag in D)&&!(Symbol.iterator in D)}import{fileURLToPath as mg}from"node:url";var J6=(D,F)=>{let $=Rq(dg(D));if(typeof $!=="string")throw TypeError(`${F} must be a string or a file URL: ${$}.`);return $},dg=(D)=>Eq(D)?D.toString():D,Eq=(D)=>typeof D!=="string"&&D&&Object.getPrototypeOf(D)===String.prototype,Rq=(D)=>D instanceof URL?mg(D):D;var A$=(D,F=[],$={})=>{let J=J6(D,"First argument"),[Q,Z]=mD(F)?[[],F]:[F,$];if(!Array.isArray(Q))throw TypeError(`Second argument must be either an array of arguments or an options object: ${Q}`);if(Q.some((q)=>typeof q==="object"&&q!==null))throw TypeError(`Second argument must be an array of strings: ${Q}`);let X=Q.map(String),Y=X.find((q)=>q.includes("\x00"));if(Y!==void 0)throw TypeError(`Arguments cannot contain null bytes ("\\0"): ${Y}`);if(!mD(Z))throw TypeError(`Last argument must be an options object: ${Z}`);return[J,X,Z]};import{ChildProcess as ag}from"node:child_process";import{StringDecoder as pg}from"node:string_decoder";var{toString:PC}=Object.prototype,jC=(D)=>PC.call(D)==="[object ArrayBuffer]",tD=(D)=>PC.call(D)==="[object Uint8Array]",o8=(D)=>new Uint8Array(D.buffer,D.byteOffset,D.byteLength),lg=new TextEncoder,SC=(D)=>lg.encode(D),cg=new TextDecoder,I$=(D)=>cg.decode(D),xC=(D,F)=>{return ng(D,F).join("")},ng=(D,F)=>{if(F==="utf8"&&D.every((Z)=>typeof Z==="string"))return D;let $=new pg(F),J=D.map((Z)=>typeof Z==="string"?SC(Z):Z).map((Z)=>$.write(Z)),Q=$.end();return Q===""?J:[...J,Q]},L9=(D)=>{if(D.length===1&&tD(D[0]))return D[0];return Aq(ig(D))},ig=(D)=>D.map((F)=>typeof F==="string"?SC(F):F),Aq=(D)=>{let F=new Uint8Array(og(D)),$=0;for(let J of D)F.set(J,$),$+=J.length;return F},og=(D)=>{let F=0;for(let $ of D)F+=$.length;return F};var bC=(D)=>Array.isArray(D)&&Array.isArray(D.raw),vC=(D,F)=>{let $=[];for(let[Z,X]of D.entries())$=rg({templates:D,expressions:F,tokens:$,index:Z,template:X});if($.length===0)throw TypeError("Template script must not be empty");let[J,...Q]=$;return[J,Q,{}]},rg=({templates:D,expressions:F,tokens:$,index:J,template:Q})=>{if(Q===void 0)throw TypeError(`Invalid backslash sequence: ${D.raw[J]}`);let{nextTokens:Z,leadingWhitespaces:X,trailingWhitespaces:Y}=sg(Q,D.raw[J]),q=yC($,Z,X);if(J===F.length)return q;let G=F[J],B=Array.isArray(G)?G.map((W)=>fC(W)):[fC(G)];return yC(q,B,Y)},sg=(D,F)=>{if(F.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let $=[],J=0,Q=kC.has(F[0]);for(let X=0,Y=0;X<D.length;X+=1,Y+=1){let q=F[Y];if(kC.has(q)){if(J!==X)$.push(D.slice(J,X));J=X+1}else if(q==="\\"){let G=F[Y+1];if(G===`
246
246
  `)X-=1,Y+=1;else if(G==="u"&&F[Y+2]==="{")Y=F.indexOf("}",Y+3);else Y+=tg[G]??1}}let Z=J===D.length;if(!Z)$.push(D.slice(J));return{nextTokens:$,leadingWhitespaces:Q,trailingWhitespaces:Z}},kC=new Set([" ","\t","\r",`
247
247
  `]),tg={x:3,u:5},yC=(D,F,$)=>$||D.length===0||F.length===0?[...D,...F]:[...D.slice(0,-1),`${D.at(-1)}${F[0]}`,...F.slice(1)],fC=(D)=>{let F=typeof D;if(F==="string")return D;if(F==="number")return String(D);if(mD(D)&&(("stdout"in D)||("isMaxBuffer"in D)))return eg(D);if(D instanceof ag||Object.prototype.toString.call(D)==="[object Promise]")throw TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}.");throw TypeError(`Unexpected "${F}" in template expression`)},eg=({stdout:D})=>{if(typeof D==="string")return D;if(tD(D))return I$(D);if(D===void 0)throw TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`);throw TypeError(`Unexpected "${typeof D}" stdout in template expression`)};import{spawnSync as Xn}from"node:child_process";import{debuglog as Dm}from"node:util";import Iq from"node:process";var v2=(D)=>w$.includes(D),w$=[Iq.stdin,Iq.stdout,Iq.stderr],z2=["stdin","stdout","stderr"],N$=(D)=>z2[D]??`stdio[${D}]`;var uC=(D)=>{let F={...D};for(let $ of Tq)F[$]=wq(D,$);return F},wq=(D,F)=>{let $=Array.from({length:Fm(D)+1}),J=$m(D[F],$,F);return Ym(J,F)},Fm=({stdio:D})=>Array.isArray(D)?Math.max(D.length,z2.length):z2.length,$m=(D,F,$)=>mD(D)?Jm(D,F,$):F.fill(D),Jm=(D,F,$)=>{for(let J of Object.keys(D).sort(Qm))for(let Q of Zm(J,$,F))F[Q]=D[J];return F},Qm=(D,F)=>hC(D)<hC(F)?1:-1,hC=(D)=>{if(D==="stdout"||D==="stderr")return 0;return D==="all"?2:1},Zm=(D,F,$)=>{if(D==="ipc")return[$.length-1];let J=Nq(D);if(J===void 0||J===0)throw TypeError(`"${F}.${D}" is invalid.
248
248
  It must be "${F}.stdout", "${F}.stderr", "${F}.all", "${F}.ipc", or "${F}.fd3", "${F}.fd4" (and so on).`);if(J>=$.length)throw TypeError(`"${F}.${D}" is invalid: that file descriptor does not exist.
@@ -273,22 +273,22 @@ ${J.message}
273
273
  ${D}`}if(!$.isDirectory())return`The "cwd" option is not a directory: ${F}.
274
274
  ${D}`;return D};var FJ=(D,F,$)=>{$.cwd=eM($.cwd);let[J,Q,Z]=oM(D,F,$),{command:X,args:Y,options:q}=JO.default._parse(J,Q,Z),G=uC(q),B=Np(G);if(lM(B),tM(B),aM(B),WM(B),dM(B),B.shell=Rq(B.shell),B.env=Tp(B),B.killSignal=XM(B.killSignal),B.forceKillAfterDelay=GM(B.forceKillAfterDelay),B.lines=B.lines.map((W,K)=>W&&!X2.has(B.encoding)&&B.buffer[K]),$O.platform==="win32"&&wp.basename(X,".exe")==="cmd")Y.unshift("/q");return{file:X,commandArguments:Y,options:B}},Np=({extendEnv:D=!0,preferLocal:F=!1,cwd:$,localDir:J=$,encoding:Q="utf8",reject:Z=!0,cleanup:X=!0,all:Y=!1,windowsHide:q=!0,killSignal:G="SIGTERM",forceKillAfterDelay:B=!0,gracefulCancel:W=!1,ipcInput:K,ipc:U=K!==void 0||W,serialization:V="advanced",...H})=>({...H,extendEnv:D,preferLocal:F,cwd:$,localDirectory:J,encoding:Q,reject:Z,cleanup:X,all:Y,windowsHide:q,killSignal:G,forceKillAfterDelay:B,gracefulCancel:W,ipcInput:K,ipc:U,serialization:V}),Tp=({env:D,extendEnv:F,preferLocal:$,node:J,localDirectory:Q,nodePath:Z})=>{let X=F?{...$O.env,...D}:D;if($||J)return r_({env:X,cwd:Q,execPath:Z,preferLocal:$,addExecPath:J});return X};var $J=(D,F,$)=>$.shell&&F.length>0?[[D,...F].join(" "),[],$]:[D,F,$];import{inspect as Yl}from"node:util";function W6(D){if(typeof D==="string")return Lp(D);if(!(ArrayBuffer.isView(D)&&D.BYTES_PER_ELEMENT===1))throw Error("Input must be a string or a Uint8Array");return Pp(D)}var Lp=(D)=>D.at(-1)===QO?D.slice(0,D.at(-2)===ZO?-2:-1):D,Pp=(D)=>D.at(-1)===jp?D.subarray(0,D.at(-2)===Sp?-2:-1):D,QO=`
275
275
  `,jp=QO.codePointAt(0),ZO="\r",Sp=ZO.codePointAt(0);import{on as Jl}from"node:events";import{finished as Ql}from"node:stream/promises";function u2(D,{checkOpen:F=!0}={}){return D!==null&&typeof D==="object"&&(D.writable||D.readable||!F||D.writable===void 0&&D.readable===void 0)&&typeof D.pipe==="function"}function sq(D,{checkOpen:F=!0}={}){return u2(D,{checkOpen:F})&&(D.writable||!F)&&typeof D.write==="function"&&typeof D.end==="function"&&typeof D.writable==="boolean"&&typeof D.writableObjectMode==="boolean"&&typeof D.destroy==="function"&&typeof D.destroyed==="boolean"}function vF(D,{checkOpen:F=!0}={}){return u2(D,{checkOpen:F})&&(D.readable||!F)&&typeof D.read==="function"&&typeof D.readable==="boolean"&&typeof D.readableObjectMode==="boolean"&&typeof D.destroy==="function"&&typeof D.destroyed==="boolean"}function tq(D,F){return sq(D,F)&&vF(D,F)}var xp=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class XO{#J;#$;#F=!1;#D=void 0;constructor(D,F){this.#J=D,this.#$=F}next(){let D=()=>this.#Z();return this.#D=this.#D?this.#D.then(D,D):D(),this.#D}return(D){let F=()=>this.#Q(D);return this.#D?this.#D.then(F,F):F()}async#Z(){if(this.#F)return{done:!0,value:void 0};let D;try{D=await this.#J.read()}catch(F){throw this.#D=void 0,this.#F=!0,this.#J.releaseLock(),F}return D.done&&(this.#D=void 0,this.#F=!0,this.#J.releaseLock()),D}async#Q(D){if(this.#F)return{done:!0,value:D};if(this.#F=!0,!this.#$){let F=this.#J.cancel(D);return this.#J.releaseLock(),await F,{done:!0,value:D}}return this.#J.releaseLock(),{done:!0,value:D}}}var eq=Symbol();function YO(){return this[eq].next()}Object.defineProperty(YO,"name",{value:"next"});function qO(D){return this[eq].return(D)}Object.defineProperty(qO,"name",{value:"return"});var kp=Object.create(xp,{next:{enumerable:!0,configurable:!0,writable:!0,value:YO},return:{enumerable:!0,configurable:!0,writable:!0,value:qO}});function DG({preventCancel:D=!1}={}){let F=this.getReader(),$=new XO(F,D),J=Object.create(kp);return J[eq]=$,J}var GO=(D)=>{if(vF(D,{checkOpen:!1})&&y9.on!==void 0)return fp(D);if(typeof D?.[Symbol.asyncIterator]==="function")return D;if(yp.call(D)==="[object ReadableStream]")return DG.call(D);throw TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:yp}=Object.prototype,fp=async function*(D){let F=new AbortController,$={};bp(D,F,$);try{for await(let[J]of y9.on(D,"data",{signal:F.signal}))yield J}catch(J){if($.error!==void 0)throw $.error;else if(!F.signal.aborted)throw J}finally{D.destroy()}},bp=async(D,F,$)=>{try{await y9.finished(D,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(J){$.error=J}finally{F.abort()}},y9={};var K6=async(D,{init:F,convertChunk:$,getSize:J,truncateChunk:Q,addChunk:Z,getFinalChunk:X,finalize:Y},{maxBuffer:q=Number.POSITIVE_INFINITY}={})=>{let G=GO(D),B=F();B.length=0;try{for await(let W of G){let K=hp(W),U=$[K](W,B);KO({convertedChunk:U,state:B,getSize:J,truncateChunk:Q,addChunk:Z,maxBuffer:q})}return vp({state:B,convertChunk:$,getSize:J,truncateChunk:Q,addChunk:Z,getFinalChunk:X,maxBuffer:q}),Y(B)}catch(W){let K=typeof W==="object"&&W!==null?W:Error(W);throw K.bufferedData=Y(B),K}},vp=({state:D,getSize:F,truncateChunk:$,addChunk:J,getFinalChunk:Q,maxBuffer:Z})=>{let X=Q(D);if(X!==void 0)KO({convertedChunk:X,state:D,getSize:F,truncateChunk:$,addChunk:J,maxBuffer:Z})},KO=({convertedChunk:D,state:F,getSize:$,truncateChunk:J,addChunk:Q,maxBuffer:Z})=>{let X=$(D),Y=F.length+X;if(Y<=Z){BO(D,F,Q,Y);return}let q=J(D,Z-F.length);if(q!==void 0)BO(q,F,Q,Z);throw new r8},BO=(D,F,$,J)=>{F.contents=$(D,F,J),F.length=J},hp=(D)=>{let F=typeof D;if(F==="string")return"string";if(F!=="object"||D===null)return"others";if(globalThis.Buffer?.isBuffer(D))return"buffer";let $=WO.call(D);if($==="[object ArrayBuffer]")return"arrayBuffer";if($==="[object DataView]")return"dataView";if(Number.isInteger(D.byteLength)&&Number.isInteger(D.byteOffset)&&WO.call(D.buffer)==="[object ArrayBuffer]")return"typedArray";return"others"},{toString:WO}=Object.prototype;class r8 extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}var s8=(D)=>D,f9=()=>{return},JJ=({contents:D})=>D,QJ=(D)=>{throw Error(`Streams in object mode are not supported: ${String(D)}`)},ZJ=(D)=>D.length;async function XJ(D,F){return K6(D,dp,F)}var up=()=>({contents:[]}),gp=()=>1,mp=(D,{contents:F})=>{return F.push(D),F},dp={init:up,convertChunk:{string:s8,buffer:s8,arrayBuffer:s8,dataView:s8,typedArray:s8,others:s8},getSize:gp,truncateChunk:f9,addChunk:mp,getFinalChunk:f9,finalize:JJ};async function YJ(D,F){return K6(D,sp,F)}var pp=()=>({contents:new ArrayBuffer(0)}),lp=(D)=>cp.encode(D),cp=new TextEncoder,UO=(D)=>new Uint8Array(D),VO=(D)=>new Uint8Array(D.buffer,D.byteOffset,D.byteLength),np=(D,F)=>D.slice(0,F),ip=(D,{contents:F,length:$},J)=>{let Q=CO()?ap(F,J):op(F,J);return new Uint8Array(Q).set(D,$),Q},op=(D,F)=>{if(F<=D.byteLength)return D;let $=new ArrayBuffer(zO(F));return new Uint8Array($).set(new Uint8Array(D),0),$},ap=(D,F)=>{if(F<=D.maxByteLength)return D.resize(F),D;let $=new ArrayBuffer(F,{maxByteLength:zO(F)});return new Uint8Array($).set(new Uint8Array(D),0),$},zO=(D)=>HO**Math.ceil(Math.log(D)/Math.log(HO)),HO=2,rp=({contents:D,length:F})=>CO()?D:D.slice(0,F),CO=()=>("resize"in ArrayBuffer.prototype),sp={init:pp,convertChunk:{string:lp,buffer:UO,arrayBuffer:UO,dataView:VO,typedArray:VO,others:QJ},getSize:ZJ,truncateChunk:np,addChunk:ip,getFinalChunk:f9,finalize:rp};async function GJ(D,F){return K6(D,$l,F)}var tp=()=>({contents:"",textDecoder:new TextDecoder}),qJ=(D,{textDecoder:F})=>F.decode(D,{stream:!0}),ep=(D,{contents:F})=>F+D,Dl=(D,F)=>D.slice(0,F),Fl=({textDecoder:D})=>{let F=D.decode();return F===""?void 0:F},$l={init:tp,convertChunk:{string:s8,buffer:qJ,arrayBuffer:qJ,dataView:qJ,typedArray:qJ,others:QJ},getSize:ZJ,truncateChunk:Dl,addChunk:ep,getFinalChunk:Fl,finalize:JJ};Object.assign(y9,{on:Jl,finished:Ql});var _O=({error:D,stream:F,readableObjectMode:$,lines:J,encoding:Q,fdNumber:Z})=>{if(!(D instanceof r8))throw D;if(Z==="all")return D;let X=Zl($,J,Q);throw D.maxBufferInfo={fdNumber:Z,unit:X},F.destroy(),D},Zl=(D,F,$)=>{if(D)return"objects";if(F)return"lines";if($==="buffer")return"bytes";return"characters"},MO=(D,F,$)=>{if(F.length!==$)return;let J=new r8;throw J.maxBufferInfo={fdNumber:"ipc"},J},OO=(D,F)=>{let{streamName:$,threshold:J,unit:Q}=Xl(D,F);return`Command's ${$} was larger than ${J} ${Q}`},Xl=(D,F)=>{if(D?.maxBufferInfo===void 0)return{streamName:"output",threshold:F[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:$,unit:J}}=D;delete D.maxBufferInfo;let Q=a8(F,$);if($==="ipc")return{streamName:"IPC output",threshold:Q,unit:"messages"};return{streamName:N$($),threshold:Q,unit:J}},EO=(D,F,$)=>D?.code==="ENOBUFS"&&F!==null&&F.some((J)=>J!==null&&J.length>BJ($)),RO=(D,F,$)=>{if(!F)return D;let J=BJ($);return D.length>J?D.slice(0,J):D},BJ=([,D])=>D;var IO=({stdio:D,all:F,ipcOutput:$,originalError:J,signal:Q,signalDescription:Z,exitCode:X,escapedCommand:Y,timedOut:q,isCanceled:G,isGracefullyCanceled:B,isMaxBuffer:W,isForcefullyTerminated:K,forceKillAfterDelay:U,killSignal:V,maxBuffer:H,timeout:z,cwd:_})=>{let O=J?.code,C=ql({originalError:J,timedOut:q,timeout:z,isMaxBuffer:W,maxBuffer:H,errorCode:O,signal:Q,signalDescription:Z,exitCode:X,isCanceled:G,isGracefullyCanceled:B,isForcefullyTerminated:K,forceKillAfterDelay:U,killSignal:V}),M=Bl(J,_),E=M===void 0?"":`
276
- ${M}`,A=`${C}: ${Y}${E}`,w=F===void 0?[D[2],D[1]]:[F],R=[A,...w,...D.slice(3),$.map((T)=>Wl(T)).join(`
276
+ ${M}`,A=`${C}: ${Y}${E}`,I=F===void 0?[D[2],D[1]]:[F],R=[A,...I,...D.slice(3),$.map((T)=>Wl(T)).join(`
277
277
  `)].map((T)=>P9(W6(Kl(T)))).filter(Boolean).join(`
278
278
 
279
279
  `);return{originalMessage:M,shortMessage:A,message:R}},ql=({originalError:D,timedOut:F,timeout:$,isMaxBuffer:J,maxBuffer:Q,errorCode:Z,signal:X,signalDescription:Y,exitCode:q,isCanceled:G,isGracefullyCanceled:B,isForcefullyTerminated:W,forceKillAfterDelay:K,killSignal:U})=>{let V=Gl(W,K);if(F)return`Command timed out after ${$} milliseconds${V}`;if(B){if(X===void 0)return`Command was gracefully canceled with exit code ${q}`;return W?`Command was gracefully canceled${V}`:`Command was gracefully canceled with ${X} (${Y})`}if(G)return`Command was canceled${V}`;if(J)return`${OO(D,Q)}${V}`;if(Z!==void 0)return`Command failed with ${Z}${V}`;if(W)return`Command was killed with ${U} (${g$(U)})${V}`;if(X!==void 0)return`Command was killed with ${X} (${Y})`;if(q!==void 0)return`Command failed with exit code ${q}`;return"Command failed"},Gl=(D,F)=>D?` and was forcefully terminated after ${F} milliseconds`:"",Bl=(D,F)=>{if(D instanceof B8)return;let $=e_(D)?D.originalMessage:String(D?.message??D),J=P9(FO($,F));return J===""?void 0:J},Wl=(D)=>typeof D==="string"?D:Yl(D),Kl=(D)=>Array.isArray(D)?D.map((F)=>W6(AO(F))).filter(Boolean).join(`
280
- `):AO(D),AO=(D)=>{if(typeof D==="string")return D;if(tD(D))return I$(D);return""};var WJ=({command:D,escapedCommand:F,stdio:$,all:J,ipcOutput:Q,options:{cwd:Z},startTime:X})=>wO({command:D,escapedCommand:F,cwd:Z,durationMs:Pq(X),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:$[1],stderr:$[2],all:J,stdio:$,ipcOutput:Q,pipedFrom:[]}),U6=({error:D,command:F,escapedCommand:$,fileDescriptors:J,options:Q,startTime:Z,isSync:X})=>b9({error:D,command:F,escapedCommand:$,startTime:Z,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:J.length}),ipcOutput:[],options:Q,isSync:X}),b9=({error:D,command:F,escapedCommand:$,startTime:J,timedOut:Q,isCanceled:Z,isGracefullyCanceled:X,isMaxBuffer:Y,isForcefullyTerminated:q,exitCode:G,signal:B,stdio:W,all:K,ipcOutput:U,options:{timeoutDuration:V,timeout:H=V,forceKillAfterDelay:z,killSignal:_,cwd:O,maxBuffer:C},isSync:M})=>{let{exitCode:E,signal:A,signalDescription:w}=Vl(G,B),{originalMessage:R,shortMessage:T,message:N}=IO({stdio:W,all:K,ipcOutput:U,originalError:D,signal:A,signalDescription:w,exitCode:E,escapedCommand:$,timedOut:Q,isCanceled:Z,isGracefullyCanceled:X,isMaxBuffer:Y,isForcefullyTerminated:q,forceKillAfterDelay:z,killSignal:_,maxBuffer:C,timeout:H,cwd:O}),j=s_(D,N,M);return Object.assign(j,Ul({error:j,command:F,escapedCommand:$,startTime:J,timedOut:Q,isCanceled:Z,isGracefullyCanceled:X,isMaxBuffer:Y,isForcefullyTerminated:q,exitCode:E,signal:A,signalDescription:w,stdio:W,all:K,ipcOutput:U,cwd:O,originalMessage:R,shortMessage:T})),j},Ul=({error:D,command:F,escapedCommand:$,startTime:J,timedOut:Q,isCanceled:Z,isGracefullyCanceled:X,isMaxBuffer:Y,isForcefullyTerminated:q,exitCode:G,signal:B,signalDescription:W,stdio:K,all:U,ipcOutput:V,cwd:H,originalMessage:z,shortMessage:_})=>wO({shortMessage:_,originalMessage:z,command:F,escapedCommand:$,cwd:H,durationMs:Pq(J),failed:!0,timedOut:Q,isCanceled:Z,isGracefullyCanceled:X,isTerminated:B!==void 0,isMaxBuffer:Y,isForcefullyTerminated:q,exitCode:G,signal:B,signalDescription:W,code:D.cause?.code,stdout:K[1],stderr:K[2],all:U,stdio:K,ipcOutput:V,pipedFrom:[]}),wO=(D)=>Object.fromEntries(Object.entries(D).filter(([,F])=>F!==void 0)),Vl=(D,F)=>{let $=D===null?void 0:D,J=F===null?void 0:F,Q=J===void 0?void 0:g$(F);return{exitCode:$,signal:J,signalDescription:Q}};var NO=(D)=>Number.isFinite(D)?D:0;function Hl(D){return{days:Math.trunc(D/86400000),hours:Math.trunc(D/3600000%24),minutes:Math.trunc(D/60000%60),seconds:Math.trunc(D/1000%60),milliseconds:Math.trunc(D%1000),microseconds:Math.trunc(NO(D*1000)%1000),nanoseconds:Math.trunc(NO(D*1e6)%1000)}}function zl(D){return{days:D/86400000n,hours:D/3600000n%24n,minutes:D/60000n%60n,seconds:D/1000n%60n,milliseconds:D%1000n,microseconds:0n,nanoseconds:0n}}function FG(D){switch(typeof D){case"number":{if(Number.isFinite(D))return Hl(D);break}case"bigint":return zl(D)}throw TypeError("Expected a finite number or bigint")}var Cl=(D)=>D===0||D===0n,_l=(D,F)=>F===1||F===1n?D:`${D}s`,Ml=0.0000001,Ol=24n*60n*60n*1000n;function $G(D,F){let $=typeof D==="bigint";if(!$&&!Number.isFinite(D))throw TypeError("Expected a finite number or bigint");F={...F};let J=D<0?"-":"";if(D=D<0?-D:D,F.colonNotation)F.compact=!1,F.formatSubMilliseconds=!1,F.separateMilliseconds=!1,F.verbose=!1;if(F.compact)F.unitCount=1,F.secondsDecimalDigits=0,F.millisecondsDecimalDigits=0;let Q=[],Z=(B,W)=>{let K=Math.floor(B*10**W+Ml);return(Math.round(K)/10**W).toFixed(W)},X=(B,W,K,U)=>{if((Q.length===0||!F.colonNotation)&&Cl(B)&&!(F.colonNotation&&K==="m"))return;if(U??=String(B),F.colonNotation){let V=U.includes(".")?U.split(".")[0].length:U.length,H=Q.length>0?2:1;U="0".repeat(Math.max(0,H-V))+U}else U+=F.verbose?" "+_l(W,B):K;Q.push(U)},Y=FG(D),q=BigInt(Y.days);if(F.hideYearAndDays)X(BigInt(q)*24n+BigInt(Y.hours),"hour","h");else{if(F.hideYear)X(q,"day","d");else X(q/365n,"year","y"),X(q%365n,"day","d");X(Number(Y.hours),"hour","h")}if(X(Number(Y.minutes),"minute","m"),!F.hideSeconds)if(F.separateMilliseconds||F.formatSubMilliseconds||!F.colonNotation&&D<1000&&!F.subSecondsAsDecimals){let B=Number(Y.seconds),W=Number(Y.milliseconds),K=Number(Y.microseconds),U=Number(Y.nanoseconds);if(X(B,"second","s"),F.formatSubMilliseconds)X(W,"millisecond","ms"),X(K,"microsecond","µs"),X(U,"nanosecond","ns");else{let V=W+K/1000+U/1e6,H=typeof F.millisecondsDecimalDigits==="number"?F.millisecondsDecimalDigits:0,z=V>=1?Math.round(V):Math.ceil(V),_=H?V.toFixed(H):z;X(Number.parseFloat(_),"millisecond","ms",_)}}else{let B=($?Number(D%Ol):D)/1000%60,W=typeof F.secondsDecimalDigits==="number"?F.secondsDecimalDigits:1,K=Z(B,W),U=F.keepDecimalsOnWholeSeconds?K:K.replace(/\.0+$/,"");X(Number.parseFloat(U),"second","s",U)}if(Q.length===0)return J+"0"+(F.verbose?" milliseconds":"ms");let G=F.colonNotation?":":" ";if(typeof F.unitCount==="number")Q=Q.slice(0,Math.max(F.unitCount,1));return J+Q.join(G)}var TO=(D,F)=>{if(D.failed)G8({type:"error",verboseMessage:D.shortMessage,verboseInfo:F,result:D})};var LO=(D,F)=>{if(!Q6(F))return;TO(D,F),El(D,F)},El=(D,F)=>{let $=`(done in ${$G(D.durationMs)})`;G8({type:"duration",verboseMessage:$,verboseInfo:F,result:D})};var V6=(D,F,{reject:$})=>{if(LO(D,F),D.failed&&$)throw D;return D};import{readFileSync as FE}from"node:fs";var SO=(D,F)=>{if(hF(D))return"asyncGenerator";if(yO(D))return"generator";if(KJ(D))return"fileUrl";if(Nl(D))return"filePath";if(Pl(D))return"webStream";if(u2(D,{checkOpen:!1}))return"native";if(tD(D))return"uint8Array";if(jl(D))return"asyncIterable";if(Sl(D))return"iterable";if(ZG(D))return xO({transform:D},F);if(wl(D))return Rl(D,F);return"native"},Rl=(D,F)=>{if(tq(D.transform,{checkOpen:!1}))return Al(D,F);if(ZG(D.transform))return xO(D,F);return Il(D,F)},Al=(D,F)=>{return kO(D,F,"Duplex stream"),"duplex"},xO=(D,F)=>{return kO(D,F,"web TransformStream"),"webTransform"},kO=({final:D,binary:F,objectMode:$},J,Q)=>{PO(D,`${J}.final`,Q),PO(F,`${J}.binary`,Q),JG($,`${J}.objectMode`)},PO=(D,F,$)=>{if(D!==void 0)throw TypeError(`The \`${F}\` option can only be defined when using a generator, not a ${$}.`)},Il=({transform:D,final:F,binary:$,objectMode:J},Q)=>{if(D!==void 0&&!jO(D))throw TypeError(`The \`${Q}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(tq(F,{checkOpen:!1}))throw TypeError(`The \`${Q}.final\` option must not be a Duplex stream.`);if(ZG(F))throw TypeError(`The \`${Q}.final\` option must not be a web TransformStream.`);if(F!==void 0&&!jO(F))throw TypeError(`The \`${Q}.final\` option must be a generator.`);return JG($,`${Q}.binary`),JG(J,`${Q}.objectMode`),hF(D)||hF(F)?"asyncGenerator":"generator"},JG=(D,F)=>{if(D!==void 0&&typeof D!=="boolean")throw TypeError(`The \`${F}\` option must use a boolean.`)},jO=(D)=>hF(D)||yO(D),hF=(D)=>Object.prototype.toString.call(D)==="[object AsyncGeneratorFunction]",yO=(D)=>Object.prototype.toString.call(D)==="[object GeneratorFunction]",wl=(D)=>mD(D)&&(D.transform!==void 0||D.final!==void 0),KJ=(D)=>Object.prototype.toString.call(D)==="[object URL]",fO=(D)=>KJ(D)&&D.protocol!=="file:",Nl=(D)=>mD(D)&&Object.keys(D).length>0&&Object.keys(D).every((F)=>Tl.has(F))&&QG(D.file),Tl=new Set(["file","append"]),QG=(D)=>typeof D==="string",bO=(D,F)=>D==="native"&&typeof F==="string"&&!Ll.has(F),Ll=new Set(["ipc","ignore","inherit","overlapped","pipe"]),vO=(D)=>Object.prototype.toString.call(D)==="[object ReadableStream]",UJ=(D)=>Object.prototype.toString.call(D)==="[object WritableStream]",Pl=(D)=>vO(D)||UJ(D),ZG=(D)=>vO(D?.readable)&&UJ(D?.writable),jl=(D)=>hO(D)&&typeof D[Symbol.asyncIterator]==="function",Sl=(D)=>hO(D)&&typeof D[Symbol.iterator]==="function",hO=(D)=>typeof D==="object"&&D!==null,C2=new Set(["generator","asyncGenerator","duplex","webTransform"]),VJ=new Set(["fileUrl","filePath","fileNumber"]),XG=new Set(["fileUrl","filePath"]),uO=new Set([...XG,"webStream","nodeStream"]),gO=new Set(["webTransform","duplex"]),v1={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"};var YG=(D,F,$,J)=>J==="output"?xl(D,F,$):kl(D,F,$),xl=(D,F,$)=>{let J=F!==0&&$[F-1].value.readableObjectMode;return{writableObjectMode:J,readableObjectMode:D??J}},kl=(D,F,$)=>{let J=F===0?D===!0:$[F-1].value.readableObjectMode,Q=F!==$.length-1&&(D??J);return{writableObjectMode:J,readableObjectMode:Q}},mO=(D,F)=>{let $=D.findLast(({type:J})=>C2.has(J));if($===void 0)return!1;return F==="input"?$.value.writableObjectMode:$.value.readableObjectMode};var dO=(D,F,$,J)=>[...D.filter(({type:Q})=>!C2.has(Q)),...yl(D,F,$,J)],yl=(D,F,$,{encoding:J})=>{let Q=D.filter(({type:X})=>C2.has(X)),Z=Array.from({length:Q.length});for(let[X,Y]of Object.entries(Q))Z[X]=fl({stdioItem:Y,index:Number(X),newTransforms:Z,optionName:F,direction:$,encoding:J});return ul(Z,$)},fl=({stdioItem:D,stdioItem:{type:F},index:$,newTransforms:J,optionName:Q,direction:Z,encoding:X})=>{if(F==="duplex")return bl({stdioItem:D,optionName:Q});if(F==="webTransform")return vl({stdioItem:D,index:$,newTransforms:J,direction:Z});return hl({stdioItem:D,index:$,newTransforms:J,direction:Z,encoding:X})},bl=({stdioItem:D,stdioItem:{value:{transform:F,transform:{writableObjectMode:$,readableObjectMode:J},objectMode:Q=J}},optionName:Z})=>{if(Q&&!J)throw TypeError(`The \`${Z}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!Q&&J)throw TypeError(`The \`${Z}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...D,value:{transform:F,writableObjectMode:$,readableObjectMode:J}}},vl=({stdioItem:D,stdioItem:{value:F},index:$,newTransforms:J,direction:Q})=>{let{transform:Z,objectMode:X}=mD(F)?F:{transform:F},{writableObjectMode:Y,readableObjectMode:q}=YG(X,$,J,Q);return{...D,value:{transform:Z,writableObjectMode:Y,readableObjectMode:q}}},hl=({stdioItem:D,stdioItem:{value:F},index:$,newTransforms:J,direction:Q,encoding:Z})=>{let{transform:X,final:Y,binary:q=!1,preserveNewlines:G=!1,objectMode:B}=mD(F)?F:{transform:F},W=q||X2.has(Z),{writableObjectMode:K,readableObjectMode:U}=YG(B,$,J,Q);return{...D,value:{transform:X,final:Y,binary:W,preserveNewlines:G,writableObjectMode:K,readableObjectMode:U}}},ul=(D,F)=>F==="input"?D.reverse():D;import qG from"node:process";var pO=(D,F,$)=>{let J=D.map((Q)=>gl(Q,F));if(J.includes("input")&&J.includes("output"))throw TypeError(`The \`${$}\` option must not be an array of both readable and writable values.`);return J.find(Boolean)??pl},gl=({type:D,value:F},$)=>ml[$]??lO[D](F),ml=["input","output","output"],H6=()=>{return},GG=()=>"input",lO={generator:H6,asyncGenerator:H6,fileUrl:H6,filePath:H6,iterable:GG,asyncIterable:GG,uint8Array:GG,webStream:(D)=>UJ(D)?"output":"input",nodeStream(D){if(!vF(D,{checkOpen:!1}))return"output";return sq(D,{checkOpen:!1})?void 0:"input"},webTransform:H6,duplex:H6,native(D){let F=dl(D);if(F!==void 0)return F;if(u2(D,{checkOpen:!1}))return lO.nodeStream(D)}},dl=(D)=>{if([0,qG.stdin].includes(D))return"input";if([1,2,qG.stdout,qG.stderr].includes(D))return"output"},pl="output";var cO=(D,F)=>F&&!D.includes("ipc")?[...D,"ipc"]:D;var nO=({stdio:D,ipc:F,buffer:$,...J},Q,Z)=>{let X=ll(D,J).map((Y,q)=>iO(Y,q));return Z?nl(X,$,Q):cO(X,F)},ll=(D,F)=>{if(D===void 0)return z2.map((J)=>F[J]);if(cl(F))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${z2.map((J)=>`\`${J}\``).join(", ")}`);if(typeof D==="string")return[D,D,D];if(!Array.isArray(D))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof D}\``);let $=Math.max(D.length,z2.length);return Array.from({length:$},(J,Q)=>D[Q])},cl=(D)=>z2.some((F)=>D[F]!==void 0),iO=(D,F)=>{if(Array.isArray(D))return D.map(($)=>iO($,F));if(D===null||D===void 0)return F>=z2.length?"ignore":"pipe";return D},nl=(D,F,$)=>D.map((J,Q)=>!F[Q]&&Q!==0&&!Z6($,Q)&&il(J)?"ignore":J),il=(D)=>D==="pipe"||Array.isArray(D)&&D.every((F)=>F==="pipe");import{readFileSync as ol}from"node:fs";import al from"node:tty";var aO=({stdioItem:D,stdioItem:{type:F},isStdioArray:$,fdNumber:J,direction:Q,isSync:Z})=>{if(!$||F!=="native")return D;return Z?rl({stdioItem:D,fdNumber:J,direction:Q}):el({stdioItem:D,fdNumber:J})},rl=({stdioItem:D,stdioItem:{value:F,optionName:$},fdNumber:J,direction:Q})=>{let Z=sl({value:F,optionName:$,fdNumber:J,direction:Q});if(Z!==void 0)return Z;if(u2(F,{checkOpen:!1}))throw TypeError(`The \`${$}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return D},sl=({value:D,optionName:F,fdNumber:$,direction:J})=>{let Q=tl(D,$);if(Q===void 0)return;if(J==="output")return{type:"fileNumber",value:Q,optionName:F};if(al.isatty(Q))throw TypeError(`The \`${F}: ${p$(D)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:o8(ol(Q)),optionName:F}},tl=(D,F)=>{if(D==="inherit")return F;if(typeof D==="number")return D;let $=w$.indexOf(D);if($!==-1)return $},el=({stdioItem:D,stdioItem:{value:F,optionName:$},fdNumber:J})=>{if(F==="inherit")return{type:"nodeStream",value:oO(J,F,$),optionName:$};if(typeof F==="number")return{type:"nodeStream",value:oO(F,F,$),optionName:$};if(u2(F,{checkOpen:!1}))return{type:"nodeStream",value:F,optionName:$};return D},oO=(D,F,$)=>{let J=w$[D];if(J===void 0)throw TypeError(`The \`${$}: ${F}\` option is invalid: no such standard stream.`);return J};var rO=({input:D,inputFile:F},$)=>$===0?[...Dc(D),...$c(F)]:[],Dc=(D)=>D===void 0?[]:[{type:Fc(D),value:D,optionName:"input"}],Fc=(D)=>{if(vF(D,{checkOpen:!1}))return"nodeStream";if(typeof D==="string")return"string";if(tD(D))return"uint8Array";throw Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},$c=(D)=>D===void 0?[]:[{...Jc(D),optionName:"inputFile"}],Jc=(D)=>{if(KJ(D))return{type:"fileUrl",value:D};if(QG(D))return{type:"filePath",value:{file:D}};throw Error("The `inputFile` option must be a file path string or a file URL.")};var sO=(D)=>D.filter((F,$)=>D.every((J,Q)=>F.value!==J.value||$>=Q||F.type==="generator"||F.type==="asyncGenerator")),tO=({stdioItem:{type:D,value:F,optionName:$},direction:J,fileDescriptors:Q,isSync:Z})=>{let X=Qc(Q,D);if(X.length===0)return;if(Z){Zc({otherStdioItems:X,type:D,value:F,optionName:$,direction:J});return}if(uO.has(D))return eO({otherStdioItems:X,type:D,value:F,optionName:$,direction:J});if(gO.has(D))Yc({otherStdioItems:X,type:D,value:F,optionName:$})},Qc=(D,F)=>D.flatMap(({direction:$,stdioItems:J})=>J.filter((Q)=>Q.type===F).map((Q)=>({...Q,direction:$}))),Zc=({otherStdioItems:D,type:F,value:$,optionName:J,direction:Q})=>{if(XG.has(F))eO({otherStdioItems:D,type:F,value:$,optionName:J,direction:Q})},eO=({otherStdioItems:D,type:F,value:$,optionName:J,direction:Q})=>{let Z=D.filter((Y)=>Xc(Y,$));if(Z.length===0)return;let X=Z.find((Y)=>Y.direction!==Q);return DE(X,J,F),Q==="output"?Z[0].stream:void 0},Xc=({type:D,value:F},$)=>{if(D==="filePath")return F.file===$.file;if(D==="fileUrl")return F.href===$.href;return F===$},Yc=({otherStdioItems:D,type:F,value:$,optionName:J})=>{let Q=D.find(({value:{transform:Z}})=>Z===$.transform);DE(Q,J,F)},DE=(D,F,$)=>{if(D!==void 0)throw TypeError(`The \`${D.optionName}\` and \`${F}\` options must not target ${v1[$]} that is the same.`)};var HJ=(D,F,$,J)=>{let Z=nO(F,$,J).map((Y,q)=>qc({stdioOption:Y,fdNumber:q,options:F,isSync:J})),X=zc({initialFileDescriptors:Z,addProperties:D,options:F,isSync:J});return F.stdio=X.map(({stdioItems:Y})=>Mc(Y)),X},qc=({stdioOption:D,fdNumber:F,options:$,isSync:J})=>{let Q=N$(F),{stdioItems:Z,isStdioArray:X}=Gc({stdioOption:D,fdNumber:F,options:$,optionName:Q}),Y=pO(Z,F,Q),q=Z.map((W)=>aO({stdioItem:W,isStdioArray:X,fdNumber:F,direction:Y,isSync:J})),G=dO(q,Q,Y,$),B=mO(G,Y);return Hc(G,B),{direction:Y,objectMode:B,stdioItems:G}},Gc=({stdioOption:D,fdNumber:F,options:$,optionName:J})=>{let Z=[...(Array.isArray(D)?D:[D]).map((q)=>Bc(q,J)),...rO($,F)],X=sO(Z),Y=X.length>1;return Wc(X,Y,J),Uc(X),{stdioItems:X,isStdioArray:Y}},Bc=(D,F)=>({type:SO(D,F),value:D,optionName:F}),Wc=(D,F,$)=>{if(D.length===0)throw TypeError(`The \`${$}\` option must not be an empty array.`);if(!F)return;for(let{value:J,optionName:Q}of D)if(Kc.has(J))throw Error(`The \`${Q}\` option must not include \`${J}\`.`)},Kc=new Set(["ignore","ipc"]),Uc=(D)=>{for(let F of D)Vc(F)},Vc=({type:D,value:F,optionName:$})=>{if(fO(F))throw TypeError(`The \`${$}: URL\` option must use the \`file:\` scheme.
280
+ `):AO(D),AO=(D)=>{if(typeof D==="string")return D;if(tD(D))return I$(D);return""};var WJ=({command:D,escapedCommand:F,stdio:$,all:J,ipcOutput:Q,options:{cwd:Z},startTime:X})=>wO({command:D,escapedCommand:F,cwd:Z,durationMs:Pq(X),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:$[1],stderr:$[2],all:J,stdio:$,ipcOutput:Q,pipedFrom:[]}),U6=({error:D,command:F,escapedCommand:$,fileDescriptors:J,options:Q,startTime:Z,isSync:X})=>b9({error:D,command:F,escapedCommand:$,startTime:Z,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:J.length}),ipcOutput:[],options:Q,isSync:X}),b9=({error:D,command:F,escapedCommand:$,startTime:J,timedOut:Q,isCanceled:Z,isGracefullyCanceled:X,isMaxBuffer:Y,isForcefullyTerminated:q,exitCode:G,signal:B,stdio:W,all:K,ipcOutput:U,options:{timeoutDuration:V,timeout:H=V,forceKillAfterDelay:z,killSignal:_,cwd:O,maxBuffer:C},isSync:M})=>{let{exitCode:E,signal:A,signalDescription:I}=Vl(G,B),{originalMessage:R,shortMessage:T,message:N}=IO({stdio:W,all:K,ipcOutput:U,originalError:D,signal:A,signalDescription:I,exitCode:E,escapedCommand:$,timedOut:Q,isCanceled:Z,isGracefullyCanceled:X,isMaxBuffer:Y,isForcefullyTerminated:q,forceKillAfterDelay:z,killSignal:_,maxBuffer:C,timeout:H,cwd:O}),j=s_(D,N,M);return Object.assign(j,Ul({error:j,command:F,escapedCommand:$,startTime:J,timedOut:Q,isCanceled:Z,isGracefullyCanceled:X,isMaxBuffer:Y,isForcefullyTerminated:q,exitCode:E,signal:A,signalDescription:I,stdio:W,all:K,ipcOutput:U,cwd:O,originalMessage:R,shortMessage:T})),j},Ul=({error:D,command:F,escapedCommand:$,startTime:J,timedOut:Q,isCanceled:Z,isGracefullyCanceled:X,isMaxBuffer:Y,isForcefullyTerminated:q,exitCode:G,signal:B,signalDescription:W,stdio:K,all:U,ipcOutput:V,cwd:H,originalMessage:z,shortMessage:_})=>wO({shortMessage:_,originalMessage:z,command:F,escapedCommand:$,cwd:H,durationMs:Pq(J),failed:!0,timedOut:Q,isCanceled:Z,isGracefullyCanceled:X,isTerminated:B!==void 0,isMaxBuffer:Y,isForcefullyTerminated:q,exitCode:G,signal:B,signalDescription:W,code:D.cause?.code,stdout:K[1],stderr:K[2],all:U,stdio:K,ipcOutput:V,pipedFrom:[]}),wO=(D)=>Object.fromEntries(Object.entries(D).filter(([,F])=>F!==void 0)),Vl=(D,F)=>{let $=D===null?void 0:D,J=F===null?void 0:F,Q=J===void 0?void 0:g$(F);return{exitCode:$,signal:J,signalDescription:Q}};var NO=(D)=>Number.isFinite(D)?D:0;function Hl(D){return{days:Math.trunc(D/86400000),hours:Math.trunc(D/3600000%24),minutes:Math.trunc(D/60000%60),seconds:Math.trunc(D/1000%60),milliseconds:Math.trunc(D%1000),microseconds:Math.trunc(NO(D*1000)%1000),nanoseconds:Math.trunc(NO(D*1e6)%1000)}}function zl(D){return{days:D/86400000n,hours:D/3600000n%24n,minutes:D/60000n%60n,seconds:D/1000n%60n,milliseconds:D%1000n,microseconds:0n,nanoseconds:0n}}function FG(D){switch(typeof D){case"number":{if(Number.isFinite(D))return Hl(D);break}case"bigint":return zl(D)}throw TypeError("Expected a finite number or bigint")}var Cl=(D)=>D===0||D===0n,_l=(D,F)=>F===1||F===1n?D:`${D}s`,Ml=0.0000001,Ol=24n*60n*60n*1000n;function $G(D,F){let $=typeof D==="bigint";if(!$&&!Number.isFinite(D))throw TypeError("Expected a finite number or bigint");F={...F};let J=D<0?"-":"";if(D=D<0?-D:D,F.colonNotation)F.compact=!1,F.formatSubMilliseconds=!1,F.separateMilliseconds=!1,F.verbose=!1;if(F.compact)F.unitCount=1,F.secondsDecimalDigits=0,F.millisecondsDecimalDigits=0;let Q=[],Z=(B,W)=>{let K=Math.floor(B*10**W+Ml);return(Math.round(K)/10**W).toFixed(W)},X=(B,W,K,U)=>{if((Q.length===0||!F.colonNotation)&&Cl(B)&&!(F.colonNotation&&K==="m"))return;if(U??=String(B),F.colonNotation){let V=U.includes(".")?U.split(".")[0].length:U.length,H=Q.length>0?2:1;U="0".repeat(Math.max(0,H-V))+U}else U+=F.verbose?" "+_l(W,B):K;Q.push(U)},Y=FG(D),q=BigInt(Y.days);if(F.hideYearAndDays)X(BigInt(q)*24n+BigInt(Y.hours),"hour","h");else{if(F.hideYear)X(q,"day","d");else X(q/365n,"year","y"),X(q%365n,"day","d");X(Number(Y.hours),"hour","h")}if(X(Number(Y.minutes),"minute","m"),!F.hideSeconds)if(F.separateMilliseconds||F.formatSubMilliseconds||!F.colonNotation&&D<1000&&!F.subSecondsAsDecimals){let B=Number(Y.seconds),W=Number(Y.milliseconds),K=Number(Y.microseconds),U=Number(Y.nanoseconds);if(X(B,"second","s"),F.formatSubMilliseconds)X(W,"millisecond","ms"),X(K,"microsecond","µs"),X(U,"nanosecond","ns");else{let V=W+K/1000+U/1e6,H=typeof F.millisecondsDecimalDigits==="number"?F.millisecondsDecimalDigits:0,z=V>=1?Math.round(V):Math.ceil(V),_=H?V.toFixed(H):z;X(Number.parseFloat(_),"millisecond","ms",_)}}else{let B=($?Number(D%Ol):D)/1000%60,W=typeof F.secondsDecimalDigits==="number"?F.secondsDecimalDigits:1,K=Z(B,W),U=F.keepDecimalsOnWholeSeconds?K:K.replace(/\.0+$/,"");X(Number.parseFloat(U),"second","s",U)}if(Q.length===0)return J+"0"+(F.verbose?" milliseconds":"ms");let G=F.colonNotation?":":" ";if(typeof F.unitCount==="number")Q=Q.slice(0,Math.max(F.unitCount,1));return J+Q.join(G)}var TO=(D,F)=>{if(D.failed)G8({type:"error",verboseMessage:D.shortMessage,verboseInfo:F,result:D})};var LO=(D,F)=>{if(!Q6(F))return;TO(D,F),El(D,F)},El=(D,F)=>{let $=`(done in ${$G(D.durationMs)})`;G8({type:"duration",verboseMessage:$,verboseInfo:F,result:D})};var V6=(D,F,{reject:$})=>{if(LO(D,F),D.failed&&$)throw D;return D};import{readFileSync as FE}from"node:fs";var SO=(D,F)=>{if(hF(D))return"asyncGenerator";if(yO(D))return"generator";if(KJ(D))return"fileUrl";if(Nl(D))return"filePath";if(Pl(D))return"webStream";if(u2(D,{checkOpen:!1}))return"native";if(tD(D))return"uint8Array";if(jl(D))return"asyncIterable";if(Sl(D))return"iterable";if(ZG(D))return xO({transform:D},F);if(wl(D))return Rl(D,F);return"native"},Rl=(D,F)=>{if(tq(D.transform,{checkOpen:!1}))return Al(D,F);if(ZG(D.transform))return xO(D,F);return Il(D,F)},Al=(D,F)=>{return kO(D,F,"Duplex stream"),"duplex"},xO=(D,F)=>{return kO(D,F,"web TransformStream"),"webTransform"},kO=({final:D,binary:F,objectMode:$},J,Q)=>{PO(D,`${J}.final`,Q),PO(F,`${J}.binary`,Q),JG($,`${J}.objectMode`)},PO=(D,F,$)=>{if(D!==void 0)throw TypeError(`The \`${F}\` option can only be defined when using a generator, not a ${$}.`)},Il=({transform:D,final:F,binary:$,objectMode:J},Q)=>{if(D!==void 0&&!jO(D))throw TypeError(`The \`${Q}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(tq(F,{checkOpen:!1}))throw TypeError(`The \`${Q}.final\` option must not be a Duplex stream.`);if(ZG(F))throw TypeError(`The \`${Q}.final\` option must not be a web TransformStream.`);if(F!==void 0&&!jO(F))throw TypeError(`The \`${Q}.final\` option must be a generator.`);return JG($,`${Q}.binary`),JG(J,`${Q}.objectMode`),hF(D)||hF(F)?"asyncGenerator":"generator"},JG=(D,F)=>{if(D!==void 0&&typeof D!=="boolean")throw TypeError(`The \`${F}\` option must use a boolean.`)},jO=(D)=>hF(D)||yO(D),hF=(D)=>Object.prototype.toString.call(D)==="[object AsyncGeneratorFunction]",yO=(D)=>Object.prototype.toString.call(D)==="[object GeneratorFunction]",wl=(D)=>mD(D)&&(D.transform!==void 0||D.final!==void 0),KJ=(D)=>Object.prototype.toString.call(D)==="[object URL]",fO=(D)=>KJ(D)&&D.protocol!=="file:",Nl=(D)=>mD(D)&&Object.keys(D).length>0&&Object.keys(D).every((F)=>Tl.has(F))&&QG(D.file),Tl=new Set(["file","append"]),QG=(D)=>typeof D==="string",bO=(D,F)=>D==="native"&&typeof F==="string"&&!Ll.has(F),Ll=new Set(["ipc","ignore","inherit","overlapped","pipe"]),vO=(D)=>Object.prototype.toString.call(D)==="[object ReadableStream]",UJ=(D)=>Object.prototype.toString.call(D)==="[object WritableStream]",Pl=(D)=>vO(D)||UJ(D),ZG=(D)=>vO(D?.readable)&&UJ(D?.writable),jl=(D)=>hO(D)&&typeof D[Symbol.asyncIterator]==="function",Sl=(D)=>hO(D)&&typeof D[Symbol.iterator]==="function",hO=(D)=>typeof D==="object"&&D!==null,C2=new Set(["generator","asyncGenerator","duplex","webTransform"]),VJ=new Set(["fileUrl","filePath","fileNumber"]),XG=new Set(["fileUrl","filePath"]),uO=new Set([...XG,"webStream","nodeStream"]),gO=new Set(["webTransform","duplex"]),v1={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"};var YG=(D,F,$,J)=>J==="output"?xl(D,F,$):kl(D,F,$),xl=(D,F,$)=>{let J=F!==0&&$[F-1].value.readableObjectMode;return{writableObjectMode:J,readableObjectMode:D??J}},kl=(D,F,$)=>{let J=F===0?D===!0:$[F-1].value.readableObjectMode,Q=F!==$.length-1&&(D??J);return{writableObjectMode:J,readableObjectMode:Q}},mO=(D,F)=>{let $=D.findLast(({type:J})=>C2.has(J));if($===void 0)return!1;return F==="input"?$.value.writableObjectMode:$.value.readableObjectMode};var dO=(D,F,$,J)=>[...D.filter(({type:Q})=>!C2.has(Q)),...yl(D,F,$,J)],yl=(D,F,$,{encoding:J})=>{let Q=D.filter(({type:X})=>C2.has(X)),Z=Array.from({length:Q.length});for(let[X,Y]of Object.entries(Q))Z[X]=fl({stdioItem:Y,index:Number(X),newTransforms:Z,optionName:F,direction:$,encoding:J});return ul(Z,$)},fl=({stdioItem:D,stdioItem:{type:F},index:$,newTransforms:J,optionName:Q,direction:Z,encoding:X})=>{if(F==="duplex")return bl({stdioItem:D,optionName:Q});if(F==="webTransform")return vl({stdioItem:D,index:$,newTransforms:J,direction:Z});return hl({stdioItem:D,index:$,newTransforms:J,direction:Z,encoding:X})},bl=({stdioItem:D,stdioItem:{value:{transform:F,transform:{writableObjectMode:$,readableObjectMode:J},objectMode:Q=J}},optionName:Z})=>{if(Q&&!J)throw TypeError(`The \`${Z}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!Q&&J)throw TypeError(`The \`${Z}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...D,value:{transform:F,writableObjectMode:$,readableObjectMode:J}}},vl=({stdioItem:D,stdioItem:{value:F},index:$,newTransforms:J,direction:Q})=>{let{transform:Z,objectMode:X}=mD(F)?F:{transform:F},{writableObjectMode:Y,readableObjectMode:q}=YG(X,$,J,Q);return{...D,value:{transform:Z,writableObjectMode:Y,readableObjectMode:q}}},hl=({stdioItem:D,stdioItem:{value:F},index:$,newTransforms:J,direction:Q,encoding:Z})=>{let{transform:X,final:Y,binary:q=!1,preserveNewlines:G=!1,objectMode:B}=mD(F)?F:{transform:F},W=q||X2.has(Z),{writableObjectMode:K,readableObjectMode:U}=YG(B,$,J,Q);return{...D,value:{transform:X,final:Y,binary:W,preserveNewlines:G,writableObjectMode:K,readableObjectMode:U}}},ul=(D,F)=>F==="input"?D.reverse():D;import qG from"node:process";var pO=(D,F,$)=>{let J=D.map((Q)=>gl(Q,F));if(J.includes("input")&&J.includes("output"))throw TypeError(`The \`${$}\` option must not be an array of both readable and writable values.`);return J.find(Boolean)??pl},gl=({type:D,value:F},$)=>ml[$]??lO[D](F),ml=["input","output","output"],H6=()=>{return},GG=()=>"input",lO={generator:H6,asyncGenerator:H6,fileUrl:H6,filePath:H6,iterable:GG,asyncIterable:GG,uint8Array:GG,webStream:(D)=>UJ(D)?"output":"input",nodeStream(D){if(!vF(D,{checkOpen:!1}))return"output";return sq(D,{checkOpen:!1})?void 0:"input"},webTransform:H6,duplex:H6,native(D){let F=dl(D);if(F!==void 0)return F;if(u2(D,{checkOpen:!1}))return lO.nodeStream(D)}},dl=(D)=>{if([0,qG.stdin].includes(D))return"input";if([1,2,qG.stdout,qG.stderr].includes(D))return"output"},pl="output";var cO=(D,F)=>F&&!D.includes("ipc")?[...D,"ipc"]:D;var nO=({stdio:D,ipc:F,buffer:$,...J},Q,Z)=>{let X=ll(D,J).map((Y,q)=>iO(Y,q));return Z?nl(X,$,Q):cO(X,F)},ll=(D,F)=>{if(D===void 0)return z2.map((J)=>F[J]);if(cl(F))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${z2.map((J)=>`\`${J}\``).join(", ")}`);if(typeof D==="string")return[D,D,D];if(!Array.isArray(D))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof D}\``);let $=Math.max(D.length,z2.length);return Array.from({length:$},(J,Q)=>D[Q])},cl=(D)=>z2.some((F)=>D[F]!==void 0),iO=(D,F)=>{if(Array.isArray(D))return D.map(($)=>iO($,F));if(D===null||D===void 0)return F>=z2.length?"ignore":"pipe";return D},nl=(D,F,$)=>D.map((J,Q)=>!F[Q]&&Q!==0&&!Z6($,Q)&&il(J)?"ignore":J),il=(D)=>D==="pipe"||Array.isArray(D)&&D.every((F)=>F==="pipe");import{readFileSync as ol}from"node:fs";import al from"node:tty";var aO=({stdioItem:D,stdioItem:{type:F},isStdioArray:$,fdNumber:J,direction:Q,isSync:Z})=>{if(!$||F!=="native")return D;return Z?rl({stdioItem:D,fdNumber:J,direction:Q}):el({stdioItem:D,fdNumber:J})},rl=({stdioItem:D,stdioItem:{value:F,optionName:$},fdNumber:J,direction:Q})=>{let Z=sl({value:F,optionName:$,fdNumber:J,direction:Q});if(Z!==void 0)return Z;if(u2(F,{checkOpen:!1}))throw TypeError(`The \`${$}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return D},sl=({value:D,optionName:F,fdNumber:$,direction:J})=>{let Q=tl(D,$);if(Q===void 0)return;if(J==="output")return{type:"fileNumber",value:Q,optionName:F};if(al.isatty(Q))throw TypeError(`The \`${F}: ${p$(D)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:o8(ol(Q)),optionName:F}},tl=(D,F)=>{if(D==="inherit")return F;if(typeof D==="number")return D;let $=w$.indexOf(D);if($!==-1)return $},el=({stdioItem:D,stdioItem:{value:F,optionName:$},fdNumber:J})=>{if(F==="inherit")return{type:"nodeStream",value:oO(J,F,$),optionName:$};if(typeof F==="number")return{type:"nodeStream",value:oO(F,F,$),optionName:$};if(u2(F,{checkOpen:!1}))return{type:"nodeStream",value:F,optionName:$};return D},oO=(D,F,$)=>{let J=w$[D];if(J===void 0)throw TypeError(`The \`${$}: ${F}\` option is invalid: no such standard stream.`);return J};var rO=({input:D,inputFile:F},$)=>$===0?[...Dc(D),...$c(F)]:[],Dc=(D)=>D===void 0?[]:[{type:Fc(D),value:D,optionName:"input"}],Fc=(D)=>{if(vF(D,{checkOpen:!1}))return"nodeStream";if(typeof D==="string")return"string";if(tD(D))return"uint8Array";throw Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},$c=(D)=>D===void 0?[]:[{...Jc(D),optionName:"inputFile"}],Jc=(D)=>{if(KJ(D))return{type:"fileUrl",value:D};if(QG(D))return{type:"filePath",value:{file:D}};throw Error("The `inputFile` option must be a file path string or a file URL.")};var sO=(D)=>D.filter((F,$)=>D.every((J,Q)=>F.value!==J.value||$>=Q||F.type==="generator"||F.type==="asyncGenerator")),tO=({stdioItem:{type:D,value:F,optionName:$},direction:J,fileDescriptors:Q,isSync:Z})=>{let X=Qc(Q,D);if(X.length===0)return;if(Z){Zc({otherStdioItems:X,type:D,value:F,optionName:$,direction:J});return}if(uO.has(D))return eO({otherStdioItems:X,type:D,value:F,optionName:$,direction:J});if(gO.has(D))Yc({otherStdioItems:X,type:D,value:F,optionName:$})},Qc=(D,F)=>D.flatMap(({direction:$,stdioItems:J})=>J.filter((Q)=>Q.type===F).map((Q)=>({...Q,direction:$}))),Zc=({otherStdioItems:D,type:F,value:$,optionName:J,direction:Q})=>{if(XG.has(F))eO({otherStdioItems:D,type:F,value:$,optionName:J,direction:Q})},eO=({otherStdioItems:D,type:F,value:$,optionName:J,direction:Q})=>{let Z=D.filter((Y)=>Xc(Y,$));if(Z.length===0)return;let X=Z.find((Y)=>Y.direction!==Q);return DE(X,J,F),Q==="output"?Z[0].stream:void 0},Xc=({type:D,value:F},$)=>{if(D==="filePath")return F.file===$.file;if(D==="fileUrl")return F.href===$.href;return F===$},Yc=({otherStdioItems:D,type:F,value:$,optionName:J})=>{let Q=D.find(({value:{transform:Z}})=>Z===$.transform);DE(Q,J,F)},DE=(D,F,$)=>{if(D!==void 0)throw TypeError(`The \`${D.optionName}\` and \`${F}\` options must not target ${v1[$]} that is the same.`)};var HJ=(D,F,$,J)=>{let Z=nO(F,$,J).map((Y,q)=>qc({stdioOption:Y,fdNumber:q,options:F,isSync:J})),X=zc({initialFileDescriptors:Z,addProperties:D,options:F,isSync:J});return F.stdio=X.map(({stdioItems:Y})=>Mc(Y)),X},qc=({stdioOption:D,fdNumber:F,options:$,isSync:J})=>{let Q=N$(F),{stdioItems:Z,isStdioArray:X}=Gc({stdioOption:D,fdNumber:F,options:$,optionName:Q}),Y=pO(Z,F,Q),q=Z.map((W)=>aO({stdioItem:W,isStdioArray:X,fdNumber:F,direction:Y,isSync:J})),G=dO(q,Q,Y,$),B=mO(G,Y);return Hc(G,B),{direction:Y,objectMode:B,stdioItems:G}},Gc=({stdioOption:D,fdNumber:F,options:$,optionName:J})=>{let Z=[...(Array.isArray(D)?D:[D]).map((q)=>Bc(q,J)),...rO($,F)],X=sO(Z),Y=X.length>1;return Wc(X,Y,J),Uc(X),{stdioItems:X,isStdioArray:Y}},Bc=(D,F)=>({type:SO(D,F),value:D,optionName:F}),Wc=(D,F,$)=>{if(D.length===0)throw TypeError(`The \`${$}\` option must not be an empty array.`);if(!F)return;for(let{value:J,optionName:Q}of D)if(Kc.has(J))throw Error(`The \`${Q}\` option must not include \`${J}\`.`)},Kc=new Set(["ignore","ipc"]),Uc=(D)=>{for(let F of D)Vc(F)},Vc=({type:D,value:F,optionName:$})=>{if(fO(F))throw TypeError(`The \`${$}: URL\` option must use the \`file:\` scheme.
281
281
  For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(bO(D,F))throw TypeError(`The \`${$}: { file: '...' }\` option must be used instead of \`${$}: '...'\`.`)},Hc=(D,F)=>{if(!F)return;let $=D.find(({type:J})=>VJ.has(J));if($!==void 0)throw TypeError(`The \`${$.optionName}\` option cannot use both files and transforms in objectMode.`)},zc=({initialFileDescriptors:D,addProperties:F,options:$,isSync:J})=>{let Q=[];try{for(let Z of D)Q.push(Cc({fileDescriptor:Z,fileDescriptors:Q,addProperties:F,options:$,isSync:J}));return Q}catch(Z){throw BG(Q),Z}},Cc=({fileDescriptor:{direction:D,objectMode:F,stdioItems:$},fileDescriptors:J,addProperties:Q,options:Z,isSync:X})=>{let Y=$.map((q)=>_c({stdioItem:q,addProperties:Q,direction:D,options:Z,fileDescriptors:J,isSync:X}));return{direction:D,objectMode:F,stdioItems:Y}},_c=({stdioItem:D,addProperties:F,direction:$,options:J,fileDescriptors:Q,isSync:Z})=>{let X=tO({stdioItem:D,direction:$,fileDescriptors:Q,isSync:Z});if(X!==void 0)return{...D,stream:X};return{...D,...F[$][D.type](D,J)}},BG=(D)=>{for(let{stdioItems:F}of D)for(let{stream:$}of F)if($!==void 0&&!v2($))$.destroy()},Mc=(D)=>{if(D.length>1)return D.some(({value:J})=>J==="overlapped")?"overlapped":"pipe";let[{type:F,value:$}]=D;return F==="native"?$:"pipe"};var JE=(D,F)=>HJ(Ec,D,F,!0),U8=({type:D,optionName:F})=>{QE(F,v1[D])},Oc=({optionName:D,value:F})=>{if(F==="ipc"||F==="overlapped")QE(D,`"${F}"`);return{}},QE=(D,F)=>{throw TypeError(`The \`${D}\` option cannot be ${F} with synchronous methods.`)},$E={generator(){},asyncGenerator:U8,webStream:U8,nodeStream:U8,webTransform:U8,duplex:U8,asyncIterable:U8,native:Oc},Ec={input:{...$E,fileUrl:({value:D})=>({contents:[o8(FE(D))]}),filePath:({value:{file:D}})=>({contents:[o8(FE(D))]}),fileNumber:U8,iterable:({value:D})=>({contents:[...D]}),string:({value:D})=>({contents:[D]}),uint8Array:({value:D})=>({contents:[D]})},output:{...$E,fileUrl:({value:D})=>({path:D}),filePath:({value:{file:D,append:F}})=>({path:D,append:F}),fileNumber:({value:D})=>({path:D}),iterable:U8,string:U8,uint8Array:U8}};var t8=(D,{stripFinalNewline:F},$)=>WG(F,$)&&D!==void 0&&!Array.isArray(D)?W6(D):D,WG=(D,F)=>F==="all"?D[1]||D[2]:D[F];import{Transform as dc,getDefaultHighWaterMark as HE}from"node:stream";var zJ=(D,F,$,J)=>D||$?void 0:XE(F,J),UG=(D,F,$)=>$?D.flatMap((J)=>ZE(J,F)):ZE(D,F),ZE=(D,F)=>{let{transform:$,final:J}=XE(F,{});return[...$(D),...J()]},XE=(D,F)=>{return F.previousChunks="",{transform:Rc.bind(void 0,F,D),final:Ic.bind(void 0,F)}},Rc=function*(D,F,$){if(typeof $!=="string"){yield $;return}let{previousChunks:J}=D,Q=-1;for(let Z=0;Z<$.length;Z+=1)if($[Z]===`
282
282
  `){let X=Ac($,Z,F,D),Y=$.slice(Q+1,Z+1-X);if(J.length>0)Y=KG(J,Y),J="";yield Y,Q=Z}if(Q!==$.length-1)J=KG(J,$.slice(Q+1));D.previousChunks=J},Ac=(D,F,$,J)=>{if($)return 0;return J.isWindowsNewline=F!==0&&D[F-1]==="\r",J.isWindowsNewline?2:1},Ic=function*({previousChunks:D}){if(D.length>0)yield D},YE=({binary:D,preserveNewlines:F,readableObjectMode:$,state:J})=>D||F||$?void 0:{transform:wc.bind(void 0,J)},wc=function*({isWindowsNewline:D=!1},F){let{unixNewline:$,windowsNewline:J,LF:Q,concatBytes:Z}=typeof F==="string"?Nc:Lc;if(F.at(-1)===Q){yield F;return}yield Z(F,D?J:$)},KG=(D,F)=>`${D}${F}`,Nc={windowsNewline:`\r
283
283
  `,unixNewline:`
284
284
  `,LF:`
285
285
  `,concatBytes:KG},Tc=(D,F)=>{let $=new Uint8Array(D.length+F.length);return $.set(D,0),$.set(F,D.length),$},Lc={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:Tc};import{Buffer as Pc}from"node:buffer";var qE=(D,F)=>D?void 0:jc.bind(void 0,F),jc=function*(D,F){if(typeof F!=="string"&&!tD(F)&&!Pc.isBuffer(F))throw TypeError(`The \`${D}\` option's transform must use "objectMode: true" to receive as input: ${typeof F}.`);yield F},GE=(D,F)=>D?Sc.bind(void 0,F):xc.bind(void 0,F),Sc=function*(D,F){BE(D,F),yield F},xc=function*(D,F){if(BE(D,F),typeof F!=="string"&&!tD(F))throw TypeError(`The \`${D}\` option's function must yield a string or an Uint8Array, not ${typeof F}.`);yield F},BE=(D,F)=>{if(F===null||F===void 0)throw TypeError(`The \`${D}\` option's function must not call \`yield ${F}\`.
286
286
  Instead, \`yield\` should either be called with a value, or not be called at all. For example:
287
- if (condition) { yield value; }`)};import{Buffer as kc}from"node:buffer";import{StringDecoder as yc}from"node:string_decoder";var CJ=(D,F,$)=>{if($)return;if(D)return{transform:fc.bind(void 0,new TextEncoder)};let J=new yc(F);return{transform:bc.bind(void 0,J),final:vc.bind(void 0,J)}},fc=function*(D,F){if(kc.isBuffer(F))yield o8(F);else if(typeof F==="string")yield D.encode(F);else yield F},bc=function*(D,F){yield tD(F)?D.write(F):F},vc=function*(D){let F=D.end();if(F!=="")yield F};import{callbackify as WE}from"node:util";var VG=WE(async(D,F,$,J)=>{F.currentIterable=D(...$);try{for await(let Q of F.currentIterable)J.push(Q)}finally{delete F.currentIterable}}),_J=async function*(D,F,$){if($===F.length){yield D;return}let{transform:J=uc}=F[$];for await(let Q of J(D))yield*_J(Q,F,$+1)},KE=async function*(D){for(let[F,{final:$}]of Object.entries(D))yield*hc($,Number(F),D)},hc=async function*(D,F,$){if(D===void 0)return;for await(let J of D())yield*_J(J,$,F+1)},UE=WE(async({currentIterable:D},F)=>{if(D!==void 0){await(F?D.throw(F):D.return());return}if(F)throw F}),uc=function*(D){yield D};var HG=(D,F,$,J)=>{try{for(let Q of D(...F))$.push(Q);J()}catch(Q){J(Q)}},VE=(D,F)=>[...F.flatMap(($)=>[...uF($,D,0)]),...v9(D)],uF=function*(D,F,$){if($===F.length){yield D;return}let{transform:J=mc}=F[$];for(let Q of J(D))yield*uF(Q,F,$+1)},v9=function*(D){for(let[F,{final:$}]of Object.entries(D))yield*gc($,Number(F),D)},gc=function*(D,F,$){if(D===void 0)return;for(let J of D())yield*uF(J,$,F+1)},mc=function*(D){yield D};var zG=({value:D,value:{transform:F,final:$,writableObjectMode:J,readableObjectMode:Q},optionName:Z},{encoding:X})=>{let Y={},q=zE(D,X,Z),G=hF(F),B=hF($),W=G?VG.bind(void 0,_J,Y):HG.bind(void 0,uF),K=G||B?VG.bind(void 0,KE,Y):HG.bind(void 0,v9),U=G||B?UE.bind(void 0,Y):void 0;return{stream:new dc({writableObjectMode:J,writableHighWaterMark:HE(J),readableObjectMode:Q,readableHighWaterMark:HE(Q),transform(H,z,_){W([H,q,0],this,_)},flush(H){K([q],this,H)},destroy:U})}},MJ=(D,F,$,J)=>{let Q=F.filter(({type:X})=>X==="generator"),Z=J?Q.reverse():Q;for(let{value:X,optionName:Y}of Z){let q=zE(X,$,Y);D=VE(q,D)}return D},zE=({transform:D,final:F,binary:$,writableObjectMode:J,readableObjectMode:Q,preserveNewlines:Z},X,Y)=>{let q={};return[{transform:qE(J,Y)},CJ($,X,J),zJ($,Z,J,q),{transform:D,final:F},{transform:GE(Q,Y)},YE({binary:$,preserveNewlines:Z,readableObjectMode:Q,state:q})].filter(Boolean)};var CE=(D,F)=>{for(let $ of pc(D))lc(D,$,F)},pc=(D)=>new Set(Object.entries(D).filter(([,{direction:F}])=>F==="input").map(([F])=>Number(F))),lc=(D,F,$)=>{let{stdioItems:J}=D[F],Q=J.filter(({contents:Y})=>Y!==void 0);if(Q.length===0)return;if(F!==0){let[{type:Y,optionName:q}]=Q;throw TypeError(`Only the \`stdin\` option, not \`${q}\`, can be ${v1[Y]} with synchronous methods.`)}let X=Q.map(({contents:Y})=>Y).map((Y)=>cc(Y,J));$.input=L9(X)},cc=(D,F)=>{let $=MJ(D,F,"utf8",!0);return nc($),L9($)},nc=(D)=>{let F=D.find(($)=>typeof $!=="string"&&!tD($));if(F!==void 0)throw TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${F}.`)};import{writeFileSync as rc,appendFileSync as sc}from"node:fs";var OJ=({stdioItems:D,encoding:F,verboseInfo:$,fdNumber:J})=>J!=="all"&&Z6($,J)&&!X2.has(F)&&ic(J)&&(D.some(({type:Q,value:Z})=>Q==="native"&&oc.has(Z))||D.every(({type:Q})=>C2.has(Q))),ic=(D)=>D===1||D===2,oc=new Set(["pipe","overlapped"]),_E=async(D,F,$,J)=>{for await(let Q of D)if(!ac(F))OE(Q,$,J)},ME=(D,F,$)=>{for(let J of D)OE(J,F,$)},ac=(D)=>D._readableState.pipes.length>0,OE=(D,F,$)=>{let J=x$(D);G8({type:"output",verboseMessage:J,fdNumber:F,verboseInfo:$})};var EE=({fileDescriptors:D,syncResult:{output:F},options:$,isMaxBuffer:J,verboseInfo:Q})=>{if(F===null)return{output:Array.from({length:3})};let Z={},X=new Set([]);return{output:F.map((q,G)=>tc({result:q,fileDescriptors:D,fdNumber:G,state:Z,outputFiles:X,isMaxBuffer:J,verboseInfo:Q},$)),...Z}},tc=({result:D,fileDescriptors:F,fdNumber:$,state:J,outputFiles:Q,isMaxBuffer:Z,verboseInfo:X},{buffer:Y,encoding:q,lines:G,stripFinalNewline:B,maxBuffer:W})=>{if(D===null)return;let K=RO(D,Z,W),U=o8(K),{stdioItems:V,objectMode:H}=F[$],z=ec([U],V,q,J),{serializedResult:_,finalResult:O=_}=Dn({chunks:z,objectMode:H,encoding:q,lines:G,stripFinalNewline:B,fdNumber:$});Fn({serializedResult:_,fdNumber:$,state:J,verboseInfo:X,encoding:q,stdioItems:V,objectMode:H});let C=Y[$]?O:void 0;try{if(J.error===void 0)$n(_,V,Q);return C}catch(M){return J.error=M,C}},ec=(D,F,$,J)=>{try{return MJ(D,F,$,!1)}catch(Q){return J.error=Q,D}},Dn=({chunks:D,objectMode:F,encoding:$,lines:J,stripFinalNewline:Q,fdNumber:Z})=>{if(F)return{serializedResult:D};if($==="buffer")return{serializedResult:L9(D)};let X=xC(D,$);if(J[Z])return{serializedResult:X,finalResult:UG(X,!Q[Z],F)};return{serializedResult:X}},Fn=({serializedResult:D,fdNumber:F,state:$,verboseInfo:J,encoding:Q,stdioItems:Z,objectMode:X})=>{if(!OJ({stdioItems:Z,encoding:Q,verboseInfo:J,fdNumber:F}))return;let Y=UG(D,!1,X);try{ME(Y,F,J)}catch(q){$.error??=q}},$n=(D,F,$)=>{for(let{path:J,append:Q}of F.filter(({type:Z})=>VJ.has(Z))){let Z=typeof J==="string"?J:J.toString();if(Q||$.has(Z))sc(J,D);else $.add(Z),rc(J,D)}};var RE=([,D,F],$)=>{if(!$.all)return;if(D===void 0)return F;if(F===void 0)return D;if(Array.isArray(D))return Array.isArray(F)?[...D,...F]:[...D,t8(F,$,"all")];if(Array.isArray(F))return[t8(D,$,"all"),...F];if(tD(D)&&tD(F))return Aq([D,F]);return`${D}${F}`};import{once as CG}from"node:events";var AE=async(D,F)=>{let[$,J]=await Jn(D);return F.isForcefullyTerminated??=!1,[$,J]},Jn=async(D)=>{let[F,$]=await Promise.allSettled([CG(D,"spawn"),CG(D,"exit")]);if(F.status==="rejected")return[];return $.status==="rejected"?IE(D):$.value},IE=async(D)=>{try{return await CG(D,"exit")}catch{return IE(D)}},wE=async(D)=>{let[F,$]=await D;if(!Qn(F,$)&&_G(F,$))throw new B8;return[F,$]},Qn=(D,F)=>D===void 0&&F===void 0,_G=(D,F)=>D!==0||F!==null;var NE=({error:D,status:F,signal:$,output:J},{maxBuffer:Q})=>{let Z=Zn(D,F,$),X=Z?.code==="ETIMEDOUT",Y=EO(Z,J,Q);return{resultError:Z,exitCode:F,signal:$,timedOut:X,isMaxBuffer:Y}},Zn=(D,F,$)=>{if(D!==void 0)return D;return _G(F,$)?new B8:void 0};var TE=(D,F,$)=>{let{file:J,commandArguments:Q,command:Z,escapedCommand:X,startTime:Y,verboseInfo:q,options:G,fileDescriptors:B}=Yn(D,F,$),W=Bn({file:J,commandArguments:Q,options:G,command:Z,escapedCommand:X,verboseInfo:q,fileDescriptors:B,startTime:Y});return V6(W,q,G)},Yn=(D,F,$)=>{let{command:J,escapedCommand:Q,startTime:Z,verboseInfo:X}=y$(D,F,$),Y=qn($),{file:q,commandArguments:G,options:B}=FJ(D,F,Y);Gn(B);let W=JE(B,X);return{file:q,commandArguments:G,command:J,escapedCommand:Q,startTime:Z,verboseInfo:X,options:B,fileDescriptors:W}},qn=(D)=>D.node&&!D.ipc?{...D,ipc:!1}:D,Gn=({ipc:D,ipcInput:F,detached:$,cancelSignal:J})=>{if(F)EJ("ipcInput");if(D)EJ("ipc: true");if($)EJ("detached: true");if(J)EJ("cancelSignal")},EJ=(D)=>{throw TypeError(`The "${D}" option cannot be used with synchronous methods.`)},Bn=({file:D,commandArguments:F,options:$,command:J,escapedCommand:Q,verboseInfo:Z,fileDescriptors:X,startTime:Y})=>{let q=Wn({file:D,commandArguments:F,options:$,command:J,escapedCommand:Q,fileDescriptors:X,startTime:Y});if(q.failed)return q;let{resultError:G,exitCode:B,signal:W,timedOut:K,isMaxBuffer:U}=NE(q,$),{output:V,error:H=G}=EE({fileDescriptors:X,syncResult:q,options:$,isMaxBuffer:U,verboseInfo:Z}),z=V.map((O,C)=>t8(O,$,C)),_=t8(RE(V,$),$,"all");return Un({error:H,exitCode:B,signal:W,timedOut:K,isMaxBuffer:U,stdio:z,all:_,options:$,command:J,escapedCommand:Q,startTime:Y})},Wn=({file:D,commandArguments:F,options:$,command:J,escapedCommand:Q,fileDescriptors:Z,startTime:X})=>{try{CE(Z,$);let Y=Kn($);return Xn(...$J(D,F,Y))}catch(Y){return U6({error:Y,command:J,escapedCommand:Q,fileDescriptors:Z,options:$,startTime:X,isSync:!0})}},Kn=({encoding:D,maxBuffer:F,...$})=>({...$,encoding:"buffer",maxBuffer:BJ(F)}),Un=({error:D,exitCode:F,signal:$,timedOut:J,isMaxBuffer:Q,stdio:Z,all:X,options:Y,command:q,escapedCommand:G,startTime:B})=>D===void 0?WJ({command:q,escapedCommand:G,stdio:Z,all:X,ipcOutput:[],options:Y,startTime:B}):b9({error:D,command:q,escapedCommand:G,timedOut:J,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:Q,isForcefullyTerminated:!1,exitCode:F,signal:$,stdio:Z,all:X,ipcOutput:[],options:Y,startTime:B,isSync:!0});import{setMaxListeners as Fo}from"node:events";import{spawn as $o}from"node:child_process";import xE from"node:process";import{once as MG,on as Vn}from"node:events";var LE=({anyProcess:D,channel:F,isSubprocess:$,ipc:J},{reference:Q=!0,filter:Z}={})=>{return q6({methodName:"getOneMessage",isSubprocess:$,ipc:J,isConnected:a$(D)}),Hn({anyProcess:D,channel:F,isSubprocess:$,filter:Z,reference:Q})},Hn=async({anyProcess:D,channel:F,isSubprocess:$,filter:J,reference:Q})=>{c$(F,Q);let Z=b1(D,F,$),X=new AbortController;try{return await Promise.race([zn(Z,J,X),Cn(Z,$,X),_n(Z,$,X)])}catch(Y){throw G6(D),Y}finally{X.abort(),n$(F,Q)}},zn=async(D,F,{signal:$})=>{if(F===void 0){let[J]=await MG(D,"message",{signal:$});return J}for await(let[J]of Vn(D,"message",{signal:$}))if(F(J))return J},Cn=async(D,F,{signal:$})=>{await MG(D,"disconnect",{signal:$}),UM(F)},_n=async(D,F,{signal:$})=>{let[J]=await MG(D,"strict:error",{signal:$});throw d$(J,F)};import{once as jE,on as Mn}from"node:events";var SE=({anyProcess:D,channel:F,isSubprocess:$,ipc:J},{reference:Q=!0}={})=>OG({anyProcess:D,channel:F,isSubprocess:$,ipc:J,shouldAwait:!$,reference:Q}),OG=({anyProcess:D,channel:F,isSubprocess:$,ipc:J,shouldAwait:Q,reference:Z})=>{q6({methodName:"getEachMessage",isSubprocess:$,ipc:J,isConnected:a$(D)}),c$(F,Z);let X=b1(D,F,$),Y=new AbortController,q={};return On(D,X,Y),En({ipcEmitter:X,isSubprocess:$,controller:Y,state:q}),Rn({anyProcess:D,channel:F,ipcEmitter:X,isSubprocess:$,shouldAwait:Q,controller:Y,state:q,reference:Z})},On=async(D,F,$)=>{try{await jE(F,"disconnect",{signal:$.signal}),$.abort()}catch{}},En=async({ipcEmitter:D,isSubprocess:F,controller:$,state:J})=>{try{let[Q]=await jE(D,"strict:error",{signal:$.signal});J.error=d$(Q,F),$.abort()}catch{}},Rn=async function*({anyProcess:D,channel:F,ipcEmitter:$,isSubprocess:J,shouldAwait:Q,controller:Z,state:X,reference:Y}){try{for await(let[q]of Mn($,"message",{signal:Z.signal}))PE(X),yield q}catch{PE(X)}finally{if(Z.abort(),n$(F,Y),!J)G6(D);if(Q)await D}},PE=({error:D})=>{if(D)throw D};var kE=(D,{ipc:F})=>{Object.assign(D,fE(D,!1,F))},yE=()=>{let D=xE,F=!0,$=xE.channel!==void 0;return{...fE(D,!0,$),getCancelSignal:gM.bind(void 0,{anyProcess:D,channel:D.channel,isSubprocess:!0,ipc:$})}},fE=(D,F,$)=>({sendMessage:e$.bind(void 0,{anyProcess:D,channel:D.channel,isSubprocess:F,ipc:$}),getOneMessage:LE.bind(void 0,{anyProcess:D,channel:D.channel,isSubprocess:F,ipc:$}),getEachMessage:SE.bind(void 0,{anyProcess:D,channel:D.channel,isSubprocess:F,ipc:$})});import{ChildProcess as An}from"node:child_process";import{PassThrough as In,Readable as wn,Writable as Nn,Duplex as Tn}from"node:stream";var bE=({error:D,command:F,escapedCommand:$,fileDescriptors:J,options:Q,startTime:Z,verboseInfo:X})=>{BG(J);let Y=new An;Ln(Y,J),Object.assign(Y,{readable:Pn,writable:jn,duplex:Sn});let q=U6({error:D,command:F,escapedCommand:$,fileDescriptors:J,options:Q,startTime:Z,isSync:!1}),G=xn(q,X,Q);return{subprocess:Y,promise:G}},Ln=(D,F)=>{let $=h9(),J=h9(),Q=h9(),Z=Array.from({length:F.length-3},h9),X=h9(),Y=[$,J,Q,...Z];Object.assign(D,{stdin:$,stdout:J,stderr:Q,all:X,stdio:Y})},h9=()=>{let D=new In;return D.end(),D},Pn=()=>new wn({read(){}}),jn=()=>new Nn({write(){}}),Sn=()=>new Tn({read(){},write(){}}),xn=async(D,F,$)=>V6(D,F,$);import{createReadStream as vE,createWriteStream as hE}from"node:fs";import{Buffer as kn}from"node:buffer";import{Readable as u9,Writable as yn,Duplex as fn}from"node:stream";var gE=(D,F)=>HJ(bn,D,F,!1),g9=({type:D,optionName:F})=>{throw TypeError(`The \`${F}\` option cannot be ${v1[D]}.`)},uE={fileNumber:g9,generator:zG,asyncGenerator:zG,nodeStream:({value:D})=>({stream:D}),webTransform({value:{transform:D,writableObjectMode:F,readableObjectMode:$}}){let J=F||$;return{stream:fn.fromWeb(D,{objectMode:J})}},duplex:({value:{transform:D}})=>({stream:D}),native(){}},bn={input:{...uE,fileUrl:({value:D})=>({stream:vE(D)}),filePath:({value:{file:D}})=>({stream:vE(D)}),webStream:({value:D})=>({stream:u9.fromWeb(D)}),iterable:({value:D})=>({stream:u9.from(D)}),asyncIterable:({value:D})=>({stream:u9.from(D)}),string:({value:D})=>({stream:u9.from(D)}),uint8Array:({value:D})=>({stream:u9.from(kn.from(D))})},output:{...uE,fileUrl:({value:D})=>({stream:hE(D)}),filePath:({value:{file:D,append:F}})=>({stream:hE(D,F?{flags:"a"}:{})}),webStream:({value:D})=>({stream:yn.fromWeb(D)}),iterable:g9,asyncIterable:g9,string:g9,uint8Array:g9}};import{on as vn,once as mE}from"node:events";import{PassThrough as hn,getDefaultHighWaterMark as un}from"node:stream";import{finished as lE}from"node:stream/promises";function gF(D){if(!Array.isArray(D))throw TypeError(`Expected an array, got \`${typeof D}\`.`);for(let Q of D)EG(Q);let F=D.some(({readableObjectMode:Q})=>Q),$=gn(D,F),J=new cE({objectMode:F,writableHighWaterMark:$,readableHighWaterMark:$});for(let Q of D)J.add(Q);return J}var gn=(D,F)=>{if(D.length===0)return un(F);let $=D.filter(({readableObjectMode:J})=>J===F).map(({readableHighWaterMark:J})=>J);return Math.max(...$)};class cE extends hn{#J=new Set([]);#$=new Set([]);#F=new Set([]);#D;#Z=Symbol("unpipe");#Q=new WeakMap;add(D){if(EG(D),this.#J.has(D))return;this.#J.add(D),this.#D??=mn(this,this.#J,this.#Z);let F=ln({passThroughStream:this,stream:D,streams:this.#J,ended:this.#$,aborted:this.#F,onFinished:this.#D,unpipeEvent:this.#Z});this.#Q.set(D,F),D.pipe(this,{end:!1})}async remove(D){if(EG(D),!this.#J.has(D))return!1;let F=this.#Q.get(D);if(F===void 0)return!1;return this.#Q.delete(D),D.unpipe(this),await F,!0}}var mn=async(D,F,$)=>{RJ(D,dE);let J=new AbortController;try{await Promise.race([dn(D,J),pn(D,F,$,J)])}finally{J.abort(),RJ(D,-dE)}},dn=async(D,{signal:F})=>{try{await lE(D,{signal:F,cleanup:!0})}catch($){throw nE(D,$),$}},pn=async(D,F,$,{signal:J})=>{for await(let[Q]of vn(D,"unpipe",{signal:J}))if(F.has(Q))Q.emit($)},EG=(D)=>{if(typeof D?.pipe!=="function")throw TypeError(`Expected a readable stream, got: \`${typeof D}\`.`)},ln=async({passThroughStream:D,stream:F,streams:$,ended:J,aborted:Q,onFinished:Z,unpipeEvent:X})=>{RJ(D,pE);let Y=new AbortController;try{await Promise.race([cn(Z,F,Y),nn({passThroughStream:D,stream:F,streams:$,ended:J,aborted:Q,controller:Y}),on({stream:F,streams:$,ended:J,aborted:Q,unpipeEvent:X,controller:Y})])}finally{Y.abort(),RJ(D,-pE)}if($.size>0&&$.size===J.size+Q.size)if(J.size===0&&Q.size>0)RG(D);else an(D)},cn=async(D,F,{signal:$})=>{try{if(await D,!$.aborted)RG(F)}catch(J){if(!$.aborted)nE(F,J)}},nn=async({passThroughStream:D,stream:F,streams:$,ended:J,aborted:Q,controller:{signal:Z}})=>{try{if(await lE(F,{signal:Z,cleanup:!0,readable:!0,writable:!1}),$.has(F))J.add(F)}catch(X){if(Z.aborted||!$.has(F))return;if(iE(X))Q.add(F);else oE(D,X)}},on=async({stream:D,streams:F,ended:$,aborted:J,unpipeEvent:Q,controller:{signal:Z}})=>{if(await mE(D,Q,{signal:Z}),!D.readable)return mE(Z,"abort",{signal:Z});F.delete(D),$.delete(D),J.delete(D)},an=(D)=>{if(D.writable)D.end()},nE=(D,F)=>{if(iE(F))RG(D);else oE(D,F)},iE=(D)=>D?.code==="ERR_STREAM_PREMATURE_CLOSE",RG=(D)=>{if(D.readable||D.writable)D.destroy()},oE=(D,F)=>{if(!D.destroyed)D.once("error",rn),D.destroy(F)},rn=()=>{},RJ=(D,F)=>{let $=D.getMaxListeners();if($!==0&&$!==Number.POSITIVE_INFINITY)D.setMaxListeners($+F)},dE=2,pE=1;import{finished as aE}from"node:stream/promises";var z6=(D,F)=>{D.pipe(F),sn(D,F),tn(D,F)},sn=async(D,F)=>{if(v2(D)||v2(F))return;try{await aE(D,{cleanup:!0,readable:!0,writable:!1})}catch{}AG(F)},AG=(D)=>{if(D.writable)D.end()},tn=async(D,F)=>{if(v2(D)||v2(F))return;try{await aE(F,{cleanup:!0,readable:!1,writable:!0})}catch{}IG(D)},IG=(D)=>{if(D.readable)D.destroy()};var rE=(D,F,$)=>{let J=new Map;for(let[Q,{stdioItems:Z,direction:X}]of Object.entries(F)){for(let{stream:Y}of Z.filter(({type:q})=>C2.has(q)))en(D,Y,X,Q);for(let{stream:Y}of Z.filter(({type:q})=>!C2.has(q)))Fi({subprocess:D,stream:Y,direction:X,fdNumber:Q,pipeGroups:J,controller:$})}for(let[Q,Z]of J.entries()){let X=Z.length===1?Z[0]:gF(Z);z6(X,Q)}},en=(D,F,$,J)=>{if($==="output")z6(D.stdio[J],F);else z6(F,D.stdio[J]);let Q=Di[J];if(Q!==void 0)D[Q]=F;D.stdio[J]=F},Di=["stdin","stdout","stderr"],Fi=({subprocess:D,stream:F,direction:$,fdNumber:J,pipeGroups:Q,controller:Z})=>{if(F===void 0)return;$i(F,Z);let[X,Y]=$==="output"?[F,D.stdio[J]]:[D.stdio[J],F],q=Q.get(X)??[];Q.set(X,[...q,Y])},$i=(D,{signal:F})=>{if(v2(D))bF(D,Ji,F)},Ji=2;IJ();import{addAbortListener as Xi}from"node:events";var FR=(D,{cleanup:F,detached:$},{signal:J})=>{if(!F||$)return;let Q=C6(()=>{D.kill()});Xi(J,()=>{Q()})};var JR=({source:D,sourcePromise:F,boundOptions:$,createNested:J},...Q)=>{let Z=k$(),{destination:X,destinationStream:Y,destinationError:q,from:G,unpipeSignal:B}=Yi($,J,Q),{sourceStream:W,sourceError:K}=Gi(D,G),{options:U,fileDescriptors:V}=K8.get(D);return{sourcePromise:F,sourceStream:W,sourceOptions:U,sourceError:K,destination:X,destinationStream:Y,destinationError:q,unpipeSignal:B,fileDescriptors:V,startTime:Z}},Yi=(D,F,$)=>{try{let{destination:J,pipeOptions:{from:Q,to:Z,unpipeSignal:X}={}}=qi(D,F,...$),Y=l$(J,Z);return{destination:J,destinationStream:Y,from:Q,unpipeSignal:X}}catch(J){return{destinationError:J}}},qi=(D,F,$,...J)=>{if(Array.isArray($))return{destination:F($R,D)($,...J),pipeOptions:D};if(typeof $==="string"||$ instanceof URL||Eq($)){if(Object.keys(D).length>0)throw TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[Q,Z,X]=A$($,...J);return{destination:F($R)(Q,Z,X),pipeOptions:X}}if(K8.has($)){if(Object.keys(D).length>0)throw TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:$,pipeOptions:J[0]}}throw TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${$}`)},$R=({options:D})=>({options:{...D,stdin:"pipe",piped:!0}}),Gi=(D,F)=>{try{return{sourceStream:B6(D,F)}}catch($){return{sourceError:$}}};var ZR=({sourceStream:D,sourceError:F,destinationStream:$,destinationError:J,fileDescriptors:Q,sourceOptions:Z,startTime:X})=>{let Y=Bi({sourceStream:D,sourceError:F,destinationStream:$,destinationError:J});if(Y!==void 0)throw PG({error:Y,fileDescriptors:Q,sourceOptions:Z,startTime:X})},Bi=({sourceStream:D,sourceError:F,destinationStream:$,destinationError:J})=>{if(F!==void 0&&J!==void 0)return J;if(J!==void 0)return IG(D),J;if(F!==void 0)return AG($),F},PG=({error:D,fileDescriptors:F,sourceOptions:$,startTime:J})=>U6({error:D,command:QR,escapedCommand:QR,fileDescriptors:F,options:$,startTime:J,isSync:!1}),QR="source.pipe(destination)";var XR=async(D)=>{let[{status:F,reason:$,value:J=$},{status:Q,reason:Z,value:X=Z}]=await D;if(!X.pipedFrom.includes(J))X.pipedFrom.push(J);if(Q==="rejected")throw X;if(F==="rejected")throw J;return X};import{finished as Wi}from"node:stream/promises";var YR=(D,F,$)=>{let J=wJ.has(F)?Ui(D,F):Ki(D,F);return bF(D,Hi,$.signal),bF(F,zi,$.signal),Vi(F),J},Ki=(D,F)=>{let $=gF([D]);return z6($,F),wJ.set(F,$),$},Ui=(D,F)=>{let $=wJ.get(F);return $.add(D),$},Vi=async(D)=>{try{await Wi(D,{cleanup:!0,readable:!1,writable:!0})}catch{}wJ.delete(D)},wJ=new WeakMap,Hi=2,zi=1;import{aborted as Ci}from"node:util";var qR=(D,F)=>D===void 0?[]:[_i(D,F)],_i=async(D,{sourceStream:F,mergedStream:$,fileDescriptors:J,sourceOptions:Q,startTime:Z})=>{await Ci(D,F),await $.remove(F);let X=Error("Pipe canceled by `unpipeSignal` option.");throw PG({error:X,fileDescriptors:J,sourceOptions:Q,startTime:Z})};var NJ=(D,...F)=>{if(mD(F[0]))return NJ.bind(void 0,{...D,boundOptions:{...D.boundOptions,...F[0]}});let{destination:$,...J}=JR(D,...F),Q=Mi({...J,destination:$});return Q.pipe=NJ.bind(void 0,{...D,source:$,sourcePromise:Q,boundOptions:{}}),Q},Mi=async({sourcePromise:D,sourceStream:F,sourceOptions:$,sourceError:J,destination:Q,destinationStream:Z,destinationError:X,unpipeSignal:Y,fileDescriptors:q,startTime:G})=>{let B=Oi(D,Q);ZR({sourceStream:F,sourceError:J,destinationStream:Z,destinationError:X,fileDescriptors:q,sourceOptions:$,startTime:G});let W=new AbortController;try{let K=YR(F,Z,W);return await Promise.race([XR(B),...qR(Y,{sourceStream:F,mergedStream:K,sourceOptions:$,fileDescriptors:q,startTime:G})])}finally{W.abort()}},Oi=(D,F)=>Promise.allSettled([D,F]);import{setImmediate as Ti}from"node:timers/promises";import{on as Ei}from"node:events";import{getDefaultHighWaterMark as Ri}from"node:stream";var TJ=({subprocessStdout:D,subprocess:F,binary:$,shouldEncode:J,encoding:Q,preserveNewlines:Z})=>{let X=new AbortController;return Ai(F,X),BR({stream:D,controller:X,binary:$,shouldEncode:!D.readableObjectMode&&J,encoding:Q,shouldSplit:!D.readableObjectMode,preserveNewlines:Z})},Ai=async(D,F)=>{try{await D}catch{}finally{F.abort()}},jG=({stream:D,onStreamEnd:F,lines:$,encoding:J,stripFinalNewline:Q,allMixed:Z})=>{let X=new AbortController;Ii(F,X,D);let Y=D.readableObjectMode&&!Z;return BR({stream:D,controller:X,binary:J==="buffer",shouldEncode:!Y,encoding:J,shouldSplit:!Y&&$,preserveNewlines:!Q})},Ii=async(D,F,$)=>{try{await D}catch{$.destroy()}finally{F.abort()}},BR=({stream:D,controller:F,binary:$,shouldEncode:J,encoding:Q,shouldSplit:Z,preserveNewlines:X})=>{let Y=Ei(D,"data",{signal:F.signal,highWaterMark:GR,highWatermark:GR});return wi({onStdoutChunk:Y,controller:F,binary:$,shouldEncode:J,encoding:Q,shouldSplit:Z,preserveNewlines:X})},SG=Ri(!0),GR=SG,wi=async function*({onStdoutChunk:D,controller:F,binary:$,shouldEncode:J,encoding:Q,shouldSplit:Z,preserveNewlines:X}){let Y=Ni({binary:$,shouldEncode:J,encoding:Q,shouldSplit:Z,preserveNewlines:X});try{for await(let[q]of D)yield*uF(q,Y,0)}catch(q){if(!F.signal.aborted)throw q}finally{yield*v9(Y)}},Ni=({binary:D,shouldEncode:F,encoding:$,shouldSplit:J,preserveNewlines:Q})=>[CJ(D,$,!F),zJ(D,Q,!J,{})].filter(Boolean);var WR=async({stream:D,onStreamEnd:F,fdNumber:$,encoding:J,buffer:Q,maxBuffer:Z,lines:X,allMixed:Y,stripFinalNewline:q,verboseInfo:G,streamInfo:B})=>{let W=Li({stream:D,onStreamEnd:F,fdNumber:$,encoding:J,allMixed:Y,verboseInfo:G,streamInfo:B});if(!Q){await Promise.all([Pi(D),W]);return}let K=WG(q,$),U=jG({stream:D,onStreamEnd:F,lines:X,encoding:J,stripFinalNewline:K,allMixed:Y}),[V]=await Promise.all([ji({stream:D,iterable:U,fdNumber:$,encoding:J,maxBuffer:Z,lines:X}),W]);return V},Li=async({stream:D,onStreamEnd:F,fdNumber:$,encoding:J,allMixed:Q,verboseInfo:Z,streamInfo:{fileDescriptors:X}})=>{if(!OJ({stdioItems:X[$]?.stdioItems,encoding:J,verboseInfo:Z,fdNumber:$}))return;let Y=jG({stream:D,onStreamEnd:F,lines:!0,encoding:J,stripFinalNewline:!0,allMixed:Q});await _E(Y,D,$,Z)},Pi=async(D)=>{if(await Ti(),D.readableFlowing===null)D.resume()},ji=async({stream:D,stream:{readableObjectMode:F},iterable:$,fdNumber:J,encoding:Q,maxBuffer:Z,lines:X})=>{try{if(F||X)return await XJ($,{maxBuffer:Z});if(Q==="buffer")return new Uint8Array(await YJ($,{maxBuffer:Z}));return await GJ($,{maxBuffer:Z})}catch(Y){return KR(_O({error:Y,stream:D,readableObjectMode:F,lines:X,encoding:Q,fdNumber:J}))}},xG=async(D)=>{try{return await D}catch(F){return KR(F)}},KR=({bufferedData:D})=>jC(D)?new Uint8Array(D):D;import{finished as Si}from"node:stream/promises";var m9=async(D,F,$,{isSameDirection:J,stopOnExit:Q=!1}={})=>{let Z=xi(D,$),X=new AbortController;try{await Promise.race([...Q?[$.exitPromise]:[],Si(D,{cleanup:!0,signal:X.signal})])}catch(Y){if(!Z.stdinCleanedUp)fi(Y,F,$,J)}finally{X.abort()}},xi=(D,{originalStreams:[F],subprocess:$})=>{let J={stdinCleanedUp:!1};if(D===F)ki(D,$,J);return J},ki=(D,F,$)=>{let{_destroy:J}=D;D._destroy=(...Q)=>{yi(F,$),J.call(D,...Q)}},yi=({exitCode:D,signalCode:F},$)=>{if(D!==null||F!==null)$.stdinCleanedUp=!0},fi=(D,F,$,J)=>{if(!bi(D,F,$,J))throw D},bi=(D,F,$,J=!0)=>{if($.propagating)return UR(D)||LJ(D);return $.propagating=!0,kG($,F)===J?UR(D):LJ(D)},kG=({fileDescriptors:D},F)=>F!=="all"&&D[F].direction==="input",LJ=(D)=>D?.code==="ERR_STREAM_PREMATURE_CLOSE",UR=(D)=>D?.code==="EPIPE";var VR=({subprocess:D,encoding:F,buffer:$,maxBuffer:J,lines:Q,stripFinalNewline:Z,verboseInfo:X,streamInfo:Y})=>D.stdio.map((q,G)=>yG({stream:q,fdNumber:G,encoding:F,buffer:$[G],maxBuffer:J[G],lines:Q[G],allMixed:!1,stripFinalNewline:Z,verboseInfo:X,streamInfo:Y})),yG=async({stream:D,fdNumber:F,encoding:$,buffer:J,maxBuffer:Q,lines:Z,allMixed:X,stripFinalNewline:Y,verboseInfo:q,streamInfo:G})=>{if(!D)return;let B=m9(D,F,G);if(kG(G,F)){await B;return}let[W]=await Promise.all([WR({stream:D,onStreamEnd:B,fdNumber:F,encoding:$,buffer:J,maxBuffer:Q,lines:Z,allMixed:X,stripFinalNewline:Y,verboseInfo:q,streamInfo:G}),B]);return W};var HR=({stdout:D,stderr:F},{all:$})=>$&&(D||F)?gF([D,F].filter(Boolean)):void 0,zR=({subprocess:D,encoding:F,buffer:$,maxBuffer:J,lines:Q,stripFinalNewline:Z,verboseInfo:X,streamInfo:Y})=>yG({...vi(D,$),fdNumber:"all",encoding:F,maxBuffer:J[1]+J[2],lines:Q[1]||Q[2],allMixed:hi(D),stripFinalNewline:Z,verboseInfo:X,streamInfo:Y}),vi=({stdout:D,stderr:F,all:$},[,J,Q])=>{let Z=J||Q;if(!Z)return{stream:$,buffer:Z};if(!J)return{stream:F,buffer:Z};if(!Q)return{stream:D,buffer:Z};return{stream:$,buffer:Z}},hi=({all:D,stdout:F,stderr:$})=>D&&F&&$&&F.readableObjectMode!==$.readableObjectMode;import{once as ui}from"node:events";var CR=(D)=>Z6(D,"ipc"),_R=(D,F)=>{let $=x$(D);G8({type:"ipc",verboseMessage:$,fdNumber:"ipc",verboseInfo:F})};var MR=async({subprocess:D,buffer:F,maxBuffer:$,ipc:J,ipcOutput:Q,verboseInfo:Z})=>{if(!J)return Q;let X=CR(Z),Y=a8(F,"ipc"),q=a8($,"ipc");for await(let G of OG({anyProcess:D,channel:D.channel,isSubprocess:!1,ipc:J,shouldAwait:!1,reference:!0})){if(Y)MO(D,Q,q),Q.push(G);if(X)_R(G,Z)}return Q},OR=async(D,F)=>{return await Promise.allSettled([D]),F};var ER=async({subprocess:D,options:{encoding:F,buffer:$,maxBuffer:J,lines:Q,timeoutDuration:Z,cancelSignal:X,gracefulCancel:Y,forceKillAfterDelay:q,stripFinalNewline:G,ipc:B,ipcInput:W},context:K,verboseInfo:U,fileDescriptors:V,originalStreams:H,onInternalError:z,controller:_})=>{let O=AE(D,K),C={originalStreams:H,fileDescriptors:V,subprocess:D,exitPromise:O,propagating:!1},M=VR({subprocess:D,encoding:F,buffer:$,maxBuffer:J,lines:Q,stripFinalNewline:G,verboseInfo:U,streamInfo:C}),E=zR({subprocess:D,encoding:F,buffer:$,maxBuffer:J,lines:Q,stripFinalNewline:G,verboseInfo:U,streamInfo:C}),A=[],w=MR({subprocess:D,buffer:$,maxBuffer:J,ipc:B,ipcOutput:A,verboseInfo:U}),R=gi(H,D,C),T=mi(V,C);try{return await Promise.race([Promise.all([{},wE(O),Promise.all(M),E,w,rM(D,W),...R,...T]),z,di(D,_),...cM(D,Z,K,_),...KM({subprocess:D,cancelSignal:X,gracefulCancel:Y,context:K,controller:_}),...pM({subprocess:D,cancelSignal:X,gracefulCancel:Y,forceKillAfterDelay:q,context:K,controller:_})])}catch(N){return K.terminationReason??="other",Promise.all([{error:N},O,Promise.all(M.map((j)=>xG(j))),xG(E),OR(w,A),Promise.allSettled(R),Promise.allSettled(T)])}},gi=(D,F,$)=>D.map((J,Q)=>J===F.stdio[Q]?void 0:m9(J,Q,$)),mi=(D,F)=>D.flatMap(({stdioItems:$},J)=>$.filter(({value:Q,stream:Z=Q})=>u2(Z,{checkOpen:!1})&&!v2(Z)).map(({type:Q,value:Z,stream:X=Z})=>m9(X,J,F,{isSameDirection:C2.has(Q),stopOnExit:Q==="native"}))),di=async(D,{signal:F})=>{let[$]=await ui(D,"error",{signal:F});throw $};var RR=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),d9=(D,F,$)=>{let J=D[$];if(!J.has(F))J.set(F,[]);let Q=J.get(F),Z=W8();return Q.push(Z),{resolve:Z.resolve.bind(Z),promises:Q}},_6=async({resolve:D,promises:F},$)=>{D();let[J]=await Promise.race([Promise.allSettled([!0,$]),Promise.all([!1,...F])]);return!J};import{Readable as pi}from"node:stream";import{callbackify as li}from"node:util";import{finished as AR}from"node:stream/promises";var fG=async(D)=>{if(D===void 0)return;try{await bG(D)}catch{}},IR=async(D)=>{if(D===void 0)return;try{await vG(D)}catch{}},bG=async(D)=>{await AR(D,{cleanup:!0,readable:!1,writable:!0})},vG=async(D)=>{await AR(D,{cleanup:!0,readable:!0,writable:!1})},PJ=async(D,F)=>{if(await D,F)throw F},jJ=(D,F,$)=>{if($&&!LJ($))D.destroy($);else if(F)D.destroy()};var wR=({subprocess:D,concurrentStreams:F,encoding:$},{from:J,binary:Q=!0,preserveNewlines:Z=!0}={})=>{let X=Q||X2.has($),{subprocessStdout:Y,waitReadableDestroy:q}=hG(D,J,F),{readableEncoding:G,readableObjectMode:B,readableHighWaterMark:W}=uG(Y,X),{read:K,onStdoutDataDone:U}=gG({subprocessStdout:Y,subprocess:D,binary:X,encoding:$,preserveNewlines:Z}),V=new pi({read:K,destroy:li(dG.bind(void 0,{subprocessStdout:Y,subprocess:D,waitReadableDestroy:q})),highWaterMark:W,objectMode:B,encoding:G});return mG({subprocessStdout:Y,onStdoutDataDone:U,readable:V,subprocess:D}),V},hG=(D,F,$)=>{let J=B6(D,F),Q=d9($,J,"readableDestroy");return{subprocessStdout:J,waitReadableDestroy:Q}},uG=({readableEncoding:D,readableObjectMode:F,readableHighWaterMark:$},J)=>J?{readableEncoding:D,readableObjectMode:F,readableHighWaterMark:$}:{readableEncoding:D,readableObjectMode:!0,readableHighWaterMark:SG},gG=({subprocessStdout:D,subprocess:F,binary:$,encoding:J,preserveNewlines:Q})=>{let Z=W8(),X=TJ({subprocessStdout:D,subprocess:F,binary:$,shouldEncode:!$,encoding:J,preserveNewlines:Q});return{read(){ci(this,X,Z)},onStdoutDataDone:Z}},ci=async(D,F,$)=>{try{let{value:J,done:Q}=await F.next();if(Q)$.resolve();else D.push(J)}catch{}},mG=async({subprocessStdout:D,onStdoutDataDone:F,readable:$,subprocess:J,subprocessStdin:Q})=>{try{if(await vG(D),await J,await fG(Q),await F,$.readable)$.push(null)}catch(Z){await fG(Q),NR($,Z)}},dG=async({subprocessStdout:D,subprocess:F,waitReadableDestroy:$},J)=>{if(await _6($,F))NR(D,J),await PJ(F,J)},NR=(D,F)=>{jJ(D,D.readable,F)};import{Writable as ni}from"node:stream";import{callbackify as TR}from"node:util";var LR=({subprocess:D,concurrentStreams:F},{to:$}={})=>{let{subprocessStdin:J,waitWritableFinal:Q,waitWritableDestroy:Z}=pG(D,$,F),X=new ni({...lG(J,D,Q),destroy:TR(nG.bind(void 0,{subprocessStdin:J,subprocess:D,waitWritableFinal:Q,waitWritableDestroy:Z})),highWaterMark:J.writableHighWaterMark,objectMode:J.writableObjectMode});return cG(J,X),X},pG=(D,F,$)=>{let J=l$(D,F),Q=d9($,J,"writableFinal"),Z=d9($,J,"writableDestroy");return{subprocessStdin:J,waitWritableFinal:Q,waitWritableDestroy:Z}},lG=(D,F,$)=>({write:ii.bind(void 0,D),final:TR(oi.bind(void 0,D,F,$))}),ii=(D,F,$,J)=>{if(D.write(F,$))J();else D.once("drain",J)},oi=async(D,F,$)=>{if(await _6($,F)){if(D.writable)D.end();await F}},cG=async(D,F,$)=>{try{if(await bG(D),F.writable)F.end()}catch(J){await IR($),PR(F,J)}},nG=async({subprocessStdin:D,subprocess:F,waitWritableFinal:$,waitWritableDestroy:J},Q)=>{if(await _6($,F),await _6(J,F))PR(D,Q),await PJ(F,Q)},PR=(D,F)=>{jJ(D,D.writable,F)};import{Duplex as ai}from"node:stream";import{callbackify as ri}from"node:util";var jR=({subprocess:D,concurrentStreams:F,encoding:$},{from:J,to:Q,binary:Z=!0,preserveNewlines:X=!0}={})=>{let Y=Z||X2.has($),{subprocessStdout:q,waitReadableDestroy:G}=hG(D,J,F),{subprocessStdin:B,waitWritableFinal:W,waitWritableDestroy:K}=pG(D,Q,F),{readableEncoding:U,readableObjectMode:V,readableHighWaterMark:H}=uG(q,Y),{read:z,onStdoutDataDone:_}=gG({subprocessStdout:q,subprocess:D,binary:Y,encoding:$,preserveNewlines:X}),O=new ai({read:z,...lG(B,D,W),destroy:ri(si.bind(void 0,{subprocessStdout:q,subprocessStdin:B,subprocess:D,waitReadableDestroy:G,waitWritableFinal:W,waitWritableDestroy:K})),readableHighWaterMark:H,writableHighWaterMark:B.writableHighWaterMark,readableObjectMode:V,writableObjectMode:B.writableObjectMode,encoding:U});return mG({subprocessStdout:q,onStdoutDataDone:_,readable:O,subprocess:D,subprocessStdin:B}),cG(B,O,q),O},si=async({subprocessStdout:D,subprocessStdin:F,subprocess:$,waitReadableDestroy:J,waitWritableFinal:Q,waitWritableDestroy:Z},X)=>{await Promise.all([dG({subprocessStdout:D,subprocess:$,waitReadableDestroy:J},X),nG({subprocessStdin:F,subprocess:$,waitWritableFinal:Q,waitWritableDestroy:Z},X)])};var iG=(D,F,{from:$,binary:J=!1,preserveNewlines:Q=!1}={})=>{let Z=J||X2.has(F),X=B6(D,$),Y=TJ({subprocessStdout:X,subprocess:D,binary:Z,shouldEncode:!0,encoding:F,preserveNewlines:Q});return ti(Y,X,D)},ti=async function*(D,F,$){try{yield*D}finally{if(F.readable)F.destroy();await $}};var SR=(D,{encoding:F})=>{let $=RR();D.readable=wR.bind(void 0,{subprocess:D,concurrentStreams:$,encoding:F}),D.writable=LR.bind(void 0,{subprocess:D,concurrentStreams:$}),D.duplex=jR.bind(void 0,{subprocess:D,concurrentStreams:$,encoding:F}),D.iterable=iG.bind(void 0,D,F),D[Symbol.asyncIterator]=iG.bind(void 0,D,F,{})};var xR=(D,F)=>{for(let[$,J]of Do){let Q=J.value.bind(F);Reflect.defineProperty(D,$,{...J,value:Q})}},ei=(async()=>{})().constructor.prototype,Do=["then","catch","finally"].map((D)=>[D,Reflect.getOwnPropertyDescriptor(ei,D)]);var kR=(D,F,$,J)=>{let{file:Q,commandArguments:Z,command:X,escapedCommand:Y,startTime:q,verboseInfo:G,options:B,fileDescriptors:W}=Jo(D,F,$),{subprocess:K,promise:U}=Zo({file:Q,commandArguments:Z,options:B,startTime:q,verboseInfo:G,command:X,escapedCommand:Y,fileDescriptors:W});return K.pipe=NJ.bind(void 0,{source:K,sourcePromise:U,boundOptions:{},createNested:J}),xR(K,U),K8.set(K,{options:B,fileDescriptors:W}),K},Jo=(D,F,$)=>{let{command:J,escapedCommand:Q,startTime:Z,verboseInfo:X}=y$(D,F,$),{file:Y,commandArguments:q,options:G}=FJ(D,F,$),B=Qo(G),W=gE(B,X);return{file:Y,commandArguments:q,command:J,escapedCommand:Q,startTime:Z,verboseInfo:X,options:B,fileDescriptors:W}},Qo=({timeout:D,signal:F,...$})=>{if(F!==void 0)throw TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...$,timeoutDuration:D}},Zo=({file:D,commandArguments:F,options:$,startTime:J,verboseInfo:Q,command:Z,escapedCommand:X,fileDescriptors:Y})=>{let q;try{q=$o(...$J(D,F,$))}catch(V){return bE({error:V,command:Z,escapedCommand:X,fileDescriptors:Y,options:$,startTime:J,verboseInfo:Q})}let G=new AbortController;Fo(Number.POSITIVE_INFINITY,G.signal);let B=[...q.stdio];rE(q,Y,G),FR(q,$,G);let W={},K=W8();q.kill=BM.bind(void 0,{kill:q.kill.bind(q),options:$,onInternalError:K,context:W,controller:G}),q.all=HR(q,$),SR(q,$),kE(q,$);let U=Xo({subprocess:q,options:$,startTime:J,verboseInfo:Q,fileDescriptors:Y,originalStreams:B,command:Z,escapedCommand:X,context:W,onInternalError:K,controller:G});return{subprocess:q,promise:U}},Xo=async({subprocess:D,options:F,startTime:$,verboseInfo:J,fileDescriptors:Q,originalStreams:Z,command:X,escapedCommand:Y,context:q,onInternalError:G,controller:B})=>{let[W,[K,U],V,H,z]=await ER({subprocess:D,options:F,context:q,verboseInfo:J,fileDescriptors:Q,originalStreams:Z,onInternalError:G,controller:B});B.abort(),G.resolve();let _=V.map((M,E)=>t8(M,F,E)),O=t8(H,F,"all"),C=Yo({errorInfo:W,exitCode:K,signal:U,stdio:_,all:O,ipcOutput:z,context:q,options:F,command:X,escapedCommand:Y,startTime:$});return V6(C,J,F)},Yo=({errorInfo:D,exitCode:F,signal:$,stdio:J,all:Q,ipcOutput:Z,context:X,options:Y,command:q,escapedCommand:G,startTime:B})=>("error"in D)?b9({error:D.error,command:q,escapedCommand:G,timedOut:X.terminationReason==="timeout",isCanceled:X.terminationReason==="cancel"||X.terminationReason==="gracefulCancel",isGracefullyCanceled:X.terminationReason==="gracefulCancel",isMaxBuffer:D.error instanceof r8,isForcefullyTerminated:X.isForcefullyTerminated,exitCode:F,signal:$,stdio:J,all:Q,ipcOutput:Z,options:Y,startTime:B,isSync:!1}):WJ({command:q,escapedCommand:G,stdio:J,all:Q,ipcOutput:Z,options:Y,startTime:B});var SJ=(D,F)=>{let $=Object.fromEntries(Object.entries(F).map(([J,Q])=>[J,qo(J,D[J],Q)]));return{...D,...$}},qo=(D,F,$)=>{if(Go.has(D)&&mD(F)&&mD($))return{...F,...$};return $},Go=new Set(["env",...Tq]);var h1=(D,F,$,J)=>{let Q=(X,Y,q)=>h1(X,Y,$,q),Z=(...X)=>Bo({mapArguments:D,deepOptions:$,boundOptions:F,setBoundExeca:J,createNested:Q},...X);if(J!==void 0)J(Z,Q,F);return Z},Bo=({mapArguments:D,deepOptions:F={},boundOptions:$={},setBoundExeca:J,createNested:Q},Z,...X)=>{if(mD(Z))return Q(D,SJ($,Z),J);let{file:Y,commandArguments:q,options:G,isSync:B}=Wo({mapArguments:D,firstArgument:Z,nextArguments:X,deepOptions:F,boundOptions:$});return B?TE(Y,q,G):kR(Y,q,G,Q)},Wo=({mapArguments:D,firstArgument:F,nextArguments:$,deepOptions:J,boundOptions:Q})=>{let Z=bC(F)?vC(F,$):[F,...$],[X,Y,q]=A$(...Z),G=SJ(SJ(J,Q),q),{file:B=X,commandArguments:W=Y,options:K=G,isSync:U=!1}=D({file:X,commandArguments:Y,options:G});return{file:B,commandArguments:W,options:K,isSync:U}};var yR=({file:D,commandArguments:F})=>bR(D,F),fR=({file:D,commandArguments:F})=>({...bR(D,F),isSync:!0}),bR=(D,F)=>{if(F.length>0)throw TypeError(`The command and its arguments must be passed as a single string: ${D} ${F}.`);let[$,...J]=Ko(D);return{file:$,commandArguments:J}},Ko=(D)=>{if(typeof D!=="string")throw TypeError(`The command must be a string: ${String(D)}.`);let F=D.trim();if(F==="")return[];let $=[];for(let J of F.split(Uo)){let Q=$.at(-1);if(Q&&Q.endsWith("\\"))$[$.length-1]=`${Q.slice(0,-1)} ${J}`;else $.push(J)}return $},Uo=/ +/g;var vR=(D,F,$)=>{D.sync=F(Vo,$),D.s=D.sync},hR=({options:D})=>uR(D),Vo=({options:D})=>({...uR(D),isSync:!0}),uR=(D)=>({options:{...Ho(D),...D}}),Ho=({input:D,inputFile:F,stdio:$})=>D===void 0&&F===void 0&&$===void 0?{stdin:"inherit"}:{},gR={preferLocal:!0};var wD=h1(()=>({})),TMD=h1(()=>({isSync:!0})),LMD=h1(yR),PMD=h1(fR),jMD=h1(iM),SMD=h1(hR,{},gR,vR),{sendMessage:xMD,getOneMessage:kMD,getEachMessage:yMD,getCancelSignal:fMD}=yE();import $Y from"node:fs";import Vk from"node:path";A6();var sJ=256,tJ;function eJ(D=11){if(!tJ||sJ+D>512){tJ="",sJ=0;for(let F=0;F<256;F++)tJ+=(256+Math.random()*256|0).toString(16).substring(1)}return tJ.substring(sJ,sJ+++D)}function DQ(D){let{batch:F,chain:$,ccipRead:J,dataSuffix:Q,key:Z="base",name:X="Base Client",type:Y="base"}=D,q=D.experimental_blockTag??(typeof $?.experimental_preconfirmationTime==="number"?"pending":void 0),G=$?.blockTime??12000,B=Math.min(Math.max(Math.floor(G/2),500),4000),W=D.pollingInterval??B,K=D.cacheTime??W,U=D.account?i(D.account):void 0,{config:V,request:H,value:z}=D.transport({account:U,chain:$,pollingInterval:W}),_={...V,...z},O={account:U,batch:F,cacheTime:K,ccipRead:J,chain:$,dataSuffix:Q,key:Z,name:X,pollingInterval:W,request:H,transport:_,type:Y,uid:eJ(),...q?{experimental_blockTag:q}:{}};function C(M){return(E)=>{let A=E(M);for(let R in O)delete A[R];let w={...M,...A};return Object.assign(w,{extend:C(w)})}}return Object.assign(O,{extend:C(O)})}z8();Y1();a0();tF();c();s();q1();function y6(D){if(!(D instanceof P))return!1;let F=D.walk(($)=>$ instanceof N8);if(!(F instanceof N8))return!1;if(F.data?.errorName==="HttpError")return!0;if(F.data?.errorName==="ResolverError")return!0;if(F.data?.errorName==="ResolverNotContract")return!0;if(F.data?.errorName==="ResolverNotFound")return!0;if(F.data?.errorName==="ReverseAddressMismatch")return!0;if(F.data?.errorName==="UnsupportedResolverProfile")return!0;return!1}W4();K0();c();c2();function kQ(D){if(D.length!==66)return null;if(D.indexOf("[")!==0)return null;if(D.indexOf("]")!==65)return null;let F=`0x${D.slice(1,65)}`;if(!DD(F))return null;return F}function K4(D){let F=new Uint8Array(32).fill(0);if(!D)return WD(F);let $=D.split(".");for(let J=$.length-1;J>=0;J-=1){let Q=kQ($[J]),Z=Q?O2(Q):OD(p2($[J]),"bytes");F=OD(ID([F,Z]),"bytes")}return WD(F)}K0();function CI(D){return`[${D.slice(2)}]`}K0();c();c2();function _I(D){let F=new Uint8Array(32).fill(0);if(!D)return WD(F);return kQ(D)||OD(p2(D))}function f6(D){let F=D.replace(/^\.|\.$/gm,"");if(F.length===0)return new Uint8Array(1);let $=new Uint8Array(p2(F).byteLength+2),J=0,Q=F.split(".");for(let Z=0;Z<Q.length;Z++){let X=p2(Q[Z]);if(X.byteLength>255)X=p2(CI(_I(Q[Z])));$[J]=X.length,$.set(X,J+1),J+=X.length+1}if($.byteLength!==J+1)return $.slice(0,J+1);return $}function f(D,F,$){let J=D[F.name];if(typeof J==="function")return J;let Q=D[$];if(typeof Q==="function")return Q;return(Z)=>F(D,Z)}Y1();a0();gD();s();q1();$3();F7();var Ma=3;function B2(D,{abi:F,address:$,args:J,docsPath:Q,functionName:Z,sender:X}){let Y=D instanceof T8?D:D instanceof P?D.walk((V)=>("data"in V))||D.walk():{},{code:q,data:G,details:B,message:W,shortMessage:K}=Y,U=(()=>{if(D instanceof d2)return new SQ({functionName:Z});if([Ma,B1.code].includes(q)&&(G||B||W||K)||q===R2.code&&B==="execution reverted"&&G)return new N8({abi:F,data:typeof G==="object"?G.data:G,functionName:Z,message:Y instanceof F3?B:K??W});return D})();return new k6(U,{abi:F,args:J,contractAddress:$,docsPath:Q,functionName:Z,sender:X})}U3();async function aD(D,F){let{abi:$,address:J,args:Q,functionName:Z,...X}=F,Y=ED({abi:$,args:Q,functionName:Z});try{let{data:q}=await f(D,w2,"call")({...X,data:Y,to:J});return O0({abi:$,args:Q,functionName:Z,data:q||"0x"})}catch(q){throw B2(q,{abi:$,address:J,args:Q,docsPath:"/docs/contract/readContract",functionName:Z})}}async function Xw(D,F){let{blockNumber:$,blockTag:J,coinType:Q,name:Z,gatewayUrls:X,strict:Y}=F,{chain:q}=D,G=(()=>{if(F.universalResolverAddress)return F.universalResolverAddress;if(!q)throw Error("client chain not configured. universalResolverAddress is required.");return E2({blockNumber:$,chain:q,contract:"ensUniversalResolver"})})(),B=q?.ensTlds;if(B&&!B.some((K)=>Z.endsWith(K)))return null;let W=(()=>{if(Q!=null)return[K4(Z),BigInt(Q)];return[K4(Z)]})();try{let K=ED({abi:$B,functionName:"addr",args:W}),U={address:G,abi:$Q,functionName:"resolveWithGateways",args:[nD(f6(Z)),K,X??[G1]],blockNumber:$,blockTag:J},H=await f(D,aD,"readContract")(U);if(H[0]==="0x")return null;let z=O0({abi:$B,args:W,functionName:"addr",data:H[0]});if(z==="0x")return null;if(q2(z)==="0x00")return null;return z}catch(K){if(Y)throw K;if(y6(K))return null;throw K}}s();class wW extends P{constructor({data:D}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(D)}`],name:"EnsAvatarInvalidMetadataError"})}}class V3 extends P{constructor({reason:D}){super(`ENS NFT avatar URI is invalid. ${D}`,{name:"EnsAvatarInvalidNftUriError"})}}class N4 extends P{constructor({uri:D}){super(`Unable to resolve ENS avatar URI "${D}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}class NW extends P{constructor({namespace:D}){super(`ENS NFT avatar namespace "${D}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}var da=/(?<protocol>https?:\/\/[^/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,pa=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?<target>[\w\-.]+))?(?<subtarget>\/.*)?$/,la=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,ca=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function na(D){try{let F=await fetch(D,{method:"HEAD"});if(F.status===200)return F.headers.get("content-type")?.startsWith("image/");return!1}catch(F){if(typeof F==="object"&&typeof F.response<"u")return!1;if(!Object.hasOwn(globalThis,"Image"))return!1;return new Promise(($)=>{let J=new Image;J.onload=()=>{$(!0)},J.onerror=()=>{$(!1)},J.src=D})}}function Yw(D,F){if(!D)return F;if(D.endsWith("/"))return D.slice(0,-1);return D}function TW({uri:D,gatewayUrls:F}){let $=la.test(D);if($)return{uri:D,isOnChain:!0,isEncoded:$};let J=Yw(F?.ipfs,"https://ipfs.io"),Q=Yw(F?.arweave,"https://arweave.net"),Z=D.match(da),{protocol:X,subpath:Y,target:q,subtarget:G=""}=Z?.groups||{},B=X==="ipns:/"||Y==="ipns/",W=X==="ipfs:/"||Y==="ipfs/"||pa.test(D);if(D.startsWith("http")&&!B&&!W){let U=D;if(F?.arweave)U=D.replace(/https:\/\/arweave.net/g,F?.arweave);return{uri:U,isOnChain:!1,isEncoded:!1}}if((B||W)&&q)return{uri:`${J}/${B?"ipns":"ipfs"}/${q}${G}`,isOnChain:!1,isEncoded:!1};if(X==="ar:/"&&q)return{uri:`${Q}/${q}${G||""}`,isOnChain:!1,isEncoded:!1};let K=D.replace(ca,"");if(K.startsWith("<svg"))K=`data:image/svg+xml;base64,${btoa(K)}`;if(K.startsWith("data:")||K.startsWith("{"))return{uri:K,isOnChain:!0,isEncoded:!1};throw new N4({uri:D})}function LW(D){if(typeof D!=="object"||!("image"in D)&&!("image_url"in D)&&!("image_data"in D))throw new wW({data:D});return D.image||D.image_url||D.image_data}async function qw({gatewayUrls:D,uri:F}){try{let $=await fetch(F).then((Q)=>Q.json());return await oQ({gatewayUrls:D,uri:LW($)})}catch{throw new N4({uri:F})}}async function oQ({gatewayUrls:D,uri:F}){let{uri:$,isOnChain:J}=TW({uri:F,gatewayUrls:D});if(J)return $;if(await na($))return $;throw new N4({uri:F})}function Gw(D){let F=D;if(F.startsWith("did:nft:"))F=F.replace("did:nft:","").replace(/_/g,"/");let[$,J,Q]=F.split("/"),[Z,X]=$.split(":"),[Y,q]=J.split(":");if(!Z||Z.toLowerCase()!=="eip155")throw new V3({reason:"Only EIP-155 supported"});if(!X)throw new V3({reason:"Chain ID not found"});if(!q)throw new V3({reason:"Contract address not found"});if(!Q)throw new V3({reason:"Token ID not found"});if(!Y)throw new V3({reason:"ERC namespace not found"});return{chainID:Number.parseInt(X,10),namespace:Y.toLowerCase(),contractAddress:q,tokenID:Q}}async function Bw(D,{nft:F}){if(F.namespace==="erc721")return aD(D,{address:F.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(F.tokenID)]});if(F.namespace==="erc1155")return aD(D,{address:F.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(F.tokenID)]});throw new NW({namespace:F.namespace})}async function Ww(D,{gatewayUrls:F,record:$}){if(/eip155:/i.test($))return ia(D,{gatewayUrls:F,record:$});return oQ({uri:$,gatewayUrls:F})}async function ia(D,{gatewayUrls:F,record:$}){let J=Gw($),Q=await Bw(D,{nft:J}),{uri:Z,isOnChain:X,isEncoded:Y}=TW({uri:Q,gatewayUrls:F});if(X&&(Z.includes("data:application/json;base64,")||Z.startsWith("{"))){let G=Y?atob(Z.replace("data:application/json;base64,","")):Z,B=JSON.parse(G);return oQ({uri:LW(B),gatewayUrls:F})}let q=J.tokenID;if(J.namespace==="erc1155")q=q.replace("0x","").padStart(64,"0");return qw({gatewayUrls:F,uri:Z.replace(/(?:0x)?{id}/,q)})}z8();Y1();a0();tF();c();W4();async function aQ(D,F){let{blockNumber:$,blockTag:J,key:Q,name:Z,gatewayUrls:X,strict:Y}=F,{chain:q}=D,G=(()=>{if(F.universalResolverAddress)return F.universalResolverAddress;if(!q)throw Error("client chain not configured. universalResolverAddress is required.");return E2({blockNumber:$,chain:q,contract:"ensUniversalResolver"})})(),B=q?.ensTlds;if(B&&!B.some((W)=>Z.endsWith(W)))return null;try{let W={address:G,abi:$Q,args:[nD(f6(Z)),ED({abi:FB,functionName:"text",args:[K4(Z),Q]}),X??[G1]],functionName:"resolveWithGateways",blockNumber:$,blockTag:J},U=await f(D,aD,"readContract")(W);if(U[0]==="0x")return null;let V=O0({abi:FB,functionName:"text",data:U[0]});return V===""?null:V}catch(W){if(Y)throw W;if(y6(W))return null;throw W}}async function Kw(D,{blockNumber:F,blockTag:$,assetGatewayUrls:J,name:Q,gatewayUrls:Z,strict:X,universalResolverAddress:Y}){let q=await f(D,aQ,"getEnsText")({blockNumber:F,blockTag:$,key:"avatar",name:Q,universalResolverAddress:Y,gatewayUrls:Z,strict:X});if(!q)return null;try{return await Ww(D,{record:q,gatewayUrls:J})}catch{return null}}z8();tF();W4();async function Uw(D,F){let{address:$,blockNumber:J,blockTag:Q,coinType:Z=60n,gatewayUrls:X,strict:Y}=F,{chain:q}=D,G=(()=>{if(F.universalResolverAddress)return F.universalResolverAddress;if(!q)throw Error("client chain not configured. universalResolverAddress is required.");return E2({blockNumber:J,chain:q,contract:"ensUniversalResolver"})})();try{let B={address:G,abi:OA,args:[$,Z,X??[G1]],functionName:"reverseWithGateways",blockNumber:J,blockTag:Q},W=f(D,aD,"readContract"),[K]=await W(B);return K||null}catch(B){if(Y)throw B;if(y6(B))return null;throw B}}tF();c();async function Vw(D,F){let{blockNumber:$,blockTag:J,name:Q}=F,{chain:Z}=D,X=(()=>{if(F.universalResolverAddress)return F.universalResolverAddress;if(!Z)throw Error("client chain not configured. universalResolverAddress is required.");return E2({blockNumber:$,chain:Z,contract:"ensUniversalResolver"})})(),Y=Z?.ensTlds;if(Y&&!Y.some((G)=>Q.endsWith(G)))throw Error(`${Q} is not a valid ENS TLD (${Y?.join(", ")}) for chain "${Z.name}" (id: ${Z.id}).`);let[q]=await f(D,aD,"readContract")({address:X,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"},{type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[nD(f6(Q))],blockNumber:$,blockTag:J});return q}U3();c();MW();S8();x8();async function rQ(D,F){let{account:$=D.account,blockNumber:J,blockTag:Q="latest",blobs:Z,data:X,gas:Y,gasPrice:q,maxFeePerBlobGas:G,maxFeePerGas:B,maxPriorityFeePerGas:W,to:K,value:U,...V}=F,H=$?i($):void 0;try{X0(F);let _=(typeof J==="bigint"?k(J):void 0)||Q,O=D.chain?.formatters?.transactionRequest?.format,M=(O||Z0)({...t0(V,{format:O}),account:H,blobs:Z,data:X,gas:Y,gasPrice:q,maxFeePerBlobGas:G,maxFeePerGas:B,maxPriorityFeePerGas:W,to:K,value:U},"createAccessList"),E=await D.request({method:"eth_createAccessList",params:[M,_]});return{accessList:E.accessList,gasUsed:BigInt(E.gasUsed)}}catch(z){throw cQ(z,{...F,account:H,chain:D.chain})}}function t1(D,{method:F}){let $={};if(D.transport.type==="fallback")D.transport.onResponse?.(({method:J,response:Q,status:Z,transport:X})=>{if(Z==="success"&&F===J)$[Q]=X.request});return(J)=>$[J]||D.request}async function Hw(D){let F=t1(D,{method:"eth_newBlockFilter"}),$=await D.request({method:"eth_newBlockFilter"});return{id:$,request:F($),type:"block"}}gD();s();class PW extends P{constructor(D){super(`Filter type "${D}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}K0();c2();Y4();A8();D1();l1();var zw="/docs/contract/encodeEventTopics";function k8(D){let{abi:F,eventName:$,args:J}=D,Q=F[0];if($){let q=o0({abi:F,name:$});if(!q)throw new XQ($,{docsPath:zw});Q=q}if(Q.type!=="event")throw new XQ(void 0,{docsPath:zw});let Z=eD(Q),X=p1(Z),Y=[];if(J&&"inputs"in Q){let q=Q.inputs?.filter((B)=>("indexed"in B)&&B.indexed),G=Array.isArray(J)?J:Object.values(J).length>0?q?.map((B)=>J[B.name])??[]:[];if(G.length>0)Y=q?.map((B,W)=>{if(Array.isArray(G[W]))return G[W].map((K,U)=>Cw({param:B,value:G[W][U]}));return typeof G[W]<"u"&&G[W]!==null?Cw({param:B,value:G[W]}):null})??[]}return[X,...Y]}function Cw({param:D,value:F}){if(D.type==="string"||D.type==="bytes")return OD(O2(F));if(D.type==="tuple"||D.type.match(/^(.*)\[(\d+)?\]$/))throw new PW(D.type);return iD([D],[F])}c();async function sQ(D,F){let{address:$,abi:J,args:Q,eventName:Z,fromBlock:X,strict:Y,toBlock:q}=F,G=t1(D,{method:"eth_newFilter"}),B=Z?k8({abi:J,args:Q,eventName:Z}):void 0,W=await D.request({method:"eth_newFilter",params:[{address:$,fromBlock:typeof X==="bigint"?k(X):X,toBlock:typeof q==="bigint"?k(q):q,topics:B}]});return{abi:J,args:Q,eventName:Z,id:W,request:G(W),strict:Boolean(Y),type:"event"}}c();async function tQ(D,{address:F,args:$,event:J,events:Q,fromBlock:Z,strict:X,toBlock:Y}={}){let q=Q??(J?[J]:void 0),G=t1(D,{method:"eth_newFilter"}),B=[];if(q){if(B=[q.flatMap((U)=>k8({abi:[U],eventName:U.name,args:$}))],J)B=B[0]}let W=await D.request({method:"eth_newFilter",params:[{address:F,fromBlock:typeof Z==="bigint"?k(Z):Z,toBlock:typeof Y==="bigint"?k(Y):Y,...B.length?{topics:B}:{}}]});return{abi:q,args:$,eventName:J?J.name:void 0,fromBlock:Z,id:W,request:G(W),strict:Boolean(X),toBlock:Y,type:"event"}}async function eQ(D){let F=t1(D,{method:"eth_newPendingTransactionFilter"}),$=await D.request({method:"eth_newPendingTransactionFilter"});return{id:$,request:F($),type:"transaction"}}a0();s();Z1();c2();function _w(D){let F=OD(`0x${D.substring(4)}`).substring(26);return O8(`0x${F}`)}_2();D0();c();async function FN({hash:D,signature:F}){let $=DD(D)?D:nD(D),{secp256k1:J}=await Promise.resolve().then(() => (ZZ(),ew));return`0x${(()=>{if(typeof F==="object"&&"r"in F&&"s"in F){let{r:G,s:B,v:W,yParity:K}=F,U=Number(K??W),V=DN(U);return new J.Signature(fD(G),fD(B)).addRecoveryBit(V)}let X=DD(F)?F:nD(F);if(GD(X)!==65)throw Error("invalid signature length");let Y=MD(`0x${X.slice(130)}`),q=DN(Y);return J.Signature.fromCompact(X.substring(2,130)).addRecoveryBit(q)})().recoverPublicKey($.substring(2)).toHex(!1)}`}function DN(D){if(D===0||D===1)return D;if(D===27)return 0;if(D===28)return 1;throw Error("Invalid yParityOrV value")}async function XZ({hash:D,signature:F}){return _w(await FN({hash:D,signature:F}))}K0();c();s();MQ();K0();c();function $N(D,F="hex"){let $=JN(D),J=w6(new Uint8Array($.length));if($.encode(J),F==="hex")return WD(J.bytes);return J.bytes}function JN(D){if(Array.isArray(D))return Er(D.map((F)=>JN(F)));return Rr(D)}function Er(D){let F=D.reduce((Q,Z)=>Q+Z.length,0),$=QN(F);return{length:(()=>{if(F<=55)return 1+F;return 1+$+F})(),encode(Q){if(F<=55)Q.pushByte(192+F);else if(Q.pushByte(247+$),$===1)Q.pushUint8(F);else if($===2)Q.pushUint16(F);else if($===3)Q.pushUint24(F);else Q.pushUint32(F);for(let{encode:Z}of D)Z(Q)}}}function Rr(D){let F=typeof D==="string"?W0(D):D,$=QN(F.length);return{length:(()=>{if(F.length===1&&F[0]<128)return 1;if(F.length<=55)return 1+F.length;return 1+$+F.length})(),encode(Q){if(F.length===1&&F[0]<128)Q.pushBytes(F);else if(F.length<=55)Q.pushByte(128+F.length),Q.pushBytes(F);else{if(Q.pushByte(183+$),$===1)Q.pushUint8(F.length);else if($===2)Q.pushUint16(F.length);else if($===3)Q.pushUint24(F.length);else Q.pushUint32(F.length);Q.pushBytes(F)}}}}function QN(D){if(D<256)return 1;if(D<65536)return 2;if(D<16777216)return 3;if(D<4294967296)return 4;throw new P("Length is too large.")}c2();function ZN(D){let{chainId:F,nonce:$,to:J}=D,Q=D.contractAddress??D.address,Z=OD(i0(["0x05",$N([F?k(F):"0x",Q,$?k($):"0x"])]));if(J==="bytes")return W0(Z);return Z}async function JF(D){let{authorization:F,signature:$}=D;return XZ({hash:ZN(F),signature:$??F})}c();jQ();S6();s();w8();class eW extends P{constructor(D,{account:F,docsPath:$,chain:J,data:Q,gas:Z,gasPrice:X,maxFeePerGas:Y,maxPriorityFeePerGas:q,nonce:G,to:B,value:W}){let K=eF({from:F?.address,to:B,value:typeof W<"u"&&`${j6(W)} ${J?.nativeCurrency?.symbol||"ETH"}`,data:Q,gas:Z,gasPrice:typeof X<"u"&&`${$0(X)} gwei`,maxFeePerGas:typeof Y<"u"&&`${$0(Y)} gwei`,maxPriorityFeePerGas:typeof q<"u"&&`${$0(q)} gwei`,nonce:G});super(D.shortMessage,{cause:D,docsPath:$,metaMessages:[...D.metaMessages?[...D.metaMessages," "]:[],"Estimate Gas Arguments:",K].filter(Boolean),name:"EstimateGasExecutionError"});Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=D}}W3();w4();function XN(D,{docsPath:F,...$}){let J=(()=>{let Q=s1(D,$);if(Q instanceof a2)return D;return Q})();return new eW(J,{docsPath:F,...$})}S8();iQ();x8();S6();s();class y4 extends P{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class C3 extends P{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class DK extends P{constructor({maxPriorityFeePerGas:D}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${$0(D)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}D0();s();class f4 extends P{constructor({blockHash:D,blockNumber:F}){let $="Block";if(D)$=`Block at hash "${D}"`;if(F)$=`Block at number "${F}"`;super(`${$} could not be found.`,{name:"BlockNotFoundError"})}}c();D0();var FK={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function z7(D,F){let $={...D,blockHash:D.blockHash?D.blockHash:null,blockNumber:D.blockNumber?BigInt(D.blockNumber):null,chainId:D.chainId?MD(D.chainId):void 0,gas:D.gas?BigInt(D.gas):void 0,gasPrice:D.gasPrice?BigInt(D.gasPrice):void 0,maxFeePerBlobGas:D.maxFeePerBlobGas?BigInt(D.maxFeePerBlobGas):void 0,maxFeePerGas:D.maxFeePerGas?BigInt(D.maxFeePerGas):void 0,maxPriorityFeePerGas:D.maxPriorityFeePerGas?BigInt(D.maxPriorityFeePerGas):void 0,nonce:D.nonce?MD(D.nonce):void 0,to:D.to?D.to:null,transactionIndex:D.transactionIndex?Number(D.transactionIndex):null,type:D.type?FK[D.type]:void 0,typeHex:D.type?D.type:void 0,value:D.value?BigInt(D.value):void 0,v:D.v?BigInt(D.v):void 0};if(D.authorizationList)$.authorizationList=Ar(D.authorizationList);if($.yParity=(()=>{if(D.yParity)return Number(D.yParity);if(typeof $.v==="bigint"){if($.v===0n||$.v===27n)return 0;if($.v===1n||$.v===28n)return 1;if($.v>=35n)return $.v%2n===0n?1:0}return})(),$.type==="legacy")delete $.accessList,delete $.maxFeePerBlobGas,delete $.maxFeePerGas,delete $.maxPriorityFeePerGas,delete $.yParity;if($.type==="eip2930")delete $.maxFeePerBlobGas,delete $.maxFeePerGas,delete $.maxPriorityFeePerGas;if($.type==="eip1559")delete $.maxFeePerBlobGas;return $}function Ar(D){return D.map((F)=>({address:F.address,chainId:Number(F.chainId),nonce:Number(F.nonce),r:F.r,s:F.s,yParity:Number(F.yParity)}))}function YZ(D,F){let $=(D.transactions??[]).map((J)=>{if(typeof J==="string")return J;return z7(J)});return{...D,baseFeePerGas:D.baseFeePerGas?BigInt(D.baseFeePerGas):null,blobGasUsed:D.blobGasUsed?BigInt(D.blobGasUsed):void 0,difficulty:D.difficulty?BigInt(D.difficulty):void 0,excessBlobGas:D.excessBlobGas?BigInt(D.excessBlobGas):void 0,gasLimit:D.gasLimit?BigInt(D.gasLimit):void 0,gasUsed:D.gasUsed?BigInt(D.gasUsed):void 0,hash:D.hash?D.hash:null,logsBloom:D.logsBloom?D.logsBloom:null,nonce:D.nonce?D.nonce:null,number:D.number?BigInt(D.number):null,size:D.size?BigInt(D.size):void 0,timestamp:D.timestamp?BigInt(D.timestamp):void 0,transactions:$,totalDifficulty:D.totalDifficulty?BigInt(D.totalDifficulty):null}}async function Y0(D,{blockHash:F,blockNumber:$,blockTag:J=D.experimental_blockTag??"latest",includeTransactions:Q}={}){let Z=Q??!1,X=$!==void 0?k($):void 0,Y=null;if(F)Y=await D.request({method:"eth_getBlockByHash",params:[F,Z]},{dedupe:!0});else Y=await D.request({method:"eth_getBlockByNumber",params:[X||J,Z]},{dedupe:Boolean(X)});if(!Y)throw new f4({blockHash:F,blockNumber:$});return(D.chain?.formatters?.block?.format||YZ)(Y,"getBlock")}async function C7(D){let F=await D.request({method:"eth_gasPrice"});return BigInt(F)}async function YN(D,F){return $K(D,F)}async function $K(D,F){let{block:$,chain:J=D.chain,request:Q}=F||{};try{let Z=J?.fees?.maxPriorityFeePerGas??J?.fees?.defaultPriorityFee;if(typeof Z==="function"){let Y=$||await f(D,Y0,"getBlock")({}),q=await Z({block:Y,client:D,request:Q});if(q===null)throw Error();return q}if(typeof Z<"u")return Z;let X=await D.request({method:"eth_maxPriorityFeePerGas"});return fD(X)}catch{let[Z,X]=await Promise.all([$?Promise.resolve($):f(D,Y0,"getBlock")({}),f(D,C7,"getGasPrice")({})]);if(typeof Z.baseFeePerGas!=="bigint")throw new C3;let Y=X-Z.baseFeePerGas;if(Y<0n)return 0n;return Y}}async function qN(D,F){return qZ(D,F)}async function qZ(D,F){let{block:$,chain:J=D.chain,request:Q,type:Z="eip1559"}=F||{},X=await(async()=>{if(typeof J?.fees?.baseFeeMultiplier==="function")return J.fees.baseFeeMultiplier({block:$,client:D,request:Q});return J?.fees?.baseFeeMultiplier??1.2})();if(X<1)throw new y4;let q=10**(X.toString().split(".")[1]?.length??0),G=(K)=>K*BigInt(Math.ceil(X*q))/BigInt(q),B=$?$:await f(D,Y0,"getBlock")({});if(typeof J?.fees?.estimateFeesPerGas==="function"){let K=await J.fees.estimateFeesPerGas({block:$,client:D,multiply:G,request:Q,type:Z});if(K!==null)return K}if(Z==="eip1559"){if(typeof B.baseFeePerGas!=="bigint")throw new C3;let K=typeof Q?.maxPriorityFeePerGas==="bigint"?Q.maxPriorityFeePerGas:await $K(D,{block:B,chain:J,request:Q}),U=G(B.baseFeePerGas);return{maxFeePerGas:Q?.maxFeePerGas??U+K,maxPriorityFeePerGas:K}}return{gasPrice:Q?.gasPrice??G(await f(D,C7,"getGasPrice")({}))}}D0();c();async function _7(D,{address:F,blockTag:$="latest",blockNumber:J}){let Q=await D.request({method:"eth_getTransactionCount",params:[F,typeof J==="bigint"?k(J):$]},{dedupe:Boolean(J)});return MD(Q)}K0();c();function GZ(D){let{kzg:F}=D,$=D.to??(typeof D.blobs[0]==="string"?"hex":"bytes"),J=typeof D.blobs[0]==="string"?D.blobs.map((Z)=>W0(Z)):D.blobs,Q=[];for(let Z of J)Q.push(Uint8Array.from(F.blobToKzgCommitment(Z)));return $==="bytes"?Q:Q.map((Z)=>WD(Z))}K0();c();function BZ(D){let{kzg:F}=D,$=D.to??(typeof D.blobs[0]==="string"?"hex":"bytes"),J=typeof D.blobs[0]==="string"?D.blobs.map((X)=>W0(X)):D.blobs,Q=typeof D.commitments[0]==="string"?D.commitments.map((X)=>W0(X)):D.commitments,Z=[];for(let X=0;X<J.length;X++){let Y=J[X],q=Q[X];Z.push(Uint8Array.from(F.computeBlobKzgProof(Y,q)))}return $==="bytes"?Z:Z.map((X)=>WD(X))}c();xW();var GN=H3;K0();c();function BN(D,F){let $=F||"hex",J=GN(DD(D,{strict:!1})?O2(D):D);if($==="bytes")return J;return nD(J)}function WN(D){let{commitment:F,version:$=1}=D,J=D.to??(typeof F==="string"?"hex":"bytes"),Q=BN(F,"bytes");return Q.set([$],0),J==="bytes"?Q:WD(Q)}function KN(D){let{commitments:F,version:$}=D,J=D.to??(typeof F[0]==="string"?"hex":"bytes"),Q=[];for(let Z of F)Q.push(WN({commitment:Z,to:J,version:$}));return Q}var UN=32,VN=4096,HN=131072,JK=761855;s();class QK extends P{constructor({maxSize:D,size:F}){super("Blob size is too large.",{metaMessages:[`Max: ${D} bytes`,`Given: ${F} bytes`],name:"BlobSizeTooLargeError"})}}class ZK extends P{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}MQ();_2();K0();c();function zN(D){let F=D.to??(typeof D.data==="string"?"hex":"bytes"),$=typeof D.data==="string"?W0(D.data):D.data,J=GD($);if(!J)throw new ZK;if(J>JK)throw new QK({maxSize:JK,size:J});let Q=[],Z=!0,X=0;while(Z){let Y=w6(new Uint8Array(HN)),q=0;while(q<VN){let G=$.slice(X,X+(UN-1));if(Y.pushByte(0),Y.pushBytes(G),G.length<31){Y.pushByte(128),Z=!1;break}q++,X+=31}Q.push(Y)}return F==="bytes"?Q.map((Y)=>Y.bytes):Q.map((Y)=>WD(Y.bytes))}function CN(D){let{data:F,kzg:$,to:J}=D,Q=D.blobs??zN({data:F,to:J}),Z=D.commitments??GZ({blobs:Q,kzg:$,to:J}),X=D.proofs??BZ({blobs:Q,commitments:Z,kzg:$,to:J}),Y=[];for(let q=0;q<Q.length;q++)Y.push({blob:Q[q],commitment:Z[q],proof:X[q]});return Y}rF();x8();w8();function _N(D){if(D.type)return D.type;if(typeof D.authorizationList<"u")return"eip7702";if(typeof D.blobs<"u"||typeof D.blobVersionedHashes<"u"||typeof D.maxFeePerBlobGas<"u"||typeof D.sidecars<"u")return"eip4844";if(typeof D.maxFeePerGas<"u"||typeof D.maxPriorityFeePerGas<"u")return"eip1559";if(typeof D.gasPrice<"u"){if(typeof D.accessList<"u")return"eip2930";return"legacy"}throw new pB({transaction:D})}W3();w8();w4();function QF(D,{docsPath:F,...$}){let J=(()=>{let Q=s1(D,$);if(Q instanceof a2)return D;return Q})();return new lB(J,{docsPath:F,...$})}S8();x8();D0();async function R0(D){let F=await D.request({method:"eth_chainId"},{dedupe:!0});return MD(F)}async function M7(D,F){let{account:$=D.account,accessList:J,authorizationList:Q,chain:Z=D.chain,blobVersionedHashes:X,blobs:Y,data:q,gas:G,gasPrice:B,maxFeePerBlobGas:W,maxFeePerGas:K,maxPriorityFeePerGas:U,nonce:V,nonceManager:H,to:z,type:_,value:O,...C}=F,M=await(async()=>{if(!$)return V;if(!H)return V;if(typeof V<"u")return V;let R=i($),T=Z?Z.id:await f(D,R0,"getChainId")({});return await H.consume({address:R.address,chainId:T,client:D})})();X0(F);let E=Z?.formatters?.transactionRequest?.format,w=(E||Z0)({...t0(C,{format:E}),account:$?i($):void 0,accessList:J,authorizationList:Q,blobs:Y,blobVersionedHashes:X,data:q,gas:G,gasPrice:B,maxFeePerBlobGas:W,maxFeePerGas:K,maxPriorityFeePerGas:U,nonce:M,to:z,type:_,value:O},"fillTransaction");try{let R=await D.request({method:"eth_fillTransaction",params:[w]}),N=(Z?.formatters?.transaction?.format||z7)(R.tx);if(delete N.blockHash,delete N.blockNumber,delete N.r,delete N.s,delete N.transactionIndex,delete N.v,delete N.yParity,N.data=N.input,N.gas)N.gas=F.gas??N.gas;if(N.gasPrice)N.gasPrice=F.gasPrice??N.gasPrice;if(N.maxFeePerBlobGas)N.maxFeePerBlobGas=F.maxFeePerBlobGas??N.maxFeePerBlobGas;if(N.maxFeePerGas)N.maxFeePerGas=F.maxFeePerGas??N.maxFeePerGas;if(N.maxPriorityFeePerGas)N.maxPriorityFeePerGas=F.maxPriorityFeePerGas??N.maxPriorityFeePerGas;if(N.nonce)N.nonce=F.nonce??N.nonce;let j=await(async()=>{if(typeof Z?.fees?.baseFeeMultiplier==="function"){let S=await f(D,Y0,"getBlock")({});return Z.fees.baseFeeMultiplier({block:S,client:D,request:F})}return Z?.fees?.baseFeeMultiplier??1.2})();if(j<1)throw new y4;let y=10**(j.toString().split(".")[1]?.length??0),m=(S)=>S*BigInt(Math.ceil(j*y))/BigInt(y);if(N.maxFeePerGas&&!F.maxFeePerGas)N.maxFeePerGas=m(N.maxFeePerGas);if(N.gasPrice&&!F.gasPrice)N.gasPrice=m(N.gasPrice);return{raw:R.raw,transaction:{from:w.from,...N}}}catch(R){throw QF(R,{...F,chain:D.chain})}}var b4=["blobVersionedHashes","chainId","fees","gas","nonce","type"],MN=new Map,XK=new G2(128);async function y8(D,F){let $=F;$.account??=D.account,$.parameters??=b4;let{account:J,chain:Q=D.chain,nonceManager:Z,parameters:X}=$,Y=(()=>{if(typeof Q?.prepareTransactionRequest==="function")return{fn:Q.prepareTransactionRequest,runAt:["beforeFillTransaction"]};if(Array.isArray(Q?.prepareTransactionRequest))return{fn:Q.prepareTransactionRequest[0],runAt:Q.prepareTransactionRequest[1].runAt};return})(),q;async function G(){if(q)return q;if(typeof $.chainId<"u")return $.chainId;if(Q)return Q.id;return q=await f(D,R0,"getChainId")({}),q}let B=J?i(J):J,W=$.nonce;if(X.includes("nonce")&&typeof W>"u"&&B&&Z){let M=await G();W=await Z.consume({address:B.address,chainId:M,client:D})}if(Y?.fn&&Y.runAt?.includes("beforeFillTransaction"))$=await Y.fn({...$,chain:Q},{phase:"beforeFillTransaction"}),W??=$.nonce;let U=(()=>{if((X.includes("blobVersionedHashes")||X.includes("sidecars"))&&$.kzg&&$.blobs)return!1;if(XK.get(D.uid)===!1)return!1;if(!["fees","gas"].some((E)=>X.includes(E)))return!1;if(X.includes("chainId")&&typeof $.chainId!=="number")return!0;if(X.includes("nonce")&&typeof W!=="number")return!0;if(X.includes("fees")&&typeof $.gasPrice!=="bigint"&&(typeof $.maxFeePerGas!=="bigint"||typeof $.maxPriorityFeePerGas!=="bigint"))return!0;if(X.includes("gas")&&typeof $.gas!=="bigint")return!0;return!1})()?await f(D,M7,"fillTransaction")({...$,nonce:W}).then((M)=>{let{chainId:E,from:A,gas:w,gasPrice:R,nonce:T,maxFeePerBlobGas:N,maxFeePerGas:j,maxPriorityFeePerGas:L,type:y,...m}=M.transaction;return XK.set(D.uid,!0),{...$,...A?{from:A}:{},...y?{type:y}:{},...typeof E<"u"?{chainId:E}:{},...typeof w<"u"?{gas:w}:{},...typeof R<"u"?{gasPrice:R}:{},...typeof T<"u"?{nonce:T}:{},...typeof N<"u"?{maxFeePerBlobGas:N}:{},...typeof j<"u"?{maxFeePerGas:j}:{},...typeof L<"u"?{maxPriorityFeePerGas:L}:{},..."nonceKey"in m&&typeof m.nonceKey<"u"?{nonceKey:m.nonceKey}:{}}}).catch((M)=>{let E=M;if(E.name!=="TransactionExecutionError")return $;if(E.walk?.((w)=>{let R=w;return R.name==="MethodNotFoundRpcError"||R.name==="MethodNotSupportedRpcError"}))XK.set(D.uid,!1);return $}):$;W??=U.nonce,$={...U,...B?{from:B?.address}:{},...W?{nonce:W}:{}};let{blobs:V,gas:H,kzg:z,type:_}=$;if(Y?.fn&&Y.runAt?.includes("beforeFillParameters"))$=await Y.fn({...$,chain:Q},{phase:"beforeFillParameters"});let O;async function C(){if(O)return O;return O=await f(D,Y0,"getBlock")({blockTag:"latest"}),O}if(X.includes("nonce")&&typeof W>"u"&&B&&!Z)$.nonce=await f(D,_7,"getTransactionCount")({address:B.address,blockTag:"pending"});if((X.includes("blobVersionedHashes")||X.includes("sidecars"))&&V&&z){let M=GZ({blobs:V,kzg:z});if(X.includes("blobVersionedHashes")){let E=KN({commitments:M,to:"hex"});$.blobVersionedHashes=E}if(X.includes("sidecars")){let E=BZ({blobs:V,commitments:M,kzg:z}),A=CN({blobs:V,commitments:M,proofs:E,to:"hex"});$.sidecars=A}}if(X.includes("chainId"))$.chainId=await G();if((X.includes("fees")||X.includes("type"))&&typeof _>"u")try{$.type=_N($)}catch{let M=MN.get(D.uid);if(typeof M>"u")M=typeof(await C())?.baseFeePerGas==="bigint",MN.set(D.uid,M);$.type=M?"eip1559":"legacy"}if(X.includes("fees"))if($.type!=="legacy"&&$.type!=="eip2930"){if(typeof $.maxFeePerGas>"u"||typeof $.maxPriorityFeePerGas>"u"){let M=await C(),{maxFeePerGas:E,maxPriorityFeePerGas:A}=await qZ(D,{block:M,chain:Q,request:$});if(typeof $.maxPriorityFeePerGas>"u"&&$.maxFeePerGas&&$.maxFeePerGas<A)throw new DK({maxPriorityFeePerGas:A});$.maxPriorityFeePerGas=A,$.maxFeePerGas=E}}else{if(typeof $.maxFeePerGas<"u"||typeof $.maxPriorityFeePerGas<"u")throw new C3;if(typeof $.gasPrice>"u"){let M=await C(),{gasPrice:E}=await qZ(D,{block:M,chain:Q,request:$,type:"legacy"});$.gasPrice=E}}if(X.includes("gas")&&typeof H>"u")$.gas=await f(D,O7,"estimateGas")({...$,account:B,prepare:B?.type==="local"?[]:["blobVersionedHashes"]});if(Y?.fn&&Y.runAt?.includes("afterFillParameters"))$=await Y.fn({...$,chain:Q},{phase:"afterFillParameters"});return X0($),delete $.parameters,$}async function O7(D,F){let{account:$=D.account,prepare:J=!0}=F,Q=$?i($):void 0,Z=(()=>{if(Array.isArray(J))return J;if(Q?.type!=="local")return["blobVersionedHashes"];return})();try{let X=await(async()=>{if(F.to)return F.to;if(F.authorizationList&&F.authorizationList.length>0)return await JF({authorization:F.authorizationList[0]}).catch(()=>{throw new P("`to` is required. Could not infer from `authorizationList`")});return})(),{accessList:Y,authorizationList:q,blobs:G,blobVersionedHashes:B,blockNumber:W,blockTag:K,data:U,gas:V,gasPrice:H,maxFeePerBlobGas:z,maxFeePerGas:_,maxPriorityFeePerGas:O,nonce:C,value:M,stateOverride:E,...A}=J?await y8(D,{...F,parameters:Z,to:X}):F;if(V&&F.gas!==V)return V;let R=(typeof W==="bigint"?k(W):void 0)||K,T=U7(E);X0(F);let N=D.chain?.formatters?.transactionRequest?.format,L=(N||Z0)({...t0(A,{format:N}),account:Q,accessList:Y,authorizationList:q,blobs:G,blobVersionedHashes:B,data:U,gasPrice:H,maxFeePerBlobGas:z,maxFeePerGas:_,maxPriorityFeePerGas:O,nonce:C,to:X,value:M},"estimateGas");return BigInt(await D.request({method:"eth_estimateGas",params:T?[L,R??D.experimental_blockTag??"latest",T]:R?[L,R]:[L]}))}catch(X){throw XN(X,{...F,account:Q,chain:D.chain})}}async function ON(D,F){let{abi:$,address:J,args:Q,functionName:Z,dataSuffix:X=typeof D.dataSuffix==="string"?D.dataSuffix:D.dataSuffix?.value,...Y}=F,q=ED({abi:$,args:Q,functionName:Z});try{return await f(D,O7,"estimateGas")({data:`${q}${X?X.replace("0x",""):""}`,to:J,...Y})}catch(G){let B=Y.account?i(Y.account):void 0;throw B2(G,{abi:$,address:J,args:Q,docsPath:"/docs/contract/estimateContractGas",functionName:Z,sender:B?.address})}}z8();Y1();a0();c();U3();async function EN(D,{address:F,blockNumber:$,blockTag:J=D.experimental_blockTag??"latest"}){if(D.batch?.multicall&&D.chain?.contracts?.multicall3){let X=D.chain.contracts.multicall3.address,Y=ED({abi:m2,functionName:"getEthBalance",args:[F]}),{data:q}=await f(D,w2,"call")({to:X,data:Y,blockNumber:$,blockTag:J});return O0({abi:m2,functionName:"getEthBalance",args:[F],data:q||"0x"})}let Q=typeof $==="bigint"?k($):void 0,Z=await D.request({method:"eth_getBalance",params:[F,Q||J]});return BigInt(Z)}async function RN(D){let F=await D.request({method:"eth_blobBaseFee"});return BigInt(F)}var Ir=new Map,wr=new Map;function AN(D){let F=(Q,Z)=>({clear:()=>Z.delete(Q),get:()=>Z.get(Q),set:(X)=>Z.set(Q,X)}),$=F(D,Ir),J=F(D,wr);return{clear:()=>{$.clear(),J.clear()},promise:$,response:J}}async function IN(D,{cacheKey:F,cacheTime:$=Number.POSITIVE_INFINITY}){let J=AN(F),Q=J.response.get();if(Q&&$>0){if(Date.now()-Q.created.getTime()<$)return Q.data}let Z=J.promise.get();if(!Z)Z=D(),J.promise.set(Z);try{let X=await Z;return J.response.set({created:new Date,data:X}),X}finally{J.promise.clear()}}var Nr=(D)=>`blockNumber.${D}`;async function f8(D,{cacheTime:F=D.cacheTime}={}){let $=await IN(()=>D.request({method:"eth_blockNumber"}),{cacheKey:Nr(D.uid),cacheTime:F});return BigInt($)}D0();c();async function wN(D,{blockHash:F,blockNumber:$,blockTag:J="latest"}={}){let Q=$!==void 0?k($):void 0,Z;if(F)Z=await D.request({method:"eth_getBlockTransactionCountByHash",params:[F]},{dedupe:!0});else Z=await D.request({method:"eth_getBlockTransactionCountByNumber",params:[Q||J]},{dedupe:Boolean(Q)});return MD(Z)}c();async function v4(D,{address:F,blockNumber:$,blockTag:J="latest"}){let Q=$!==void 0?k($):void 0,Z=await D.request({method:"eth_getCode",params:[F,Q||J]},{dedupe:Boolean(Q)});if(Z==="0x")return;return Z}l1();K3();K0();c2();Y4();gD();TB();_2();Y4();X4();D1();var NN="/docs/contract/decodeEventLog";function _3(D){let{abi:F,data:$,strict:J,topics:Q}=D,Z=J??!0,[X,...Y]=Q;if(!X)throw new WB({docsPath:NN});let q=F.find((_)=>_.type==="event"&&X===p1(eD(_)));if(!(q&&("name"in q))||q.type!=="event")throw new KB(X,{docsPath:NN});let{name:G,inputs:B}=q,W=B?.some((_)=>!(("name"in _)&&_.name)),K=W?[]:{},U=B.map((_,O)=>[_,O]).filter(([_])=>("indexed"in _)&&_.indexed),V=[];for(let _=0;_<U.length;_++){let[O,C]=U[_],M=Y[_];if(!M){if(Z)throw new pF({abiItem:q,param:O});V.push([O,C]);continue}K[W?C:O.name||C]=Tr({param:O,value:M})}let H=B.filter((_)=>!(("indexed"in _)&&_.indexed)),z=Z?H:[...V.map(([_])=>_),...H];if(z.length>0){if($&&$!=="0x")try{let _=X1(z,$);if(_){let O=0;if(!Z)for(let[C,M]of V)K[W?M:C.name||M]=_[O++];if(W){for(let C=0;C<B.length;C++)if(K[C]===void 0&&O<_.length)K[C]=_[O++]}else for(let C=0;C<H.length;C++)K[H[C].name]=_[O++]}}catch(_){if(Z){if(_ instanceof a9||_ instanceof Q4)throw new g1({abiItem:q,data:$,params:z,size:GD($)});throw _}}else if(Z)throw new g1({abiItem:q,data:"0x",params:z,size:0})}return{eventName:G,args:Object.values(K).length>0?K:void 0}}function Tr({param:D,value:F}){if(D.type==="string"||D.type==="bytes"||D.type==="tuple"||D.type.match(/^(.*)\[(\d+)?\]$/))return F;return(X1([D],F)||[])[0]}function E7(D){let{abi:F,args:$,logs:J,strict:Q=!0}=D,Z=(()=>{if(!D.eventName)return;if(Array.isArray(D.eventName))return D.eventName;return[D.eventName]})(),X=F.filter((Y)=>Y.type==="event").map((Y)=>({abi:Y,selector:p1(Y)}));return J.map((Y)=>{let q=X.filter((W)=>Y.topics[0]===W.selector);if(q.length===0)return null;let G,B;for(let W of q)try{G=_3({...Y,abi:[W.abi],strict:!0}),B=W;break}catch{}if(!G&&!Q){B=q[0];try{G=_3({data:Y.data,topics:Y.topics,abi:[B.abi],strict:!1})}catch{let W=B.abi.inputs?.some((K)=>!(("name"in K)&&K.name));return{...Y,args:W?[]:{},eventName:B.abi.name}}}if(!G||!B)return null;if(Z&&!Z.includes(G.eventName))return null;if(!Lr({args:G.args,inputs:B.abi.inputs,matchArgs:$}))return null;return{...G,...Y}}).filter(Boolean)}function Lr(D){let{args:F,inputs:$,matchArgs:J}=D;if(!J)return!0;if(!F)return!1;function Q(Z,X,Y){try{if(Z.type==="address")return I2(X,Y);if(Z.type==="string"||Z.type==="bytes")return OD(O2(X))===Y;return X===Y}catch{return!1}}if(Array.isArray(F)&&Array.isArray(J))return J.every((Z,X)=>{if(Z===null||Z===void 0)return!0;let Y=$[X];if(!Y)return!1;return(Array.isArray(Z)?Z:[Z]).some((G)=>Q(Y,G,F[X]))});if(typeof F==="object"&&!Array.isArray(F)&&typeof J==="object"&&!Array.isArray(J))return Object.entries(J).every(([Z,X])=>{if(X===null||X===void 0)return!0;let Y=$.find((G)=>G.name===Z);if(!Y)return!1;return(Array.isArray(X)?X:[X]).some((G)=>Q(Y,G,F[Z]))});return!1}c();function A0(D,{args:F,eventName:$}={}){return{...D,blockHash:D.blockHash?D.blockHash:null,blockNumber:D.blockNumber?BigInt(D.blockNumber):null,blockTimestamp:D.blockTimestamp?BigInt(D.blockTimestamp):D.blockTimestamp===null?null:void 0,logIndex:D.logIndex?Number(D.logIndex):null,transactionHash:D.transactionHash?D.transactionHash:null,transactionIndex:D.transactionIndex?Number(D.transactionIndex):null,...$?{args:F,eventName:$}:{}}}async function R7(D,{address:F,blockHash:$,fromBlock:J,toBlock:Q,event:Z,events:X,args:Y,strict:q}={}){let G=q??!1,B=X??(Z?[Z]:void 0),W=[];if(B){if(W=[B.flatMap((H)=>k8({abi:[H],eventName:H.name,args:X?void 0:Y}))],Z)W=W[0]}let K;if($)K=await D.request({method:"eth_getLogs",params:[{address:F,topics:W,blockHash:$}]});else K=await D.request({method:"eth_getLogs",params:[{address:F,topics:W,fromBlock:typeof J==="bigint"?k(J):J,toBlock:typeof Q==="bigint"?k(Q):Q}]});let U=K.map((V)=>A0(V));if(!B)return U;return E7({abi:B,args:Y,logs:U,strict:G})}async function WZ(D,F){let{abi:$,address:J,args:Q,blockHash:Z,eventName:X,fromBlock:Y,toBlock:q,strict:G}=F,B=X?o0({abi:$,name:X}):void 0,W=!B?$.filter((K)=>K.type==="event"):void 0;return f(D,R7,"getLogs")({address:J,args:Q,blockHash:Z,event:B,events:W,fromBlock:Y,toBlock:q,strict:G})}s();class YK extends P{constructor({address:D}){super(`No EIP-712 domain found on contract "${D}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${D}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."],name:"Eip712DomainNotFoundError"})}}async function TN(D,F){let{address:$,factory:J,factoryData:Q}=F;try{let[Z,X,Y,q,G,B,W]=await f(D,aD,"readContract")({abi:Pr,address:$,functionName:"eip712Domain",factory:J,factoryData:Q});return{domain:{name:X,version:Y,chainId:Number(q),verifyingContract:G,salt:B},extensions:W,fields:Z}}catch(Z){let X=Z;if(X.name==="ContractFunctionExecutionError"&&X.cause.name==="ContractFunctionZeroDataError")throw new YK({address:$});throw X}}var Pr=[{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"}];c();function LN(D){return{baseFeePerGas:D.baseFeePerGas.map((F)=>BigInt(F)),gasUsedRatio:D.gasUsedRatio,oldestBlock:BigInt(D.oldestBlock),reward:D.reward?.map((F)=>F.map(($)=>BigInt($)))}}async function PN(D,{blockCount:F,blockNumber:$,blockTag:J="latest",rewardPercentiles:Q}){let Z=typeof $==="bigint"?k($):void 0,X=await D.request({method:"eth_feeHistory",params:[k(F),Z||J,Q]},{dedupe:Boolean(Z)});return LN(X)}async function ZF(D,{filter:F}){let $="strict"in F&&F.strict,J=await F.request({method:"eth_getFilterChanges",params:[F.id]});if(typeof J[0]==="string")return J;let Q=J.map((Z)=>A0(Z));if(!("abi"in F)||!F.abi)return Q;return E7({abi:F.abi,logs:Q,strict:$})}async function jN(D,{filter:F}){let $=F.strict??!1,Q=(await F.request({method:"eth_getFilterLogs",params:[F.id]})).map((Z)=>A0(Z));if(!F.abi)return Q;return E7({abi:F.abi,logs:Q,strict:$})}c();D0();c();function xr(D){return D.map((F)=>({...F,value:BigInt(F.value)}))}function SN(D){return{...D,balance:D.balance?BigInt(D.balance):void 0,nonce:D.nonce?MD(D.nonce):void 0,storageProof:D.storageProof?xr(D.storageProof):void 0}}async function xN(D,{address:F,blockNumber:$,blockTag:J,storageKeys:Q}){let Z=J??"latest",X=$!==void 0?k($):void 0,Y=await D.request({method:"eth_getProof",params:[F,Q,X||Z]});return SN(Y)}c();async function kN(D,{address:F,blockNumber:$,blockTag:J="latest",slot:Q}){let Z=$!==void 0?k($):void 0;return await D.request({method:"eth_getStorageAt",params:[F,Q,Z||J]})}w8();c();async function A7(D,{blockHash:F,blockNumber:$,blockTag:J,hash:Q,index:Z,sender:X,nonce:Y}){let q=J||"latest",G=$!==void 0?k($):void 0,B=null;if(Q)B=await D.request({method:"eth_getTransactionByHash",params:[Q]},{dedupe:!0});else if(F)B=await D.request({method:"eth_getTransactionByBlockHashAndIndex",params:[F,k(Z)]},{dedupe:!0});else if((G||q)&&typeof Z==="number")B=await D.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[G||q,k(Z)]},{dedupe:Boolean(G)});else if(X&&typeof Y==="number")B=await D.request({method:"eth_getTransactionBySenderAndNonce",params:[X,k(Y)]},{dedupe:!0});if(!B)throw new q4({blockHash:F,blockNumber:$,blockTag:q,hash:Q,index:Z});return(D.chain?.formatters?.transaction?.format||z7)(B,"getTransaction")}async function yN(D,{hash:F,transactionReceipt:$}){let[J,Q]=await Promise.all([f(D,f8,"getBlockNumber")({}),F?f(D,A7,"getTransaction")({hash:F}):void 0]),Z=$?.blockNumber||Q?.blockNumber;if(!Z)return 0n;return J-Z+1n}w8();D0();var qK={"0x0":"reverted","0x1":"success"};function KZ(D,F){let $={...D,blockNumber:D.blockNumber?BigInt(D.blockNumber):null,contractAddress:D.contractAddress?D.contractAddress:null,cumulativeGasUsed:D.cumulativeGasUsed?BigInt(D.cumulativeGasUsed):null,effectiveGasPrice:D.effectiveGasPrice?BigInt(D.effectiveGasPrice):null,gasUsed:D.gasUsed?BigInt(D.gasUsed):null,logs:D.logs?D.logs.map((J)=>A0(J)):null,to:D.to?D.to:null,transactionIndex:D.transactionIndex?MD(D.transactionIndex):null,status:D.status?qK[D.status]:null,type:D.type?FK[D.type]||D.type:null};if(D.blobGasPrice)$.blobGasPrice=BigInt(D.blobGasPrice);if(D.blobGasUsed)$.blobGasUsed=BigInt(D.blobGasUsed);return $}async function I7(D,{hash:F}){let $=await D.request({method:"eth_getTransactionReceipt",params:[F]},{dedupe:!0});if(!$)throw new G4({hash:F});return(D.chain?.formatters?.transactionReceipt?.format||KZ)($,"getTransactionReceipt")}z8();gD();s();q1();Y1();a0();tF();async function fN(D,F){let{account:$,authorizationList:J,allowFailure:Q=!0,blockNumber:Z,blockOverrides:X,blockTag:Y,stateOverride:q}=F,G=F.contracts,{batchSize:B=F.batchSize??1024,deployless:W=F.deployless??!1}=typeof D.batch?.multicall==="object"?D.batch.multicall:{},K=(()=>{if(F.multicallAddress)return F.multicallAddress;if(W)return null;if(D.chain)return E2({blockNumber:Z,chain:D.chain,contract:"multicall3"});throw Error("client chain not configured. multicallAddress is required.")})(),U=[[]],V=0,H=0;for(let O=0;O<G.length;O++){let{abi:C,address:M,args:E,functionName:A}=G[O];try{let w=ED({abi:C,args:E,functionName:A});if(H+=(w.length-2)/2,B>0&&H>B&&U[V].length>0)V++,H=(w.length-2)/2,U[V]=[];U[V]=[...U[V],{allowFailure:!0,callData:w,target:M}]}catch(w){let R=B2(w,{abi:C,address:M,args:E,docsPath:"/docs/contract/multicall",functionName:A,sender:$});if(!Q)throw R;U[V]=[...U[V],{allowFailure:!0,callData:"0x",target:M}]}}let z=await Promise.allSettled(U.map((O)=>f(D,aD,"readContract")({...K===null?{code:W7}:{address:K},abi:m2,account:$,args:[O],authorizationList:J,blockNumber:Z,blockOverrides:X,blockTag:Y,functionName:"aggregate3",stateOverride:q}))),_=[];for(let O=0;O<z.length;O++){let C=z[O];if(C.status==="rejected"){if(!Q)throw C.reason;for(let E=0;E<U[O].length;E++)_.push({status:"failure",error:C.reason,result:void 0});continue}let M=C.value;for(let E=0;E<M.length;E++){let{returnData:A,success:w}=M[E],{callData:R}=U[O][E],{abi:T,address:N,functionName:j,args:L}=G[_.length];try{if(R==="0x")throw new d2;if(!w)throw new T8({data:A});let y=O0({abi:T,args:L,data:A,functionName:j});_.push(Q?{result:y,status:"success"}:y)}catch(y){let m=B2(y,{abi:T,address:N,args:L,docsPath:"/docs/contract/multicall",functionName:j});if(!Q)throw m;_.push({error:m,result:void 0,status:"failure"})}}}if(_.length!==G.length)throw new P("multicall results mismatch");return _}CW();gD();q1();W3();Y1();a0();c();w4();S8();iQ();x8();async function h4(D,F){let{blockNumber:$,blockTag:J=D.experimental_blockTag??"latest",blocks:Q,returnFullTransactions:Z,traceTransfers:X,validation:Y}=F;try{let q=[];for(let K of Q){let U=K.blockOverrides?dQ(K.blockOverrides):void 0,V=K.calls.map((z)=>{let _=z,O=_.account?i(_.account):void 0,C=_.abi?ED(_):_.data,M={..._,account:O,data:_.dataSuffix?ID([C||"0x",_.dataSuffix]):C,from:_.from??O?.address};return X0(M),Z0(M)}),H=K.stateOverrides?U7(K.stateOverrides):void 0;q.push({blockOverrides:U,calls:V,stateOverrides:H})}let B=(typeof $==="bigint"?k($):void 0)||J;return(await D.request({method:"eth_simulateV1",params:[{blockStateCalls:q,returnFullTransactions:Z,traceTransfers:X,validation:Y},B]})).map((K,U)=>({...YZ(K),calls:K.calls.map((V,H)=>{let{abi:z,args:_,functionName:O,to:C}=Q[U].calls[H],M=V.error?.data??V.returnData,E=BigInt(V.gasUsed),A=V.logs?.map((N)=>A0(N)),w=V.status==="0x1"?"success":"failure",R=z&&w==="success"&&M!=="0x"?O0({abi:z,data:M,functionName:O}):null,T=(()=>{if(w==="success")return;let N;if(M==="0x")N=new d2;else if(M)N=new T8({data:M});if(!N)return;return B2(N,{abi:z??[],address:C??"0x",args:_,functionName:O??"<unknown>"})})();return{data:M,gasUsed:E,logs:A,status:w,...w==="success"?{result:R}:{error:T}}})}))}catch(q){let G=q,B=s1(G,{});if(B instanceof a2)throw G;throw B}}A6();s0();AB();o1();Q0();function M3(D,F={}){let{as:$=typeof D==="string"?"Hex":"Bytes"}=F,J=CQ(vI(D));if($==="Bytes")return J;return dD(J)}Q0();o1();class BK extends Map{constructor(D){super();Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=D}get(D){let F=super.get(D);if(super.has(D)&&F!==void 0)this.delete(D),super.set(D,F);return F}set(D,F){if(super.set(D,F),this.maxSize&&this.size>this.maxSize){let $=this.keys().next().value;if($)this.delete($)}return this}}var kr={checksum:new BK(8192)},UZ=kr.checksum;s0();o1();s0();Q0();function bN(D,F={}){let{compressed:$}=F,{prefix:J,x:Q,y:Z}=D;if($===!1||typeof Q==="bigint"&&typeof Z==="bigint"){if(J!==4)throw new WK({prefix:J,cause:new mN});return}if($===!0||typeof Q==="bigint"&&typeof Z>"u"){if(J!==3&&J!==2)throw new WK({prefix:J,cause:new gN});return}throw new uN({publicKey:D})}function vN(D){let F=(()=>{if(z4(D))return hN(D);if(pI(D))return fr(D);let{prefix:$,x:J,y:Q}=D;if(typeof J==="bigint"&&typeof Q==="bigint")return{prefix:$??4,x:J,y:Q};return{prefix:$,x:J}})();return bN(F),F}function fr(D){return hN(dD(D))}function hN(D){if(D.length!==132&&D.length!==130&&D.length!==68)throw new dN({publicKey:D});if(D.length===130){let J=BigInt(PD(D,0,32)),Q=BigInt(PD(D,32,64));return{prefix:4,x:J,y:Q}}if(D.length===132){let J=Number(PD(D,0,1)),Q=BigInt(PD(D,1,33)),Z=BigInt(PD(D,33,65));return{prefix:J,x:Q,y:Z}}let F=Number(PD(D,0,1)),$=BigInt(PD(D,1,33));return{prefix:F,x:$}}function KK(D,F={}){bN(D);let{prefix:$,x:J,y:Q}=D,{includePrefix:Z=!0}=F;return bD(Z?KD($,{size:1}):"0x",KD(J,{size:32}),typeof Q==="bigint"?KD(Q,{size:32}):"0x")}class uN extends d{constructor({publicKey:D}){super(`Value \`${a1(D)}\` is not a valid public key.`,{metaMessages:["Public key must contain:","- an `x` and `prefix` value (compressed)","- an `x`, `y`, and `prefix` value (uncompressed)"]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidError"})}}class WK extends d{constructor({prefix:D,cause:F}){super(`Prefix "${D}" is invalid.`,{cause:F});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidPrefixError"})}}class gN extends d{constructor(){super("Prefix must be 2 or 3 for compressed public keys.");Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidCompressedPrefixError"})}}class mN extends d{constructor(){super("Prefix must be 4 for uncompressed public keys.");Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidUncompressedPrefixError"})}}class dN extends d{constructor({publicKey:D}){super(`Value \`${D}\` is an invalid public key size.`,{metaMessages:["Expected: 33 bytes (compressed + prefix), 64 bytes (uncompressed) or 65 bytes (uncompressed + prefix).",`Received ${LD(G7(D))} bytes.`]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidSerializedSizeError"})}}var br=/^0x[a-fA-F0-9]{40}$/;function O3(D,F={}){let{strict:$=!0}=F;if(!br.test(D))throw new UK({address:D,cause:new cN});if($){if(D.toLowerCase()===D)return;if(VZ(D)!==D)throw new UK({address:D,cause:new nN})}}function VZ(D){if(UZ.has(D))return UZ.get(D);O3(D,{strict:!1});let F=D.substring(2).toLowerCase(),$=M3(hI(F),{as:"Bytes"}),J=F.split("");for(let Z=0;Z<40;Z+=2){if($[Z>>1]>>4>=8&&J[Z])J[Z]=J[Z].toUpperCase();if(($[Z>>1]&15)>=8&&J[Z+1])J[Z+1]=J[Z+1].toUpperCase()}let Q=`0x${J.join("")}`;return UZ.set(D,Q),Q}function vr(D,F={}){let{checksum:$=!1}=F;if(O3(D),$)return VZ(D);return D}function lN(D,F={}){let $=M3(`0x${KK(D).slice(4)}`).substring(26);return vr(`0x${$}`,F)}function HZ(D,F={}){let{strict:$=!0}=F??{};try{return O3(D,{strict:$}),!0}catch{return!1}}class UK extends d{constructor({address:D,cause:F}){super(`Address "${D}" is invalid.`,{cause:F});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class cN extends d{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value.");Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}class nN extends d{constructor(){super("Address does not match its checksum counterpart.");Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}s0();function _Z(D){let F=!0,$="",J=0,Q="",Z=!1;for(let X=0;X<D.length;X++){let Y=D[X];if(["(",")",","].includes(Y))F=!0;if(Y==="(")J++;if(Y===")")J--;if(!F)continue;if(J===0){if(Y===" "&&["event","function","error",""].includes(Q))Q="";else if(Q+=Y,Y===")"){Z=!0;break}continue}if(Y===" "){if(D[X-1]!==","&&$!==","&&$!==",(")$="",F=!1;continue}Q+=Y,$+=Y}if(!Z)throw new d("Unable to normalize signature.");return Q}function CZ(D,F){let $=typeof D,J=F.type;switch(J){case"address":return HZ(D,{strict:!1});case"bool":return $==="boolean";case"function":return $==="string";case"string":return $==="string";default:{if(J==="tuple"&&"components"in F)return Object.values(F.components).every((Q,Z)=>{return CZ(Object.values(D)[Z],Q)});if(/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(J))return $==="number"||$==="bigint";if(/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(J))return $==="string"||D instanceof Uint8Array;if(/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(J))return Array.isArray(D)&&D.every((Q)=>CZ(Q,{...F,type:J.replace(/(\[[0-9]{0,}\])$/,"")}));return!1}}}function VK(D,F,$){for(let J in D){let Q=D[J],Z=F[J];if(Q.type==="tuple"&&Z.type==="tuple"&&"components"in Q&&"components"in Z)return VK(Q.components,Z.components,$[J]);let X=[Q.type,Z.type];if((()=>{if(X.includes("address")&&X.includes("bytes20"))return!0;if(X.includes("address")&&X.includes("string"))return HZ($[J],{strict:!1});if(X.includes("address")&&X.includes("bytes"))return HZ($[J],{strict:!1});return!1})())return X}return}function MZ(D,F={}){let{prepare:$=!0}=F,J=(()=>{if(Array.isArray(D))return n9(D);if(typeof D==="string")return n9(D);return D})();return{...J,...$?{hash:w7(J)}:{}}}function u4(D,F,$){let{args:J=[],prepare:Q=!0}=$??{},Z=z4(F,{strict:!1}),X=D.filter((G)=>{if(Z){if(G.type==="function"||G.type==="error")return HK(G)===PD(F,0,4);if(G.type==="event")return w7(G)===F;return!1}return"name"in G&&G.name===F});if(X.length===0)throw new E3({name:F});if(X.length===1)return{...X[0],...Q?{hash:w7(X[0])}:{}};let Y;for(let G of X){if(!("inputs"in G))continue;if(!J||J.length===0){if(!G.inputs||G.inputs.length===0)return{...G,...Q?{hash:w7(G)}:{}};continue}if(!G.inputs)continue;if(G.inputs.length===0)continue;if(G.inputs.length!==J.length)continue;if(J.every((W,K)=>{let U="inputs"in G&&G.inputs[K];if(!U)return!1;return CZ(W,U)})){if(Y&&"inputs"in Y&&Y.inputs){let W=VK(G.inputs,Y.inputs,J);if(W)throw new iN({abiItem:G,type:W[0]},{abiItem:Y,type:W[1]})}Y=G}}let q=(()=>{if(Y)return Y;let[G,...B]=X;return{...G,overloads:B}})();if(!q)throw new E3({name:F});return{...q,...Q?{hash:w7(q)}:{}}}function HK(...D){let F=(()=>{if(Array.isArray(D[0])){let[$,J]=D;return u4($,J)}return D[0]})();return PD(w7(F),0,4)}function ur(...D){let F=(()=>{if(Array.isArray(D[0])){let[J,Q]=D;return u4(J,Q)}return D[0]})(),$=(()=>{if(typeof F==="string")return F;return dF(F)})();return _Z($)}function w7(...D){let F=(()=>{if(Array.isArray(D[0])){let[$,J]=D;return u4($,J)}return D[0]})();if(typeof F!=="string"&&"hash"in F&&F.hash)return F.hash;return M3(B7(ur(F)))}class iN extends d{constructor(D,F){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${D.type}\` in \`${_Z(dF(D.abiItem))}\`, and`,`\`${F.type}\` in \`${_Z(dF(F.abiItem))}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.AmbiguityError"})}}class E3 extends d{constructor({name:D,data:F,type:$="item"}){let J=(()=>{if(D)return` with name "${D}"`;if(F)return` with data "${F}"`;return""})();super(`ABI ${$}${J} not found.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}A6();o1();s0();Q0();o1();s0();Q0();var aN=/^(.*)\[([0-9]*)\]$/,rN=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,OZ=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,ZgD=2n**(8n-1n)-1n,XgD=2n**(16n-1n)-1n,YgD=2n**(24n-1n)-1n,qgD=2n**(32n-1n)-1n,GgD=2n**(40n-1n)-1n,BgD=2n**(48n-1n)-1n,WgD=2n**(56n-1n)-1n,KgD=2n**(64n-1n)-1n,UgD=2n**(72n-1n)-1n,VgD=2n**(80n-1n)-1n,HgD=2n**(88n-1n)-1n,zgD=2n**(96n-1n)-1n,CgD=2n**(104n-1n)-1n,_gD=2n**(112n-1n)-1n,MgD=2n**(120n-1n)-1n,OgD=2n**(128n-1n)-1n,EgD=2n**(136n-1n)-1n,RgD=2n**(144n-1n)-1n,AgD=2n**(152n-1n)-1n,IgD=2n**(160n-1n)-1n,wgD=2n**(168n-1n)-1n,NgD=2n**(176n-1n)-1n,TgD=2n**(184n-1n)-1n,LgD=2n**(192n-1n)-1n,PgD=2n**(200n-1n)-1n,jgD=2n**(208n-1n)-1n,SgD=2n**(216n-1n)-1n,xgD=2n**(224n-1n)-1n,kgD=2n**(232n-1n)-1n,ygD=2n**(240n-1n)-1n,fgD=2n**(248n-1n)-1n,bgD=2n**(256n-1n)-1n,vgD=-(2n**(8n-1n)),hgD=-(2n**(16n-1n)),ugD=-(2n**(24n-1n)),ggD=-(2n**(32n-1n)),mgD=-(2n**(40n-1n)),dgD=-(2n**(48n-1n)),pgD=-(2n**(56n-1n)),lgD=-(2n**(64n-1n)),cgD=-(2n**(72n-1n)),ngD=-(2n**(80n-1n)),igD=-(2n**(88n-1n)),ogD=-(2n**(96n-1n)),agD=-(2n**(104n-1n)),rgD=-(2n**(112n-1n)),sgD=-(2n**(120n-1n)),tgD=-(2n**(128n-1n)),egD=-(2n**(136n-1n)),DmD=-(2n**(144n-1n)),FmD=-(2n**(152n-1n)),$mD=-(2n**(160n-1n)),JmD=-(2n**(168n-1n)),QmD=-(2n**(176n-1n)),ZmD=-(2n**(184n-1n)),XmD=-(2n**(192n-1n)),YmD=-(2n**(200n-1n)),qmD=-(2n**(208n-1n)),GmD=-(2n**(216n-1n)),BmD=-(2n**(224n-1n)),WmD=-(2n**(232n-1n)),KmD=-(2n**(240n-1n)),UmD=-(2n**(248n-1n)),VmD=-(2n**(256n-1n)),HmD=2n**8n-1n,zmD=2n**16n-1n,CmD=2n**24n-1n,_mD=2n**32n-1n,MmD=2n**40n-1n,OmD=2n**48n-1n,EmD=2n**56n-1n,RmD=2n**64n-1n,AmD=2n**72n-1n,ImD=2n**80n-1n,wmD=2n**88n-1n,NmD=2n**96n-1n,TmD=2n**104n-1n,LmD=2n**112n-1n,PmD=2n**120n-1n,jmD=2n**128n-1n,SmD=2n**136n-1n,xmD=2n**144n-1n,kmD=2n**152n-1n,ymD=2n**160n-1n,fmD=2n**168n-1n,bmD=2n**176n-1n,vmD=2n**184n-1n,hmD=2n**192n-1n,umD=2n**200n-1n,gmD=2n**208n-1n,mmD=2n**216n-1n,dmD=2n**224n-1n,pmD=2n**232n-1n,lmD=2n**240n-1n,cmD=2n**248n-1n,zK=2n**256n-1n;function R3(D,F,$){let{checksumAddress:J,staticPosition:Q}=$,Z=MK(F.type);if(Z){let[X,Y]=Z;return mr(D,{...F,type:Y},{checksumAddress:J,length:X,staticPosition:Q})}if(F.type==="tuple")return cr(D,F,{checksumAddress:J,staticPosition:Q});if(F.type==="address")return gr(D,{checksum:J});if(F.type==="bool")return dr(D);if(F.type.startsWith("bytes"))return pr(D,F,{staticPosition:Q});if(F.type.startsWith("uint")||F.type.startsWith("int"))return lr(D,F);if(F.type==="string")return nr(D,{staticPosition:Q});throw new m4(F.type)}var tN=32,CK=32;function gr(D,F={}){let{checksum:$=!1}=F,J=D.readBytes(32);return[((Z)=>$?VZ(Z):Z)(dD(uI(J,-20))),32]}function mr(D,F,$){let{checksumAddress:J,length:Q,staticPosition:Z}=$;if(!Q){let q=P8(D.readBytes(CK)),G=Z+q,B=G+tN;D.setPosition(G);let W=P8(D.readBytes(tN)),K=g4(F),U=0,V=[];for(let H=0;H<W;++H){D.setPosition(B+(K?H*32:U));let[z,_]=R3(D,F,{checksumAddress:J,staticPosition:B});U+=_,V.push(z)}return D.setPosition(Z+32),[V,32]}if(g4(F)){let q=P8(D.readBytes(CK)),G=Z+q,B=[];for(let W=0;W<Q;++W){D.setPosition(G+W*32);let[K]=R3(D,F,{checksumAddress:J,staticPosition:G});B.push(K)}return D.setPosition(Z+32),[B,32]}let X=0,Y=[];for(let q=0;q<Q;++q){let[G,B]=R3(D,F,{checksumAddress:J,staticPosition:Z+X});X+=B,Y.push(G)}return[Y,X]}function dr(D){return[mI(D.readBytes(32),{size:32}),32]}function pr(D,F,{staticPosition:$}){let[J,Q]=F.type.split("bytes");if(!Q){let X=P8(D.readBytes(32));D.setPosition($+X);let Y=P8(D.readBytes(32));if(Y===0)return D.setPosition($+32),["0x",32];let q=D.readBytes(Y);return D.setPosition($+32),[dD(q),32]}return[dD(D.readBytes(Number.parseInt(Q,10),32)),32]}function lr(D,F){let $=F.type.startsWith("int"),J=Number.parseInt(F.type.split("int")[1]||"256",10),Q=D.readBytes(32);return[J>48?gI(Q,{signed:$}):P8(Q,{signed:$}),32]}function cr(D,F,$){let{checksumAddress:J,staticPosition:Q}=$,Z=F.components.length===0||F.components.some(({name:q})=>!q),X=Z?[]:{},Y=0;if(g4(F)){let q=P8(D.readBytes(CK)),G=Q+q;for(let B=0;B<F.components.length;++B){let W=F.components[B];D.setPosition(G+Y);let[K,U]=R3(D,W,{checksumAddress:J,staticPosition:G});Y+=U,X[Z?B:W?.name]=K}return D.setPosition(Q+32),[X,32]}for(let q=0;q<F.components.length;++q){let G=F.components[q],[B,W]=R3(D,G,{checksumAddress:J,staticPosition:Q});X[Z?q:G?.name]=B,Y+=W}return[X,Y]}function nr(D,{staticPosition:F}){let $=P8(D.readBytes(32)),J=F+$;D.setPosition(J);let Q=P8(D.readBytes(32));if(Q===0)return D.setPosition(F+32),["",32];let Z=D.readBytes(Q,32),X=dI(KW(Z));return D.setPosition(F+32),[X,32]}function eN({checksumAddress:D,parameters:F,values:$}){let J=[];for(let Q=0;Q<F.length;Q++)J.push(_K({checksumAddress:D,parameter:F[Q],value:$[Q]}));return J}function _K({checksumAddress:D=!1,parameter:F,value:$}){let J=F,Q=MK(J.type);if(Q){let[Z,X]=Q;return or($,{checksumAddress:D,length:Z,parameter:{...J,type:X}})}if(J.type==="tuple")return er($,{checksumAddress:D,parameter:J});if(J.type==="address")return ir($,{checksum:D});if(J.type==="bool")return rr($);if(J.type.startsWith("uint")||J.type.startsWith("int")){let Z=J.type.startsWith("int"),[,,X="256"]=OZ.exec(J.type)??[];return sr($,{signed:Z,size:Number(X)})}if(J.type.startsWith("bytes"))return ar($,{type:J.type});if(J.type==="string")return tr($);throw new m4(J.type)}function EZ(D){let F=0;for(let Z=0;Z<D.length;Z++){let{dynamic:X,encoded:Y}=D[Z];if(X)F+=32;else F+=LD(Y)}let $=[],J=[],Q=0;for(let Z=0;Z<D.length;Z++){let{dynamic:X,encoded:Y}=D[Z];if(X)$.push(KD(F+Q,{size:32})),J.push(Y),Q+=LD(Y);else $.push(Y)}return bD(...$,...J)}function ir(D,F){let{checksum:$=!1}=F;return O3(D,{strict:$}),{dynamic:!1,encoded:z1(D.toLowerCase())}}function or(D,F){let{checksumAddress:$,length:J,parameter:Q}=F,Z=J===null;if(!Array.isArray(D))throw new EK(D);if(!Z&&D.length!==J)throw new OK({expectedLength:J,givenLength:D.length,type:`${Q.type}[${J}]`});let X=!1,Y=[];for(let q=0;q<D.length;q++){let G=_K({checksumAddress:$,parameter:Q,value:D[q]});if(G.dynamic)X=!0;Y.push(G)}if(Z||X){let q=EZ(Y);if(Z){let G=KD(Y.length,{size:32});return{dynamic:!0,encoded:Y.length>0?bD(G,q):G}}if(X)return{dynamic:!0,encoded:q}}return{dynamic:!1,encoded:bD(...Y.map(({encoded:q})=>q))}}function ar(D,{type:F}){let[,$]=F.split("bytes"),J=LD(D);if(!$){let Q=D;if(J%32!==0)Q=j8(Q,Math.ceil((D.length-2)/2/32)*32);return{dynamic:!0,encoded:bD(z1(KD(J,{size:32})),Q)}}if(J!==Number.parseInt($,10))throw new RZ({expectedSize:Number.parseInt($,10),value:D});return{dynamic:!1,encoded:j8(D)}}function rr(D){if(typeof D!=="boolean")throw new d(`Invalid boolean value: "${D}" (type: ${typeof D}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:z1(gQ(D))}}function sr(D,{signed:F,size:$}){if(typeof $==="number"){let J=2n**(BigInt($)-(F?1n:0n))-1n,Q=F?-J-1n:0n;if(D>J||D<Q)throw new mQ({max:J.toString(),min:Q.toString(),signed:F,size:$/8,value:D.toString()})}return{dynamic:!1,encoded:KD(D,{size:32,signed:F})}}function tr(D){let F=B7(D),$=Math.ceil(LD(F)/32),J=[];for(let Q=0;Q<$;Q++)J.push(j8(PD(F,Q*32,(Q+1)*32)));return{dynamic:!0,encoded:bD(j8(KD(LD(F),{size:32})),...J)}}function er(D,F){let{checksumAddress:$,parameter:J}=F,Q=!1,Z=[];for(let X=0;X<J.components.length;X++){let Y=J.components[X],q=Array.isArray(D)?X:Y.name,G=_K({checksumAddress:$,parameter:Y,value:D[q]});if(Z.push(G),G.dynamic)Q=!0}return{dynamic:Q,encoded:Q?EZ(Z):bD(...Z.map(({encoded:X})=>X))}}function MK(D){let F=D.match(/^(.*)\[(\d+)?\]$/);return F?[F[2]?Number(F[2]):null,F[1]]:void 0}function g4(D){let{type:F}=D;if(F==="string")return!0;if(F==="bytes")return!0;if(F.endsWith("[]"))return!0;if(F==="tuple")return D.components?.some(g4);let $=MK(D.type);if($&&g4({...D,type:$[1]}))return!0;return!1}s0();var Fs={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new FT({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(D){if(D<0||D>this.bytes.length-1)throw new DT({length:this.bytes.length,position:D})},decrementPosition(D){if(D<0)throw new RK({offset:D});let F=this.position-D;this.assertPosition(F),this.position=F},getReadCount(D){return this.positionReadCount.get(D||this.position)||0},incrementPosition(D){if(D<0)throw new RK({offset:D});let F=this.position+D;this.assertPosition(F),this.position=F},inspectByte(D){let F=D??this.position;return this.assertPosition(F),this.bytes[F]},inspectBytes(D,F){let $=F??this.position;return this.assertPosition($+D-1),this.bytes.subarray($,$+D)},inspectUint8(D){let F=D??this.position;return this.assertPosition(F),this.bytes[F]},inspectUint16(D){let F=D??this.position;return this.assertPosition(F+1),this.dataView.getUint16(F)},inspectUint24(D){let F=D??this.position;return this.assertPosition(F+2),(this.dataView.getUint16(F)<<8)+this.dataView.getUint8(F+2)},inspectUint32(D){let F=D??this.position;return this.assertPosition(F+3),this.dataView.getUint32(F)},pushByte(D){this.assertPosition(this.position),this.bytes[this.position]=D,this.position++},pushBytes(D){this.assertPosition(this.position+D.length-1),this.bytes.set(D,this.position),this.position+=D.length},pushUint8(D){this.assertPosition(this.position),this.bytes[this.position]=D,this.position++},pushUint16(D){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,D),this.position+=2},pushUint24(D){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,D>>8),this.dataView.setUint8(this.position+2,D&255),this.position+=3},pushUint32(D){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,D),this.position+=4},readByte(){this.assertReadLimit(),this._touch();let D=this.inspectByte();return this.position++,D},readBytes(D,F){this.assertReadLimit(),this._touch();let $=this.inspectBytes(D);return this.position+=F??D,$},readUint8(){this.assertReadLimit(),this._touch();let D=this.inspectUint8();return this.position+=1,D},readUint16(){this.assertReadLimit(),this._touch();let D=this.inspectUint16();return this.position+=2,D},readUint24(){this.assertReadLimit(),this._touch();let D=this.inspectUint24();return this.position+=3,D},readUint32(){this.assertReadLimit(),this._touch();let D=this.inspectUint32();return this.position+=4,D},get remaining(){return this.bytes.length-this.position},setPosition(D){let F=this.position;return this.assertPosition(D),this.position=D,()=>this.position=F},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;let D=this.getReadCount();if(this.positionReadCount.set(this.position,D+1),D>0)this.recursiveReadCount++}};function AZ(D,{recursiveReadLimit:F=8192}={}){let $=Object.create(Fs);return $.bytes=D,$.dataView=new DataView(D.buffer,D.byteOffset,D.byteLength),$.positionReadCount=new Map,$.recursiveReadLimit=F,$}class RK extends d{constructor({offset:D}){super(`Offset \`${D}\` cannot be negative.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}class DT extends d{constructor({length:D,position:F}){super(`Position \`${F}\` is out of bounds (\`0 < position < ${D}\`).`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}class FT extends d{constructor({count:D,limit:F}){super(`Recursive read limit of \`${F}\` exceeded (recursive read count: \`${D}\`).`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}function N7(D,F,$={}){let{as:J="Array",checksumAddress:Q=!1}=$,Z=typeof F==="string"?q7(F):F,X=AZ(Z);if(A2(Z)===0&&D.length>0)throw new QT;if(A2(Z)&&A2(Z)<32)throw new JT({data:typeof F==="string"?F:dD(F),parameters:D,size:A2(Z)});let Y=0,q=J==="Array"?[]:{};for(let G=0;G<D.length;++G){let B=D[G];X.setPosition(Y);let[W,K]=R3(X,B,{checksumAddress:Q,staticPosition:0});if(Y+=K,J==="Array")q.push(W);else q[B.name??G]=W}return q}function XF(D,F,$){let{checksumAddress:J=!1}=$??{};if(D.length!==F.length)throw new IK({expectedLength:D.length,givenLength:F.length});let Q=eN({checksumAddress:J,parameters:D,values:F}),Z=EZ(Q);if(Z.length===0)return"0x";return Z}function AK(D,F){if(D.length!==F.length)throw new IK({expectedLength:D.length,givenLength:F.length});let $=[];for(let J=0;J<D.length;J++){let Q=D[J],Z=F[J];$.push(AK.encode(Q,Z))}return bD(...$)}(function(D){function F($,J,Q=!1){if($==="address"){let q=J;return O3(q),z1(q.toLowerCase(),Q?32:0)}if($==="string")return B7(J);if($==="bytes")return J;if($==="bool")return z1(gQ(J),Q?32:1);let Z=$.match(OZ);if(Z){let[q,G,B="256"]=Z,W=Number.parseInt(B,10)/8;return KD(J,{size:Q?32:W,signed:G==="int"})}let X=$.match(rN);if(X){let[q,G]=X;if(Number.parseInt(G,10)!==(J.length-2)/2)throw new RZ({expectedSize:Number.parseInt(G,10),value:J});return j8(J,Q?32:0)}let Y=$.match(aN);if(Y&&Array.isArray(J)){let[q,G]=Y,B=[];for(let W=0;W<J.length;W++)B.push(F(G,J[W],!0));if(B.length===0)return"0x";return bD(...B)}throw new m4($)}D.encode=F})(AK||(AK={}));function p4(D){if(Array.isArray(D)&&typeof D[0]==="string")return H8(D);if(typeof D==="string")return H8(D);return D}class JT extends d{constructor({data:D,parameters:F,size:$}){super(`Data size of ${$} bytes is too small for given parameters.`,{metaMessages:[`Params: (${e8(F)})`,`Data: ${D} (${$} bytes)`]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}class QT extends d{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.');Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}class OK extends d{constructor({expectedLength:D,givenLength:F,type:$}){super(`Array length mismatch for type \`${$}\`. Expected: \`${D}\`. Given: \`${F}\`.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}class RZ extends d{constructor({expectedSize:D,value:F}){super(`Size of bytes "${F}" (bytes${LD(F)}) does not match expected size (bytes${D}).`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}class IK extends d{constructor({expectedLength:D,givenLength:F}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${D}`,`Given length (values): ${F}`].join(`
288
- `));Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}class EK extends d{constructor(D){super(`Value \`${D}\` is not a valid array.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}class m4 extends d{constructor(D){super(`Type \`${D}\` is not a valid ABI Type.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}Q0();function ZT(...D){let[F,$]=(()=>{if(Array.isArray(D[0])){let[Z,X]=D;return[$s(Z),X]}return D})(),{bytecode:J,args:Q}=$;return bD(J,F.inputs?.length&&Q?.length?XF(F.inputs,Q):"0x")}function XT(D){return MZ(D)}function $s(D){let F=D.find(($)=>$.type==="constructor");if(!F)throw new E3({name:"constructor"});return F}Q0();function qT(...D){let[F,$=[]]=(()=>{if(Array.isArray(D[0])){let[G,B,W]=D;return[YT(G,B,{args:W}),W]}let[Y,q]=D;return[Y,q]})(),{overloads:J}=F,Q=J?YT([F,...J],F.name,{args:$}):F,Z=Qs(Q),X=$.length>0?XF(Q.inputs,$):void 0;return X?bD(Z,X):Z}function A3(D,F={}){return MZ(D,F)}function YT(D,F,$){let J=u4(D,F,$);if(J.type!=="function")throw new E3({name:F,type:"function"});return J}function Qs(D){return HK(D)}var GT="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",s2="0x0000000000000000000000000000000000000000";s();a0();var Xs="0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033";async function BT(D,F){let{blockNumber:$,blockTag:J,calls:Q,stateOverrides:Z,traceAssetChanges:X,traceTransfers:Y,validation:q}=F,G=F.account?i(F.account):void 0;if(X&&!G)throw new P("`account` is required when `traceAssetChanges` is true");let B=G?ZT(XT("constructor(bytes, bytes)"),{bytecode:pQ,args:[Xs,qT(A3("function getBalance(address)"),[G.address])]}):void 0,W=X?await Promise.all(F.calls.map(async(b)=>{if(!b.data&&!b.abi)return;let{accessList:u}=await rQ(D,{account:G.address,...b,data:b.abi?ED(b):b.data});return u.map(({address:o,storageKeys:cD})=>cD.length>0?o:null)})).then((b)=>b.flat().filter(Boolean)):[],K=await h4(D,{blockNumber:$,blockTag:J,blocks:[...X?[{calls:[{data:B}],stateOverrides:Z},{calls:W.map((b,u)=>({abi:[A3("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[G.address],to:b,from:s2,nonce:u})),stateOverrides:[{address:s2,nonce:0}]}]:[],{calls:[...Q,{}].map((b)=>({...b,from:G?.address})),stateOverrides:Z},...X?[{calls:[{data:B}]},{calls:W.map((b,u)=>({abi:[A3("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[G.address],to:b,from:s2,nonce:u})),stateOverrides:[{address:s2,nonce:0}]},{calls:W.map((b,u)=>({to:b,abi:[A3("function decimals() returns (uint256)")],functionName:"decimals",from:s2,nonce:u})),stateOverrides:[{address:s2,nonce:0}]},{calls:W.map((b,u)=>({to:b,abi:[A3("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:s2,nonce:u})),stateOverrides:[{address:s2,nonce:0}]},{calls:W.map((b,u)=>({to:b,abi:[A3("function symbol() returns (string)")],functionName:"symbol",from:s2,nonce:u})),stateOverrides:[{address:s2,nonce:0}]}]:[]],traceTransfers:Y,validation:q}),U=X?K[2]:K[0],[V,H,,z,_,O,C,M]=X?K:[],{calls:E,...A}=U,w=E.slice(0,-1)??[],R=V?.calls??[],T=H?.calls??[],N=[...R,...T].map((b)=>b.status==="success"?fD(b.data):null),j=z?.calls??[],L=_?.calls??[],y=[...j,...L].map((b)=>b.status==="success"?fD(b.data):null),m=(O?.calls??[]).map((b)=>b.status==="success"?b.result:null),S=(M?.calls??[]).map((b)=>b.status==="success"?b.result:null),h=(C?.calls??[]).map((b)=>b.status==="success"?b.result:null),g=[];for(let[b,u]of y.entries()){let o=N[b];if(typeof u!=="bigint")continue;if(typeof o!=="bigint")continue;let cD=m[b-1],RD=S[b-1],V2=h[b-1],$2=(()=>{if(b===0)return{address:GT,decimals:18,symbol:"ETH"};return{address:W[b-1],decimals:V2||cD?Number(cD??1):void 0,symbol:RD??void 0}})();if(g.some((_0)=>_0.token.address===$2.address))continue;g.push({token:$2,value:{pre:o,post:u,diff:u-o}})}return{assetChanges:g,block:A,results:w}}Y1();a0();U3();async function WT(D,F){let{abi:$,address:J,args:Q,functionName:Z,dataSuffix:X=typeof D.dataSuffix==="string"?D.dataSuffix:D.dataSuffix?.value,...Y}=F,q=Y.account?i(Y.account):D.account,G=ED({abi:$,args:Q,functionName:Z});try{let{data:B}=await f(D,w2,"call")({batch:!1,data:`${G}${X?X.replace("0x",""):""}`,to:J,...Y,account:q}),W=O0({abi:$,args:Q,functionName:Z,data:B||"0x"}),K=$.filter((U)=>("name"in U)&&U.name===F.functionName);return{result:W,request:{abi:K,address:J,args:Q,dataSuffix:X,functionName:Z,...Y,account:q}}}catch(B){throw B2(B,{abi:$,address:J,args:Q,docsPath:"/docs/contract/simulateContract",functionName:Z,sender:q?.address})}}async function YF(D,{filter:F}){return F.request({method:"eth_uninstallFilter",params:[F.id]})}var l4={};H2(l4,{wrap:()=>Bs,validate:()=>Ws,unwrap:()=>KT,universalSignatureValidatorBytecode:()=>Ys,universalSignatureValidatorAbi:()=>qs,magicBytes:()=>wK,from:()=>Gs,assert:()=>NK,InvalidWrappedSignatureError:()=>TK});s0();Q0();var wK="0x6492649264926492649264926492649264926492649264926492649264926492",Ys="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",qs=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}];function NK(D){if(PD(D,-32)!==wK)throw new TK(D)}function Gs(D){if(typeof D==="string")return KT(D);return D}function KT(D){NK(D);let[F,$,J]=N7(p4("address, bytes, bytes"),D);return{data:$,signature:J,to:F}}function Bs(D){let{data:F,signature:$,to:J}=D;return bD(XF(p4("address, bytes, bytes"),[J,F,$]),wK)}function Ws(D){try{return NK(D),!0}catch{return!1}}class TK extends d{constructor(D){super(`Value \`${D}\` is an invalid ERC-6492 wrapped signature.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc6492.InvalidWrappedSignatureError"})}}var c4={};H2(c4,{wrap:()=>Ns,validate:()=>Ts,unwrap:()=>NT,suffixParameters:()=>kK,magicBytes:()=>xK,from:()=>ws,assert:()=>NZ,InvalidWrappedSignatureError:()=>yK});Q0();o1();s0();Q0();function Ks(D,F){let{as:$}=F,J=VT(D),Q=AZ(new Uint8Array(J.length));if(J.encode(Q),$==="Hex")return dD(Q.bytes);return Q.bytes}function UT(D,F={}){let{as:$="Hex"}=F;return Ks(D,{as:$})}function VT(D){if(Array.isArray(D))return Us(D.map((F)=>VT(F)));return Vs(D)}function Us(D){let F=D.reduce((Q,Z)=>Q+Z.length,0),$=HT(F);return{length:(()=>{if(F<=55)return 1+F;return 1+$+F})(),encode(Q){if(F<=55)Q.pushByte(192+F);else if(Q.pushByte(247+$),$===1)Q.pushUint8(F);else if($===2)Q.pushUint16(F);else if($===3)Q.pushUint24(F);else Q.pushUint32(F);for(let{encode:Z}of D)Z(Q)}}}function Vs(D){let F=typeof D==="string"?q7(D):D,$=HT(F.length);return{length:(()=>{if(F.length===1&&F[0]<128)return 1;if(F.length<=55)return 1+F.length;return 1+$+F.length})(),encode(Q){if(F.length===1&&F[0]<128)Q.pushBytes(F);else if(F.length<=55)Q.pushByte(128+F.length),Q.pushBytes(F);else{if(Q.pushByte(183+$),$===1)Q.pushUint8(F.length);else if($===2)Q.pushUint16(F.length);else if($===3)Q.pushUint24(F.length);else Q.pushUint32(F.length);Q.pushBytes(F)}}}}function HT(D){if(D<=255)return 1;if(D<=65535)return 2;if(D<=16777215)return 3;if(D<=4294967295)return 4;throw new d("Length is too large.")}s0();Q0();function LK(D,F={}){let{recovered:$}=F;if(typeof D.r>"u")throw new IZ({signature:D});if(typeof D.s>"u")throw new IZ({signature:D});if($&&typeof D.yParity>"u")throw new IZ({signature:D});if(D.r<0n||D.r>zK)throw new MT({value:D.r});if(D.s<0n||D.s>zK)throw new OT({value:D.s});if(typeof D.yParity==="number"&&D.yParity!==0&&D.yParity!==1)throw new wZ({value:D.yParity})}function zs(D){return zT(dD(D))}function zT(D){if(D.length!==130&&D.length!==132)throw new _T({signature:D});let F=BigInt(PD(D,0,32)),$=BigInt(PD(D,32,64)),J=(()=>{let Q=Number(`0x${D.slice(130)}`);if(Number.isNaN(Q))return;try{return SK(Q)}catch{throw new wZ({value:Q})}})();if(typeof J>"u")return{r:F,s:$};return{r:F,s:$,yParity:J}}function PK(D){if(typeof D.r>"u")return;if(typeof D.s>"u")return;return jK(D)}function jK(D){let F=(()=>{if(typeof D==="string")return zT(D);if(D instanceof Uint8Array)return zs(D);if(typeof D.r==="string")return _s(D);if(D.v)return Cs(D);return{r:D.r,s:D.s,...typeof D.yParity<"u"?{yParity:D.yParity}:{}}})();return LK(F),F}function Cs(D){return{r:D.r,s:D.s,yParity:SK(D.v)}}function _s(D){let F=(()=>{let $=D.v?Number(D.v):void 0,J=D.yParity?Number(D.yParity):void 0;if(typeof $==="number"&&typeof J!=="number")J=SK($);if(typeof J!=="number")throw new wZ({value:D.yParity});return J})();return{r:BigInt(D.r),s:BigInt(D.s),yParity:F}}function CT(D){let{r:F,s:$,yParity:J}=D;return[J?"0x01":"0x",F===0n?"0x":zW(KD(F)),$===0n?"0x":zW(KD($))]}function SK(D){if(D===0||D===27)return 0;if(D===1||D===28)return 1;if(D>=35)return D%2===0?1:0;throw new ET({value:D})}class _T extends d{constructor({signature:D}){super(`Value \`${D}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${LD(G7(D))} bytes.`]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class IZ extends d{constructor({signature:D}){super(`Signature \`${a1(D)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class MT extends d{constructor({value:D}){super(`Value \`${D}\` is an invalid r value. r must be a positive integer less than 2^256.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}}class OT extends d{constructor({value:D}){super(`Value \`${D}\` is an invalid s value. s must be a positive integer less than 2^256.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}}class wZ extends d{constructor({value:D}){super(`Value \`${D}\` is an invalid y-parity value. Y-parity must be 0 or 1.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}class ET extends d{constructor({value:D}){super(`Value \`${D}\` is an invalid v value. v must be 27, 28 or >=35.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}function AT(D,F={}){if(typeof D.chainId==="string")return Ms(D);return{...D,...F.signature}}function Ms(D){let{address:F,chainId:$,nonce:J}=D,Q=PK(D);return{address:F,chainId:Number($),nonce:BigInt(J),...Q}}function IT(D){return Os(D,{presign:!0})}function Os(D,F={}){let{presign:$}=F;return M3(bD("0x05",UT(Es($?{address:D.address,chainId:D.chainId,nonce:D.nonce}:D))))}function Es(D){let{address:F,chainId:$,nonce:J}=D,Q=PK(D);return[$?KD($):"0x",F,J?KD(J):"0x",...Q?CT(Q):[]]}s0();Q0();ZZ();Q0();function wT(D){return lN(As(D))}function As(D){let{payload:F,signature:$}=D,{r:J,s:Q,yParity:Z}=$,Y=new M1.Signature(BigInt(J),BigInt(Q)).addRecoveryBit(Z).recoverPublicKey(G7(F).substring(2));return vN(Y)}var xK="0x8010801080108010801080108010801080108010801080108010801080108010",kK=p4("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function NZ(D){if(typeof D==="string"){if(PD(D,-32)!==xK)throw new yK(D)}else LK(D.authorization)}function ws(D){if(typeof D==="string")return NT(D);return D}function NT(D){NZ(D);let F=uQ(PD(D,-64,-32)),$=PD(D,-F-64,-64),J=PD(D,0,-F-64),[Q,Z,X]=N7(kK,$);return{authorization:AT({address:Q.delegation,chainId:Number(Q.chainId),nonce:Q.nonce,yParity:Q.yParity,r:Q.r,s:Q.s}),signature:J,...X&&X!=="0x"?{data:X,to:Z}:{}}}function Ns(D){let{data:F,signature:$}=D;NZ(D);let J=wT({payload:IT(D.authorization),signature:jK(D.authorization)}),Q=XF(kK,[{...D.authorization,delegation:D.authorization.address,chainId:BigInt(D.authorization.chainId)},D.to??J,F??"0x"]),Z=KD(LD(Q),{size:32});return bD($,Q,Z,xK)}function Ts(D){try{return NZ(D),!0}catch{return!1}}class yK extends d{constructor(D){super(`Value \`${D}\` is an invalid ERC-8010 wrapped signature.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc8010.InvalidWrappedSignatureError"})}}z8();q1();lQ();a0();Z1();K3();Z1();K3();async function TT({address:D,authorization:F,signature:$}){return I2(AD(D),await JF({authorization:F,signature:$}))}D0();c();ZZ();D0();K0();function LT({r:D,s:F,to:$="hex",v:J,yParity:Q}){let Z=(()=>{if(Q===0||Q===1)return Q;if(J&&(J===27n||J===28n||J>=35n))return J%2n===0n?1:0;throw Error("Invalid `v` or `yParity` value")})(),X=`0x${new M1.Signature(fD(D),fD(F)).toCompactHex()}${Z===0?"1b":"1c"}`;if($==="hex")return X;return W0(X)}U3();async function GF(D,F){let{address:$,chain:J=D.chain,hash:Q,erc6492VerifierAddress:Z=F.universalSignatureVerifierAddress??J?.contracts?.erc6492Verifier?.address,multicallAddress:X=F.multicallAddress??J?.contracts?.multicall3?.address}=F;if(J?.verifyHash)return await J.verifyHash(D,F);let Y=(()=>{let q=F.signature;if(DD(q))return q;if(typeof q==="object"&&"r"in q&&"s"in q)return LT(q);return WD(q)})();try{if(c4.validate(Y))return await Ls(D,{...F,multicallAddress:X,signature:Y});return await Ps(D,{...F,verifierAddress:Z,signature:Y})}catch(q){try{if(I2(AD($),await XZ({hash:Q,signature:Y})))return!0}catch{}if(q instanceof qF)return!1;throw q}}async function Ls(D,F){let{address:$,blockNumber:J,blockTag:Q,hash:Z,multicallAddress:X}=F,{authorization:Y,data:q,signature:G,to:B}=c4.unwrap(F.signature);if(await v4(D,{address:$,blockNumber:J,blockTag:Q})===i0(["0xef0100",Y.address]))return await js(D,{address:$,blockNumber:J,blockTag:Q,hash:Z,signature:G});let K={address:Y.address,chainId:Number(Y.chainId),nonce:Number(Y.nonce),r:k(Y.r,{size:32}),s:k(Y.s,{size:32}),yParity:Y.yParity};if(!await TT({address:$,authorization:K}))throw new qF;let V=await f(D,aD,"readContract")({...X?{address:X}:{code:W7},authorizationList:[K],abi:m2,blockNumber:J,blockTag:"pending",functionName:"aggregate3",args:[[...q?[{allowFailure:!0,target:B??$,callData:q}]:[],{allowFailure:!0,target:$,callData:ED({abi:JB,functionName:"isValidSignature",args:[Z,G]})}]]});if(V[V.length-1]?.returnData?.startsWith("0x1626ba7e"))return!0;throw new qF}async function Ps(D,F){let{address:$,factory:J,factoryData:Q,hash:Z,signature:X,verifierAddress:Y,...q}=F,G=await(async()=>{if(!J&&!Q)return X;if(l4.validate(X))return X;return l4.wrap({data:Q,signature:X,to:J})})(),B=Y?{to:Y,data:ED({abi:i9,functionName:"isValidSig",args:[$,Z,G]}),...q}:{data:q3({abi:i9,args:[$,Z,G],bytecode:rI}),...q},{data:W}=await f(D,w2,"call")(B).catch((K)=>{if(K instanceof x6)throw new qF;throw K});if(WQ(W??"0x0"))return!0;throw new qF}async function js(D,F){let{address:$,blockNumber:J,blockTag:Q,hash:Z,signature:X}=F;if((await f(D,aD,"readContract")({address:$,abi:JB,args:[Z,X],blockNumber:J,blockTag:Q,functionName:"isValidSignature"}).catch((q)=>{if(q instanceof k6)throw new qF;throw q})).startsWith("0x1626ba7e"))return!0;throw new qF}class qF extends Error{}c2();var PT=`\x19Ethereum Signed Message:
289
- `;_2();c();function jT(D){let F=(()=>{if(typeof D==="string")return F0(D);if(typeof D.raw==="string")return D.raw;return WD(D.raw)})(),$=F0(`${PT}${GD(F)}`);return ID([$,F])}function TZ(D,F){return OD(jT(D),F)}async function ST(D,{address:F,message:$,factory:J,factoryData:Q,signature:Z,...X}){let Y=TZ($);return f(D,GF,"verifyHash")({address:F,factory:J,factoryData:Q,hash:Y,signature:Z,...X})}A8();c();c2();gD();m1();s();class fK extends P{constructor({domain:D}){super(`Invalid domain "${qD(D)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class bK extends P{constructor({primaryType:D,types:F}){super(`Invalid primary type \`${D}\` must be one of \`${JSON.stringify(Object.keys(F))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}class vK extends P{constructor({type:D}){super(`Struct type "${D}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}n2();_2();c();RQ();function xT(D){let{domain:F,message:$,primaryType:J,types:Q}=D,Z=(q,G)=>{let B={...G};for(let W of q){let{name:K,type:U}=W;if(U==="address")B[K]=B[K].toLowerCase()}return B},X=(()=>{if(!Q.EIP712Domain)return{};if(!F)return{};return Z(Q.EIP712Domain,F)})(),Y=(()=>{if(J==="EIP712Domain")return;return Z(Q[J],$)})();return qD({domain:X,message:Y,primaryType:J,types:Q})}function LZ(D){let{domain:F,message:$,primaryType:J,types:Q}=D,Z=(X,Y)=>{for(let q of X){let{name:G,type:B}=q,W=Y[G],K=B.match(N6);if(K&&(typeof W==="number"||typeof W==="bigint")){let[H,z,_]=K;k(W,{signed:z==="int",size:Number.parseInt(_,10)/8})}if(B==="address"&&typeof W==="string"&&!t(W))throw new B0({address:W});let U=B.match(EQ);if(U){let[H,z]=U;if(z&&GD(W)!==Number.parseInt(z,10))throw new e9({expectedSize:Number.parseInt(z,10),givenSize:GD(W)})}let V=Q[B];if(V)Ss(B),Z(V,W)}};if(Q.EIP712Domain&&F){if(typeof F!=="object")throw new fK({domain:F});Z(Q.EIP712Domain,F)}if(J!=="EIP712Domain")if(Q[J])Z(Q[J],$);else throw new bK({primaryType:J,types:Q})}function PZ({domain:D}){return[typeof D?.name==="string"&&{name:"name",type:"string"},D?.version&&{name:"version",type:"string"},(typeof D?.chainId==="number"||typeof D?.chainId==="bigint")&&{name:"chainId",type:"uint256"},D?.verifyingContract&&{name:"verifyingContract",type:"address"},D?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean)}function Ss(D){if(D==="address"||D==="bool"||D==="string"||D.startsWith("bytes")||D.startsWith("uint")||D.startsWith("int"))throw new vK({type:D})}function kT(D){let{domain:F={},message:$,primaryType:J}=D,Q={EIP712Domain:PZ({domain:F}),...D.types};LZ({domain:F,message:$,primaryType:J,types:Q});let Z=["0x1901"];if(F)Z.push(xs({domain:F,types:Q}));if(J!=="EIP712Domain")Z.push(yT({data:$,primaryType:J,types:Q}));return OD(ID(Z))}function xs({domain:D,types:F}){return yT({data:D,primaryType:"EIP712Domain",types:F})}function yT({data:D,primaryType:F,types:$}){let J=fT({data:D,primaryType:F,types:$});return OD(J)}function fT({data:D,primaryType:F,types:$}){let J=[{type:"bytes32"}],Q=[ks({primaryType:F,types:$})];for(let Z of $[F]){let[X,Y]=vT({types:$,name:Z.name,type:Z.type,value:D[Z.name]});J.push(X),Q.push(Y)}return iD(J,Q)}function ks({primaryType:D,types:F}){let $=nD(ys({primaryType:D,types:F}));return OD($)}function ys({primaryType:D,types:F}){let $="",J=bT({primaryType:D,types:F});J.delete(D);let Q=[D,...Array.from(J).sort()];for(let Z of Q)$+=`${Z}(${F[Z].map(({name:X,type:Y})=>`${Y} ${X}`).join(",")})`;return $}function bT({primaryType:D,types:F},$=new Set){let Q=D.match(/^\w*/u)?.[0];if($.has(Q)||F[Q]===void 0)return $;$.add(Q);for(let Z of F[Q])bT({primaryType:Z.type,types:F},$);return $}function vT({types:D,name:F,type:$,value:J}){if(D[$]!==void 0)return[{type:"bytes32"},OD(fT({data:J,primaryType:$,types:D}))];if($==="bytes")return[{type:"bytes32"},OD(J)];if($==="string")return[{type:"bytes32"},OD(nD(J))];if($.lastIndexOf("]")===$.length-1){let Q=$.slice(0,$.lastIndexOf("[")),Z=J.map((X)=>vT({name:F,type:Q,types:D,value:X}));return[{type:"bytes32"},OD(iD(Z.map(([X])=>X),Z.map(([,X])=>X)))]}return[{type:$},J]}async function hT(D,F){let{address:$,factory:J,factoryData:Q,signature:Z,message:X,primaryType:Y,types:q,domain:G,...B}=F,W=kT({message:X,primaryType:Y,types:q,domain:G});return f(D,GF,"verifyHash")({address:$,factory:J,factoryData:Q,hash:W,signature:Z,...B})}w8();var hK=new Map,uT=new Map,fs=0;function I0(D,F,$){let J=++fs,Q=()=>hK.get(D)||[],Z=()=>{let B=Q();hK.set(D,B.filter((W)=>W.id!==J))},X=()=>{let B=Q();if(!B.some((K)=>K.id===J))return;let W=uT.get(D);if(B.length===1&&W){let K=W();if(K instanceof Promise)K.catch(()=>{})}Z()},Y=Q();if(hK.set(D,[...Y,{id:J,fns:F}]),Y&&Y.length>0)return X;let q={};for(let B in F)q[B]=(...W)=>{let K=Q();if(K.length===0)return;for(let U of K)U.fns[B]?.(...W)};let G=$(q);if(typeof G==="function")uT.set(D,G);return X}async function n4(D){return new Promise((F)=>setTimeout(F,D))}function I3(D,{delay:F=100,retryCount:$=2,shouldRetry:J=()=>!0}={}){return new Promise((Q,Z)=>{let X=async({count:Y=0}={})=>{let q=async({error:G})=>{let B=typeof F==="function"?F({count:Y,error:G}):F;if(B)await n4(B);X({count:Y+1})};try{let G=await D();Q(G)}catch(G){if(Y<$&&await J({count:Y,error:G}))return q({error:G});Z(G)}};X()})}D0();function N2(D,{emitOnBegin:F,initialWaitTime:$,interval:J}){let Q=!0,Z=()=>Q=!1;return(async()=>{let Y;if(F)Y=await D({unpoll:Z});let q=await $?.(Y)??J;await n4(q);let G=async()=>{if(!Q)return;await D({unpoll:Z}),await n4(J),G()};G()})(),Z}function jZ(D,{emitOnBegin:F=!1,emitMissed:$=!1,onBlockNumber:J,onError:Q,poll:Z,pollingInterval:X=D.pollingInterval}){let Y=(()=>{if(typeof Z<"u")return Z;if(D.transport.type==="webSocket"||D.transport.type==="ipc")return!1;if(D.transport.type==="fallback"&&(D.transport.transports[0].config.type==="webSocket"||D.transport.transports[0].config.type==="ipc"))return!1;return!0})(),q;return Y?(()=>{let W=qD(["watchBlockNumber",D.uid,F,$,X]);return I0(W,{onBlockNumber:J,onError:Q},(K)=>N2(async()=>{try{let U=await f(D,f8,"getBlockNumber")({cacheTime:0});if(q!==void 0){if(U===q)return;if(U-q>1&&$)for(let V=q+1n;V<U;V++)K.onBlockNumber(V,q),q=V}if(q===void 0||U>q)K.onBlockNumber(U,q),q=U}catch(U){K.onError?.(U)}},{emitOnBegin:F,interval:X}))})():(()=>{let W=qD(["watchBlockNumber",D.uid,F,$]);return I0(W,{onBlockNumber:J,onError:Q},(K)=>{let U=!0,V=()=>U=!1;return(async()=>{try{let H=(()=>{if(D.transport.type==="fallback"){let _=D.transport.transports.find((O)=>O.config.type==="webSocket"||O.config.type==="ipc");if(!_)return D.transport;return _.value}return D.transport})(),{unsubscribe:z}=await H.subscribe({params:["newHeads"],onData(_){if(!U)return;let O=fD(_.result?.number);K.onBlockNumber(O,q),q=O},onError(_){K.onError?.(_)}});if(V=z,!U)V()}catch(H){Q?.(H)}})(),()=>V()})})()}async function SZ(D,F){let{checkReplacement:$=!0,confirmations:J=1,hash:Q,onReplaced:Z,retryCount:X=6,retryDelay:Y=({count:E})=>~~(1<<E)*200,timeout:q=180000}=F,G=qD(["waitForTransactionReceipt",D.uid,Q]),B=(()=>{if(F.pollingInterval)return F.pollingInterval;if(D.chain?.experimental_preconfirmationTime)return D.chain.experimental_preconfirmationTime;return D.pollingInterval})(),W,K,U,V=!1,H,z,{promise:_,resolve:O,reject:C}=K7(),M=q?setTimeout(()=>{z?.(),H?.(),C(new cB({hash:Q}))},q):void 0;return H=I0(G,{onReplaced:Z,resolve:O,reject:C},async(E)=>{if(U=await f(D,I7,"getTransactionReceipt")({hash:Q}).catch(()=>{return}),U&&J<=1){clearTimeout(M),E.resolve(U),H?.();return}z=f(D,jZ,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:B,async onBlockNumber(A){let w=(T)=>{clearTimeout(M),z?.(),T(),H?.()},R=A;if(V)return;try{if(U){if(J>1&&(!U.blockNumber||R-U.blockNumber+1n<J))return;w(()=>E.resolve(U));return}if($&&!W)V=!0,await I3(async()=>{if(W=await f(D,A7,"getTransaction")({hash:Q}),W.blockNumber)R=W.blockNumber},{delay:Y,retryCount:X}),V=!1;if(U=await f(D,I7,"getTransactionReceipt")({hash:Q}),J>1&&(!U.blockNumber||R-U.blockNumber+1n<J))return;w(()=>E.resolve(U))}catch(T){if(T instanceof q4||T instanceof G4){if(!W){V=!1;return}try{K=W,V=!0;let N=await I3(()=>f(D,Y0,"getBlock")({blockNumber:R,includeTransactions:!0}),{delay:Y,retryCount:X,shouldRetry:({error:y})=>y instanceof f4});V=!1;let j=N.transactions.find(({from:y,nonce:m})=>y===K.from&&m===K.nonce);if(!j)return;if(U=await f(D,I7,"getTransactionReceipt")({hash:j.hash}),J>1&&(!U.blockNumber||R-U.blockNumber+1n<J))return;let L="replaced";if(j.to===K.to&&j.value===K.value&&j.input===K.input)L="repriced";else if(j.from===j.to&&j.value===0n)L="cancelled";w(()=>{E.onReplaced?.({reason:L,replacedTransaction:K,transaction:j,transactionReceipt:U}),E.resolve(U)})}catch(N){w(()=>E.reject(N))}}else w(()=>E.reject(T))}}})}),_}function gT(D,{blockTag:F=D.experimental_blockTag??"latest",emitMissed:$=!1,emitOnBegin:J=!1,onBlock:Q,onError:Z,includeTransactions:X,poll:Y,pollingInterval:q=D.pollingInterval}){let G=(()=>{if(typeof Y<"u")return Y;if(D.transport.type==="webSocket"||D.transport.type==="ipc")return!1;if(D.transport.type==="fallback"&&(D.transport.transports[0].config.type==="webSocket"||D.transport.transports[0].config.type==="ipc"))return!1;return!0})(),B=X??!1,W;return G?(()=>{let V=qD(["watchBlocks",D.uid,F,$,J,B,q]);return I0(V,{onBlock:Q,onError:Z},(H)=>N2(async()=>{try{let z=await f(D,Y0,"getBlock")({blockTag:F,includeTransactions:B});if(z.number!==null&&W?.number!=null){if(z.number===W.number)return;if(z.number-W.number>1&&$)for(let _=W?.number+1n;_<z.number;_++){let O=await f(D,Y0,"getBlock")({blockNumber:_,includeTransactions:B});H.onBlock(O,W),W=O}}if(W?.number==null||F==="pending"&&z?.number==null||z.number!==null&&z.number>W.number)H.onBlock(z,W),W=z}catch(z){H.onError?.(z)}},{emitOnBegin:J,interval:q}))})():(()=>{let V=!0,H=!0,z=()=>V=!1;return(async()=>{try{if(J)f(D,Y0,"getBlock")({blockTag:F,includeTransactions:B}).then((C)=>{if(!V)return;if(!H)return;Q(C,void 0),H=!1}).catch(Z);let _=(()=>{if(D.transport.type==="fallback"){let C=D.transport.transports.find((M)=>M.config.type==="webSocket"||M.config.type==="ipc");if(!C)return D.transport;return C.value}return D.transport})(),{unsubscribe:O}=await _.subscribe({params:["newHeads"],async onData(C){if(!V)return;let M=await f(D,Y0,"getBlock")({blockNumber:C.result?.number,includeTransactions:B}).catch(()=>{});if(!V)return;Q(M,W),H=!1,W=M},onError(C){Z?.(C)}});if(z=O,!V)z()}catch(_){Z?.(_)}})(),()=>z()})()}gD();F7();function mT(D,F){let{abi:$,address:J,args:Q,batch:Z=!0,eventName:X,fromBlock:Y,onError:q,onLogs:G,poll:B,pollingInterval:W=D.pollingInterval,strict:K}=F;return(()=>{if(typeof B<"u")return B;if(typeof Y==="bigint")return!0;if(D.transport.type==="webSocket"||D.transport.type==="ipc")return!1;if(D.transport.type==="fallback"&&(D.transport.transports[0].config.type==="webSocket"||D.transport.transports[0].config.type==="ipc"))return!1;return!0})()?(()=>{let z=K??!1,_=qD(["watchContractEvent",J,Q,Z,D.uid,X,W,z,Y]);return I0(_,{onLogs:G,onError:q},(O)=>{let C;if(Y!==void 0)C=Y-1n;let M,E=!1,A=N2(async()=>{if(!E){try{M=await f(D,sQ,"createContractEventFilter")({abi:$,address:J,args:Q,eventName:X,strict:z,fromBlock:Y})}catch{}E=!0;return}try{let w;if(M)w=await f(D,ZF,"getFilterChanges")({filter:M});else{let R=await f(D,f8,"getBlockNumber")({});if(C&&C<R)w=await f(D,WZ,"getContractEvents")({abi:$,address:J,args:Q,eventName:X,fromBlock:C+1n,toBlock:R,strict:z});else w=[];C=R}if(w.length===0)return;if(Z)O.onLogs(w);else for(let R of w)O.onLogs([R])}catch(w){if(M&&w instanceof R2)E=!1;O.onError?.(w)}},{emitOnBegin:!0,interval:W});return async()=>{if(M)await f(D,YF,"uninstallFilter")({filter:M});A()}})})():(()=>{let z=K??!1,_=qD(["watchContractEvent",J,Q,Z,D.uid,X,W,z]),O=!0,C=()=>O=!1;return I0(_,{onLogs:G,onError:q},(M)=>{return(async()=>{try{let E=(()=>{if(D.transport.type==="fallback"){let R=D.transport.transports.find((T)=>T.config.type==="webSocket"||T.config.type==="ipc");if(!R)return D.transport;return R.value}return D.transport})(),A=X?k8({abi:$,eventName:X,args:Q}):[],{unsubscribe:w}=await E.subscribe({params:["logs",{address:J,topics:A}],onData(R){if(!O)return;let T=R.result;try{let{eventName:N,args:j}=_3({abi:$,data:T.data,topics:T.topics,strict:K}),L=A0(T,{args:j,eventName:N});M.onLogs([L])}catch(N){let j,L;if(N instanceof g1||N instanceof pF){if(K)return;j=N.abiItem.name,L=N.abiItem.inputs?.some((m)=>!(("name"in m)&&m.name))}let y=A0(T,{args:L?[]:{},eventName:j});M.onLogs([y])}},onError(R){M.onError?.(R)}});if(C=w,!O)C()}catch(E){q?.(E)}})(),()=>C()})})()}gD();F7();function dT(D,{address:F,args:$,batch:J=!0,event:Q,events:Z,fromBlock:X,onError:Y,onLogs:q,poll:G,pollingInterval:B=D.pollingInterval,strict:W}){let K=(()=>{if(typeof G<"u")return G;if(typeof X==="bigint")return!0;if(D.transport.type==="webSocket"||D.transport.type==="ipc")return!1;if(D.transport.type==="fallback"&&(D.transport.transports[0].config.type==="webSocket"||D.transport.transports[0].config.type==="ipc"))return!1;return!0})(),U=W??!1;return K?(()=>{let z=qD(["watchEvent",F,$,J,D.uid,Q,B,X]);return I0(z,{onLogs:q,onError:Y},(_)=>{let O;if(X!==void 0)O=X-1n;let C,M=!1,E=N2(async()=>{if(!M){try{C=await f(D,tQ,"createEventFilter")({address:F,args:$,event:Q,events:Z,strict:U,fromBlock:X})}catch{}M=!0;return}try{let A;if(C)A=await f(D,ZF,"getFilterChanges")({filter:C});else{let w=await f(D,f8,"getBlockNumber")({});if(O&&O!==w)A=await f(D,R7,"getLogs")({address:F,args:$,event:Q,events:Z,fromBlock:O+1n,toBlock:w});else A=[];O=w}if(A.length===0)return;if(J)_.onLogs(A);else for(let w of A)_.onLogs([w])}catch(A){if(C&&A instanceof R2)M=!1;_.onError?.(A)}},{emitOnBegin:!0,interval:B});return async()=>{if(C)await f(D,YF,"uninstallFilter")({filter:C});E()}})})():(()=>{let z=!0,_=()=>z=!1;return(async()=>{try{let O=(()=>{if(D.transport.type==="fallback"){let A=D.transport.transports.find((w)=>w.config.type==="webSocket"||w.config.type==="ipc");if(!A)return D.transport;return A.value}return D.transport})(),C=Z??(Q?[Q]:void 0),M=[];if(C){if(M=[C.flatMap((w)=>k8({abi:[w],eventName:w.name,args:$}))],Q)M=M[0]}let{unsubscribe:E}=await O.subscribe({params:["logs",{address:F,topics:M}],onData(A){if(!z)return;let w=A.result;try{let{eventName:R,args:T}=_3({abi:C??[],data:w.data,topics:w.topics,strict:U}),N=A0(w,{args:T,eventName:R});q([N])}catch(R){let T,N;if(R instanceof g1||R instanceof pF){if(W)return;T=R.abiItem.name,N=R.abiItem.inputs?.some((L)=>!(("name"in L)&&L.name))}let j=A0(w,{args:N?[]:{},eventName:T});q([j])}},onError(A){Y?.(A)}});if(_=E,!z)_()}catch(O){Y?.(O)}})(),()=>_()})()}function pT(D,{batch:F=!0,onError:$,onTransactions:J,poll:Q,pollingInterval:Z=D.pollingInterval}){return(typeof Q<"u"?Q:D.transport.type!=="webSocket"&&D.transport.type!=="ipc")?(()=>{let G=qD(["watchPendingTransactions",D.uid,F,Z]);return I0(G,{onTransactions:J,onError:$},(B)=>{let W,K=N2(async()=>{try{if(!W)try{W=await f(D,eQ,"createPendingTransactionFilter")({});return}catch(V){throw K(),V}let U=await f(D,ZF,"getFilterChanges")({filter:W});if(U.length===0)return;if(F)B.onTransactions(U);else for(let V of U)B.onTransactions([V])}catch(U){B.onError?.(U)}},{emitOnBegin:!0,interval:Z});return async()=>{if(W)await f(D,YF,"uninstallFilter")({filter:W});K()}})})():(()=>{let G=!0,B=()=>G=!1;return(async()=>{try{let{unsubscribe:W}=await D.transport.subscribe({params:["newPendingTransactions"],onData(K){if(!G)return;let U=K.result;J([U])},onError(K){$?.(K)}});if(B=W,!G)B()}catch(W){$?.(W)}})(),()=>B()})()}function lT(D){let{scheme:F,statement:$,...J}=D.match(bs)?.groups??{},{chainId:Q,expirationTime:Z,issuedAt:X,notBefore:Y,requestId:q,...G}=D.match(vs)?.groups??{},B=D.split("Resources:")[1]?.split(`
287
+ if (condition) { yield value; }`)};import{Buffer as kc}from"node:buffer";import{StringDecoder as yc}from"node:string_decoder";var CJ=(D,F,$)=>{if($)return;if(D)return{transform:fc.bind(void 0,new TextEncoder)};let J=new yc(F);return{transform:bc.bind(void 0,J),final:vc.bind(void 0,J)}},fc=function*(D,F){if(kc.isBuffer(F))yield o8(F);else if(typeof F==="string")yield D.encode(F);else yield F},bc=function*(D,F){yield tD(F)?D.write(F):F},vc=function*(D){let F=D.end();if(F!=="")yield F};import{callbackify as WE}from"node:util";var VG=WE(async(D,F,$,J)=>{F.currentIterable=D(...$);try{for await(let Q of F.currentIterable)J.push(Q)}finally{delete F.currentIterable}}),_J=async function*(D,F,$){if($===F.length){yield D;return}let{transform:J=uc}=F[$];for await(let Q of J(D))yield*_J(Q,F,$+1)},KE=async function*(D){for(let[F,{final:$}]of Object.entries(D))yield*hc($,Number(F),D)},hc=async function*(D,F,$){if(D===void 0)return;for await(let J of D())yield*_J(J,$,F+1)},UE=WE(async({currentIterable:D},F)=>{if(D!==void 0){await(F?D.throw(F):D.return());return}if(F)throw F}),uc=function*(D){yield D};var HG=(D,F,$,J)=>{try{for(let Q of D(...F))$.push(Q);J()}catch(Q){J(Q)}},VE=(D,F)=>[...F.flatMap(($)=>[...uF($,D,0)]),...v9(D)],uF=function*(D,F,$){if($===F.length){yield D;return}let{transform:J=mc}=F[$];for(let Q of J(D))yield*uF(Q,F,$+1)},v9=function*(D){for(let[F,{final:$}]of Object.entries(D))yield*gc($,Number(F),D)},gc=function*(D,F,$){if(D===void 0)return;for(let J of D())yield*uF(J,$,F+1)},mc=function*(D){yield D};var zG=({value:D,value:{transform:F,final:$,writableObjectMode:J,readableObjectMode:Q},optionName:Z},{encoding:X})=>{let Y={},q=zE(D,X,Z),G=hF(F),B=hF($),W=G?VG.bind(void 0,_J,Y):HG.bind(void 0,uF),K=G||B?VG.bind(void 0,KE,Y):HG.bind(void 0,v9),U=G||B?UE.bind(void 0,Y):void 0;return{stream:new dc({writableObjectMode:J,writableHighWaterMark:HE(J),readableObjectMode:Q,readableHighWaterMark:HE(Q),transform(H,z,_){W([H,q,0],this,_)},flush(H){K([q],this,H)},destroy:U})}},MJ=(D,F,$,J)=>{let Q=F.filter(({type:X})=>X==="generator"),Z=J?Q.reverse():Q;for(let{value:X,optionName:Y}of Z){let q=zE(X,$,Y);D=VE(q,D)}return D},zE=({transform:D,final:F,binary:$,writableObjectMode:J,readableObjectMode:Q,preserveNewlines:Z},X,Y)=>{let q={};return[{transform:qE(J,Y)},CJ($,X,J),zJ($,Z,J,q),{transform:D,final:F},{transform:GE(Q,Y)},YE({binary:$,preserveNewlines:Z,readableObjectMode:Q,state:q})].filter(Boolean)};var CE=(D,F)=>{for(let $ of pc(D))lc(D,$,F)},pc=(D)=>new Set(Object.entries(D).filter(([,{direction:F}])=>F==="input").map(([F])=>Number(F))),lc=(D,F,$)=>{let{stdioItems:J}=D[F],Q=J.filter(({contents:Y})=>Y!==void 0);if(Q.length===0)return;if(F!==0){let[{type:Y,optionName:q}]=Q;throw TypeError(`Only the \`stdin\` option, not \`${q}\`, can be ${v1[Y]} with synchronous methods.`)}let X=Q.map(({contents:Y})=>Y).map((Y)=>cc(Y,J));$.input=L9(X)},cc=(D,F)=>{let $=MJ(D,F,"utf8",!0);return nc($),L9($)},nc=(D)=>{let F=D.find(($)=>typeof $!=="string"&&!tD($));if(F!==void 0)throw TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${F}.`)};import{writeFileSync as rc,appendFileSync as sc}from"node:fs";var OJ=({stdioItems:D,encoding:F,verboseInfo:$,fdNumber:J})=>J!=="all"&&Z6($,J)&&!X2.has(F)&&ic(J)&&(D.some(({type:Q,value:Z})=>Q==="native"&&oc.has(Z))||D.every(({type:Q})=>C2.has(Q))),ic=(D)=>D===1||D===2,oc=new Set(["pipe","overlapped"]),_E=async(D,F,$,J)=>{for await(let Q of D)if(!ac(F))OE(Q,$,J)},ME=(D,F,$)=>{for(let J of D)OE(J,F,$)},ac=(D)=>D._readableState.pipes.length>0,OE=(D,F,$)=>{let J=x$(D);G8({type:"output",verboseMessage:J,fdNumber:F,verboseInfo:$})};var EE=({fileDescriptors:D,syncResult:{output:F},options:$,isMaxBuffer:J,verboseInfo:Q})=>{if(F===null)return{output:Array.from({length:3})};let Z={},X=new Set([]);return{output:F.map((q,G)=>tc({result:q,fileDescriptors:D,fdNumber:G,state:Z,outputFiles:X,isMaxBuffer:J,verboseInfo:Q},$)),...Z}},tc=({result:D,fileDescriptors:F,fdNumber:$,state:J,outputFiles:Q,isMaxBuffer:Z,verboseInfo:X},{buffer:Y,encoding:q,lines:G,stripFinalNewline:B,maxBuffer:W})=>{if(D===null)return;let K=RO(D,Z,W),U=o8(K),{stdioItems:V,objectMode:H}=F[$],z=ec([U],V,q,J),{serializedResult:_,finalResult:O=_}=Dn({chunks:z,objectMode:H,encoding:q,lines:G,stripFinalNewline:B,fdNumber:$});Fn({serializedResult:_,fdNumber:$,state:J,verboseInfo:X,encoding:q,stdioItems:V,objectMode:H});let C=Y[$]?O:void 0;try{if(J.error===void 0)$n(_,V,Q);return C}catch(M){return J.error=M,C}},ec=(D,F,$,J)=>{try{return MJ(D,F,$,!1)}catch(Q){return J.error=Q,D}},Dn=({chunks:D,objectMode:F,encoding:$,lines:J,stripFinalNewline:Q,fdNumber:Z})=>{if(F)return{serializedResult:D};if($==="buffer")return{serializedResult:L9(D)};let X=xC(D,$);if(J[Z])return{serializedResult:X,finalResult:UG(X,!Q[Z],F)};return{serializedResult:X}},Fn=({serializedResult:D,fdNumber:F,state:$,verboseInfo:J,encoding:Q,stdioItems:Z,objectMode:X})=>{if(!OJ({stdioItems:Z,encoding:Q,verboseInfo:J,fdNumber:F}))return;let Y=UG(D,!1,X);try{ME(Y,F,J)}catch(q){$.error??=q}},$n=(D,F,$)=>{for(let{path:J,append:Q}of F.filter(({type:Z})=>VJ.has(Z))){let Z=typeof J==="string"?J:J.toString();if(Q||$.has(Z))sc(J,D);else $.add(Z),rc(J,D)}};var RE=([,D,F],$)=>{if(!$.all)return;if(D===void 0)return F;if(F===void 0)return D;if(Array.isArray(D))return Array.isArray(F)?[...D,...F]:[...D,t8(F,$,"all")];if(Array.isArray(F))return[t8(D,$,"all"),...F];if(tD(D)&&tD(F))return Aq([D,F]);return`${D}${F}`};import{once as CG}from"node:events";var AE=async(D,F)=>{let[$,J]=await Jn(D);return F.isForcefullyTerminated??=!1,[$,J]},Jn=async(D)=>{let[F,$]=await Promise.allSettled([CG(D,"spawn"),CG(D,"exit")]);if(F.status==="rejected")return[];return $.status==="rejected"?IE(D):$.value},IE=async(D)=>{try{return await CG(D,"exit")}catch{return IE(D)}},wE=async(D)=>{let[F,$]=await D;if(!Qn(F,$)&&_G(F,$))throw new B8;return[F,$]},Qn=(D,F)=>D===void 0&&F===void 0,_G=(D,F)=>D!==0||F!==null;var NE=({error:D,status:F,signal:$,output:J},{maxBuffer:Q})=>{let Z=Zn(D,F,$),X=Z?.code==="ETIMEDOUT",Y=EO(Z,J,Q);return{resultError:Z,exitCode:F,signal:$,timedOut:X,isMaxBuffer:Y}},Zn=(D,F,$)=>{if(D!==void 0)return D;return _G(F,$)?new B8:void 0};var TE=(D,F,$)=>{let{file:J,commandArguments:Q,command:Z,escapedCommand:X,startTime:Y,verboseInfo:q,options:G,fileDescriptors:B}=Yn(D,F,$),W=Bn({file:J,commandArguments:Q,options:G,command:Z,escapedCommand:X,verboseInfo:q,fileDescriptors:B,startTime:Y});return V6(W,q,G)},Yn=(D,F,$)=>{let{command:J,escapedCommand:Q,startTime:Z,verboseInfo:X}=y$(D,F,$),Y=qn($),{file:q,commandArguments:G,options:B}=FJ(D,F,Y);Gn(B);let W=JE(B,X);return{file:q,commandArguments:G,command:J,escapedCommand:Q,startTime:Z,verboseInfo:X,options:B,fileDescriptors:W}},qn=(D)=>D.node&&!D.ipc?{...D,ipc:!1}:D,Gn=({ipc:D,ipcInput:F,detached:$,cancelSignal:J})=>{if(F)EJ("ipcInput");if(D)EJ("ipc: true");if($)EJ("detached: true");if(J)EJ("cancelSignal")},EJ=(D)=>{throw TypeError(`The "${D}" option cannot be used with synchronous methods.`)},Bn=({file:D,commandArguments:F,options:$,command:J,escapedCommand:Q,verboseInfo:Z,fileDescriptors:X,startTime:Y})=>{let q=Wn({file:D,commandArguments:F,options:$,command:J,escapedCommand:Q,fileDescriptors:X,startTime:Y});if(q.failed)return q;let{resultError:G,exitCode:B,signal:W,timedOut:K,isMaxBuffer:U}=NE(q,$),{output:V,error:H=G}=EE({fileDescriptors:X,syncResult:q,options:$,isMaxBuffer:U,verboseInfo:Z}),z=V.map((O,C)=>t8(O,$,C)),_=t8(RE(V,$),$,"all");return Un({error:H,exitCode:B,signal:W,timedOut:K,isMaxBuffer:U,stdio:z,all:_,options:$,command:J,escapedCommand:Q,startTime:Y})},Wn=({file:D,commandArguments:F,options:$,command:J,escapedCommand:Q,fileDescriptors:Z,startTime:X})=>{try{CE(Z,$);let Y=Kn($);return Xn(...$J(D,F,Y))}catch(Y){return U6({error:Y,command:J,escapedCommand:Q,fileDescriptors:Z,options:$,startTime:X,isSync:!0})}},Kn=({encoding:D,maxBuffer:F,...$})=>({...$,encoding:"buffer",maxBuffer:BJ(F)}),Un=({error:D,exitCode:F,signal:$,timedOut:J,isMaxBuffer:Q,stdio:Z,all:X,options:Y,command:q,escapedCommand:G,startTime:B})=>D===void 0?WJ({command:q,escapedCommand:G,stdio:Z,all:X,ipcOutput:[],options:Y,startTime:B}):b9({error:D,command:q,escapedCommand:G,timedOut:J,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:Q,isForcefullyTerminated:!1,exitCode:F,signal:$,stdio:Z,all:X,ipcOutput:[],options:Y,startTime:B,isSync:!0});import{setMaxListeners as Fo}from"node:events";import{spawn as $o}from"node:child_process";import xE from"node:process";import{once as MG,on as Vn}from"node:events";var LE=({anyProcess:D,channel:F,isSubprocess:$,ipc:J},{reference:Q=!0,filter:Z}={})=>{return q6({methodName:"getOneMessage",isSubprocess:$,ipc:J,isConnected:a$(D)}),Hn({anyProcess:D,channel:F,isSubprocess:$,filter:Z,reference:Q})},Hn=async({anyProcess:D,channel:F,isSubprocess:$,filter:J,reference:Q})=>{c$(F,Q);let Z=b1(D,F,$),X=new AbortController;try{return await Promise.race([zn(Z,J,X),Cn(Z,$,X),_n(Z,$,X)])}catch(Y){throw G6(D),Y}finally{X.abort(),n$(F,Q)}},zn=async(D,F,{signal:$})=>{if(F===void 0){let[J]=await MG(D,"message",{signal:$});return J}for await(let[J]of Vn(D,"message",{signal:$}))if(F(J))return J},Cn=async(D,F,{signal:$})=>{await MG(D,"disconnect",{signal:$}),UM(F)},_n=async(D,F,{signal:$})=>{let[J]=await MG(D,"strict:error",{signal:$});throw d$(J,F)};import{once as jE,on as Mn}from"node:events";var SE=({anyProcess:D,channel:F,isSubprocess:$,ipc:J},{reference:Q=!0}={})=>OG({anyProcess:D,channel:F,isSubprocess:$,ipc:J,shouldAwait:!$,reference:Q}),OG=({anyProcess:D,channel:F,isSubprocess:$,ipc:J,shouldAwait:Q,reference:Z})=>{q6({methodName:"getEachMessage",isSubprocess:$,ipc:J,isConnected:a$(D)}),c$(F,Z);let X=b1(D,F,$),Y=new AbortController,q={};return On(D,X,Y),En({ipcEmitter:X,isSubprocess:$,controller:Y,state:q}),Rn({anyProcess:D,channel:F,ipcEmitter:X,isSubprocess:$,shouldAwait:Q,controller:Y,state:q,reference:Z})},On=async(D,F,$)=>{try{await jE(F,"disconnect",{signal:$.signal}),$.abort()}catch{}},En=async({ipcEmitter:D,isSubprocess:F,controller:$,state:J})=>{try{let[Q]=await jE(D,"strict:error",{signal:$.signal});J.error=d$(Q,F),$.abort()}catch{}},Rn=async function*({anyProcess:D,channel:F,ipcEmitter:$,isSubprocess:J,shouldAwait:Q,controller:Z,state:X,reference:Y}){try{for await(let[q]of Mn($,"message",{signal:Z.signal}))PE(X),yield q}catch{PE(X)}finally{if(Z.abort(),n$(F,Y),!J)G6(D);if(Q)await D}},PE=({error:D})=>{if(D)throw D};var kE=(D,{ipc:F})=>{Object.assign(D,fE(D,!1,F))},yE=()=>{let D=xE,F=!0,$=xE.channel!==void 0;return{...fE(D,!0,$),getCancelSignal:gM.bind(void 0,{anyProcess:D,channel:D.channel,isSubprocess:!0,ipc:$})}},fE=(D,F,$)=>({sendMessage:e$.bind(void 0,{anyProcess:D,channel:D.channel,isSubprocess:F,ipc:$}),getOneMessage:LE.bind(void 0,{anyProcess:D,channel:D.channel,isSubprocess:F,ipc:$}),getEachMessage:SE.bind(void 0,{anyProcess:D,channel:D.channel,isSubprocess:F,ipc:$})});import{ChildProcess as An}from"node:child_process";import{PassThrough as In,Readable as wn,Writable as Nn,Duplex as Tn}from"node:stream";var bE=({error:D,command:F,escapedCommand:$,fileDescriptors:J,options:Q,startTime:Z,verboseInfo:X})=>{BG(J);let Y=new An;Ln(Y,J),Object.assign(Y,{readable:Pn,writable:jn,duplex:Sn});let q=U6({error:D,command:F,escapedCommand:$,fileDescriptors:J,options:Q,startTime:Z,isSync:!1}),G=xn(q,X,Q);return{subprocess:Y,promise:G}},Ln=(D,F)=>{let $=h9(),J=h9(),Q=h9(),Z=Array.from({length:F.length-3},h9),X=h9(),Y=[$,J,Q,...Z];Object.assign(D,{stdin:$,stdout:J,stderr:Q,all:X,stdio:Y})},h9=()=>{let D=new In;return D.end(),D},Pn=()=>new wn({read(){}}),jn=()=>new Nn({write(){}}),Sn=()=>new Tn({read(){},write(){}}),xn=async(D,F,$)=>V6(D,F,$);import{createReadStream as vE,createWriteStream as hE}from"node:fs";import{Buffer as kn}from"node:buffer";import{Readable as u9,Writable as yn,Duplex as fn}from"node:stream";var gE=(D,F)=>HJ(bn,D,F,!1),g9=({type:D,optionName:F})=>{throw TypeError(`The \`${F}\` option cannot be ${v1[D]}.`)},uE={fileNumber:g9,generator:zG,asyncGenerator:zG,nodeStream:({value:D})=>({stream:D}),webTransform({value:{transform:D,writableObjectMode:F,readableObjectMode:$}}){let J=F||$;return{stream:fn.fromWeb(D,{objectMode:J})}},duplex:({value:{transform:D}})=>({stream:D}),native(){}},bn={input:{...uE,fileUrl:({value:D})=>({stream:vE(D)}),filePath:({value:{file:D}})=>({stream:vE(D)}),webStream:({value:D})=>({stream:u9.fromWeb(D)}),iterable:({value:D})=>({stream:u9.from(D)}),asyncIterable:({value:D})=>({stream:u9.from(D)}),string:({value:D})=>({stream:u9.from(D)}),uint8Array:({value:D})=>({stream:u9.from(kn.from(D))})},output:{...uE,fileUrl:({value:D})=>({stream:hE(D)}),filePath:({value:{file:D,append:F}})=>({stream:hE(D,F?{flags:"a"}:{})}),webStream:({value:D})=>({stream:yn.fromWeb(D)}),iterable:g9,asyncIterable:g9,string:g9,uint8Array:g9}};import{on as vn,once as mE}from"node:events";import{PassThrough as hn,getDefaultHighWaterMark as un}from"node:stream";import{finished as lE}from"node:stream/promises";function gF(D){if(!Array.isArray(D))throw TypeError(`Expected an array, got \`${typeof D}\`.`);for(let Q of D)EG(Q);let F=D.some(({readableObjectMode:Q})=>Q),$=gn(D,F),J=new cE({objectMode:F,writableHighWaterMark:$,readableHighWaterMark:$});for(let Q of D)J.add(Q);return J}var gn=(D,F)=>{if(D.length===0)return un(F);let $=D.filter(({readableObjectMode:J})=>J===F).map(({readableHighWaterMark:J})=>J);return Math.max(...$)};class cE extends hn{#J=new Set([]);#$=new Set([]);#F=new Set([]);#D;#Z=Symbol("unpipe");#Q=new WeakMap;add(D){if(EG(D),this.#J.has(D))return;this.#J.add(D),this.#D??=mn(this,this.#J,this.#Z);let F=ln({passThroughStream:this,stream:D,streams:this.#J,ended:this.#$,aborted:this.#F,onFinished:this.#D,unpipeEvent:this.#Z});this.#Q.set(D,F),D.pipe(this,{end:!1})}async remove(D){if(EG(D),!this.#J.has(D))return!1;let F=this.#Q.get(D);if(F===void 0)return!1;return this.#Q.delete(D),D.unpipe(this),await F,!0}}var mn=async(D,F,$)=>{RJ(D,dE);let J=new AbortController;try{await Promise.race([dn(D,J),pn(D,F,$,J)])}finally{J.abort(),RJ(D,-dE)}},dn=async(D,{signal:F})=>{try{await lE(D,{signal:F,cleanup:!0})}catch($){throw nE(D,$),$}},pn=async(D,F,$,{signal:J})=>{for await(let[Q]of vn(D,"unpipe",{signal:J}))if(F.has(Q))Q.emit($)},EG=(D)=>{if(typeof D?.pipe!=="function")throw TypeError(`Expected a readable stream, got: \`${typeof D}\`.`)},ln=async({passThroughStream:D,stream:F,streams:$,ended:J,aborted:Q,onFinished:Z,unpipeEvent:X})=>{RJ(D,pE);let Y=new AbortController;try{await Promise.race([cn(Z,F,Y),nn({passThroughStream:D,stream:F,streams:$,ended:J,aborted:Q,controller:Y}),on({stream:F,streams:$,ended:J,aborted:Q,unpipeEvent:X,controller:Y})])}finally{Y.abort(),RJ(D,-pE)}if($.size>0&&$.size===J.size+Q.size)if(J.size===0&&Q.size>0)RG(D);else an(D)},cn=async(D,F,{signal:$})=>{try{if(await D,!$.aborted)RG(F)}catch(J){if(!$.aborted)nE(F,J)}},nn=async({passThroughStream:D,stream:F,streams:$,ended:J,aborted:Q,controller:{signal:Z}})=>{try{if(await lE(F,{signal:Z,cleanup:!0,readable:!0,writable:!1}),$.has(F))J.add(F)}catch(X){if(Z.aborted||!$.has(F))return;if(iE(X))Q.add(F);else oE(D,X)}},on=async({stream:D,streams:F,ended:$,aborted:J,unpipeEvent:Q,controller:{signal:Z}})=>{if(await mE(D,Q,{signal:Z}),!D.readable)return mE(Z,"abort",{signal:Z});F.delete(D),$.delete(D),J.delete(D)},an=(D)=>{if(D.writable)D.end()},nE=(D,F)=>{if(iE(F))RG(D);else oE(D,F)},iE=(D)=>D?.code==="ERR_STREAM_PREMATURE_CLOSE",RG=(D)=>{if(D.readable||D.writable)D.destroy()},oE=(D,F)=>{if(!D.destroyed)D.once("error",rn),D.destroy(F)},rn=()=>{},RJ=(D,F)=>{let $=D.getMaxListeners();if($!==0&&$!==Number.POSITIVE_INFINITY)D.setMaxListeners($+F)},dE=2,pE=1;import{finished as aE}from"node:stream/promises";var z6=(D,F)=>{D.pipe(F),sn(D,F),tn(D,F)},sn=async(D,F)=>{if(v2(D)||v2(F))return;try{await aE(D,{cleanup:!0,readable:!0,writable:!1})}catch{}AG(F)},AG=(D)=>{if(D.writable)D.end()},tn=async(D,F)=>{if(v2(D)||v2(F))return;try{await aE(F,{cleanup:!0,readable:!1,writable:!0})}catch{}IG(D)},IG=(D)=>{if(D.readable)D.destroy()};var rE=(D,F,$)=>{let J=new Map;for(let[Q,{stdioItems:Z,direction:X}]of Object.entries(F)){for(let{stream:Y}of Z.filter(({type:q})=>C2.has(q)))en(D,Y,X,Q);for(let{stream:Y}of Z.filter(({type:q})=>!C2.has(q)))Fi({subprocess:D,stream:Y,direction:X,fdNumber:Q,pipeGroups:J,controller:$})}for(let[Q,Z]of J.entries()){let X=Z.length===1?Z[0]:gF(Z);z6(X,Q)}},en=(D,F,$,J)=>{if($==="output")z6(D.stdio[J],F);else z6(F,D.stdio[J]);let Q=Di[J];if(Q!==void 0)D[Q]=F;D.stdio[J]=F},Di=["stdin","stdout","stderr"],Fi=({subprocess:D,stream:F,direction:$,fdNumber:J,pipeGroups:Q,controller:Z})=>{if(F===void 0)return;$i(F,Z);let[X,Y]=$==="output"?[F,D.stdio[J]]:[D.stdio[J],F],q=Q.get(X)??[];Q.set(X,[...q,Y])},$i=(D,{signal:F})=>{if(v2(D))bF(D,Ji,F)},Ji=2;IJ();import{addAbortListener as Xi}from"node:events";var FR=(D,{cleanup:F,detached:$},{signal:J})=>{if(!F||$)return;let Q=C6(()=>{D.kill()});Xi(J,()=>{Q()})};var JR=({source:D,sourcePromise:F,boundOptions:$,createNested:J},...Q)=>{let Z=k$(),{destination:X,destinationStream:Y,destinationError:q,from:G,unpipeSignal:B}=Yi($,J,Q),{sourceStream:W,sourceError:K}=Gi(D,G),{options:U,fileDescriptors:V}=K8.get(D);return{sourcePromise:F,sourceStream:W,sourceOptions:U,sourceError:K,destination:X,destinationStream:Y,destinationError:q,unpipeSignal:B,fileDescriptors:V,startTime:Z}},Yi=(D,F,$)=>{try{let{destination:J,pipeOptions:{from:Q,to:Z,unpipeSignal:X}={}}=qi(D,F,...$),Y=l$(J,Z);return{destination:J,destinationStream:Y,from:Q,unpipeSignal:X}}catch(J){return{destinationError:J}}},qi=(D,F,$,...J)=>{if(Array.isArray($))return{destination:F($R,D)($,...J),pipeOptions:D};if(typeof $==="string"||$ instanceof URL||Eq($)){if(Object.keys(D).length>0)throw TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[Q,Z,X]=A$($,...J);return{destination:F($R)(Q,Z,X),pipeOptions:X}}if(K8.has($)){if(Object.keys(D).length>0)throw TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:$,pipeOptions:J[0]}}throw TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${$}`)},$R=({options:D})=>({options:{...D,stdin:"pipe",piped:!0}}),Gi=(D,F)=>{try{return{sourceStream:B6(D,F)}}catch($){return{sourceError:$}}};var ZR=({sourceStream:D,sourceError:F,destinationStream:$,destinationError:J,fileDescriptors:Q,sourceOptions:Z,startTime:X})=>{let Y=Bi({sourceStream:D,sourceError:F,destinationStream:$,destinationError:J});if(Y!==void 0)throw PG({error:Y,fileDescriptors:Q,sourceOptions:Z,startTime:X})},Bi=({sourceStream:D,sourceError:F,destinationStream:$,destinationError:J})=>{if(F!==void 0&&J!==void 0)return J;if(J!==void 0)return IG(D),J;if(F!==void 0)return AG($),F},PG=({error:D,fileDescriptors:F,sourceOptions:$,startTime:J})=>U6({error:D,command:QR,escapedCommand:QR,fileDescriptors:F,options:$,startTime:J,isSync:!1}),QR="source.pipe(destination)";var XR=async(D)=>{let[{status:F,reason:$,value:J=$},{status:Q,reason:Z,value:X=Z}]=await D;if(!X.pipedFrom.includes(J))X.pipedFrom.push(J);if(Q==="rejected")throw X;if(F==="rejected")throw J;return X};import{finished as Wi}from"node:stream/promises";var YR=(D,F,$)=>{let J=wJ.has(F)?Ui(D,F):Ki(D,F);return bF(D,Hi,$.signal),bF(F,zi,$.signal),Vi(F),J},Ki=(D,F)=>{let $=gF([D]);return z6($,F),wJ.set(F,$),$},Ui=(D,F)=>{let $=wJ.get(F);return $.add(D),$},Vi=async(D)=>{try{await Wi(D,{cleanup:!0,readable:!1,writable:!0})}catch{}wJ.delete(D)},wJ=new WeakMap,Hi=2,zi=1;import{aborted as Ci}from"node:util";var qR=(D,F)=>D===void 0?[]:[_i(D,F)],_i=async(D,{sourceStream:F,mergedStream:$,fileDescriptors:J,sourceOptions:Q,startTime:Z})=>{await Ci(D,F),await $.remove(F);let X=Error("Pipe canceled by `unpipeSignal` option.");throw PG({error:X,fileDescriptors:J,sourceOptions:Q,startTime:Z})};var NJ=(D,...F)=>{if(mD(F[0]))return NJ.bind(void 0,{...D,boundOptions:{...D.boundOptions,...F[0]}});let{destination:$,...J}=JR(D,...F),Q=Mi({...J,destination:$});return Q.pipe=NJ.bind(void 0,{...D,source:$,sourcePromise:Q,boundOptions:{}}),Q},Mi=async({sourcePromise:D,sourceStream:F,sourceOptions:$,sourceError:J,destination:Q,destinationStream:Z,destinationError:X,unpipeSignal:Y,fileDescriptors:q,startTime:G})=>{let B=Oi(D,Q);ZR({sourceStream:F,sourceError:J,destinationStream:Z,destinationError:X,fileDescriptors:q,sourceOptions:$,startTime:G});let W=new AbortController;try{let K=YR(F,Z,W);return await Promise.race([XR(B),...qR(Y,{sourceStream:F,mergedStream:K,sourceOptions:$,fileDescriptors:q,startTime:G})])}finally{W.abort()}},Oi=(D,F)=>Promise.allSettled([D,F]);import{setImmediate as Ti}from"node:timers/promises";import{on as Ei}from"node:events";import{getDefaultHighWaterMark as Ri}from"node:stream";var TJ=({subprocessStdout:D,subprocess:F,binary:$,shouldEncode:J,encoding:Q,preserveNewlines:Z})=>{let X=new AbortController;return Ai(F,X),BR({stream:D,controller:X,binary:$,shouldEncode:!D.readableObjectMode&&J,encoding:Q,shouldSplit:!D.readableObjectMode,preserveNewlines:Z})},Ai=async(D,F)=>{try{await D}catch{}finally{F.abort()}},jG=({stream:D,onStreamEnd:F,lines:$,encoding:J,stripFinalNewline:Q,allMixed:Z})=>{let X=new AbortController;Ii(F,X,D);let Y=D.readableObjectMode&&!Z;return BR({stream:D,controller:X,binary:J==="buffer",shouldEncode:!Y,encoding:J,shouldSplit:!Y&&$,preserveNewlines:!Q})},Ii=async(D,F,$)=>{try{await D}catch{$.destroy()}finally{F.abort()}},BR=({stream:D,controller:F,binary:$,shouldEncode:J,encoding:Q,shouldSplit:Z,preserveNewlines:X})=>{let Y=Ei(D,"data",{signal:F.signal,highWaterMark:GR,highWatermark:GR});return wi({onStdoutChunk:Y,controller:F,binary:$,shouldEncode:J,encoding:Q,shouldSplit:Z,preserveNewlines:X})},SG=Ri(!0),GR=SG,wi=async function*({onStdoutChunk:D,controller:F,binary:$,shouldEncode:J,encoding:Q,shouldSplit:Z,preserveNewlines:X}){let Y=Ni({binary:$,shouldEncode:J,encoding:Q,shouldSplit:Z,preserveNewlines:X});try{for await(let[q]of D)yield*uF(q,Y,0)}catch(q){if(!F.signal.aborted)throw q}finally{yield*v9(Y)}},Ni=({binary:D,shouldEncode:F,encoding:$,shouldSplit:J,preserveNewlines:Q})=>[CJ(D,$,!F),zJ(D,Q,!J,{})].filter(Boolean);var WR=async({stream:D,onStreamEnd:F,fdNumber:$,encoding:J,buffer:Q,maxBuffer:Z,lines:X,allMixed:Y,stripFinalNewline:q,verboseInfo:G,streamInfo:B})=>{let W=Li({stream:D,onStreamEnd:F,fdNumber:$,encoding:J,allMixed:Y,verboseInfo:G,streamInfo:B});if(!Q){await Promise.all([Pi(D),W]);return}let K=WG(q,$),U=jG({stream:D,onStreamEnd:F,lines:X,encoding:J,stripFinalNewline:K,allMixed:Y}),[V]=await Promise.all([ji({stream:D,iterable:U,fdNumber:$,encoding:J,maxBuffer:Z,lines:X}),W]);return V},Li=async({stream:D,onStreamEnd:F,fdNumber:$,encoding:J,allMixed:Q,verboseInfo:Z,streamInfo:{fileDescriptors:X}})=>{if(!OJ({stdioItems:X[$]?.stdioItems,encoding:J,verboseInfo:Z,fdNumber:$}))return;let Y=jG({stream:D,onStreamEnd:F,lines:!0,encoding:J,stripFinalNewline:!0,allMixed:Q});await _E(Y,D,$,Z)},Pi=async(D)=>{if(await Ti(),D.readableFlowing===null)D.resume()},ji=async({stream:D,stream:{readableObjectMode:F},iterable:$,fdNumber:J,encoding:Q,maxBuffer:Z,lines:X})=>{try{if(F||X)return await XJ($,{maxBuffer:Z});if(Q==="buffer")return new Uint8Array(await YJ($,{maxBuffer:Z}));return await GJ($,{maxBuffer:Z})}catch(Y){return KR(_O({error:Y,stream:D,readableObjectMode:F,lines:X,encoding:Q,fdNumber:J}))}},xG=async(D)=>{try{return await D}catch(F){return KR(F)}},KR=({bufferedData:D})=>jC(D)?new Uint8Array(D):D;import{finished as Si}from"node:stream/promises";var m9=async(D,F,$,{isSameDirection:J,stopOnExit:Q=!1}={})=>{let Z=xi(D,$),X=new AbortController;try{await Promise.race([...Q?[$.exitPromise]:[],Si(D,{cleanup:!0,signal:X.signal})])}catch(Y){if(!Z.stdinCleanedUp)fi(Y,F,$,J)}finally{X.abort()}},xi=(D,{originalStreams:[F],subprocess:$})=>{let J={stdinCleanedUp:!1};if(D===F)ki(D,$,J);return J},ki=(D,F,$)=>{let{_destroy:J}=D;D._destroy=(...Q)=>{yi(F,$),J.call(D,...Q)}},yi=({exitCode:D,signalCode:F},$)=>{if(D!==null||F!==null)$.stdinCleanedUp=!0},fi=(D,F,$,J)=>{if(!bi(D,F,$,J))throw D},bi=(D,F,$,J=!0)=>{if($.propagating)return UR(D)||LJ(D);return $.propagating=!0,kG($,F)===J?UR(D):LJ(D)},kG=({fileDescriptors:D},F)=>F!=="all"&&D[F].direction==="input",LJ=(D)=>D?.code==="ERR_STREAM_PREMATURE_CLOSE",UR=(D)=>D?.code==="EPIPE";var VR=({subprocess:D,encoding:F,buffer:$,maxBuffer:J,lines:Q,stripFinalNewline:Z,verboseInfo:X,streamInfo:Y})=>D.stdio.map((q,G)=>yG({stream:q,fdNumber:G,encoding:F,buffer:$[G],maxBuffer:J[G],lines:Q[G],allMixed:!1,stripFinalNewline:Z,verboseInfo:X,streamInfo:Y})),yG=async({stream:D,fdNumber:F,encoding:$,buffer:J,maxBuffer:Q,lines:Z,allMixed:X,stripFinalNewline:Y,verboseInfo:q,streamInfo:G})=>{if(!D)return;let B=m9(D,F,G);if(kG(G,F)){await B;return}let[W]=await Promise.all([WR({stream:D,onStreamEnd:B,fdNumber:F,encoding:$,buffer:J,maxBuffer:Q,lines:Z,allMixed:X,stripFinalNewline:Y,verboseInfo:q,streamInfo:G}),B]);return W};var HR=({stdout:D,stderr:F},{all:$})=>$&&(D||F)?gF([D,F].filter(Boolean)):void 0,zR=({subprocess:D,encoding:F,buffer:$,maxBuffer:J,lines:Q,stripFinalNewline:Z,verboseInfo:X,streamInfo:Y})=>yG({...vi(D,$),fdNumber:"all",encoding:F,maxBuffer:J[1]+J[2],lines:Q[1]||Q[2],allMixed:hi(D),stripFinalNewline:Z,verboseInfo:X,streamInfo:Y}),vi=({stdout:D,stderr:F,all:$},[,J,Q])=>{let Z=J||Q;if(!Z)return{stream:$,buffer:Z};if(!J)return{stream:F,buffer:Z};if(!Q)return{stream:D,buffer:Z};return{stream:$,buffer:Z}},hi=({all:D,stdout:F,stderr:$})=>D&&F&&$&&F.readableObjectMode!==$.readableObjectMode;import{once as ui}from"node:events";var CR=(D)=>Z6(D,"ipc"),_R=(D,F)=>{let $=x$(D);G8({type:"ipc",verboseMessage:$,fdNumber:"ipc",verboseInfo:F})};var MR=async({subprocess:D,buffer:F,maxBuffer:$,ipc:J,ipcOutput:Q,verboseInfo:Z})=>{if(!J)return Q;let X=CR(Z),Y=a8(F,"ipc"),q=a8($,"ipc");for await(let G of OG({anyProcess:D,channel:D.channel,isSubprocess:!1,ipc:J,shouldAwait:!1,reference:!0})){if(Y)MO(D,Q,q),Q.push(G);if(X)_R(G,Z)}return Q},OR=async(D,F)=>{return await Promise.allSettled([D]),F};var ER=async({subprocess:D,options:{encoding:F,buffer:$,maxBuffer:J,lines:Q,timeoutDuration:Z,cancelSignal:X,gracefulCancel:Y,forceKillAfterDelay:q,stripFinalNewline:G,ipc:B,ipcInput:W},context:K,verboseInfo:U,fileDescriptors:V,originalStreams:H,onInternalError:z,controller:_})=>{let O=AE(D,K),C={originalStreams:H,fileDescriptors:V,subprocess:D,exitPromise:O,propagating:!1},M=VR({subprocess:D,encoding:F,buffer:$,maxBuffer:J,lines:Q,stripFinalNewline:G,verboseInfo:U,streamInfo:C}),E=zR({subprocess:D,encoding:F,buffer:$,maxBuffer:J,lines:Q,stripFinalNewline:G,verboseInfo:U,streamInfo:C}),A=[],I=MR({subprocess:D,buffer:$,maxBuffer:J,ipc:B,ipcOutput:A,verboseInfo:U}),R=gi(H,D,C),T=mi(V,C);try{return await Promise.race([Promise.all([{},wE(O),Promise.all(M),E,I,rM(D,W),...R,...T]),z,di(D,_),...cM(D,Z,K,_),...KM({subprocess:D,cancelSignal:X,gracefulCancel:Y,context:K,controller:_}),...pM({subprocess:D,cancelSignal:X,gracefulCancel:Y,forceKillAfterDelay:q,context:K,controller:_})])}catch(N){return K.terminationReason??="other",Promise.all([{error:N},O,Promise.all(M.map((j)=>xG(j))),xG(E),OR(I,A),Promise.allSettled(R),Promise.allSettled(T)])}},gi=(D,F,$)=>D.map((J,Q)=>J===F.stdio[Q]?void 0:m9(J,Q,$)),mi=(D,F)=>D.flatMap(({stdioItems:$},J)=>$.filter(({value:Q,stream:Z=Q})=>u2(Z,{checkOpen:!1})&&!v2(Z)).map(({type:Q,value:Z,stream:X=Z})=>m9(X,J,F,{isSameDirection:C2.has(Q),stopOnExit:Q==="native"}))),di=async(D,{signal:F})=>{let[$]=await ui(D,"error",{signal:F});throw $};var RR=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),d9=(D,F,$)=>{let J=D[$];if(!J.has(F))J.set(F,[]);let Q=J.get(F),Z=W8();return Q.push(Z),{resolve:Z.resolve.bind(Z),promises:Q}},_6=async({resolve:D,promises:F},$)=>{D();let[J]=await Promise.race([Promise.allSettled([!0,$]),Promise.all([!1,...F])]);return!J};import{Readable as pi}from"node:stream";import{callbackify as li}from"node:util";import{finished as AR}from"node:stream/promises";var fG=async(D)=>{if(D===void 0)return;try{await bG(D)}catch{}},IR=async(D)=>{if(D===void 0)return;try{await vG(D)}catch{}},bG=async(D)=>{await AR(D,{cleanup:!0,readable:!1,writable:!0})},vG=async(D)=>{await AR(D,{cleanup:!0,readable:!0,writable:!1})},PJ=async(D,F)=>{if(await D,F)throw F},jJ=(D,F,$)=>{if($&&!LJ($))D.destroy($);else if(F)D.destroy()};var wR=({subprocess:D,concurrentStreams:F,encoding:$},{from:J,binary:Q=!0,preserveNewlines:Z=!0}={})=>{let X=Q||X2.has($),{subprocessStdout:Y,waitReadableDestroy:q}=hG(D,J,F),{readableEncoding:G,readableObjectMode:B,readableHighWaterMark:W}=uG(Y,X),{read:K,onStdoutDataDone:U}=gG({subprocessStdout:Y,subprocess:D,binary:X,encoding:$,preserveNewlines:Z}),V=new pi({read:K,destroy:li(dG.bind(void 0,{subprocessStdout:Y,subprocess:D,waitReadableDestroy:q})),highWaterMark:W,objectMode:B,encoding:G});return mG({subprocessStdout:Y,onStdoutDataDone:U,readable:V,subprocess:D}),V},hG=(D,F,$)=>{let J=B6(D,F),Q=d9($,J,"readableDestroy");return{subprocessStdout:J,waitReadableDestroy:Q}},uG=({readableEncoding:D,readableObjectMode:F,readableHighWaterMark:$},J)=>J?{readableEncoding:D,readableObjectMode:F,readableHighWaterMark:$}:{readableEncoding:D,readableObjectMode:!0,readableHighWaterMark:SG},gG=({subprocessStdout:D,subprocess:F,binary:$,encoding:J,preserveNewlines:Q})=>{let Z=W8(),X=TJ({subprocessStdout:D,subprocess:F,binary:$,shouldEncode:!$,encoding:J,preserveNewlines:Q});return{read(){ci(this,X,Z)},onStdoutDataDone:Z}},ci=async(D,F,$)=>{try{let{value:J,done:Q}=await F.next();if(Q)$.resolve();else D.push(J)}catch{}},mG=async({subprocessStdout:D,onStdoutDataDone:F,readable:$,subprocess:J,subprocessStdin:Q})=>{try{if(await vG(D),await J,await fG(Q),await F,$.readable)$.push(null)}catch(Z){await fG(Q),NR($,Z)}},dG=async({subprocessStdout:D,subprocess:F,waitReadableDestroy:$},J)=>{if(await _6($,F))NR(D,J),await PJ(F,J)},NR=(D,F)=>{jJ(D,D.readable,F)};import{Writable as ni}from"node:stream";import{callbackify as TR}from"node:util";var LR=({subprocess:D,concurrentStreams:F},{to:$}={})=>{let{subprocessStdin:J,waitWritableFinal:Q,waitWritableDestroy:Z}=pG(D,$,F),X=new ni({...lG(J,D,Q),destroy:TR(nG.bind(void 0,{subprocessStdin:J,subprocess:D,waitWritableFinal:Q,waitWritableDestroy:Z})),highWaterMark:J.writableHighWaterMark,objectMode:J.writableObjectMode});return cG(J,X),X},pG=(D,F,$)=>{let J=l$(D,F),Q=d9($,J,"writableFinal"),Z=d9($,J,"writableDestroy");return{subprocessStdin:J,waitWritableFinal:Q,waitWritableDestroy:Z}},lG=(D,F,$)=>({write:ii.bind(void 0,D),final:TR(oi.bind(void 0,D,F,$))}),ii=(D,F,$,J)=>{if(D.write(F,$))J();else D.once("drain",J)},oi=async(D,F,$)=>{if(await _6($,F)){if(D.writable)D.end();await F}},cG=async(D,F,$)=>{try{if(await bG(D),F.writable)F.end()}catch(J){await IR($),PR(F,J)}},nG=async({subprocessStdin:D,subprocess:F,waitWritableFinal:$,waitWritableDestroy:J},Q)=>{if(await _6($,F),await _6(J,F))PR(D,Q),await PJ(F,Q)},PR=(D,F)=>{jJ(D,D.writable,F)};import{Duplex as ai}from"node:stream";import{callbackify as ri}from"node:util";var jR=({subprocess:D,concurrentStreams:F,encoding:$},{from:J,to:Q,binary:Z=!0,preserveNewlines:X=!0}={})=>{let Y=Z||X2.has($),{subprocessStdout:q,waitReadableDestroy:G}=hG(D,J,F),{subprocessStdin:B,waitWritableFinal:W,waitWritableDestroy:K}=pG(D,Q,F),{readableEncoding:U,readableObjectMode:V,readableHighWaterMark:H}=uG(q,Y),{read:z,onStdoutDataDone:_}=gG({subprocessStdout:q,subprocess:D,binary:Y,encoding:$,preserveNewlines:X}),O=new ai({read:z,...lG(B,D,W),destroy:ri(si.bind(void 0,{subprocessStdout:q,subprocessStdin:B,subprocess:D,waitReadableDestroy:G,waitWritableFinal:W,waitWritableDestroy:K})),readableHighWaterMark:H,writableHighWaterMark:B.writableHighWaterMark,readableObjectMode:V,writableObjectMode:B.writableObjectMode,encoding:U});return mG({subprocessStdout:q,onStdoutDataDone:_,readable:O,subprocess:D,subprocessStdin:B}),cG(B,O,q),O},si=async({subprocessStdout:D,subprocessStdin:F,subprocess:$,waitReadableDestroy:J,waitWritableFinal:Q,waitWritableDestroy:Z},X)=>{await Promise.all([dG({subprocessStdout:D,subprocess:$,waitReadableDestroy:J},X),nG({subprocessStdin:F,subprocess:$,waitWritableFinal:Q,waitWritableDestroy:Z},X)])};var iG=(D,F,{from:$,binary:J=!1,preserveNewlines:Q=!1}={})=>{let Z=J||X2.has(F),X=B6(D,$),Y=TJ({subprocessStdout:X,subprocess:D,binary:Z,shouldEncode:!0,encoding:F,preserveNewlines:Q});return ti(Y,X,D)},ti=async function*(D,F,$){try{yield*D}finally{if(F.readable)F.destroy();await $}};var SR=(D,{encoding:F})=>{let $=RR();D.readable=wR.bind(void 0,{subprocess:D,concurrentStreams:$,encoding:F}),D.writable=LR.bind(void 0,{subprocess:D,concurrentStreams:$}),D.duplex=jR.bind(void 0,{subprocess:D,concurrentStreams:$,encoding:F}),D.iterable=iG.bind(void 0,D,F),D[Symbol.asyncIterator]=iG.bind(void 0,D,F,{})};var xR=(D,F)=>{for(let[$,J]of Do){let Q=J.value.bind(F);Reflect.defineProperty(D,$,{...J,value:Q})}},ei=(async()=>{})().constructor.prototype,Do=["then","catch","finally"].map((D)=>[D,Reflect.getOwnPropertyDescriptor(ei,D)]);var kR=(D,F,$,J)=>{let{file:Q,commandArguments:Z,command:X,escapedCommand:Y,startTime:q,verboseInfo:G,options:B,fileDescriptors:W}=Jo(D,F,$),{subprocess:K,promise:U}=Zo({file:Q,commandArguments:Z,options:B,startTime:q,verboseInfo:G,command:X,escapedCommand:Y,fileDescriptors:W});return K.pipe=NJ.bind(void 0,{source:K,sourcePromise:U,boundOptions:{},createNested:J}),xR(K,U),K8.set(K,{options:B,fileDescriptors:W}),K},Jo=(D,F,$)=>{let{command:J,escapedCommand:Q,startTime:Z,verboseInfo:X}=y$(D,F,$),{file:Y,commandArguments:q,options:G}=FJ(D,F,$),B=Qo(G),W=gE(B,X);return{file:Y,commandArguments:q,command:J,escapedCommand:Q,startTime:Z,verboseInfo:X,options:B,fileDescriptors:W}},Qo=({timeout:D,signal:F,...$})=>{if(F!==void 0)throw TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...$,timeoutDuration:D}},Zo=({file:D,commandArguments:F,options:$,startTime:J,verboseInfo:Q,command:Z,escapedCommand:X,fileDescriptors:Y})=>{let q;try{q=$o(...$J(D,F,$))}catch(V){return bE({error:V,command:Z,escapedCommand:X,fileDescriptors:Y,options:$,startTime:J,verboseInfo:Q})}let G=new AbortController;Fo(Number.POSITIVE_INFINITY,G.signal);let B=[...q.stdio];rE(q,Y,G),FR(q,$,G);let W={},K=W8();q.kill=BM.bind(void 0,{kill:q.kill.bind(q),options:$,onInternalError:K,context:W,controller:G}),q.all=HR(q,$),SR(q,$),kE(q,$);let U=Xo({subprocess:q,options:$,startTime:J,verboseInfo:Q,fileDescriptors:Y,originalStreams:B,command:Z,escapedCommand:X,context:W,onInternalError:K,controller:G});return{subprocess:q,promise:U}},Xo=async({subprocess:D,options:F,startTime:$,verboseInfo:J,fileDescriptors:Q,originalStreams:Z,command:X,escapedCommand:Y,context:q,onInternalError:G,controller:B})=>{let[W,[K,U],V,H,z]=await ER({subprocess:D,options:F,context:q,verboseInfo:J,fileDescriptors:Q,originalStreams:Z,onInternalError:G,controller:B});B.abort(),G.resolve();let _=V.map((M,E)=>t8(M,F,E)),O=t8(H,F,"all"),C=Yo({errorInfo:W,exitCode:K,signal:U,stdio:_,all:O,ipcOutput:z,context:q,options:F,command:X,escapedCommand:Y,startTime:$});return V6(C,J,F)},Yo=({errorInfo:D,exitCode:F,signal:$,stdio:J,all:Q,ipcOutput:Z,context:X,options:Y,command:q,escapedCommand:G,startTime:B})=>("error"in D)?b9({error:D.error,command:q,escapedCommand:G,timedOut:X.terminationReason==="timeout",isCanceled:X.terminationReason==="cancel"||X.terminationReason==="gracefulCancel",isGracefullyCanceled:X.terminationReason==="gracefulCancel",isMaxBuffer:D.error instanceof r8,isForcefullyTerminated:X.isForcefullyTerminated,exitCode:F,signal:$,stdio:J,all:Q,ipcOutput:Z,options:Y,startTime:B,isSync:!1}):WJ({command:q,escapedCommand:G,stdio:J,all:Q,ipcOutput:Z,options:Y,startTime:B});var SJ=(D,F)=>{let $=Object.fromEntries(Object.entries(F).map(([J,Q])=>[J,qo(J,D[J],Q)]));return{...D,...$}},qo=(D,F,$)=>{if(Go.has(D)&&mD(F)&&mD($))return{...F,...$};return $},Go=new Set(["env",...Tq]);var h1=(D,F,$,J)=>{let Q=(X,Y,q)=>h1(X,Y,$,q),Z=(...X)=>Bo({mapArguments:D,deepOptions:$,boundOptions:F,setBoundExeca:J,createNested:Q},...X);if(J!==void 0)J(Z,Q,F);return Z},Bo=({mapArguments:D,deepOptions:F={},boundOptions:$={},setBoundExeca:J,createNested:Q},Z,...X)=>{if(mD(Z))return Q(D,SJ($,Z),J);let{file:Y,commandArguments:q,options:G,isSync:B}=Wo({mapArguments:D,firstArgument:Z,nextArguments:X,deepOptions:F,boundOptions:$});return B?TE(Y,q,G):kR(Y,q,G,Q)},Wo=({mapArguments:D,firstArgument:F,nextArguments:$,deepOptions:J,boundOptions:Q})=>{let Z=bC(F)?vC(F,$):[F,...$],[X,Y,q]=A$(...Z),G=SJ(SJ(J,Q),q),{file:B=X,commandArguments:W=Y,options:K=G,isSync:U=!1}=D({file:X,commandArguments:Y,options:G});return{file:B,commandArguments:W,options:K,isSync:U}};var yR=({file:D,commandArguments:F})=>bR(D,F),fR=({file:D,commandArguments:F})=>({...bR(D,F),isSync:!0}),bR=(D,F)=>{if(F.length>0)throw TypeError(`The command and its arguments must be passed as a single string: ${D} ${F}.`);let[$,...J]=Ko(D);return{file:$,commandArguments:J}},Ko=(D)=>{if(typeof D!=="string")throw TypeError(`The command must be a string: ${String(D)}.`);let F=D.trim();if(F==="")return[];let $=[];for(let J of F.split(Uo)){let Q=$.at(-1);if(Q&&Q.endsWith("\\"))$[$.length-1]=`${Q.slice(0,-1)} ${J}`;else $.push(J)}return $},Uo=/ +/g;var vR=(D,F,$)=>{D.sync=F(Vo,$),D.s=D.sync},hR=({options:D})=>uR(D),Vo=({options:D})=>({...uR(D),isSync:!0}),uR=(D)=>({options:{...Ho(D),...D}}),Ho=({input:D,inputFile:F,stdio:$})=>D===void 0&&F===void 0&&$===void 0?{stdin:"inherit"}:{},gR={preferLocal:!0};var wD=h1(()=>({})),TMD=h1(()=>({isSync:!0})),LMD=h1(yR),PMD=h1(fR),jMD=h1(iM),SMD=h1(hR,{},gR,vR),{sendMessage:xMD,getOneMessage:kMD,getEachMessage:yMD,getCancelSignal:fMD}=yE();import $Y from"node:fs";import Vk from"node:path";A6();var sJ=256,tJ;function eJ(D=11){if(!tJ||sJ+D>512){tJ="",sJ=0;for(let F=0;F<256;F++)tJ+=(256+Math.random()*256|0).toString(16).substring(1)}return tJ.substring(sJ,sJ+++D)}function DQ(D){let{batch:F,chain:$,ccipRead:J,dataSuffix:Q,key:Z="base",name:X="Base Client",type:Y="base"}=D,q=D.experimental_blockTag??(typeof $?.experimental_preconfirmationTime==="number"?"pending":void 0),G=$?.blockTime??12000,B=Math.min(Math.max(Math.floor(G/2),500),4000),W=D.pollingInterval??B,K=D.cacheTime??W,U=D.account?i(D.account):void 0,{config:V,request:H,value:z}=D.transport({account:U,chain:$,pollingInterval:W}),_={...V,...z},O={account:U,batch:F,cacheTime:K,ccipRead:J,chain:$,dataSuffix:Q,key:Z,name:X,pollingInterval:W,request:H,transport:_,type:Y,uid:eJ(),...q?{experimental_blockTag:q}:{}};function C(M){return(E)=>{let A=E(M);for(let R in O)delete A[R];let I={...M,...A};return Object.assign(I,{extend:C(I)})}}return Object.assign(O,{extend:C(O)})}z8();Y1();a0();tF();c();s();q1();function y6(D){if(!(D instanceof P))return!1;let F=D.walk(($)=>$ instanceof N8);if(!(F instanceof N8))return!1;if(F.data?.errorName==="HttpError")return!0;if(F.data?.errorName==="ResolverError")return!0;if(F.data?.errorName==="ResolverNotContract")return!0;if(F.data?.errorName==="ResolverNotFound")return!0;if(F.data?.errorName==="ReverseAddressMismatch")return!0;if(F.data?.errorName==="UnsupportedResolverProfile")return!0;return!1}W4();K0();c();c2();function kQ(D){if(D.length!==66)return null;if(D.indexOf("[")!==0)return null;if(D.indexOf("]")!==65)return null;let F=`0x${D.slice(1,65)}`;if(!DD(F))return null;return F}function K4(D){let F=new Uint8Array(32).fill(0);if(!D)return WD(F);let $=D.split(".");for(let J=$.length-1;J>=0;J-=1){let Q=kQ($[J]),Z=Q?O2(Q):OD(p2($[J]),"bytes");F=OD(ID([F,Z]),"bytes")}return WD(F)}K0();function CI(D){return`[${D.slice(2)}]`}K0();c();c2();function _I(D){let F=new Uint8Array(32).fill(0);if(!D)return WD(F);return kQ(D)||OD(p2(D))}function f6(D){let F=D.replace(/^\.|\.$/gm,"");if(F.length===0)return new Uint8Array(1);let $=new Uint8Array(p2(F).byteLength+2),J=0,Q=F.split(".");for(let Z=0;Z<Q.length;Z++){let X=p2(Q[Z]);if(X.byteLength>255)X=p2(CI(_I(Q[Z])));$[J]=X.length,$.set(X,J+1),J+=X.length+1}if($.byteLength!==J+1)return $.slice(0,J+1);return $}function f(D,F,$){let J=D[F.name];if(typeof J==="function")return J;let Q=D[$];if(typeof Q==="function")return Q;return(Z)=>F(D,Z)}Y1();a0();gD();s();q1();$3();F7();var Ma=3;function B2(D,{abi:F,address:$,args:J,docsPath:Q,functionName:Z,sender:X}){let Y=D instanceof T8?D:D instanceof P?D.walk((V)=>("data"in V))||D.walk():{},{code:q,data:G,details:B,message:W,shortMessage:K}=Y,U=(()=>{if(D instanceof d2)return new SQ({functionName:Z});if([Ma,B1.code].includes(q)&&(G||B||W||K)||q===R2.code&&B==="execution reverted"&&G)return new N8({abi:F,data:typeof G==="object"?G.data:G,functionName:Z,message:Y instanceof F3?B:K??W});return D})();return new k6(U,{abi:F,args:J,contractAddress:$,docsPath:Q,functionName:Z,sender:X})}U3();async function aD(D,F){let{abi:$,address:J,args:Q,functionName:Z,...X}=F,Y=ED({abi:$,args:Q,functionName:Z});try{let{data:q}=await f(D,w2,"call")({...X,data:Y,to:J});return O0({abi:$,args:Q,functionName:Z,data:q||"0x"})}catch(q){throw B2(q,{abi:$,address:J,args:Q,docsPath:"/docs/contract/readContract",functionName:Z})}}async function Xw(D,F){let{blockNumber:$,blockTag:J,coinType:Q,name:Z,gatewayUrls:X,strict:Y}=F,{chain:q}=D,G=(()=>{if(F.universalResolverAddress)return F.universalResolverAddress;if(!q)throw Error("client chain not configured. universalResolverAddress is required.");return E2({blockNumber:$,chain:q,contract:"ensUniversalResolver"})})(),B=q?.ensTlds;if(B&&!B.some((K)=>Z.endsWith(K)))return null;let W=(()=>{if(Q!=null)return[K4(Z),BigInt(Q)];return[K4(Z)]})();try{let K=ED({abi:$B,functionName:"addr",args:W}),U={address:G,abi:$Q,functionName:"resolveWithGateways",args:[nD(f6(Z)),K,X??[G1]],blockNumber:$,blockTag:J},H=await f(D,aD,"readContract")(U);if(H[0]==="0x")return null;let z=O0({abi:$B,args:W,functionName:"addr",data:H[0]});if(z==="0x")return null;if(q2(z)==="0x00")return null;return z}catch(K){if(Y)throw K;if(y6(K))return null;throw K}}s();class wW extends P{constructor({data:D}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(D)}`],name:"EnsAvatarInvalidMetadataError"})}}class V3 extends P{constructor({reason:D}){super(`ENS NFT avatar URI is invalid. ${D}`,{name:"EnsAvatarInvalidNftUriError"})}}class N4 extends P{constructor({uri:D}){super(`Unable to resolve ENS avatar URI "${D}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}class NW extends P{constructor({namespace:D}){super(`ENS NFT avatar namespace "${D}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}var da=/(?<protocol>https?:\/\/[^/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,pa=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?<target>[\w\-.]+))?(?<subtarget>\/.*)?$/,la=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,ca=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function na(D){try{let F=await fetch(D,{method:"HEAD"});if(F.status===200)return F.headers.get("content-type")?.startsWith("image/");return!1}catch(F){if(typeof F==="object"&&typeof F.response<"u")return!1;if(!Object.hasOwn(globalThis,"Image"))return!1;return new Promise(($)=>{let J=new Image;J.onload=()=>{$(!0)},J.onerror=()=>{$(!1)},J.src=D})}}function Yw(D,F){if(!D)return F;if(D.endsWith("/"))return D.slice(0,-1);return D}function TW({uri:D,gatewayUrls:F}){let $=la.test(D);if($)return{uri:D,isOnChain:!0,isEncoded:$};let J=Yw(F?.ipfs,"https://ipfs.io"),Q=Yw(F?.arweave,"https://arweave.net"),Z=D.match(da),{protocol:X,subpath:Y,target:q,subtarget:G=""}=Z?.groups||{},B=X==="ipns:/"||Y==="ipns/",W=X==="ipfs:/"||Y==="ipfs/"||pa.test(D);if(D.startsWith("http")&&!B&&!W){let U=D;if(F?.arweave)U=D.replace(/https:\/\/arweave.net/g,F?.arweave);return{uri:U,isOnChain:!1,isEncoded:!1}}if((B||W)&&q)return{uri:`${J}/${B?"ipns":"ipfs"}/${q}${G}`,isOnChain:!1,isEncoded:!1};if(X==="ar:/"&&q)return{uri:`${Q}/${q}${G||""}`,isOnChain:!1,isEncoded:!1};let K=D.replace(ca,"");if(K.startsWith("<svg"))K=`data:image/svg+xml;base64,${btoa(K)}`;if(K.startsWith("data:")||K.startsWith("{"))return{uri:K,isOnChain:!0,isEncoded:!1};throw new N4({uri:D})}function LW(D){if(typeof D!=="object"||!("image"in D)&&!("image_url"in D)&&!("image_data"in D))throw new wW({data:D});return D.image||D.image_url||D.image_data}async function qw({gatewayUrls:D,uri:F}){try{let $=await fetch(F).then((Q)=>Q.json());return await oQ({gatewayUrls:D,uri:LW($)})}catch{throw new N4({uri:F})}}async function oQ({gatewayUrls:D,uri:F}){let{uri:$,isOnChain:J}=TW({uri:F,gatewayUrls:D});if(J)return $;if(await na($))return $;throw new N4({uri:F})}function Gw(D){let F=D;if(F.startsWith("did:nft:"))F=F.replace("did:nft:","").replace(/_/g,"/");let[$,J,Q]=F.split("/"),[Z,X]=$.split(":"),[Y,q]=J.split(":");if(!Z||Z.toLowerCase()!=="eip155")throw new V3({reason:"Only EIP-155 supported"});if(!X)throw new V3({reason:"Chain ID not found"});if(!q)throw new V3({reason:"Contract address not found"});if(!Q)throw new V3({reason:"Token ID not found"});if(!Y)throw new V3({reason:"ERC namespace not found"});return{chainID:Number.parseInt(X,10),namespace:Y.toLowerCase(),contractAddress:q,tokenID:Q}}async function Bw(D,{nft:F}){if(F.namespace==="erc721")return aD(D,{address:F.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(F.tokenID)]});if(F.namespace==="erc1155")return aD(D,{address:F.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(F.tokenID)]});throw new NW({namespace:F.namespace})}async function Ww(D,{gatewayUrls:F,record:$}){if(/eip155:/i.test($))return ia(D,{gatewayUrls:F,record:$});return oQ({uri:$,gatewayUrls:F})}async function ia(D,{gatewayUrls:F,record:$}){let J=Gw($),Q=await Bw(D,{nft:J}),{uri:Z,isOnChain:X,isEncoded:Y}=TW({uri:Q,gatewayUrls:F});if(X&&(Z.includes("data:application/json;base64,")||Z.startsWith("{"))){let G=Y?atob(Z.replace("data:application/json;base64,","")):Z,B=JSON.parse(G);return oQ({uri:LW(B),gatewayUrls:F})}let q=J.tokenID;if(J.namespace==="erc1155")q=q.replace("0x","").padStart(64,"0");return qw({gatewayUrls:F,uri:Z.replace(/(?:0x)?{id}/,q)})}z8();Y1();a0();tF();c();W4();async function aQ(D,F){let{blockNumber:$,blockTag:J,key:Q,name:Z,gatewayUrls:X,strict:Y}=F,{chain:q}=D,G=(()=>{if(F.universalResolverAddress)return F.universalResolverAddress;if(!q)throw Error("client chain not configured. universalResolverAddress is required.");return E2({blockNumber:$,chain:q,contract:"ensUniversalResolver"})})(),B=q?.ensTlds;if(B&&!B.some((W)=>Z.endsWith(W)))return null;try{let W={address:G,abi:$Q,args:[nD(f6(Z)),ED({abi:FB,functionName:"text",args:[K4(Z),Q]}),X??[G1]],functionName:"resolveWithGateways",blockNumber:$,blockTag:J},U=await f(D,aD,"readContract")(W);if(U[0]==="0x")return null;let V=O0({abi:FB,functionName:"text",data:U[0]});return V===""?null:V}catch(W){if(Y)throw W;if(y6(W))return null;throw W}}async function Kw(D,{blockNumber:F,blockTag:$,assetGatewayUrls:J,name:Q,gatewayUrls:Z,strict:X,universalResolverAddress:Y}){let q=await f(D,aQ,"getEnsText")({blockNumber:F,blockTag:$,key:"avatar",name:Q,universalResolverAddress:Y,gatewayUrls:Z,strict:X});if(!q)return null;try{return await Ww(D,{record:q,gatewayUrls:J})}catch{return null}}z8();tF();W4();async function Uw(D,F){let{address:$,blockNumber:J,blockTag:Q,coinType:Z=60n,gatewayUrls:X,strict:Y}=F,{chain:q}=D,G=(()=>{if(F.universalResolverAddress)return F.universalResolverAddress;if(!q)throw Error("client chain not configured. universalResolverAddress is required.");return E2({blockNumber:J,chain:q,contract:"ensUniversalResolver"})})();try{let B={address:G,abi:OA,args:[$,Z,X??[G1]],functionName:"reverseWithGateways",blockNumber:J,blockTag:Q},W=f(D,aD,"readContract"),[K]=await W(B);return K||null}catch(B){if(Y)throw B;if(y6(B))return null;throw B}}tF();c();async function Vw(D,F){let{blockNumber:$,blockTag:J,name:Q}=F,{chain:Z}=D,X=(()=>{if(F.universalResolverAddress)return F.universalResolverAddress;if(!Z)throw Error("client chain not configured. universalResolverAddress is required.");return E2({blockNumber:$,chain:Z,contract:"ensUniversalResolver"})})(),Y=Z?.ensTlds;if(Y&&!Y.some((G)=>Q.endsWith(G)))throw Error(`${Q} is not a valid ENS TLD (${Y?.join(", ")}) for chain "${Z.name}" (id: ${Z.id}).`);let[q]=await f(D,aD,"readContract")({address:X,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"},{type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[nD(f6(Q))],blockNumber:$,blockTag:J});return q}U3();c();MW();S8();x8();async function rQ(D,F){let{account:$=D.account,blockNumber:J,blockTag:Q="latest",blobs:Z,data:X,gas:Y,gasPrice:q,maxFeePerBlobGas:G,maxFeePerGas:B,maxPriorityFeePerGas:W,to:K,value:U,...V}=F,H=$?i($):void 0;try{X0(F);let _=(typeof J==="bigint"?k(J):void 0)||Q,O=D.chain?.formatters?.transactionRequest?.format,M=(O||Z0)({...t0(V,{format:O}),account:H,blobs:Z,data:X,gas:Y,gasPrice:q,maxFeePerBlobGas:G,maxFeePerGas:B,maxPriorityFeePerGas:W,to:K,value:U},"createAccessList"),E=await D.request({method:"eth_createAccessList",params:[M,_]});return{accessList:E.accessList,gasUsed:BigInt(E.gasUsed)}}catch(z){throw cQ(z,{...F,account:H,chain:D.chain})}}function t1(D,{method:F}){let $={};if(D.transport.type==="fallback")D.transport.onResponse?.(({method:J,response:Q,status:Z,transport:X})=>{if(Z==="success"&&F===J)$[Q]=X.request});return(J)=>$[J]||D.request}async function Hw(D){let F=t1(D,{method:"eth_newBlockFilter"}),$=await D.request({method:"eth_newBlockFilter"});return{id:$,request:F($),type:"block"}}gD();s();class PW extends P{constructor(D){super(`Filter type "${D}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}K0();c2();Y4();A8();D1();l1();var zw="/docs/contract/encodeEventTopics";function k8(D){let{abi:F,eventName:$,args:J}=D,Q=F[0];if($){let q=o0({abi:F,name:$});if(!q)throw new XQ($,{docsPath:zw});Q=q}if(Q.type!=="event")throw new XQ(void 0,{docsPath:zw});let Z=eD(Q),X=p1(Z),Y=[];if(J&&"inputs"in Q){let q=Q.inputs?.filter((B)=>("indexed"in B)&&B.indexed),G=Array.isArray(J)?J:Object.values(J).length>0?q?.map((B)=>J[B.name])??[]:[];if(G.length>0)Y=q?.map((B,W)=>{if(Array.isArray(G[W]))return G[W].map((K,U)=>Cw({param:B,value:G[W][U]}));return typeof G[W]<"u"&&G[W]!==null?Cw({param:B,value:G[W]}):null})??[]}return[X,...Y]}function Cw({param:D,value:F}){if(D.type==="string"||D.type==="bytes")return OD(O2(F));if(D.type==="tuple"||D.type.match(/^(.*)\[(\d+)?\]$/))throw new PW(D.type);return iD([D],[F])}c();async function sQ(D,F){let{address:$,abi:J,args:Q,eventName:Z,fromBlock:X,strict:Y,toBlock:q}=F,G=t1(D,{method:"eth_newFilter"}),B=Z?k8({abi:J,args:Q,eventName:Z}):void 0,W=await D.request({method:"eth_newFilter",params:[{address:$,fromBlock:typeof X==="bigint"?k(X):X,toBlock:typeof q==="bigint"?k(q):q,topics:B}]});return{abi:J,args:Q,eventName:Z,id:W,request:G(W),strict:Boolean(Y),type:"event"}}c();async function tQ(D,{address:F,args:$,event:J,events:Q,fromBlock:Z,strict:X,toBlock:Y}={}){let q=Q??(J?[J]:void 0),G=t1(D,{method:"eth_newFilter"}),B=[];if(q){if(B=[q.flatMap((U)=>k8({abi:[U],eventName:U.name,args:$}))],J)B=B[0]}let W=await D.request({method:"eth_newFilter",params:[{address:F,fromBlock:typeof Z==="bigint"?k(Z):Z,toBlock:typeof Y==="bigint"?k(Y):Y,...B.length?{topics:B}:{}}]});return{abi:q,args:$,eventName:J?J.name:void 0,fromBlock:Z,id:W,request:G(W),strict:Boolean(X),toBlock:Y,type:"event"}}async function eQ(D){let F=t1(D,{method:"eth_newPendingTransactionFilter"}),$=await D.request({method:"eth_newPendingTransactionFilter"});return{id:$,request:F($),type:"transaction"}}a0();s();Z1();c2();function _w(D){let F=OD(`0x${D.substring(4)}`).substring(26);return O8(`0x${F}`)}_2();D0();c();async function FN({hash:D,signature:F}){let $=DD(D)?D:nD(D),{secp256k1:J}=await Promise.resolve().then(() => (ZZ(),ew));return`0x${(()=>{if(typeof F==="object"&&"r"in F&&"s"in F){let{r:G,s:B,v:W,yParity:K}=F,U=Number(K??W),V=DN(U);return new J.Signature(fD(G),fD(B)).addRecoveryBit(V)}let X=DD(F)?F:nD(F);if(GD(X)!==65)throw Error("invalid signature length");let Y=MD(`0x${X.slice(130)}`),q=DN(Y);return J.Signature.fromCompact(X.substring(2,130)).addRecoveryBit(q)})().recoverPublicKey($.substring(2)).toHex(!1)}`}function DN(D){if(D===0||D===1)return D;if(D===27)return 0;if(D===28)return 1;throw Error("Invalid yParityOrV value")}async function XZ({hash:D,signature:F}){return _w(await FN({hash:D,signature:F}))}K0();c();s();MQ();K0();c();function $N(D,F="hex"){let $=JN(D),J=w6(new Uint8Array($.length));if($.encode(J),F==="hex")return WD(J.bytes);return J.bytes}function JN(D){if(Array.isArray(D))return Er(D.map((F)=>JN(F)));return Rr(D)}function Er(D){let F=D.reduce((Q,Z)=>Q+Z.length,0),$=QN(F);return{length:(()=>{if(F<=55)return 1+F;return 1+$+F})(),encode(Q){if(F<=55)Q.pushByte(192+F);else if(Q.pushByte(247+$),$===1)Q.pushUint8(F);else if($===2)Q.pushUint16(F);else if($===3)Q.pushUint24(F);else Q.pushUint32(F);for(let{encode:Z}of D)Z(Q)}}}function Rr(D){let F=typeof D==="string"?W0(D):D,$=QN(F.length);return{length:(()=>{if(F.length===1&&F[0]<128)return 1;if(F.length<=55)return 1+F.length;return 1+$+F.length})(),encode(Q){if(F.length===1&&F[0]<128)Q.pushBytes(F);else if(F.length<=55)Q.pushByte(128+F.length),Q.pushBytes(F);else{if(Q.pushByte(183+$),$===1)Q.pushUint8(F.length);else if($===2)Q.pushUint16(F.length);else if($===3)Q.pushUint24(F.length);else Q.pushUint32(F.length);Q.pushBytes(F)}}}}function QN(D){if(D<256)return 1;if(D<65536)return 2;if(D<16777216)return 3;if(D<4294967296)return 4;throw new P("Length is too large.")}c2();function ZN(D){let{chainId:F,nonce:$,to:J}=D,Q=D.contractAddress??D.address,Z=OD(i0(["0x05",$N([F?k(F):"0x",Q,$?k($):"0x"])]));if(J==="bytes")return W0(Z);return Z}async function JF(D){let{authorization:F,signature:$}=D;return XZ({hash:ZN(F),signature:$??F})}c();jQ();S6();s();w8();class eW extends P{constructor(D,{account:F,docsPath:$,chain:J,data:Q,gas:Z,gasPrice:X,maxFeePerGas:Y,maxPriorityFeePerGas:q,nonce:G,to:B,value:W}){let K=eF({from:F?.address,to:B,value:typeof W<"u"&&`${j6(W)} ${J?.nativeCurrency?.symbol||"ETH"}`,data:Q,gas:Z,gasPrice:typeof X<"u"&&`${$0(X)} gwei`,maxFeePerGas:typeof Y<"u"&&`${$0(Y)} gwei`,maxPriorityFeePerGas:typeof q<"u"&&`${$0(q)} gwei`,nonce:G});super(D.shortMessage,{cause:D,docsPath:$,metaMessages:[...D.metaMessages?[...D.metaMessages," "]:[],"Estimate Gas Arguments:",K].filter(Boolean),name:"EstimateGasExecutionError"});Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=D}}W3();w4();function XN(D,{docsPath:F,...$}){let J=(()=>{let Q=s1(D,$);if(Q instanceof a2)return D;return Q})();return new eW(J,{docsPath:F,...$})}S8();iQ();x8();S6();s();class y4 extends P{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class C3 extends P{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class DK extends P{constructor({maxPriorityFeePerGas:D}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${$0(D)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}D0();s();class f4 extends P{constructor({blockHash:D,blockNumber:F}){let $="Block";if(D)$=`Block at hash "${D}"`;if(F)$=`Block at number "${F}"`;super(`${$} could not be found.`,{name:"BlockNotFoundError"})}}c();D0();var FK={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function z7(D,F){let $={...D,blockHash:D.blockHash?D.blockHash:null,blockNumber:D.blockNumber?BigInt(D.blockNumber):null,chainId:D.chainId?MD(D.chainId):void 0,gas:D.gas?BigInt(D.gas):void 0,gasPrice:D.gasPrice?BigInt(D.gasPrice):void 0,maxFeePerBlobGas:D.maxFeePerBlobGas?BigInt(D.maxFeePerBlobGas):void 0,maxFeePerGas:D.maxFeePerGas?BigInt(D.maxFeePerGas):void 0,maxPriorityFeePerGas:D.maxPriorityFeePerGas?BigInt(D.maxPriorityFeePerGas):void 0,nonce:D.nonce?MD(D.nonce):void 0,to:D.to?D.to:null,transactionIndex:D.transactionIndex?Number(D.transactionIndex):null,type:D.type?FK[D.type]:void 0,typeHex:D.type?D.type:void 0,value:D.value?BigInt(D.value):void 0,v:D.v?BigInt(D.v):void 0};if(D.authorizationList)$.authorizationList=Ar(D.authorizationList);if($.yParity=(()=>{if(D.yParity)return Number(D.yParity);if(typeof $.v==="bigint"){if($.v===0n||$.v===27n)return 0;if($.v===1n||$.v===28n)return 1;if($.v>=35n)return $.v%2n===0n?1:0}return})(),$.type==="legacy")delete $.accessList,delete $.maxFeePerBlobGas,delete $.maxFeePerGas,delete $.maxPriorityFeePerGas,delete $.yParity;if($.type==="eip2930")delete $.maxFeePerBlobGas,delete $.maxFeePerGas,delete $.maxPriorityFeePerGas;if($.type==="eip1559")delete $.maxFeePerBlobGas;return $}function Ar(D){return D.map((F)=>({address:F.address,chainId:Number(F.chainId),nonce:Number(F.nonce),r:F.r,s:F.s,yParity:Number(F.yParity)}))}function YZ(D,F){let $=(D.transactions??[]).map((J)=>{if(typeof J==="string")return J;return z7(J)});return{...D,baseFeePerGas:D.baseFeePerGas?BigInt(D.baseFeePerGas):null,blobGasUsed:D.blobGasUsed?BigInt(D.blobGasUsed):void 0,difficulty:D.difficulty?BigInt(D.difficulty):void 0,excessBlobGas:D.excessBlobGas?BigInt(D.excessBlobGas):void 0,gasLimit:D.gasLimit?BigInt(D.gasLimit):void 0,gasUsed:D.gasUsed?BigInt(D.gasUsed):void 0,hash:D.hash?D.hash:null,logsBloom:D.logsBloom?D.logsBloom:null,nonce:D.nonce?D.nonce:null,number:D.number?BigInt(D.number):null,size:D.size?BigInt(D.size):void 0,timestamp:D.timestamp?BigInt(D.timestamp):void 0,transactions:$,totalDifficulty:D.totalDifficulty?BigInt(D.totalDifficulty):null}}async function Y0(D,{blockHash:F,blockNumber:$,blockTag:J=D.experimental_blockTag??"latest",includeTransactions:Q}={}){let Z=Q??!1,X=$!==void 0?k($):void 0,Y=null;if(F)Y=await D.request({method:"eth_getBlockByHash",params:[F,Z]},{dedupe:!0});else Y=await D.request({method:"eth_getBlockByNumber",params:[X||J,Z]},{dedupe:Boolean(X)});if(!Y)throw new f4({blockHash:F,blockNumber:$});return(D.chain?.formatters?.block?.format||YZ)(Y,"getBlock")}async function C7(D){let F=await D.request({method:"eth_gasPrice"});return BigInt(F)}async function YN(D,F){return $K(D,F)}async function $K(D,F){let{block:$,chain:J=D.chain,request:Q}=F||{};try{let Z=J?.fees?.maxPriorityFeePerGas??J?.fees?.defaultPriorityFee;if(typeof Z==="function"){let Y=$||await f(D,Y0,"getBlock")({}),q=await Z({block:Y,client:D,request:Q});if(q===null)throw Error();return q}if(typeof Z<"u")return Z;let X=await D.request({method:"eth_maxPriorityFeePerGas"});return fD(X)}catch{let[Z,X]=await Promise.all([$?Promise.resolve($):f(D,Y0,"getBlock")({}),f(D,C7,"getGasPrice")({})]);if(typeof Z.baseFeePerGas!=="bigint")throw new C3;let Y=X-Z.baseFeePerGas;if(Y<0n)return 0n;return Y}}async function qN(D,F){return qZ(D,F)}async function qZ(D,F){let{block:$,chain:J=D.chain,request:Q,type:Z="eip1559"}=F||{},X=await(async()=>{if(typeof J?.fees?.baseFeeMultiplier==="function")return J.fees.baseFeeMultiplier({block:$,client:D,request:Q});return J?.fees?.baseFeeMultiplier??1.2})();if(X<1)throw new y4;let q=10**(X.toString().split(".")[1]?.length??0),G=(K)=>K*BigInt(Math.ceil(X*q))/BigInt(q),B=$?$:await f(D,Y0,"getBlock")({});if(typeof J?.fees?.estimateFeesPerGas==="function"){let K=await J.fees.estimateFeesPerGas({block:$,client:D,multiply:G,request:Q,type:Z});if(K!==null)return K}if(Z==="eip1559"){if(typeof B.baseFeePerGas!=="bigint")throw new C3;let K=typeof Q?.maxPriorityFeePerGas==="bigint"?Q.maxPriorityFeePerGas:await $K(D,{block:B,chain:J,request:Q}),U=G(B.baseFeePerGas);return{maxFeePerGas:Q?.maxFeePerGas??U+K,maxPriorityFeePerGas:K}}return{gasPrice:Q?.gasPrice??G(await f(D,C7,"getGasPrice")({}))}}D0();c();async function _7(D,{address:F,blockTag:$="latest",blockNumber:J}){let Q=await D.request({method:"eth_getTransactionCount",params:[F,typeof J==="bigint"?k(J):$]},{dedupe:Boolean(J)});return MD(Q)}K0();c();function GZ(D){let{kzg:F}=D,$=D.to??(typeof D.blobs[0]==="string"?"hex":"bytes"),J=typeof D.blobs[0]==="string"?D.blobs.map((Z)=>W0(Z)):D.blobs,Q=[];for(let Z of J)Q.push(Uint8Array.from(F.blobToKzgCommitment(Z)));return $==="bytes"?Q:Q.map((Z)=>WD(Z))}K0();c();function BZ(D){let{kzg:F}=D,$=D.to??(typeof D.blobs[0]==="string"?"hex":"bytes"),J=typeof D.blobs[0]==="string"?D.blobs.map((X)=>W0(X)):D.blobs,Q=typeof D.commitments[0]==="string"?D.commitments.map((X)=>W0(X)):D.commitments,Z=[];for(let X=0;X<J.length;X++){let Y=J[X],q=Q[X];Z.push(Uint8Array.from(F.computeBlobKzgProof(Y,q)))}return $==="bytes"?Z:Z.map((X)=>WD(X))}c();xW();var GN=H3;K0();c();function BN(D,F){let $=F||"hex",J=GN(DD(D,{strict:!1})?O2(D):D);if($==="bytes")return J;return nD(J)}function WN(D){let{commitment:F,version:$=1}=D,J=D.to??(typeof F==="string"?"hex":"bytes"),Q=BN(F,"bytes");return Q.set([$],0),J==="bytes"?Q:WD(Q)}function KN(D){let{commitments:F,version:$}=D,J=D.to??(typeof F[0]==="string"?"hex":"bytes"),Q=[];for(let Z of F)Q.push(WN({commitment:Z,to:J,version:$}));return Q}var UN=32,VN=4096,HN=131072,JK=761855;s();class QK extends P{constructor({maxSize:D,size:F}){super("Blob size is too large.",{metaMessages:[`Max: ${D} bytes`,`Given: ${F} bytes`],name:"BlobSizeTooLargeError"})}}class ZK extends P{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}MQ();_2();K0();c();function zN(D){let F=D.to??(typeof D.data==="string"?"hex":"bytes"),$=typeof D.data==="string"?W0(D.data):D.data,J=GD($);if(!J)throw new ZK;if(J>JK)throw new QK({maxSize:JK,size:J});let Q=[],Z=!0,X=0;while(Z){let Y=w6(new Uint8Array(HN)),q=0;while(q<VN){let G=$.slice(X,X+(UN-1));if(Y.pushByte(0),Y.pushBytes(G),G.length<31){Y.pushByte(128),Z=!1;break}q++,X+=31}Q.push(Y)}return F==="bytes"?Q.map((Y)=>Y.bytes):Q.map((Y)=>WD(Y.bytes))}function CN(D){let{data:F,kzg:$,to:J}=D,Q=D.blobs??zN({data:F,to:J}),Z=D.commitments??GZ({blobs:Q,kzg:$,to:J}),X=D.proofs??BZ({blobs:Q,commitments:Z,kzg:$,to:J}),Y=[];for(let q=0;q<Q.length;q++)Y.push({blob:Q[q],commitment:Z[q],proof:X[q]});return Y}rF();x8();w8();function _N(D){if(D.type)return D.type;if(typeof D.authorizationList<"u")return"eip7702";if(typeof D.blobs<"u"||typeof D.blobVersionedHashes<"u"||typeof D.maxFeePerBlobGas<"u"||typeof D.sidecars<"u")return"eip4844";if(typeof D.maxFeePerGas<"u"||typeof D.maxPriorityFeePerGas<"u")return"eip1559";if(typeof D.gasPrice<"u"){if(typeof D.accessList<"u")return"eip2930";return"legacy"}throw new pB({transaction:D})}W3();w8();w4();function QF(D,{docsPath:F,...$}){let J=(()=>{let Q=s1(D,$);if(Q instanceof a2)return D;return Q})();return new lB(J,{docsPath:F,...$})}S8();x8();D0();async function R0(D){let F=await D.request({method:"eth_chainId"},{dedupe:!0});return MD(F)}async function M7(D,F){let{account:$=D.account,accessList:J,authorizationList:Q,chain:Z=D.chain,blobVersionedHashes:X,blobs:Y,data:q,gas:G,gasPrice:B,maxFeePerBlobGas:W,maxFeePerGas:K,maxPriorityFeePerGas:U,nonce:V,nonceManager:H,to:z,type:_,value:O,...C}=F,M=await(async()=>{if(!$)return V;if(!H)return V;if(typeof V<"u")return V;let R=i($),T=Z?Z.id:await f(D,R0,"getChainId")({});return await H.consume({address:R.address,chainId:T,client:D})})();X0(F);let E=Z?.formatters?.transactionRequest?.format,I=(E||Z0)({...t0(C,{format:E}),account:$?i($):void 0,accessList:J,authorizationList:Q,blobs:Y,blobVersionedHashes:X,data:q,gas:G,gasPrice:B,maxFeePerBlobGas:W,maxFeePerGas:K,maxPriorityFeePerGas:U,nonce:M,to:z,type:_,value:O},"fillTransaction");try{let R=await D.request({method:"eth_fillTransaction",params:[I]}),N=(Z?.formatters?.transaction?.format||z7)(R.tx);if(delete N.blockHash,delete N.blockNumber,delete N.r,delete N.s,delete N.transactionIndex,delete N.v,delete N.yParity,N.data=N.input,N.gas)N.gas=F.gas??N.gas;if(N.gasPrice)N.gasPrice=F.gasPrice??N.gasPrice;if(N.maxFeePerBlobGas)N.maxFeePerBlobGas=F.maxFeePerBlobGas??N.maxFeePerBlobGas;if(N.maxFeePerGas)N.maxFeePerGas=F.maxFeePerGas??N.maxFeePerGas;if(N.maxPriorityFeePerGas)N.maxPriorityFeePerGas=F.maxPriorityFeePerGas??N.maxPriorityFeePerGas;if(N.nonce)N.nonce=F.nonce??N.nonce;let j=await(async()=>{if(typeof Z?.fees?.baseFeeMultiplier==="function"){let S=await f(D,Y0,"getBlock")({});return Z.fees.baseFeeMultiplier({block:S,client:D,request:F})}return Z?.fees?.baseFeeMultiplier??1.2})();if(j<1)throw new y4;let y=10**(j.toString().split(".")[1]?.length??0),m=(S)=>S*BigInt(Math.ceil(j*y))/BigInt(y);if(N.maxFeePerGas&&!F.maxFeePerGas)N.maxFeePerGas=m(N.maxFeePerGas);if(N.gasPrice&&!F.gasPrice)N.gasPrice=m(N.gasPrice);return{raw:R.raw,transaction:{from:I.from,...N}}}catch(R){throw QF(R,{...F,chain:D.chain})}}var b4=["blobVersionedHashes","chainId","fees","gas","nonce","type"],MN=new Map,XK=new G2(128);async function y8(D,F){let $=F;$.account??=D.account,$.parameters??=b4;let{account:J,chain:Q=D.chain,nonceManager:Z,parameters:X}=$,Y=(()=>{if(typeof Q?.prepareTransactionRequest==="function")return{fn:Q.prepareTransactionRequest,runAt:["beforeFillTransaction"]};if(Array.isArray(Q?.prepareTransactionRequest))return{fn:Q.prepareTransactionRequest[0],runAt:Q.prepareTransactionRequest[1].runAt};return})(),q;async function G(){if(q)return q;if(typeof $.chainId<"u")return $.chainId;if(Q)return Q.id;return q=await f(D,R0,"getChainId")({}),q}let B=J?i(J):J,W=$.nonce;if(X.includes("nonce")&&typeof W>"u"&&B&&Z){let M=await G();W=await Z.consume({address:B.address,chainId:M,client:D})}if(Y?.fn&&Y.runAt?.includes("beforeFillTransaction"))$=await Y.fn({...$,chain:Q},{phase:"beforeFillTransaction"}),W??=$.nonce;let U=(()=>{if((X.includes("blobVersionedHashes")||X.includes("sidecars"))&&$.kzg&&$.blobs)return!1;if(XK.get(D.uid)===!1)return!1;if(!["fees","gas"].some((E)=>X.includes(E)))return!1;if(X.includes("chainId")&&typeof $.chainId!=="number")return!0;if(X.includes("nonce")&&typeof W!=="number")return!0;if(X.includes("fees")&&typeof $.gasPrice!=="bigint"&&(typeof $.maxFeePerGas!=="bigint"||typeof $.maxPriorityFeePerGas!=="bigint"))return!0;if(X.includes("gas")&&typeof $.gas!=="bigint")return!0;return!1})()?await f(D,M7,"fillTransaction")({...$,nonce:W}).then((M)=>{let{chainId:E,from:A,gas:I,gasPrice:R,nonce:T,maxFeePerBlobGas:N,maxFeePerGas:j,maxPriorityFeePerGas:L,type:y,...m}=M.transaction;return XK.set(D.uid,!0),{...$,...A?{from:A}:{},...y?{type:y}:{},...typeof E<"u"?{chainId:E}:{},...typeof I<"u"?{gas:I}:{},...typeof R<"u"?{gasPrice:R}:{},...typeof T<"u"?{nonce:T}:{},...typeof N<"u"?{maxFeePerBlobGas:N}:{},...typeof j<"u"?{maxFeePerGas:j}:{},...typeof L<"u"?{maxPriorityFeePerGas:L}:{},..."nonceKey"in m&&typeof m.nonceKey<"u"?{nonceKey:m.nonceKey}:{}}}).catch((M)=>{let E=M;if(E.name!=="TransactionExecutionError")return $;if(E.walk?.((I)=>{let R=I;return R.name==="MethodNotFoundRpcError"||R.name==="MethodNotSupportedRpcError"}))XK.set(D.uid,!1);return $}):$;W??=U.nonce,$={...U,...B?{from:B?.address}:{},...W?{nonce:W}:{}};let{blobs:V,gas:H,kzg:z,type:_}=$;if(Y?.fn&&Y.runAt?.includes("beforeFillParameters"))$=await Y.fn({...$,chain:Q},{phase:"beforeFillParameters"});let O;async function C(){if(O)return O;return O=await f(D,Y0,"getBlock")({blockTag:"latest"}),O}if(X.includes("nonce")&&typeof W>"u"&&B&&!Z)$.nonce=await f(D,_7,"getTransactionCount")({address:B.address,blockTag:"pending"});if((X.includes("blobVersionedHashes")||X.includes("sidecars"))&&V&&z){let M=GZ({blobs:V,kzg:z});if(X.includes("blobVersionedHashes")){let E=KN({commitments:M,to:"hex"});$.blobVersionedHashes=E}if(X.includes("sidecars")){let E=BZ({blobs:V,commitments:M,kzg:z}),A=CN({blobs:V,commitments:M,proofs:E,to:"hex"});$.sidecars=A}}if(X.includes("chainId"))$.chainId=await G();if((X.includes("fees")||X.includes("type"))&&typeof _>"u")try{$.type=_N($)}catch{let M=MN.get(D.uid);if(typeof M>"u")M=typeof(await C())?.baseFeePerGas==="bigint",MN.set(D.uid,M);$.type=M?"eip1559":"legacy"}if(X.includes("fees"))if($.type!=="legacy"&&$.type!=="eip2930"){if(typeof $.maxFeePerGas>"u"||typeof $.maxPriorityFeePerGas>"u"){let M=await C(),{maxFeePerGas:E,maxPriorityFeePerGas:A}=await qZ(D,{block:M,chain:Q,request:$});if(typeof $.maxPriorityFeePerGas>"u"&&$.maxFeePerGas&&$.maxFeePerGas<A)throw new DK({maxPriorityFeePerGas:A});$.maxPriorityFeePerGas=A,$.maxFeePerGas=E}}else{if(typeof $.maxFeePerGas<"u"||typeof $.maxPriorityFeePerGas<"u")throw new C3;if(typeof $.gasPrice>"u"){let M=await C(),{gasPrice:E}=await qZ(D,{block:M,chain:Q,request:$,type:"legacy"});$.gasPrice=E}}if(X.includes("gas")&&typeof H>"u")$.gas=await f(D,O7,"estimateGas")({...$,account:B,prepare:B?.type==="local"?[]:["blobVersionedHashes"]});if(Y?.fn&&Y.runAt?.includes("afterFillParameters"))$=await Y.fn({...$,chain:Q},{phase:"afterFillParameters"});return X0($),delete $.parameters,$}async function O7(D,F){let{account:$=D.account,prepare:J=!0}=F,Q=$?i($):void 0,Z=(()=>{if(Array.isArray(J))return J;if(Q?.type!=="local")return["blobVersionedHashes"];return})();try{let X=await(async()=>{if(F.to)return F.to;if(F.authorizationList&&F.authorizationList.length>0)return await JF({authorization:F.authorizationList[0]}).catch(()=>{throw new P("`to` is required. Could not infer from `authorizationList`")});return})(),{accessList:Y,authorizationList:q,blobs:G,blobVersionedHashes:B,blockNumber:W,blockTag:K,data:U,gas:V,gasPrice:H,maxFeePerBlobGas:z,maxFeePerGas:_,maxPriorityFeePerGas:O,nonce:C,value:M,stateOverride:E,...A}=J?await y8(D,{...F,parameters:Z,to:X}):F;if(V&&F.gas!==V)return V;let R=(typeof W==="bigint"?k(W):void 0)||K,T=U7(E);X0(F);let N=D.chain?.formatters?.transactionRequest?.format,L=(N||Z0)({...t0(A,{format:N}),account:Q,accessList:Y,authorizationList:q,blobs:G,blobVersionedHashes:B,data:U,gasPrice:H,maxFeePerBlobGas:z,maxFeePerGas:_,maxPriorityFeePerGas:O,nonce:C,to:X,value:M},"estimateGas");return BigInt(await D.request({method:"eth_estimateGas",params:T?[L,R??D.experimental_blockTag??"latest",T]:R?[L,R]:[L]}))}catch(X){throw XN(X,{...F,account:Q,chain:D.chain})}}async function ON(D,F){let{abi:$,address:J,args:Q,functionName:Z,dataSuffix:X=typeof D.dataSuffix==="string"?D.dataSuffix:D.dataSuffix?.value,...Y}=F,q=ED({abi:$,args:Q,functionName:Z});try{return await f(D,O7,"estimateGas")({data:`${q}${X?X.replace("0x",""):""}`,to:J,...Y})}catch(G){let B=Y.account?i(Y.account):void 0;throw B2(G,{abi:$,address:J,args:Q,docsPath:"/docs/contract/estimateContractGas",functionName:Z,sender:B?.address})}}z8();Y1();a0();c();U3();async function EN(D,{address:F,blockNumber:$,blockTag:J=D.experimental_blockTag??"latest"}){if(D.batch?.multicall&&D.chain?.contracts?.multicall3){let X=D.chain.contracts.multicall3.address,Y=ED({abi:m2,functionName:"getEthBalance",args:[F]}),{data:q}=await f(D,w2,"call")({to:X,data:Y,blockNumber:$,blockTag:J});return O0({abi:m2,functionName:"getEthBalance",args:[F],data:q||"0x"})}let Q=typeof $==="bigint"?k($):void 0,Z=await D.request({method:"eth_getBalance",params:[F,Q||J]});return BigInt(Z)}async function RN(D){let F=await D.request({method:"eth_blobBaseFee"});return BigInt(F)}var Ir=new Map,wr=new Map;function AN(D){let F=(Q,Z)=>({clear:()=>Z.delete(Q),get:()=>Z.get(Q),set:(X)=>Z.set(Q,X)}),$=F(D,Ir),J=F(D,wr);return{clear:()=>{$.clear(),J.clear()},promise:$,response:J}}async function IN(D,{cacheKey:F,cacheTime:$=Number.POSITIVE_INFINITY}){let J=AN(F),Q=J.response.get();if(Q&&$>0){if(Date.now()-Q.created.getTime()<$)return Q.data}let Z=J.promise.get();if(!Z)Z=D(),J.promise.set(Z);try{let X=await Z;return J.response.set({created:new Date,data:X}),X}finally{J.promise.clear()}}var Nr=(D)=>`blockNumber.${D}`;async function f8(D,{cacheTime:F=D.cacheTime}={}){let $=await IN(()=>D.request({method:"eth_blockNumber"}),{cacheKey:Nr(D.uid),cacheTime:F});return BigInt($)}D0();c();async function wN(D,{blockHash:F,blockNumber:$,blockTag:J="latest"}={}){let Q=$!==void 0?k($):void 0,Z;if(F)Z=await D.request({method:"eth_getBlockTransactionCountByHash",params:[F]},{dedupe:!0});else Z=await D.request({method:"eth_getBlockTransactionCountByNumber",params:[Q||J]},{dedupe:Boolean(Q)});return MD(Z)}c();async function v4(D,{address:F,blockNumber:$,blockTag:J="latest"}){let Q=$!==void 0?k($):void 0,Z=await D.request({method:"eth_getCode",params:[F,Q||J]},{dedupe:Boolean(Q)});if(Z==="0x")return;return Z}l1();K3();K0();c2();Y4();gD();TB();_2();Y4();X4();D1();var NN="/docs/contract/decodeEventLog";function _3(D){let{abi:F,data:$,strict:J,topics:Q}=D,Z=J??!0,[X,...Y]=Q;if(!X)throw new WB({docsPath:NN});let q=F.find((_)=>_.type==="event"&&X===p1(eD(_)));if(!(q&&("name"in q))||q.type!=="event")throw new KB(X,{docsPath:NN});let{name:G,inputs:B}=q,W=B?.some((_)=>!(("name"in _)&&_.name)),K=W?[]:{},U=B.map((_,O)=>[_,O]).filter(([_])=>("indexed"in _)&&_.indexed),V=[];for(let _=0;_<U.length;_++){let[O,C]=U[_],M=Y[_];if(!M){if(Z)throw new pF({abiItem:q,param:O});V.push([O,C]);continue}K[W?C:O.name||C]=Tr({param:O,value:M})}let H=B.filter((_)=>!(("indexed"in _)&&_.indexed)),z=Z?H:[...V.map(([_])=>_),...H];if(z.length>0){if($&&$!=="0x")try{let _=X1(z,$);if(_){let O=0;if(!Z)for(let[C,M]of V)K[W?M:C.name||M]=_[O++];if(W){for(let C=0;C<B.length;C++)if(K[C]===void 0&&O<_.length)K[C]=_[O++]}else for(let C=0;C<H.length;C++)K[H[C].name]=_[O++]}}catch(_){if(Z){if(_ instanceof a9||_ instanceof Q4)throw new g1({abiItem:q,data:$,params:z,size:GD($)});throw _}}else if(Z)throw new g1({abiItem:q,data:"0x",params:z,size:0})}return{eventName:G,args:Object.values(K).length>0?K:void 0}}function Tr({param:D,value:F}){if(D.type==="string"||D.type==="bytes"||D.type==="tuple"||D.type.match(/^(.*)\[(\d+)?\]$/))return F;return(X1([D],F)||[])[0]}function E7(D){let{abi:F,args:$,logs:J,strict:Q=!0}=D,Z=(()=>{if(!D.eventName)return;if(Array.isArray(D.eventName))return D.eventName;return[D.eventName]})(),X=F.filter((Y)=>Y.type==="event").map((Y)=>({abi:Y,selector:p1(Y)}));return J.map((Y)=>{let q=X.filter((W)=>Y.topics[0]===W.selector);if(q.length===0)return null;let G,B;for(let W of q)try{G=_3({...Y,abi:[W.abi],strict:!0}),B=W;break}catch{}if(!G&&!Q){B=q[0];try{G=_3({data:Y.data,topics:Y.topics,abi:[B.abi],strict:!1})}catch{let W=B.abi.inputs?.some((K)=>!(("name"in K)&&K.name));return{...Y,args:W?[]:{},eventName:B.abi.name}}}if(!G||!B)return null;if(Z&&!Z.includes(G.eventName))return null;if(!Lr({args:G.args,inputs:B.abi.inputs,matchArgs:$}))return null;return{...G,...Y}}).filter(Boolean)}function Lr(D){let{args:F,inputs:$,matchArgs:J}=D;if(!J)return!0;if(!F)return!1;function Q(Z,X,Y){try{if(Z.type==="address")return I2(X,Y);if(Z.type==="string"||Z.type==="bytes")return OD(O2(X))===Y;return X===Y}catch{return!1}}if(Array.isArray(F)&&Array.isArray(J))return J.every((Z,X)=>{if(Z===null||Z===void 0)return!0;let Y=$[X];if(!Y)return!1;return(Array.isArray(Z)?Z:[Z]).some((G)=>Q(Y,G,F[X]))});if(typeof F==="object"&&!Array.isArray(F)&&typeof J==="object"&&!Array.isArray(J))return Object.entries(J).every(([Z,X])=>{if(X===null||X===void 0)return!0;let Y=$.find((G)=>G.name===Z);if(!Y)return!1;return(Array.isArray(X)?X:[X]).some((G)=>Q(Y,G,F[Z]))});return!1}c();function A0(D,{args:F,eventName:$}={}){return{...D,blockHash:D.blockHash?D.blockHash:null,blockNumber:D.blockNumber?BigInt(D.blockNumber):null,blockTimestamp:D.blockTimestamp?BigInt(D.blockTimestamp):D.blockTimestamp===null?null:void 0,logIndex:D.logIndex?Number(D.logIndex):null,transactionHash:D.transactionHash?D.transactionHash:null,transactionIndex:D.transactionIndex?Number(D.transactionIndex):null,...$?{args:F,eventName:$}:{}}}async function R7(D,{address:F,blockHash:$,fromBlock:J,toBlock:Q,event:Z,events:X,args:Y,strict:q}={}){let G=q??!1,B=X??(Z?[Z]:void 0),W=[];if(B){if(W=[B.flatMap((H)=>k8({abi:[H],eventName:H.name,args:X?void 0:Y}))],Z)W=W[0]}let K;if($)K=await D.request({method:"eth_getLogs",params:[{address:F,topics:W,blockHash:$}]});else K=await D.request({method:"eth_getLogs",params:[{address:F,topics:W,fromBlock:typeof J==="bigint"?k(J):J,toBlock:typeof Q==="bigint"?k(Q):Q}]});let U=K.map((V)=>A0(V));if(!B)return U;return E7({abi:B,args:Y,logs:U,strict:G})}async function WZ(D,F){let{abi:$,address:J,args:Q,blockHash:Z,eventName:X,fromBlock:Y,toBlock:q,strict:G}=F,B=X?o0({abi:$,name:X}):void 0,W=!B?$.filter((K)=>K.type==="event"):void 0;return f(D,R7,"getLogs")({address:J,args:Q,blockHash:Z,event:B,events:W,fromBlock:Y,toBlock:q,strict:G})}s();class YK extends P{constructor({address:D}){super(`No EIP-712 domain found on contract "${D}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${D}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."],name:"Eip712DomainNotFoundError"})}}async function TN(D,F){let{address:$,factory:J,factoryData:Q}=F;try{let[Z,X,Y,q,G,B,W]=await f(D,aD,"readContract")({abi:Pr,address:$,functionName:"eip712Domain",factory:J,factoryData:Q});return{domain:{name:X,version:Y,chainId:Number(q),verifyingContract:G,salt:B},extensions:W,fields:Z}}catch(Z){let X=Z;if(X.name==="ContractFunctionExecutionError"&&X.cause.name==="ContractFunctionZeroDataError")throw new YK({address:$});throw X}}var Pr=[{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"}];c();function LN(D){return{baseFeePerGas:D.baseFeePerGas.map((F)=>BigInt(F)),gasUsedRatio:D.gasUsedRatio,oldestBlock:BigInt(D.oldestBlock),reward:D.reward?.map((F)=>F.map(($)=>BigInt($)))}}async function PN(D,{blockCount:F,blockNumber:$,blockTag:J="latest",rewardPercentiles:Q}){let Z=typeof $==="bigint"?k($):void 0,X=await D.request({method:"eth_feeHistory",params:[k(F),Z||J,Q]},{dedupe:Boolean(Z)});return LN(X)}async function ZF(D,{filter:F}){let $="strict"in F&&F.strict,J=await F.request({method:"eth_getFilterChanges",params:[F.id]});if(typeof J[0]==="string")return J;let Q=J.map((Z)=>A0(Z));if(!("abi"in F)||!F.abi)return Q;return E7({abi:F.abi,logs:Q,strict:$})}async function jN(D,{filter:F}){let $=F.strict??!1,Q=(await F.request({method:"eth_getFilterLogs",params:[F.id]})).map((Z)=>A0(Z));if(!F.abi)return Q;return E7({abi:F.abi,logs:Q,strict:$})}c();D0();c();function xr(D){return D.map((F)=>({...F,value:BigInt(F.value)}))}function SN(D){return{...D,balance:D.balance?BigInt(D.balance):void 0,nonce:D.nonce?MD(D.nonce):void 0,storageProof:D.storageProof?xr(D.storageProof):void 0}}async function xN(D,{address:F,blockNumber:$,blockTag:J,storageKeys:Q}){let Z=J??"latest",X=$!==void 0?k($):void 0,Y=await D.request({method:"eth_getProof",params:[F,Q,X||Z]});return SN(Y)}c();async function kN(D,{address:F,blockNumber:$,blockTag:J="latest",slot:Q}){let Z=$!==void 0?k($):void 0;return await D.request({method:"eth_getStorageAt",params:[F,Q,Z||J]})}w8();c();async function A7(D,{blockHash:F,blockNumber:$,blockTag:J,hash:Q,index:Z,sender:X,nonce:Y}){let q=J||"latest",G=$!==void 0?k($):void 0,B=null;if(Q)B=await D.request({method:"eth_getTransactionByHash",params:[Q]},{dedupe:!0});else if(F)B=await D.request({method:"eth_getTransactionByBlockHashAndIndex",params:[F,k(Z)]},{dedupe:!0});else if((G||q)&&typeof Z==="number")B=await D.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[G||q,k(Z)]},{dedupe:Boolean(G)});else if(X&&typeof Y==="number")B=await D.request({method:"eth_getTransactionBySenderAndNonce",params:[X,k(Y)]},{dedupe:!0});if(!B)throw new q4({blockHash:F,blockNumber:$,blockTag:q,hash:Q,index:Z});return(D.chain?.formatters?.transaction?.format||z7)(B,"getTransaction")}async function yN(D,{hash:F,transactionReceipt:$}){let[J,Q]=await Promise.all([f(D,f8,"getBlockNumber")({}),F?f(D,A7,"getTransaction")({hash:F}):void 0]),Z=$?.blockNumber||Q?.blockNumber;if(!Z)return 0n;return J-Z+1n}w8();D0();var qK={"0x0":"reverted","0x1":"success"};function KZ(D,F){let $={...D,blockNumber:D.blockNumber?BigInt(D.blockNumber):null,contractAddress:D.contractAddress?D.contractAddress:null,cumulativeGasUsed:D.cumulativeGasUsed?BigInt(D.cumulativeGasUsed):null,effectiveGasPrice:D.effectiveGasPrice?BigInt(D.effectiveGasPrice):null,gasUsed:D.gasUsed?BigInt(D.gasUsed):null,logs:D.logs?D.logs.map((J)=>A0(J)):null,to:D.to?D.to:null,transactionIndex:D.transactionIndex?MD(D.transactionIndex):null,status:D.status?qK[D.status]:null,type:D.type?FK[D.type]||D.type:null};if(D.blobGasPrice)$.blobGasPrice=BigInt(D.blobGasPrice);if(D.blobGasUsed)$.blobGasUsed=BigInt(D.blobGasUsed);return $}async function I7(D,{hash:F}){let $=await D.request({method:"eth_getTransactionReceipt",params:[F]},{dedupe:!0});if(!$)throw new G4({hash:F});return(D.chain?.formatters?.transactionReceipt?.format||KZ)($,"getTransactionReceipt")}z8();gD();s();q1();Y1();a0();tF();async function fN(D,F){let{account:$,authorizationList:J,allowFailure:Q=!0,blockNumber:Z,blockOverrides:X,blockTag:Y,stateOverride:q}=F,G=F.contracts,{batchSize:B=F.batchSize??1024,deployless:W=F.deployless??!1}=typeof D.batch?.multicall==="object"?D.batch.multicall:{},K=(()=>{if(F.multicallAddress)return F.multicallAddress;if(W)return null;if(D.chain)return E2({blockNumber:Z,chain:D.chain,contract:"multicall3"});throw Error("client chain not configured. multicallAddress is required.")})(),U=[[]],V=0,H=0;for(let O=0;O<G.length;O++){let{abi:C,address:M,args:E,functionName:A}=G[O];try{let I=ED({abi:C,args:E,functionName:A});if(H+=(I.length-2)/2,B>0&&H>B&&U[V].length>0)V++,H=(I.length-2)/2,U[V]=[];U[V]=[...U[V],{allowFailure:!0,callData:I,target:M}]}catch(I){let R=B2(I,{abi:C,address:M,args:E,docsPath:"/docs/contract/multicall",functionName:A,sender:$});if(!Q)throw R;U[V]=[...U[V],{allowFailure:!0,callData:"0x",target:M}]}}let z=await Promise.allSettled(U.map((O)=>f(D,aD,"readContract")({...K===null?{code:W7}:{address:K},abi:m2,account:$,args:[O],authorizationList:J,blockNumber:Z,blockOverrides:X,blockTag:Y,functionName:"aggregate3",stateOverride:q}))),_=[];for(let O=0;O<z.length;O++){let C=z[O];if(C.status==="rejected"){if(!Q)throw C.reason;for(let E=0;E<U[O].length;E++)_.push({status:"failure",error:C.reason,result:void 0});continue}let M=C.value;for(let E=0;E<M.length;E++){let{returnData:A,success:I}=M[E],{callData:R}=U[O][E],{abi:T,address:N,functionName:j,args:L}=G[_.length];try{if(R==="0x")throw new d2;if(!I)throw new T8({data:A});let y=O0({abi:T,args:L,data:A,functionName:j});_.push(Q?{result:y,status:"success"}:y)}catch(y){let m=B2(y,{abi:T,address:N,args:L,docsPath:"/docs/contract/multicall",functionName:j});if(!Q)throw m;_.push({error:m,result:void 0,status:"failure"})}}}if(_.length!==G.length)throw new P("multicall results mismatch");return _}CW();gD();q1();W3();Y1();a0();c();w4();S8();iQ();x8();async function h4(D,F){let{blockNumber:$,blockTag:J=D.experimental_blockTag??"latest",blocks:Q,returnFullTransactions:Z,traceTransfers:X,validation:Y}=F;try{let q=[];for(let K of Q){let U=K.blockOverrides?dQ(K.blockOverrides):void 0,V=K.calls.map((z)=>{let _=z,O=_.account?i(_.account):void 0,C=_.abi?ED(_):_.data,M={..._,account:O,data:_.dataSuffix?ID([C||"0x",_.dataSuffix]):C,from:_.from??O?.address};return X0(M),Z0(M)}),H=K.stateOverrides?U7(K.stateOverrides):void 0;q.push({blockOverrides:U,calls:V,stateOverrides:H})}let B=(typeof $==="bigint"?k($):void 0)||J;return(await D.request({method:"eth_simulateV1",params:[{blockStateCalls:q,returnFullTransactions:Z,traceTransfers:X,validation:Y},B]})).map((K,U)=>({...YZ(K),calls:K.calls.map((V,H)=>{let{abi:z,args:_,functionName:O,to:C}=Q[U].calls[H],M=V.error?.data??V.returnData,E=BigInt(V.gasUsed),A=V.logs?.map((N)=>A0(N)),I=V.status==="0x1"?"success":"failure",R=z&&I==="success"&&M!=="0x"?O0({abi:z,data:M,functionName:O}):null,T=(()=>{if(I==="success")return;let N;if(M==="0x")N=new d2;else if(M)N=new T8({data:M});if(!N)return;return B2(N,{abi:z??[],address:C??"0x",args:_,functionName:O??"<unknown>"})})();return{data:M,gasUsed:E,logs:A,status:I,...I==="success"?{result:R}:{error:T}}})}))}catch(q){let G=q,B=s1(G,{});if(B instanceof a2)throw G;throw B}}A6();s0();AB();o1();Q0();function M3(D,F={}){let{as:$=typeof D==="string"?"Hex":"Bytes"}=F,J=CQ(vI(D));if($==="Bytes")return J;return dD(J)}Q0();o1();class BK extends Map{constructor(D){super();Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=D}get(D){let F=super.get(D);if(super.has(D)&&F!==void 0)this.delete(D),super.set(D,F);return F}set(D,F){if(super.set(D,F),this.maxSize&&this.size>this.maxSize){let $=this.keys().next().value;if($)this.delete($)}return this}}var kr={checksum:new BK(8192)},UZ=kr.checksum;s0();o1();s0();Q0();function bN(D,F={}){let{compressed:$}=F,{prefix:J,x:Q,y:Z}=D;if($===!1||typeof Q==="bigint"&&typeof Z==="bigint"){if(J!==4)throw new WK({prefix:J,cause:new mN});return}if($===!0||typeof Q==="bigint"&&typeof Z>"u"){if(J!==3&&J!==2)throw new WK({prefix:J,cause:new gN});return}throw new uN({publicKey:D})}function vN(D){let F=(()=>{if(z4(D))return hN(D);if(pI(D))return fr(D);let{prefix:$,x:J,y:Q}=D;if(typeof J==="bigint"&&typeof Q==="bigint")return{prefix:$??4,x:J,y:Q};return{prefix:$,x:J}})();return bN(F),F}function fr(D){return hN(dD(D))}function hN(D){if(D.length!==132&&D.length!==130&&D.length!==68)throw new dN({publicKey:D});if(D.length===130){let J=BigInt(PD(D,0,32)),Q=BigInt(PD(D,32,64));return{prefix:4,x:J,y:Q}}if(D.length===132){let J=Number(PD(D,0,1)),Q=BigInt(PD(D,1,33)),Z=BigInt(PD(D,33,65));return{prefix:J,x:Q,y:Z}}let F=Number(PD(D,0,1)),$=BigInt(PD(D,1,33));return{prefix:F,x:$}}function KK(D,F={}){bN(D);let{prefix:$,x:J,y:Q}=D,{includePrefix:Z=!0}=F;return bD(Z?KD($,{size:1}):"0x",KD(J,{size:32}),typeof Q==="bigint"?KD(Q,{size:32}):"0x")}class uN extends d{constructor({publicKey:D}){super(`Value \`${a1(D)}\` is not a valid public key.`,{metaMessages:["Public key must contain:","- an `x` and `prefix` value (compressed)","- an `x`, `y`, and `prefix` value (uncompressed)"]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidError"})}}class WK extends d{constructor({prefix:D,cause:F}){super(`Prefix "${D}" is invalid.`,{cause:F});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidPrefixError"})}}class gN extends d{constructor(){super("Prefix must be 2 or 3 for compressed public keys.");Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidCompressedPrefixError"})}}class mN extends d{constructor(){super("Prefix must be 4 for uncompressed public keys.");Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidUncompressedPrefixError"})}}class dN extends d{constructor({publicKey:D}){super(`Value \`${D}\` is an invalid public key size.`,{metaMessages:["Expected: 33 bytes (compressed + prefix), 64 bytes (uncompressed) or 65 bytes (uncompressed + prefix).",`Received ${LD(G7(D))} bytes.`]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidSerializedSizeError"})}}var br=/^0x[a-fA-F0-9]{40}$/;function O3(D,F={}){let{strict:$=!0}=F;if(!br.test(D))throw new UK({address:D,cause:new cN});if($){if(D.toLowerCase()===D)return;if(VZ(D)!==D)throw new UK({address:D,cause:new nN})}}function VZ(D){if(UZ.has(D))return UZ.get(D);O3(D,{strict:!1});let F=D.substring(2).toLowerCase(),$=M3(hI(F),{as:"Bytes"}),J=F.split("");for(let Z=0;Z<40;Z+=2){if($[Z>>1]>>4>=8&&J[Z])J[Z]=J[Z].toUpperCase();if(($[Z>>1]&15)>=8&&J[Z+1])J[Z+1]=J[Z+1].toUpperCase()}let Q=`0x${J.join("")}`;return UZ.set(D,Q),Q}function vr(D,F={}){let{checksum:$=!1}=F;if(O3(D),$)return VZ(D);return D}function lN(D,F={}){let $=M3(`0x${KK(D).slice(4)}`).substring(26);return vr(`0x${$}`,F)}function HZ(D,F={}){let{strict:$=!0}=F??{};try{return O3(D,{strict:$}),!0}catch{return!1}}class UK extends d{constructor({address:D,cause:F}){super(`Address "${D}" is invalid.`,{cause:F});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class cN extends d{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value.");Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}class nN extends d{constructor(){super("Address does not match its checksum counterpart.");Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}s0();function _Z(D){let F=!0,$="",J=0,Q="",Z=!1;for(let X=0;X<D.length;X++){let Y=D[X];if(["(",")",","].includes(Y))F=!0;if(Y==="(")J++;if(Y===")")J--;if(!F)continue;if(J===0){if(Y===" "&&["event","function","error",""].includes(Q))Q="";else if(Q+=Y,Y===")"){Z=!0;break}continue}if(Y===" "){if(D[X-1]!==","&&$!==","&&$!==",(")$="",F=!1;continue}Q+=Y,$+=Y}if(!Z)throw new d("Unable to normalize signature.");return Q}function CZ(D,F){let $=typeof D,J=F.type;switch(J){case"address":return HZ(D,{strict:!1});case"bool":return $==="boolean";case"function":return $==="string";case"string":return $==="string";default:{if(J==="tuple"&&"components"in F)return Object.values(F.components).every((Q,Z)=>{return CZ(Object.values(D)[Z],Q)});if(/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(J))return $==="number"||$==="bigint";if(/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(J))return $==="string"||D instanceof Uint8Array;if(/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(J))return Array.isArray(D)&&D.every((Q)=>CZ(Q,{...F,type:J.replace(/(\[[0-9]{0,}\])$/,"")}));return!1}}}function VK(D,F,$){for(let J in D){let Q=D[J],Z=F[J];if(Q.type==="tuple"&&Z.type==="tuple"&&"components"in Q&&"components"in Z)return VK(Q.components,Z.components,$[J]);let X=[Q.type,Z.type];if((()=>{if(X.includes("address")&&X.includes("bytes20"))return!0;if(X.includes("address")&&X.includes("string"))return HZ($[J],{strict:!1});if(X.includes("address")&&X.includes("bytes"))return HZ($[J],{strict:!1});return!1})())return X}return}function MZ(D,F={}){let{prepare:$=!0}=F,J=(()=>{if(Array.isArray(D))return n9(D);if(typeof D==="string")return n9(D);return D})();return{...J,...$?{hash:w7(J)}:{}}}function u4(D,F,$){let{args:J=[],prepare:Q=!0}=$??{},Z=z4(F,{strict:!1}),X=D.filter((G)=>{if(Z){if(G.type==="function"||G.type==="error")return HK(G)===PD(F,0,4);if(G.type==="event")return w7(G)===F;return!1}return"name"in G&&G.name===F});if(X.length===0)throw new E3({name:F});if(X.length===1)return{...X[0],...Q?{hash:w7(X[0])}:{}};let Y;for(let G of X){if(!("inputs"in G))continue;if(!J||J.length===0){if(!G.inputs||G.inputs.length===0)return{...G,...Q?{hash:w7(G)}:{}};continue}if(!G.inputs)continue;if(G.inputs.length===0)continue;if(G.inputs.length!==J.length)continue;if(J.every((W,K)=>{let U="inputs"in G&&G.inputs[K];if(!U)return!1;return CZ(W,U)})){if(Y&&"inputs"in Y&&Y.inputs){let W=VK(G.inputs,Y.inputs,J);if(W)throw new iN({abiItem:G,type:W[0]},{abiItem:Y,type:W[1]})}Y=G}}let q=(()=>{if(Y)return Y;let[G,...B]=X;return{...G,overloads:B}})();if(!q)throw new E3({name:F});return{...q,...Q?{hash:w7(q)}:{}}}function HK(...D){let F=(()=>{if(Array.isArray(D[0])){let[$,J]=D;return u4($,J)}return D[0]})();return PD(w7(F),0,4)}function ur(...D){let F=(()=>{if(Array.isArray(D[0])){let[J,Q]=D;return u4(J,Q)}return D[0]})(),$=(()=>{if(typeof F==="string")return F;return dF(F)})();return _Z($)}function w7(...D){let F=(()=>{if(Array.isArray(D[0])){let[$,J]=D;return u4($,J)}return D[0]})();if(typeof F!=="string"&&"hash"in F&&F.hash)return F.hash;return M3(B7(ur(F)))}class iN extends d{constructor(D,F){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${D.type}\` in \`${_Z(dF(D.abiItem))}\`, and`,`\`${F.type}\` in \`${_Z(dF(F.abiItem))}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.AmbiguityError"})}}class E3 extends d{constructor({name:D,data:F,type:$="item"}){let J=(()=>{if(D)return` with name "${D}"`;if(F)return` with data "${F}"`;return""})();super(`ABI ${$}${J} not found.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}A6();o1();s0();Q0();o1();s0();Q0();var aN=/^(.*)\[([0-9]*)\]$/,rN=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,OZ=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,ZgD=2n**(8n-1n)-1n,XgD=2n**(16n-1n)-1n,YgD=2n**(24n-1n)-1n,qgD=2n**(32n-1n)-1n,GgD=2n**(40n-1n)-1n,BgD=2n**(48n-1n)-1n,WgD=2n**(56n-1n)-1n,KgD=2n**(64n-1n)-1n,UgD=2n**(72n-1n)-1n,VgD=2n**(80n-1n)-1n,HgD=2n**(88n-1n)-1n,zgD=2n**(96n-1n)-1n,CgD=2n**(104n-1n)-1n,_gD=2n**(112n-1n)-1n,MgD=2n**(120n-1n)-1n,OgD=2n**(128n-1n)-1n,EgD=2n**(136n-1n)-1n,RgD=2n**(144n-1n)-1n,AgD=2n**(152n-1n)-1n,IgD=2n**(160n-1n)-1n,wgD=2n**(168n-1n)-1n,NgD=2n**(176n-1n)-1n,TgD=2n**(184n-1n)-1n,LgD=2n**(192n-1n)-1n,PgD=2n**(200n-1n)-1n,jgD=2n**(208n-1n)-1n,SgD=2n**(216n-1n)-1n,xgD=2n**(224n-1n)-1n,kgD=2n**(232n-1n)-1n,ygD=2n**(240n-1n)-1n,fgD=2n**(248n-1n)-1n,bgD=2n**(256n-1n)-1n,vgD=-(2n**(8n-1n)),hgD=-(2n**(16n-1n)),ugD=-(2n**(24n-1n)),ggD=-(2n**(32n-1n)),mgD=-(2n**(40n-1n)),dgD=-(2n**(48n-1n)),pgD=-(2n**(56n-1n)),lgD=-(2n**(64n-1n)),cgD=-(2n**(72n-1n)),ngD=-(2n**(80n-1n)),igD=-(2n**(88n-1n)),ogD=-(2n**(96n-1n)),agD=-(2n**(104n-1n)),rgD=-(2n**(112n-1n)),sgD=-(2n**(120n-1n)),tgD=-(2n**(128n-1n)),egD=-(2n**(136n-1n)),DmD=-(2n**(144n-1n)),FmD=-(2n**(152n-1n)),$mD=-(2n**(160n-1n)),JmD=-(2n**(168n-1n)),QmD=-(2n**(176n-1n)),ZmD=-(2n**(184n-1n)),XmD=-(2n**(192n-1n)),YmD=-(2n**(200n-1n)),qmD=-(2n**(208n-1n)),GmD=-(2n**(216n-1n)),BmD=-(2n**(224n-1n)),WmD=-(2n**(232n-1n)),KmD=-(2n**(240n-1n)),UmD=-(2n**(248n-1n)),VmD=-(2n**(256n-1n)),HmD=2n**8n-1n,zmD=2n**16n-1n,CmD=2n**24n-1n,_mD=2n**32n-1n,MmD=2n**40n-1n,OmD=2n**48n-1n,EmD=2n**56n-1n,RmD=2n**64n-1n,AmD=2n**72n-1n,ImD=2n**80n-1n,wmD=2n**88n-1n,NmD=2n**96n-1n,TmD=2n**104n-1n,LmD=2n**112n-1n,PmD=2n**120n-1n,jmD=2n**128n-1n,SmD=2n**136n-1n,xmD=2n**144n-1n,kmD=2n**152n-1n,ymD=2n**160n-1n,fmD=2n**168n-1n,bmD=2n**176n-1n,vmD=2n**184n-1n,hmD=2n**192n-1n,umD=2n**200n-1n,gmD=2n**208n-1n,mmD=2n**216n-1n,dmD=2n**224n-1n,pmD=2n**232n-1n,lmD=2n**240n-1n,cmD=2n**248n-1n,zK=2n**256n-1n;function R3(D,F,$){let{checksumAddress:J,staticPosition:Q}=$,Z=MK(F.type);if(Z){let[X,Y]=Z;return mr(D,{...F,type:Y},{checksumAddress:J,length:X,staticPosition:Q})}if(F.type==="tuple")return cr(D,F,{checksumAddress:J,staticPosition:Q});if(F.type==="address")return gr(D,{checksum:J});if(F.type==="bool")return dr(D);if(F.type.startsWith("bytes"))return pr(D,F,{staticPosition:Q});if(F.type.startsWith("uint")||F.type.startsWith("int"))return lr(D,F);if(F.type==="string")return nr(D,{staticPosition:Q});throw new m4(F.type)}var tN=32,CK=32;function gr(D,F={}){let{checksum:$=!1}=F,J=D.readBytes(32);return[((Z)=>$?VZ(Z):Z)(dD(uI(J,-20))),32]}function mr(D,F,$){let{checksumAddress:J,length:Q,staticPosition:Z}=$;if(!Q){let q=P8(D.readBytes(CK)),G=Z+q,B=G+tN;D.setPosition(G);let W=P8(D.readBytes(tN)),K=g4(F),U=0,V=[];for(let H=0;H<W;++H){D.setPosition(B+(K?H*32:U));let[z,_]=R3(D,F,{checksumAddress:J,staticPosition:B});U+=_,V.push(z)}return D.setPosition(Z+32),[V,32]}if(g4(F)){let q=P8(D.readBytes(CK)),G=Z+q,B=[];for(let W=0;W<Q;++W){D.setPosition(G+W*32);let[K]=R3(D,F,{checksumAddress:J,staticPosition:G});B.push(K)}return D.setPosition(Z+32),[B,32]}let X=0,Y=[];for(let q=0;q<Q;++q){let[G,B]=R3(D,F,{checksumAddress:J,staticPosition:Z+X});X+=B,Y.push(G)}return[Y,X]}function dr(D){return[mI(D.readBytes(32),{size:32}),32]}function pr(D,F,{staticPosition:$}){let[J,Q]=F.type.split("bytes");if(!Q){let X=P8(D.readBytes(32));D.setPosition($+X);let Y=P8(D.readBytes(32));if(Y===0)return D.setPosition($+32),["0x",32];let q=D.readBytes(Y);return D.setPosition($+32),[dD(q),32]}return[dD(D.readBytes(Number.parseInt(Q,10),32)),32]}function lr(D,F){let $=F.type.startsWith("int"),J=Number.parseInt(F.type.split("int")[1]||"256",10),Q=D.readBytes(32);return[J>48?gI(Q,{signed:$}):P8(Q,{signed:$}),32]}function cr(D,F,$){let{checksumAddress:J,staticPosition:Q}=$,Z=F.components.length===0||F.components.some(({name:q})=>!q),X=Z?[]:{},Y=0;if(g4(F)){let q=P8(D.readBytes(CK)),G=Q+q;for(let B=0;B<F.components.length;++B){let W=F.components[B];D.setPosition(G+Y);let[K,U]=R3(D,W,{checksumAddress:J,staticPosition:G});Y+=U,X[Z?B:W?.name]=K}return D.setPosition(Q+32),[X,32]}for(let q=0;q<F.components.length;++q){let G=F.components[q],[B,W]=R3(D,G,{checksumAddress:J,staticPosition:Q});X[Z?q:G?.name]=B,Y+=W}return[X,Y]}function nr(D,{staticPosition:F}){let $=P8(D.readBytes(32)),J=F+$;D.setPosition(J);let Q=P8(D.readBytes(32));if(Q===0)return D.setPosition(F+32),["",32];let Z=D.readBytes(Q,32),X=dI(KW(Z));return D.setPosition(F+32),[X,32]}function eN({checksumAddress:D,parameters:F,values:$}){let J=[];for(let Q=0;Q<F.length;Q++)J.push(_K({checksumAddress:D,parameter:F[Q],value:$[Q]}));return J}function _K({checksumAddress:D=!1,parameter:F,value:$}){let J=F,Q=MK(J.type);if(Q){let[Z,X]=Q;return or($,{checksumAddress:D,length:Z,parameter:{...J,type:X}})}if(J.type==="tuple")return er($,{checksumAddress:D,parameter:J});if(J.type==="address")return ir($,{checksum:D});if(J.type==="bool")return rr($);if(J.type.startsWith("uint")||J.type.startsWith("int")){let Z=J.type.startsWith("int"),[,,X="256"]=OZ.exec(J.type)??[];return sr($,{signed:Z,size:Number(X)})}if(J.type.startsWith("bytes"))return ar($,{type:J.type});if(J.type==="string")return tr($);throw new m4(J.type)}function EZ(D){let F=0;for(let Z=0;Z<D.length;Z++){let{dynamic:X,encoded:Y}=D[Z];if(X)F+=32;else F+=LD(Y)}let $=[],J=[],Q=0;for(let Z=0;Z<D.length;Z++){let{dynamic:X,encoded:Y}=D[Z];if(X)$.push(KD(F+Q,{size:32})),J.push(Y),Q+=LD(Y);else $.push(Y)}return bD(...$,...J)}function ir(D,F){let{checksum:$=!1}=F;return O3(D,{strict:$}),{dynamic:!1,encoded:z1(D.toLowerCase())}}function or(D,F){let{checksumAddress:$,length:J,parameter:Q}=F,Z=J===null;if(!Array.isArray(D))throw new EK(D);if(!Z&&D.length!==J)throw new OK({expectedLength:J,givenLength:D.length,type:`${Q.type}[${J}]`});let X=!1,Y=[];for(let q=0;q<D.length;q++){let G=_K({checksumAddress:$,parameter:Q,value:D[q]});if(G.dynamic)X=!0;Y.push(G)}if(Z||X){let q=EZ(Y);if(Z){let G=KD(Y.length,{size:32});return{dynamic:!0,encoded:Y.length>0?bD(G,q):G}}if(X)return{dynamic:!0,encoded:q}}return{dynamic:!1,encoded:bD(...Y.map(({encoded:q})=>q))}}function ar(D,{type:F}){let[,$]=F.split("bytes"),J=LD(D);if(!$){let Q=D;if(J%32!==0)Q=j8(Q,Math.ceil((D.length-2)/2/32)*32);return{dynamic:!0,encoded:bD(z1(KD(J,{size:32})),Q)}}if(J!==Number.parseInt($,10))throw new RZ({expectedSize:Number.parseInt($,10),value:D});return{dynamic:!1,encoded:j8(D)}}function rr(D){if(typeof D!=="boolean")throw new d(`Invalid boolean value: "${D}" (type: ${typeof D}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:z1(gQ(D))}}function sr(D,{signed:F,size:$}){if(typeof $==="number"){let J=2n**(BigInt($)-(F?1n:0n))-1n,Q=F?-J-1n:0n;if(D>J||D<Q)throw new mQ({max:J.toString(),min:Q.toString(),signed:F,size:$/8,value:D.toString()})}return{dynamic:!1,encoded:KD(D,{size:32,signed:F})}}function tr(D){let F=B7(D),$=Math.ceil(LD(F)/32),J=[];for(let Q=0;Q<$;Q++)J.push(j8(PD(F,Q*32,(Q+1)*32)));return{dynamic:!0,encoded:bD(j8(KD(LD(F),{size:32})),...J)}}function er(D,F){let{checksumAddress:$,parameter:J}=F,Q=!1,Z=[];for(let X=0;X<J.components.length;X++){let Y=J.components[X],q=Array.isArray(D)?X:Y.name,G=_K({checksumAddress:$,parameter:Y,value:D[q]});if(Z.push(G),G.dynamic)Q=!0}return{dynamic:Q,encoded:Q?EZ(Z):bD(...Z.map(({encoded:X})=>X))}}function MK(D){let F=D.match(/^(.*)\[(\d+)?\]$/);return F?[F[2]?Number(F[2]):null,F[1]]:void 0}function g4(D){let{type:F}=D;if(F==="string")return!0;if(F==="bytes")return!0;if(F.endsWith("[]"))return!0;if(F==="tuple")return D.components?.some(g4);let $=MK(D.type);if($&&g4({...D,type:$[1]}))return!0;return!1}s0();var Fs={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new FT({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(D){if(D<0||D>this.bytes.length-1)throw new DT({length:this.bytes.length,position:D})},decrementPosition(D){if(D<0)throw new RK({offset:D});let F=this.position-D;this.assertPosition(F),this.position=F},getReadCount(D){return this.positionReadCount.get(D||this.position)||0},incrementPosition(D){if(D<0)throw new RK({offset:D});let F=this.position+D;this.assertPosition(F),this.position=F},inspectByte(D){let F=D??this.position;return this.assertPosition(F),this.bytes[F]},inspectBytes(D,F){let $=F??this.position;return this.assertPosition($+D-1),this.bytes.subarray($,$+D)},inspectUint8(D){let F=D??this.position;return this.assertPosition(F),this.bytes[F]},inspectUint16(D){let F=D??this.position;return this.assertPosition(F+1),this.dataView.getUint16(F)},inspectUint24(D){let F=D??this.position;return this.assertPosition(F+2),(this.dataView.getUint16(F)<<8)+this.dataView.getUint8(F+2)},inspectUint32(D){let F=D??this.position;return this.assertPosition(F+3),this.dataView.getUint32(F)},pushByte(D){this.assertPosition(this.position),this.bytes[this.position]=D,this.position++},pushBytes(D){this.assertPosition(this.position+D.length-1),this.bytes.set(D,this.position),this.position+=D.length},pushUint8(D){this.assertPosition(this.position),this.bytes[this.position]=D,this.position++},pushUint16(D){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,D),this.position+=2},pushUint24(D){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,D>>8),this.dataView.setUint8(this.position+2,D&255),this.position+=3},pushUint32(D){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,D),this.position+=4},readByte(){this.assertReadLimit(),this._touch();let D=this.inspectByte();return this.position++,D},readBytes(D,F){this.assertReadLimit(),this._touch();let $=this.inspectBytes(D);return this.position+=F??D,$},readUint8(){this.assertReadLimit(),this._touch();let D=this.inspectUint8();return this.position+=1,D},readUint16(){this.assertReadLimit(),this._touch();let D=this.inspectUint16();return this.position+=2,D},readUint24(){this.assertReadLimit(),this._touch();let D=this.inspectUint24();return this.position+=3,D},readUint32(){this.assertReadLimit(),this._touch();let D=this.inspectUint32();return this.position+=4,D},get remaining(){return this.bytes.length-this.position},setPosition(D){let F=this.position;return this.assertPosition(D),this.position=D,()=>this.position=F},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;let D=this.getReadCount();if(this.positionReadCount.set(this.position,D+1),D>0)this.recursiveReadCount++}};function AZ(D,{recursiveReadLimit:F=8192}={}){let $=Object.create(Fs);return $.bytes=D,$.dataView=new DataView(D.buffer,D.byteOffset,D.byteLength),$.positionReadCount=new Map,$.recursiveReadLimit=F,$}class RK extends d{constructor({offset:D}){super(`Offset \`${D}\` cannot be negative.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}class DT extends d{constructor({length:D,position:F}){super(`Position \`${F}\` is out of bounds (\`0 < position < ${D}\`).`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}class FT extends d{constructor({count:D,limit:F}){super(`Recursive read limit of \`${F}\` exceeded (recursive read count: \`${D}\`).`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}function N7(D,F,$={}){let{as:J="Array",checksumAddress:Q=!1}=$,Z=typeof F==="string"?q7(F):F,X=AZ(Z);if(A2(Z)===0&&D.length>0)throw new QT;if(A2(Z)&&A2(Z)<32)throw new JT({data:typeof F==="string"?F:dD(F),parameters:D,size:A2(Z)});let Y=0,q=J==="Array"?[]:{};for(let G=0;G<D.length;++G){let B=D[G];X.setPosition(Y);let[W,K]=R3(X,B,{checksumAddress:Q,staticPosition:0});if(Y+=K,J==="Array")q.push(W);else q[B.name??G]=W}return q}function XF(D,F,$){let{checksumAddress:J=!1}=$??{};if(D.length!==F.length)throw new IK({expectedLength:D.length,givenLength:F.length});let Q=eN({checksumAddress:J,parameters:D,values:F}),Z=EZ(Q);if(Z.length===0)return"0x";return Z}function AK(D,F){if(D.length!==F.length)throw new IK({expectedLength:D.length,givenLength:F.length});let $=[];for(let J=0;J<D.length;J++){let Q=D[J],Z=F[J];$.push(AK.encode(Q,Z))}return bD(...$)}(function(D){function F($,J,Q=!1){if($==="address"){let q=J;return O3(q),z1(q.toLowerCase(),Q?32:0)}if($==="string")return B7(J);if($==="bytes")return J;if($==="bool")return z1(gQ(J),Q?32:1);let Z=$.match(OZ);if(Z){let[q,G,B="256"]=Z,W=Number.parseInt(B,10)/8;return KD(J,{size:Q?32:W,signed:G==="int"})}let X=$.match(rN);if(X){let[q,G]=X;if(Number.parseInt(G,10)!==(J.length-2)/2)throw new RZ({expectedSize:Number.parseInt(G,10),value:J});return j8(J,Q?32:0)}let Y=$.match(aN);if(Y&&Array.isArray(J)){let[q,G]=Y,B=[];for(let W=0;W<J.length;W++)B.push(F(G,J[W],!0));if(B.length===0)return"0x";return bD(...B)}throw new m4($)}D.encode=F})(AK||(AK={}));function p4(D){if(Array.isArray(D)&&typeof D[0]==="string")return H8(D);if(typeof D==="string")return H8(D);return D}class JT extends d{constructor({data:D,parameters:F,size:$}){super(`Data size of ${$} bytes is too small for given parameters.`,{metaMessages:[`Params: (${e8(F)})`,`Data: ${D} (${$} bytes)`]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}class QT extends d{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.');Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}class OK extends d{constructor({expectedLength:D,givenLength:F,type:$}){super(`Array length mismatch for type \`${$}\`. Expected: \`${D}\`. Given: \`${F}\`.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}class RZ extends d{constructor({expectedSize:D,value:F}){super(`Size of bytes "${F}" (bytes${LD(F)}) does not match expected size (bytes${D}).`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}class IK extends d{constructor({expectedLength:D,givenLength:F}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${D}`,`Given length (values): ${F}`].join(`
288
+ `));Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}class EK extends d{constructor(D){super(`Value \`${D}\` is not a valid array.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}class m4 extends d{constructor(D){super(`Type \`${D}\` is not a valid ABI Type.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}Q0();function ZT(...D){let[F,$]=(()=>{if(Array.isArray(D[0])){let[Z,X]=D;return[$s(Z),X]}return D})(),{bytecode:J,args:Q}=$;return bD(J,F.inputs?.length&&Q?.length?XF(F.inputs,Q):"0x")}function XT(D){return MZ(D)}function $s(D){let F=D.find(($)=>$.type==="constructor");if(!F)throw new E3({name:"constructor"});return F}Q0();function qT(...D){let[F,$=[]]=(()=>{if(Array.isArray(D[0])){let[G,B,W]=D;return[YT(G,B,{args:W}),W]}let[Y,q]=D;return[Y,q]})(),{overloads:J}=F,Q=J?YT([F,...J],F.name,{args:$}):F,Z=Qs(Q),X=$.length>0?XF(Q.inputs,$):void 0;return X?bD(Z,X):Z}function A3(D,F={}){return MZ(D,F)}function YT(D,F,$){let J=u4(D,F,$);if(J.type!=="function")throw new E3({name:F,type:"function"});return J}function Qs(D){return HK(D)}var GT="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",s2="0x0000000000000000000000000000000000000000";s();a0();var Xs="0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033";async function BT(D,F){let{blockNumber:$,blockTag:J,calls:Q,stateOverrides:Z,traceAssetChanges:X,traceTransfers:Y,validation:q}=F,G=F.account?i(F.account):void 0;if(X&&!G)throw new P("`account` is required when `traceAssetChanges` is true");let B=G?ZT(XT("constructor(bytes, bytes)"),{bytecode:pQ,args:[Xs,qT(A3("function getBalance(address)"),[G.address])]}):void 0,W=X?await Promise.all(F.calls.map(async(b)=>{if(!b.data&&!b.abi)return;let{accessList:u}=await rQ(D,{account:G.address,...b,data:b.abi?ED(b):b.data});return u.map(({address:o,storageKeys:cD})=>cD.length>0?o:null)})).then((b)=>b.flat().filter(Boolean)):[],K=await h4(D,{blockNumber:$,blockTag:J,blocks:[...X?[{calls:[{data:B}],stateOverrides:Z},{calls:W.map((b,u)=>({abi:[A3("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[G.address],to:b,from:s2,nonce:u})),stateOverrides:[{address:s2,nonce:0}]}]:[],{calls:[...Q,{}].map((b)=>({...b,from:G?.address})),stateOverrides:Z},...X?[{calls:[{data:B}]},{calls:W.map((b,u)=>({abi:[A3("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[G.address],to:b,from:s2,nonce:u})),stateOverrides:[{address:s2,nonce:0}]},{calls:W.map((b,u)=>({to:b,abi:[A3("function decimals() returns (uint256)")],functionName:"decimals",from:s2,nonce:u})),stateOverrides:[{address:s2,nonce:0}]},{calls:W.map((b,u)=>({to:b,abi:[A3("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:s2,nonce:u})),stateOverrides:[{address:s2,nonce:0}]},{calls:W.map((b,u)=>({to:b,abi:[A3("function symbol() returns (string)")],functionName:"symbol",from:s2,nonce:u})),stateOverrides:[{address:s2,nonce:0}]}]:[]],traceTransfers:Y,validation:q}),U=X?K[2]:K[0],[V,H,,z,_,O,C,M]=X?K:[],{calls:E,...A}=U,I=E.slice(0,-1)??[],R=V?.calls??[],T=H?.calls??[],N=[...R,...T].map((b)=>b.status==="success"?fD(b.data):null),j=z?.calls??[],L=_?.calls??[],y=[...j,...L].map((b)=>b.status==="success"?fD(b.data):null),m=(O?.calls??[]).map((b)=>b.status==="success"?b.result:null),S=(M?.calls??[]).map((b)=>b.status==="success"?b.result:null),h=(C?.calls??[]).map((b)=>b.status==="success"?b.result:null),g=[];for(let[b,u]of y.entries()){let o=N[b];if(typeof u!=="bigint")continue;if(typeof o!=="bigint")continue;let cD=m[b-1],RD=S[b-1],V2=h[b-1],$2=(()=>{if(b===0)return{address:GT,decimals:18,symbol:"ETH"};return{address:W[b-1],decimals:V2||cD?Number(cD??1):void 0,symbol:RD??void 0}})();if(g.some((_0)=>_0.token.address===$2.address))continue;g.push({token:$2,value:{pre:o,post:u,diff:u-o}})}return{assetChanges:g,block:A,results:I}}Y1();a0();U3();async function WT(D,F){let{abi:$,address:J,args:Q,functionName:Z,dataSuffix:X=typeof D.dataSuffix==="string"?D.dataSuffix:D.dataSuffix?.value,...Y}=F,q=Y.account?i(Y.account):D.account,G=ED({abi:$,args:Q,functionName:Z});try{let{data:B}=await f(D,w2,"call")({batch:!1,data:`${G}${X?X.replace("0x",""):""}`,to:J,...Y,account:q}),W=O0({abi:$,args:Q,functionName:Z,data:B||"0x"}),K=$.filter((U)=>("name"in U)&&U.name===F.functionName);return{result:W,request:{abi:K,address:J,args:Q,dataSuffix:X,functionName:Z,...Y,account:q}}}catch(B){throw B2(B,{abi:$,address:J,args:Q,docsPath:"/docs/contract/simulateContract",functionName:Z,sender:q?.address})}}async function YF(D,{filter:F}){return F.request({method:"eth_uninstallFilter",params:[F.id]})}var l4={};H2(l4,{wrap:()=>Bs,validate:()=>Ws,unwrap:()=>KT,universalSignatureValidatorBytecode:()=>Ys,universalSignatureValidatorAbi:()=>qs,magicBytes:()=>wK,from:()=>Gs,assert:()=>NK,InvalidWrappedSignatureError:()=>TK});s0();Q0();var wK="0x6492649264926492649264926492649264926492649264926492649264926492",Ys="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",qs=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}];function NK(D){if(PD(D,-32)!==wK)throw new TK(D)}function Gs(D){if(typeof D==="string")return KT(D);return D}function KT(D){NK(D);let[F,$,J]=N7(p4("address, bytes, bytes"),D);return{data:$,signature:J,to:F}}function Bs(D){let{data:F,signature:$,to:J}=D;return bD(XF(p4("address, bytes, bytes"),[J,F,$]),wK)}function Ws(D){try{return NK(D),!0}catch{return!1}}class TK extends d{constructor(D){super(`Value \`${D}\` is an invalid ERC-6492 wrapped signature.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc6492.InvalidWrappedSignatureError"})}}var c4={};H2(c4,{wrap:()=>Ns,validate:()=>Ts,unwrap:()=>NT,suffixParameters:()=>kK,magicBytes:()=>xK,from:()=>ws,assert:()=>NZ,InvalidWrappedSignatureError:()=>yK});Q0();o1();s0();Q0();function Ks(D,F){let{as:$}=F,J=VT(D),Q=AZ(new Uint8Array(J.length));if(J.encode(Q),$==="Hex")return dD(Q.bytes);return Q.bytes}function UT(D,F={}){let{as:$="Hex"}=F;return Ks(D,{as:$})}function VT(D){if(Array.isArray(D))return Us(D.map((F)=>VT(F)));return Vs(D)}function Us(D){let F=D.reduce((Q,Z)=>Q+Z.length,0),$=HT(F);return{length:(()=>{if(F<=55)return 1+F;return 1+$+F})(),encode(Q){if(F<=55)Q.pushByte(192+F);else if(Q.pushByte(247+$),$===1)Q.pushUint8(F);else if($===2)Q.pushUint16(F);else if($===3)Q.pushUint24(F);else Q.pushUint32(F);for(let{encode:Z}of D)Z(Q)}}}function Vs(D){let F=typeof D==="string"?q7(D):D,$=HT(F.length);return{length:(()=>{if(F.length===1&&F[0]<128)return 1;if(F.length<=55)return 1+F.length;return 1+$+F.length})(),encode(Q){if(F.length===1&&F[0]<128)Q.pushBytes(F);else if(F.length<=55)Q.pushByte(128+F.length),Q.pushBytes(F);else{if(Q.pushByte(183+$),$===1)Q.pushUint8(F.length);else if($===2)Q.pushUint16(F.length);else if($===3)Q.pushUint24(F.length);else Q.pushUint32(F.length);Q.pushBytes(F)}}}}function HT(D){if(D<=255)return 1;if(D<=65535)return 2;if(D<=16777215)return 3;if(D<=4294967295)return 4;throw new d("Length is too large.")}s0();Q0();function LK(D,F={}){let{recovered:$}=F;if(typeof D.r>"u")throw new IZ({signature:D});if(typeof D.s>"u")throw new IZ({signature:D});if($&&typeof D.yParity>"u")throw new IZ({signature:D});if(D.r<0n||D.r>zK)throw new MT({value:D.r});if(D.s<0n||D.s>zK)throw new OT({value:D.s});if(typeof D.yParity==="number"&&D.yParity!==0&&D.yParity!==1)throw new wZ({value:D.yParity})}function zs(D){return zT(dD(D))}function zT(D){if(D.length!==130&&D.length!==132)throw new _T({signature:D});let F=BigInt(PD(D,0,32)),$=BigInt(PD(D,32,64)),J=(()=>{let Q=Number(`0x${D.slice(130)}`);if(Number.isNaN(Q))return;try{return SK(Q)}catch{throw new wZ({value:Q})}})();if(typeof J>"u")return{r:F,s:$};return{r:F,s:$,yParity:J}}function PK(D){if(typeof D.r>"u")return;if(typeof D.s>"u")return;return jK(D)}function jK(D){let F=(()=>{if(typeof D==="string")return zT(D);if(D instanceof Uint8Array)return zs(D);if(typeof D.r==="string")return _s(D);if(D.v)return Cs(D);return{r:D.r,s:D.s,...typeof D.yParity<"u"?{yParity:D.yParity}:{}}})();return LK(F),F}function Cs(D){return{r:D.r,s:D.s,yParity:SK(D.v)}}function _s(D){let F=(()=>{let $=D.v?Number(D.v):void 0,J=D.yParity?Number(D.yParity):void 0;if(typeof $==="number"&&typeof J!=="number")J=SK($);if(typeof J!=="number")throw new wZ({value:D.yParity});return J})();return{r:BigInt(D.r),s:BigInt(D.s),yParity:F}}function CT(D){let{r:F,s:$,yParity:J}=D;return[J?"0x01":"0x",F===0n?"0x":zW(KD(F)),$===0n?"0x":zW(KD($))]}function SK(D){if(D===0||D===27)return 0;if(D===1||D===28)return 1;if(D>=35)return D%2===0?1:0;throw new ET({value:D})}class _T extends d{constructor({signature:D}){super(`Value \`${D}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${LD(G7(D))} bytes.`]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class IZ extends d{constructor({signature:D}){super(`Signature \`${a1(D)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class MT extends d{constructor({value:D}){super(`Value \`${D}\` is an invalid r value. r must be a positive integer less than 2^256.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}}class OT extends d{constructor({value:D}){super(`Value \`${D}\` is an invalid s value. s must be a positive integer less than 2^256.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}}class wZ extends d{constructor({value:D}){super(`Value \`${D}\` is an invalid y-parity value. Y-parity must be 0 or 1.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}class ET extends d{constructor({value:D}){super(`Value \`${D}\` is an invalid v value. v must be 27, 28 or >=35.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}function AT(D,F={}){if(typeof D.chainId==="string")return Ms(D);return{...D,...F.signature}}function Ms(D){let{address:F,chainId:$,nonce:J}=D,Q=PK(D);return{address:F,chainId:Number($),nonce:BigInt(J),...Q}}function IT(D){return Os(D,{presign:!0})}function Os(D,F={}){let{presign:$}=F;return M3(bD("0x05",UT(Es($?{address:D.address,chainId:D.chainId,nonce:D.nonce}:D))))}function Es(D){let{address:F,chainId:$,nonce:J}=D,Q=PK(D);return[$?KD($):"0x",F,J?KD(J):"0x",...Q?CT(Q):[]]}s0();Q0();ZZ();Q0();function wT(D){return lN(As(D))}function As(D){let{payload:F,signature:$}=D,{r:J,s:Q,yParity:Z}=$,Y=new M1.Signature(BigInt(J),BigInt(Q)).addRecoveryBit(Z).recoverPublicKey(G7(F).substring(2));return vN(Y)}var xK="0x8010801080108010801080108010801080108010801080108010801080108010",kK=p4("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function NZ(D){if(typeof D==="string"){if(PD(D,-32)!==xK)throw new yK(D)}else LK(D.authorization)}function ws(D){if(typeof D==="string")return NT(D);return D}function NT(D){NZ(D);let F=uQ(PD(D,-64,-32)),$=PD(D,-F-64,-64),J=PD(D,0,-F-64),[Q,Z,X]=N7(kK,$);return{authorization:AT({address:Q.delegation,chainId:Number(Q.chainId),nonce:Q.nonce,yParity:Q.yParity,r:Q.r,s:Q.s}),signature:J,...X&&X!=="0x"?{data:X,to:Z}:{}}}function Ns(D){let{data:F,signature:$}=D;NZ(D);let J=wT({payload:IT(D.authorization),signature:jK(D.authorization)}),Q=XF(kK,[{...D.authorization,delegation:D.authorization.address,chainId:BigInt(D.authorization.chainId)},D.to??J,F??"0x"]),Z=KD(LD(Q),{size:32});return bD($,Q,Z,xK)}function Ts(D){try{return NZ(D),!0}catch{return!1}}class yK extends d{constructor(D){super(`Value \`${D}\` is an invalid ERC-8010 wrapped signature.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc8010.InvalidWrappedSignatureError"})}}z8();q1();lQ();a0();Z1();K3();Z1();K3();async function TT({address:D,authorization:F,signature:$}){return I2(AD(D),await JF({authorization:F,signature:$}))}D0();c();ZZ();D0();K0();function LT({r:D,s:F,to:$="hex",v:J,yParity:Q}){let Z=(()=>{if(Q===0||Q===1)return Q;if(J&&(J===27n||J===28n||J>=35n))return J%2n===0n?1:0;throw Error("Invalid `v` or `yParity` value")})(),X=`0x${new M1.Signature(fD(D),fD(F)).toCompactHex()}${Z===0?"1b":"1c"}`;if($==="hex")return X;return W0(X)}U3();async function GF(D,F){let{address:$,chain:J=D.chain,hash:Q,erc6492VerifierAddress:Z=F.universalSignatureVerifierAddress??J?.contracts?.erc6492Verifier?.address,multicallAddress:X=F.multicallAddress??J?.contracts?.multicall3?.address}=F;if(J?.verifyHash)return await J.verifyHash(D,F);let Y=(()=>{let q=F.signature;if(DD(q))return q;if(typeof q==="object"&&"r"in q&&"s"in q)return LT(q);return WD(q)})();try{if(c4.validate(Y))return await Ls(D,{...F,multicallAddress:X,signature:Y});return await Ps(D,{...F,verifierAddress:Z,signature:Y})}catch(q){try{if(I2(AD($),await XZ({hash:Q,signature:Y})))return!0}catch{}if(q instanceof qF)return!1;throw q}}async function Ls(D,F){let{address:$,blockNumber:J,blockTag:Q,hash:Z,multicallAddress:X}=F,{authorization:Y,data:q,signature:G,to:B}=c4.unwrap(F.signature);if(await v4(D,{address:$,blockNumber:J,blockTag:Q})===i0(["0xef0100",Y.address]))return await js(D,{address:$,blockNumber:J,blockTag:Q,hash:Z,signature:G});let K={address:Y.address,chainId:Number(Y.chainId),nonce:Number(Y.nonce),r:k(Y.r,{size:32}),s:k(Y.s,{size:32}),yParity:Y.yParity};if(!await TT({address:$,authorization:K}))throw new qF;let V=await f(D,aD,"readContract")({...X?{address:X}:{code:W7},authorizationList:[K],abi:m2,blockNumber:J,blockTag:"pending",functionName:"aggregate3",args:[[...q?[{allowFailure:!0,target:B??$,callData:q}]:[],{allowFailure:!0,target:$,callData:ED({abi:JB,functionName:"isValidSignature",args:[Z,G]})}]]});if(V[V.length-1]?.returnData?.startsWith("0x1626ba7e"))return!0;throw new qF}async function Ps(D,F){let{address:$,factory:J,factoryData:Q,hash:Z,signature:X,verifierAddress:Y,...q}=F,G=await(async()=>{if(!J&&!Q)return X;if(l4.validate(X))return X;return l4.wrap({data:Q,signature:X,to:J})})(),B=Y?{to:Y,data:ED({abi:i9,functionName:"isValidSig",args:[$,Z,G]}),...q}:{data:q3({abi:i9,args:[$,Z,G],bytecode:rI}),...q},{data:W}=await f(D,w2,"call")(B).catch((K)=>{if(K instanceof x6)throw new qF;throw K});if(WQ(W??"0x0"))return!0;throw new qF}async function js(D,F){let{address:$,blockNumber:J,blockTag:Q,hash:Z,signature:X}=F;if((await f(D,aD,"readContract")({address:$,abi:JB,args:[Z,X],blockNumber:J,blockTag:Q,functionName:"isValidSignature"}).catch((q)=>{if(q instanceof k6)throw new qF;throw q})).startsWith("0x1626ba7e"))return!0;throw new qF}class qF extends Error{}c2();var PT=`\x19Ethereum Signed Message:
289
+ `;_2();c();function jT(D){let F=(()=>{if(typeof D==="string")return F0(D);if(typeof D.raw==="string")return D.raw;return WD(D.raw)})(),$=F0(`${PT}${GD(F)}`);return ID([$,F])}function TZ(D,F){return OD(jT(D),F)}async function ST(D,{address:F,message:$,factory:J,factoryData:Q,signature:Z,...X}){let Y=TZ($);return f(D,GF,"verifyHash")({address:F,factory:J,factoryData:Q,hash:Y,signature:Z,...X})}A8();c();c2();gD();m1();s();class fK extends P{constructor({domain:D}){super(`Invalid domain "${qD(D)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class bK extends P{constructor({primaryType:D,types:F}){super(`Invalid primary type \`${D}\` must be one of \`${JSON.stringify(Object.keys(F))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}class vK extends P{constructor({type:D}){super(`Struct type "${D}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}n2();_2();c();RQ();function xT(D){let{domain:F,message:$,primaryType:J,types:Q}=D,Z=(q,G)=>{let B={...G};for(let W of q){let{name:K,type:U}=W;if(U==="address")B[K]=B[K].toLowerCase()}return B},X=(()=>{if(!Q.EIP712Domain)return{};if(!F)return{};return Z(Q.EIP712Domain,F)})(),Y=(()=>{if(J==="EIP712Domain")return;return Z(Q[J],$)})();return qD({domain:X,message:Y,primaryType:J,types:Q})}function LZ(D){let{domain:F,message:$,primaryType:J,types:Q}=D,Z=(X,Y)=>{for(let q of X){let{name:G,type:B}=q,W=Y[G],K=B.match(N6);if(K&&(typeof W==="number"||typeof W==="bigint")){let[H,z,_]=K;k(W,{signed:z==="int",size:Number.parseInt(_,10)/8})}if(B==="address"&&typeof W==="string"&&!t(W))throw new B0({address:W});let U=B.match(EQ);if(U){let[H,z]=U;if(z&&GD(W)!==Number.parseInt(z,10))throw new e9({expectedSize:Number.parseInt(z,10),givenSize:GD(W)})}let V=Q[B];if(V)Ss(B),Z(V,W)}};if(Q.EIP712Domain&&F){if(typeof F!=="object")throw new fK({domain:F});Z(Q.EIP712Domain,F)}if(J!=="EIP712Domain")if(Q[J])Z(Q[J],$);else throw new bK({primaryType:J,types:Q})}function PZ({domain:D}){return[typeof D?.name==="string"&&{name:"name",type:"string"},D?.version&&{name:"version",type:"string"},(typeof D?.chainId==="number"||typeof D?.chainId==="bigint")&&{name:"chainId",type:"uint256"},D?.verifyingContract&&{name:"verifyingContract",type:"address"},D?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean)}function Ss(D){if(D==="address"||D==="bool"||D==="string"||D.startsWith("bytes")||D.startsWith("uint")||D.startsWith("int"))throw new vK({type:D})}function kT(D){let{domain:F={},message:$,primaryType:J}=D,Q={EIP712Domain:PZ({domain:F}),...D.types};LZ({domain:F,message:$,primaryType:J,types:Q});let Z=["0x1901"];if(F)Z.push(xs({domain:F,types:Q}));if(J!=="EIP712Domain")Z.push(yT({data:$,primaryType:J,types:Q}));return OD(ID(Z))}function xs({domain:D,types:F}){return yT({data:D,primaryType:"EIP712Domain",types:F})}function yT({data:D,primaryType:F,types:$}){let J=fT({data:D,primaryType:F,types:$});return OD(J)}function fT({data:D,primaryType:F,types:$}){let J=[{type:"bytes32"}],Q=[ks({primaryType:F,types:$})];for(let Z of $[F]){let[X,Y]=vT({types:$,name:Z.name,type:Z.type,value:D[Z.name]});J.push(X),Q.push(Y)}return iD(J,Q)}function ks({primaryType:D,types:F}){let $=nD(ys({primaryType:D,types:F}));return OD($)}function ys({primaryType:D,types:F}){let $="",J=bT({primaryType:D,types:F});J.delete(D);let Q=[D,...Array.from(J).sort()];for(let Z of Q)$+=`${Z}(${F[Z].map(({name:X,type:Y})=>`${Y} ${X}`).join(",")})`;return $}function bT({primaryType:D,types:F},$=new Set){let Q=D.match(/^\w*/u)?.[0];if($.has(Q)||F[Q]===void 0)return $;$.add(Q);for(let Z of F[Q])bT({primaryType:Z.type,types:F},$);return $}function vT({types:D,name:F,type:$,value:J}){if(D[$]!==void 0)return[{type:"bytes32"},OD(fT({data:J,primaryType:$,types:D}))];if($==="bytes")return[{type:"bytes32"},OD(J)];if($==="string")return[{type:"bytes32"},OD(nD(J))];if($.lastIndexOf("]")===$.length-1){let Q=$.slice(0,$.lastIndexOf("[")),Z=J.map((X)=>vT({name:F,type:Q,types:D,value:X}));return[{type:"bytes32"},OD(iD(Z.map(([X])=>X),Z.map(([,X])=>X)))]}return[{type:$},J]}async function hT(D,F){let{address:$,factory:J,factoryData:Q,signature:Z,message:X,primaryType:Y,types:q,domain:G,...B}=F,W=kT({message:X,primaryType:Y,types:q,domain:G});return f(D,GF,"verifyHash")({address:$,factory:J,factoryData:Q,hash:W,signature:Z,...B})}w8();var hK=new Map,uT=new Map,fs=0;function I0(D,F,$){let J=++fs,Q=()=>hK.get(D)||[],Z=()=>{let B=Q();hK.set(D,B.filter((W)=>W.id!==J))},X=()=>{let B=Q();if(!B.some((K)=>K.id===J))return;let W=uT.get(D);if(B.length===1&&W){let K=W();if(K instanceof Promise)K.catch(()=>{})}Z()},Y=Q();if(hK.set(D,[...Y,{id:J,fns:F}]),Y&&Y.length>0)return X;let q={};for(let B in F)q[B]=(...W)=>{let K=Q();if(K.length===0)return;for(let U of K)U.fns[B]?.(...W)};let G=$(q);if(typeof G==="function")uT.set(D,G);return X}async function n4(D){return new Promise((F)=>setTimeout(F,D))}function I3(D,{delay:F=100,retryCount:$=2,shouldRetry:J=()=>!0}={}){return new Promise((Q,Z)=>{let X=async({count:Y=0}={})=>{let q=async({error:G})=>{let B=typeof F==="function"?F({count:Y,error:G}):F;if(B)await n4(B);X({count:Y+1})};try{let G=await D();Q(G)}catch(G){if(Y<$&&await J({count:Y,error:G}))return q({error:G});Z(G)}};X()})}D0();function N2(D,{emitOnBegin:F,initialWaitTime:$,interval:J}){let Q=!0,Z=()=>Q=!1;return(async()=>{let Y;if(F)Y=await D({unpoll:Z});let q=await $?.(Y)??J;await n4(q);let G=async()=>{if(!Q)return;await D({unpoll:Z}),await n4(J),G()};G()})(),Z}function jZ(D,{emitOnBegin:F=!1,emitMissed:$=!1,onBlockNumber:J,onError:Q,poll:Z,pollingInterval:X=D.pollingInterval}){let Y=(()=>{if(typeof Z<"u")return Z;if(D.transport.type==="webSocket"||D.transport.type==="ipc")return!1;if(D.transport.type==="fallback"&&(D.transport.transports[0].config.type==="webSocket"||D.transport.transports[0].config.type==="ipc"))return!1;return!0})(),q;return Y?(()=>{let W=qD(["watchBlockNumber",D.uid,F,$,X]);return I0(W,{onBlockNumber:J,onError:Q},(K)=>N2(async()=>{try{let U=await f(D,f8,"getBlockNumber")({cacheTime:0});if(q!==void 0){if(U===q)return;if(U-q>1&&$)for(let V=q+1n;V<U;V++)K.onBlockNumber(V,q),q=V}if(q===void 0||U>q)K.onBlockNumber(U,q),q=U}catch(U){K.onError?.(U)}},{emitOnBegin:F,interval:X}))})():(()=>{let W=qD(["watchBlockNumber",D.uid,F,$]);return I0(W,{onBlockNumber:J,onError:Q},(K)=>{let U=!0,V=()=>U=!1;return(async()=>{try{let H=(()=>{if(D.transport.type==="fallback"){let _=D.transport.transports.find((O)=>O.config.type==="webSocket"||O.config.type==="ipc");if(!_)return D.transport;return _.value}return D.transport})(),{unsubscribe:z}=await H.subscribe({params:["newHeads"],onData(_){if(!U)return;let O=fD(_.result?.number);K.onBlockNumber(O,q),q=O},onError(_){K.onError?.(_)}});if(V=z,!U)V()}catch(H){Q?.(H)}})(),()=>V()})})()}async function SZ(D,F){let{checkReplacement:$=!0,confirmations:J=1,hash:Q,onReplaced:Z,retryCount:X=6,retryDelay:Y=({count:E})=>~~(1<<E)*200,timeout:q=180000}=F,G=qD(["waitForTransactionReceipt",D.uid,Q]),B=(()=>{if(F.pollingInterval)return F.pollingInterval;if(D.chain?.experimental_preconfirmationTime)return D.chain.experimental_preconfirmationTime;return D.pollingInterval})(),W,K,U,V=!1,H,z,{promise:_,resolve:O,reject:C}=K7(),M=q?setTimeout(()=>{z?.(),H?.(),C(new cB({hash:Q}))},q):void 0;return H=I0(G,{onReplaced:Z,resolve:O,reject:C},async(E)=>{if(U=await f(D,I7,"getTransactionReceipt")({hash:Q}).catch(()=>{return}),U&&J<=1){clearTimeout(M),E.resolve(U),H?.();return}z=f(D,jZ,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:B,async onBlockNumber(A){let I=(T)=>{clearTimeout(M),z?.(),T(),H?.()},R=A;if(V)return;try{if(U){if(J>1&&(!U.blockNumber||R-U.blockNumber+1n<J))return;I(()=>E.resolve(U));return}if($&&!W)V=!0,await I3(async()=>{if(W=await f(D,A7,"getTransaction")({hash:Q}),W.blockNumber)R=W.blockNumber},{delay:Y,retryCount:X}),V=!1;if(U=await f(D,I7,"getTransactionReceipt")({hash:Q}),J>1&&(!U.blockNumber||R-U.blockNumber+1n<J))return;I(()=>E.resolve(U))}catch(T){if(T instanceof q4||T instanceof G4){if(!W){V=!1;return}try{K=W,V=!0;let N=await I3(()=>f(D,Y0,"getBlock")({blockNumber:R,includeTransactions:!0}),{delay:Y,retryCount:X,shouldRetry:({error:y})=>y instanceof f4});V=!1;let j=N.transactions.find(({from:y,nonce:m})=>y===K.from&&m===K.nonce);if(!j)return;if(U=await f(D,I7,"getTransactionReceipt")({hash:j.hash}),J>1&&(!U.blockNumber||R-U.blockNumber+1n<J))return;let L="replaced";if(j.to===K.to&&j.value===K.value&&j.input===K.input)L="repriced";else if(j.from===j.to&&j.value===0n)L="cancelled";I(()=>{E.onReplaced?.({reason:L,replacedTransaction:K,transaction:j,transactionReceipt:U}),E.resolve(U)})}catch(N){I(()=>E.reject(N))}}else I(()=>E.reject(T))}}})}),_}function gT(D,{blockTag:F=D.experimental_blockTag??"latest",emitMissed:$=!1,emitOnBegin:J=!1,onBlock:Q,onError:Z,includeTransactions:X,poll:Y,pollingInterval:q=D.pollingInterval}){let G=(()=>{if(typeof Y<"u")return Y;if(D.transport.type==="webSocket"||D.transport.type==="ipc")return!1;if(D.transport.type==="fallback"&&(D.transport.transports[0].config.type==="webSocket"||D.transport.transports[0].config.type==="ipc"))return!1;return!0})(),B=X??!1,W;return G?(()=>{let V=qD(["watchBlocks",D.uid,F,$,J,B,q]);return I0(V,{onBlock:Q,onError:Z},(H)=>N2(async()=>{try{let z=await f(D,Y0,"getBlock")({blockTag:F,includeTransactions:B});if(z.number!==null&&W?.number!=null){if(z.number===W.number)return;if(z.number-W.number>1&&$)for(let _=W?.number+1n;_<z.number;_++){let O=await f(D,Y0,"getBlock")({blockNumber:_,includeTransactions:B});H.onBlock(O,W),W=O}}if(W?.number==null||F==="pending"&&z?.number==null||z.number!==null&&z.number>W.number)H.onBlock(z,W),W=z}catch(z){H.onError?.(z)}},{emitOnBegin:J,interval:q}))})():(()=>{let V=!0,H=!0,z=()=>V=!1;return(async()=>{try{if(J)f(D,Y0,"getBlock")({blockTag:F,includeTransactions:B}).then((C)=>{if(!V)return;if(!H)return;Q(C,void 0),H=!1}).catch(Z);let _=(()=>{if(D.transport.type==="fallback"){let C=D.transport.transports.find((M)=>M.config.type==="webSocket"||M.config.type==="ipc");if(!C)return D.transport;return C.value}return D.transport})(),{unsubscribe:O}=await _.subscribe({params:["newHeads"],async onData(C){if(!V)return;let M=await f(D,Y0,"getBlock")({blockNumber:C.result?.number,includeTransactions:B}).catch(()=>{});if(!V)return;Q(M,W),H=!1,W=M},onError(C){Z?.(C)}});if(z=O,!V)z()}catch(_){Z?.(_)}})(),()=>z()})()}gD();F7();function mT(D,F){let{abi:$,address:J,args:Q,batch:Z=!0,eventName:X,fromBlock:Y,onError:q,onLogs:G,poll:B,pollingInterval:W=D.pollingInterval,strict:K}=F;return(()=>{if(typeof B<"u")return B;if(typeof Y==="bigint")return!0;if(D.transport.type==="webSocket"||D.transport.type==="ipc")return!1;if(D.transport.type==="fallback"&&(D.transport.transports[0].config.type==="webSocket"||D.transport.transports[0].config.type==="ipc"))return!1;return!0})()?(()=>{let z=K??!1,_=qD(["watchContractEvent",J,Q,Z,D.uid,X,W,z,Y]);return I0(_,{onLogs:G,onError:q},(O)=>{let C;if(Y!==void 0)C=Y-1n;let M,E=!1,A=N2(async()=>{if(!E){try{M=await f(D,sQ,"createContractEventFilter")({abi:$,address:J,args:Q,eventName:X,strict:z,fromBlock:Y})}catch{}E=!0;return}try{let I;if(M)I=await f(D,ZF,"getFilterChanges")({filter:M});else{let R=await f(D,f8,"getBlockNumber")({});if(C&&C<R)I=await f(D,WZ,"getContractEvents")({abi:$,address:J,args:Q,eventName:X,fromBlock:C+1n,toBlock:R,strict:z});else I=[];C=R}if(I.length===0)return;if(Z)O.onLogs(I);else for(let R of I)O.onLogs([R])}catch(I){if(M&&I instanceof R2)E=!1;O.onError?.(I)}},{emitOnBegin:!0,interval:W});return async()=>{if(M)await f(D,YF,"uninstallFilter")({filter:M});A()}})})():(()=>{let z=K??!1,_=qD(["watchContractEvent",J,Q,Z,D.uid,X,W,z]),O=!0,C=()=>O=!1;return I0(_,{onLogs:G,onError:q},(M)=>{return(async()=>{try{let E=(()=>{if(D.transport.type==="fallback"){let R=D.transport.transports.find((T)=>T.config.type==="webSocket"||T.config.type==="ipc");if(!R)return D.transport;return R.value}return D.transport})(),A=X?k8({abi:$,eventName:X,args:Q}):[],{unsubscribe:I}=await E.subscribe({params:["logs",{address:J,topics:A}],onData(R){if(!O)return;let T=R.result;try{let{eventName:N,args:j}=_3({abi:$,data:T.data,topics:T.topics,strict:K}),L=A0(T,{args:j,eventName:N});M.onLogs([L])}catch(N){let j,L;if(N instanceof g1||N instanceof pF){if(K)return;j=N.abiItem.name,L=N.abiItem.inputs?.some((m)=>!(("name"in m)&&m.name))}let y=A0(T,{args:L?[]:{},eventName:j});M.onLogs([y])}},onError(R){M.onError?.(R)}});if(C=I,!O)C()}catch(E){q?.(E)}})(),()=>C()})})()}gD();F7();function dT(D,{address:F,args:$,batch:J=!0,event:Q,events:Z,fromBlock:X,onError:Y,onLogs:q,poll:G,pollingInterval:B=D.pollingInterval,strict:W}){let K=(()=>{if(typeof G<"u")return G;if(typeof X==="bigint")return!0;if(D.transport.type==="webSocket"||D.transport.type==="ipc")return!1;if(D.transport.type==="fallback"&&(D.transport.transports[0].config.type==="webSocket"||D.transport.transports[0].config.type==="ipc"))return!1;return!0})(),U=W??!1;return K?(()=>{let z=qD(["watchEvent",F,$,J,D.uid,Q,B,X]);return I0(z,{onLogs:q,onError:Y},(_)=>{let O;if(X!==void 0)O=X-1n;let C,M=!1,E=N2(async()=>{if(!M){try{C=await f(D,tQ,"createEventFilter")({address:F,args:$,event:Q,events:Z,strict:U,fromBlock:X})}catch{}M=!0;return}try{let A;if(C)A=await f(D,ZF,"getFilterChanges")({filter:C});else{let I=await f(D,f8,"getBlockNumber")({});if(O&&O!==I)A=await f(D,R7,"getLogs")({address:F,args:$,event:Q,events:Z,fromBlock:O+1n,toBlock:I});else A=[];O=I}if(A.length===0)return;if(J)_.onLogs(A);else for(let I of A)_.onLogs([I])}catch(A){if(C&&A instanceof R2)M=!1;_.onError?.(A)}},{emitOnBegin:!0,interval:B});return async()=>{if(C)await f(D,YF,"uninstallFilter")({filter:C});E()}})})():(()=>{let z=!0,_=()=>z=!1;return(async()=>{try{let O=(()=>{if(D.transport.type==="fallback"){let A=D.transport.transports.find((I)=>I.config.type==="webSocket"||I.config.type==="ipc");if(!A)return D.transport;return A.value}return D.transport})(),C=Z??(Q?[Q]:void 0),M=[];if(C){if(M=[C.flatMap((I)=>k8({abi:[I],eventName:I.name,args:$}))],Q)M=M[0]}let{unsubscribe:E}=await O.subscribe({params:["logs",{address:F,topics:M}],onData(A){if(!z)return;let I=A.result;try{let{eventName:R,args:T}=_3({abi:C??[],data:I.data,topics:I.topics,strict:U}),N=A0(I,{args:T,eventName:R});q([N])}catch(R){let T,N;if(R instanceof g1||R instanceof pF){if(W)return;T=R.abiItem.name,N=R.abiItem.inputs?.some((L)=>!(("name"in L)&&L.name))}let j=A0(I,{args:N?[]:{},eventName:T});q([j])}},onError(A){Y?.(A)}});if(_=E,!z)_()}catch(O){Y?.(O)}})(),()=>_()})()}function pT(D,{batch:F=!0,onError:$,onTransactions:J,poll:Q,pollingInterval:Z=D.pollingInterval}){return(typeof Q<"u"?Q:D.transport.type!=="webSocket"&&D.transport.type!=="ipc")?(()=>{let G=qD(["watchPendingTransactions",D.uid,F,Z]);return I0(G,{onTransactions:J,onError:$},(B)=>{let W,K=N2(async()=>{try{if(!W)try{W=await f(D,eQ,"createPendingTransactionFilter")({});return}catch(V){throw K(),V}let U=await f(D,ZF,"getFilterChanges")({filter:W});if(U.length===0)return;if(F)B.onTransactions(U);else for(let V of U)B.onTransactions([V])}catch(U){B.onError?.(U)}},{emitOnBegin:!0,interval:Z});return async()=>{if(W)await f(D,YF,"uninstallFilter")({filter:W});K()}})})():(()=>{let G=!0,B=()=>G=!1;return(async()=>{try{let{unsubscribe:W}=await D.transport.subscribe({params:["newPendingTransactions"],onData(K){if(!G)return;let U=K.result;J([U])},onError(K){$?.(K)}});if(B=W,!G)B()}catch(W){$?.(W)}})(),()=>B()})()}function lT(D){let{scheme:F,statement:$,...J}=D.match(bs)?.groups??{},{chainId:Q,expirationTime:Z,issuedAt:X,notBefore:Y,requestId:q,...G}=D.match(vs)?.groups??{},B=D.split("Resources:")[1]?.split(`
290
290
  - `).slice(1);return{...J,...G,...Q?{chainId:Number(Q)}:{},...Z?{expirationTime:new Date(Z)}:{},...X?{issuedAt:new Date(X)}:{},...Y?{notBefore:new Date(Y)}:{},...q?{requestId:q}:{},...B?{resources:B}:{},...F?{scheme:F}:{},...$?{statement:$}:{}}}var bs=/^(?:(?<scheme>[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?<domain>[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?<address>0x[a-fA-F0-9]{40})\n\n(?:(?<statement>.*)\n\n)?/,vs=/(?:URI: (?<uri>.+))\n(?:Version: (?<version>.+))\n(?:Chain ID: (?<chainId>\d+))\n(?:Nonce: (?<nonce>[a-zA-Z0-9]+))\n(?:Issued At: (?<issuedAt>.+))(?:\nExpiration Time: (?<expirationTime>.+))?(?:\nNot Before: (?<notBefore>.+))?(?:\nRequest ID: (?<requestId>.+))?/;n2();K3();function cT(D){let{address:F,domain:$,message:J,nonce:Q,scheme:Z,time:X=new Date}=D;if($&&J.domain!==$)return!1;if(Q&&J.nonce!==Q)return!1;if(Z&&J.scheme!==Z)return!1;if(J.expirationTime&&X>=J.expirationTime)return!1;if(J.notBefore&&X<J.notBefore)return!1;try{if(!J.address)return!1;if(!t(J.address,{strict:!1}))return!1;if(F&&!I2(J.address,F))return!1}catch{return!1}return!0}async function nT(D,F){let{address:$,domain:J,message:Q,nonce:Z,scheme:X,signature:Y,time:q=new Date,...G}=F,B=lT(Q);if(!B.address)return!1;if(!cT({address:$,domain:J,message:B,nonce:Z,scheme:X,time:q}))return!1;let K=TZ(Q);return GF(D,{address:B.address,hash:K,signature:Y,...G})}async function T7(D,{serializedTransaction:F}){return D.request({method:"eth_sendRawTransaction",params:[F]},{retryCount:0})}w8();async function L7(D,{serializedTransaction:F,throwOnReceiptRevert:$,timeout:J}){let Q=await D.request({method:"eth_sendRawTransactionSync",params:J?[F,k(J)]:[F]},{retryCount:0}),X=(D.chain?.formatters?.transactionReceipt?.format||KZ)(Q);if(X.status==="reverted"&&$)throw new B4({receipt:X});return X}function i4(D){return{call:(F)=>w2(D,F),createAccessList:(F)=>rQ(D,F),createBlockFilter:()=>Hw(D),createContractEventFilter:(F)=>sQ(D,F),createEventFilter:(F)=>tQ(D,F),createPendingTransactionFilter:()=>eQ(D),estimateContractGas:(F)=>ON(D,F),estimateGas:(F)=>O7(D,F),getBalance:(F)=>EN(D,F),getBlobBaseFee:()=>RN(D),getBlock:(F)=>Y0(D,F),getBlockNumber:(F)=>f8(D,F),getBlockTransactionCount:(F)=>wN(D,F),getBytecode:(F)=>v4(D,F),getChainId:()=>R0(D),getCode:(F)=>v4(D,F),getContractEvents:(F)=>WZ(D,F),getEip712Domain:(F)=>TN(D,F),getEnsAddress:(F)=>Xw(D,F),getEnsAvatar:(F)=>Kw(D,F),getEnsName:(F)=>Uw(D,F),getEnsResolver:(F)=>Vw(D,F),getEnsText:(F)=>aQ(D,F),getFeeHistory:(F)=>PN(D,F),estimateFeesPerGas:(F)=>qN(D,F),getFilterChanges:(F)=>ZF(D,F),getFilterLogs:(F)=>jN(D,F),getGasPrice:()=>C7(D),getLogs:(F)=>R7(D,F),getProof:(F)=>xN(D,F),estimateMaxPriorityFeePerGas:(F)=>YN(D,F),fillTransaction:(F)=>M7(D,F),getStorageAt:(F)=>kN(D,F),getTransaction:(F)=>A7(D,F),getTransactionConfirmations:(F)=>yN(D,F),getTransactionCount:(F)=>_7(D,F),getTransactionReceipt:(F)=>I7(D,F),multicall:(F)=>fN(D,F),prepareTransactionRequest:(F)=>y8(D,F),readContract:(F)=>aD(D,F),sendRawTransaction:(F)=>T7(D,F),sendRawTransactionSync:(F)=>L7(D,F),simulate:(F)=>h4(D,F),simulateBlocks:(F)=>h4(D,F),simulateCalls:(F)=>BT(D,F),simulateContract:(F)=>WT(D,F),verifyHash:(F)=>GF(D,F),verifyMessage:(F)=>ST(D,F),verifySiweMessage:(F)=>nT(D,F),verifyTypedData:(F)=>hT(D,F),uninstallFilter:(F)=>YF(D,F),waitForTransactionReceipt:(F)=>SZ(D,F),watchBlocks:(F)=>gT(D,F),watchBlockNumber:(F)=>jZ(D,F),watchContractEvent:(F)=>mT(D,F),watchEvent:(F)=>dT(D,F),watchPendingTransactions:(F)=>pT(D,F)}}function o4(D){let{key:F="public",name:$="Public Client"}=D;return DQ({...D,key:F,name:$,type:"publicClient"}).extend(i4)}async function iT(D,{hash:F}){await D.request({method:`${D.mode}_dropTransaction`,params:[F]})}async function oT(D){return D.request({method:`${D.mode}_dumpState`})}async function aT(D){if(D.mode==="ganache")return await D.request({method:"eth_mining"});return await D.request({method:`${D.mode}_getAutomine`})}async function rT(D){return await D.request({method:"txpool_content"})}D0();async function sT(D){let{pending:F,queued:$}=await D.request({method:"txpool_status"});return{pending:MD(F),queued:MD($)}}async function tT(D,{address:F}){await D.request({method:`${D.mode}_impersonateAccount`,params:[F]})}c();async function eT(D,{seconds:F}){return await D.request({method:"evm_increaseTime",params:[k(F)]})}async function DL(D){return await D.request({method:"txpool_inspect"})}async function FL(D,{state:F}){await D.request({method:`${D.mode}_loadState`,params:[F]})}c();async function $L(D,{blocks:F,interval:$}){if(D.mode==="ganache")await D.request({method:"evm_mine",params:[{blocks:k(F)}]});else await D.request({method:`${D.mode}_mine`,params:[k(F),k($||0)]})}async function JL(D){await D.request({method:`${D.mode}_removeBlockTimestampInterval`})}async function QL(D,{blockNumber:F,jsonRpcUrl:$}={}){await D.request({method:`${D.mode}_reset`,params:[{forking:{blockNumber:Number(F),jsonRpcUrl:$}}]})}async function ZL(D,{id:F}){await D.request({method:"evm_revert",params:[F]})}S8();async function XL(D,F){let{accessList:$,data:J,from:Q,gas:Z,gasPrice:X,maxFeePerGas:Y,maxPriorityFeePerGas:q,nonce:G,to:B,value:W,...K}=F,U=D.chain?.formatters?.transactionRequest?.format,H=(U||Z0)({...t0(K,{format:U}),accessList:$,data:J,from:Q,gas:Z,gasPrice:X,maxFeePerGas:Y,maxPriorityFeePerGas:q,nonce:G,to:B,value:W},"sendUnsignedTransaction");return await D.request({method:"eth_sendUnsignedTransaction",params:[H]})}async function YL(D,F){if(D.mode==="ganache")if(F)await D.request({method:"miner_start"});else await D.request({method:"miner_stop"});else await D.request({method:"evm_setAutomine",params:[F]})}c();async function qL(D,{address:F,value:$}){if(D.mode==="ganache")await D.request({method:"evm_setAccountBalance",params:[F,k($)]});else await D.request({method:`${D.mode}_setBalance`,params:[F,k($)]})}c();async function GL(D,{gasLimit:F}){await D.request({method:"evm_setBlockGasLimit",params:[k(F)]})}async function BL(D,{interval:F}){let $=(()=>{if(D.mode==="hardhat")return F*1000;return F})();await D.request({method:`${D.mode}_setBlockTimestampInterval`,params:[$]})}async function WL(D,{address:F,bytecode:$}){if(D.mode==="ganache")await D.request({method:"evm_setAccountCode",params:[F,$]});else await D.request({method:`${D.mode}_setCode`,params:[F,$]})}async function KL(D,{address:F}){await D.request({method:`${D.mode}_setCoinbase`,params:[F]})}async function UL(D,{interval:F}){let $=(()=>{if(D.mode==="hardhat")return F*1000;return F})();await D.request({method:"evm_setIntervalMining",params:[$]})}async function VL(D,F){await D.request({method:`${D.mode}_setLoggingEnabled`,params:[F]})}c();async function HL(D,{gasPrice:F}){await D.request({method:`${D.mode}_setMinGasPrice`,params:[k(F)]})}c();async function zL(D,{baseFeePerGas:F}){await D.request({method:`${D.mode}_setNextBlockBaseFeePerGas`,params:[k(F)]})}c();async function CL(D,{timestamp:F}){await D.request({method:"evm_setNextBlockTimestamp",params:[k(F)]})}c();async function _L(D,{address:F,nonce:$}){await D.request({method:`${D.mode}_setNonce`,params:[F,k($)]})}async function ML(D,F){await D.request({method:`${D.mode}_setRpcUrl`,params:[F]})}c();async function OL(D,{address:F,index:$,value:J}){await D.request({method:`${D.mode}_setStorageAt`,params:[F,typeof $==="number"?k($):$,J]})}async function EL(D){return await D.request({method:"evm_snapshot"})}async function RL(D,{address:F}){await D.request({method:`${D.mode}_stopImpersonatingAccount`,params:[F]})}function AL({mode:D}){return(F)=>{let $=F.extend(()=>({mode:D}));return{dropTransaction:(J)=>iT($,J),dumpState:()=>oT($),getAutomine:()=>aT($),getTxpoolContent:()=>rT($),getTxpoolStatus:()=>sT($),impersonateAccount:(J)=>tT($,J),increaseTime:(J)=>eT($,J),inspectTxpool:()=>DL($),loadState:(J)=>FL($,J),mine:(J)=>$L($,J),removeBlockTimestampInterval:()=>JL($),reset:(J)=>QL($,J),revert:(J)=>ZL($,J),sendUnsignedTransaction:(J)=>XL($,J),setAutomine:(J)=>YL($,J),setBalance:(J)=>qL($,J),setBlockGasLimit:(J)=>GL($,J),setBlockTimestampInterval:(J)=>BL($,J),setCode:(J)=>WL($,J),setCoinbase:(J)=>KL($,J),setIntervalMining:(J)=>UL($,J),setLoggingEnabled:(J)=>VL($,J),setMinGasPrice:(J)=>HL($,J),setNextBlockBaseFeePerGas:(J)=>zL($,J),setNextBlockTimestamp:(J)=>CL($,J),setNonce:(J)=>_L($,J),setRpcUrl:(J)=>ML($,J),setStorageAt:(J)=>OL($,J),snapshot:()=>EL($),stopImpersonatingAccount:(J)=>RL($,J)}}}function uK(D){let{key:F="test",name:$="Test Client",mode:J}=D;return DQ({...D,key:F,name:$,type:"testClient"}).extend((Z)=>({mode:J,...AL({mode:J})(Z)}))}c();async function IL(D,{chain:F}){let{id:$,name:J,nativeCurrency:Q,rpcUrls:Z,blockExplorers:X}=F;await D.request({method:"wallet_addEthereumChain",params:[{chainId:k($),chainName:J,nativeCurrency:Q,rpcUrls:Z.default.http,blockExplorerUrls:X?Object.values(X).map(({url:Y})=>Y):void 0}]},{dedupe:!0,retryCount:0})}lQ();s();class V0 extends P{constructor({docsPath:D}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."].join(`
291
- `),{docsPath:D,docsSlug:"account",name:"AccountNotFoundError"})}}class t2 extends P{constructor({docsPath:D,metaMessages:F,type:$}){super(`Account type "${$}" is not supported.`,{docsPath:D,metaMessages:F,name:"AccountTypeNotSupportedError"})}}s();NQ();function P7({chain:D,currentChainId:F}){if(!D)throw new bB;if(F!==D.id)throw new fB({chain:D,currentChainId:F})}S8();rF();x8();var gK=new G2(128);async function BF(D,F){let{account:$=D.account,assertChainId:J=!0,chain:Q=D.chain,accessList:Z,authorizationList:X,blobs:Y,data:q,dataSuffix:G=typeof D.dataSuffix==="string"?D.dataSuffix:D.dataSuffix?.value,gas:B,gasPrice:W,maxFeePerBlobGas:K,maxFeePerGas:U,maxPriorityFeePerGas:V,nonce:H,type:z,value:_,...O}=F;if(typeof $>"u")throw new V0({docsPath:"/docs/actions/wallet/sendTransaction"});let C=$?i($):null;try{X0(F);let M=await(async()=>{if(F.to)return F.to;if(F.to===null)return;if(X&&X.length>0)return await JF({authorization:X[0]}).catch(()=>{throw new P("`to` is required. Could not infer from `authorizationList`.")});return})();if(C?.type==="json-rpc"||C===null){let E;if(Q!==null){if(E=await f(D,R0,"getChainId")({}),J)P7({currentChainId:E,chain:Q})}let A=D.chain?.formatters?.transactionRequest?.format,R=(A||Z0)({...t0(O,{format:A}),accessList:Z,account:C,authorizationList:X,blobs:Y,chainId:E,data:q?ID([q,G??"0x"]):q,gas:B,gasPrice:W,maxFeePerBlobGas:K,maxFeePerGas:U,maxPriorityFeePerGas:V,nonce:H,to:M,type:z,value:_},"sendTransaction"),T=gK.get(D.uid),N=T?"wallet_sendTransaction":"eth_sendTransaction";try{return await D.request({method:N,params:[R]},{retryCount:0})}catch(j){if(T===!1)throw j;let L=j;if(L.name==="InvalidInputRpcError"||L.name==="InvalidParamsRpcError"||L.name==="MethodNotFoundRpcError"||L.name==="MethodNotSupportedRpcError")return await D.request({method:"wallet_sendTransaction",params:[R]},{retryCount:0}).then((y)=>{return gK.set(D.uid,!0),y}).catch((y)=>{let m=y;if(m.name==="MethodNotFoundRpcError"||m.name==="MethodNotSupportedRpcError")throw gK.set(D.uid,!1),L;throw m});throw L}}if(C?.type==="local"){let E=await f(D,y8,"prepareTransactionRequest")({account:C,accessList:Z,authorizationList:X,blobs:Y,chain:Q,data:q?ID([q,G??"0x"]):q,gas:B,gasPrice:W,maxFeePerBlobGas:K,maxFeePerGas:U,maxPriorityFeePerGas:V,nonce:H,nonceManager:C.nonceManager,parameters:[...b4,"sidecars"],type:z,value:_,...O,to:M}),A=Q?.serializers?.transaction,w=await C.signTransaction(E,{serializer:A});return await f(D,T7,"sendRawTransaction")({serializedTransaction:w})}if(C?.type==="smart")throw new t2({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"});throw new t2({docsPath:"/docs/actions/wallet/sendTransaction",type:C?.type})}catch(M){if(M instanceof t2)throw M;throw QF(M,{...F,account:C,chain:F.chain||void 0})}}function wL(D,F){let{abi:$,args:J,bytecode:Q,...Z}=F,X=q3({abi:$,args:J,bytecode:Q});return BF(D,{...Z,...Z.authorizationList?{to:null}:{},data:X})}Z1();async function NL(D){if(D.account?.type==="local")return[D.account.address];return(await D.request({method:"eth_accounts"},{dedupe:!0})).map(($)=>O8($))}sF();D0();s();F7();a0();D0();c();var mK="0x5792579257925792579257925792579257925792579257925792579257925792",dK=k(0,{size:32});async function xZ(D,F){let{account:$=D.account,chain:J=D.chain,experimental_fallback:Q,experimental_fallbackDelay:Z=32,forceAtomic:X=!1,id:Y,version:q="2.0.0"}=F,G=$?i($):null,B=F.capabilities;if(D.dataSuffix&&!F.capabilities?.dataSuffix)if(typeof D.dataSuffix==="string")B={...F.capabilities,dataSuffix:{value:D.dataSuffix,optional:!0}};else B={...F.capabilities,dataSuffix:{value:D.dataSuffix.value,...D.dataSuffix.required?{}:{optional:!0}}};let W=F.calls.map((K)=>{let U=K,V=U.abi?ED({abi:U.abi,functionName:U.functionName,args:U.args}):U.data;return{data:U.dataSuffix&&V?ID([V,U.dataSuffix]):V,to:U.to,value:U.value?k(U.value):void 0}});try{let K=await D.request({method:"wallet_sendCalls",params:[{atomicRequired:X,calls:W,capabilities:B,chainId:k(J.id),from:G?.address,id:Y,version:q}]},{retryCount:0});if(typeof K==="string")return{id:K};return K}catch(K){let U=K;if(Q&&(U.name==="MethodNotFoundRpcError"||U.name==="MethodNotSupportedRpcError"||U.name==="UnknownRpcError"||U.details.toLowerCase().includes("does not exist / is not available")||U.details.toLowerCase().includes("missing or invalid. request()")||U.details.toLowerCase().includes("did not match any variant of untagged enum")||U.details.toLowerCase().includes("account upgraded to unsupported contract")||U.details.toLowerCase().includes("eip-7702 not supported")||U.details.toLowerCase().includes("unsupported wc_ method")||U.details.toLowerCase().includes("feature toggled misconfigured")||U.details.toLowerCase().includes("jsonrpcengine: response has no error or result for request"))){if(B){if(Object.values(B).some((O)=>!O.optional))throw new n1(new P("non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`.",{details:"non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`."}))}if(X&&W.length>1)throw new i1(new P("`forceAtomic` is not supported on fallback to `eth_sendTransaction`.",{details:"`forceAtomic` is not supported on fallback to `eth_sendTransaction`."}));let V=[];for(let _ of W){let O=BF(D,{account:G,chain:J,data:_.data,to:_.to,value:_.value?fD(_.value):void 0});if(V.push(O),Z>0)await new Promise((C)=>setTimeout(C,Z))}let H=await Promise.allSettled(V);if(H.every((_)=>_.status==="rejected"))throw H[0].reason;let z=H.map((_)=>{if(_.status==="fulfilled")return _.value;return dK});return{id:ID([...z,k(J.id,{size:32}),mK])}}throw QF(K,{...F,account:G,chain:F.chain})}}async function kZ(D,F){async function $(B){if(B.endsWith(mK.slice(2))){let K=q2(OQ(B,-64,-32)),U=OQ(B,0,-64).slice(2).match(/.{1,64}/g),V=await Promise.all(U.map((z)=>dK.slice(2)!==z?D.request({method:"eth_getTransactionReceipt",params:[`0x${z}`]},{dedupe:!0}):void 0)),H=(()=>{if(V.some((z)=>z===null))return 100;if(V.every((z)=>z?.status==="0x1"))return 200;if(V.every((z)=>z?.status==="0x0"))return 500;return 600})();return{atomic:!1,chainId:MD(K),receipts:V.filter(Boolean),status:H,version:"2.0.0"}}return D.request({method:"wallet_getCallsStatus",params:[B]})}let{atomic:J=!1,chainId:Q,receipts:Z,version:X="2.0.0",...Y}=await $(F.id),[q,G]=(()=>{let B=Y.status;if(B>=100&&B<200)return["pending",B];if(B>=200&&B<300)return["success",B];if(B>=300&&B<700)return["failure",B];if(B==="CONFIRMED")return["success",200];if(B==="PENDING")return["pending",100];return[void 0,B]})();return{...Y,atomic:J,chainId:Q?MD(Q):void 0,receipts:Z?.map((B)=>({...B,blockNumber:fD(B.blockNumber),gasUsed:fD(B.gasUsed),status:qK[B.status]}))??[],statusCode:G,status:q,version:X}}c();async function TL(D,F={}){let{account:$=D.account,chainId:J}=F,Q=$?i($):void 0,Z=J?[Q?.address,[k(J)]]:[Q?.address],X=await D.request({method:"wallet_getCapabilities",params:Z}),Y={};for(let[q,G]of Object.entries(X)){Y[Number(q)]={};for(let[B,W]of Object.entries(G)){if(B==="addSubAccount")B="unstable_addSubAccount";Y[Number(q)][B]=W}}return typeof J==="number"?Y[J]:Y}async function LL(D){return await D.request({method:"wallet_getPermissions"},{dedupe:!0})}K3();async function yZ(D,F){let{account:$=D.account,chainId:J,nonce:Q}=F;if(!$)throw new V0({docsPath:"/docs/eip7702/prepareAuthorization"});let Z=i($),X=(()=>{if(!F.executor)return;if(F.executor==="self")return F.executor;return i(F.executor)})(),Y={address:F.contractAddress??F.address,chainId:J,nonce:Q};if(typeof Y.chainId>"u")Y.chainId=D.chain?.id??await f(D,R0,"getChainId")({});if(typeof Y.nonce>"u"){if(Y.nonce=await f(D,_7,"getTransactionCount")({address:Z.address,blockTag:"pending"}),X==="self"||X?.address&&I2(X.address,Z.address))Y.nonce+=1}return Y}Z1();async function PL(D){return(await D.request({method:"eth_requestAccounts"},{dedupe:!0,retryCount:0})).map(($)=>AD($))}async function jL(D,F){return D.request({method:"wallet_requestPermissions",params:[F]},{retryCount:0})}s();s();class pK extends P{constructor(D){super(`Call bundle failed with status: ${D.statusCode}`,{name:"BundleFailedError"});Object.defineProperty(this,"result",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.result=D}}async function fZ(D,F){let{id:$,pollingInterval:J=D.pollingInterval,status:Q=({statusCode:H})=>H===200||H>=300,retryCount:Z=4,retryDelay:X=({count:H})=>~~(1<<H)*200,timeout:Y=60000,throwOnFailure:q=!1}=F,G=qD(["waitForCallsStatus",D.uid,$]),{promise:B,resolve:W,reject:K}=K7(),U,V=I0(G,{resolve:W,reject:K},(H)=>{let z=N2(async()=>{let _=(O)=>{clearTimeout(U),z(),O(),V()};try{let O=await I3(async()=>{let C=await f(D,kZ,"getCallsStatus")({id:$});if(q&&C.status==="failure")throw new pK(C);return C},{retryCount:Z,delay:X});if(!Q(O))return;_(()=>H.resolve(O))}catch(O){_(()=>H.reject(O))}},{interval:J,emitOnBegin:!0});return z});return U=Y?setTimeout(()=>{V(),clearTimeout(U),K(new SL({id:$}))},Y):void 0,await B}class SL extends P{constructor({id:D}){super(`Timed out while waiting for call bundle with id "${D}" to be confirmed.`,{name:"WaitForCallsStatusTimeoutError"})}}async function xL(D,F){let{chain:$=D.chain}=F,J=F.timeout??Math.max(($?.blockTime??0)*3,5000),Q=await f(D,xZ,"sendCalls")(F);return await f(D,fZ,"waitForCallsStatus")({...F,id:Q.id,timeout:J})}s();w8();S8();rF();x8();var lK=new G2(128);async function bZ(D,F){let{account:$=D.account,assertChainId:J=!0,chain:Q=D.chain,accessList:Z,authorizationList:X,blobs:Y,data:q,dataSuffix:G=typeof D.dataSuffix==="string"?D.dataSuffix:D.dataSuffix?.value,gas:B,gasPrice:W,maxFeePerBlobGas:K,maxFeePerGas:U,maxPriorityFeePerGas:V,nonce:H,pollingInterval:z,throwOnReceiptRevert:_,type:O,value:C,...M}=F,E=F.timeout??Math.max((Q?.blockTime??0)*3,5000);if(typeof $>"u")throw new V0({docsPath:"/docs/actions/wallet/sendTransactionSync"});let A=$?i($):null;try{X0(F);let w=await(async()=>{if(F.to)return F.to;if(F.to===null)return;if(X&&X.length>0)return await JF({authorization:X[0]}).catch(()=>{throw new P("`to` is required. Could not infer from `authorizationList`.")});return})();if(A?.type==="json-rpc"||A===null){let R;if(Q!==null){if(R=await f(D,R0,"getChainId")({}),J)P7({currentChainId:R,chain:Q})}let T=D.chain?.formatters?.transactionRequest?.format,j=(T||Z0)({...t0(M,{format:T}),accessList:Z,account:A,authorizationList:X,blobs:Y,chainId:R,data:q?ID([q,G??"0x"]):q,gas:B,gasPrice:W,maxFeePerBlobGas:K,maxFeePerGas:U,maxPriorityFeePerGas:V,nonce:H,to:w,type:O,value:C},"sendTransaction"),L=lK.get(D.uid),y=L?"wallet_sendTransaction":"eth_sendTransaction",m=await(async()=>{try{return await D.request({method:y,params:[j]},{retryCount:0})}catch(h){if(L===!1)throw h;let g=h;if(g.name==="InvalidInputRpcError"||g.name==="InvalidParamsRpcError"||g.name==="MethodNotFoundRpcError"||g.name==="MethodNotSupportedRpcError")return await D.request({method:"wallet_sendTransaction",params:[j]},{retryCount:0}).then((b)=>{return lK.set(D.uid,!0),b}).catch((b)=>{let u=b;if(u.name==="MethodNotFoundRpcError"||u.name==="MethodNotSupportedRpcError")throw lK.set(D.uid,!1),g;throw u});throw g}})(),S=await f(D,SZ,"waitForTransactionReceipt")({checkReplacement:!1,hash:m,pollingInterval:z,timeout:E});if(_&&S.status==="reverted")throw new B4({receipt:S});return S}if(A?.type==="local"){let R=await f(D,y8,"prepareTransactionRequest")({account:A,accessList:Z,authorizationList:X,blobs:Y,chain:Q,data:q?ID([q,G??"0x"]):q,gas:B,gasPrice:W,maxFeePerBlobGas:K,maxFeePerGas:U,maxPriorityFeePerGas:V,nonce:H,nonceManager:A.nonceManager,parameters:[...b4,"sidecars"],type:O,value:C,...M,to:w}),T=Q?.serializers?.transaction,N=await A.signTransaction(R,{serializer:T});return await f(D,L7,"sendRawTransactionSync")({serializedTransaction:N,throwOnReceiptRevert:_,timeout:F.timeout})}if(A?.type==="smart")throw new t2({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"});throw new t2({docsPath:"/docs/actions/wallet/sendTransactionSync",type:A?.type})}catch(w){if(w instanceof t2)throw w;throw QF(w,{...F,account:A,chain:F.chain||void 0})}}async function kL(D,F){let{id:$}=F;await D.request({method:"wallet_showCallsStatus",params:[$]});return}async function yL(D,F){let{account:$=D.account}=F;if(!$)throw new V0({docsPath:"/docs/eip7702/signAuthorization"});let J=i($);if(!J.signAuthorization)throw new t2({docsPath:"/docs/eip7702/signAuthorization",metaMessages:["The `signAuthorization` Action does not support JSON-RPC Accounts."],type:J.type});let Q=await yZ(D,F);return J.signAuthorization(Q)}c();async function fL(D,{account:F=D.account,message:$}){if(!F)throw new V0({docsPath:"/docs/actions/wallet/signMessage"});let J=i(F);if(J.signMessage)return J.signMessage({message:$});let Q=(()=>{if(typeof $==="string")return F0($);if($.raw instanceof Uint8Array)return nD($.raw);return $.raw})();return D.request({method:"personal_sign",params:[Q,J.address]},{retryCount:0})}c();S8();x8();async function bL(D,F){let{account:$=D.account,chain:J=D.chain,...Q}=F;if(!$)throw new V0({docsPath:"/docs/actions/wallet/signTransaction"});let Z=i($);X0({account:Z,...F});let X=await f(D,R0,"getChainId")({});if(J!==null)P7({currentChainId:X,chain:J});let q=(J?.formatters||D.chain?.formatters)?.transactionRequest?.format||Z0;if(Z.signTransaction)return Z.signTransaction({...Q,chainId:X},{serializer:D.chain?.serializers?.transaction});return await D.request({method:"eth_signTransaction",params:[{...q({...Q,account:Z},"signTransaction"),chainId:k(X),from:Z.address}]},{retryCount:0})}async function vL(D,F){let{account:$=D.account,domain:J,message:Q,primaryType:Z}=F;if(!$)throw new V0({docsPath:"/docs/actions/wallet/signTypedData"});let X=i($),Y={EIP712Domain:PZ({domain:J}),...F.types};if(LZ({domain:J,message:Q,primaryType:Z,types:Y}),X.signTypedData)return X.signTypedData({domain:J,message:Q,primaryType:Z,types:Y});let q=xT({domain:J,message:Q,primaryType:Z,types:Y});return D.request({method:"eth_signTypedData_v4",params:[X.address,q]},{retryCount:0})}c();async function hL(D,{id:F}){await D.request({method:"wallet_switchEthereumChain",params:[{chainId:k(F)}]},{retryCount:0})}async function uL(D,F){return await D.request({method:"wallet_watchAsset",params:F},{retryCount:0})}a0();async function w3(D,F){return w3.internal(D,BF,"sendTransaction",F)}(function(D){async function F($,J,Q,Z){let{abi:X,account:Y=$.account,address:q,args:G,functionName:B,...W}=Z;if(typeof Y>"u")throw new V0({docsPath:"/docs/contract/writeContract"});let K=Y?i(Y):null,U=ED({abi:X,args:G,functionName:B});try{return await f($,J,Q)({data:U,to:q,account:K,...W})}catch(V){throw B2(V,{abi:X,address:q,args:G,docsPath:"/docs/contract/writeContract",functionName:B,sender:K?.address})}}D.internal=F})(w3||(w3={}));async function gL(D,F){return w3.internal(D,bZ,"sendTransactionSync",F)}function cK(D){return{addChain:(F)=>IL(D,F),deployContract:(F)=>wL(D,F),fillTransaction:(F)=>M7(D,F),getAddresses:()=>NL(D),getCallsStatus:(F)=>kZ(D,F),getCapabilities:(F)=>TL(D,F),getChainId:()=>R0(D),getPermissions:()=>LL(D),prepareAuthorization:(F)=>yZ(D,F),prepareTransactionRequest:(F)=>y8(D,F),requestAddresses:()=>PL(D),requestPermissions:(F)=>jL(D,F),sendCalls:(F)=>xZ(D,F),sendCallsSync:(F)=>xL(D,F),sendRawTransaction:(F)=>T7(D,F),sendRawTransactionSync:(F)=>L7(D,F),sendTransaction:(F)=>BF(D,F),sendTransactionSync:(F)=>bZ(D,F),showCallsStatus:(F)=>kL(D,F),signAuthorization:(F)=>yL(D,F),signMessage:(F)=>fL(D,F),signTransaction:(F)=>bL(D,F),signTypedData:(F)=>vL(D,F),switchChain:(F)=>hL(D,F),waitForCallsStatus:(F)=>fZ(D,F),watchAsset:(F)=>uL(D,F),writeContract:(F)=>w3(D,F),writeContractSync:(F)=>gL(D,F)}}$3();s();class nK extends P{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}EW();$3();function mL(D,{errorInstance:F=Error("timed out"),timeout:$,signal:J}){return new Promise((Q,Z)=>{(async()=>{let X;try{let Y=new AbortController;if($>0)X=setTimeout(()=>{if(J)Y.abort();else Z(F)},$);Q(await D({signal:Y?.signal||null}))}catch(Y){if(Y?.name==="AbortError")Z(F);Z(Y)}finally{clearTimeout(X)}})()})}function hs(){return{current:0,take(){return this.current++},reset(){this.current=0}}}var iK=hs();function dL(D,F={}){let{url:$,headers:J}=us(D);return{async request(Q){let{body:Z,fetchFn:X=F.fetchFn??fetch,onRequest:Y=F.onRequest,onResponse:q=F.onResponse,timeout:G=F.timeout??1e4}=Q,B={...F.fetchOptions??{},...Q.fetchOptions??{}},{headers:W,method:K,signal:U}=B;try{let V=await mL(async({signal:z})=>{let _={...B,body:Array.isArray(Z)?qD(Z.map((E)=>({jsonrpc:"2.0",id:E.id??iK.take(),...E}))):qD({jsonrpc:"2.0",id:Z.id??iK.take(),...Z}),headers:{...J,"Content-Type":"application/json",...W},method:K||"POST",signal:U||(G>0?z:null)},O=new Request($,_),C=await Y?.(O,_)??{..._,url:$};return await X(C.url??$,C)},{errorInstance:new yQ({body:Z,url:$}),timeout:G,signal:!0});if(q)await q(V);let H;if(V.headers.get("Content-Type")?.startsWith("application/json"))H=await V.json();else{H=await V.text();try{H=JSON.parse(H||"{}")}catch(z){if(V.ok)throw z;H={error:H}}}if(!V.ok)throw new o2({body:Z,details:qD(H.error)||V.statusText,headers:V.headers,status:V.status,url:$});return H}catch(V){if(V instanceof o2)throw V;if(V instanceof yQ)throw V;throw new o2({body:Z,cause:V,url:$})}}}}function us(D){try{let F=new URL(D),$=(()=>{if(F.username){let J=`${decodeURIComponent(F.username)}:${decodeURIComponent(F.password)}`;return F.username="",F.password="",{url:F.toString(),headers:{Authorization:`Basic ${btoa(J)}`}}}return})();return{url:F.toString(),...$}}catch{return{url:D}}}s();$3();F7();c();rF();var vZ=new G2(8192);function pL(D,{enabled:F=!0,id:$}){if(!F||!$)return D();if(vZ.get($))return vZ.get($);let J=D().finally(()=>vZ.delete($));return vZ.set($,J),J}function lL(D,F={}){return async($,J={})=>{let{dedupe:Q=!1,methods:Z,retryDelay:X=150,retryCount:Y=3,uid:q}={...F,...J},{method:G}=$;if(Z?.exclude?.includes(G))throw new c1(Error("method not supported"),{method:G});if(Z?.include&&!Z.include.includes(G))throw new c1(Error("method not supported"),{method:G});let B=Q?F0(`${q}.${qD($)}`):void 0;return pL(()=>I3(async()=>{try{return await D($)}catch(W){let K=W;switch(K.code){case b6.code:throw new b6(K);case v6.code:throw new v6(K);case h6.code:throw new h6(K,{method:$.method});case u6.code:throw new u6(K);case B1.code:throw new B1(K);case R2.code:throw new R2(K);case g6.code:throw new g6(K);case m6.code:throw new m6(K);case d6.code:throw new d6(K);case c1.code:throw new c1(K,{method:$.method});case J3.code:throw new J3(K);case p6.code:throw new p6(K);case Q3.code:throw new Q3(K);case l6.code:throw new l6(K);case c6.code:throw new c6(K);case n6.code:throw new n6(K);case i6.code:throw new i6(K);case o6.code:throw new o6(K);case n1.code:throw new n1(K);case a6.code:throw new a6(K);case r6.code:throw new r6(K);case s6.code:throw new s6(K);case t6.code:throw new t6(K);case e6.code:throw new e6(K);case i1.code:throw new i1(K);case 5000:throw new Q3(K);case D7.code:throw new D7(K);default:if(W instanceof P)throw W;throw new rB(K)}}},{delay:({count:W,error:K})=>{if(K&&K instanceof o2){let U=K?.headers?.get("Retry-After");if(U?.match(/\d/))return Number.parseInt(U,10)*1000}return~~(1<<W)*X},retryCount:Y,shouldRetry:({error:W})=>gs(W)}),{enabled:Q,id:B})}}function gs(D){if("code"in D&&typeof D.code==="number"){if(D.code===-1)return!0;if(D.code===J3.code)return!0;if(D.code===B1.code)return!0;return!1}if(D instanceof o2&&D.status){if(D.status===403)return!0;if(D.status===408)return!0;if(D.status===413)return!0;if(D.status===429)return!0;if(D.status===500)return!0;if(D.status===502)return!0;if(D.status===503)return!0;if(D.status===504)return!0;return!1}return!0}function cL({key:D,methods:F,name:$,request:J,retryCount:Q=3,retryDelay:Z=150,timeout:X,type:Y},q){let G=eJ();return{config:{key:D,methods:F,name:$,request:J,retryCount:Q,retryDelay:Z,timeout:X,type:Y},request:lL(J,{methods:F,retryCount:Q,retryDelay:Z,uid:G}),value:q}}function N3(D,F={}){let{batch:$,fetchFn:J,fetchOptions:Q,key:Z="http",methods:X,name:Y="HTTP JSON-RPC",onFetchRequest:q,onFetchResponse:G,retryDelay:B,raw:W}=F;return({chain:K,retryCount:U,timeout:V})=>{let{batchSize:H=1000,wait:z=0}=typeof $==="object"?$:{},_=F.retryCount??U,O=V??F.timeout??1e4,C=D||K?.rpcUrls.default.http[0];if(!C)throw new nK;let M=dL(C,{fetchFn:J,fetchOptions:Q,onRequest:q,onResponse:G,timeout:O});return cL({key:Z,methods:X,name:Y,async request({method:E,params:A}){let w={method:E,params:A},{schedule:R}=nQ({id:C,wait:z,shouldSplitBatch(L){return L.length>H},fn:(L)=>M.request({body:L}),sort:(L,y)=>L.id-y.id}),T=async(L)=>$?R(L):[await M.request({body:L})],[{error:N,result:j}]=await T(w);if(W)return{error:N,result:j};if(N)throw new F3({body:w,error:N,url:C});return j},retryCount:_,retryDelay:B,timeout:O,type:"http"},{fetchOptions:Q,url:C})}}z8();s();q1();A8();gD();m1();n2();F4();c();RQ();function a4(D,F){if(D.length!==F.length)throw new r9({expectedLength:D.length,givenLength:F.length});let $=[];for(let J=0;J<D.length;J++){let Q=D[J],Z=F[J];$.push(nL(Q,Z))}return i0($)}function nL(D,F,$=!1){if(D==="address"){let X=F;if(!t(X))throw new B0({address:X});return M2(X.toLowerCase(),{size:$?32:null})}if(D==="string")return F0(F);if(D==="bytes")return F;if(D==="bool")return M2(cF(F),{size:$?32:1});let J=D.match(N6);if(J){let[X,Y,q="256"]=J,G=Number.parseInt(q,10)/8;return k(F,{size:$?32:G,signed:Y==="int"})}let Q=D.match(EQ);if(Q){let[X,Y]=Q;if(Number.parseInt(Y,10)!==(F.length-2)/2)throw new e9({expectedSize:Number.parseInt(Y,10),givenSize:(F.length-2)/2});return M2(F,{dir:"right",size:$?32:null})}let Z=D.match(nA);if(Z&&Array.isArray(F)){let[X,Y]=Z,q=[];for(let G=0;G<F.length;G++)q.push(nL(Y,F[G],!0));if(q.length===0)return"0x";return i0(q)}throw new CB(D)}Z1();n2();function r4(D){let F={formatters:void 0,fees:void 0,serializers:void 0,...D};function $(J){return(Q)=>{let Z=typeof Q==="function"?Q(J):Q,X={...J,...Z};return Object.assign(X,{extend:$(X)})}}return Object.assign(F,{extend:$(F)})}D0();c();_2();function oK(D){return DD(D)&&GD(D)===32}s();class aK extends P{constructor({value:D}){super(`Number \`${D}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function T3(D,F){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(D))throw new aK({value:D});let[$,J="0"]=D.split("."),Q=$.startsWith("-");if(Q)$=$.slice(1);if(J=J.replace(/(0+)$/,""),F===0){if(Math.round(Number(`.${J}`))===1)$=`${BigInt($)+1n}`;J=""}else if(J.length>F){let[Z,X,Y]=[J.slice(0,F-1),J.slice(F-1,F),J.slice(F)],q=Math.round(Number(`${X}.${Y}`));if(q>9)J=`${BigInt(Z)+BigInt(1)}0`.padStart(Z.length+1,"0");else J=`${Z}${q}`;if(J.length>F)J=J.slice(1),$=`${BigInt($)+1n}`;J=J.slice(0,F)}else J=J.padEnd(F,"0");return BigInt(`${Q?"-":""}${$}${J}`)}var JP=TD(aL(),1);import{extname as Ft}from"node:path";/*!
291
+ `),{docsPath:D,docsSlug:"account",name:"AccountNotFoundError"})}}class t2 extends P{constructor({docsPath:D,metaMessages:F,type:$}){super(`Account type "${$}" is not supported.`,{docsPath:D,metaMessages:F,name:"AccountTypeNotSupportedError"})}}s();NQ();function P7({chain:D,currentChainId:F}){if(!D)throw new bB;if(F!==D.id)throw new fB({chain:D,currentChainId:F})}S8();rF();x8();var gK=new G2(128);async function BF(D,F){let{account:$=D.account,assertChainId:J=!0,chain:Q=D.chain,accessList:Z,authorizationList:X,blobs:Y,data:q,dataSuffix:G=typeof D.dataSuffix==="string"?D.dataSuffix:D.dataSuffix?.value,gas:B,gasPrice:W,maxFeePerBlobGas:K,maxFeePerGas:U,maxPriorityFeePerGas:V,nonce:H,type:z,value:_,...O}=F;if(typeof $>"u")throw new V0({docsPath:"/docs/actions/wallet/sendTransaction"});let C=$?i($):null;try{X0(F);let M=await(async()=>{if(F.to)return F.to;if(F.to===null)return;if(X&&X.length>0)return await JF({authorization:X[0]}).catch(()=>{throw new P("`to` is required. Could not infer from `authorizationList`.")});return})();if(C?.type==="json-rpc"||C===null){let E;if(Q!==null){if(E=await f(D,R0,"getChainId")({}),J)P7({currentChainId:E,chain:Q})}let A=D.chain?.formatters?.transactionRequest?.format,R=(A||Z0)({...t0(O,{format:A}),accessList:Z,account:C,authorizationList:X,blobs:Y,chainId:E,data:q?ID([q,G??"0x"]):q,gas:B,gasPrice:W,maxFeePerBlobGas:K,maxFeePerGas:U,maxPriorityFeePerGas:V,nonce:H,to:M,type:z,value:_},"sendTransaction"),T=gK.get(D.uid),N=T?"wallet_sendTransaction":"eth_sendTransaction";try{return await D.request({method:N,params:[R]},{retryCount:0})}catch(j){if(T===!1)throw j;let L=j;if(L.name==="InvalidInputRpcError"||L.name==="InvalidParamsRpcError"||L.name==="MethodNotFoundRpcError"||L.name==="MethodNotSupportedRpcError")return await D.request({method:"wallet_sendTransaction",params:[R]},{retryCount:0}).then((y)=>{return gK.set(D.uid,!0),y}).catch((y)=>{let m=y;if(m.name==="MethodNotFoundRpcError"||m.name==="MethodNotSupportedRpcError")throw gK.set(D.uid,!1),L;throw m});throw L}}if(C?.type==="local"){let E=await f(D,y8,"prepareTransactionRequest")({account:C,accessList:Z,authorizationList:X,blobs:Y,chain:Q,data:q?ID([q,G??"0x"]):q,gas:B,gasPrice:W,maxFeePerBlobGas:K,maxFeePerGas:U,maxPriorityFeePerGas:V,nonce:H,nonceManager:C.nonceManager,parameters:[...b4,"sidecars"],type:z,value:_,...O,to:M}),A=Q?.serializers?.transaction,I=await C.signTransaction(E,{serializer:A});return await f(D,T7,"sendRawTransaction")({serializedTransaction:I})}if(C?.type==="smart")throw new t2({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"});throw new t2({docsPath:"/docs/actions/wallet/sendTransaction",type:C?.type})}catch(M){if(M instanceof t2)throw M;throw QF(M,{...F,account:C,chain:F.chain||void 0})}}function wL(D,F){let{abi:$,args:J,bytecode:Q,...Z}=F,X=q3({abi:$,args:J,bytecode:Q});return BF(D,{...Z,...Z.authorizationList?{to:null}:{},data:X})}Z1();async function NL(D){if(D.account?.type==="local")return[D.account.address];return(await D.request({method:"eth_accounts"},{dedupe:!0})).map(($)=>O8($))}sF();D0();s();F7();a0();D0();c();var mK="0x5792579257925792579257925792579257925792579257925792579257925792",dK=k(0,{size:32});async function xZ(D,F){let{account:$=D.account,chain:J=D.chain,experimental_fallback:Q,experimental_fallbackDelay:Z=32,forceAtomic:X=!1,id:Y,version:q="2.0.0"}=F,G=$?i($):null,B=F.capabilities;if(D.dataSuffix&&!F.capabilities?.dataSuffix)if(typeof D.dataSuffix==="string")B={...F.capabilities,dataSuffix:{value:D.dataSuffix,optional:!0}};else B={...F.capabilities,dataSuffix:{value:D.dataSuffix.value,...D.dataSuffix.required?{}:{optional:!0}}};let W=F.calls.map((K)=>{let U=K,V=U.abi?ED({abi:U.abi,functionName:U.functionName,args:U.args}):U.data;return{data:U.dataSuffix&&V?ID([V,U.dataSuffix]):V,to:U.to,value:U.value?k(U.value):void 0}});try{let K=await D.request({method:"wallet_sendCalls",params:[{atomicRequired:X,calls:W,capabilities:B,chainId:k(J.id),from:G?.address,id:Y,version:q}]},{retryCount:0});if(typeof K==="string")return{id:K};return K}catch(K){let U=K;if(Q&&(U.name==="MethodNotFoundRpcError"||U.name==="MethodNotSupportedRpcError"||U.name==="UnknownRpcError"||U.details.toLowerCase().includes("does not exist / is not available")||U.details.toLowerCase().includes("missing or invalid. request()")||U.details.toLowerCase().includes("did not match any variant of untagged enum")||U.details.toLowerCase().includes("account upgraded to unsupported contract")||U.details.toLowerCase().includes("eip-7702 not supported")||U.details.toLowerCase().includes("unsupported wc_ method")||U.details.toLowerCase().includes("feature toggled misconfigured")||U.details.toLowerCase().includes("jsonrpcengine: response has no error or result for request"))){if(B){if(Object.values(B).some((O)=>!O.optional))throw new n1(new P("non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`.",{details:"non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`."}))}if(X&&W.length>1)throw new i1(new P("`forceAtomic` is not supported on fallback to `eth_sendTransaction`.",{details:"`forceAtomic` is not supported on fallback to `eth_sendTransaction`."}));let V=[];for(let _ of W){let O=BF(D,{account:G,chain:J,data:_.data,to:_.to,value:_.value?fD(_.value):void 0});if(V.push(O),Z>0)await new Promise((C)=>setTimeout(C,Z))}let H=await Promise.allSettled(V);if(H.every((_)=>_.status==="rejected"))throw H[0].reason;let z=H.map((_)=>{if(_.status==="fulfilled")return _.value;return dK});return{id:ID([...z,k(J.id,{size:32}),mK])}}throw QF(K,{...F,account:G,chain:F.chain})}}async function kZ(D,F){async function $(B){if(B.endsWith(mK.slice(2))){let K=q2(OQ(B,-64,-32)),U=OQ(B,0,-64).slice(2).match(/.{1,64}/g),V=await Promise.all(U.map((z)=>dK.slice(2)!==z?D.request({method:"eth_getTransactionReceipt",params:[`0x${z}`]},{dedupe:!0}):void 0)),H=(()=>{if(V.some((z)=>z===null))return 100;if(V.every((z)=>z?.status==="0x1"))return 200;if(V.every((z)=>z?.status==="0x0"))return 500;return 600})();return{atomic:!1,chainId:MD(K),receipts:V.filter(Boolean),status:H,version:"2.0.0"}}return D.request({method:"wallet_getCallsStatus",params:[B]})}let{atomic:J=!1,chainId:Q,receipts:Z,version:X="2.0.0",...Y}=await $(F.id),[q,G]=(()=>{let B=Y.status;if(B>=100&&B<200)return["pending",B];if(B>=200&&B<300)return["success",B];if(B>=300&&B<700)return["failure",B];if(B==="CONFIRMED")return["success",200];if(B==="PENDING")return["pending",100];return[void 0,B]})();return{...Y,atomic:J,chainId:Q?MD(Q):void 0,receipts:Z?.map((B)=>({...B,blockNumber:fD(B.blockNumber),gasUsed:fD(B.gasUsed),status:qK[B.status]}))??[],statusCode:G,status:q,version:X}}c();async function TL(D,F={}){let{account:$=D.account,chainId:J}=F,Q=$?i($):void 0,Z=J?[Q?.address,[k(J)]]:[Q?.address],X=await D.request({method:"wallet_getCapabilities",params:Z}),Y={};for(let[q,G]of Object.entries(X)){Y[Number(q)]={};for(let[B,W]of Object.entries(G)){if(B==="addSubAccount")B="unstable_addSubAccount";Y[Number(q)][B]=W}}return typeof J==="number"?Y[J]:Y}async function LL(D){return await D.request({method:"wallet_getPermissions"},{dedupe:!0})}K3();async function yZ(D,F){let{account:$=D.account,chainId:J,nonce:Q}=F;if(!$)throw new V0({docsPath:"/docs/eip7702/prepareAuthorization"});let Z=i($),X=(()=>{if(!F.executor)return;if(F.executor==="self")return F.executor;return i(F.executor)})(),Y={address:F.contractAddress??F.address,chainId:J,nonce:Q};if(typeof Y.chainId>"u")Y.chainId=D.chain?.id??await f(D,R0,"getChainId")({});if(typeof Y.nonce>"u"){if(Y.nonce=await f(D,_7,"getTransactionCount")({address:Z.address,blockTag:"pending"}),X==="self"||X?.address&&I2(X.address,Z.address))Y.nonce+=1}return Y}Z1();async function PL(D){return(await D.request({method:"eth_requestAccounts"},{dedupe:!0,retryCount:0})).map(($)=>AD($))}async function jL(D,F){return D.request({method:"wallet_requestPermissions",params:[F]},{retryCount:0})}s();s();class pK extends P{constructor(D){super(`Call bundle failed with status: ${D.statusCode}`,{name:"BundleFailedError"});Object.defineProperty(this,"result",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.result=D}}async function fZ(D,F){let{id:$,pollingInterval:J=D.pollingInterval,status:Q=({statusCode:H})=>H===200||H>=300,retryCount:Z=4,retryDelay:X=({count:H})=>~~(1<<H)*200,timeout:Y=60000,throwOnFailure:q=!1}=F,G=qD(["waitForCallsStatus",D.uid,$]),{promise:B,resolve:W,reject:K}=K7(),U,V=I0(G,{resolve:W,reject:K},(H)=>{let z=N2(async()=>{let _=(O)=>{clearTimeout(U),z(),O(),V()};try{let O=await I3(async()=>{let C=await f(D,kZ,"getCallsStatus")({id:$});if(q&&C.status==="failure")throw new pK(C);return C},{retryCount:Z,delay:X});if(!Q(O))return;_(()=>H.resolve(O))}catch(O){_(()=>H.reject(O))}},{interval:J,emitOnBegin:!0});return z});return U=Y?setTimeout(()=>{V(),clearTimeout(U),K(new SL({id:$}))},Y):void 0,await B}class SL extends P{constructor({id:D}){super(`Timed out while waiting for call bundle with id "${D}" to be confirmed.`,{name:"WaitForCallsStatusTimeoutError"})}}async function xL(D,F){let{chain:$=D.chain}=F,J=F.timeout??Math.max(($?.blockTime??0)*3,5000),Q=await f(D,xZ,"sendCalls")(F);return await f(D,fZ,"waitForCallsStatus")({...F,id:Q.id,timeout:J})}s();w8();S8();rF();x8();var lK=new G2(128);async function bZ(D,F){let{account:$=D.account,assertChainId:J=!0,chain:Q=D.chain,accessList:Z,authorizationList:X,blobs:Y,data:q,dataSuffix:G=typeof D.dataSuffix==="string"?D.dataSuffix:D.dataSuffix?.value,gas:B,gasPrice:W,maxFeePerBlobGas:K,maxFeePerGas:U,maxPriorityFeePerGas:V,nonce:H,pollingInterval:z,throwOnReceiptRevert:_,type:O,value:C,...M}=F,E=F.timeout??Math.max((Q?.blockTime??0)*3,5000);if(typeof $>"u")throw new V0({docsPath:"/docs/actions/wallet/sendTransactionSync"});let A=$?i($):null;try{X0(F);let I=await(async()=>{if(F.to)return F.to;if(F.to===null)return;if(X&&X.length>0)return await JF({authorization:X[0]}).catch(()=>{throw new P("`to` is required. Could not infer from `authorizationList`.")});return})();if(A?.type==="json-rpc"||A===null){let R;if(Q!==null){if(R=await f(D,R0,"getChainId")({}),J)P7({currentChainId:R,chain:Q})}let T=D.chain?.formatters?.transactionRequest?.format,j=(T||Z0)({...t0(M,{format:T}),accessList:Z,account:A,authorizationList:X,blobs:Y,chainId:R,data:q?ID([q,G??"0x"]):q,gas:B,gasPrice:W,maxFeePerBlobGas:K,maxFeePerGas:U,maxPriorityFeePerGas:V,nonce:H,to:I,type:O,value:C},"sendTransaction"),L=lK.get(D.uid),y=L?"wallet_sendTransaction":"eth_sendTransaction",m=await(async()=>{try{return await D.request({method:y,params:[j]},{retryCount:0})}catch(h){if(L===!1)throw h;let g=h;if(g.name==="InvalidInputRpcError"||g.name==="InvalidParamsRpcError"||g.name==="MethodNotFoundRpcError"||g.name==="MethodNotSupportedRpcError")return await D.request({method:"wallet_sendTransaction",params:[j]},{retryCount:0}).then((b)=>{return lK.set(D.uid,!0),b}).catch((b)=>{let u=b;if(u.name==="MethodNotFoundRpcError"||u.name==="MethodNotSupportedRpcError")throw lK.set(D.uid,!1),g;throw u});throw g}})(),S=await f(D,SZ,"waitForTransactionReceipt")({checkReplacement:!1,hash:m,pollingInterval:z,timeout:E});if(_&&S.status==="reverted")throw new B4({receipt:S});return S}if(A?.type==="local"){let R=await f(D,y8,"prepareTransactionRequest")({account:A,accessList:Z,authorizationList:X,blobs:Y,chain:Q,data:q?ID([q,G??"0x"]):q,gas:B,gasPrice:W,maxFeePerBlobGas:K,maxFeePerGas:U,maxPriorityFeePerGas:V,nonce:H,nonceManager:A.nonceManager,parameters:[...b4,"sidecars"],type:O,value:C,...M,to:I}),T=Q?.serializers?.transaction,N=await A.signTransaction(R,{serializer:T});return await f(D,L7,"sendRawTransactionSync")({serializedTransaction:N,throwOnReceiptRevert:_,timeout:F.timeout})}if(A?.type==="smart")throw new t2({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"});throw new t2({docsPath:"/docs/actions/wallet/sendTransactionSync",type:A?.type})}catch(I){if(I instanceof t2)throw I;throw QF(I,{...F,account:A,chain:F.chain||void 0})}}async function kL(D,F){let{id:$}=F;await D.request({method:"wallet_showCallsStatus",params:[$]});return}async function yL(D,F){let{account:$=D.account}=F;if(!$)throw new V0({docsPath:"/docs/eip7702/signAuthorization"});let J=i($);if(!J.signAuthorization)throw new t2({docsPath:"/docs/eip7702/signAuthorization",metaMessages:["The `signAuthorization` Action does not support JSON-RPC Accounts."],type:J.type});let Q=await yZ(D,F);return J.signAuthorization(Q)}c();async function fL(D,{account:F=D.account,message:$}){if(!F)throw new V0({docsPath:"/docs/actions/wallet/signMessage"});let J=i(F);if(J.signMessage)return J.signMessage({message:$});let Q=(()=>{if(typeof $==="string")return F0($);if($.raw instanceof Uint8Array)return nD($.raw);return $.raw})();return D.request({method:"personal_sign",params:[Q,J.address]},{retryCount:0})}c();S8();x8();async function bL(D,F){let{account:$=D.account,chain:J=D.chain,...Q}=F;if(!$)throw new V0({docsPath:"/docs/actions/wallet/signTransaction"});let Z=i($);X0({account:Z,...F});let X=await f(D,R0,"getChainId")({});if(J!==null)P7({currentChainId:X,chain:J});let q=(J?.formatters||D.chain?.formatters)?.transactionRequest?.format||Z0;if(Z.signTransaction)return Z.signTransaction({...Q,chainId:X},{serializer:D.chain?.serializers?.transaction});return await D.request({method:"eth_signTransaction",params:[{...q({...Q,account:Z},"signTransaction"),chainId:k(X),from:Z.address}]},{retryCount:0})}async function vL(D,F){let{account:$=D.account,domain:J,message:Q,primaryType:Z}=F;if(!$)throw new V0({docsPath:"/docs/actions/wallet/signTypedData"});let X=i($),Y={EIP712Domain:PZ({domain:J}),...F.types};if(LZ({domain:J,message:Q,primaryType:Z,types:Y}),X.signTypedData)return X.signTypedData({domain:J,message:Q,primaryType:Z,types:Y});let q=xT({domain:J,message:Q,primaryType:Z,types:Y});return D.request({method:"eth_signTypedData_v4",params:[X.address,q]},{retryCount:0})}c();async function hL(D,{id:F}){await D.request({method:"wallet_switchEthereumChain",params:[{chainId:k(F)}]},{retryCount:0})}async function uL(D,F){return await D.request({method:"wallet_watchAsset",params:F},{retryCount:0})}a0();async function w3(D,F){return w3.internal(D,BF,"sendTransaction",F)}(function(D){async function F($,J,Q,Z){let{abi:X,account:Y=$.account,address:q,args:G,functionName:B,...W}=Z;if(typeof Y>"u")throw new V0({docsPath:"/docs/contract/writeContract"});let K=Y?i(Y):null,U=ED({abi:X,args:G,functionName:B});try{return await f($,J,Q)({data:U,to:q,account:K,...W})}catch(V){throw B2(V,{abi:X,address:q,args:G,docsPath:"/docs/contract/writeContract",functionName:B,sender:K?.address})}}D.internal=F})(w3||(w3={}));async function gL(D,F){return w3.internal(D,bZ,"sendTransactionSync",F)}function cK(D){return{addChain:(F)=>IL(D,F),deployContract:(F)=>wL(D,F),fillTransaction:(F)=>M7(D,F),getAddresses:()=>NL(D),getCallsStatus:(F)=>kZ(D,F),getCapabilities:(F)=>TL(D,F),getChainId:()=>R0(D),getPermissions:()=>LL(D),prepareAuthorization:(F)=>yZ(D,F),prepareTransactionRequest:(F)=>y8(D,F),requestAddresses:()=>PL(D),requestPermissions:(F)=>jL(D,F),sendCalls:(F)=>xZ(D,F),sendCallsSync:(F)=>xL(D,F),sendRawTransaction:(F)=>T7(D,F),sendRawTransactionSync:(F)=>L7(D,F),sendTransaction:(F)=>BF(D,F),sendTransactionSync:(F)=>bZ(D,F),showCallsStatus:(F)=>kL(D,F),signAuthorization:(F)=>yL(D,F),signMessage:(F)=>fL(D,F),signTransaction:(F)=>bL(D,F),signTypedData:(F)=>vL(D,F),switchChain:(F)=>hL(D,F),waitForCallsStatus:(F)=>fZ(D,F),watchAsset:(F)=>uL(D,F),writeContract:(F)=>w3(D,F),writeContractSync:(F)=>gL(D,F)}}$3();s();class nK extends P{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}EW();$3();function mL(D,{errorInstance:F=Error("timed out"),timeout:$,signal:J}){return new Promise((Q,Z)=>{(async()=>{let X;try{let Y=new AbortController;if($>0)X=setTimeout(()=>{if(J)Y.abort();else Z(F)},$);Q(await D({signal:Y?.signal||null}))}catch(Y){if(Y?.name==="AbortError")Z(F);Z(Y)}finally{clearTimeout(X)}})()})}function hs(){return{current:0,take(){return this.current++},reset(){this.current=0}}}var iK=hs();function dL(D,F={}){let{url:$,headers:J}=us(D);return{async request(Q){let{body:Z,fetchFn:X=F.fetchFn??fetch,onRequest:Y=F.onRequest,onResponse:q=F.onResponse,timeout:G=F.timeout??1e4}=Q,B={...F.fetchOptions??{},...Q.fetchOptions??{}},{headers:W,method:K,signal:U}=B;try{let V=await mL(async({signal:z})=>{let _={...B,body:Array.isArray(Z)?qD(Z.map((E)=>({jsonrpc:"2.0",id:E.id??iK.take(),...E}))):qD({jsonrpc:"2.0",id:Z.id??iK.take(),...Z}),headers:{...J,"Content-Type":"application/json",...W},method:K||"POST",signal:U||(G>0?z:null)},O=new Request($,_),C=await Y?.(O,_)??{..._,url:$};return await X(C.url??$,C)},{errorInstance:new yQ({body:Z,url:$}),timeout:G,signal:!0});if(q)await q(V);let H;if(V.headers.get("Content-Type")?.startsWith("application/json"))H=await V.json();else{H=await V.text();try{H=JSON.parse(H||"{}")}catch(z){if(V.ok)throw z;H={error:H}}}if(!V.ok)throw new o2({body:Z,details:qD(H.error)||V.statusText,headers:V.headers,status:V.status,url:$});return H}catch(V){if(V instanceof o2)throw V;if(V instanceof yQ)throw V;throw new o2({body:Z,cause:V,url:$})}}}}function us(D){try{let F=new URL(D),$=(()=>{if(F.username){let J=`${decodeURIComponent(F.username)}:${decodeURIComponent(F.password)}`;return F.username="",F.password="",{url:F.toString(),headers:{Authorization:`Basic ${btoa(J)}`}}}return})();return{url:F.toString(),...$}}catch{return{url:D}}}s();$3();F7();c();rF();var vZ=new G2(8192);function pL(D,{enabled:F=!0,id:$}){if(!F||!$)return D();if(vZ.get($))return vZ.get($);let J=D().finally(()=>vZ.delete($));return vZ.set($,J),J}function lL(D,F={}){return async($,J={})=>{let{dedupe:Q=!1,methods:Z,retryDelay:X=150,retryCount:Y=3,uid:q}={...F,...J},{method:G}=$;if(Z?.exclude?.includes(G))throw new c1(Error("method not supported"),{method:G});if(Z?.include&&!Z.include.includes(G))throw new c1(Error("method not supported"),{method:G});let B=Q?F0(`${q}.${qD($)}`):void 0;return pL(()=>I3(async()=>{try{return await D($)}catch(W){let K=W;switch(K.code){case b6.code:throw new b6(K);case v6.code:throw new v6(K);case h6.code:throw new h6(K,{method:$.method});case u6.code:throw new u6(K);case B1.code:throw new B1(K);case R2.code:throw new R2(K);case g6.code:throw new g6(K);case m6.code:throw new m6(K);case d6.code:throw new d6(K);case c1.code:throw new c1(K,{method:$.method});case J3.code:throw new J3(K);case p6.code:throw new p6(K);case Q3.code:throw new Q3(K);case l6.code:throw new l6(K);case c6.code:throw new c6(K);case n6.code:throw new n6(K);case i6.code:throw new i6(K);case o6.code:throw new o6(K);case n1.code:throw new n1(K);case a6.code:throw new a6(K);case r6.code:throw new r6(K);case s6.code:throw new s6(K);case t6.code:throw new t6(K);case e6.code:throw new e6(K);case i1.code:throw new i1(K);case 5000:throw new Q3(K);case D7.code:throw new D7(K);default:if(W instanceof P)throw W;throw new rB(K)}}},{delay:({count:W,error:K})=>{if(K&&K instanceof o2){let U=K?.headers?.get("Retry-After");if(U?.match(/\d/))return Number.parseInt(U,10)*1000}return~~(1<<W)*X},retryCount:Y,shouldRetry:({error:W})=>gs(W)}),{enabled:Q,id:B})}}function gs(D){if("code"in D&&typeof D.code==="number"){if(D.code===-1)return!0;if(D.code===J3.code)return!0;if(D.code===B1.code)return!0;return!1}if(D instanceof o2&&D.status){if(D.status===403)return!0;if(D.status===408)return!0;if(D.status===413)return!0;if(D.status===429)return!0;if(D.status===500)return!0;if(D.status===502)return!0;if(D.status===503)return!0;if(D.status===504)return!0;return!1}return!0}function cL({key:D,methods:F,name:$,request:J,retryCount:Q=3,retryDelay:Z=150,timeout:X,type:Y},q){let G=eJ();return{config:{key:D,methods:F,name:$,request:J,retryCount:Q,retryDelay:Z,timeout:X,type:Y},request:lL(J,{methods:F,retryCount:Q,retryDelay:Z,uid:G}),value:q}}function N3(D,F={}){let{batch:$,fetchFn:J,fetchOptions:Q,key:Z="http",methods:X,name:Y="HTTP JSON-RPC",onFetchRequest:q,onFetchResponse:G,retryDelay:B,raw:W}=F;return({chain:K,retryCount:U,timeout:V})=>{let{batchSize:H=1000,wait:z=0}=typeof $==="object"?$:{},_=F.retryCount??U,O=V??F.timeout??1e4,C=D||K?.rpcUrls.default.http[0];if(!C)throw new nK;let M=dL(C,{fetchFn:J,fetchOptions:Q,onRequest:q,onResponse:G,timeout:O});return cL({key:Z,methods:X,name:Y,async request({method:E,params:A}){let I={method:E,params:A},{schedule:R}=nQ({id:C,wait:z,shouldSplitBatch(L){return L.length>H},fn:(L)=>M.request({body:L}),sort:(L,y)=>L.id-y.id}),T=async(L)=>$?R(L):[await M.request({body:L})],[{error:N,result:j}]=await T(I);if(W)return{error:N,result:j};if(N)throw new F3({body:I,error:N,url:C});return j},retryCount:_,retryDelay:B,timeout:O,type:"http"},{fetchOptions:Q,url:C})}}z8();s();q1();A8();gD();m1();n2();F4();c();RQ();function a4(D,F){if(D.length!==F.length)throw new r9({expectedLength:D.length,givenLength:F.length});let $=[];for(let J=0;J<D.length;J++){let Q=D[J],Z=F[J];$.push(nL(Q,Z))}return i0($)}function nL(D,F,$=!1){if(D==="address"){let X=F;if(!t(X))throw new B0({address:X});return M2(X.toLowerCase(),{size:$?32:null})}if(D==="string")return F0(F);if(D==="bytes")return F;if(D==="bool")return M2(cF(F),{size:$?32:1});let J=D.match(N6);if(J){let[X,Y,q="256"]=J,G=Number.parseInt(q,10)/8;return k(F,{size:$?32:G,signed:Y==="int"})}let Q=D.match(EQ);if(Q){let[X,Y]=Q;if(Number.parseInt(Y,10)!==(F.length-2)/2)throw new e9({expectedSize:Number.parseInt(Y,10),givenSize:(F.length-2)/2});return M2(F,{dir:"right",size:$?32:null})}let Z=D.match(nA);if(Z&&Array.isArray(F)){let[X,Y]=Z,q=[];for(let G=0;G<F.length;G++)q.push(nL(Y,F[G],!0));if(q.length===0)return"0x";return i0(q)}throw new CB(D)}Z1();n2();function r4(D){let F={formatters:void 0,fees:void 0,serializers:void 0,...D};function $(J){return(Q)=>{let Z=typeof Q==="function"?Q(J):Q,X={...J,...Z};return Object.assign(X,{extend:$(X)})}}return Object.assign(F,{extend:$(F)})}D0();c();_2();function oK(D){return DD(D)&&GD(D)===32}s();class aK extends P{constructor({value:D}){super(`Number \`${D}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function T3(D,F){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(D))throw new aK({value:D});let[$,J="0"]=D.split("."),Q=$.startsWith("-");if(Q)$=$.slice(1);if(J=J.replace(/(0+)$/,""),F===0){if(Math.round(Number(`.${J}`))===1)$=`${BigInt($)+1n}`;J=""}else if(J.length>F){let[Z,X,Y]=[J.slice(0,F-1),J.slice(F-1,F),J.slice(F)],q=Math.round(Number(`${X}.${Y}`));if(q>9)J=`${BigInt(Z)+BigInt(1)}0`.padStart(Z.length+1,"0");else J=`${Z}${q}`;if(J.length>F)J=J.slice(1),$=`${BigInt($)+1n}`;J=J.slice(0,F)}else J=J.padEnd(F,"0");return BigInt(`${Q?"-":""}${$}${J}`)}var JP=TD(aL(),1);import{extname as Ft}from"node:path";/*!
292
292
  * Copyright (c) Squirrel Chat et al., All rights reserved.
293
293
  * SPDX-License-Identifier: BSD-3-Clause
294
294
  *
@@ -617,7 +617,7 @@ ${Q}`,F);this.line=$,this.column=J,this.codeblock=Q}}/*!
617
617
  explorer:
618
618
  loadBalancer:
619
619
  servers:
620
- - url: "http://explorer:3000"`}},ex=(D)=>({configs:{explorer_api_proxy:D4D(),explorer_proxy:J4D()},services:{explorer_api:e9D(D),explorer:$4D(D),squid_processor:F4D(D),proxy:{configs:[{source:"explorer_proxy",target:"/etc/traefik/conf.d/explorer.yaml"},{source:"explorer_api_proxy",target:"/etc/traefik/conf.d/explorer-api.yaml"}]}}});var Q4D=(D)=>{let F=D.databasePassword,$=D.databaseHost??"database",J=D.databasePort??5432,Q=D.defaultBlock??"latest",Z=D.imageTag??"latest",X=D.logLevel??"info",Y=D.mnemonic??"test test test test test test test test test test test junk",q=D.forkChainId??31337,G=D5[q];if(!G)throw Error(`Unsupported fork chain ${q}`);return{image:`cartesi/rollups-runtime:${Z}`,init:!0,depends_on:{database:{condition:"service_healthy"},anvil:{condition:"service_healthy"}},deploy:{resources:{limits:{cpus:D.cpus!==void 0?D.cpus.toString():void 0,memory:D.memory!==void 0?`${D.memory.toString()}M`:void 0}}},expose:["10000","10011","10012"],healthcheck:{...N0,test:["CMD","curl","-fsS","http://127.0.0.1:10000/livez"]},command:["cartesi-rollups-node"],environment:{CARTESI_AUTH_MNEMONIC:Y,CARTESI_BLOCKCHAIN_DEFAULT_BLOCK:Q,CARTESI_BLOCKCHAIN_HTTP_ENDPOINT:"http://anvil:8545",CARTESI_BLOCKCHAIN_ID:v3.id.toString(),CARTESI_BLOCKCHAIN_WS_ENDPOINT:"ws://anvil:8545",CARTESI_CONTRACTS_DAVE_APP_FACTORY_ADDRESS:G,CARTESI_CONTRACTS_INPUT_BOX_ADDRESS:v7,CARTESI_CONTRACTS_SELF_HOSTED_APPLICATION_FACTORY_ADDRESS:nZ,CARTESI_DATABASE_CONNECTION:`postgres://postgres:${F}@${$}:${J}/rollupsdb?sslmode=disable`,CARTESI_LOG_LEVEL:X,CARTESI_SNAPSHOTS_DIR:"/var/lib/cartesi-rollups-node/snapshots"},volumes:["./.cartesi:/var/lib/cartesi-rollups-node/snapshots:ro"]}},Z4D=()=>{return{name:"rollups-node-proxy",content:`
620
+ - url: "http://explorer:3000"`}},ex=(D)=>({configs:{explorer_api_proxy:D4D(),explorer_proxy:J4D()},services:{explorer_api:e9D(D),explorer:$4D(D),squid_processor:F4D(D),proxy:{configs:[{source:"explorer_proxy",target:"/etc/traefik/conf.d/explorer.yaml"},{source:"explorer_api_proxy",target:"/etc/traefik/conf.d/explorer-api.yaml"}]}}});var Q4D=(D)=>{let F=D.databasePassword,$=D.databaseHost??"database",J=D.databasePort??5432,Q=D.defaultBlock??"latest",Z=D.imageTag??"latest",X=D.logLevel??"info",Y=D.mnemonic??"test test test test test test test test test test test junk",q=D.prt??!1,G=D.forkChainId??31337,B;if(q){if(B=D5[G],!B)throw Error(`Unsupported fork chain ${G}`)}return{image:`cartesi/rollups-runtime:${Z}`,init:!0,depends_on:{database:{condition:"service_healthy"},anvil:{condition:"service_healthy"}},deploy:{resources:{limits:{cpus:D.cpus!==void 0?D.cpus.toString():void 0,memory:D.memory!==void 0?`${D.memory.toString()}M`:void 0}}},expose:["10000","10011","10012"],healthcheck:{...N0,test:["CMD","curl","-fsS","http://127.0.0.1:10000/livez"]},command:["cartesi-rollups-node"],environment:{CARTESI_AUTH_MNEMONIC:Y,CARTESI_BLOCKCHAIN_DEFAULT_BLOCK:Q,CARTESI_BLOCKCHAIN_HTTP_ENDPOINT:"http://anvil:8545",CARTESI_BLOCKCHAIN_ID:v3.id.toString(),CARTESI_BLOCKCHAIN_WS_ENDPOINT:"ws://anvil:8545",...B&&{CARTESI_CONTRACTS_DAVE_APP_FACTORY_ADDRESS:B},CARTESI_CONTRACTS_INPUT_BOX_ADDRESS:v7,CARTESI_CONTRACTS_SELF_HOSTED_APPLICATION_FACTORY_ADDRESS:nZ,CARTESI_DATABASE_CONNECTION:`postgres://postgres:${F}@${$}:${J}/rollupsdb?sslmode=disable`,CARTESI_LOG_LEVEL:X,CARTESI_SNAPSHOTS_DIR:"/var/lib/cartesi-rollups-node/snapshots"},volumes:["./.cartesi:/var/lib/cartesi-rollups-node/snapshots:ro"]}},Z4D=()=>{return{name:"rollups-node-proxy",content:`
621
621
  http:
622
622
  routers:
623
623
  inspect_server:
@@ -667,13 +667,13 @@ http:
667
667
  paymaster:
668
668
  loadBalancer:
669
669
  servers:
670
- - url: "http://paymaster:3000"`}},$k=(D)=>({configs:{paymaster_proxy:G4D()},services:{paymaster:q4D(D),proxy:{configs:[{source:"paymaster_proxy",target:"/etc/traefik/conf.d/paymaster.yaml"}]}}});var B4D=(D)=>{let F=D.imageTag??"latest",$=D.port??6751;return{image:`traefik:${F}`,healthcheck:{...N0,test:["CMD","traefik","healthcheck","--ping"]},command:["--ping=true","--entryPoints.web.address=:8088","--entryPoints.traefik.address=:8080","--metrics.prometheus=true","--metrics.prometheus.addServicesLabels=true","--providers.file.directory=/etc/traefik/conf.d","--providers.file.watch=true","--log","--log.level=INFO"],ports:[`${$}:8088`]}},Jk=(D)=>({services:{proxy:B4D(D)}});var Qk=(D)=>({address:D.iapplication_address,consensus:D.iconsensus_address,epochLength:MD(D.epoch_length),name:D.name,state:D.state,templateHash:D.template_hash}),sV=async(D)=>{try{let{stdout:F}=await wD("docker",["compose","--project-name",D.projectName,"exec","rollups_node","cartesi-rollups-cli","app","list"]);return JSON.parse(F).map(Qk)}catch{return[]}},W4D=async(D)=>{let F=h3();if(!F)return;return(await sV(D)).find((J)=>J.templateHash===F)},FY=async(D)=>{let F=yD(D??{});return(await W4D({projectName:F}))?.address},Zk=async(D)=>{let F=yD(D??{});try{let J=(await V4D({projectName:F}))?.forkConfig?.forkUrl;if(J)return o4({transport:N3(J)}).getChainId()}catch{return}return},A1="http://127.0.0.1",K4D=[{name:"anvil",healthySemaphore:"anvil",healthyTitle:(D)=>`${v.cyan("anvil")} service ready at ${v.cyan(`${A1}:${D}/anvil`)}`,waitTitle:`${v.cyan("anvil")} service starting...`,errorTitle:`${v.red("anvil")} service failed`},{name:"proxy"},{name:"database"},{name:"rpc",healthySemaphore:"rollups_node",healthyTitle:(D)=>`${v.cyan("rpc")} service ready at ${v.cyan(`${A1}:${D}/rpc`)}`,waitTitle:`${v.cyan("rpc")} service starting...`,errorTitle:`${v.red("rpc")} service failed`},{name:"inspect",healthySemaphore:"rollups_node",healthyTitle:(D,F)=>`${v.cyan("inspect")} service ready at ${v.cyan(`${A1}:${D}/inspect/${F??"<application_address>"}`)}`,waitTitle:`${v.cyan("inspect")} service starting...`,errorTitle:`${v.red("inspect")} service failed`}],rV=[{name:"bundler",healthySemaphore:"bundler",healthyTitle:(D)=>`${v.cyan("bundler")} service ready at ${v.cyan(`${A1}:${D}/bundler/rpc`)}`,waitTitle:`${v.cyan("bundler")} service starting...`,errorTitle:`${v.red("bundler")} service failed`},{name:"explorer",healthySemaphore:"explorer_api",healthyTitle:(D)=>`${v.cyan("explorer")} service ready at ${v.cyan(`${A1}:${D}/explorer`)}`,waitTitle:`${v.cyan("explorer")} service starting...`,errorTitle:`${v.red("explorer")} service failed`},{name:"paymaster",healthySemaphore:"paymaster",healthyTitle:(D)=>`${v.cyan("paymaster")} service ready at ${v.cyan(`${A1}:${D}/paymaster`)}`,waitTitle:`${v.cyan("paymaster")} service starting...`,errorTitle:`${v.red("paymaster")} service failed`},{name:"passkey",healthySemaphore:"passkey_server",healthyTitle:(D)=>`${v.cyan("passkey")} service ready at ${v.cyan(`${A1}:${D}/passkey`)}`,waitTitle:`${v.cyan("passkey")} service starting...`,errorTitle:`${v.red("passkey")} service failed`}],Xk=rV.map(({name:D})=>D),U4D=(D)=>{let{errorTitle:F,healthyTitle:$,service:J,waitTitle:Q}=D;return{task:async(Z,X)=>{await yU(async()=>{if(await Uk(D)!=="healthy")throw Error(F??`Service ${v.cyan(J)} is not healthy`)},{retries:100,minTimeout:500,factor:1.1}),X.title=$??`Service ${v.cyan(J)} is ready`},title:Q??`Starting ${v.cyan(J)}...`}},Yk=async(D)=>{let{blockTime:F,cpus:$,defaultBlock:J,detach:Q,dryRun:Z,forkConfig:X,memory:Y,port:q,projectName:G,runtimeVersion:B,services:W,verbose:K}=D,U={CARTESI_BLOCKCHAIN_DEFAULT_BLOCK:J,CARTESI_LISTEN_PORT:q.toString(),CARTESI_LOG_LEVEL:K?"debug":"info"},V="password",H=[ax({blockTime:F,forkConfig:X,imageTag:B}),tx({imageTag:B,password:"password"}),Dk({cpus:$,databasePassword:"password",defaultBlock:J,forkChainId:X?.chainId,imageTag:B,logLevel:K?"debug":"info",memory:Y}),Jk({imageTag:"v3.3.4",port:q})];if(W.includes("explorer"))H.push(ex({imageTag:"1.4.0",apiTag:"1.1.0",databasePassword:"password",port:q}));if(W.includes("bundler"))H.push(sx({imageTag:B}));if(W.includes("paymaster"))H.push($k({imageTag:B}));if(W.includes("passkey"))H.push(Fk({imageTag:B}));let z=["compose","-f","-","--project-directory","."],_=Q?["--detach"]:[],O=rx([{name:G},...H]);if(Z){let{stdout:M}=await wD("docker",[...z,"config","--format","yaml"],{env:U,input:DY(O,{lineWidth:0,indent:2})});return{config:M}}let C=wD("docker",[...z,"up",..._],{env:U,input:DY(O,{lineWidth:0,indent:2})});if(Q)await C;return{cmd:C}},qk=async(D)=>{let{name:F,port:$,projectName:J,services:Q}=D,Z=Q.length===1&&Q[0]==="all"?rV:rV.filter(({name:q})=>Q.includes(q)),X=[...K4D,...Z].filter(({healthySemaphore:q})=>!!q).map((q)=>{let G=typeof q.healthyTitle==="function"?q.healthyTitle($,F):q.healthyTitle;return U4D({projectName:J,service:q.healthySemaphore,errorTitle:q.errorTitle,waitTitle:q.waitTitle,healthyTitle:G})});await new o7(X,{concurrent:!0}).run()};var Gk=async(D)=>{let{projectName:F}=D;return wD("docker",["compose","--project-name",F,"down","--volumes"])};var Bk=async(D)=>{let{consensus:F,epochLength:$,name:J,projectName:Q,prt:Z,salt:X,snapshotPath:Y}=D,q=[J,Y];if(F)q.push("--consensus",F);else q.push("--epoch-length",$.toString());if(X)q.push("--salt",X);if(Z)q.push("--prt");q.push("--json");let{stdout:G}=await wD("docker",["compose","--project-name",Q,"exec","rollups_node","cartesi-rollups-cli","deploy","application",...q]),B=G?Qk(JSON.parse(G)):void 0;if(B)return B;throw Error("Failed to deploy application")},Wk=async(D)=>{let{application:F,force:$,projectName:J}=D;await wD("docker",["compose","--project-name",J,"exec","rollups_node","cartesi-rollups-cli","app","status",F,"disabled"]);let Q=[F];if($)Q.push("--force");return wD("docker",["compose","--project-name",J,"exec","rollups_node","cartesi-rollups-cli","app","remove",...Q])},Kk=async(D)=>{let{projectName:F}=D,{stdout:$}=await wD("docker",["compose","--project-name",F,"port","proxy","8088"]);return $},V4D=async(D)=>{let{projectName:F}=D,{stdout:$}=await wD("docker",["compose","--project-name",F,"exec","anvil","cast","rpc","anvil_nodeInfo"]);return JSON.parse($)};var I1=(...D)=>{return Vk.join(".cartesi",...D)},h3=()=>{let D=I1("image","hash");if($Y.existsSync(D)){let F=$Y.readFileSync(D).toString("hex");if(oK(`0x${F}`))return`0x${F}`}return},JY=(D)=>{let F=D.map(($)=>{if($Y.existsSync($))return $Y.readFileSync($).toString();if($==="cartesi.toml")return"";throw Error(`Config file ${$} does not exist`)});return WP(F)},yD=(D)=>{return D.projectName??Vk.basename(process.cwd())},Hk=async(D)=>{let F=await Zk(D),$=await FY(D),J=F!==void 0?D5[F]:D5[31337];if(!J)throw Error(`Unsupported fork chain ${F}`);let Q={EntryPointV06:"0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",EntryPointV07:"0x0000000071727De22E5E9d8BAf0edAc6f37da032",EntryPointV08:"0x4337084d9e255ff0702461cf8895ce9e3b5ff108",EntryPointV09:"0x433709009B8330FDa32311DF1C2AFA402eD8D009",LightAccountFactory:"0x00004EC70002a32400f8ae005A26081065620D20",SimpleAccountFactory:"0x9406Cc6185a346906296840746125a0E44976454",SmartAccountFactory:"0x000000a56Aaca3e9a4C479ea6b6CD0DbcB6634F5",KernelFactoryV2:"0x5de4839a76cf55d0c90e2061ef4386d962E15ae3",KernelFactoryV3:"0x6723b44Abeec4E71eBE3232BD5B455805baDD22f",KernelFactoryV3_1:"0xaac5D4240AF87249B3f71BC8E4A2cae074A3E419",VerifyingPaymasterV06:"0x28ec0633192d0cBd9E1156CE05D5FdACAcB93947",VerifyingPaymasterV07:"0xc5c97885C67F7361aBAfD2B95067a5bBdA603608"},Z={TestToken:oZ,TestNFT:F5,TestMultiToken:iZ},X={ApplicationFactory:UP,AuthorityFactory:VP,DaveAppFactory:J,ERC1155BatchPortal:k7,ERC1155SinglePortal:y7,ERC20Portal:f7,ERC721Portal:b7,EtherPortal:cZ,InputBox:v7,SelfHostedApplicationFactory:nZ},Y=F!==void 0?{...X,...Q}:{...X,...Z};if($)Y.Application=$;return Y},QY=async(D)=>{let{projectName:F,service:$}=D,{stdout:J}=await wD("docker",["compose","--project-name",F,"ps",$,"--format","json"]);return J?JSON.parse(J):void 0},zk=async(D)=>{return(await QY(D))?.State},Uk=async(D)=>{return(await QY(D))?.Health};var _k=()=>{return new ZD("address-book").description("Prints the addresses of all smart contracts deployed to the runtime environment of the application.").option("--json","Format output as json.").option("--project-name <string>","name of project (used by docker compose and cartesi-rollups-node)").action(async(D)=>{let{json:F}=D,$=yD(D),J=await Hk({projectName:$});if(!F){let Q=new Ck.default({head:["Contract","Address"],chars:{top:"","top-mid":"","top-left":"","top-right":"",bottom:"","bottom-mid":"","bottom-left":"","bottom-right":"",left:"","left-mid":"",mid:"","mid-mid":"",right:"","right-mid":"",middle:" "},style:{"padding-left":0,"padding-right":0}});Q.push(...Object.entries(J)),console.log(Q.toString())}else process.stdout.write(JSON.stringify(J))})};var bH=TD(m8(),1);var Tv=TD(Tf(),1);import Nv from"node:path";var fY=TD(m8(),1);import qXD from"node:path";var xY={};H2(xY,{version:()=>sZD,requiredVersion:()=>aZD,boot:()=>rZD});var SY=TD(D$(),1);import oZD from"node:os";var y2=async(D,F,$)=>{try{if($.forceDocker){let J=new Z2;throw J.code="ENOENT",J}return await wD(D,F,$)}catch(J){if(J instanceof Z2){if(J.code==="ENOENT"&&$.image){let Q=oZD.userInfo(),Z=["--volume",`${$.cwd}:/work`,"--workdir","/work","--interactive","--rm","--user",`${Q.uid}:${Q.gid}`];return await wD("docker",["run",...Z,$.image,D,...F],$)}}throw J}};var aZD=new SY.Range("^0.19.0"),rZD=(D,F)=>y2("cartesi-machine",D,F),sZD=async(D)=>{let{image:F}=D||{};try{let{stdout:$}=await y2("cartesi-machine",["--version-json"],{image:F});if(typeof $==="string"){let J=JSON.parse($);return SY.parse(J.version)}return null}catch{return null}};var l8={};H2(l8,{version:()=>$XD,requiredVersion:()=>tZD,fromTar:()=>FXD,fromDirectory:()=>DXD,empty:()=>eZD});var kY=TD(D$(),1);var F$=4096,tZD=new kY.Range("^1.5.6"),_v=(D)=>["--block-size",F$.toString(),"--faketime","--readjustment",`+${D.extraBlocks}`],eZD=(D)=>{let{size:F,output:$}=D,J=Math.ceil(F/F$);return y2("xgenext2fs",["--block-size",F$.toString(),"--faketime","--size-in-blocks",J.toString(),$],D)},DXD=(D)=>{let{cwd:F,extraSize:$,image:J,input:Q,output:Z}=D,X=Math.ceil($/F$);return y2("xgenext2fs",[..._v({extraBlocks:X}),"--root",Q,Z],{cwd:F,image:J})},FXD=(D)=>{let{cwd:F,extraSize:$,image:J,input:Q,output:Z}=D,X=Math.ceil($/F$);return y2("xgenext2fs",[..._v({extraBlocks:X}),"--tarball",Q,Z],{cwd:F,image:J})},$XD=async(D)=>{let{stdout:F}=await y2("xgenext2fs",["--version"],D||{});if(typeof F==="string"){let $=/(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?/,J=F.match($);if(J?.[0])return kY.parse(J[0])}return null};var PF={};H2(PF,{version:()=>YXD,requiredVersion:()=>QXD,fromTar:()=>XXD,fromDirectory:()=>ZXD});var yY=TD(D$(),1);var JXD="lzo",QXD=new yY.Range("^4.5.1"),Mv=()=>["-all-time","0","-mkfs-time","0","-all-root","-noappend","-comp",JXD,"-no-progress"],ZXD=(D)=>{let{cwd:F,image:$,input:J,output:Q}=D;return y2("mksquashfs",[J,Q,...Mv()],{cwd:F,image:$})},XXD=(D)=>{let{cwd:F,image:$,input:J,output:Q}=D;return y2("mksquashfs",["-",Q,"-tar",...Mv()],{cwd:F,image:$,inputFile:J})},YXD=async(D)=>{try{let{stdout:F}=await y2("mksquashfs",["-version"],D||{});if(typeof F==="string"){let $=/(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?/gm,J=F.match($);if(J?.[0])return yY.parse(J[0])}}catch(F){return console.error(F),null}return null};var SH=async(D,F,$,J,Q)=>{let Z=`${D}.${F.format}`,X=qXD.join(J,D);await fY.default.mkdirp(X),await fY.default.copy(F.directory,X);try{switch(F.format){case"ext2":{await l8.fromDirectory({extraSize:F.extraSize,input:D,output:Z,cwd:J,image:$});break}case"sqfs":{await PF.fromDirectory({input:D,output:Z,cwd:J,image:$});break}}}finally{if(!Q)await fY.default.remove(X)}};var Ev=TD(m8(),1);import bY from"node:path";var Ov=async(D)=>{let{buildArgs:F,context:$,destination:J,dockerfile:Q,dockerfileContent:Z,tags:X,target:Y}=D,q=["buildx","build","--platform","linux/riscv64","--file",Z?"-":Q,"--output","type=docker","--output",`type=tar,dest=${J}`,"--progress","quiet"];if(q.push(...X.flatMap((B)=>["--tag",B])),q.push(...F.flatMap((B)=>["--build-arg",B])),Y)q.push("--target",Y);q.push($);let{stdout:G}=await wD("docker",q,{input:Z});return G},GXD=async(D)=>{let{stdout:F}=await wD("docker",["image","inspect",D]),[$]=JSON.parse(F);if($.Architecture!=="riscv64")throw Error(`Invalid image Architecture: ${$.Architecture}. Expected riscv64`);return{cmd:$.Config.Cmd??[],entrypoint:$.Config.Entrypoint??[],env:$.Config.Env||[],workdir:$.Config.WorkingDir}},xH=async(D,F,$,J,Q)=>{let{format:Z}=F,X=`${D}.tar`,Y=`${D}.${Z}`,q;if(F.image)q=await Ov({...F,destination:bY.join(J,X),dockerfileContent:`FROM ${F.image}`});else q=await Ov({...F,destination:bY.join(J,X)});let G=await GXD(q);try{switch(Z){case"ext2":{await l8.fromTar({extraSize:F.extraSize,input:X,output:Y,cwd:J,image:$});break}case"sqfs":{await PF.fromTar({input:bY.join(J,X),output:Y,cwd:J,image:$});break}}}finally{if(!Q)await Ev.default.remove(bY.join(J,X))}return G};var Rv=TD(m8(),1);import BXD from"node:path";var kH=async(D,F,$,J)=>{let Q=`${D}.${F.format}`;switch(F.format){case"ext2":{await l8.empty({output:Q,size:F.size,cwd:J,image:$});break}case"raw":{await Rv.default.writeFile(BXD.join(J,Q),Buffer.alloc(F.size));break}}};var Av=TD(m8(),1);import WXD from"node:path";var yH=async(D,F,$)=>{let J=F.filename,Q=ZU(J),Z=WXD.join($,`${D}.${Q}`);await Av.default.copyFile(J,Z)};var wv=TD(m8(),1);import Iv from"node:path";var fH=async(D,F,$,J)=>{let Q=`${D}.tar`,Z=`${D}.${F.format}`;switch(await wv.default.copy(F.filename,Iv.join(J,Q)),F.format){case"ext2":{await l8.fromTar({extraSize:F.extraSize,input:Q,output:Z,cwd:J,image:$});break}case"sqfs":{await PF.fromTar({input:Iv.join(J,Q),output:Z,cwd:J,image:$});break}}};var KXD=(D,F)=>{let{format:$,mount:J,shared:Q,user:Z}=F,X=`${D}.${$}`,Y=[`label:${D}`,`filename:${X}`];if(J!==void 0)Y.push(`mount:${J}`);if(Z)Y.push(`user:${Z}`);if(Q)Y.push("shared");return`--flash-drive=${Y.join(",")}`},vY=(D,F,$,J)=>{let{machine:Q}=D,{assertRollingTemplate:Z,maxMCycle:X,noRollup:Y,ramLength:q,ramImage:G,useDockerEnv:B,useDockerWorkdir:W,user:K}=Q,V=(B?F?.env??[]:[]).map((M)=>{let[E,A]=M.split("=");return`--env=${E}="${A}"`});if(D.drives.root?.format==="sqfs"){if(!D.machine.bootargs.find((E)=>E.startsWith("rootfstype=")))D.machine.bootargs.push("rootfstype=squashfs")}let z=Q.bootargs.map((M)=>`--append-bootargs="${M}"`),_;if(Q.entrypoint)_=Q.entrypoint;else if(F&&(F.entrypoint.length>0||F.cmd.length>0))_=[...F.entrypoint,...F.cmd].join(" ");if(!_)throw Error("Undefined machine entrypoint. Please define an entrypoint in your cartesi.toml config or in your Dockerfile.");let O=Object.entries(D.drives).map(([M,E])=>KXD(M,E)),C=[...z,...V,...O,`--ram-length=${q}`];if(G)C.push(`--ram-image=${G}`);if(Z)C.push("--assert-rolling-template");if($.finalHash)C.push("--final-hash");if(W&&F?.workdir)C.push(`--workdir="${F.workdir}"`);if($.interactive)C.push("-it");if(Y)C.push("--no-rollup");if(X)C.push(`--max-mcycle=${X.toString()}`);if($.store)C.push(`--store=${$.store}`);if(K)C.push(`--user=${K}`);return C.push("--"),C.push(_),xY.boot(C,{image:D.sdk,...J})};var UXD=(D,F)=>({title:`Building drive ${v.cyan(D)}`,task:async($,J)=>{let{config:Q,debug:Z,destination:X}=$,Y=Q.sdk;switch(F.builder){case"directory":{await SH(D,F,Y,X,Z);break}case"docker":{let q=await xH(D,F,Y,X,Z);if(q&&D==="root")$.imageInfo=q;break}case"empty":{await kH(D,F,Y,X);break}case"tar":{await fH(D,F,Y,X);break}case"none":{await yH(D,F,X);break}}J.title=`Build drive ${v.cyan(D)}`}}),Lv=()=>{return new ZD("build").description("Build application by building Cartesi machine drives, configuring a machine and booting it.").option("-c, --config <config>","path to the configuration file",(D,F)=>F.concat([D]),["cartesi.toml"]).addOption(new S0("--debug","enable debug mode (do not remove intermediate files)").default(!1).hideHelp()).option("-d, --drives-only","only build drives, do not boot machine").option("-v, --verbose","verbose output",!1).action(async(D)=>{let{debug:F,drivesOnly:$,verbose:J}=D;Tv.default.setGracefulCleanup();let Q=JY(D.config),Z=Nv.resolve(I1());await bH.default.emptyDir(Z);let X={config:Q,debug:F,destination:Z,imageInfo:void 0},Y=Object.entries(Q.drives).map(([B,W])=>UXD(B,W)),G=await new o7([{title:"Build drives",task:async(B,W)=>{return W.newListr(Y,{concurrent:!0,rendererOptions:{collapseSubtasks:!1},ctx:X})}}],{ctx:X,renderer:J?"verbose":"default"}).run();if($)return;await vY(Q,G.imageInfo,{finalHash:!0,store:"image"},{cwd:Z,stdio:"inherit"}),await bH.default.chmod(Nv.join(Z,"image"),493)})};var Pv=TD(m8(),1);var jv=()=>{return new ZD("clean").description("Deletes all cached build artifacts of application.").action(async()=>{await Pv.default.emptyDir(I1())})};import J$ from"node:process";import{stripVTControlCharacters as EXD}from"node:util";zU();var vH={dots:{interval:80,frames:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"]},dots2:{interval:80,frames:["⣾","⣽","⣻","⢿","⡿","⣟","⣯","⣷"]},dots3:{interval:80,frames:["⠋","⠙","⠚","⠞","⠖","⠦","⠴","⠲","⠳","⠓"]},dots4:{interval:80,frames:["⠄","⠆","⠇","⠋","⠙","⠸","⠰","⠠","⠰","⠸","⠙","⠋","⠇","⠆"]},dots5:{interval:80,frames:["⠋","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋"]},dots6:{interval:80,frames:["⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠴","⠲","⠒","⠂","⠂","⠒","⠚","⠙","⠉","⠁"]},dots7:{interval:80,frames:["⠈","⠉","⠋","⠓","⠒","⠐","⠐","⠒","⠖","⠦","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈"]},dots8:{interval:80,frames:["⠁","⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈","⠈"]},dots9:{interval:80,frames:["⢹","⢺","⢼","⣸","⣇","⡧","⡗","⡏"]},dots10:{interval:80,frames:["⢄","⢂","⢁","⡁","⡈","⡐","⡠"]},dots11:{interval:100,frames:["⠁","⠂","⠄","⡀","⢀","⠠","⠐","⠈"]},dots12:{interval:80,frames:["⢀⠀","⡀⠀","⠄⠀","⢂⠀","⡂⠀","⠅⠀","⢃⠀","⡃⠀","⠍⠀","⢋⠀","⡋⠀","⠍⠁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⢈⠩","⡀⢙","⠄⡙","⢂⠩","⡂⢘","⠅⡘","⢃⠨","⡃⢐","⠍⡐","⢋⠠","⡋⢀","⠍⡁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⠈⠩","⠀⢙","⠀⡙","⠀⠩","⠀⢘","⠀⡘","⠀⠨","⠀⢐","⠀⡐","⠀⠠","⠀⢀","⠀⡀"]},dots13:{interval:80,frames:["⣼","⣹","⢻","⠿","⡟","⣏","⣧","⣶"]},dots14:{interval:80,frames:["⠉⠉","⠈⠙","⠀⠹","⠀⢸","⠀⣰","⢀⣠","⣀⣀","⣄⡀","⣆⠀","⡇⠀","⠏⠀","⠋⠁"]},dots8Bit:{interval:80,frames:["⠀","⠁","⠂","⠃","⠄","⠅","⠆","⠇","⡀","⡁","⡂","⡃","⡄","⡅","⡆","⡇","⠈","⠉","⠊","⠋","⠌","⠍","⠎","⠏","⡈","⡉","⡊","⡋","⡌","⡍","⡎","⡏","⠐","⠑","⠒","⠓","⠔","⠕","⠖","⠗","⡐","⡑","⡒","⡓","⡔","⡕","⡖","⡗","⠘","⠙","⠚","⠛","⠜","⠝","⠞","⠟","⡘","⡙","⡚","⡛","⡜","⡝","⡞","⡟","⠠","⠡","⠢","⠣","⠤","⠥","⠦","⠧","⡠","⡡","⡢","⡣","⡤","⡥","⡦","⡧","⠨","⠩","⠪","⠫","⠬","⠭","⠮","⠯","⡨","⡩","⡪","⡫","⡬","⡭","⡮","⡯","⠰","⠱","⠲","⠳","⠴","⠵","⠶","⠷","⡰","⡱","⡲","⡳","⡴","⡵","⡶","⡷","⠸","⠹","⠺","⠻","⠼","⠽","⠾","⠿","⡸","⡹","⡺","⡻","⡼","⡽","⡾","⡿","⢀","⢁","⢂","⢃","⢄","⢅","⢆","⢇","⣀","⣁","⣂","⣃","⣄","⣅","⣆","⣇","⢈","⢉","⢊","⢋","⢌","⢍","⢎","⢏","⣈","⣉","⣊","⣋","⣌","⣍","⣎","⣏","⢐","⢑","⢒","⢓","⢔","⢕","⢖","⢗","⣐","⣑","⣒","⣓","⣔","⣕","⣖","⣗","⢘","⢙","⢚","⢛","⢜","⢝","⢞","⢟","⣘","⣙","⣚","⣛","⣜","⣝","⣞","⣟","⢠","⢡","⢢","⢣","⢤","⢥","⢦","⢧","⣠","⣡","⣢","⣣","⣤","⣥","⣦","⣧","⢨","⢩","⢪","⢫","⢬","⢭","⢮","⢯","⣨","⣩","⣪","⣫","⣬","⣭","⣮","⣯","⢰","⢱","⢲","⢳","⢴","⢵","⢶","⢷","⣰","⣱","⣲","⣳","⣴","⣵","⣶","⣷","⢸","⢹","⢺","⢻","⢼","⢽","⢾","⢿","⣸","⣹","⣺","⣻","⣼","⣽","⣾","⣿"]},dotsCircle:{interval:80,frames:["⢎ ","⠎⠁","⠊⠑","⠈⠱"," ⡱","⢀⡰","⢄⡠","⢆⡀"]},sand:{interval:80,frames:["⠁","⠂","⠄","⡀","⡈","⡐","⡠","⣀","⣁","⣂","⣄","⣌","⣔","⣤","⣥","⣦","⣮","⣶","⣷","⣿","⡿","⠿","⢟","⠟","⡛","⠛","⠫","⢋","⠋","⠍","⡉","⠉","⠑","⠡","⢁"]},line:{interval:130,frames:["-","\\","|","/"]},line2:{interval:100,frames:["⠂","-","–","—","–","-"]},rollingLine:{interval:80,frames:["/ "," - "," \\ "," |"," |"," \\ "," - ","/ "]},pipe:{interval:100,frames:["┤","┘","┴","└","├","┌","┬","┐"]},simpleDots:{interval:400,frames:[". ",".. ","..."," "]},simpleDotsScrolling:{interval:200,frames:[". ",".. ","..."," .."," ."," "]},star:{interval:70,frames:["✶","✸","✹","✺","✹","✷"]},star2:{interval:80,frames:["+","x","*"]},flip:{interval:70,frames:["_","_","_","-","`","`","'","´","-","_","_","_"]},hamburger:{interval:100,frames:["☱","☲","☴"]},growVertical:{interval:120,frames:["▁","▃","▄","▅","▆","▇","▆","▅","▄","▃"]},growHorizontal:{interval:120,frames:["▏","▎","▍","▌","▋","▊","▉","▊","▋","▌","▍","▎"]},balloon:{interval:140,frames:[" ",".","o","O","@","*"," "]},balloon2:{interval:120,frames:[".","o","O","°","O","o","."]},noise:{interval:100,frames:["▓","▒","░"]},bounce:{interval:120,frames:["⠁","⠂","⠄","⠂"]},boxBounce:{interval:120,frames:["▖","▘","▝","▗"]},boxBounce2:{interval:100,frames:["▌","▀","▐","▄"]},triangle:{interval:50,frames:["◢","◣","◤","◥"]},binary:{interval:80,frames:["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},arc:{interval:100,frames:["◜","◠","◝","◞","◡","◟"]},circle:{interval:120,frames:["◡","⊙","◠"]},squareCorners:{interval:180,frames:["◰","◳","◲","◱"]},circleQuarters:{interval:120,frames:["◴","◷","◶","◵"]},circleHalves:{interval:50,frames:["◐","◓","◑","◒"]},squish:{interval:100,frames:["╫","╪"]},toggle:{interval:250,frames:["⊶","⊷"]},toggle2:{interval:80,frames:["▫","▪"]},toggle3:{interval:120,frames:["□","■"]},toggle4:{interval:100,frames:["■","□","▪","▫"]},toggle5:{interval:100,frames:["▮","▯"]},toggle6:{interval:300,frames:["ဝ","၀"]},toggle7:{interval:80,frames:["⦾","⦿"]},toggle8:{interval:100,frames:["◍","◌"]},toggle9:{interval:100,frames:["◉","◎"]},toggle10:{interval:100,frames:["㊂","㊀","㊁"]},toggle11:{interval:50,frames:["⧇","⧆"]},toggle12:{interval:120,frames:["☗","☖"]},toggle13:{interval:80,frames:["=","*","-"]},arrow:{interval:100,frames:["←","↖","↑","↗","→","↘","↓","↙"]},arrow2:{interval:80,frames:["⬆️ ","↗️ ","➡️ ","↘️ ","⬇️ ","↙️ ","⬅️ ","↖️ "]},arrow3:{interval:120,frames:["▹▹▹▹▹","▸▹▹▹▹","▹▸▹▹▹","▹▹▸▹▹","▹▹▹▸▹","▹▹▹▹▸"]},bouncingBar:{interval:80,frames:["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},bouncingBall:{interval:80,frames:["( ● )","( ● )","( ● )","( ● )","( ●)","( ● )","( ● )","( ● )","( ● )","(● )"]},smiley:{interval:200,frames:["😄 ","😝 "]},monkey:{interval:300,frames:["🙈 ","🙈 ","🙉 ","🙊 "]},hearts:{interval:100,frames:["💛 ","💙 ","💜 ","💚 ","💗 "]},clock:{interval:100,frames:["🕛 ","🕐 ","🕑 ","🕒 ","🕓 ","🕔 ","🕕 ","🕖 ","🕗 ","🕘 ","🕙 ","🕚 "]},earth:{interval:180,frames:["🌍 ","🌎 ","🌏 "]},material:{interval:17,frames:["█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███████▁▁▁▁▁▁▁▁▁▁▁▁▁","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","██████████▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","█████████████▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁██████████████▁▁▁▁","▁▁▁██████████████▁▁▁","▁▁▁▁█████████████▁▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁▁▁████████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁██████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","██████▁▁▁▁▁▁▁▁▁▁▁▁▁█","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁▁█████████████▁▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁▁███████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁▁█████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁"]},moon:{interval:80,frames:["🌑 ","🌒 ","🌓 ","🌔 ","🌕 ","🌖 ","🌗 ","🌘 "]},runner:{interval:140,frames:["🚶 ","🏃 "]},pong:{interval:80,frames:["▐⠂ ▌","▐⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂▌","▐ ⠠▌","▐ ⡀▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐⠠ ▌"]},shark:{interval:120,frames:["▐|\\____________▌","▐_|\\___________▌","▐__|\\__________▌","▐___|\\_________▌","▐____|\\________▌","▐_____|\\_______▌","▐______|\\______▌","▐_______|\\_____▌","▐________|\\____▌","▐_________|\\___▌","▐__________|\\__▌","▐___________|\\_▌","▐____________|\\▌","▐____________/|▌","▐___________/|_▌","▐__________/|__▌","▐_________/|___▌","▐________/|____▌","▐_______/|_____▌","▐______/|______▌","▐_____/|_______▌","▐____/|________▌","▐___/|_________▌","▐__/|__________▌","▐_/|___________▌","▐/|____________▌"]},dqpb:{interval:100,frames:["d","q","p","b"]},weather:{interval:100,frames:["☀️ ","☀️ ","☀️ ","🌤 ","⛅️ ","🌥 ","☁️ ","🌧 ","🌨 ","🌧 ","🌨 ","🌧 ","🌨 ","⛈ ","🌨 ","🌧 ","🌨 ","☁️ ","🌥 ","⛅️ ","🌤 ","☀️ ","☀️ "]},christmas:{interval:400,frames:["🌲","🎄"]},grenade:{interval:80,frames:["، ","′ "," ´ "," ‾ "," ⸌"," ⸊"," |"," ⁎"," ⁕"," ෴ "," ⁓"," "," "," "]},point:{interval:125,frames:["∙∙∙","●∙∙","∙●∙","∙∙●","∙∙∙"]},layer:{interval:150,frames:["-","=","≡"]},betaWave:{interval:80,frames:["ρββββββ","βρβββββ","ββρββββ","βββρβββ","ββββρββ","βββββρβ","ββββββρ"]},fingerDance:{interval:160,frames:["🤘 ","🤟 ","🖖 ","✋ ","🤚 ","👆 "]},fistBump:{interval:80,frames:["🤜    🤛 ","🤜    🤛 ","🤜    🤛 "," 🤜  🤛  ","  🤜🤛   "," 🤜✨🤛   ","🤜 ✨ 🤛  "]},soccerHeader:{interval:80,frames:[" 🧑⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 "]},mindblown:{interval:160,frames:["😐 ","😐 ","😮 ","😮 ","😦 ","😦 ","😧 ","😧 ","🤯 ","💥 ","✨ ","  ","  ","  "]},speaker:{interval:160,frames:["🔈 ","🔉 ","🔊 ","🔉 "]},orangePulse:{interval:100,frames:["🔸 ","🔶 ","🟠 ","🟠 ","🔶 "]},bluePulse:{interval:100,frames:["🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},orangeBluePulse:{interval:100,frames:["🔸 ","🔶 ","🟠 ","🟠 ","🔶 ","🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},timeTravel:{interval:100,frames:["🕛 ","🕚 ","🕙 ","🕘 ","🕗 ","🕖 ","🕕 ","🕔 ","🕓 ","🕒 ","🕑 ","🕐 "]},aesthetic:{interval:80,frames:["▰▱▱▱▱▱▱","▰▰▱▱▱▱▱","▰▰▰▱▱▱▱","▰▰▰▰▱▱▱","▰▰▰▰▰▱▱","▰▰▰▰▰▰▱","▰▰▰▰▰▰▰","▰▱▱▱▱▱▱"]},dwarfFortress:{interval:80,frames:[" ██████£££ ","☺██████£££ ","☺██████£££ ","☺▓█████£££ ","☺▓█████£££ ","☺▒█████£££ ","☺▒█████£££ ","☺░█████£££ ","☺░█████£££ ","☺ █████£££ "," ☺█████£££ "," ☺█████£££ "," ☺▓████£££ "," ☺▓████£££ "," ☺▒████£££ "," ☺▒████£££ "," ☺░████£££ "," ☺░████£££ "," ☺ ████£££ "," ☺████£££ "," ☺████£££ "," ☺▓███£££ "," ☺▓███£££ "," ☺▒███£££ "," ☺▒███£££ "," ☺░███£££ "," ☺░███£££ "," ☺ ███£££ "," ☺███£££ "," ☺███£££ "," ☺▓██£££ "," ☺▓██£££ "," ☺▒██£££ "," ☺▒██£££ "," ☺░██£££ "," ☺░██£££ "," ☺ ██£££ "," ☺██£££ "," ☺██£££ "," ☺▓█£££ "," ☺▓█£££ "," ☺▒█£££ "," ☺▒█£££ "," ☺░█£££ "," ☺░█£££ "," ☺ █£££ "," ☺█£££ "," ☺█£££ "," ☺▓£££ "," ☺▓£££ "," ☺▒£££ "," ☺▒£££ "," ☺░£££ "," ☺░£££ "," ☺ £££ "," ☺£££ "," ☺£££ "," ☺▓££ "," ☺▓££ "," ☺▒££ "," ☺▒££ "," ☺░££ "," ☺░££ "," ☺ ££ "," ☺££ "," ☺££ "," ☺▓£ "," ☺▓£ "," ☺▒£ "," ☺▒£ "," ☺░£ "," ☺░£ "," ☺ £ "," ☺£ "," ☺£ "," ☺▓ "," ☺▓ "," ☺▒ "," ☺▒ "," ☺░ "," ☺░ "," ☺ "," ☺ &"," ☺ ☼&"," ☺ ☼ &"," ☺☼ &"," ☺☼ & "," ‼ & "," ☺ & "," ‼ & "," ☺ & "," ‼ & "," ☺ & ","‼ & "," & "," & "," & ░ "," & ▒ "," & ▓ "," & £ "," & ░£ "," & ▒£ "," & ▓£ "," & ££ "," & ░££ "," & ▒££ ","& ▓££ ","& £££ "," ░£££ "," ▒£££ "," ▓£££ "," █£££ "," ░█£££ "," ▒█£££ "," ▓█£££ "," ██£££ "," ░██£££ "," ▒██£££ "," ▓██£££ "," ███£££ "," ░███£££ "," ▒███£££ "," ▓███£££ "," ████£££ "," ░████£££ "," ▒████£££ "," ▓████£££ "," █████£££ "," ░█████£££ "," ▒█████£££ "," ▓█████£££ "," ██████£££ "," ██████£££ "]}};var $$=vH,oj0=Object.keys(vH);var d3={};H2(d3,{warning:()=>CXD,success:()=>zXD,info:()=>HXD,error:()=>_XD});var hY=yF(),HXD=rC(hY?"ℹ":"i"),zXD=oC(hY?"✔":"√"),CXD=aC(hY?"⚠":"‼"),_XD=iC(hY?"✖":"×");LU();function hH({stream:D=process.stdout}={}){return Boolean(D&&D.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}import H9 from"node:process";var MXD=3;class Sv{#J=0;#$;#F=!1;#D=!1;#Z=(D)=>{if(!D?.length)return;if((typeof D==="string"?D.codePointAt(0):D[0])===MXD)if(H9.listenerCount("SIGINT")>0)H9.emit("SIGINT");else H9.kill(H9.pid,"SIGINT")};start(){if(this.#J++,this.#J===1)this.#Q()}stop(){if(this.#J===0)return;if(--this.#J===0)this.#X()}#Q(){let{stdin:D}=H9;if(H9.platform==="win32"||!D?.isTTY||typeof D.setRawMode!=="function"){this.#$=void 0;return}if(this.#$=D,this.#F=D.isPaused(),this.#D=Boolean(D.isRaw),D.setRawMode(!0),D.prependListener("data",this.#Z),this.#F)D.resume()}#X(){if(!this.#$)return;let D=this.#$;if(D.off("data",this.#Z),D.isTTY)D.setRawMode?.(this.#D);if(this.#F)D.pause();this.#$=void 0,this.#F=!1,this.#D=!1}}var OXD=new Sv,uH=Object.freeze(OXD);var RXD=200,AXD="\x1B[?2026h",IXD="\x1B[?2026l",uY=new Map;class xv{#J=0;#$=-1;#F=0;#D;#Z;#Q;#X;#q=new Map;#W=!1;#G;#Y;#K=!1;color;#B(D){this.#W=!0;try{return D()}finally{this.#W=!1}}#V(){if(this.isSpinning)this.render()}#O(D,F){if(D===void 0||D===null)return"";if(typeof D==="string")return D;if(Buffer.isBuffer(D)||ArrayBuffer.isView(D)){let $=typeof F==="string"&&F&&F!=="buffer"?F:"utf8";return Buffer.from(D).toString($)}return String(D)}#E(D){if(!D)return!1;let F=D.at(-1);return F===`
670
+ - url: "http://paymaster:3000"`}},$k=(D)=>({configs:{paymaster_proxy:G4D()},services:{paymaster:q4D(D),proxy:{configs:[{source:"paymaster_proxy",target:"/etc/traefik/conf.d/paymaster.yaml"}]}}});var B4D=(D)=>{let F=D.imageTag??"latest",$=D.port??6751;return{image:`traefik:${F}`,healthcheck:{...N0,test:["CMD","traefik","healthcheck","--ping"]},command:["--ping=true","--entryPoints.web.address=:8088","--entryPoints.traefik.address=:8080","--metrics.prometheus=true","--metrics.prometheus.addServicesLabels=true","--providers.file.directory=/etc/traefik/conf.d","--providers.file.watch=true","--log","--log.level=INFO"],ports:[`${$}:8088`]}},Jk=(D)=>({services:{proxy:B4D(D)}});var Qk=(D)=>({address:D.iapplication_address,consensus:D.iconsensus_address,epochLength:MD(D.epoch_length),name:D.name,state:D.state,templateHash:D.template_hash}),sV=async(D)=>{try{let{stdout:F}=await wD("docker",["compose","--project-name",D.projectName,"exec","rollups_node","cartesi-rollups-cli","app","list"]);return JSON.parse(F).map(Qk)}catch{return[]}},W4D=async(D)=>{let F=h3();if(!F)return;return(await sV(D)).find((J)=>J.templateHash===F)},FY=async(D)=>{let F=yD(D??{});return(await W4D({projectName:F}))?.address},Zk=async(D)=>{let F=yD(D??{});try{let J=(await V4D({projectName:F}))?.forkConfig?.forkUrl;if(J)return o4({transport:N3(J)}).getChainId()}catch{return}return},A1="http://127.0.0.1",K4D=[{name:"anvil",healthySemaphore:"anvil",healthyTitle:(D)=>`${v.cyan("anvil")} service ready at ${v.cyan(`${A1}:${D}/anvil`)}`,waitTitle:`${v.cyan("anvil")} service starting...`,errorTitle:`${v.red("anvil")} service failed`},{name:"proxy"},{name:"database"},{name:"rpc",healthySemaphore:"rollups_node",healthyTitle:(D)=>`${v.cyan("rpc")} service ready at ${v.cyan(`${A1}:${D}/rpc`)}`,waitTitle:`${v.cyan("rpc")} service starting...`,errorTitle:`${v.red("rpc")} service failed`},{name:"inspect",healthySemaphore:"rollups_node",healthyTitle:(D,F)=>`${v.cyan("inspect")} service ready at ${v.cyan(`${A1}:${D}/inspect/${F??"<application_address>"}`)}`,waitTitle:`${v.cyan("inspect")} service starting...`,errorTitle:`${v.red("inspect")} service failed`}],rV=[{name:"bundler",healthySemaphore:"bundler",healthyTitle:(D)=>`${v.cyan("bundler")} service ready at ${v.cyan(`${A1}:${D}/bundler/rpc`)}`,waitTitle:`${v.cyan("bundler")} service starting...`,errorTitle:`${v.red("bundler")} service failed`},{name:"explorer",healthySemaphore:"explorer_api",healthyTitle:(D)=>`${v.cyan("explorer")} service ready at ${v.cyan(`${A1}:${D}/explorer`)}`,waitTitle:`${v.cyan("explorer")} service starting...`,errorTitle:`${v.red("explorer")} service failed`},{name:"paymaster",healthySemaphore:"paymaster",healthyTitle:(D)=>`${v.cyan("paymaster")} service ready at ${v.cyan(`${A1}:${D}/paymaster`)}`,waitTitle:`${v.cyan("paymaster")} service starting...`,errorTitle:`${v.red("paymaster")} service failed`},{name:"passkey",healthySemaphore:"passkey_server",healthyTitle:(D)=>`${v.cyan("passkey")} service ready at ${v.cyan(`${A1}:${D}/passkey`)}`,waitTitle:`${v.cyan("passkey")} service starting...`,errorTitle:`${v.red("passkey")} service failed`}],Xk=rV.map(({name:D})=>D),U4D=(D)=>{let{errorTitle:F,healthyTitle:$,service:J,waitTitle:Q}=D;return{task:async(Z,X)=>{await yU(async()=>{if(await Uk(D)!=="healthy")throw Error(F??`Service ${v.cyan(J)} is not healthy`)},{retries:100,minTimeout:500,factor:1.1}),X.title=$??`Service ${v.cyan(J)} is ready`},title:Q??`Starting ${v.cyan(J)}...`}},Yk=async(D)=>{let{blockTime:F,cpus:$,defaultBlock:J,detach:Q,dryRun:Z,forkConfig:X,memory:Y,port:q,projectName:G,prt:B,runtimeVersion:W,services:K,verbose:U}=D,V={CARTESI_BLOCKCHAIN_DEFAULT_BLOCK:J,CARTESI_LISTEN_PORT:q.toString(),CARTESI_LOG_LEVEL:U?"debug":"info"},H="password",z=[ax({blockTime:F,forkConfig:X,imageTag:W}),tx({imageTag:W,password:"password"}),Dk({cpus:$,databasePassword:"password",defaultBlock:J,forkChainId:X?.chainId,imageTag:W,logLevel:U?"debug":"info",memory:Y,prt:B}),Jk({imageTag:"v3.3.4",port:q})];if(K.includes("explorer"))z.push(ex({imageTag:"1.4.0",apiTag:"1.1.0",databasePassword:"password",port:q}));if(K.includes("bundler"))z.push(sx({imageTag:W}));if(K.includes("paymaster"))z.push($k({imageTag:W}));if(K.includes("passkey"))z.push(Fk({imageTag:W}));let _=["compose","-f","-","--project-directory","."],O=Q?["--detach"]:[],C=rx([{name:G},...z]);if(Z){let{stdout:E}=await wD("docker",[..._,"config","--format","yaml"],{env:V,input:DY(C,{lineWidth:0,indent:2})});return{config:E}}let M=wD("docker",[..._,"up",...O],{env:V,input:DY(C,{lineWidth:0,indent:2})});if(Q)await M;return{cmd:M}},qk=async(D)=>{let{name:F,port:$,projectName:J,services:Q}=D,Z=Q.length===1&&Q[0]==="all"?rV:rV.filter(({name:q})=>Q.includes(q)),X=[...K4D,...Z].filter(({healthySemaphore:q})=>!!q).map((q)=>{let G=typeof q.healthyTitle==="function"?q.healthyTitle($,F):q.healthyTitle;return U4D({projectName:J,service:q.healthySemaphore,errorTitle:q.errorTitle,waitTitle:q.waitTitle,healthyTitle:G})});await new o7(X,{concurrent:!0}).run()};var Gk=async(D)=>{let{projectName:F}=D;return wD("docker",["compose","--project-name",F,"down","--volumes"])};var Bk=async(D)=>{let{consensus:F,epochLength:$,name:J,projectName:Q,prt:Z,salt:X,snapshotPath:Y}=D,q=[J,Y];if(F)q.push("--consensus",F);else q.push("--epoch-length",$.toString());if(X)q.push("--salt",X);if(Z)q.push("--prt");q.push("--json");let{stdout:G}=await wD("docker",["compose","--project-name",Q,"exec","rollups_node","cartesi-rollups-cli","deploy","application",...q]),B=G?Qk(JSON.parse(G)):void 0;if(B)return B;throw Error("Failed to deploy application")},Wk=async(D)=>{let{application:F,force:$,projectName:J}=D;await wD("docker",["compose","--project-name",J,"exec","rollups_node","cartesi-rollups-cli","app","status",F,"disabled"]);let Q=[F];if($)Q.push("--force");return wD("docker",["compose","--project-name",J,"exec","rollups_node","cartesi-rollups-cli","app","remove",...Q])},Kk=async(D)=>{let{projectName:F}=D,{stdout:$}=await wD("docker",["compose","--project-name",F,"port","proxy","8088"]);return $},V4D=async(D)=>{let{projectName:F}=D,{stdout:$}=await wD("docker",["compose","--project-name",F,"exec","anvil","cast","rpc","anvil_nodeInfo"]);return JSON.parse($)};var I1=(...D)=>{return Vk.join(".cartesi",...D)},h3=()=>{let D=I1("image","hash");if($Y.existsSync(D)){let F=$Y.readFileSync(D).toString("hex");if(oK(`0x${F}`))return`0x${F}`}return},JY=(D)=>{let F=D.map(($)=>{if($Y.existsSync($))return $Y.readFileSync($).toString();if($==="cartesi.toml")return"";throw Error(`Config file ${$} does not exist`)});return WP(F)},yD=(D)=>{return D.projectName??Vk.basename(process.cwd())},Hk=async(D)=>{let F=await Zk(D),$=await FY(D),J=F!==void 0?D5[F]:D5[31337];if(!J)throw Error(`Unsupported fork chain ${F}`);let Q={EntryPointV06:"0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",EntryPointV07:"0x0000000071727De22E5E9d8BAf0edAc6f37da032",EntryPointV08:"0x4337084d9e255ff0702461cf8895ce9e3b5ff108",EntryPointV09:"0x433709009B8330FDa32311DF1C2AFA402eD8D009",LightAccountFactory:"0x00004EC70002a32400f8ae005A26081065620D20",SimpleAccountFactory:"0x9406Cc6185a346906296840746125a0E44976454",SmartAccountFactory:"0x000000a56Aaca3e9a4C479ea6b6CD0DbcB6634F5",KernelFactoryV2:"0x5de4839a76cf55d0c90e2061ef4386d962E15ae3",KernelFactoryV3:"0x6723b44Abeec4E71eBE3232BD5B455805baDD22f",KernelFactoryV3_1:"0xaac5D4240AF87249B3f71BC8E4A2cae074A3E419",VerifyingPaymasterV06:"0x28ec0633192d0cBd9E1156CE05D5FdACAcB93947",VerifyingPaymasterV07:"0xc5c97885C67F7361aBAfD2B95067a5bBdA603608"},Z={TestToken:oZ,TestNFT:F5,TestMultiToken:iZ},X={ApplicationFactory:UP,AuthorityFactory:VP,DaveAppFactory:J,ERC1155BatchPortal:k7,ERC1155SinglePortal:y7,ERC20Portal:f7,ERC721Portal:b7,EtherPortal:cZ,InputBox:v7,SelfHostedApplicationFactory:nZ},Y=F!==void 0?{...X,...Q}:{...X,...Z};if($)Y.Application=$;return Y},QY=async(D)=>{let{projectName:F,service:$}=D,{stdout:J}=await wD("docker",["compose","--project-name",F,"ps",$,"--format","json"]);return J?JSON.parse(J):void 0},zk=async(D)=>{return(await QY(D))?.State},Uk=async(D)=>{return(await QY(D))?.Health};var _k=()=>{return new ZD("address-book").description("Prints the addresses of all smart contracts deployed to the runtime environment of the application.").option("--json","Format output as json.").option("--project-name <string>","name of project (used by docker compose and cartesi-rollups-node)").action(async(D)=>{let{json:F}=D,$=yD(D),J=await Hk({projectName:$});if(!F){let Q=new Ck.default({head:["Contract","Address"],chars:{top:"","top-mid":"","top-left":"","top-right":"",bottom:"","bottom-mid":"","bottom-left":"","bottom-right":"",left:"","left-mid":"",mid:"","mid-mid":"",right:"","right-mid":"",middle:" "},style:{"padding-left":0,"padding-right":0}});Q.push(...Object.entries(J)),console.log(Q.toString())}else process.stdout.write(JSON.stringify(J))})};var bH=TD(m8(),1);var Tv=TD(Tf(),1);import Nv from"node:path";var fY=TD(m8(),1);import qXD from"node:path";var xY={};H2(xY,{version:()=>sZD,requiredVersion:()=>aZD,boot:()=>rZD});var SY=TD(D$(),1);import oZD from"node:os";var y2=async(D,F,$)=>{try{if($.forceDocker){let J=new Z2;throw J.code="ENOENT",J}return await wD(D,F,$)}catch(J){if(J instanceof Z2){if(J.code==="ENOENT"&&$.image){let Q=oZD.userInfo(),Z=["--volume",`${$.cwd}:/work`,"--workdir","/work","--interactive","--rm","--user",`${Q.uid}:${Q.gid}`];return await wD("docker",["run",...Z,$.image,D,...F],$)}}throw J}};var aZD=new SY.Range("^0.19.0"),rZD=(D,F)=>y2("cartesi-machine",D,F),sZD=async(D)=>{let{image:F}=D||{};try{let{stdout:$}=await y2("cartesi-machine",["--version-json"],{image:F});if(typeof $==="string"){let J=JSON.parse($);return SY.parse(J.version)}return null}catch{return null}};var l8={};H2(l8,{version:()=>$XD,requiredVersion:()=>tZD,fromTar:()=>FXD,fromDirectory:()=>DXD,empty:()=>eZD});var kY=TD(D$(),1);var F$=4096,tZD=new kY.Range("^1.5.6"),_v=(D)=>["--block-size",F$.toString(),"--faketime","--readjustment",`+${D.extraBlocks}`],eZD=(D)=>{let{size:F,output:$}=D,J=Math.ceil(F/F$);return y2("xgenext2fs",["--block-size",F$.toString(),"--faketime","--size-in-blocks",J.toString(),$],D)},DXD=(D)=>{let{cwd:F,extraSize:$,image:J,input:Q,output:Z}=D,X=Math.ceil($/F$);return y2("xgenext2fs",[..._v({extraBlocks:X}),"--root",Q,Z],{cwd:F,image:J})},FXD=(D)=>{let{cwd:F,extraSize:$,image:J,input:Q,output:Z}=D,X=Math.ceil($/F$);return y2("xgenext2fs",[..._v({extraBlocks:X}),"--tarball",Q,Z],{cwd:F,image:J})},$XD=async(D)=>{let{stdout:F}=await y2("xgenext2fs",["--version"],D||{});if(typeof F==="string"){let $=/(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?/,J=F.match($);if(J?.[0])return kY.parse(J[0])}return null};var PF={};H2(PF,{version:()=>YXD,requiredVersion:()=>QXD,fromTar:()=>XXD,fromDirectory:()=>ZXD});var yY=TD(D$(),1);var JXD="lzo",QXD=new yY.Range("^4.5.1"),Mv=()=>["-all-time","0","-mkfs-time","0","-all-root","-noappend","-comp",JXD,"-no-progress"],ZXD=(D)=>{let{cwd:F,image:$,input:J,output:Q}=D;return y2("mksquashfs",[J,Q,...Mv()],{cwd:F,image:$})},XXD=(D)=>{let{cwd:F,image:$,input:J,output:Q}=D;return y2("mksquashfs",["-",Q,"-tar",...Mv()],{cwd:F,image:$,inputFile:J})},YXD=async(D)=>{try{let{stdout:F}=await y2("mksquashfs",["-version"],D||{});if(typeof F==="string"){let $=/(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?/gm,J=F.match($);if(J?.[0])return yY.parse(J[0])}}catch(F){return console.error(F),null}return null};var SH=async(D,F,$,J,Q)=>{let Z=`${D}.${F.format}`,X=qXD.join(J,D);await fY.default.mkdirp(X),await fY.default.copy(F.directory,X);try{switch(F.format){case"ext2":{await l8.fromDirectory({extraSize:F.extraSize,input:D,output:Z,cwd:J,image:$});break}case"sqfs":{await PF.fromDirectory({input:D,output:Z,cwd:J,image:$});break}}}finally{if(!Q)await fY.default.remove(X)}};var Ev=TD(m8(),1);import bY from"node:path";var Ov=async(D)=>{let{buildArgs:F,context:$,destination:J,dockerfile:Q,dockerfileContent:Z,tags:X,target:Y}=D,q=["buildx","build","--platform","linux/riscv64","--file",Z?"-":Q,"--output","type=docker","--output",`type=tar,dest=${J}`,"--progress","quiet"];if(q.push(...X.flatMap((B)=>["--tag",B])),q.push(...F.flatMap((B)=>["--build-arg",B])),Y)q.push("--target",Y);q.push($);let{stdout:G}=await wD("docker",q,{input:Z});return G},GXD=async(D)=>{let{stdout:F}=await wD("docker",["image","inspect",D]),[$]=JSON.parse(F);if($.Architecture!=="riscv64")throw Error(`Invalid image Architecture: ${$.Architecture}. Expected riscv64`);return{cmd:$.Config.Cmd??[],entrypoint:$.Config.Entrypoint??[],env:$.Config.Env||[],workdir:$.Config.WorkingDir}},xH=async(D,F,$,J,Q)=>{let{format:Z}=F,X=`${D}.tar`,Y=`${D}.${Z}`,q;if(F.image)q=await Ov({...F,destination:bY.join(J,X),dockerfileContent:`FROM ${F.image}`});else q=await Ov({...F,destination:bY.join(J,X)});let G=await GXD(q);try{switch(Z){case"ext2":{await l8.fromTar({extraSize:F.extraSize,input:X,output:Y,cwd:J,image:$});break}case"sqfs":{await PF.fromTar({input:bY.join(J,X),output:Y,cwd:J,image:$});break}}}finally{if(!Q)await Ev.default.remove(bY.join(J,X))}return G};var Rv=TD(m8(),1);import BXD from"node:path";var kH=async(D,F,$,J)=>{let Q=`${D}.${F.format}`;switch(F.format){case"ext2":{await l8.empty({output:Q,size:F.size,cwd:J,image:$});break}case"raw":{await Rv.default.writeFile(BXD.join(J,Q),Buffer.alloc(F.size));break}}};var Av=TD(m8(),1);import WXD from"node:path";var yH=async(D,F,$)=>{let J=F.filename,Q=ZU(J),Z=WXD.join($,`${D}.${Q}`);await Av.default.copyFile(J,Z)};var wv=TD(m8(),1);import Iv from"node:path";var fH=async(D,F,$,J)=>{let Q=`${D}.tar`,Z=`${D}.${F.format}`;switch(await wv.default.copy(F.filename,Iv.join(J,Q)),F.format){case"ext2":{await l8.fromTar({extraSize:F.extraSize,input:Q,output:Z,cwd:J,image:$});break}case"sqfs":{await PF.fromTar({input:Iv.join(J,Q),output:Z,cwd:J,image:$});break}}};var KXD=(D,F)=>{let{format:$,mount:J,shared:Q,user:Z}=F,X=`${D}.${$}`,Y=[`label:${D}`,`filename:${X}`];if(J!==void 0)Y.push(`mount:${J}`);if(Z)Y.push(`user:${Z}`);if(Q)Y.push("shared");return`--flash-drive=${Y.join(",")}`},vY=(D,F,$,J)=>{let{machine:Q}=D,{assertRollingTemplate:Z,maxMCycle:X,noRollup:Y,ramLength:q,ramImage:G,useDockerEnv:B,useDockerWorkdir:W,user:K}=Q,V=(B?F?.env??[]:[]).map((M)=>{let[E,A]=M.split("=");return`--env=${E}="${A}"`});if(D.drives.root?.format==="sqfs"){if(!D.machine.bootargs.find((E)=>E.startsWith("rootfstype=")))D.machine.bootargs.push("rootfstype=squashfs")}let z=Q.bootargs.map((M)=>`--append-bootargs="${M}"`),_;if(Q.entrypoint)_=Q.entrypoint;else if(F&&(F.entrypoint.length>0||F.cmd.length>0))_=[...F.entrypoint,...F.cmd].join(" ");if(!_)throw Error("Undefined machine entrypoint. Please define an entrypoint in your cartesi.toml config or in your Dockerfile.");let O=Object.entries(D.drives).map(([M,E])=>KXD(M,E)),C=[...z,...V,...O,`--ram-length=${q}`];if(G)C.push(`--ram-image=${G}`);if(Z)C.push("--assert-rolling-template");if($.finalHash)C.push("--final-hash");if(W&&F?.workdir)C.push(`--workdir="${F.workdir}"`);if($.interactive)C.push("-it");if(Y)C.push("--no-rollup");if(X)C.push(`--max-mcycle=${X.toString()}`);if($.store)C.push(`--store=${$.store}`);if(K)C.push(`--user=${K}`);return C.push("--"),C.push(_),xY.boot(C,{image:D.sdk,...J})};var UXD=(D,F)=>({title:`Building drive ${v.cyan(D)}`,task:async($,J)=>{let{config:Q,debug:Z,destination:X}=$,Y=Q.sdk;switch(F.builder){case"directory":{await SH(D,F,Y,X,Z);break}case"docker":{let q=await xH(D,F,Y,X,Z);if(q&&D==="root")$.imageInfo=q;break}case"empty":{await kH(D,F,Y,X);break}case"tar":{await fH(D,F,Y,X);break}case"none":{await yH(D,F,X);break}}J.title=`Build drive ${v.cyan(D)}`}}),Lv=()=>{return new ZD("build").description("Build application by building Cartesi machine drives, configuring a machine and booting it.").option("-c, --config <config>","path to the configuration file",(D,F)=>F.concat([D]),["cartesi.toml"]).addOption(new S0("--debug","enable debug mode (do not remove intermediate files)").default(!1).hideHelp()).option("-d, --drives-only","only build drives, do not boot machine").option("-v, --verbose","verbose output",!1).action(async(D)=>{let{debug:F,drivesOnly:$,verbose:J}=D;Tv.default.setGracefulCleanup();let Q=JY(D.config),Z=Nv.resolve(I1());await bH.default.emptyDir(Z);let X={config:Q,debug:F,destination:Z,imageInfo:void 0},Y=Object.entries(Q.drives).map(([B,W])=>UXD(B,W)),G=await new o7([{title:"Build drives",task:async(B,W)=>{return W.newListr(Y,{concurrent:!0,rendererOptions:{collapseSubtasks:!1},ctx:X})}}],{ctx:X,renderer:J?"verbose":"default"}).run();if($)return;await vY(Q,G.imageInfo,{finalHash:!0,store:"image"},{cwd:Z,stdio:"inherit"}),await bH.default.chmod(Nv.join(Z,"image"),493)})};var Pv=TD(m8(),1);var jv=()=>{return new ZD("clean").description("Deletes all cached build artifacts of application.").action(async()=>{await Pv.default.emptyDir(I1())})};import J$ from"node:process";import{stripVTControlCharacters as EXD}from"node:util";zU();var vH={dots:{interval:80,frames:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"]},dots2:{interval:80,frames:["⣾","⣽","⣻","⢿","⡿","⣟","⣯","⣷"]},dots3:{interval:80,frames:["⠋","⠙","⠚","⠞","⠖","⠦","⠴","⠲","⠳","⠓"]},dots4:{interval:80,frames:["⠄","⠆","⠇","⠋","⠙","⠸","⠰","⠠","⠰","⠸","⠙","⠋","⠇","⠆"]},dots5:{interval:80,frames:["⠋","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋"]},dots6:{interval:80,frames:["⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠴","⠲","⠒","⠂","⠂","⠒","⠚","⠙","⠉","⠁"]},dots7:{interval:80,frames:["⠈","⠉","⠋","⠓","⠒","⠐","⠐","⠒","⠖","⠦","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈"]},dots8:{interval:80,frames:["⠁","⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈","⠈"]},dots9:{interval:80,frames:["⢹","⢺","⢼","⣸","⣇","⡧","⡗","⡏"]},dots10:{interval:80,frames:["⢄","⢂","⢁","⡁","⡈","⡐","⡠"]},dots11:{interval:100,frames:["⠁","⠂","⠄","⡀","⢀","⠠","⠐","⠈"]},dots12:{interval:80,frames:["⢀⠀","⡀⠀","⠄⠀","⢂⠀","⡂⠀","⠅⠀","⢃⠀","⡃⠀","⠍⠀","⢋⠀","⡋⠀","⠍⠁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⢈⠩","⡀⢙","⠄⡙","⢂⠩","⡂⢘","⠅⡘","⢃⠨","⡃⢐","⠍⡐","⢋⠠","⡋⢀","⠍⡁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⠈⠩","⠀⢙","⠀⡙","⠀⠩","⠀⢘","⠀⡘","⠀⠨","⠀⢐","⠀⡐","⠀⠠","⠀⢀","⠀⡀"]},dots13:{interval:80,frames:["⣼","⣹","⢻","⠿","⡟","⣏","⣧","⣶"]},dots14:{interval:80,frames:["⠉⠉","⠈⠙","⠀⠹","⠀⢸","⠀⣰","⢀⣠","⣀⣀","⣄⡀","⣆⠀","⡇⠀","⠏⠀","⠋⠁"]},dots8Bit:{interval:80,frames:["⠀","⠁","⠂","⠃","⠄","⠅","⠆","⠇","⡀","⡁","⡂","⡃","⡄","⡅","⡆","⡇","⠈","⠉","⠊","⠋","⠌","⠍","⠎","⠏","⡈","⡉","⡊","⡋","⡌","⡍","⡎","⡏","⠐","⠑","⠒","⠓","⠔","⠕","⠖","⠗","⡐","⡑","⡒","⡓","⡔","⡕","⡖","⡗","⠘","⠙","⠚","⠛","⠜","⠝","⠞","⠟","⡘","⡙","⡚","⡛","⡜","⡝","⡞","⡟","⠠","⠡","⠢","⠣","⠤","⠥","⠦","⠧","⡠","⡡","⡢","⡣","⡤","⡥","⡦","⡧","⠨","⠩","⠪","⠫","⠬","⠭","⠮","⠯","⡨","⡩","⡪","⡫","⡬","⡭","⡮","⡯","⠰","⠱","⠲","⠳","⠴","⠵","⠶","⠷","⡰","⡱","⡲","⡳","⡴","⡵","⡶","⡷","⠸","⠹","⠺","⠻","⠼","⠽","⠾","⠿","⡸","⡹","⡺","⡻","⡼","⡽","⡾","⡿","⢀","⢁","⢂","⢃","⢄","⢅","⢆","⢇","⣀","⣁","⣂","⣃","⣄","⣅","⣆","⣇","⢈","⢉","⢊","⢋","⢌","⢍","⢎","⢏","⣈","⣉","⣊","⣋","⣌","⣍","⣎","⣏","⢐","⢑","⢒","⢓","⢔","⢕","⢖","⢗","⣐","⣑","⣒","⣓","⣔","⣕","⣖","⣗","⢘","⢙","⢚","⢛","⢜","⢝","⢞","⢟","⣘","⣙","⣚","⣛","⣜","⣝","⣞","⣟","⢠","⢡","⢢","⢣","⢤","⢥","⢦","⢧","⣠","⣡","⣢","⣣","⣤","⣥","⣦","⣧","⢨","⢩","⢪","⢫","⢬","⢭","⢮","⢯","⣨","⣩","⣪","⣫","⣬","⣭","⣮","⣯","⢰","⢱","⢲","⢳","⢴","⢵","⢶","⢷","⣰","⣱","⣲","⣳","⣴","⣵","⣶","⣷","⢸","⢹","⢺","⢻","⢼","⢽","⢾","⢿","⣸","⣹","⣺","⣻","⣼","⣽","⣾","⣿"]},dotsCircle:{interval:80,frames:["⢎ ","⠎⠁","⠊⠑","⠈⠱"," ⡱","⢀⡰","⢄⡠","⢆⡀"]},sand:{interval:80,frames:["⠁","⠂","⠄","⡀","⡈","⡐","⡠","⣀","⣁","⣂","⣄","⣌","⣔","⣤","⣥","⣦","⣮","⣶","⣷","⣿","⡿","⠿","⢟","⠟","⡛","⠛","⠫","⢋","⠋","⠍","⡉","⠉","⠑","⠡","⢁"]},line:{interval:130,frames:["-","\\","|","/"]},line2:{interval:100,frames:["⠂","-","–","—","–","-"]},rollingLine:{interval:80,frames:["/ "," - "," \\ "," |"," |"," \\ "," - ","/ "]},pipe:{interval:100,frames:["┤","┘","┴","└","├","┌","┬","┐"]},simpleDots:{interval:400,frames:[". ",".. ","..."," "]},simpleDotsScrolling:{interval:200,frames:[". ",".. ","..."," .."," ."," "]},star:{interval:70,frames:["✶","✸","✹","✺","✹","✷"]},star2:{interval:80,frames:["+","x","*"]},flip:{interval:70,frames:["_","_","_","-","`","`","'","´","-","_","_","_"]},hamburger:{interval:100,frames:["☱","☲","☴"]},growVertical:{interval:120,frames:["▁","▃","▄","▅","▆","▇","▆","▅","▄","▃"]},growHorizontal:{interval:120,frames:["▏","▎","▍","▌","▋","▊","▉","▊","▋","▌","▍","▎"]},balloon:{interval:140,frames:[" ",".","o","O","@","*"," "]},balloon2:{interval:120,frames:[".","o","O","°","O","o","."]},noise:{interval:100,frames:["▓","▒","░"]},bounce:{interval:120,frames:["⠁","⠂","⠄","⠂"]},boxBounce:{interval:120,frames:["▖","▘","▝","▗"]},boxBounce2:{interval:100,frames:["▌","▀","▐","▄"]},triangle:{interval:50,frames:["◢","◣","◤","◥"]},binary:{interval:80,frames:["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},arc:{interval:100,frames:["◜","◠","◝","◞","◡","◟"]},circle:{interval:120,frames:["◡","⊙","◠"]},squareCorners:{interval:180,frames:["◰","◳","◲","◱"]},circleQuarters:{interval:120,frames:["◴","◷","◶","◵"]},circleHalves:{interval:50,frames:["◐","◓","◑","◒"]},squish:{interval:100,frames:["╫","╪"]},toggle:{interval:250,frames:["⊶","⊷"]},toggle2:{interval:80,frames:["▫","▪"]},toggle3:{interval:120,frames:["□","■"]},toggle4:{interval:100,frames:["■","□","▪","▫"]},toggle5:{interval:100,frames:["▮","▯"]},toggle6:{interval:300,frames:["ဝ","၀"]},toggle7:{interval:80,frames:["⦾","⦿"]},toggle8:{interval:100,frames:["◍","◌"]},toggle9:{interval:100,frames:["◉","◎"]},toggle10:{interval:100,frames:["㊂","㊀","㊁"]},toggle11:{interval:50,frames:["⧇","⧆"]},toggle12:{interval:120,frames:["☗","☖"]},toggle13:{interval:80,frames:["=","*","-"]},arrow:{interval:100,frames:["←","↖","↑","↗","→","↘","↓","↙"]},arrow2:{interval:80,frames:["⬆️ ","↗️ ","➡️ ","↘️ ","⬇️ ","↙️ ","⬅️ ","↖️ "]},arrow3:{interval:120,frames:["▹▹▹▹▹","▸▹▹▹▹","▹▸▹▹▹","▹▹▸▹▹","▹▹▹▸▹","▹▹▹▹▸"]},bouncingBar:{interval:80,frames:["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},bouncingBall:{interval:80,frames:["( ● )","( ● )","( ● )","( ● )","( ●)","( ● )","( ● )","( ● )","( ● )","(● )"]},smiley:{interval:200,frames:["😄 ","😝 "]},monkey:{interval:300,frames:["🙈 ","🙈 ","🙉 ","🙊 "]},hearts:{interval:100,frames:["💛 ","💙 ","💜 ","💚 ","💗 "]},clock:{interval:100,frames:["🕛 ","🕐 ","🕑 ","🕒 ","🕓 ","🕔 ","🕕 ","🕖 ","🕗 ","🕘 ","🕙 ","🕚 "]},earth:{interval:180,frames:["🌍 ","🌎 ","🌏 "]},material:{interval:17,frames:["█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███████▁▁▁▁▁▁▁▁▁▁▁▁▁","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","██████████▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","█████████████▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁██████████████▁▁▁▁","▁▁▁██████████████▁▁▁","▁▁▁▁█████████████▁▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁▁▁████████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁██████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","██████▁▁▁▁▁▁▁▁▁▁▁▁▁█","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁▁█████████████▁▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁▁███████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁▁█████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁"]},moon:{interval:80,frames:["🌑 ","🌒 ","🌓 ","🌔 ","🌕 ","🌖 ","🌗 ","🌘 "]},runner:{interval:140,frames:["🚶 ","🏃 "]},pong:{interval:80,frames:["▐⠂ ▌","▐⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂▌","▐ ⠠▌","▐ ⡀▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐⠠ ▌"]},shark:{interval:120,frames:["▐|\\____________▌","▐_|\\___________▌","▐__|\\__________▌","▐___|\\_________▌","▐____|\\________▌","▐_____|\\_______▌","▐______|\\______▌","▐_______|\\_____▌","▐________|\\____▌","▐_________|\\___▌","▐__________|\\__▌","▐___________|\\_▌","▐____________|\\▌","▐____________/|▌","▐___________/|_▌","▐__________/|__▌","▐_________/|___▌","▐________/|____▌","▐_______/|_____▌","▐______/|______▌","▐_____/|_______▌","▐____/|________▌","▐___/|_________▌","▐__/|__________▌","▐_/|___________▌","▐/|____________▌"]},dqpb:{interval:100,frames:["d","q","p","b"]},weather:{interval:100,frames:["☀️ ","☀️ ","☀️ ","🌤 ","⛅️ ","🌥 ","☁️ ","🌧 ","🌨 ","🌧 ","🌨 ","🌧 ","🌨 ","⛈ ","🌨 ","🌧 ","🌨 ","☁️ ","🌥 ","⛅️ ","🌤 ","☀️ ","☀️ "]},christmas:{interval:400,frames:["🌲","🎄"]},grenade:{interval:80,frames:["، ","′ "," ´ "," ‾ "," ⸌"," ⸊"," |"," ⁎"," ⁕"," ෴ "," ⁓"," "," "," "]},point:{interval:125,frames:["∙∙∙","●∙∙","∙●∙","∙∙●","∙∙∙"]},layer:{interval:150,frames:["-","=","≡"]},betaWave:{interval:80,frames:["ρββββββ","βρβββββ","ββρββββ","βββρβββ","ββββρββ","βββββρβ","ββββββρ"]},fingerDance:{interval:160,frames:["🤘 ","🤟 ","🖖 ","✋ ","🤚 ","👆 "]},fistBump:{interval:80,frames:["🤜    🤛 ","🤜    🤛 ","🤜    🤛 "," 🤜  🤛  ","  🤜🤛   "," 🤜✨🤛   ","🤜 ✨ 🤛  "]},soccerHeader:{interval:80,frames:[" 🧑⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 "]},mindblown:{interval:160,frames:["😐 ","😐 ","😮 ","😮 ","😦 ","😦 ","😧 ","😧 ","🤯 ","💥 ","✨ ","  ","  ","  "]},speaker:{interval:160,frames:["🔈 ","🔉 ","🔊 ","🔉 "]},orangePulse:{interval:100,frames:["🔸 ","🔶 ","🟠 ","🟠 ","🔶 "]},bluePulse:{interval:100,frames:["🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},orangeBluePulse:{interval:100,frames:["🔸 ","🔶 ","🟠 ","🟠 ","🔶 ","🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},timeTravel:{interval:100,frames:["🕛 ","🕚 ","🕙 ","🕘 ","🕗 ","🕖 ","🕕 ","🕔 ","🕓 ","🕒 ","🕑 ","🕐 "]},aesthetic:{interval:80,frames:["▰▱▱▱▱▱▱","▰▰▱▱▱▱▱","▰▰▰▱▱▱▱","▰▰▰▰▱▱▱","▰▰▰▰▰▱▱","▰▰▰▰▰▰▱","▰▰▰▰▰▰▰","▰▱▱▱▱▱▱"]},dwarfFortress:{interval:80,frames:[" ██████£££ ","☺██████£££ ","☺██████£££ ","☺▓█████£££ ","☺▓█████£££ ","☺▒█████£££ ","☺▒█████£££ ","☺░█████£££ ","☺░█████£££ ","☺ █████£££ "," ☺█████£££ "," ☺█████£££ "," ☺▓████£££ "," ☺▓████£££ "," ☺▒████£££ "," ☺▒████£££ "," ☺░████£££ "," ☺░████£££ "," ☺ ████£££ "," ☺████£££ "," ☺████£££ "," ☺▓███£££ "," ☺▓███£££ "," ☺▒███£££ "," ☺▒███£££ "," ☺░███£££ "," ☺░███£££ "," ☺ ███£££ "," ☺███£££ "," ☺███£££ "," ☺▓██£££ "," ☺▓██£££ "," ☺▒██£££ "," ☺▒██£££ "," ☺░██£££ "," ☺░██£££ "," ☺ ██£££ "," ☺██£££ "," ☺██£££ "," ☺▓█£££ "," ☺▓█£££ "," ☺▒█£££ "," ☺▒█£££ "," ☺░█£££ "," ☺░█£££ "," ☺ █£££ "," ☺█£££ "," ☺█£££ "," ☺▓£££ "," ☺▓£££ "," ☺▒£££ "," ☺▒£££ "," ☺░£££ "," ☺░£££ "," ☺ £££ "," ☺£££ "," ☺£££ "," ☺▓££ "," ☺▓££ "," ☺▒££ "," ☺▒££ "," ☺░££ "," ☺░££ "," ☺ ££ "," ☺££ "," ☺££ "," ☺▓£ "," ☺▓£ "," ☺▒£ "," ☺▒£ "," ☺░£ "," ☺░£ "," ☺ £ "," ☺£ "," ☺£ "," ☺▓ "," ☺▓ "," ☺▒ "," ☺▒ "," ☺░ "," ☺░ "," ☺ "," ☺ &"," ☺ ☼&"," ☺ ☼ &"," ☺☼ &"," ☺☼ & "," ‼ & "," ☺ & "," ‼ & "," ☺ & "," ‼ & "," ☺ & ","‼ & "," & "," & "," & ░ "," & ▒ "," & ▓ "," & £ "," & ░£ "," & ▒£ "," & ▓£ "," & ££ "," & ░££ "," & ▒££ ","& ▓££ ","& £££ "," ░£££ "," ▒£££ "," ▓£££ "," █£££ "," ░█£££ "," ▒█£££ "," ▓█£££ "," ██£££ "," ░██£££ "," ▒██£££ "," ▓██£££ "," ███£££ "," ░███£££ "," ▒███£££ "," ▓███£££ "," ████£££ "," ░████£££ "," ▒████£££ "," ▓████£££ "," █████£££ "," ░█████£££ "," ▒█████£££ "," ▓█████£££ "," ██████£££ "," ██████£££ "]}};var $$=vH,oj0=Object.keys(vH);var d3={};H2(d3,{warning:()=>CXD,success:()=>zXD,info:()=>HXD,error:()=>_XD});var hY=yF(),HXD=rC(hY?"ℹ":"i"),zXD=oC(hY?"✔":"√"),CXD=aC(hY?"⚠":"‼"),_XD=iC(hY?"✖":"×");LU();function hH({stream:D=process.stdout}={}){return Boolean(D&&D.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}import H9 from"node:process";var MXD=3;class Sv{#J=0;#$;#F=!1;#D=!1;#Z=(D)=>{if(!D?.length)return;if((typeof D==="string"?D.codePointAt(0):D[0])===MXD)if(H9.listenerCount("SIGINT")>0)H9.emit("SIGINT");else H9.kill(H9.pid,"SIGINT")};start(){if(this.#J++,this.#J===1)this.#Q()}stop(){if(this.#J===0)return;if(--this.#J===0)this.#X()}#Q(){let{stdin:D}=H9;if(H9.platform==="win32"||!D?.isTTY||typeof D.setRawMode!=="function"){this.#$=void 0;return}if(this.#$=D,this.#F=D.isPaused(),this.#D=Boolean(D.isRaw),D.setRawMode(!0),D.prependListener("data",this.#Z),this.#F)D.resume()}#X(){if(!this.#$)return;let D=this.#$;if(D.off("data",this.#Z),D.isTTY)D.setRawMode?.(this.#D);if(this.#F)D.pause();this.#$=void 0,this.#F=!1,this.#D=!1}}var OXD=new Sv,uH=Object.freeze(OXD);var RXD=200,AXD="\x1B[?2026h",IXD="\x1B[?2026l",uY=new Map;class xv{#J=0;#$=-1;#F=0;#D;#Z;#Q;#X;#q=new Map;#W=!1;#G;#Y;#K=!1;color;#B(D){this.#W=!0;try{return D()}finally{this.#W=!1}}#V(){if(this.isSpinning)this.render()}#O(D,F){if(D===void 0||D===null)return"";if(typeof D==="string")return D;if(Buffer.isBuffer(D)||ArrayBuffer.isView(D)){let $=typeof F==="string"&&F&&F!=="buffer"?F:"utf8";return Buffer.from(D).toString($)}return String(D)}#E(D){if(!D)return!1;let F=D.at(-1);return F===`
671
671
  `||F==="\r"}#R(){if(this.#Y)return;if(this.#Y=setTimeout(()=>{if(this.#Y=void 0,this.isSpinning)this.#V()},RXD),typeof this.#Y?.unref==="function")this.#Y.unref()}#H(){if(this.#Y)clearTimeout(this.#Y),this.#Y=void 0}#z(D,F,$,J){let Q=this.#_($," "),X=typeof F==="string"?(D?" ":"")+F:"",Y=this.#M(J," ");return Q+D+X+Y}constructor(D){if(typeof D==="string")D={text:D};if(this.#D={color:"cyan",stream:J$.stderr,discardStdin:!0,hideCursor:!0,...D},this.color=this.#D.color,this.#Q=this.#D.stream,typeof this.#D.isEnabled!=="boolean")this.#D.isEnabled=hH({stream:this.#Q});if(typeof this.#D.isSilent!=="boolean")this.#D.isSilent=!1;let F=this.#D.interval;if(this.spinner=this.#D.spinner,this.#D.interval=F,this.text=this.#D.text,this.prefixText=this.#D.prefixText,this.suffixText=this.#D.suffixText,this.indent=this.#D.indent,J$.env.NODE_ENV==="test")this._stream=this.#Q,this._isEnabled=this.#D.isEnabled,Object.defineProperty(this,"_linesToClear",{get(){return this.#J},set($){this.#J=$}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#$}}),Object.defineProperty(this,"_lineCount",{get(){let $=this.#Q.columns??80,J=typeof this.#D.prefixText==="function"?"":this.#D.prefixText,Q=typeof this.#D.suffixText==="function"?"":this.#D.suffixText,Z=typeof J==="string"&&J!==""?J+" ":"",X=typeof Q==="string"&&Q!==""?" "+Q:"",Y="-",q=" ".repeat(this.#D.indent)+Z+"-"+(typeof this.#D.text==="string"?" "+this.#D.text:"")+X;return this.#U(q,$)}})}get indent(){return this.#D.indent}set indent(D=0){if(!(D>=0&&Number.isInteger(D)))throw Error("The `indent` option must be an integer from 0 and up");this.#D.indent=D}get interval(){return this.#D.interval??this.#Z.interval??100}get spinner(){return this.#Z}set spinner(D){if(this.#$=-1,this.#D.interval=void 0,typeof D==="object"){if(!Array.isArray(D.frames)||D.frames.length===0||D.frames.some((F)=>typeof F!=="string"))throw Error("The given spinner must have a non-empty `frames` array of strings");if(D.interval!==void 0&&!(Number.isInteger(D.interval)&&D.interval>0))throw Error("`spinner.interval` must be a positive integer if provided");this.#Z=D}else if(!yF())this.#Z=$$.line;else if(D===void 0)this.#Z=$$.dots;else if(D!=="default"&&$$[D])this.#Z=$$[D];else throw Error(`There is no built-in spinner named '${D}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#D.text}set text(D=""){this.#D.text=D}get prefixText(){return this.#D.prefixText}set prefixText(D=""){this.#D.prefixText=D}get suffixText(){return this.#D.suffixText}set suffixText(D=""){this.#D.suffixText=D}get isSpinning(){return this.#X!==void 0}#C(D,F,$=!1){let J=typeof D==="function"?D():D;if(typeof J==="string"&&J!=="")return $?F+J:J+F;return""}#_(D=this.#D.prefixText,F=" "){return this.#C(D,F,!1)}#M(D=this.#D.suffixText,F=" "){return this.#C(D,F,!0)}#U(D,F){let $=0;for(let J of EXD(D).split(`
672
672
  `))$+=Math.max(1,Math.ceil(VF(J)/F));return $}get isEnabled(){return this.#D.isEnabled&&!this.#D.isSilent}set isEnabled(D){if(typeof D!=="boolean")throw TypeError("The `isEnabled` option must be a boolean");this.#D.isEnabled=D}get isSilent(){return this.#D.isSilent}set isSilent(D){if(typeof D!=="boolean")throw TypeError("The `isSilent` option must be a boolean");this.#D.isSilent=D}frame(){let D=Date.now();if(this.#$===-1||D-this.#F>=this.interval)this.#$=(this.#$+1)%this.#Z.frames.length,this.#F=D;let{frames:F}=this.#Z,$=F[this.#$];if(this.color)$=v[this.color]($);let J=this.#_(this.#D.prefixText," "),Q=typeof this.text==="string"?" "+this.text:"",Z=this.#M(this.#D.suffixText," ");return J+$+Q+Z}clear(){if(!this.isEnabled||!this.#Q.isTTY)return this;return this.#B(()=>{this.#Q.cursorTo(0);for(let D=0;D<this.#J;D++){if(D>0)this.#Q.moveCursor(0,-1);this.#Q.clearLine(1)}if(this.#D.indent)this.#Q.cursorTo(this.#D.indent)}),this.#J=0,this}#A(D){if(!D||this.#q.has(D)||!D.isTTY||typeof D.write!=="function")return;if(uY.has(D))console.warn("[ora] Multiple concurrent spinners detected. This may cause visual corruption. Use one spinner at a time.");let F=D.write;this.#q.set(D,F),uY.set(D,this),D.write=($,J,Q)=>this.#N(D,F,$,J,Q)}#I(){if(!this.isEnabled||this.#q.size>0)return;let D=new Set([this.#Q,J$.stdout,J$.stderr]);for(let F of D)this.#A(F)}#w(){for(let[D,F]of this.#q)if(D.write=F,uY.get(D)===this)uY.delete(D);this.#q.clear()}#N(D,F,$,J,Q){if(typeof J==="function")Q=J,J=void 0;if(this.#W)return F.call(D,$,J,Q);this.clear();let Z=this.#O($,J),X=this.#E(Z),Y=F.call(D,$,J,Q);if(X)this.#H();else if(Z.length>0)this.#R();if(this.isSpinning&&!this.#Y)this.render();return Y}render(){if(!this.isEnabled||this.#G||this.#Y)return this;let D=this.#Q.isTTY,F=!1;try{if(D)this.#B(()=>this.#Q.write(AXD)),F=!0;this.clear();let $=this.frame(),J=this.#Q.columns??80,Q=this.#U($,J),Z=this.#Q.rows;if(Z&&Z>1&&Q>Z){let Y=$.split(`
673
673
  `),q=Z-1;$=[...Y.slice(0,q),"... (content truncated to fit terminal)"].join(`
674
674
  `)}if(this.#B(()=>this.#Q.write($))===!1&&this.#Q.isTTY)this.#G=()=>{this.#G=void 0,this.#V()},this.#Q.once("drain",this.#G);this.#J=this.#U($,J)}finally{if(F)this.#B(()=>this.#Q.write(IXD))}return this}start(D){if(D)this.text=D;if(this.isSilent)return this;if(!this.isEnabled){let F=this.text?"-":"",$=" ".repeat(this.#D.indent)+this.#z(F,this.text,this.#D.prefixText,this.#D.suffixText);if($.trim()!=="")this.#B(()=>this.#Q.write($+`
675
675
  `));return this}if(this.isSpinning)return this;if(this.#D.hideCursor)n7.hide(this.#Q);if(this.#D.discardStdin&&J$.stdin.isTTY)uH.start(),this.#K=!0;return this.#I(),this.render(),this.#X=setInterval(this.render.bind(this),this.interval),this}stop(){if(clearInterval(this.#X),this.#X=void 0,this.#$=-1,this.#F=0,this.#H(),this.#w(),this.#G)this.#Q.removeListener("drain",this.#G),this.#G=void 0;if(this.isEnabled){if(this.clear(),this.#D.hideCursor)n7.show(this.#Q)}if(this.#K)this.#K=!1,uH.stop();return this}succeed(D){return this.stopAndPersist({symbol:d3.success,text:D})}fail(D){return this.stopAndPersist({symbol:d3.error,text:D})}warn(D){return this.stopAndPersist({symbol:d3.warning,text:D})}info(D){return this.stopAndPersist({symbol:d3.info,text:D})}stopAndPersist(D={}){if(this.isSilent)return this;let F=D.symbol??" ",$=D.text??this.text,J=D.prefixText??this.#D.prefixText,Q=D.suffixText??this.#D.suffixText,Z=this.#z(F,$,J,Q)+`
676
- `;return this.stop(),this.#B(()=>this.#Q.write(Z)),this}}function sD(D){return new xv(D)}var dv=TD(m8(),1);var dH="file",pH="link",lH="symlink",p3="directory";var wXD={"0":"file","1":"link","2":"symlink","3":"character-device","4":"block-device","5":"directory","6":"fifo",x:"pax-header",g:"pax-global-header",L:"gnu-long-name",K:"gnu-long-link-name"},US0=new Uint8Array(512),gH=new Uint8Array(0);var NXD=new TextDecoder;function T1(D,F,$){let J=D.indexOf(0,F),Q=J===-1||J>F+$?F+$:J;return NXD.decode(D.subarray(F,Q))}function cH(D,F,$){let J=0,Q=F+$;for(let Z=F;Z<Q;Z++){let X=D[Z];if(X===0)break;if(X===32)continue;J=J*8+(X-48)}return J}function gY(D,F,$){if(D[F]&128){let J=0;J=D[F]&127;for(let Q=1;Q<$;Q++)J=J*256+D[F+Q];if(!Number.isSafeInteger(J))throw Error("TAR number too large");return J}return cH(D,F,$)}function fv(D,F){let{strip:$,filter:J,map:Q}=F;if(!$&&!J&&!Q)return D;let Z={...D};if($&&$>0){let Y=Z.name.split("/").filter(Boolean);if($>=Y.length)return null;let q=Y.slice($).join("/");if(Z.name=Z.type==="directory"&&!q.endsWith("/")?`${q}/`:q,Z.linkname?.startsWith("/")){let G=Z.linkname.split("/").filter(Boolean);Z.linkname=$>=G.length?"/":`/${G.slice($).join("/")}`}}if(J?.(Z)===!1)return null;let X=Q?Q(Z):Z;if(X&&(!X.name||!X.name.trim()||X.name==="."||X.name==="/"))return null;return X}var TXD=32;function LXD(D){let F=cH(D,148,8),$=0;for(let J=0;J<D.length;J++)if(J>=148&&J<156)$+=TXD;else $+=D[J];return F===$}function PXD(D,F){if(F&&!LXD(D))throw Error("Invalid tar header checksum.");let $=T1(D,156,1),J={name:T1(D,0,100),mode:cH(D,100,8),uid:gY(D,108,8),gid:gY(D,116,8),size:gY(D,124,12),mtime:new Date(gY(D,136,12)*1000),type:wXD[$]||"file",linkname:T1(D,157,100)},Q=T1(D,257,6);if(Q.trim()==="ustar")J.uname=T1(D,265,32),J.gname=T1(D,297,32);if(Q==="ustar")J.prefix=T1(D,345,155);return J}var jXD={path:["name",(D)=>D],linkpath:["linkname",(D)=>D],size:["size",(D)=>parseInt(D,10)],mtime:["mtime",parseFloat],uid:["uid",(D)=>parseInt(D,10)],gid:["gid",(D)=>parseInt(D,10)],uname:["uname",(D)=>D],gname:["gname",(D)=>D]};function SXD(D){let F=new TextDecoder("utf-8"),$={},J={},Q=0;while(Q<D.length){let Z=D.indexOf(32,Q);if(Z===-1)break;let X=parseInt(F.decode(D.subarray(Q,Z)),10);if(Number.isNaN(X)||X===0)break;let Y=Q+X,[q,G]=F.decode(D.subarray(Z+1,Y-1)).split("=",2);if(q&&G!==void 0){J[q]=G;let B=jXD[q];if(B){let[W,K]=B,U=K(G);if(typeof U==="string"||!Number.isNaN(U))$[W]=U}}Q=Y}if(Object.keys(J).length>0)$.pax=J;return $}function kv(D,F){if(F.name!==void 0)D.name=F.name;if(F.linkname!==void 0)D.linkname=F.linkname;if(F.size!==void 0)D.size=F.size;if(F.mtime!==void 0)D.mtime=new Date(F.mtime*1000);if(F.uid!==void 0)D.uid=F.uid;if(F.gid!==void 0)D.gid=F.gid;if(F.uname!==void 0)D.uname=F.uname;if(F.gname!==void 0)D.gname=F.gname;if(F.pax)D.pax=Object.assign({},D.pax??{},F.pax)}function xXD(D){switch(D){case"pax-global-header":case"pax-header":return SXD;case"gnu-long-name":return(F)=>({name:T1(F,0,F.length)});case"gnu-long-link-name":return(F)=>({linkname:T1(F,0,F.length)});default:return}}var VS0=new Uint8Array(1024);var mY=256;function kXD(){let D=Array(mY),F=D.length-1,$=0,J=0,Q=0,Z=(Y)=>{let q=D[$];if(Y===q.length)D[$]=gH,$=$+1&F;else D[$]=q.subarray(Y);if(Q-=Y,Q===0&&D.length>mY)D=Array(mY),F=mY-1,$=0,J=0};function X(Y,q){if(q){let U=0,V=Math.min(Y,Q);while(V>0){let H=D[$],z=Math.min(V,H.length),_=z===H.length?H:H.subarray(0,z);if(Z(z),V-=z,U+=z,!q(_))break}return U}if(Q<Y)return null;if(Y===0)return gH;let G=D[$];if(G.length>=Y){let U=G.length===Y?G:G.subarray(0,Y);return Z(Y),U}let B=new Uint8Array(Y),W=0,K=Y;while(K>0){let U=D[$],V=Math.min(K,U.length);B.set(V===U.length?U:U.subarray(0,V),W),W+=V,K-=V,Z(V)}return B}return{push:(Y)=>{if(Y.length===0)return;let q=J+1&F;if(q===$){let G=D.length,B=G*2,W=Array(B),K=J-$+G&G-1;if($<J)for(let U=0;U<K;U++)W[U]=D[$+U];else if(K>0){let U=G-$;for(let V=0;V<U;V++)W[V]=D[$+V];for(let V=0;V<J;V++)W[U+V]=D[V]}D=W,F=B-1,$=0,J=K,q=J+1&F}D[J]=Y,J=q,Q+=Y.length},available:()=>Q,peek:(Y)=>{if(Q<Y)return null;if(Y===0)return gH;let q=D[$];if(q.length>=Y)return q.length===Y?q:q.subarray(0,Y);let G=new Uint8Array(Y),B=0,W=$;while(B<Y){let K=D[W],U=Math.min(Y-B,K.length);if(U===K.length)G.set(K,B);else G.set(K.subarray(0,U),B);B+=U,W=W+1&F}return G},discard:(Y)=>{if(Y>Q)throw Error("Too many bytes consumed");if(Y===0)return;let q=Y;while(q>0){let G=D[$],B=Math.min(q,G.length);Z(B),q-=B}},pull:X}}var mH=0,Q$=1,dY=Error("Tar archive is truncated.");function bv(D={}){let F=D.strict??!1,{available:$,peek:J,push:Q,discard:Z,pull:X}=kXD(),Y=mH,q=!1,G=!1,B=!1,W=null,K={},U={},V={isEntryActive:()=>Y===Q$,isBodyComplete:()=>!W||W.remaining===0,write(H){if(q)throw Error("Archive already ended.");Q(H)},end(){q=!0},readHeader(){if(Y!==mH)throw Error("Cannot read header while an entry is active");if(G)return;while(!G){if($()<512){if(q){if($()>0&&F)throw dY;G=!0;return}return null}let H=J(512);if(yv(H)){if($()<1024){if(q){if(F)throw dY;G=!0;return}return null}if(yv(J(1024).subarray(512))){Z(1024),G=!0,B=!0;return}if(F)throw Error("Invalid tar header.");Z(512);continue}let z;try{z=PXD(H,F)}catch(C){if(F)throw C;Z(512);continue}let _=xXD(z.type);if(_){let C=z.size+511&-512;if($()<512+C){if(q&&F)throw dY;return null}Z(512);let M=_(X(C).subarray(0,z.size)),E=z.type==="pax-global-header"?K:U;for(let A in M)E[A]=M[A];continue}Z(512);let O=z;if(z.prefix)O.name=`${z.prefix}/${O.name}`;return kv(O,K),kv(O,U),U={},W={header:O,remaining:O.size,padding:-O.size&511},Y=Q$,O}},streamBody(H){if(Y!==Q$||!W||W.remaining===0)return 0;let z=Math.min(W.remaining,$());if(z===0)return 0;let _=X(z,H);return W.remaining-=_,_},skipPadding(){if(Y!==Q$||!W)return!0;if(W.remaining>0)throw Error("Body not fully consumed");if($()<W.padding)return!1;return Z(W.padding),W=null,Y=mH,!0},skipEntry(){if(Y!==Q$||!W)return!0;let H=Math.min(W.remaining,$());if(H>0)Z(H),W.remaining-=H;if(W.remaining>0)return!1;return V.skipPadding()},validateEOF(){if(F){if(!B)throw dY;if($()>0){if(X($()).some((H)=>H!==0))throw Error("Invalid EOF.")}}}};return V}function yv(D){if(D.byteOffset%8===0){let F=new BigUint64Array(D.buffer,D.byteOffset,D.length/8);for(let $=0;$<F.length;$++)if(F[$]!==0n)return!1;return!0}for(let F=0;F<D.length;F++)if(D[F]!==0)return!1;return!0}import*as hD from"node:fs/promises";import{cpus as yXD}from"node:os";import*as lD from"node:path";import{Readable as ES0,Writable as fXD}from"node:stream";import*as j0 from"node:fs";var pY=()=>{let D=new Map;return{get(F){let $=D.get(F);if(D.delete(F))D.set(F,$);return $},set(F,$){if(D.set(F,$).size>1e4)D.delete(D.keys().next().value)}}},vv=pY(),lY=(D)=>{for(let F=0;F<D.length;F++)if(D.charCodeAt(F)>=128){let $=vv.get(D);if($!==void 0)return $;let J=D.normalize("NFD");return vv.set(D,J),J}return D};function l3(D,F,$){let J=lY(lD.resolve(D)),Q=lD.resolve(F);if(J!==Q&&!J.startsWith(Q+lD.sep))throw Error($)}var bXD={":":"","<":"",">":"","|":"","?":"","*":"",'"':""};function vXD(D){let F=D.replace(/\\/g,"/");if(F.split("/").includes("..")||/^[a-zA-Z]:\.\./.test(F))throw Error(`${D} points outside extraction directory`);let $=F;if(/^[a-zA-Z]:/.test($))$=$.replace(/^[a-zA-Z]:[/\\]?/,"");else if($.startsWith("/"))$=$.replace(/^\/+/,"");if(process.platform==="win32")return $.replace(/[<>:"|?*]/g,(J)=>bXD[J]);return $}var hXD=(D)=>lY(vXD(D.replace(/\/+$/,"")));var uXD=(D)=>{let F=0,$=[],J=0,Q=null,Z=null,X=()=>Q??=new Promise((q)=>Z=q),Y=()=>{while(F<D&&J<$.length){let q=$[J++];F++,q().finally(()=>{F--,Y()})}if(J===$.length){if($.length=0,J=0,F===0&&Z)Z(),Q=null,Z=null}};return{add(q){let G=F===0&&J===$.length;return new Promise((B,W)=>{if($.push(()=>Promise.resolve().then(q).then(B,W)),G)X();Y()})},onIdle(){return F===0&&J===$.length?Promise.resolve():X()}}},z9=262144,hv=0,nH=1,c3=2,Z$=3,uv=4,gv=Promise.resolve();function gXD(D,{mode:F=438,mtime:$}={}){let J=hv,Q=!1,Z=null,X=[],Y=[],q=0,G=null,B=null,W=null,K=null,U=[],V=[],H=()=>{if(U.length===0)return;for(let L=0;L<U.length;L++)U[L]();U.length=0,V.length=0},z=(L)=>{if(V.length===0)return;for(let y=0;y<V.length;y++)V[y](L);V.length=0,U.length=0},_=()=>{q=0,X.length=0,Y.length=0},O=()=>{J=Z$,W?.(),H()},C=()=>{let L=X;return X=Y,Y=L,X.length=0,L},M=(L)=>{if(G)return;G=L,J=uv,_(),Q=!1;let y=Z;if(Z=null,y!==null)j0.ftruncate(y,0,()=>j0.close(y));K?.(L),z(L)},E=()=>{if(Z===null){O();return}let L=Z;if(Z=null,$)j0.futimes(L,$,$,(y)=>{if(y)return M(y);j0.close(L,(m)=>{if(m)M(m);else O()})});else j0.close(L,(y)=>{if(y)M(y);else O()})},A=()=>{if(Q||X.length===0||J!==c3)return;Q=!0;let L=C(),y=(m,S=0)=>{if(m)return M(m);if(Q=!1,q-=S,Y.length=0,q<z9)H();if(X.length>0)A();else if(W)E()};if(L.length===1){let m=L[0];j0.write(Z,m,0,m.length,null,y)}else j0.writev(Z,L,y)},w=()=>{if(J!==hv)return;J=nH,j0.open(D,"w",F,(L,y)=>{if(L)return M(L);if(J===Z$||J===uv){j0.close(y);return}if(Z=y,J=c3,W)if(X.length>0)A();else E();else if(q>=z9&&!Q)A();else H()})};return{write:(L)=>{if(G||J>=Z$||W)return!1;if(J!==c3&&J!==nH)w();let y=Buffer.isBuffer(L)?L:L instanceof Uint8Array?Buffer.from(L.buffer,L.byteOffset,L.byteLength):Buffer.from(L);if(y.length===0)return q<z9;if(X.push(y),q+=y.length,J===c3&&!Q&&q>=z9)A();return q<z9},end:()=>{if(J>=Z$)return gv;if(G)return Promise.reject(G);if(B)return B;return B=new Promise((L,y)=>{if(W=L,K=y,J!==c3&&J!==nH)w();else if(J===c3&&!Q)if(X.length>0)A();else E()}),B},destroy:(L)=>{if(L){M(L);return}if(J>=Z$||G)return;if(_(),Q=!1,Z!==null){let y=Z;Z=null,j0.close(y)}O()},waitDrain:()=>{if(q<z9||J!==c3)return gv;return new Promise((L,y)=>{U.push(L),V.push(y)})}}}var X$="ENOENT",mXD=(D,F)=>{let $=pY(),J=pY(),Q=[],Z=pY(),Y=(async(B)=>{let W=lY(lD.resolve(B));try{await hD.mkdir(W,{recursive:!0})}catch(K){if(K.code===X$){let U=lD.dirname(W);if(U===W)throw K;await hD.mkdir(U,{recursive:!0}),await hD.mkdir(W,{recursive:!0})}else throw K}try{return{symbolic:W,real:await hD.realpath(W)}}catch(K){if(K.code===X$)return{symbolic:W,real:W};throw K}})(D);Y.catch(()=>{});let q=async(B,W)=>{let K=await Y;if(B===K.symbolic)return l3(K.real,K.real,W),K.real;let U=Z.get(B);if(!U)U=hD.realpath(B).then((H)=>{return l3(H,K.real,W),H}),Z.set(B,U);let V=await U;return l3(V,K.real,W),V},G=async(B,W)=>{let K=$.get(B);if(K)return K;return K=(async()=>{if(B===(await Y).symbolic)return;await G(lD.dirname(B));try{let U=await hD.lstat(B);if(U.isDirectory())return;if(U.isSymbolicLink())try{let V=await q(B,`Symlink "${B}" points outside the extraction directory.`);if((await hD.stat(V)).isDirectory())return}catch(V){if(V.code===X$)throw Error(`Symlink "${B}" points outside the extraction directory.`);throw V}throw Error(`"${B}" is not a valid directory component.`)}catch(U){if(U.code===X$){await hD.mkdir(B,{mode:W??F.dmode});return}throw U}})(),$.set(B,K),K};return{async ready(){await Y},async preparePath(B){let{name:W,linkname:K,type:U,mode:V,mtime:H}=B,{maxDepth:z=1024,dmode:_}=F,O=hXD(W),C=await Y,M=lD.join(C.symbolic,O);if(l3(M,C.symbolic,`Entry "${W}" points outside the extraction directory.`),z!==1/0){let w=1;for(let R of O)if(R==="/"&&++w>z)throw Error("Tar exceeds max specified depth.")}let E=J.get(O);if(E){if(E===p3&&U!==p3||E!==p3&&U===p3)throw Error(`Path conflict ${U} over existing ${E} at "${W}"`);return}let A=lD.dirname(M);switch(U){case p3:if(J.set(O,p3),await G(M,_??V),H)await hD.lutimes(M,H,H).catch(()=>{});return;case dH:return J.set(O,dH),await G(A),M;case lH:if(J.set(O,lH),!K)return;if(await G(A),l3(lD.resolve(A,K),C.symbolic,`Symlink "${K}" points outside the extraction directory.`),await hD.symlink(K,M),H)await hD.lutimes(M,H,H).catch(()=>{});return;case pH:{if(J.set(O,pH),!K)return;let w=lY(K);if(lD.isAbsolute(w))throw Error(`Hardlink "${K}" points outside the extraction directory.`);let R=lD.join(C.symbolic,w);l3(R,C.symbolic,`Hardlink "${K}" points outside the extraction directory.`),await G(lD.dirname(R));let T=await q(lD.dirname(R),`Hardlink "${K}" points outside the extraction directory.`);if(l3(lD.join(T,lD.basename(R)),C.real,`Hardlink "${K}" points outside the extraction directory.`),R!==M)await G(A),Q.push({linkTarget:R,outPath:M});return}default:return}},async applyLinks(){for(let{linkTarget:B,outPath:W}of Q)try{await hD.link(B,W)}catch(K){if(K.code===X$)throw Error(`Hardlink target "${B}" does not exist for link at "${W}".`);throw K}}}};function mv(D,F={}){let $=bv(F),J=uXD(F.concurrency||yXD().length||8),Q=mXD(D,F),Z=null,X=null;return new fXD({async write(Y,q,G){try{if($.write(Y),$.isEntryActive()){if(Z&&X){let B=!1,W=X;while(!$.isBodyComplete())if(B=!1,$.streamBody(W)===0)if(B)await Z.waitDrain();else{G();return}while(!$.skipPadding()){G();return}let K=Z;if(K)J.add(()=>K.end());Z=null,X=null}else if(!$.skipEntry()){G();return}}while(!0){let B=$.readHeader();if(B===void 0||B===null){G();return}let W=fv(B,F);if(!W){if(!$.skipEntry()){G();return}continue}let K=await J.add(()=>Q.preparePath(W));if(K){let U=gXD(K,{mode:F.fmode??W.mode??void 0,mtime:W.mtime??void 0}),V=!1,H=(z)=>{let _=U.write(z);if(!_)V=!0;return _};while(!$.isBodyComplete())if(V=!1,$.streamBody(H)===0)if(V)await U.waitDrain();else{Z=U,X=H,G();return}while(!$.skipPadding()){Z=U,X=H,G();return}J.add(()=>U.end())}else if(!$.skipEntry()){G();return}}}catch(B){G(B)}},async final(Y){try{$.end(),$.validateEOF(),await Q.ready(),await J.onIdle(),await Q.applyLinks(),Y()}catch(q){Y(q)}},destroy(Y,q){(async()=>{if(Z)Z.destroy(Y??void 0),Z=null,X=null;await J.onIdle()})().then(()=>q(Y??null),(G)=>q(Y??(G instanceof Error?G:Error("Stream destroyed"))))}})}import dXD from"node:path";import{pipeline as pXD}from"node:stream/promises";import{createGunzip as lXD}from"node:zlib";var pv=async(D,F,$)=>{let Q=`https://codeload.github.com/cartesi/application-templates/tar.gz/refs/heads/${F}`;await dv.ensureDir($);let Z=await fetch(Q);if(!Z.ok)throw Error(`Failed to download template: ${Z.statusText}`);let X=mv($,{filter:(Y)=>{return Y.name.split("/").splice(1).join("/").startsWith(`${D}/`)},map:(Y)=>{let q=Y.name.split("/").splice(1).join("/");return Y.name=dXD.relative(D,q),Y}});return await pXD(Z.body,lXD(),X),{dir:$,source:"https://github.com/cartesi/application-templates"}};var cXD="prerelease/sdk-12",nXD=["cpp","cpp-low-level","go","java","javascript","lua","python","ruby","rust","typescript"],lv=()=>{return new ZD("create").argument("<name>","application and directory name").addOption(new S0("-t, --template <template>","template name to use").choices(nXD).makeOptionMandatory()).option("-b, --branch <branch>","cartesi/application-templates repository branch name to use",cXD).action(async(D,{branch:F,template:$})=>{let J=sD("Creating application...").start();try{let{dir:Q}=await pv($,F,D);J.succeed(`Application created at ${v.cyan(Q)}`)}catch(Q){J.fail(Q instanceof Error?`Error creating application: ${v.red(Q.message)}`:String(Q))}})};var cv=()=>{return new ZD("build").description("DEPRECATED: Package the application in a Docker image ready to be deployed.").action(async()=>{console.warn(v.yellow("deploy build command is deprecated"))})};var nv=()=>{let D=new ZD("deploy").description("DEPRECATED: Package and deploy the application to a supported live network.").action(async()=>{console.warn(v.yellow("deploy command is deprecated, use 'cartesi-rollups-cli' directly instead"))});return D.addCommand(cv(),{hidden:!0}),D};var Y$=(D,F=[])=>D.name==="up"||F.includes("vim")&&D.name==="k"||F.includes("emacs")&&D.ctrl&&D.name==="p",cY=(D,F=[])=>D.name==="down"||F.includes("vim")&&D.name==="j"||F.includes("emacs")&&D.ctrl&&D.name==="n";var q$=(D)=>D.name==="backspace",G$=(D)=>D.name==="tab",iH=(D)=>"1234567890".includes(D.name),n3=(D)=>D.name==="enter"||D.name==="return";class oH extends Error{name="AbortPromptError";message="Prompt was aborted";constructor(D){super();this.cause=D?.cause}}class aH extends Error{name="CancelPromptError";message="Prompt was canceled"}class C9 extends Error{name="ExitPromptError"}class rH extends Error{name="HookError"}class B$ extends Error{name="ValidationError"}import{AsyncResource as rXD}from"node:async_hooks";import{AsyncLocalStorage as iXD,AsyncResource as oXD}from"node:async_hooks";var iv=new iXD;function aXD(D){return{rl:D,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function ov(D,F){let $=aXD(D);return iv.run($,()=>{function J(Q){$.handleChange=()=>{$.index=0,Q()},$.handleChange()}return F(J)})}function i3(){let D=iv.getStore();if(!D)throw new rH("[Inquirer] Hook functions can only be called from within a prompt");return D}function sH(){return i3().rl}function tH(D){let F=(...$)=>{let J=i3(),Q=!1,Z=J.handleChange;J.handleChange=()=>{Q=!0};let X=D(...$);if(Q)Z();return J.handleChange=Z,X};return oXD.bind(F)}function _9(D){let F=i3(),{index:$}=F,J={get(){return F.hooks[$]},set(Z){F.hooks[$]=Z},initialized:$ in F.hooks},Q=D(J);return F.index++,Q}function av(){i3().handleChange()}var o3={queue(D){let F=i3(),{index:$}=F;F.hooksEffect.push(()=>{F.hooksCleanup[$]?.();let J=D(sH());if(J!=null&&typeof J!=="function")throw new B$("useEffect return value must be a cleanup function or nothing.");F.hooksCleanup[$]=J})},run(){let D=i3();tH(()=>{D.hooksEffect.forEach((F)=>{F()}),D.hooksEffect.length=0})()},clearAll(){let D=i3();D.hooksCleanup.forEach((F)=>{F?.()}),D.hooksEffect.length=0,D.hooksCleanup.length=0}};function C0(D){return _9((F)=>{let $=rXD.bind(function(Z){if(F.get()!==Z)F.set(Z),av()});if(F.initialized)return[F.get(),$];let J=typeof D==="function"?D():D;return F.set(J),[J,$]})}function L1(D,F){_9(($)=>{let J=$.get();if(!Array.isArray(J)||F.some((Z,X)=>!Object.is(Z,J[X])))o3.queue(D);$.set(F)})}import{styleText as Z8}from"node:util";import c8 from"node:process";function sXD(){if(c8.platform!=="win32")return c8.env.TERM!=="linux";return Boolean(c8.env.WT_SESSION)||Boolean(c8.env.TERMINUS_SUBLIME)||c8.env.ConEmuTask==="{cmd::Cmder}"||c8.env.TERM_PROGRAM==="Terminus-Sublime"||c8.env.TERM_PROGRAM==="vscode"||c8.env.TERM==="xterm-256color"||c8.env.TERM==="alacritty"||c8.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var rv={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"█",squareDarkShade:"▓",squareMediumShade:"▒",squareLightShade:"░",squareTop:"▀",squareBottom:"▄",squareLeft:"▌",squareRight:"▐",squareCenter:"■",bullet:"●",dot:"․",ellipsis:"…",pointerSmall:"›",triangleUp:"▲",triangleUpSmall:"▴",triangleDown:"▼",triangleDownSmall:"▾",triangleLeftSmall:"◂",triangleRightSmall:"▸",home:"⌂",heart:"♥",musicNote:"♪",musicNoteBeamed:"♫",arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",arrowLeftRight:"↔",arrowUpDown:"↕",almostEqual:"≈",notEqual:"≠",lessOrEqual:"≤",greaterOrEqual:"≥",identical:"≡",infinity:"∞",subscriptZero:"₀",subscriptOne:"₁",subscriptTwo:"₂",subscriptThree:"₃",subscriptFour:"₄",subscriptFive:"₅",subscriptSix:"₆",subscriptSeven:"₇",subscriptEight:"₈",subscriptNine:"₉",oneHalf:"½",oneThird:"⅓",oneQuarter:"¼",oneFifth:"⅕",oneSixth:"⅙",oneEighth:"⅛",twoThirds:"⅔",twoFifths:"⅖",threeQuarters:"¾",threeFifths:"⅗",threeEighths:"⅜",fourFifths:"⅘",fiveSixths:"⅚",fiveEighths:"⅝",sevenEighths:"⅞",line:"─",lineBold:"━",lineDouble:"═",lineDashed0:"┄",lineDashed1:"┅",lineDashed2:"┈",lineDashed3:"┉",lineDashed4:"╌",lineDashed5:"╍",lineDashed6:"╴",lineDashed7:"╶",lineDashed8:"╸",lineDashed9:"╺",lineDashed10:"╼",lineDashed11:"╾",lineDashed12:"−",lineDashed13:"–",lineDashed14:"‐",lineDashed15:"⁃",lineVertical:"│",lineVerticalBold:"┃",lineVerticalDouble:"║",lineVerticalDashed0:"┆",lineVerticalDashed1:"┇",lineVerticalDashed2:"┊",lineVerticalDashed3:"┋",lineVerticalDashed4:"╎",lineVerticalDashed5:"╏",lineVerticalDashed6:"╵",lineVerticalDashed7:"╷",lineVerticalDashed8:"╹",lineVerticalDashed9:"╻",lineVerticalDashed10:"╽",lineVerticalDashed11:"╿",lineDownLeft:"┐",lineDownLeftArc:"╮",lineDownBoldLeftBold:"┓",lineDownBoldLeft:"┒",lineDownLeftBold:"┑",lineDownDoubleLeftDouble:"╗",lineDownDoubleLeft:"╖",lineDownLeftDouble:"╕",lineDownRight:"┌",lineDownRightArc:"╭",lineDownBoldRightBold:"┏",lineDownBoldRight:"┎",lineDownRightBold:"┍",lineDownDoubleRightDouble:"╔",lineDownDoubleRight:"╓",lineDownRightDouble:"╒",lineUpLeft:"┘",lineUpLeftArc:"╯",lineUpBoldLeftBold:"┛",lineUpBoldLeft:"┚",lineUpLeftBold:"┙",lineUpDoubleLeftDouble:"╝",lineUpDoubleLeft:"╜",lineUpLeftDouble:"╛",lineUpRight:"└",lineUpRightArc:"╰",lineUpBoldRightBold:"┗",lineUpBoldRight:"┖",lineUpRightBold:"┕",lineUpDoubleRightDouble:"╚",lineUpDoubleRight:"╙",lineUpRightDouble:"╘",lineUpDownLeft:"┤",lineUpBoldDownBoldLeftBold:"┫",lineUpBoldDownBoldLeft:"┨",lineUpDownLeftBold:"┥",lineUpBoldDownLeftBold:"┩",lineUpDownBoldLeftBold:"┪",lineUpDownBoldLeft:"┧",lineUpBoldDownLeft:"┦",lineUpDoubleDownDoubleLeftDouble:"╣",lineUpDoubleDownDoubleLeft:"╢",lineUpDownLeftDouble:"╡",lineUpDownRight:"├",lineUpBoldDownBoldRightBold:"┣",lineUpBoldDownBoldRight:"┠",lineUpDownRightBold:"┝",lineUpBoldDownRightBold:"┡",lineUpDownBoldRightBold:"┢",lineUpDownBoldRight:"┟",lineUpBoldDownRight:"┞",lineUpDoubleDownDoubleRightDouble:"╠",lineUpDoubleDownDoubleRight:"╟",lineUpDownRightDouble:"╞",lineDownLeftRight:"┬",lineDownBoldLeftBoldRightBold:"┳",lineDownLeftBoldRightBold:"┯",lineDownBoldLeftRight:"┰",lineDownBoldLeftBoldRight:"┱",lineDownBoldLeftRightBold:"┲",lineDownLeftRightBold:"┮",lineDownLeftBoldRight:"┭",lineDownDoubleLeftDoubleRightDouble:"╦",lineDownDoubleLeftRight:"╥",lineDownLeftDoubleRightDouble:"╤",lineUpLeftRight:"┴",lineUpBoldLeftBoldRightBold:"┻",lineUpLeftBoldRightBold:"┷",lineUpBoldLeftRight:"┸",lineUpBoldLeftBoldRight:"┹",lineUpBoldLeftRightBold:"┺",lineUpLeftRightBold:"┶",lineUpLeftBoldRight:"┵",lineUpDoubleLeftDoubleRightDouble:"╩",lineUpDoubleLeftRight:"╨",lineUpLeftDoubleRightDouble:"╧",lineUpDownLeftRight:"┼",lineUpBoldDownBoldLeftBoldRightBold:"╋",lineUpDownBoldLeftBoldRightBold:"╈",lineUpBoldDownLeftBoldRightBold:"╇",lineUpBoldDownBoldLeftRightBold:"╊",lineUpBoldDownBoldLeftBoldRight:"╉",lineUpBoldDownLeftRight:"╀",lineUpDownBoldLeftRight:"╁",lineUpDownLeftBoldRight:"┽",lineUpDownLeftRightBold:"┾",lineUpBoldDownBoldLeftRight:"╂",lineUpDownLeftBoldRightBold:"┿",lineUpBoldDownLeftBoldRight:"╃",lineUpBoldDownLeftRightBold:"╄",lineUpDownBoldLeftBoldRight:"╅",lineUpDownBoldLeftRightBold:"╆",lineUpDoubleDownDoubleLeftDoubleRightDouble:"╬",lineUpDoubleDownDoubleLeftRight:"╫",lineUpDownLeftDoubleRightDouble:"╪",lineCross:"╳",lineBackslash:"╲",lineSlash:"╱"},sv={tick:"✔",info:"ℹ",warning:"⚠",cross:"✘",squareSmall:"◻",squareSmallFilled:"◼",circle:"◯",circleFilled:"◉",circleDotted:"◌",circleDouble:"◎",circleCircle:"ⓞ",circleCross:"ⓧ",circlePipe:"Ⓘ",radioOn:"◉",radioOff:"◯",checkboxOn:"☒",checkboxOff:"☐",checkboxCircleOn:"ⓧ",checkboxCircleOff:"Ⓘ",pointer:"❯",triangleUpOutline:"△",triangleLeft:"◀",triangleRight:"▶",lozenge:"◆",lozengeOutline:"◇",hamburger:"☰",smiley:"㋡",mustache:"෴",star:"★",play:"▶",nodejs:"⬢",oneSeventh:"⅐",oneNinth:"⅑",oneTenth:"⅒"},tXD={tick:"√",info:"i",warning:"‼",cross:"×",squareSmall:"□",squareSmallFilled:"■",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(○)",circleCross:"(×)",circlePipe:"(│)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[×]",checkboxOff:"[ ]",checkboxCircleOn:"(×)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"∆",triangleLeft:"◄",triangleRight:"►",lozenge:"♦",lozengeOutline:"◊",hamburger:"≡",smiley:"☺",mustache:"┌─┐",star:"✶",play:"►",nodejs:"♦",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},eXD={...rv,...sv},DYD={...rv,...tXD},FYD=sXD(),$YD=FYD?eXD:DYD,M9=$YD,sS0=Object.entries(sv);var tv={prefix:{idle:Z8("blue","?"),done:Z8("green",M9.tick)},spinner:{interval:80,frames:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"].map((D)=>Z8("yellow",D))},style:{answer:(D)=>Z8("cyan",D),message:(D)=>Z8("bold",D),error:(D)=>Z8("red",`> ${D}`),defaultAnswer:(D)=>Z8("dim",`(${D})`),help:(D)=>Z8("dim",D),highlight:(D)=>Z8("cyan",D),key:(D)=>Z8("cyan",Z8("bold",`<${D}>`))}};function ev(D){if(typeof D!=="object"||D===null)return!1;let F=D;while(Object.getPrototypeOf(F)!==null)F=Object.getPrototypeOf(F);return Object.getPrototypeOf(D)===F}function Dh(...D){let F={};for(let $ of D)for(let[J,Q]of Object.entries($)){let Z=F[J];F[J]=ev(Z)&&ev(Q)?Dh(Z,Q):Q}return F}function P1(...D){let F=[tv,...D.filter(($)=>$!=null)];return Dh(...F)}function a3({status:D="idle",theme:F}){let[$,J]=C0(!1),[Q,Z]=C0(0),{prefix:X,spinner:Y}=P1(F);if(L1(()=>{if(D==="loading"){let G,B=-1,W=setTimeout(()=>{J(!0),G=setInterval(()=>{B=B+1,Z(B%Y.frames.length)},Y.interval)},300);return()=>{clearTimeout(W),clearInterval(G)}}else J(!1)},[D]),$)return Y.frames[Q];return typeof X==="string"?X:X[D==="loading"?"idle":D]??X.idle}function W$(D,F){return _9(($)=>{let J=$.get();if(!J||J.dependencies.length!==F.length||J.dependencies.some((Q,Z)=>Q!==F[Z])){let Q=D();return $.set({value:Q,dependencies:F}),Q}return J.value})}function r3(D){return C0({current:D})[0]}function j1(D){let F=r3(D);F.current=D,L1(($)=>{let J=!1,Q=tH((Z,X)=>{if(J)return;F.current(X,$)});return $.input.on("keypress",Q),()=>{J=!0,$.input.removeListener("keypress",Q)}},[])}var _h=TD($h(),1);var Jh=(()=>{let D=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return(F)=>{let $=0;D.lastIndex=0;while(D.test(F))$+=1;return F.length-$}})(),Qh=(D)=>{return D===12288||D>=65281&&D<=65376||D>=65504&&D<=65510},Zh=(D)=>{return D===8987||D===9001||D>=12272&&D<=12287||D>=12289&&D<=12350||D>=12441&&D<=12543||D>=12549&&D<=12591||D>=12593&&D<=12686||D>=12688&&D<=12771||D>=12783&&D<=12830||D>=12832&&D<=12871||D>=12880&&D<=19903||D>=65040&&D<=65049||D>=65072&&D<=65106||D>=65108&&D<=65126||D>=65128&&D<=65131||D>=127488&&D<=127490||D>=127504&&D<=127547||D>=127552&&D<=127560||D>=131072&&D<=196605||D>=196608&&D<=262141};var ZYD=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,XYD=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Xh=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,YYD=/\t{1,1000}/y,Yh=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,qYD=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,GYD=/\p{M}+/gu,BYD={limit:1/0,ellipsis:""},qh=(D,F={},$={})=>{let J=F.limit??1/0,Q=F.ellipsis??"",Z=F?.ellipsisWidth??(Q?qh(Q,BYD,$).width:0),X=0,Y=$.controlWidth??0,q=$.tabWidth??8,G=$.emojiWidth??2,B=2,W=$.regularWidth??1,K=$.wideWidth??2,U=[[qYD,W],[ZYD,0],[XYD,Y],[YYD,q],[Yh,G],[Xh,K]],V=0,H=0,z=D.length,_=0,O=!1,C=z,M=Math.max(0,J-Z),E=0,A=0,w=0,R=0;D:while(!0){if(A>E||H>=z&&H>V){let T=D.slice(E,A)||D.slice(V,H);_=0;for(let N of T.replaceAll(GYD,"")){let j=N.codePointAt(0)||0;if(Qh(j))R=2;else if(Zh(j))R=K;else R=W;if(w+R>M)C=Math.min(C,Math.max(E,V)+_);if(w+R>J){O=!0;break D}_+=N.length,w+=R}E=A=0}if(H>=z)break D;for(let T=0,N=U.length;T<N;T++){let[j,L]=U[T];if(j.lastIndex=H,j.test(D)){if(_=j===Xh?Jh(D.slice(H,j.lastIndex)):j===Yh?1:j.lastIndex-H,R=_*L,w+R>M)C=Math.min(C,H+Math.floor((M-w)/L));if(w+R>J){O=!0;break D}w+=R,E=V,A=H,H=V=j.lastIndex;continue D}}H+=1}return{width:O?M:w,index:O?C:z,truncated:O,ellipsed:O&&J>=Z}},Gh=qh;var WYD={limit:1/0,ellipsis:"",ellipsisWidth:0},KYD=(D,F={})=>{return Gh(D,WYD,F).width},S1=KYD;var nY="\x1B",Vh="›",UYD=39,Dz="\x07",Hh="[",VYD="]",zh="m",Fz=`${VYD}8;;`,Bh=new RegExp(`(?:\\${Hh}(?<code>\\d+)m|\\${Fz}(?<uri>.*)${Dz})`,"y"),Wh=(D)=>{if(D>=30&&D<=37)return 39;if(D>=90&&D<=97)return 39;if(D>=40&&D<=47)return 49;if(D>=100&&D<=107)return 49;if(D===1||D===2)return 22;if(D===3)return 23;if(D===4)return 24;if(D===7)return 27;if(D===8)return 28;if(D===9)return 29;if(D===0)return 0;return},Kh=(D)=>`${nY}${Hh}${D}${zh}`,Uh=(D)=>`${nY}${Fz}${D}${Dz}`,eH=(D,F,$)=>{let J=F[Symbol.iterator](),Q=!1,Z=!1,X=D.at(-1),Y=X===void 0?0:S1(X),q=J.next(),G=J.next(),B=0;while(!q.done){let W=q.value,K=S1(W);if(Y+K<=$)D[D.length-1]+=W;else D.push(W),Y=0;if(W===nY||W===Vh)Q=!0,Z=F.startsWith(Fz,B+1);if(Q){if(Z){if(W===Dz)Q=!1,Z=!1}else if(W===zh)Q=!1}else if(Y+=K,Y===$&&!G.done)D.push(""),Y=0;q=G,G=J.next(),B+=W.length}if(X=D.at(-1),!Y&&X!==void 0&&X.length&&D.length>1)D[D.length-2]+=D.pop()},HYD=(D)=>{let F=D.split(" "),$=F.length;while($){if(S1(F[$-1]))break;$--}if($===F.length)return D;return F.slice(0,$).join(" ")+F.slice($).join("")},zYD=(D,F,$={})=>{if($.trim!==!1&&D.trim()==="")return"";let J="",Q,Z,X=D.split(" "),Y=[""],q=0;for(let W=0;W<X.length;W++){let K=X[W];if($.trim!==!1){let V=Y.at(-1)??"",H=V.trimStart();if(V.length!==H.length)Y[Y.length-1]=H,q=S1(H)}if(W!==0){if(q>=F&&($.wordWrap===!1||$.trim===!1))Y.push(""),q=0;if(q||$.trim===!1)Y[Y.length-1]+=" ",q++}let U=S1(K);if($.hard&&U>F){let V=F-q,H=1+Math.floor((U-V-1)/F);if(Math.floor((U-1)/F)<H)Y.push("");eH(Y,K,F),q=S1(Y.at(-1)??"");continue}if(q+U>F&&q&&U){if($.wordWrap===!1&&q<F){eH(Y,K,F),q=S1(Y.at(-1)??"");continue}Y.push(""),q=0}if(q+U>F&&$.wordWrap===!1){eH(Y,K,F),q=S1(Y.at(-1)??"");continue}Y[Y.length-1]+=K,q+=U}if($.trim!==!1)Y=Y.map((W)=>HYD(W));let G=Y.join(`
676
+ `;return this.stop(),this.#B(()=>this.#Q.write(Z)),this}}function sD(D){return new xv(D)}var dv=TD(m8(),1);var dH="file",pH="link",lH="symlink",p3="directory";var wXD={"0":"file","1":"link","2":"symlink","3":"character-device","4":"block-device","5":"directory","6":"fifo",x:"pax-header",g:"pax-global-header",L:"gnu-long-name",K:"gnu-long-link-name"},US0=new Uint8Array(512),gH=new Uint8Array(0);var NXD=new TextDecoder;function T1(D,F,$){let J=D.indexOf(0,F),Q=J===-1||J>F+$?F+$:J;return NXD.decode(D.subarray(F,Q))}function cH(D,F,$){let J=0,Q=F+$;for(let Z=F;Z<Q;Z++){let X=D[Z];if(X===0)break;if(X===32)continue;J=J*8+(X-48)}return J}function gY(D,F,$){if(D[F]&128){let J=0;J=D[F]&127;for(let Q=1;Q<$;Q++)J=J*256+D[F+Q];if(!Number.isSafeInteger(J))throw Error("TAR number too large");return J}return cH(D,F,$)}function fv(D,F){let{strip:$,filter:J,map:Q}=F;if(!$&&!J&&!Q)return D;let Z={...D};if($&&$>0){let Y=Z.name.split("/").filter(Boolean);if($>=Y.length)return null;let q=Y.slice($).join("/");if(Z.name=Z.type==="directory"&&!q.endsWith("/")?`${q}/`:q,Z.linkname?.startsWith("/")){let G=Z.linkname.split("/").filter(Boolean);Z.linkname=$>=G.length?"/":`/${G.slice($).join("/")}`}}if(J?.(Z)===!1)return null;let X=Q?Q(Z):Z;if(X&&(!X.name||!X.name.trim()||X.name==="."||X.name==="/"))return null;return X}var TXD=32;function LXD(D){let F=cH(D,148,8),$=0;for(let J=0;J<D.length;J++)if(J>=148&&J<156)$+=TXD;else $+=D[J];return F===$}function PXD(D,F){if(F&&!LXD(D))throw Error("Invalid tar header checksum.");let $=T1(D,156,1),J={name:T1(D,0,100),mode:cH(D,100,8),uid:gY(D,108,8),gid:gY(D,116,8),size:gY(D,124,12),mtime:new Date(gY(D,136,12)*1000),type:wXD[$]||"file",linkname:T1(D,157,100)},Q=T1(D,257,6);if(Q.trim()==="ustar")J.uname=T1(D,265,32),J.gname=T1(D,297,32);if(Q==="ustar")J.prefix=T1(D,345,155);return J}var jXD={path:["name",(D)=>D],linkpath:["linkname",(D)=>D],size:["size",(D)=>parseInt(D,10)],mtime:["mtime",parseFloat],uid:["uid",(D)=>parseInt(D,10)],gid:["gid",(D)=>parseInt(D,10)],uname:["uname",(D)=>D],gname:["gname",(D)=>D]};function SXD(D){let F=new TextDecoder("utf-8"),$={},J={},Q=0;while(Q<D.length){let Z=D.indexOf(32,Q);if(Z===-1)break;let X=parseInt(F.decode(D.subarray(Q,Z)),10);if(Number.isNaN(X)||X===0)break;let Y=Q+X,[q,G]=F.decode(D.subarray(Z+1,Y-1)).split("=",2);if(q&&G!==void 0){J[q]=G;let B=jXD[q];if(B){let[W,K]=B,U=K(G);if(typeof U==="string"||!Number.isNaN(U))$[W]=U}}Q=Y}if(Object.keys(J).length>0)$.pax=J;return $}function kv(D,F){if(F.name!==void 0)D.name=F.name;if(F.linkname!==void 0)D.linkname=F.linkname;if(F.size!==void 0)D.size=F.size;if(F.mtime!==void 0)D.mtime=new Date(F.mtime*1000);if(F.uid!==void 0)D.uid=F.uid;if(F.gid!==void 0)D.gid=F.gid;if(F.uname!==void 0)D.uname=F.uname;if(F.gname!==void 0)D.gname=F.gname;if(F.pax)D.pax=Object.assign({},D.pax??{},F.pax)}function xXD(D){switch(D){case"pax-global-header":case"pax-header":return SXD;case"gnu-long-name":return(F)=>({name:T1(F,0,F.length)});case"gnu-long-link-name":return(F)=>({linkname:T1(F,0,F.length)});default:return}}var VS0=new Uint8Array(1024);var mY=256;function kXD(){let D=Array(mY),F=D.length-1,$=0,J=0,Q=0,Z=(Y)=>{let q=D[$];if(Y===q.length)D[$]=gH,$=$+1&F;else D[$]=q.subarray(Y);if(Q-=Y,Q===0&&D.length>mY)D=Array(mY),F=mY-1,$=0,J=0};function X(Y,q){if(q){let U=0,V=Math.min(Y,Q);while(V>0){let H=D[$],z=Math.min(V,H.length),_=z===H.length?H:H.subarray(0,z);if(Z(z),V-=z,U+=z,!q(_))break}return U}if(Q<Y)return null;if(Y===0)return gH;let G=D[$];if(G.length>=Y){let U=G.length===Y?G:G.subarray(0,Y);return Z(Y),U}let B=new Uint8Array(Y),W=0,K=Y;while(K>0){let U=D[$],V=Math.min(K,U.length);B.set(V===U.length?U:U.subarray(0,V),W),W+=V,K-=V,Z(V)}return B}return{push:(Y)=>{if(Y.length===0)return;let q=J+1&F;if(q===$){let G=D.length,B=G*2,W=Array(B),K=J-$+G&G-1;if($<J)for(let U=0;U<K;U++)W[U]=D[$+U];else if(K>0){let U=G-$;for(let V=0;V<U;V++)W[V]=D[$+V];for(let V=0;V<J;V++)W[U+V]=D[V]}D=W,F=B-1,$=0,J=K,q=J+1&F}D[J]=Y,J=q,Q+=Y.length},available:()=>Q,peek:(Y)=>{if(Q<Y)return null;if(Y===0)return gH;let q=D[$];if(q.length>=Y)return q.length===Y?q:q.subarray(0,Y);let G=new Uint8Array(Y),B=0,W=$;while(B<Y){let K=D[W],U=Math.min(Y-B,K.length);if(U===K.length)G.set(K,B);else G.set(K.subarray(0,U),B);B+=U,W=W+1&F}return G},discard:(Y)=>{if(Y>Q)throw Error("Too many bytes consumed");if(Y===0)return;let q=Y;while(q>0){let G=D[$],B=Math.min(q,G.length);Z(B),q-=B}},pull:X}}var mH=0,Q$=1,dY=Error("Tar archive is truncated.");function bv(D={}){let F=D.strict??!1,{available:$,peek:J,push:Q,discard:Z,pull:X}=kXD(),Y=mH,q=!1,G=!1,B=!1,W=null,K={},U={},V={isEntryActive:()=>Y===Q$,isBodyComplete:()=>!W||W.remaining===0,write(H){if(q)throw Error("Archive already ended.");Q(H)},end(){q=!0},readHeader(){if(Y!==mH)throw Error("Cannot read header while an entry is active");if(G)return;while(!G){if($()<512){if(q){if($()>0&&F)throw dY;G=!0;return}return null}let H=J(512);if(yv(H)){if($()<1024){if(q){if(F)throw dY;G=!0;return}return null}if(yv(J(1024).subarray(512))){Z(1024),G=!0,B=!0;return}if(F)throw Error("Invalid tar header.");Z(512);continue}let z;try{z=PXD(H,F)}catch(C){if(F)throw C;Z(512);continue}let _=xXD(z.type);if(_){let C=z.size+511&-512;if($()<512+C){if(q&&F)throw dY;return null}Z(512);let M=_(X(C).subarray(0,z.size)),E=z.type==="pax-global-header"?K:U;for(let A in M)E[A]=M[A];continue}Z(512);let O=z;if(z.prefix)O.name=`${z.prefix}/${O.name}`;return kv(O,K),kv(O,U),U={},W={header:O,remaining:O.size,padding:-O.size&511},Y=Q$,O}},streamBody(H){if(Y!==Q$||!W||W.remaining===0)return 0;let z=Math.min(W.remaining,$());if(z===0)return 0;let _=X(z,H);return W.remaining-=_,_},skipPadding(){if(Y!==Q$||!W)return!0;if(W.remaining>0)throw Error("Body not fully consumed");if($()<W.padding)return!1;return Z(W.padding),W=null,Y=mH,!0},skipEntry(){if(Y!==Q$||!W)return!0;let H=Math.min(W.remaining,$());if(H>0)Z(H),W.remaining-=H;if(W.remaining>0)return!1;return V.skipPadding()},validateEOF(){if(F){if(!B)throw dY;if($()>0){if(X($()).some((H)=>H!==0))throw Error("Invalid EOF.")}}}};return V}function yv(D){if(D.byteOffset%8===0){let F=new BigUint64Array(D.buffer,D.byteOffset,D.length/8);for(let $=0;$<F.length;$++)if(F[$]!==0n)return!1;return!0}for(let F=0;F<D.length;F++)if(D[F]!==0)return!1;return!0}import*as hD from"node:fs/promises";import{cpus as yXD}from"node:os";import*as lD from"node:path";import{Readable as ES0,Writable as fXD}from"node:stream";import*as j0 from"node:fs";var pY=()=>{let D=new Map;return{get(F){let $=D.get(F);if(D.delete(F))D.set(F,$);return $},set(F,$){if(D.set(F,$).size>1e4)D.delete(D.keys().next().value)}}},vv=pY(),lY=(D)=>{for(let F=0;F<D.length;F++)if(D.charCodeAt(F)>=128){let $=vv.get(D);if($!==void 0)return $;let J=D.normalize("NFD");return vv.set(D,J),J}return D};function l3(D,F,$){let J=lY(lD.resolve(D)),Q=lD.resolve(F);if(J!==Q&&!J.startsWith(Q+lD.sep))throw Error($)}var bXD={":":"","<":"",">":"","|":"","?":"","*":"",'"':""};function vXD(D){let F=D.replace(/\\/g,"/");if(F.split("/").includes("..")||/^[a-zA-Z]:\.\./.test(F))throw Error(`${D} points outside extraction directory`);let $=F;if(/^[a-zA-Z]:/.test($))$=$.replace(/^[a-zA-Z]:[/\\]?/,"");else if($.startsWith("/"))$=$.replace(/^\/+/,"");if(process.platform==="win32")return $.replace(/[<>:"|?*]/g,(J)=>bXD[J]);return $}var hXD=(D)=>lY(vXD(D.replace(/\/+$/,"")));var uXD=(D)=>{let F=0,$=[],J=0,Q=null,Z=null,X=()=>Q??=new Promise((q)=>Z=q),Y=()=>{while(F<D&&J<$.length){let q=$[J++];F++,q().finally(()=>{F--,Y()})}if(J===$.length){if($.length=0,J=0,F===0&&Z)Z(),Q=null,Z=null}};return{add(q){let G=F===0&&J===$.length;return new Promise((B,W)=>{if($.push(()=>Promise.resolve().then(q).then(B,W)),G)X();Y()})},onIdle(){return F===0&&J===$.length?Promise.resolve():X()}}},z9=262144,hv=0,nH=1,c3=2,Z$=3,uv=4,gv=Promise.resolve();function gXD(D,{mode:F=438,mtime:$}={}){let J=hv,Q=!1,Z=null,X=[],Y=[],q=0,G=null,B=null,W=null,K=null,U=[],V=[],H=()=>{if(U.length===0)return;for(let L=0;L<U.length;L++)U[L]();U.length=0,V.length=0},z=(L)=>{if(V.length===0)return;for(let y=0;y<V.length;y++)V[y](L);V.length=0,U.length=0},_=()=>{q=0,X.length=0,Y.length=0},O=()=>{J=Z$,W?.(),H()},C=()=>{let L=X;return X=Y,Y=L,X.length=0,L},M=(L)=>{if(G)return;G=L,J=uv,_(),Q=!1;let y=Z;if(Z=null,y!==null)j0.ftruncate(y,0,()=>j0.close(y));K?.(L),z(L)},E=()=>{if(Z===null){O();return}let L=Z;if(Z=null,$)j0.futimes(L,$,$,(y)=>{if(y)return M(y);j0.close(L,(m)=>{if(m)M(m);else O()})});else j0.close(L,(y)=>{if(y)M(y);else O()})},A=()=>{if(Q||X.length===0||J!==c3)return;Q=!0;let L=C(),y=(m,S=0)=>{if(m)return M(m);if(Q=!1,q-=S,Y.length=0,q<z9)H();if(X.length>0)A();else if(W)E()};if(L.length===1){let m=L[0];j0.write(Z,m,0,m.length,null,y)}else j0.writev(Z,L,y)},I=()=>{if(J!==hv)return;J=nH,j0.open(D,"w",F,(L,y)=>{if(L)return M(L);if(J===Z$||J===uv){j0.close(y);return}if(Z=y,J=c3,W)if(X.length>0)A();else E();else if(q>=z9&&!Q)A();else H()})};return{write:(L)=>{if(G||J>=Z$||W)return!1;if(J!==c3&&J!==nH)I();let y=Buffer.isBuffer(L)?L:L instanceof Uint8Array?Buffer.from(L.buffer,L.byteOffset,L.byteLength):Buffer.from(L);if(y.length===0)return q<z9;if(X.push(y),q+=y.length,J===c3&&!Q&&q>=z9)A();return q<z9},end:()=>{if(J>=Z$)return gv;if(G)return Promise.reject(G);if(B)return B;return B=new Promise((L,y)=>{if(W=L,K=y,J!==c3&&J!==nH)I();else if(J===c3&&!Q)if(X.length>0)A();else E()}),B},destroy:(L)=>{if(L){M(L);return}if(J>=Z$||G)return;if(_(),Q=!1,Z!==null){let y=Z;Z=null,j0.close(y)}O()},waitDrain:()=>{if(q<z9||J!==c3)return gv;return new Promise((L,y)=>{U.push(L),V.push(y)})}}}var X$="ENOENT",mXD=(D,F)=>{let $=pY(),J=pY(),Q=[],Z=pY(),Y=(async(B)=>{let W=lY(lD.resolve(B));try{await hD.mkdir(W,{recursive:!0})}catch(K){if(K.code===X$){let U=lD.dirname(W);if(U===W)throw K;await hD.mkdir(U,{recursive:!0}),await hD.mkdir(W,{recursive:!0})}else throw K}try{return{symbolic:W,real:await hD.realpath(W)}}catch(K){if(K.code===X$)return{symbolic:W,real:W};throw K}})(D);Y.catch(()=>{});let q=async(B,W)=>{let K=await Y;if(B===K.symbolic)return l3(K.real,K.real,W),K.real;let U=Z.get(B);if(!U)U=hD.realpath(B).then((H)=>{return l3(H,K.real,W),H}),Z.set(B,U);let V=await U;return l3(V,K.real,W),V},G=async(B,W)=>{let K=$.get(B);if(K)return K;return K=(async()=>{if(B===(await Y).symbolic)return;await G(lD.dirname(B));try{let U=await hD.lstat(B);if(U.isDirectory())return;if(U.isSymbolicLink())try{let V=await q(B,`Symlink "${B}" points outside the extraction directory.`);if((await hD.stat(V)).isDirectory())return}catch(V){if(V.code===X$)throw Error(`Symlink "${B}" points outside the extraction directory.`);throw V}throw Error(`"${B}" is not a valid directory component.`)}catch(U){if(U.code===X$){await hD.mkdir(B,{mode:W??F.dmode});return}throw U}})(),$.set(B,K),K};return{async ready(){await Y},async preparePath(B){let{name:W,linkname:K,type:U,mode:V,mtime:H}=B,{maxDepth:z=1024,dmode:_}=F,O=hXD(W),C=await Y,M=lD.join(C.symbolic,O);if(l3(M,C.symbolic,`Entry "${W}" points outside the extraction directory.`),z!==1/0){let I=1;for(let R of O)if(R==="/"&&++I>z)throw Error("Tar exceeds max specified depth.")}let E=J.get(O);if(E){if(E===p3&&U!==p3||E!==p3&&U===p3)throw Error(`Path conflict ${U} over existing ${E} at "${W}"`);return}let A=lD.dirname(M);switch(U){case p3:if(J.set(O,p3),await G(M,_??V),H)await hD.lutimes(M,H,H).catch(()=>{});return;case dH:return J.set(O,dH),await G(A),M;case lH:if(J.set(O,lH),!K)return;if(await G(A),l3(lD.resolve(A,K),C.symbolic,`Symlink "${K}" points outside the extraction directory.`),await hD.symlink(K,M),H)await hD.lutimes(M,H,H).catch(()=>{});return;case pH:{if(J.set(O,pH),!K)return;let I=lY(K);if(lD.isAbsolute(I))throw Error(`Hardlink "${K}" points outside the extraction directory.`);let R=lD.join(C.symbolic,I);l3(R,C.symbolic,`Hardlink "${K}" points outside the extraction directory.`),await G(lD.dirname(R));let T=await q(lD.dirname(R),`Hardlink "${K}" points outside the extraction directory.`);if(l3(lD.join(T,lD.basename(R)),C.real,`Hardlink "${K}" points outside the extraction directory.`),R!==M)await G(A),Q.push({linkTarget:R,outPath:M});return}default:return}},async applyLinks(){for(let{linkTarget:B,outPath:W}of Q)try{await hD.link(B,W)}catch(K){if(K.code===X$)throw Error(`Hardlink target "${B}" does not exist for link at "${W}".`);throw K}}}};function mv(D,F={}){let $=bv(F),J=uXD(F.concurrency||yXD().length||8),Q=mXD(D,F),Z=null,X=null;return new fXD({async write(Y,q,G){try{if($.write(Y),$.isEntryActive()){if(Z&&X){let B=!1,W=X;while(!$.isBodyComplete())if(B=!1,$.streamBody(W)===0)if(B)await Z.waitDrain();else{G();return}while(!$.skipPadding()){G();return}let K=Z;if(K)J.add(()=>K.end());Z=null,X=null}else if(!$.skipEntry()){G();return}}while(!0){let B=$.readHeader();if(B===void 0||B===null){G();return}let W=fv(B,F);if(!W){if(!$.skipEntry()){G();return}continue}let K=await J.add(()=>Q.preparePath(W));if(K){let U=gXD(K,{mode:F.fmode??W.mode??void 0,mtime:W.mtime??void 0}),V=!1,H=(z)=>{let _=U.write(z);if(!_)V=!0;return _};while(!$.isBodyComplete())if(V=!1,$.streamBody(H)===0)if(V)await U.waitDrain();else{Z=U,X=H,G();return}while(!$.skipPadding()){Z=U,X=H,G();return}J.add(()=>U.end())}else if(!$.skipEntry()){G();return}}}catch(B){G(B)}},async final(Y){try{$.end(),$.validateEOF(),await Q.ready(),await J.onIdle(),await Q.applyLinks(),Y()}catch(q){Y(q)}},destroy(Y,q){(async()=>{if(Z)Z.destroy(Y??void 0),Z=null,X=null;await J.onIdle()})().then(()=>q(Y??null),(G)=>q(Y??(G instanceof Error?G:Error("Stream destroyed"))))}})}import dXD from"node:path";import{pipeline as pXD}from"node:stream/promises";import{createGunzip as lXD}from"node:zlib";var pv=async(D,F,$)=>{let Q=`https://codeload.github.com/cartesi/application-templates/tar.gz/refs/heads/${F}`;await dv.ensureDir($);let Z=await fetch(Q);if(!Z.ok)throw Error(`Failed to download template: ${Z.statusText}`);let X=mv($,{filter:(Y)=>{return Y.name.split("/").splice(1).join("/").startsWith(`${D}/`)},map:(Y)=>{let q=Y.name.split("/").splice(1).join("/");return Y.name=dXD.relative(D,q),Y}});return await pXD(Z.body,lXD(),X),{dir:$,source:"https://github.com/cartesi/application-templates"}};var cXD="prerelease/sdk-12",nXD=["cpp","cpp-low-level","go","java","javascript","lua","python","ruby","rust","typescript"],lv=()=>{return new ZD("create").argument("<name>","application and directory name").addOption(new S0("-t, --template <template>","template name to use").choices(nXD).makeOptionMandatory()).option("-b, --branch <branch>","cartesi/application-templates repository branch name to use",cXD).action(async(D,{branch:F,template:$})=>{let J=sD("Creating application...").start();try{let{dir:Q}=await pv($,F,D);J.succeed(`Application created at ${v.cyan(Q)}`)}catch(Q){J.fail(Q instanceof Error?`Error creating application: ${v.red(Q.message)}`:String(Q))}})};var cv=()=>{return new ZD("build").description("DEPRECATED: Package the application in a Docker image ready to be deployed.").action(async()=>{console.warn(v.yellow("deploy build command is deprecated"))})};var nv=()=>{let D=new ZD("deploy").description("DEPRECATED: Package and deploy the application to a supported live network.").action(async()=>{console.warn(v.yellow("deploy command is deprecated, use 'cartesi-rollups-cli' directly instead"))});return D.addCommand(cv(),{hidden:!0}),D};var Y$=(D,F=[])=>D.name==="up"||F.includes("vim")&&D.name==="k"||F.includes("emacs")&&D.ctrl&&D.name==="p",cY=(D,F=[])=>D.name==="down"||F.includes("vim")&&D.name==="j"||F.includes("emacs")&&D.ctrl&&D.name==="n";var q$=(D)=>D.name==="backspace",G$=(D)=>D.name==="tab",iH=(D)=>"1234567890".includes(D.name),n3=(D)=>D.name==="enter"||D.name==="return";class oH extends Error{name="AbortPromptError";message="Prompt was aborted";constructor(D){super();this.cause=D?.cause}}class aH extends Error{name="CancelPromptError";message="Prompt was canceled"}class C9 extends Error{name="ExitPromptError"}class rH extends Error{name="HookError"}class B$ extends Error{name="ValidationError"}import{AsyncResource as rXD}from"node:async_hooks";import{AsyncLocalStorage as iXD,AsyncResource as oXD}from"node:async_hooks";var iv=new iXD;function aXD(D){return{rl:D,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function ov(D,F){let $=aXD(D);return iv.run($,()=>{function J(Q){$.handleChange=()=>{$.index=0,Q()},$.handleChange()}return F(J)})}function i3(){let D=iv.getStore();if(!D)throw new rH("[Inquirer] Hook functions can only be called from within a prompt");return D}function sH(){return i3().rl}function tH(D){let F=(...$)=>{let J=i3(),Q=!1,Z=J.handleChange;J.handleChange=()=>{Q=!0};let X=D(...$);if(Q)Z();return J.handleChange=Z,X};return oXD.bind(F)}function _9(D){let F=i3(),{index:$}=F,J={get(){return F.hooks[$]},set(Z){F.hooks[$]=Z},initialized:$ in F.hooks},Q=D(J);return F.index++,Q}function av(){i3().handleChange()}var o3={queue(D){let F=i3(),{index:$}=F;F.hooksEffect.push(()=>{F.hooksCleanup[$]?.();let J=D(sH());if(J!=null&&typeof J!=="function")throw new B$("useEffect return value must be a cleanup function or nothing.");F.hooksCleanup[$]=J})},run(){let D=i3();tH(()=>{D.hooksEffect.forEach((F)=>{F()}),D.hooksEffect.length=0})()},clearAll(){let D=i3();D.hooksCleanup.forEach((F)=>{F?.()}),D.hooksEffect.length=0,D.hooksCleanup.length=0}};function C0(D){return _9((F)=>{let $=rXD.bind(function(Z){if(F.get()!==Z)F.set(Z),av()});if(F.initialized)return[F.get(),$];let J=typeof D==="function"?D():D;return F.set(J),[J,$]})}function L1(D,F){_9(($)=>{let J=$.get();if(!Array.isArray(J)||F.some((Z,X)=>!Object.is(Z,J[X])))o3.queue(D);$.set(F)})}import{styleText as Z8}from"node:util";import c8 from"node:process";function sXD(){if(c8.platform!=="win32")return c8.env.TERM!=="linux";return Boolean(c8.env.WT_SESSION)||Boolean(c8.env.TERMINUS_SUBLIME)||c8.env.ConEmuTask==="{cmd::Cmder}"||c8.env.TERM_PROGRAM==="Terminus-Sublime"||c8.env.TERM_PROGRAM==="vscode"||c8.env.TERM==="xterm-256color"||c8.env.TERM==="alacritty"||c8.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var rv={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"█",squareDarkShade:"▓",squareMediumShade:"▒",squareLightShade:"░",squareTop:"▀",squareBottom:"▄",squareLeft:"▌",squareRight:"▐",squareCenter:"■",bullet:"●",dot:"․",ellipsis:"…",pointerSmall:"›",triangleUp:"▲",triangleUpSmall:"▴",triangleDown:"▼",triangleDownSmall:"▾",triangleLeftSmall:"◂",triangleRightSmall:"▸",home:"⌂",heart:"♥",musicNote:"♪",musicNoteBeamed:"♫",arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",arrowLeftRight:"↔",arrowUpDown:"↕",almostEqual:"≈",notEqual:"≠",lessOrEqual:"≤",greaterOrEqual:"≥",identical:"≡",infinity:"∞",subscriptZero:"₀",subscriptOne:"₁",subscriptTwo:"₂",subscriptThree:"₃",subscriptFour:"₄",subscriptFive:"₅",subscriptSix:"₆",subscriptSeven:"₇",subscriptEight:"₈",subscriptNine:"₉",oneHalf:"½",oneThird:"⅓",oneQuarter:"¼",oneFifth:"⅕",oneSixth:"⅙",oneEighth:"⅛",twoThirds:"⅔",twoFifths:"⅖",threeQuarters:"¾",threeFifths:"⅗",threeEighths:"⅜",fourFifths:"⅘",fiveSixths:"⅚",fiveEighths:"⅝",sevenEighths:"⅞",line:"─",lineBold:"━",lineDouble:"═",lineDashed0:"┄",lineDashed1:"┅",lineDashed2:"┈",lineDashed3:"┉",lineDashed4:"╌",lineDashed5:"╍",lineDashed6:"╴",lineDashed7:"╶",lineDashed8:"╸",lineDashed9:"╺",lineDashed10:"╼",lineDashed11:"╾",lineDashed12:"−",lineDashed13:"–",lineDashed14:"‐",lineDashed15:"⁃",lineVertical:"│",lineVerticalBold:"┃",lineVerticalDouble:"║",lineVerticalDashed0:"┆",lineVerticalDashed1:"┇",lineVerticalDashed2:"┊",lineVerticalDashed3:"┋",lineVerticalDashed4:"╎",lineVerticalDashed5:"╏",lineVerticalDashed6:"╵",lineVerticalDashed7:"╷",lineVerticalDashed8:"╹",lineVerticalDashed9:"╻",lineVerticalDashed10:"╽",lineVerticalDashed11:"╿",lineDownLeft:"┐",lineDownLeftArc:"╮",lineDownBoldLeftBold:"┓",lineDownBoldLeft:"┒",lineDownLeftBold:"┑",lineDownDoubleLeftDouble:"╗",lineDownDoubleLeft:"╖",lineDownLeftDouble:"╕",lineDownRight:"┌",lineDownRightArc:"╭",lineDownBoldRightBold:"┏",lineDownBoldRight:"┎",lineDownRightBold:"┍",lineDownDoubleRightDouble:"╔",lineDownDoubleRight:"╓",lineDownRightDouble:"╒",lineUpLeft:"┘",lineUpLeftArc:"╯",lineUpBoldLeftBold:"┛",lineUpBoldLeft:"┚",lineUpLeftBold:"┙",lineUpDoubleLeftDouble:"╝",lineUpDoubleLeft:"╜",lineUpLeftDouble:"╛",lineUpRight:"└",lineUpRightArc:"╰",lineUpBoldRightBold:"┗",lineUpBoldRight:"┖",lineUpRightBold:"┕",lineUpDoubleRightDouble:"╚",lineUpDoubleRight:"╙",lineUpRightDouble:"╘",lineUpDownLeft:"┤",lineUpBoldDownBoldLeftBold:"┫",lineUpBoldDownBoldLeft:"┨",lineUpDownLeftBold:"┥",lineUpBoldDownLeftBold:"┩",lineUpDownBoldLeftBold:"┪",lineUpDownBoldLeft:"┧",lineUpBoldDownLeft:"┦",lineUpDoubleDownDoubleLeftDouble:"╣",lineUpDoubleDownDoubleLeft:"╢",lineUpDownLeftDouble:"╡",lineUpDownRight:"├",lineUpBoldDownBoldRightBold:"┣",lineUpBoldDownBoldRight:"┠",lineUpDownRightBold:"┝",lineUpBoldDownRightBold:"┡",lineUpDownBoldRightBold:"┢",lineUpDownBoldRight:"┟",lineUpBoldDownRight:"┞",lineUpDoubleDownDoubleRightDouble:"╠",lineUpDoubleDownDoubleRight:"╟",lineUpDownRightDouble:"╞",lineDownLeftRight:"┬",lineDownBoldLeftBoldRightBold:"┳",lineDownLeftBoldRightBold:"┯",lineDownBoldLeftRight:"┰",lineDownBoldLeftBoldRight:"┱",lineDownBoldLeftRightBold:"┲",lineDownLeftRightBold:"┮",lineDownLeftBoldRight:"┭",lineDownDoubleLeftDoubleRightDouble:"╦",lineDownDoubleLeftRight:"╥",lineDownLeftDoubleRightDouble:"╤",lineUpLeftRight:"┴",lineUpBoldLeftBoldRightBold:"┻",lineUpLeftBoldRightBold:"┷",lineUpBoldLeftRight:"┸",lineUpBoldLeftBoldRight:"┹",lineUpBoldLeftRightBold:"┺",lineUpLeftRightBold:"┶",lineUpLeftBoldRight:"┵",lineUpDoubleLeftDoubleRightDouble:"╩",lineUpDoubleLeftRight:"╨",lineUpLeftDoubleRightDouble:"╧",lineUpDownLeftRight:"┼",lineUpBoldDownBoldLeftBoldRightBold:"╋",lineUpDownBoldLeftBoldRightBold:"╈",lineUpBoldDownLeftBoldRightBold:"╇",lineUpBoldDownBoldLeftRightBold:"╊",lineUpBoldDownBoldLeftBoldRight:"╉",lineUpBoldDownLeftRight:"╀",lineUpDownBoldLeftRight:"╁",lineUpDownLeftBoldRight:"┽",lineUpDownLeftRightBold:"┾",lineUpBoldDownBoldLeftRight:"╂",lineUpDownLeftBoldRightBold:"┿",lineUpBoldDownLeftBoldRight:"╃",lineUpBoldDownLeftRightBold:"╄",lineUpDownBoldLeftBoldRight:"╅",lineUpDownBoldLeftRightBold:"╆",lineUpDoubleDownDoubleLeftDoubleRightDouble:"╬",lineUpDoubleDownDoubleLeftRight:"╫",lineUpDownLeftDoubleRightDouble:"╪",lineCross:"╳",lineBackslash:"╲",lineSlash:"╱"},sv={tick:"✔",info:"ℹ",warning:"⚠",cross:"✘",squareSmall:"◻",squareSmallFilled:"◼",circle:"◯",circleFilled:"◉",circleDotted:"◌",circleDouble:"◎",circleCircle:"ⓞ",circleCross:"ⓧ",circlePipe:"Ⓘ",radioOn:"◉",radioOff:"◯",checkboxOn:"☒",checkboxOff:"☐",checkboxCircleOn:"ⓧ",checkboxCircleOff:"Ⓘ",pointer:"❯",triangleUpOutline:"△",triangleLeft:"◀",triangleRight:"▶",lozenge:"◆",lozengeOutline:"◇",hamburger:"☰",smiley:"㋡",mustache:"෴",star:"★",play:"▶",nodejs:"⬢",oneSeventh:"⅐",oneNinth:"⅑",oneTenth:"⅒"},tXD={tick:"√",info:"i",warning:"‼",cross:"×",squareSmall:"□",squareSmallFilled:"■",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(○)",circleCross:"(×)",circlePipe:"(│)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[×]",checkboxOff:"[ ]",checkboxCircleOn:"(×)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"∆",triangleLeft:"◄",triangleRight:"►",lozenge:"♦",lozengeOutline:"◊",hamburger:"≡",smiley:"☺",mustache:"┌─┐",star:"✶",play:"►",nodejs:"♦",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},eXD={...rv,...sv},DYD={...rv,...tXD},FYD=sXD(),$YD=FYD?eXD:DYD,M9=$YD,sS0=Object.entries(sv);var tv={prefix:{idle:Z8("blue","?"),done:Z8("green",M9.tick)},spinner:{interval:80,frames:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"].map((D)=>Z8("yellow",D))},style:{answer:(D)=>Z8("cyan",D),message:(D)=>Z8("bold",D),error:(D)=>Z8("red",`> ${D}`),defaultAnswer:(D)=>Z8("dim",`(${D})`),help:(D)=>Z8("dim",D),highlight:(D)=>Z8("cyan",D),key:(D)=>Z8("cyan",Z8("bold",`<${D}>`))}};function ev(D){if(typeof D!=="object"||D===null)return!1;let F=D;while(Object.getPrototypeOf(F)!==null)F=Object.getPrototypeOf(F);return Object.getPrototypeOf(D)===F}function Dh(...D){let F={};for(let $ of D)for(let[J,Q]of Object.entries($)){let Z=F[J];F[J]=ev(Z)&&ev(Q)?Dh(Z,Q):Q}return F}function P1(...D){let F=[tv,...D.filter(($)=>$!=null)];return Dh(...F)}function a3({status:D="idle",theme:F}){let[$,J]=C0(!1),[Q,Z]=C0(0),{prefix:X,spinner:Y}=P1(F);if(L1(()=>{if(D==="loading"){let G,B=-1,W=setTimeout(()=>{J(!0),G=setInterval(()=>{B=B+1,Z(B%Y.frames.length)},Y.interval)},300);return()=>{clearTimeout(W),clearInterval(G)}}else J(!1)},[D]),$)return Y.frames[Q];return typeof X==="string"?X:X[D==="loading"?"idle":D]??X.idle}function W$(D,F){return _9(($)=>{let J=$.get();if(!J||J.dependencies.length!==F.length||J.dependencies.some((Q,Z)=>Q!==F[Z])){let Q=D();return $.set({value:Q,dependencies:F}),Q}return J.value})}function r3(D){return C0({current:D})[0]}function j1(D){let F=r3(D);F.current=D,L1(($)=>{let J=!1,Q=tH((Z,X)=>{if(J)return;F.current(X,$)});return $.input.on("keypress",Q),()=>{J=!0,$.input.removeListener("keypress",Q)}},[])}var _h=TD($h(),1);var Jh=(()=>{let D=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return(F)=>{let $=0;D.lastIndex=0;while(D.test(F))$+=1;return F.length-$}})(),Qh=(D)=>{return D===12288||D>=65281&&D<=65376||D>=65504&&D<=65510},Zh=(D)=>{return D===8987||D===9001||D>=12272&&D<=12287||D>=12289&&D<=12350||D>=12441&&D<=12543||D>=12549&&D<=12591||D>=12593&&D<=12686||D>=12688&&D<=12771||D>=12783&&D<=12830||D>=12832&&D<=12871||D>=12880&&D<=19903||D>=65040&&D<=65049||D>=65072&&D<=65106||D>=65108&&D<=65126||D>=65128&&D<=65131||D>=127488&&D<=127490||D>=127504&&D<=127547||D>=127552&&D<=127560||D>=131072&&D<=196605||D>=196608&&D<=262141};var ZYD=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,XYD=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Xh=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,YYD=/\t{1,1000}/y,Yh=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,qYD=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,GYD=/\p{M}+/gu,BYD={limit:1/0,ellipsis:""},qh=(D,F={},$={})=>{let J=F.limit??1/0,Q=F.ellipsis??"",Z=F?.ellipsisWidth??(Q?qh(Q,BYD,$).width:0),X=0,Y=$.controlWidth??0,q=$.tabWidth??8,G=$.emojiWidth??2,B=2,W=$.regularWidth??1,K=$.wideWidth??2,U=[[qYD,W],[ZYD,0],[XYD,Y],[YYD,q],[Yh,G],[Xh,K]],V=0,H=0,z=D.length,_=0,O=!1,C=z,M=Math.max(0,J-Z),E=0,A=0,I=0,R=0;D:while(!0){if(A>E||H>=z&&H>V){let T=D.slice(E,A)||D.slice(V,H);_=0;for(let N of T.replaceAll(GYD,"")){let j=N.codePointAt(0)||0;if(Qh(j))R=2;else if(Zh(j))R=K;else R=W;if(I+R>M)C=Math.min(C,Math.max(E,V)+_);if(I+R>J){O=!0;break D}_+=N.length,I+=R}E=A=0}if(H>=z)break D;for(let T=0,N=U.length;T<N;T++){let[j,L]=U[T];if(j.lastIndex=H,j.test(D)){if(_=j===Xh?Jh(D.slice(H,j.lastIndex)):j===Yh?1:j.lastIndex-H,R=_*L,I+R>M)C=Math.min(C,H+Math.floor((M-I)/L));if(I+R>J){O=!0;break D}I+=R,E=V,A=H,H=V=j.lastIndex;continue D}}H+=1}return{width:O?M:I,index:O?C:z,truncated:O,ellipsed:O&&J>=Z}},Gh=qh;var WYD={limit:1/0,ellipsis:"",ellipsisWidth:0},KYD=(D,F={})=>{return Gh(D,WYD,F).width},S1=KYD;var nY="\x1B",Vh="›",UYD=39,Dz="\x07",Hh="[",VYD="]",zh="m",Fz=`${VYD}8;;`,Bh=new RegExp(`(?:\\${Hh}(?<code>\\d+)m|\\${Fz}(?<uri>.*)${Dz})`,"y"),Wh=(D)=>{if(D>=30&&D<=37)return 39;if(D>=90&&D<=97)return 39;if(D>=40&&D<=47)return 49;if(D>=100&&D<=107)return 49;if(D===1||D===2)return 22;if(D===3)return 23;if(D===4)return 24;if(D===7)return 27;if(D===8)return 28;if(D===9)return 29;if(D===0)return 0;return},Kh=(D)=>`${nY}${Hh}${D}${zh}`,Uh=(D)=>`${nY}${Fz}${D}${Dz}`,eH=(D,F,$)=>{let J=F[Symbol.iterator](),Q=!1,Z=!1,X=D.at(-1),Y=X===void 0?0:S1(X),q=J.next(),G=J.next(),B=0;while(!q.done){let W=q.value,K=S1(W);if(Y+K<=$)D[D.length-1]+=W;else D.push(W),Y=0;if(W===nY||W===Vh)Q=!0,Z=F.startsWith(Fz,B+1);if(Q){if(Z){if(W===Dz)Q=!1,Z=!1}else if(W===zh)Q=!1}else if(Y+=K,Y===$&&!G.done)D.push(""),Y=0;q=G,G=J.next(),B+=W.length}if(X=D.at(-1),!Y&&X!==void 0&&X.length&&D.length>1)D[D.length-2]+=D.pop()},HYD=(D)=>{let F=D.split(" "),$=F.length;while($){if(S1(F[$-1]))break;$--}if($===F.length)return D;return F.slice(0,$).join(" ")+F.slice($).join("")},zYD=(D,F,$={})=>{if($.trim!==!1&&D.trim()==="")return"";let J="",Q,Z,X=D.split(" "),Y=[""],q=0;for(let W=0;W<X.length;W++){let K=X[W];if($.trim!==!1){let V=Y.at(-1)??"",H=V.trimStart();if(V.length!==H.length)Y[Y.length-1]=H,q=S1(H)}if(W!==0){if(q>=F&&($.wordWrap===!1||$.trim===!1))Y.push(""),q=0;if(q||$.trim===!1)Y[Y.length-1]+=" ",q++}let U=S1(K);if($.hard&&U>F){let V=F-q,H=1+Math.floor((U-V-1)/F);if(Math.floor((U-1)/F)<H)Y.push("");eH(Y,K,F),q=S1(Y.at(-1)??"");continue}if(q+U>F&&q&&U){if($.wordWrap===!1&&q<F){eH(Y,K,F),q=S1(Y.at(-1)??"");continue}Y.push(""),q=0}if(q+U>F&&$.wordWrap===!1){eH(Y,K,F),q=S1(Y.at(-1)??"");continue}Y[Y.length-1]+=K,q+=U}if($.trim!==!1)Y=Y.map((W)=>HYD(W));let G=Y.join(`
677
677
  `),B=!1;for(let W=0;W<G.length;W++){let K=G[W];if(J+=K,!B){if(B=K>="\uD800"&&K<="\uDBFF",B)continue}else B=!1;if(K===nY||K===Vh){Bh.lastIndex=W+1;let V=Bh.exec(G)?.groups;if(V?.code!==void 0){let H=Number.parseFloat(V.code);Q=H===UYD?void 0:H}else if(V?.uri!==void 0)Z=V.uri.length===0?void 0:V.uri}if(G[W+1]===`
678
678
  `){if(Z)J+=Uh("");let U=Q?Wh(Q):void 0;if(Q&&U)J+=Kh(U)}else if(K===`
679
679
  `){if(Q&&Wh(Q))J+=Kh(Q);if(Z)J+=Uh(Z)}}return J},CYD=/\r?\n/;function Ch(D,F,$){return String(D).normalize().split(CYD).map((J)=>zYD(J,F,$)).join(`
@@ -688,9 +688,9 @@ http:
688
688
  `;let X=D+(F?`
689
689
  `+F:""),q=Math.floor(J.length/Z)-this.cursorPos.rows+(F?wh(F):0);if(q>0)X+=Jz(q);X+=Zz(this.cursorPos.cols),this.write(Qz(this.extraLinesUnderPrompt)+Xz(this.height)+X),this.extraLinesUnderPrompt=q,this.height=wh(X)}checkCursorPos(){let D=this.rl.getCursorPos();if(D.cols!==this.cursorPos.cols)this.write(Zz(D.cols)),this.cursorPos=D}done({clearContent:D}){this.rl.setPrompt("");let F=Qz(this.extraLinesUnderPrompt);F+=D?Xz(this.height):`
690
690
  `,F+=Ih,this.write(F),this.rl.close()}}class Yz extends Promise{static withResolver(){let D,F;return{promise:new Promise((J,Q)=>{D=J,F=Q}),resolve:D,reject:F}}}function IYD(){let D=Error.prepareStackTrace,F=[];try{Error.prepareStackTrace=($,J)=>{let Q=J.slice(1);return F=Q,Q},Error().stack}catch{return F}return Error.prepareStackTrace=D,F}function x1(D){let F=IYD();return(J,Q={})=>{let{input:Z=process.stdin,signal:X}=Q,Y=new Set,q=new Th.default;q.pipe(Q.output??process.stdout);let G=Nh.createInterface({terminal:!0,input:Z,output:q}),B=new oY(G),{promise:W,resolve:K,reject:U}=Yz.withResolver(),V=()=>U(new aH);if(X){let _=()=>U(new oH({cause:X.reason}));if(X.aborted)return _(),Object.assign(W,{cancel:V});X.addEventListener("abort",_),Y.add(()=>X.removeEventListener("abort",_))}Y.add(C6((_,O)=>{U(new C9(`User force closed the prompt with ${_} ${O}`))}));let H=()=>U(new C9("User force closed the prompt with SIGINT"));G.on("SIGINT",H),Y.add(()=>G.removeListener("SIGINT",H));let z=()=>B.checkCursorPos();return G.input.on("keypress",z),Y.add(()=>G.input.removeListener("keypress",z)),ov(G,(_)=>{let O=AYD.bind(()=>o3.clearAll());return G.on("close",O),Y.add(()=>G.removeListener("close",O)),_(()=>{try{let C=D(J,(A)=>{setImmediate(()=>K(A))});if(C===void 0){let A=F[1]?.getFileName();throw Error(`Prompt functions must return a string.
691
- at ${A}`)}let[M,E]=typeof C==="string"?[C]:C;B.render(M,E),o3.run()}catch(C){U(C)}}),Object.assign(W.then((C)=>{return o3.clearAll(),C},(C)=>{throw o3.clearAll(),C}).finally(()=>{Y.forEach((C)=>C()),B.done({clearContent:Boolean(Q.clearPromptOnDone)}),q.end()}).then(()=>W),{cancel:V})})}}import{styleText as wYD}from"node:util";class jF{separator=wYD("dim",Array.from({length:15}).join(M9.line));type="separator";constructor(D){if(D)this.separator=D}static isSeparator(D){return Boolean(D&&typeof D==="object"&&"type"in D&&D.type==="separator")}}import{styleText as U$}from"node:util";var NYD={icon:{cursor:M9.pointer},style:{disabled:(D)=>U$("dim",`- ${D}`),description:(D)=>U$("cyan",D),keysHelpTip:(D)=>D.map(([F,$])=>`${U$("bold",F)} ${U$("dim",$)}`).join(U$("dim"," • "))},indexMode:"hidden",keybindings:[]};function O9(D){return!jF.isSeparator(D)&&!D.disabled}function TYD(D){return D.map((F)=>{if(jF.isSeparator(F))return F;if(typeof F!=="object"||F===null||!("value"in F)){let Q=String(F);return{value:F,name:Q,short:Q,disabled:!1}}let $=F.name??String(F.value),J={value:F.value,name:$,short:F.short??$,disabled:F.disabled??!1};if(F.description)J.description=F.description;return J})}var aY=x1((D,F)=>{let{loop:$=!0,pageSize:J=7}=D,Q=P1(NYD,D.theme),{keybindings:Z}=Q,[X,Y]=C0("idle"),q=a3({status:X,theme:Q}),G=r3(),B=!Z.includes("vim"),W=W$(()=>TYD(D.choices),[D.choices]),K=W$(()=>{let w=W.findIndex(O9),R=W.findLastIndex(O9);if(w===-1)throw new B$("[select prompt] No selectable choices. All choices are disabled.");return{first:w,last:R}},[W]),U=W$(()=>{if(!("default"in D))return-1;return W.findIndex((w)=>O9(w)&&w.value===D.default)},[D.default,W]),[V,H]=C0(U===-1?K.first:U),z=W[V];j1((w,R)=>{if(clearTimeout(G.current),n3(w))Y("done"),F(z.value);else if(Y$(w,Z)||cY(w,Z)){if(R.clearLine(0),$||Y$(w,Z)&&V!==K.first||cY(w,Z)&&V!==K.last){let T=Y$(w,Z)?-1:1,N=V;do N=(N+T+W.length)%W.length;while(!O9(W[N]));H(N)}}else if(iH(w)&&!Number.isNaN(Number(R.line))){let T=Number(R.line)-1,N=-1,j=W.findIndex((y)=>{if(jF.isSeparator(y))return!1;return N++,N===T}),L=W[j];if(L!=null&&O9(L))H(j);G.current=setTimeout(()=>{R.clearLine(0)},700)}else if(q$(w))R.clearLine(0);else if(B){let T=R.line.toLowerCase(),N=W.findIndex((j)=>{if(jF.isSeparator(j)||!O9(j))return!1;return j.name.toLowerCase().startsWith(T)});if(N!==-1)H(N);G.current=setTimeout(()=>{R.clearLine(0)},700)}}),L1(()=>()=>{clearTimeout(G.current)},[]);let _=Q.style.message(D.message,X),O=Q.style.keysHelpTip([["↑↓","navigate"],["⏎","select"]]),C=0,M=$z({items:W,active:V,renderItem({item:w,isActive:R,index:T}){if(jF.isSeparator(w))return C++,` ${w.separator}`;let N=Q.indexMode==="number"?`${T+1-C}. `:"";if(w.disabled){let y=typeof w.disabled==="string"?w.disabled:"(disabled)";return Q.style.disabled(`${N}${w.name} ${y}`)}let j=R?Q.style.highlight:(y)=>y,L=R?Q.icon.cursor:" ";return j(`${L} ${N}${w.name}`)},pageSize:J,loop:$});if(X==="done")return[q,_,Q.style.answer(z.short)].filter(Boolean).join(" ");let{description:E}=z;return`${[[q,_].filter(Boolean).join(" "),M," ",E?Q.style.description(E):"",O].filter(Boolean).join(`
691
+ at ${A}`)}let[M,E]=typeof C==="string"?[C]:C;B.render(M,E),o3.run()}catch(C){U(C)}}),Object.assign(W.then((C)=>{return o3.clearAll(),C},(C)=>{throw o3.clearAll(),C}).finally(()=>{Y.forEach((C)=>C()),B.done({clearContent:Boolean(Q.clearPromptOnDone)}),q.end()}).then(()=>W),{cancel:V})})}}import{styleText as wYD}from"node:util";class jF{separator=wYD("dim",Array.from({length:15}).join(M9.line));type="separator";constructor(D){if(D)this.separator=D}static isSeparator(D){return Boolean(D&&typeof D==="object"&&"type"in D&&D.type==="separator")}}import{styleText as U$}from"node:util";var NYD={icon:{cursor:M9.pointer},style:{disabled:(D)=>U$("dim",`- ${D}`),description:(D)=>U$("cyan",D),keysHelpTip:(D)=>D.map(([F,$])=>`${U$("bold",F)} ${U$("dim",$)}`).join(U$("dim"," • "))},indexMode:"hidden",keybindings:[]};function O9(D){return!jF.isSeparator(D)&&!D.disabled}function TYD(D){return D.map((F)=>{if(jF.isSeparator(F))return F;if(typeof F!=="object"||F===null||!("value"in F)){let Q=String(F);return{value:F,name:Q,short:Q,disabled:!1}}let $=F.name??String(F.value),J={value:F.value,name:$,short:F.short??$,disabled:F.disabled??!1};if(F.description)J.description=F.description;return J})}var aY=x1((D,F)=>{let{loop:$=!0,pageSize:J=7}=D,Q=P1(NYD,D.theme),{keybindings:Z}=Q,[X,Y]=C0("idle"),q=a3({status:X,theme:Q}),G=r3(),B=!Z.includes("vim"),W=W$(()=>TYD(D.choices),[D.choices]),K=W$(()=>{let I=W.findIndex(O9),R=W.findLastIndex(O9);if(I===-1)throw new B$("[select prompt] No selectable choices. All choices are disabled.");return{first:I,last:R}},[W]),U=W$(()=>{if(!("default"in D))return-1;return W.findIndex((I)=>O9(I)&&I.value===D.default)},[D.default,W]),[V,H]=C0(U===-1?K.first:U),z=W[V];j1((I,R)=>{if(clearTimeout(G.current),n3(I))Y("done"),F(z.value);else if(Y$(I,Z)||cY(I,Z)){if(R.clearLine(0),$||Y$(I,Z)&&V!==K.first||cY(I,Z)&&V!==K.last){let T=Y$(I,Z)?-1:1,N=V;do N=(N+T+W.length)%W.length;while(!O9(W[N]));H(N)}}else if(iH(I)&&!Number.isNaN(Number(R.line))){let T=Number(R.line)-1,N=-1,j=W.findIndex((y)=>{if(jF.isSeparator(y))return!1;return N++,N===T}),L=W[j];if(L!=null&&O9(L))H(j);G.current=setTimeout(()=>{R.clearLine(0)},700)}else if(q$(I))R.clearLine(0);else if(B){let T=R.line.toLowerCase(),N=W.findIndex((j)=>{if(jF.isSeparator(j)||!O9(j))return!1;return j.name.toLowerCase().startsWith(T)});if(N!==-1)H(N);G.current=setTimeout(()=>{R.clearLine(0)},700)}}),L1(()=>()=>{clearTimeout(G.current)},[]);let _=Q.style.message(D.message,X),O=Q.style.keysHelpTip([["↑↓","navigate"],["⏎","select"]]),C=0,M=$z({items:W,active:V,renderItem({item:I,isActive:R,index:T}){if(jF.isSeparator(I))return C++,` ${I.separator}`;let N=Q.indexMode==="number"?`${T+1-C}. `:"";if(I.disabled){let y=typeof I.disabled==="string"?I.disabled:"(disabled)";return Q.style.disabled(`${N}${I.name} ${y}`)}let j=R?Q.style.highlight:(y)=>y,L=R?Q.icon.cursor:" ";return j(`${L} ${N}${I.name}`)},pageSize:J,loop:$});if(X==="done")return[q,_,Q.style.answer(z.short)].filter(Boolean).join(" ");let{description:E}=z;return`${[[q,_].filter(Boolean).join(" "),M," ",E?Q.style.description(E):"",O].filter(Boolean).join(`
692
692
  `).trimEnd()}${Ah}`});var LYD={validationFailureMode:"keep"},F2=x1((D,F)=>{let{prefill:$="tab"}=D,J=P1(LYD,D.theme),[Q,Z]=C0("idle"),[X,Y]=C0(String(D.default??"")),[q,G]=C0(),[B,W]=C0(""),K=a3({status:Q,theme:J});async function U(O){let{required:C,pattern:M,patternError:E="Invalid input"}=D;if(C&&!O)return"You must provide a value";if(M&&!M.test(O))return E;if(typeof D.validate==="function")return await D.validate(O)||"You must provide a valid value";return!0}j1(async(O,C)=>{if(Q!=="idle")return;if(n3(O)){let M=B||X;Z("loading");let E=await U(M);if(E===!0)W(M),Z("done"),F(M);else{if(J.validationFailureMode==="clear")W("");else C.write(B);G(E),Z("idle")}}else if(q$(O)&&!B)Y("");else if(G$(O)&&!B)Y(""),C.clearLine(0),C.write(X),W(X);else W(C.line),G(void 0)}),L1((O)=>{if($==="editable"&&X)O.write(X),W(X)},[]);let V=J.style.message(D.message,Q),H=B;if(typeof D.transformer==="function")H=D.transformer(B,{isFinal:Q==="done"});else if(Q==="done")H=J.style.answer(B);let z;if(X&&Q!=="done"&&!B)z=J.style.defaultAnswer(X);let _="";if(q)_=J.style.error(q);return[[K,V,z,H].filter((O)=>O!==void 0).join(" "),_]});function Lh(D,F){let $=F!==!1;if(/^(y|yes)/i.test(D))$=!0;else if(/^(n|no)/i.test(D))$=!1;return $}function Ph(D){return D?"Yes":"No"}var jh=x1((D,F)=>{let{transformer:$=Ph}=D,[J,Q]=C0("idle"),[Z,X]=C0(""),Y=P1(D.theme),q=a3({status:J,theme:Y});j1((K,U)=>{if(J!=="idle")return;if(n3(K)){let V=Lh(Z,D.default);X($(V)),Q("done"),F(V)}else if(G$(K)){let V=Ph(!Lh(Z,D.default));U.clearLine(0),U.write(V),X(V)}else X(U.line)});let G=Z,B="";if(J==="done")G=Y.style.answer(Z);else B=` ${Y.style.defaultAnswer(D.default===!1?"y/N":"Y/n")}`;let W=Y.style.message(D.message,J);return`${q} ${W}${B} ${G}`});var s3=async(D)=>{let F=await F2({...D,validate:($)=>t($)||"Enter a valid address"});return AD(F)},PYD=async(D)=>{return await F2({...D,validate:($)=>DD($)||"Enter a valid hex value"})},k1=async(D)=>{let F=D.default!==void 0?i2(D.default,D.decimals):void 0,$=await F2({...D,default:F});return T3($,D.decimals)},qz=async(D)=>{let F=D.encoding??await aY({...D,choices:[{value:"string",name:"String encoding",description:"Convert UTF-8 string to bytes"},{value:"hex",name:"Hex string encoding",description:"Convert a hex string to bytes (must start with 0x)"},{value:"abi",name:"ABI encoding",description:"Input as ABI encoding parameters https://abitype.dev/api/human#parseabiparameters"},{value:"abi-packed",name:"ABI packed encoding",description:"Input as ABI encoding parameters https://abitype.dev/api/human#parseabiparameters"}]});switch(F){case"hex":return await PYD({...D,default:"0x",message:`${D.message} (as hex-string)`});case"string":{let $=await F2({...D,message:`${D.message} (as string)`});return F0($)}case"abi":return Sh(D);case"abi-packed":return Sh(D,!0);default:throw Error(`Unsupported encoding ${F}`)}},Sh=async(D,F)=>{let $=D.abiParams??await F2({message:`${D.message} (as ABI encoded https://abitype.dev/api/human#parseabiparameters )`,validate:(Z)=>{try{return H8(Z),!0}catch{return"Invalid ABI parameters"}}}),J=H8($),Q=[];for(let Z of J){let X=`${D.message} -> ${Z.type} ${Z.name??""}`;switch(Z.type){case"string":{Q.push(await F2({message:X}));break}case"bool":{Q.push(await jh({message:X}));break}case"uint":case"uint8":case"uint16":case"uint32":case"uint64":case"uint128":case"uint256":case"int":case"int8":case"int16":case"int32":case"int64":case"int128":case"int256":{Q.push(await F2({message:X,validate:(Y)=>{try{return BigInt(Y),!0}catch{return"Invalid number"}}}));break}case"bytes":{Q.push(await qz({message:X}));break}case"address":{Q.push(await F2({message:X,validate:(Y)=>t(Y)||"Invalid address"}));break}default:throw Error(`Unsupported type ${Z.type}`)}}return F?a4(J.map((Z)=>Z.type),Q):iD(J,Q)},xh=x1((D,F)=>{let $=D.choices,J=D.separator??"\t",Q=$.map((Z)=>`(${v.cyan(Z.value)}) ${Z.name??""}`).join(J);return j1((Z)=>{let X=$.find((Y)=>Y.value===Z.name);if(X)F(X.value)}),`${Q} `}),X8=async(D)=>{let{application:F,projectName:$}=D;if(F&&t(F))return F;let J=await FY({projectName:$});if(J)return J;return await s3({message:"Application address"})};var jYD=r4({...v3,name:"Cartesi Devnet",testnet:!0}),SYD=async(D)=>{if(D.rpcUrl)return D.rpcUrl;try{let F=yD(D);return`http://${await Kk({projectName:F})}/anvil`}catch{return await F2({message:"RPC URL",default:`http://127.0.0.1:${e4}/anvil`})}},Y8=async(D)=>{let F=await SYD(D);return uK({chain:jYD,mode:"anvil",transport:N3(F),pollingInterval:200}).extend(i4).extend(cK)};var kh=async(D)=>{return{address:D.token&&t(D.token)?AD(D.token):await s3({message:"Token address",default:iZ}),name:"TestMultiToken"}},yh=()=>{return new ZD("erc1155-single").description("Deposits an ERC1155 token to the application").configureHelp({showGlobalOptions:!0}).argument("[token-id]","token ID").argument("[amount]","amount to send").option("--token <address>","ERC1155 token address").option("--base-layer-data <hex>","base layer data","0x").option("--exec-layer-data <hex>","exec layer data","0x").action(async(D,F,$,J)=>{let{from:Q}=J.optsWithGlobals(),Z=await Y8(J.optsWithGlobals()),X=await kh({token:$.token}),Y=D?BigInt(D):await k1({decimals:0,message:"Token ID"}),q=yD(J.optsWithGlobals()),G=await X8({...J.optsWithGlobals(),projectName:q}),B=Q&&t(Q)?AD(Q):(await Z.getAddresses())[0],W=F?BigInt(F):await k1({message:`Amount of token ID ${Y}`,decimals:0});if(W<=BigInt(0)){console.error(v.red("Amount of tokens to be deposited, must be greater than zero."));return}let K=XU,U=DD($.baseLayerData)?$.baseLayerData:"0x",V=DD($.execLayerData)?$.execLayerData:"0x",H=sD();if(await Z.readContract({abi:K,address:X.address,functionName:"balanceOf",args:[B,Y]})<W){H.fail("Insufficient balance");return}if(await Z.readContract({abi:K,address:X.address,functionName:"isApprovedForAll",args:[B,y7]})===!1){H.start("Approving ERC1155Portal...");let{request:E}=await Z.simulateContract({abi:K,account:B,address:X.address,functionName:"setApprovalForAll",args:[y7,!0]}),A=await Z.writeContract(E);await Z.waitForTransactionReceipt({hash:A}),H.succeed("Approved ERC1155Portal")}let{request:O}=await Z.simulateContract({abi:zP,account:B,address:y7,functionName:"depositSingleERC1155Token",args:[X.address,G,Y,W,U,V]}),C=`${v.cyan(W)} units of token id ${Y}`;H.start(`Depositing ${C} to ${v.cyan(G)}...`);let M=await Z.writeContract(O);await Z.waitForTransactionReceipt({hash:M}),H.succeed(`Deposited ${C} to ${v.cyan(G)}`)})},fh=()=>{return new ZD("erc1155-batch").description("Deposits multiple ERC1155 tokens to the application").configureHelp({showGlobalOptions:!0}).argument("[token-ids]","token IDs separated by comma").argument("[amounts]","amounts separated by comma").option("--token <address>","ERC1155 token address").option("--base-layer-data <hex>","base layer data","0x").option("--exec-layer-data <hex>","exec layer data","0x").action(async(D,F,$,J)=>{let{from:Q}=J.optsWithGlobals(),Z=await Y8(J.optsWithGlobals()),X=await kh({token:$.token}),Y;if(D)Y=D.split(",").map((M)=>BigInt(M.trim()));else Y=(await F2({message:"Token IDs (comma separated)"})).split(",").map((E)=>BigInt(E.trim()));let q;if(F)q=F.split(",").map((M)=>BigInt(M.trim()));else q=(await F2({message:"Amounts (comma separated)"})).split(",").map((E)=>BigInt(E.trim()));if(Y.length!==q.length){console.error(v.red("Token IDs and amounts must have the same length."));return}for(let M=0;M<q.length;M++)if(q[M]<=BigInt(0)){console.error(v.red(`Amount of token Id: ${Y[M]} to be deposited, must be greater than zero.`));return}let G=yD(J.optsWithGlobals()),B=await X8({...J.optsWithGlobals(),projectName:G}),W=Q&&t(Q)?AD(Q):(await Z.getAddresses())[0],K=XU,U=DD($.baseLayerData)?$.baseLayerData:"0x",V=DD($.execLayerData)?$.execLayerData:"0x",H=sD();for(let M=0;M<Y.length;M++)if(await Z.readContract({abi:K,address:X.address,functionName:"balanceOf",args:[W,Y[M]]})<q[M]){H.fail(`Insufficient balance for token ID ${Y[M]}`);return}if(await Z.readContract({abi:K,address:X.address,functionName:"isApprovedForAll",args:[W,k7]})===!1){H.start("Approving ERC1155Portal...");let{request:M}=await Z.simulateContract({abi:K,account:W,address:X.address,functionName:"setApprovalForAll",args:[k7,!0]}),E=await Z.writeContract(M);await Z.waitForTransactionReceipt({hash:E}),H.succeed("Approved ERC1155Portal")}let{request:_}=await Z.simulateContract({abi:HP,account:W,address:k7,functionName:"depositBatchERC1155Token",args:[X.address,B,Y,q,U,V]}),O=Y.map((M,E)=>`${v.cyan(q[E])} units of token id ${M}`).join(", ");H.start(`Depositing tokens to ${v.cyan(B)}...`);let C=await Z.writeContract(_);await Z.waitForTransactionReceipt({hash:C}),H.succeed(`Deposited ${O} to ${v.cyan(B)}`)})};var xYD=async(D,F)=>{let $={abi:I6,address:F},J=await D.readContract({...$,functionName:"symbol"}),Q=await D.readContract({...$,functionName:"name"}),Z=await D.readContract({...$,functionName:"decimals"});return{address:F,name:Q,symbol:J,decimals:Z}},kYD=async(D)=>{let{testClient:F}=D,$=D.token&&t(D.token)?AD(D.token):await s3({message:"Token address",default:oZ});return xYD(F,$)},bh=()=>{return new ZD("erc20").description("Deposit ERC-20 to the application").configureHelp({showGlobalOptions:!0}).argument("[amount]","amount to send").option("--token <address>","token address").option("--exec-layer-data <hex>","exec layer data","0x").action(async(D,F,$)=>{let{from:J}=$.optsWithGlobals(),Q=yD($.optsWithGlobals()),Z=await Y8($.optsWithGlobals()),X=J&&t(J)?AD(J):(await Z.getAddresses())[0],Y=await kYD({testClient:Z,token:F.token}),q=await X8({...$.optsWithGlobals(),projectName:Q}),{decimals:G,symbol:B}=Y,W=D?T3(D,G):await k1({message:`Amount (${B})`,decimals:G}),K=DD(F.execLayerData)?F.execLayerData:"0x",U=sD();if(await Z.readContract({abi:I6,address:Y.address,functionName:"balanceOf",args:[X]})<W){U.fail("Insufficient balance");return}let H=await Z.readContract({abi:I6,address:Y.address,functionName:"allowance",args:[X,f7]}),z=`${v.cyan(i2(W,G))} ${B}`;if(H<W){U.start(`Approving ${z}...`);let{request:C}=await Z.simulateContract({abi:I6,account:X,address:Y.address,functionName:"approve",args:[f7,W]}),M=await Z.writeContract(C);await Z.waitForTransactionReceipt({hash:M}),U.succeed(`Approved ${z}`)}let{request:_}=await Z.simulateContract({abi:CP,account:X,address:f7,functionName:"depositERC20Tokens",args:[Y.address,q,W,K]});U.start(`Depositing ${z} to ${v.cyan(q)}...`);let O=await Z.writeContract(_);await Z.waitForTransactionReceipt({hash:O}),U.succeed(`Deposited ${z} to ${v.cyan(q)}`)})};var yYD=async(D,F)=>{let $={abi:JQ,address:F},J=await D.readContract({...$,functionName:"symbol"}),Q=await D.readContract({...$,functionName:"name"});return{address:F,name:Q,symbol:J}},fYD=async(D)=>{let{testClient:F}=D,$=D.token&&t(D.token)?AD(D.token):await s3({message:"Token address",default:F5});return yYD(F,$)},vh=()=>{return new ZD("erc721").description("Deposit ERC-721 to the application").configureHelp({showGlobalOptions:!0}).argument("[token-id]","token ID").option("--token <address>","token address").option("--base-layer-data <hex>","base layer data","0x").option("--exec-layer-data <hex>","exec layer data","0x").action(async(D,F,$)=>{let{from:J}=$.optsWithGlobals(),Q=D?BigInt(D):await k1({decimals:0,message:"Token ID"}),Z=yD($.optsWithGlobals()),X=await Y8($.optsWithGlobals()),Y=J&&t(J)?AD(J):(await X.getAddresses())[0],q=await fYD({testClient:X,token:F.token}),G=q.address===F5?EP:JQ,B=await X8({...$.optsWithGlobals(),projectName:Z}),{symbol:W}=q,K=DD(F.baseLayerData)?F.baseLayerData:"0x",U=DD(F.execLayerData)?F.execLayerData:"0x",V=sD();try{if(await X.readContract({abi:G,address:q.address,args:[Q],functionName:"ownerOf"})!==Y){V.fail("Insufficient balance");return}}catch(C){if(C instanceof P){let M=C.walk((E)=>E instanceof N8);if(M instanceof N8){if((M.data?.errorName??"")==="ERC721NonexistentToken"){V.fail(`Token ${D} does not exist`);return}}V.fail("Failed to check ownership")}}let H=await X.readContract({abi:G,address:q.address,args:[Q],functionName:"getApproved"}),z=`${v.cyan(D)} ${W}`;if(H!==b7){V.start(`Approving ${z}...`);let{request:C}=await X.simulateContract({abi:G,account:Y,address:q.address,functionName:"approve",args:[b7,Q]}),M=await X.writeContract(C);await X.waitForTransactionReceipt({hash:M}),V.succeed(`Approved ${z}`)}let{request:_}=await X.simulateContract({abi:_P,account:Y,address:b7,functionName:"depositERC721Token",args:[q.address,B,Q,K,U]});V.start(`Depositing ${z} to ${v.cyan(B)}...`);let O=await X.writeContract(_);await X.waitForTransactionReceipt({hash:O}),V.succeed(`Deposited ${z} to ${v.cyan(B)}`)})};var hh=()=>{return new ZD("ether").description("Deposit ether to the application").configureHelp({showGlobalOptions:!0}).argument("[amount]","amount, in ETH units").option("--exec-layer-data <hex>","exec layer data","0x").action(async(D,F,$)=>{let{from:J}=$.optsWithGlobals(),Q=yD($.optsWithGlobals()),Z=await Y8($.optsWithGlobals()),X=J&&t(J)?AD(J):(await Z.getAddresses())[0],Y=await X8({...$.optsWithGlobals(),projectName:Q}),{decimals:q,symbol:G}=Z.chain.nativeCurrency,B=D?T3(D,q):await k1({message:`Amount (${G})`,decimals:q}),W=DD(F.execLayerData)?F.execLayerData:"0x",K=sD(),U=`${v.cyan(i2(B,q))} ${G}`;if(await Z.getBalance({address:X})<B){K.fail("Insufficient balance");return}let{request:H}=await Z.simulateContract({abi:MP,account:X,address:cZ,args:[Y,W],functionName:"depositEther",value:B});K.start(`Depositing ${U} to ${v.cyan(Y)}...`);let z=await Z.writeContract(H);await Z.waitForTransactionReceipt({hash:z}),K.succeed(`Deposited ${U} to ${v.cyan(Y)}`)})};var uh=()=>{let D=new ZD("deposit").description("Deposits an asset to the application").configureHelp({showGlobalOptions:!0}).option("--from <address>","input sender address").option("--application <address>","application address").option("--project-name <string>","name of project (used by docker compose and cartesi-rollups-node)").option("--rpc-url <url>","RPC URL of the Cartesi Devnet").action(async(F,$)=>{let Q=$.commands.map((X)=>({name:X.name(),value:X,description:X.description()}));(await aY({choices:Q,message:"Select type of asset to deposit"})).parseAsync($.args)});return D.addCommand(hh()),D.addCommand(bh()),D.addCommand(vh()),D.addCommand(yh()),D.addCommand(fh()),D};var t3=TD(D$(),1),gh="25.0.0",mh="2.24.0",dh="0.13.0",bYD=async(D)=>{try{D.start("Checking Docker Engine version...");let{stdout:F}=await wD("docker",["version","--format","{{json .Client.Version}}"]),$=t3.default.coerce(F);if($!==null&&!t3.default.gte($,gh))throw Error(`Unsupported Docker version. Minimum required version is ${gh}. Installed version is ${$}.`);D.succeed(`Docker Engine ${v.cyan($)}`)}catch(F){if(F instanceof Error&&F.code==="ENOENT")throw Error("Docker not found");throw F}return!0},vYD=async(D)=>{try{D.start("Checking Docker Compose version...");let{stdout:F}=await wD("docker",["compose","version","--short"]),$=t3.default.coerce(F);if($!==null&&!t3.default.gte($,mh))throw Error(`Unsupported Docker Compose version. Minimum required version is ${mh}. Installed version is ${$}.`);D.succeed(`Docker Compose ${v.cyan(F)}`)}catch(F){if(F instanceof Error&&F.exitCode===125)throw Error("Docker Compose is required but not installed or the command execution failed. Please refer to the Docker Compose documentation for installation instructions: https://docs.docker.com/compose/install/");throw F}return!0},hYD=async(D)=>{try{D.start("Checking Docker Buildx version...");let{stdout:F}=await wD("docker",["buildx","version"]),$=t3.default.coerce(F);if($!==null&&!t3.default.gte($,dh))throw Error(`Unsupported Docker Buildx version. Minimum required version is ${dh}. Installed version is ${$}.`);D.succeed(`Docker Buildx ${v.cyan($)}`),D.start("Checking Docker RISC-V support...");let{stdout:J}=await wD("docker",["buildx","ls","--format","{{.Platforms}}"]);if(!J.split(",").map((Z)=>Z.trim()).includes("linux/riscv64"))throw Error("Your system does not support riscv64 architecture. Run `docker run --privileged --rm tonistiigi/binfmt:riscv` to enable riscv64 support.");D.succeed(`Docker RISC-V support ${v.cyan("linux/riscv64")}`)}catch(F){if(F instanceof Error&&F.exitCode===125)throw Error("Docker Buildx is required but not installed. Please refer to the Docker Desktop documentation for installation instructions: https://docs.docker.com/desktop/");throw F}return!0},ph=()=>{return new ZD("doctor").action(async()=>{let D=sD();try{await bYD(D),await vYD(D),await hYD(D),D.succeed("Your system is ready.")}catch(F){D.fail(F.message),process.exit(1)}})};var lh=()=>{return new ZD("hash").description("Converts the binary generated by the build command to hexadecimal and prints out the result to console.").option("--json","Format output as json.").action(async({json:D},F)=>{let $=h3();if($)if(!D)console.log(`${v.green("?")} Cartesi machine templateHash ${v.cyan($)}
693
- `);else process.stdout.write(JSON.stringify({hash:$}));else F.error("Cartesi machine snapshot not found, run 'build'")})};var ch=()=>{return new ZD("logs").description("Show logs of a local environment.").option("--project-name <string>","name of project (used by docker compose and cartesi-rollups-node)").option("-f, --follow","Follow log output").option("--since <string>","Show logs since timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)").option("-n, --tail <string>","Number of lines to show from the end of the logs","all").option("--until <string>","Show logs before a timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)").configureHelp({showGlobalOptions:!0}).action(async(D)=>{let{follow:F,since:$,tail:J,until:Q}=D,Z=yD(D),X=[];if(F)X.push("--follow");if($)X.push("--since",$);if(J)X.push("--tail",J);if(Q)X.push("--until",Q);let Y=await QY({projectName:Z,service:"rollups_node"});if(!Y)throw Error("service rollups_node not found");await wD("docker",["container","logs",...X,Y.ID],{stdio:"inherit"})})};import uYD from"node:net";import gYD from"node:os";class Gz extends Error{constructor(D){super(`${D} is locked`)}}var E9={old:new Set,young:new Set},mYD=15000,rY=1024,sY=65535,V$,dYD=()=>{let D=gYD.networkInterfaces(),F=new Set([void 0,"0.0.0.0"]);for(let $ of Object.values(D))for(let J of $)F.add(J.address);return F},nh=(D)=>new Promise((F,$)=>{let J=uYD.createServer();J.unref(),J.on("error",$),J.listen(D,()=>{let{port:Q}=J.address();J.close(()=>{F(Q)})})}),ih=async(D,F)=>{if(D.host||D.port===0)return nh(D);for(let $ of F)try{await nh({port:D.port,host:$})}catch(J){if(!["EADDRNOTAVAIL","EINVAL"].includes(J.code))throw J}return D.port},pYD=function*(D){if(D)yield*D;yield 0};async function Bz(D){let F,$=new Set;if(D){if(D.port)F=typeof D.port==="number"?[D.port]:D.port;if(D.exclude){let Q=D.exclude;if(typeof Q[Symbol.iterator]!=="function")throw TypeError("The `exclude` option must be an iterable.");for(let Z of Q){if(typeof Z!=="number")throw TypeError("Each item in the `exclude` option must be a number corresponding to the port you want excluded.");if(!Number.isSafeInteger(Z))throw TypeError(`Number ${Z} in the exclude option is not a safe integer and can't be used`)}$=new Set(Q)}}if(V$===void 0){if(V$=setTimeout(()=>{V$=void 0,E9.old=E9.young,E9.young=new Set},mYD),V$.unref)V$.unref()}let J=dYD();for(let Q of pYD(F))try{if($.has(Q))continue;let Z=await ih({...D,port:Q},J);while(E9.old.has(Z)||E9.young.has(Z)){if(Q!==0)throw new Gz(Q);Z=await ih({...D,port:Q},J)}return E9.young.add(Z),Z}catch(Z){if(!["EADDRINUSE","EACCES"].includes(Z.code)&&!(Z instanceof Gz))throw Z}throw Error("No available ports found")}function oh(D,F){if(!Number.isInteger(D)||!Number.isInteger(F))throw TypeError("`from` and `to` must be integer numbers");if(D<rY||D>sY)throw RangeError(`'from' must be between ${rY} and ${sY}`);if(F<rY||F>sY)throw RangeError(`'to' must be between ${rY} and ${sY}`);if(D>F)throw RangeError("`to` must be greater than or equal to `from`");return function*(J,Q){for(let Z=J;Z<=Q;Z++)yield Z}(D,F)}var lYD=(D)=>D.split(","),cYD=async(D)=>{let{build:F,epochLength:$,log:J,projectName:Q,prt:Z}=D,X=D.deployment,Y=D.salt;while(!0)try{switch(await xh({choices:[{name:"View logs",value:"l"},{name:"Build and redeploy",value:"b"},{name:"Quit",value:"q"}]},{})){case"l":{try{await J?.parseAsync(["--project-name",Q,"--follow"],{from:"user"})}catch(G){if(G instanceof Z2){if(G.exitCode===130)break;throw G}}break}case"b":{await F?.parseAsync([],{from:"user"});let G=h3();if(G){if(X)await nYD({projectName:Q});X=await ah({consensus:X?.consensus,epochLength:$,hash:G,projectName:Q,prt:Z,salt:k(Y++,{size:32})})}break}case"q":return}}catch(q){if(q instanceof C9)return;throw q}},nYD=async(D)=>{let{projectName:F}=D,$=sD(`${v.cyan(F)} undeploying...`).start();await Wk({application:F,force:!0,projectName:F}),$.succeed(`${v.cyan(F)} undeployed`)},ah=async(D)=>{let{consensus:F,epochLength:$,hash:J,projectName:Q,prt:Z,salt:X}=D,Y=sD(`deploying ${v.cyan(J)} as ${v.cyan(Q)}`),q=await Bk({consensus:F,epochLength:$,name:Q,projectName:Q,prt:Z,salt:X,snapshotPath:"/var/lib/cartesi-rollups-node/snapshots/image"});return Y.succeed(`${v.cyan(Q)} machine hash is ${v.cyan(J)}`),Y.succeed(`${v.cyan(Q)} contract deployed at ${v.cyan(q.address)}`),q},iYD=async(D)=>{if(!D.forkUrl)return;let F=D.forkUrl,$=o4({transport:N3(F)}),J=D.forkBlockNumber?BigInt(D.forkBlockNumber):await $.getBlockNumber(),Q=await $.getChainId();return{blockNumber:J,chainId:Q,url:F}},rh=()=>{return new ZD("run").description("Run a local cartesi node for the application.").addOption(new S0("--authority","deploy application with authority consensus").default(!1)).addOption(new S0("--block-time <number>","interval between blocks (in seconds)").argParser(Number).default(2)).addOption(new S0("--cpus <number>","number of cpu limits for the rollups-node").argParser(Number)).addOption(new S0("--default-block <string>","default block to be used when fetching new blocks.").choices(["latest","safe","pending","finalized"]).default("latest")).option("--dry-run","show the docker compose configuration",!1).option("--fork-url <url>","RPC URL to fork from").addOption(new S0("--fork-block-number <number>","block number to fork from").argParser(Number)).addOption(new S0("--memory <number>","memory limit for the rollups-node in MB").argParser(Number)).addOption(new S0("--epoch-length <number>","length of an epoch (in blocks)").argParser(Number).default(720)).option("-p, --port <number>","port to listen on",Number).addOption(new S0("--runtime-version <version>","version for Cartesi Rollups Runtime to use").default(QU).hideHelp()).option("--project-name <string>","name of project (used by docker compose and cartesi-rollups-node)").option("--services <string>",`optional services to start, comma separated list from [${Xk.join(", ")}]`,lYD,[]).option("-v, --verbose","verbose output",!1).action(async(D,F)=>{let{authority:$,blockTime:J,cpus:Q,defaultBlock:Z,dryRun:X,epochLength:Y,memory:q,runtimeVersion:G,services:B,verbose:W}=D,K=sD();if(Z!=="finalized")console.warn(v.yellow(`WARNING: default block is set to '${Z}', production configuration will likely use 'finalized'`));let U=yD(D),V=D.port||await Bz({port:oh(e4,e4+10)}),H=await iYD(D),z=process.stdin.isTTY,{cmd:_,config:O}=await Yk({blockTime:J,cpus:Q,defaultBlock:Z,detach:z,dryRun:X,forkConfig:H,memory:q,port:V,projectName:U,runtimeVersion:G,services:B,verbose:W}),C=`${A1}:${V}`;if(X&&O){process.stdout.write(O);return}K.succeed(`${v.cyan(U)} starting at ${v.cyan(`${C}`)}`),await qk({name:U,port:V,projectName:U,services:B});let M,E=0,A=!$,w=h3();if(w)M=await ah({epochLength:Y,hash:w,projectName:U,prt:A,salt:k(E++,{size:32})});else console.warn(v.yellow("machine snapshot not found, waiting for build"));let R=async()=>{K.start(`${v.cyan(U)} stopping...`);try{await Gk({projectName:U}),K.succeed(`${v.cyan(U)} stopped`)}catch(T){K.fail(T instanceof Error?T.message:"Unknown error")}process.exit(0)};if(z){process.on("SIGINT",()=>{}),process.on("SIGTERM",()=>{});let T=F.parent?.commands.find((j)=>j.name()==="logs"),N=F.parent?.commands.find((j)=>j.name()==="build");await cYD({build:N,deployment:M,epochLength:Y,log:T,projectName:U,prt:A,salt:E}),await R()}else{process.on("SIGINT",R),process.on("SIGTERM",R);try{await _}catch(T){if(T instanceof Z2){if(T.exitCode===130)return;throw T}}}})};var oYD=async(D,F)=>{let{encoding:$}=F;if(D){if($==="hex"){if(!DD(D))throw Error("input encoded as hex must start with 0x");return D}if($==="string")return F0(D);if($==="abi"||$==="abi-packed"){let J=F.abiParams;if(!J)throw Error("Undefined input-abi-params");let Q=H8(J),Z=D.split(",").map((X,Y)=>{if(Y>=Q.length)throw Error(`Too many values, expected ${Q.length} values based on --input-abi-params '${J}', parsing value at index ${Y} from input '${D}'`);let q=Q[Y];switch(q.type){case"string":return X;case"bool":if(X==="true")return!0;if(X==="false")return!1;throw Error(`Invalid boolean value: ${X}`);case"uint":case"uint8":case"uint16":case"uint32":case"uint64":case"uint128":case"uint256":case"int":case"int8":case"int16":case"int32":case"int64":case"int128":case"int256":try{return BigInt(X)}catch{throw Error(`Invalid uint value: ${X}`)}case"bytes":if(DD(X))return X;throw Error(`Invalid bytes value: ${X}`);case"address":if(t(X))return AD(X);throw Error(`Invalid address value: ${X}`);default:throw Error(`Unsupported type ${q.type}`)}});if(Z.length!==Q.length)throw Error(`Not enough values, expected ${Q.length} values based on --input-abi-params '${J}', parsed ${Z.length} values from input '${D}'`);if($==="abi")return iD(Q,Z);else if($==="abi-packed"){let X=Q.map((Y)=>Y.type);return a4(X,Z)}}if(DD(D))return D;return F0(D)}return},sh=()=>{return new ZD("send").description("Send input to the application").argument("[input]","input payload").option("--from <address>","input sender address").option("--application <address>","application address").addOption(new S0("--encoding <encoding>","input encoding").choices(["hex","string","abi","abi-packed"])).option("--abi-params <abi-params>","input abi params").option("--project-name <string>","name of project (used by docker compose and cartesi-rollups-node)").option("--rpc-url <url>","RPC URL of the Cartesi Devnet").action(async(F,$)=>{let{application:J,from:Q}=$,Z=yD($),X=await Y8($),Y=Q&&t(Q)?AD(Q):(await X.getAddresses())[0],q=await X8({application:J,projectName:Z}),G=await oYD(F,$)||await qz({abiParams:$.abiParams,encoding:$.encoding,message:"Input"}),{request:B}=await X.simulateContract({address:v7,abi:OP,account:Y,args:[q,G],functionName:"addInput"}),W=await X.writeContract(B),K=sD("Sending input...").start();await X.waitForTransactionReceipt({hash:W}),K.succeed(`Input sent: ${W}`)})};var th=TD(m8(),1);import aYD from"node:path";var eh=()=>{return new ZD("shell").option("--command <command>","shell command to run","/bin/sh").option("-c, --config <config>","path to the configuration file",(D,F)=>F.concat([D]),["cartesi.toml"]).option("--run-as-root","run as root user",!1).action(async(D)=>{let{command:F,runAsRoot:$}=D,J=JY(D.config),Q=aYD.resolve(I1());for(let[Z,X]of Object.entries(J.drives)){let Y=`${Z}.${X.format}`,q=I1(Y);if(!th.default.existsSync(q))throw Error(`drive '${Z}' not built, run 'build'`)}J.machine.entrypoint=F,J.machine.user=$?"root":void 0;try{await vY(J,void 0,{interactive:!0},{cwd:Q,stdio:"inherit"})}catch(Z){if(Z instanceof Z2){if(Z.exitCode===130)return;throw Z}}})};var Du=TD(Oq(),1);var Fu=()=>{return new ZD("status").description("Shows the status of a local environment.").configureHelp({showGlobalOptions:!0}).option("--project-name <string>","name of project (used by docker compose and cartesi-rollups-node)").option("--json","output in JSON format").action(async(D)=>{let{json:F}=D,$=yD(D),J=await zk({projectName:$,service:"rollups_node"}),Q=await sV({projectName:$});if(F)process.stdout.write(JSON.stringify({status:J,deployments:Q}));else if(console.log(`${v.cyan($)} is ${J==="running"?v.green("running"):v.red("not running")}`),J==="running")if(Q.length===0)console.log(v.red("no applications deployed"));else{let Z=new Du.default({head:["Machine","Address","State"],style:{border:[],head:[]}});Z.push(...Q.map((X)=>[X.templateHash,X.address,X.state])),console.log(Z.toString())}})};var rYD=String.raw` .
693
+ `);else process.stdout.write(JSON.stringify({hash:$}));else F.error("Cartesi machine snapshot not found, run 'build'")})};var ch=()=>{return new ZD("logs").description("Show logs of a local environment.").option("--project-name <string>","name of project (used by docker compose and cartesi-rollups-node)").option("-f, --follow","Follow log output").option("--since <string>","Show logs since timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)").option("-n, --tail <string>","Number of lines to show from the end of the logs","all").option("--until <string>","Show logs before a timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)").configureHelp({showGlobalOptions:!0}).action(async(D)=>{let{follow:F,since:$,tail:J,until:Q}=D,Z=yD(D),X=[];if(F)X.push("--follow");if($)X.push("--since",$);if(J)X.push("--tail",J);if(Q)X.push("--until",Q);let Y=await QY({projectName:Z,service:"rollups_node"});if(!Y)throw Error("service rollups_node not found");await wD("docker",["container","logs",...X,Y.ID],{stdio:"inherit"})})};import uYD from"node:net";import gYD from"node:os";class Gz extends Error{constructor(D){super(`${D} is locked`)}}var E9={old:new Set,young:new Set},mYD=15000,rY=1024,sY=65535,V$,dYD=()=>{let D=gYD.networkInterfaces(),F=new Set([void 0,"0.0.0.0"]);for(let $ of Object.values(D))for(let J of $)F.add(J.address);return F},nh=(D)=>new Promise((F,$)=>{let J=uYD.createServer();J.unref(),J.on("error",$),J.listen(D,()=>{let{port:Q}=J.address();J.close(()=>{F(Q)})})}),ih=async(D,F)=>{if(D.host||D.port===0)return nh(D);for(let $ of F)try{await nh({port:D.port,host:$})}catch(J){if(!["EADDRNOTAVAIL","EINVAL"].includes(J.code))throw J}return D.port},pYD=function*(D){if(D)yield*D;yield 0};async function Bz(D){let F,$=new Set;if(D){if(D.port)F=typeof D.port==="number"?[D.port]:D.port;if(D.exclude){let Q=D.exclude;if(typeof Q[Symbol.iterator]!=="function")throw TypeError("The `exclude` option must be an iterable.");for(let Z of Q){if(typeof Z!=="number")throw TypeError("Each item in the `exclude` option must be a number corresponding to the port you want excluded.");if(!Number.isSafeInteger(Z))throw TypeError(`Number ${Z} in the exclude option is not a safe integer and can't be used`)}$=new Set(Q)}}if(V$===void 0){if(V$=setTimeout(()=>{V$=void 0,E9.old=E9.young,E9.young=new Set},mYD),V$.unref)V$.unref()}let J=dYD();for(let Q of pYD(F))try{if($.has(Q))continue;let Z=await ih({...D,port:Q},J);while(E9.old.has(Z)||E9.young.has(Z)){if(Q!==0)throw new Gz(Q);Z=await ih({...D,port:Q},J)}return E9.young.add(Z),Z}catch(Z){if(!["EADDRINUSE","EACCES"].includes(Z.code)&&!(Z instanceof Gz))throw Z}throw Error("No available ports found")}function oh(D,F){if(!Number.isInteger(D)||!Number.isInteger(F))throw TypeError("`from` and `to` must be integer numbers");if(D<rY||D>sY)throw RangeError(`'from' must be between ${rY} and ${sY}`);if(F<rY||F>sY)throw RangeError(`'to' must be between ${rY} and ${sY}`);if(D>F)throw RangeError("`to` must be greater than or equal to `from`");return function*(J,Q){for(let Z=J;Z<=Q;Z++)yield Z}(D,F)}var lYD=(D)=>D.split(","),cYD=async(D)=>{let{build:F,epochLength:$,log:J,projectName:Q,prt:Z}=D,X=D.deployment,Y=D.salt;while(!0)try{switch(await xh({choices:[{name:"View logs",value:"l"},{name:"Build and redeploy",value:"b"},{name:"Quit",value:"q"}]},{})){case"l":{try{await J?.parseAsync(["--project-name",Q,"--follow"],{from:"user"})}catch(G){if(G instanceof Z2){if(G.exitCode===130)break;throw G}}break}case"b":{await F?.parseAsync([],{from:"user"});let G=h3();if(G){if(X)await nYD({projectName:Q});X=await ah({consensus:X?.consensus,epochLength:$,hash:G,projectName:Q,prt:Z,salt:k(Y++,{size:32})})}break}case"q":return}}catch(q){if(q instanceof C9)return;throw q}},nYD=async(D)=>{let{projectName:F}=D,$=sD(`${v.cyan(F)} undeploying...`).start();await Wk({application:F,force:!0,projectName:F}),$.succeed(`${v.cyan(F)} undeployed`)},ah=async(D)=>{let{consensus:F,epochLength:$,hash:J,projectName:Q,prt:Z,salt:X}=D,Y=sD(`deploying ${v.cyan(J)} as ${v.cyan(Q)}`),q=await Bk({consensus:F,epochLength:$,name:Q,projectName:Q,prt:Z,salt:X,snapshotPath:"/var/lib/cartesi-rollups-node/snapshots/image"});return Y.succeed(`${v.cyan(Q)} machine hash is ${v.cyan(J)}`),Y.succeed(`${v.cyan(Q)} contract deployed at ${v.cyan(q.address)}`),q},iYD=async(D)=>{if(!D.forkUrl)return;let F=D.forkUrl,$=o4({transport:N3(F)}),J=D.forkBlockNumber?BigInt(D.forkBlockNumber):await $.getBlockNumber(),Q=await $.getChainId();return{blockNumber:J,chainId:Q,url:F}},rh=()=>{return new ZD("run").description("Run a local cartesi node for the application.").addOption(new S0("--prt","deploy application with PRT consensus").default(!1)).addOption(new S0("--block-time <number>","interval between blocks (in seconds)").argParser(Number).default(2)).addOption(new S0("--cpus <number>","number of cpu limits for the rollups-node").argParser(Number)).addOption(new S0("--default-block <string>","default block to be used when fetching new blocks.").choices(["latest","safe","pending","finalized"]).default("latest")).option("--dry-run","show the docker compose configuration",!1).option("--fork-url <url>","RPC URL to fork from").addOption(new S0("--fork-block-number <number>","block number to fork from").argParser(Number)).addOption(new S0("--memory <number>","memory limit for the rollups-node in MB").argParser(Number)).addOption(new S0("--epoch-length <number>","length of an epoch (in blocks)").argParser(Number).default(720)).option("-p, --port <number>","port to listen on",Number).addOption(new S0("--runtime-version <version>","version for Cartesi Rollups Runtime to use").default(QU).hideHelp()).option("--project-name <string>","name of project (used by docker compose and cartesi-rollups-node)").option("--services <string>",`optional services to start, comma separated list from [${Xk.join(", ")}]`,lYD,[]).option("-v, --verbose","verbose output",!1).action(async(D,F)=>{let{prt:$,blockTime:J,cpus:Q,defaultBlock:Z,dryRun:X,epochLength:Y,memory:q,runtimeVersion:G,services:B,verbose:W}=D,K=sD();if(Z!=="finalized")console.warn(v.yellow(`WARNING: default block is set to '${Z}', production configuration will likely use 'finalized'`));let U=yD(D),V=D.port||await Bz({port:oh(e4,e4+10)}),H=await iYD(D),z=process.stdin.isTTY,{cmd:_,config:O}=await Yk({blockTime:J,cpus:Q,defaultBlock:Z,detach:z,dryRun:X,forkConfig:H,memory:q,port:V,projectName:U,prt:$,runtimeVersion:G,services:B,verbose:W}),C=`${A1}:${V}`;if(X&&O){process.stdout.write(O);return}K.succeed(`${v.cyan(U)} starting at ${v.cyan(`${C}`)}`),await qk({name:U,port:V,projectName:U,services:B});let M,E=0,A=h3();if(A)M=await ah({epochLength:Y,hash:A,projectName:U,prt:$,salt:k(E++,{size:32})});else console.warn(v.yellow("machine snapshot not found, waiting for build"));let I=async()=>{K.start(`${v.cyan(U)} stopping...`);try{await Gk({projectName:U}),K.succeed(`${v.cyan(U)} stopped`)}catch(R){K.fail(R instanceof Error?R.message:"Unknown error")}process.exit(0)};if(z){process.on("SIGINT",()=>{}),process.on("SIGTERM",()=>{});let R=F.parent?.commands.find((N)=>N.name()==="logs"),T=F.parent?.commands.find((N)=>N.name()==="build");await cYD({build:T,deployment:M,epochLength:Y,log:R,projectName:U,prt:$,salt:E}),await I()}else{process.on("SIGINT",I),process.on("SIGTERM",I);try{await _}catch(R){if(R instanceof Z2){if(R.exitCode===130)return;throw R}}}})};var oYD=async(D,F)=>{let{encoding:$}=F;if(D){if($==="hex"){if(!DD(D))throw Error("input encoded as hex must start with 0x");return D}if($==="string")return F0(D);if($==="abi"||$==="abi-packed"){let J=F.abiParams;if(!J)throw Error("Undefined input-abi-params");let Q=H8(J),Z=D.split(",").map((X,Y)=>{if(Y>=Q.length)throw Error(`Too many values, expected ${Q.length} values based on --input-abi-params '${J}', parsing value at index ${Y} from input '${D}'`);let q=Q[Y];switch(q.type){case"string":return X;case"bool":if(X==="true")return!0;if(X==="false")return!1;throw Error(`Invalid boolean value: ${X}`);case"uint":case"uint8":case"uint16":case"uint32":case"uint64":case"uint128":case"uint256":case"int":case"int8":case"int16":case"int32":case"int64":case"int128":case"int256":try{return BigInt(X)}catch{throw Error(`Invalid uint value: ${X}`)}case"bytes":if(DD(X))return X;throw Error(`Invalid bytes value: ${X}`);case"address":if(t(X))return AD(X);throw Error(`Invalid address value: ${X}`);default:throw Error(`Unsupported type ${q.type}`)}});if(Z.length!==Q.length)throw Error(`Not enough values, expected ${Q.length} values based on --input-abi-params '${J}', parsed ${Z.length} values from input '${D}'`);if($==="abi")return iD(Q,Z);else if($==="abi-packed"){let X=Q.map((Y)=>Y.type);return a4(X,Z)}}if(DD(D))return D;return F0(D)}return},sh=()=>{return new ZD("send").description("Send input to the application").argument("[input]","input payload").option("--from <address>","input sender address").option("--application <address>","application address").addOption(new S0("--encoding <encoding>","input encoding").choices(["hex","string","abi","abi-packed"])).option("--abi-params <abi-params>","input abi params").option("--project-name <string>","name of project (used by docker compose and cartesi-rollups-node)").option("--rpc-url <url>","RPC URL of the Cartesi Devnet").action(async(F,$)=>{let{application:J,from:Q}=$,Z=yD($),X=await Y8($),Y=Q&&t(Q)?AD(Q):(await X.getAddresses())[0],q=await X8({application:J,projectName:Z}),G=await oYD(F,$)||await qz({abiParams:$.abiParams,encoding:$.encoding,message:"Input"}),{request:B}=await X.simulateContract({address:v7,abi:OP,account:Y,args:[q,G],functionName:"addInput"}),W=await X.writeContract(B),K=sD("Sending input...").start();await X.waitForTransactionReceipt({hash:W}),K.succeed(`Input sent: ${W}`)})};var th=TD(m8(),1);import aYD from"node:path";var eh=()=>{return new ZD("shell").option("--command <command>","shell command to run","/bin/sh").option("-c, --config <config>","path to the configuration file",(D,F)=>F.concat([D]),["cartesi.toml"]).option("--run-as-root","run as root user",!1).action(async(D)=>{let{command:F,runAsRoot:$}=D,J=JY(D.config),Q=aYD.resolve(I1());for(let[Z,X]of Object.entries(J.drives)){let Y=`${Z}.${X.format}`,q=I1(Y);if(!th.default.existsSync(q))throw Error(`drive '${Z}' not built, run 'build'`)}J.machine.entrypoint=F,J.machine.user=$?"root":void 0;try{await vY(J,void 0,{interactive:!0},{cwd:Q,stdio:"inherit"})}catch(Z){if(Z instanceof Z2){if(Z.exitCode===130)return;throw Z}}})};var Du=TD(Oq(),1);var Fu=()=>{return new ZD("status").description("Shows the status of a local environment.").configureHelp({showGlobalOptions:!0}).option("--project-name <string>","name of project (used by docker compose and cartesi-rollups-node)").option("--json","output in JSON format").action(async(D)=>{let{json:F}=D,$=yD(D),J=await zk({projectName:$,service:"rollups_node"}),Q=await sV({projectName:$});if(F)process.stdout.write(JSON.stringify({status:J,deployments:Q}));else if(console.log(`${v.cyan($)} is ${J==="running"?v.green("running"):v.red("not running")}`),J==="running")if(Q.length===0)console.log(v.red("no applications deployed"));else{let Z=new Du.default({head:["Machine","Address","State"],style:{border:[],head:[]}});Z.push(...Q.map((X)=>[X.templateHash,X.address,X.state])),console.log(Z.toString())}})};var rYD=String.raw` .
694
694
  / \
695
695
  / \
696
696
  \---/---\ /----\
@@ -700,5 +700,5 @@ http:
700
700
  \ / CLI
701
701
  '`,sYD=new ZD().name("cartesi").version(Sz.version).addHelpText("before",rYD).addCommand(_k()).addCommand(Lv()).addCommand(jv()).addCommand(lv()).addCommand(nv(),{hidden:!0}).addCommand(uh()).addCommand(ph()).addCommand(ch()).addCommand(lh()).addCommand(rh()).addCommand(sh()).addCommand(eh()).addCommand(Fu());process.on("uncaughtException",(D)=>{console.error(D),process.exit(1)});sYD.parse();
702
702
 
703
- //# debugId=D9DB59415C4A96AB64756E2164756E21
703
+ //# debugId=A7CC0C2B5272579364756E2164756E21
704
704
  //# sourceMappingURL=index.js.map