oh-my-agent 5.0.0 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.js +266 -259
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -1,100 +1,100 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{createRequire as
|
|
3
|
-
`)}displayWidth($){return
|
|
2
|
+
import{createRequire as mM}from"node:module";var wM=Object.create;var{getPrototypeOf:EM,defineProperty:_g,getOwnPropertyNames:CM}=Object;var fM=Object.prototype.hasOwnProperty;function xM($){return this[$]}var kM,yM,O$=($,I,_)=>{var u=$!=null&&typeof $==="object";if(u){var U=I?kM??=new WeakMap:yM??=new WeakMap,g=U.get($);if(g)return g}_=$!=null?wM(EM($)):{};let z=I||!$||!$.__esModule?_g(_,"default",{value:$,enumerable:!0}):_;for(let G of CM($))if(!fM.call(z,G))_g(z,G,{get:xM.bind($,G),enumerable:!0});if(u)U.set($,z);return z};var S=($,I)=>()=>(I||$((I={exports:{}}).exports,I),I.exports);var iM=($)=>$;function lM($,I){this[$]=iM.bind(null,I)}var b4=($,I)=>{for(var _ in I)_g($,_,{get:I[_],enumerable:!0,configurable:!0,set:lM.bind(I,_)})};var wI=($,I)=>()=>($&&(I=$($=0)),I);var z$=mM(import.meta.url);var EI=S((nM)=>{class ug extends Error{constructor($,I,_){super(_);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=I,this.exitCode=$,this.nestedError=void 0}}class L5 extends ug{constructor($){super(1,"commander.invalidArgument",$);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}nM.CommanderError=ug;nM.InvalidArgumentError=L5});var DU=S((oM)=>{var{InvalidArgumentError:cM}=EI();class B5{constructor($,I){switch(this.description=I||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,$[0]){case"<":this.required=!0,this._name=$.slice(1,-1);break;case"[":this.required=!1,this._name=$.slice(1,-1);break;default:this.required=!0,this._name=$;break}if(this._name.endsWith("..."))this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_collectValue($,I){if(I===this.defaultValue||!Array.isArray(I))return[$];return I.push($),I}default($,I){return this.defaultValue=$,this.defaultValueDescription=I,this}argParser($){return this.parseArg=$,this}choices($){return this.argChoices=$.slice(),this.parseArg=(I,_)=>{if(!this.argChoices.includes(I))throw new cM(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(I,_);return I},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function dM($){let I=$.name()+($.variadic===!0?"...":"");return $.required?"<"+I+">":"["+I+"]"}oM.Argument=B5;oM.humanReadableArgName=dM});var gg=S((eM)=>{var{humanReadableArgName:aM}=DU();class K5{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext($){this.helpWidth=this.helpWidth??$.helpWidth??80}visibleCommands($){let I=$.commands.filter((u)=>!u._hidden),_=$._getHelpCommand();if(_&&!_._hidden)I.push(_);if(this.sortSubcommands)I.sort((u,U)=>{return u.name().localeCompare(U.name())});return I}compareOptions($,I){let _=(u)=>{return u.short?u.short.replace(/^-/,""):u.long.replace(/^--/,"")};return _($).localeCompare(_(I))}visibleOptions($){let I=$.options.filter((u)=>!u.hidden),_=$._getHelpOption();if(_&&!_.hidden){let u=_.short&&$._findOption(_.short),U=_.long&&$._findOption(_.long);if(!u&&!U)I.push(_);else if(_.long&&!U)I.push($.createOption(_.long,_.description));else if(_.short&&!u)I.push($.createOption(_.short,_.description))}if(this.sortOptions)I.sort(this.compareOptions);return I}visibleGlobalOptions($){if(!this.showGlobalOptions)return[];let I=[];for(let _=$.parent;_;_=_.parent){let u=_.options.filter((U)=>!U.hidden);I.push(...u)}if(this.sortOptions)I.sort(this.compareOptions);return I}visibleArguments($){if($._argsDescription)$.registeredArguments.forEach((I)=>{I.description=I.description||$._argsDescription[I.name()]||""});if($.registeredArguments.find((I)=>I.description))return $.registeredArguments;return[]}subcommandTerm($){let I=$.registeredArguments.map((_)=>aM(_)).join(" ");return $._name+($._aliases[0]?"|"+$._aliases[0]:"")+($.options.length?" [options]":"")+(I?" "+I:"")}optionTerm($){return $.flags}argumentTerm($){return $.name()}longestSubcommandTermLength($,I){return I.visibleCommands($).reduce((_,u)=>{return Math.max(_,this.displayWidth(I.styleSubcommandTerm(I.subcommandTerm(u))))},0)}longestOptionTermLength($,I){return I.visibleOptions($).reduce((_,u)=>{return Math.max(_,this.displayWidth(I.styleOptionTerm(I.optionTerm(u))))},0)}longestGlobalOptionTermLength($,I){return I.visibleGlobalOptions($).reduce((_,u)=>{return Math.max(_,this.displayWidth(I.styleOptionTerm(I.optionTerm(u))))},0)}longestArgumentTermLength($,I){return I.visibleArguments($).reduce((_,u)=>{return Math.max(_,this.displayWidth(I.styleArgumentTerm(I.argumentTerm(u))))},0)}commandUsage($){let I=$._name;if($._aliases[0])I=I+"|"+$._aliases[0];let _="";for(let u=$.parent;u;u=u.parent)_=u.name()+" "+_;return _+I+" "+$.usage()}commandDescription($){return $.description()}subcommandDescription($){return $.summary()||$.description()}optionDescription($){let I=[];if($.argChoices)I.push(`choices: ${$.argChoices.map((_)=>JSON.stringify(_)).join(", ")}`);if($.defaultValue!==void 0){if($.required||$.optional||$.isBoolean()&&typeof $.defaultValue==="boolean")I.push(`default: ${$.defaultValueDescription||JSON.stringify($.defaultValue)}`)}if($.presetArg!==void 0&&$.optional)I.push(`preset: ${JSON.stringify($.presetArg)}`);if($.envVar!==void 0)I.push(`env: ${$.envVar}`);if(I.length>0){let _=`(${I.join(", ")})`;if($.description)return`${$.description} ${_}`;return _}return $.description}argumentDescription($){let I=[];if($.argChoices)I.push(`choices: ${$.argChoices.map((_)=>JSON.stringify(_)).join(", ")}`);if($.defaultValue!==void 0)I.push(`default: ${$.defaultValueDescription||JSON.stringify($.defaultValue)}`);if(I.length>0){let _=`(${I.join(", ")})`;if($.description)return`${$.description} ${_}`;return _}return $.description}formatItemList($,I,_){if(I.length===0)return[];return[_.styleTitle($),...I,""]}groupItems($,I,_){let u=new Map;return $.forEach((U)=>{let g=_(U);if(!u.has(g))u.set(g,[])}),I.forEach((U)=>{let g=_(U);if(!u.has(g))u.set(g,[]);u.get(g).push(U)}),u}formatHelp($,I){let _=I.padWidth($,I),u=I.helpWidth??80;function U(N,q){return I.formatItem(N,_,q,I)}let g=[`${I.styleTitle("Usage:")} ${I.styleUsage(I.commandUsage($))}`,""],z=I.commandDescription($);if(z.length>0)g=g.concat([I.boxWrap(I.styleCommandDescription(z),u),""]);let G=I.visibleArguments($).map((N)=>{return U(I.styleArgumentTerm(I.argumentTerm(N)),I.styleArgumentDescription(I.argumentDescription(N)))});if(g=g.concat(this.formatItemList("Arguments:",G,I)),this.groupItems($.options,I.visibleOptions($),(N)=>N.helpGroupHeading??"Options:").forEach((N,q)=>{let Q=N.map((Y)=>{return U(I.styleOptionTerm(I.optionTerm(Y)),I.styleOptionDescription(I.optionDescription(Y)))});g=g.concat(this.formatItemList(q,Q,I))}),I.showGlobalOptions){let N=I.visibleGlobalOptions($).map((q)=>{return U(I.styleOptionTerm(I.optionTerm(q)),I.styleOptionDescription(I.optionDescription(q)))});g=g.concat(this.formatItemList("Global Options:",N,I))}return this.groupItems($.commands,I.visibleCommands($),(N)=>N.helpGroup()||"Commands:").forEach((N,q)=>{let Q=N.map((Y)=>{return U(I.styleSubcommandTerm(I.subcommandTerm(Y)),I.styleSubcommandDescription(I.subcommandDescription(Y)))});g=g.concat(this.formatItemList(q,Q,I))}),g.join(`
|
|
3
|
+
`)}displayWidth($){return W5($).length}styleTitle($){return $}styleUsage($){return $.split(" ").map((I)=>{if(I==="[options]")return this.styleOptionText(I);if(I==="[command]")return this.styleSubcommandText(I);if(I[0]==="["||I[0]==="<")return this.styleArgumentText(I);return this.styleCommandText(I)}).join(" ")}styleCommandDescription($){return this.styleDescriptionText($)}styleOptionDescription($){return this.styleDescriptionText($)}styleSubcommandDescription($){return this.styleDescriptionText($)}styleArgumentDescription($){return this.styleDescriptionText($)}styleDescriptionText($){return $}styleOptionTerm($){return this.styleOptionText($)}styleSubcommandTerm($){return $.split(" ").map((I)=>{if(I==="[options]")return this.styleOptionText(I);if(I[0]==="["||I[0]==="<")return this.styleArgumentText(I);return this.styleSubcommandText(I)}).join(" ")}styleArgumentTerm($){return this.styleArgumentText($)}styleOptionText($){return $}styleArgumentText($){return $}styleSubcommandText($){return $}styleCommandText($){return $}padWidth($,I){return Math.max(I.longestOptionTermLength($,I),I.longestGlobalOptionTermLength($,I),I.longestSubcommandTermLength($,I),I.longestArgumentTermLength($,I))}preformatted($){return/\n[^\S\r\n]/.test($)}formatItem($,I,_,u){let g=" ".repeat(2);if(!_)return g+$;let z=$.padEnd(I+$.length-u.displayWidth($)),G=2,X=(this.helpWidth??80)-I-G-2,N;if(X<this.minWidthToWrap||u.preformatted(_))N=_;else N=u.boxWrap(_,X).replace(/\n/g,`
|
|
4
4
|
`+" ".repeat(I+G));return g+z+" ".repeat(G)+N.replace(/\n/g,`
|
|
5
5
|
${g}`)}boxWrap($,I){if(I<this.minWidthToWrap)return $;let _=$.split(/\r\n|\n/),u=/[\s]*[^\s]+/g,U=[];return _.forEach((g)=>{let z=g.match(u);if(z===null){U.push("");return}let G=[z.shift()],J=this.displayWidth(G[0]);z.forEach((X)=>{let N=this.displayWidth(X);if(J+N<=I){G.push(X),J+=N;return}U.push(G.join(""));let q=X.trimStart();G=[q],J=this.displayWidth(q)}),U.push(G.join(""))}),U.join(`
|
|
6
|
-
`)}}function
|
|
6
|
+
`)}}function W5($){let I=/\x1b\[\d*(;\d*)*m/g;return $.replace(I,"")}eM.Help=K5;eM.stripColor=W5});var zg=S((_D)=>{var{InvalidArgumentError:ID}=EI();class V5{constructor($,I){this.flags=$,this.description=I||"",this.required=$.includes("<"),this.optional=$.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test($),this.mandatory=!1;let _=UD($);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($,I){return this.defaultValue=$,this.defaultValueDescription=I,this}preset($){return this.presetArg=$,this}conflicts($){return this.conflictsWith=this.conflictsWith.concat($),this}implies($){let I=$;if(typeof $==="string")I={[$]:!0};return this.implied=Object.assign(this.implied||{},I),this}env($){return this.envVar=$,this}argParser($){return this.parseArg=$,this}makeOptionMandatory($=!0){return this.mandatory=!!$,this}hideHelp($=!0){return this.hidden=!!$,this}_collectValue($,I){if(I===this.defaultValue||!Array.isArray(I))return[$];return I.push($),I}choices($){return this.argChoices=$.slice(),this.parseArg=(I,_)=>{if(!this.argChoices.includes(I))throw new ID(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(I,_);return I},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return R5(this.name().replace(/^no-/,""));return R5(this.name())}helpGroup($){return this.helpGroupHeading=$,this}is($){return this.short===$||this.long===$}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class Z5{constructor($){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,$.forEach((I)=>{if(I.negate)this.negativeOptions.set(I.attributeName(),I);else this.positiveOptions.set(I.attributeName(),I)}),this.negativeOptions.forEach((I,_)=>{if(this.positiveOptions.has(_))this.dualOptions.add(_)})}valueFromOption($,I){let _=I.attributeName();if(!this.dualOptions.has(_))return!0;let u=this.negativeOptions.get(_).presetArg,U=u!==void 0?u:!1;return I.negate===(U===$)}}function R5($){return $.split("-").reduce((I,_)=>{return I+_[0].toUpperCase()+_.slice(1)})}function UD($){let I,_,u=/^-[^-]$/,U=/^--[^-]/,g=$.split(/[ |,]+/).concat("guard");if(u.test(g[0]))I=g.shift();if(U.test(g[0]))_=g.shift();if(!I&&u.test(g[0]))I=g.shift();if(!I&&U.test(g[0]))I=_,_=g.shift();if(g[0].startsWith("-")){let z=g[0],G=`option creation failed due to '${z}' in option flags '${$}'`;if(/^-[^-][^-]/.test(z))throw Error(`${G}
|
|
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(u.test(z))throw Error(`${G}
|
|
10
10
|
- too many short flags`);if(U.test(z))throw Error(`${G}
|
|
11
11
|
- too many long flags`);throw Error(`${G}
|
|
12
|
-
- unrecognised flag format`)}if(I===void 0&&_===void 0)throw Error(`option creation failed due to no flags found in '${$}'.`);return{shortFlag:I,longFlag:_}}
|
|
12
|
+
- unrecognised flag format`)}if(I===void 0&&_===void 0)throw Error(`option creation failed due to no flags found in '${$}'.`);return{shortFlag:I,longFlag:_}}_D.Option=V5;_D.DualOptions=Z5});var A5=S((JD)=>{function zD($,I){if(Math.abs($.length-I.length)>3)return Math.max($.length,I.length);let _=[];for(let u=0;u<=$.length;u++)_[u]=[u];for(let u=0;u<=I.length;u++)_[0][u]=u;for(let u=1;u<=I.length;u++)for(let U=1;U<=$.length;U++){let g=1;if($[U-1]===I[u-1])g=0;else g=1;if(_[U][u]=Math.min(_[U-1][u]+1,_[U][u-1]+1,_[U-1][u-1]+g),U>1&&u>1&&$[U-1]===I[u-2]&&$[U-2]===I[u-1])_[U][u]=Math.min(_[U][u],_[U-2][u-2]+1)}return _[$.length][I.length]}function GD($,I){if(!I||I.length===0)return"";I=Array.from(new Set(I));let _=$.startsWith("--");if(_)$=$.slice(2),I=I.map((z)=>z.slice(2));let u=[],U=3,g=0.4;if(I.forEach((z)=>{if(z.length<=1)return;let G=zD($,z),J=Math.max($.length,z.length);if((J-G)/J>g){if(G<U)U=G,u=[z];else if(G===U)u.push(z)}}),u.sort((z,G)=>z.localeCompare(G)),_)u=u.map((z)=>`--${z}`);if(u.length>1)return`
|
|
13
13
|
(Did you mean one of ${u.join(", ")}?)`;if(u.length===1)return`
|
|
14
|
-
(Did you mean ${u[0]}?)`;return""}
|
|
15
|
-
- specify the name in Command constructor or using .name()`);if(I=I||{},I.isDefault)this._defaultCommandName=$._name;if(I.noHelp||I.hidden)$._hidden=!0;return this._registerCommand($),$.parent=this,$._checkForBrokenPassThrough(),this}createArgument($,I){return new
|
|
16
|
-
Expecting one of '${_.join("', '")}'`);if(this._lifeCycleHooks[$])this._lifeCycleHooks[$].push(I);else this._lifeCycleHooks[$]=[I];return this}exitOverride($){if($)this._exitCallback=$;else this._exitCallback=(I)=>{if(I.code!=="commander.executeSubCommandAsync")throw I};return this}_exit($,I,_){if(this._exitCallback)this._exitCallback(new
|
|
17
|
-
- already used by option '${I.flags}'`)}this._initOptionGroup($),this.options.push($)}_registerCommand($){let I=(u)=>{return[u.name()].concat(u.aliases())},_=I($).find((u)=>this._findCommand(u));if(_){let u=I(this._findCommand(_)).join("|"),U=I($).join("|");throw Error(`cannot add command '${U}' as already have command '${u}'`)}this._initCommandGroup($),this.commands.push($)}addOption($){this._registerOption($);let I=$.name(),_=$.attributeName();if($.negate){let U=$.long.replace(/^--no-/,"--");if(!this._findOption(U))this.setOptionValueWithSource(_,$.defaultValue===void 0?!0:$.defaultValue,"default")}else if($.defaultValue!==void 0)this.setOptionValueWithSource(_,$.defaultValue,"default");let u=(U,g,z)=>{if(U==null&&$.presetArg!==void 0)U=$.presetArg;let G=this.getOptionValue(_);if(U!==null&&$.parseArg)U=this._callParseArg($,U,G,g);else if(U!==null&&$.variadic)U=$._collectValue(U,G);if(U==null)if($.negate)U=!1;else if($.isBoolean()||$.optional)U=!0;else U="";this.setOptionValueWithSource(_,U,z)};if(this.on("option:"+I,(U)=>{let g=`error: option '${$.flags}' argument '${U}' is invalid.`;u(U,g,"cli")}),$.envVar)this.on("optionEnv:"+I,(U)=>{let g=`error: option '${$.flags}' value '${U}' from env '${$.envVar}' is invalid.`;u(U,g,"env")});return this}_optionEx($,I,_,u,U){if(typeof I==="object"&&I instanceof
|
|
18
|
-
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable($,I,_){if(
|
|
14
|
+
(Did you mean ${u[0]}?)`;return""}JD.suggestSimilar=GD});var S5=S((vD)=>{var qD=z$("node:events").EventEmitter,Gg=z$("node:child_process"),n4=z$("node:path"),LU=z$("node:fs"),I$=z$("node:process"),{Argument:ND,humanReadableArgName:QD}=DU(),{CommanderError:Jg}=EI(),{Help:HD,stripColor:YD}=gg(),{Option:b5,DualOptions:OD}=zg(),{suggestSimilar:P5}=A5();class qg extends qD{constructor($){super();this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=$||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:(I)=>I$.stdout.write(I),writeErr:(I)=>I$.stderr.write(I),outputError:(I,_)=>_(I),getOutHelpWidth:()=>I$.stdout.isTTY?I$.stdout.columns:void 0,getErrHelpWidth:()=>I$.stderr.isTTY?I$.stderr.columns:void 0,getOutHasColors:()=>Xg()??(I$.stdout.isTTY&&I$.stdout.hasColors?.()),getErrHasColors:()=>Xg()??(I$.stderr.isTTY&&I$.stderr.hasColors?.()),stripColor:(I)=>YD(I)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings($){return this._outputConfiguration=$._outputConfiguration,this._helpOption=$._helpOption,this._helpCommand=$._helpCommand,this._helpConfiguration=$._helpConfiguration,this._exitCallback=$._exitCallback,this._storeOptionsAsProperties=$._storeOptionsAsProperties,this._combineFlagAndOptionalValue=$._combineFlagAndOptionalValue,this._allowExcessArguments=$._allowExcessArguments,this._enablePositionalOptions=$._enablePositionalOptions,this._showHelpAfterError=$._showHelpAfterError,this._showSuggestionAfterError=$._showSuggestionAfterError,this}_getCommandAndAncestors(){let $=[];for(let I=this;I;I=I.parent)$.push(I);return $}command($,I,_){let u=I,U=_;if(typeof u==="object"&&u!==null)U=u,u=null;U=U||{};let[,g,z]=$.match(/([^ ]+) *(.*)/),G=this.createCommand(g);if(u)G.description(u),G._executableHandler=!0;if(U.isDefault)this._defaultCommandName=G._name;if(G._hidden=!!(U.noHelp||U.hidden),G._executableFile=U.executableFile||null,z)G.arguments(z);if(this._registerCommand(G),G.parent=this,G.copyInheritedSettings(this),u)return this;return G}createCommand($){return new qg($)}createHelp(){return Object.assign(new HD,this.configureHelp())}configureHelp($){if($===void 0)return this._helpConfiguration;return this._helpConfiguration=$,this}configureOutput($){if($===void 0)return this._outputConfiguration;return this._outputConfiguration={...this._outputConfiguration,...$},this}showHelpAfterError($=!0){if(typeof $!=="string")$=!!$;return this._showHelpAfterError=$,this}showSuggestionAfterError($=!0){return this._showSuggestionAfterError=!!$,this}addCommand($,I){if(!$._name)throw Error(`Command passed to .addCommand() must have a name
|
|
15
|
+
- specify the name in Command constructor or using .name()`);if(I=I||{},I.isDefault)this._defaultCommandName=$._name;if(I.noHelp||I.hidden)$._hidden=!0;return this._registerCommand($),$.parent=this,$._checkForBrokenPassThrough(),this}createArgument($,I){return new ND($,I)}argument($,I,_,u){let U=this.createArgument($,I);if(typeof _==="function")U.default(u).argParser(_);else U.default(_);return this.addArgument(U),this}arguments($){return $.trim().split(/ +/).forEach((I)=>{this.argument(I)}),this}addArgument($){let I=this.registeredArguments.slice(-1)[0];if(I?.variadic)throw Error(`only the last argument can be variadic '${I.name()}'`);if($.required&&$.defaultValue!==void 0&&$.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${$.name()}'`);return this.registeredArguments.push($),this}helpCommand($,I){if(typeof $==="boolean"){if(this._addImplicitHelpCommand=$,$&&this._defaultCommandGroup)this._initCommandGroup(this._getHelpCommand());return this}let _=$??"help [command]",[,u,U]=_.match(/([^ ]+) *(.*)/),g=I??"display help for command",z=this.createCommand(u);if(z.helpOption(!1),U)z.arguments(U);if(g)z.description(g);if(this._addImplicitHelpCommand=!0,this._helpCommand=z,$||I)this._initCommandGroup(z);return this}addHelpCommand($,I){if(typeof $!=="object")return this.helpCommand($,I),this;return this._addImplicitHelpCommand=!0,this._helpCommand=$,this._initCommandGroup($),this}_getHelpCommand(){if(this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))){if(this._helpCommand===void 0)this.helpCommand(void 0,void 0);return this._helpCommand}return null}hook($,I){let _=["preSubcommand","preAction","postAction"];if(!_.includes($))throw Error(`Unexpected value for event passed to hook : '${$}'.
|
|
16
|
+
Expecting one of '${_.join("', '")}'`);if(this._lifeCycleHooks[$])this._lifeCycleHooks[$].push(I);else this._lifeCycleHooks[$]=[I];return this}exitOverride($){if($)this._exitCallback=$;else this._exitCallback=(I)=>{if(I.code!=="commander.executeSubCommandAsync")throw I};return this}_exit($,I,_){if(this._exitCallback)this._exitCallback(new Jg($,I,_));I$.exit($)}action($){let I=(_)=>{let u=this.registeredArguments.length,U=_.slice(0,u);if(this._storeOptionsAsProperties)U[u]=this;else U[u]=this.opts();return U.push(this),$.apply(this,U)};return this._actionHandler=I,this}createOption($,I){return new b5($,I)}_callParseArg($,I,_,u){try{return $.parseArg(I,_)}catch(U){if(U.code==="commander.invalidArgument"){let g=`${u} ${U.message}`;this.error(g,{exitCode:U.exitCode,code:U.code})}throw U}}_registerOption($){let I=$.short&&this._findOption($.short)||$.long&&this._findOption($.long);if(I){let _=$.long&&this._findOption($.long)?$.long:$.short;throw Error(`Cannot add option '${$.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${_}'
|
|
17
|
+
- already used by option '${I.flags}'`)}this._initOptionGroup($),this.options.push($)}_registerCommand($){let I=(u)=>{return[u.name()].concat(u.aliases())},_=I($).find((u)=>this._findCommand(u));if(_){let u=I(this._findCommand(_)).join("|"),U=I($).join("|");throw Error(`cannot add command '${U}' as already have command '${u}'`)}this._initCommandGroup($),this.commands.push($)}addOption($){this._registerOption($);let I=$.name(),_=$.attributeName();if($.negate){let U=$.long.replace(/^--no-/,"--");if(!this._findOption(U))this.setOptionValueWithSource(_,$.defaultValue===void 0?!0:$.defaultValue,"default")}else if($.defaultValue!==void 0)this.setOptionValueWithSource(_,$.defaultValue,"default");let u=(U,g,z)=>{if(U==null&&$.presetArg!==void 0)U=$.presetArg;let G=this.getOptionValue(_);if(U!==null&&$.parseArg)U=this._callParseArg($,U,G,g);else if(U!==null&&$.variadic)U=$._collectValue(U,G);if(U==null)if($.negate)U=!1;else if($.isBoolean()||$.optional)U=!0;else U="";this.setOptionValueWithSource(_,U,z)};if(this.on("option:"+I,(U)=>{let g=`error: option '${$.flags}' argument '${U}' is invalid.`;u(U,g,"cli")}),$.envVar)this.on("optionEnv:"+I,(U)=>{let g=`error: option '${$.flags}' value '${U}' from env '${$.envVar}' is invalid.`;u(U,g,"env")});return this}_optionEx($,I,_,u,U){if(typeof I==="object"&&I instanceof b5)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let g=this.createOption(I,_);if(g.makeOptionMandatory(!!$.mandatory),typeof u==="function")g.default(U).argParser(u);else if(u instanceof RegExp){let z=u;u=(G,J)=>{let X=z.exec(G);return X?X[0]:J},g.default(U).argParser(u)}else g.default(u);return this.addOption(g)}option($,I,_,u){return this._optionEx({},$,I,_,u)}requiredOption($,I,_,u){return this._optionEx({mandatory:!0},$,I,_,u)}combineFlagAndOptionalValue($=!0){return this._combineFlagAndOptionalValue=!!$,this}allowUnknownOption($=!0){return this._allowUnknownOption=!!$,this}allowExcessArguments($=!0){return this._allowExcessArguments=!!$,this}enablePositionalOptions($=!0){return this._enablePositionalOptions=!!$,this}passThroughOptions($=!0){return this._passThroughOptions=!!$,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties($=!0){if(this.options.length)throw Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!$,this}getOptionValue($){if(this._storeOptionsAsProperties)return this[$];return this._optionValues[$]}setOptionValue($,I){return this.setOptionValueWithSource($,I,void 0)}setOptionValueWithSource($,I,_){if(this._storeOptionsAsProperties)this[$]=I;else this._optionValues[$]=I;return this._optionValueSources[$]=_,this}getOptionValueSource($){return this._optionValueSources[$]}getOptionValueSourceWithGlobals($){let I;return this._getCommandAndAncestors().forEach((_)=>{if(_.getOptionValueSource($)!==void 0)I=_.getOptionValueSource($)}),I}_prepareUserArgs($,I){if($!==void 0&&!Array.isArray($))throw Error("first parameter to parse must be array or undefined");if(I=I||{},$===void 0&&I.from===void 0){if(I$.versions?.electron)I.from="electron";let u=I$.execArgv??[];if(u.includes("-e")||u.includes("--eval")||u.includes("-p")||u.includes("--print"))I.from="eval"}if($===void 0)$=I$.argv;this.rawArgs=$.slice();let _;switch(I.from){case void 0:case"node":this._scriptPath=$[1],_=$.slice(2);break;case"electron":if(I$.defaultApp)this._scriptPath=$[1],_=$.slice(2);else _=$.slice(1);break;case"user":_=$.slice(0);break;case"eval":_=$.slice(1);break;default:throw Error(`unexpected parse option { from: '${I.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",_}parse($,I){this._prepareForParse();let _=this._prepareUserArgs($,I);return this._parseCommand([],_),this}async parseAsync($,I){this._prepareForParse();let _=this._prepareUserArgs($,I);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.
|
|
18
|
+
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable($,I,_){if(LU.existsSync($))return;let u=I?`searched for local subcommand relative to directory '${I}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",U=`'${$}' does not exist
|
|
19
19
|
- if '${_}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
20
20
|
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
21
|
-
- ${u}`;throw Error(U)}_executeSubCommand($,I){I=I.slice();let _=!1,u=[".js",".ts",".tsx",".mjs",".cjs"];function U(X,N){let q=n4.resolve(X,N);if(
|
|
21
|
+
- ${u}`;throw Error(U)}_executeSubCommand($,I){I=I.slice();let _=!1,u=[".js",".ts",".tsx",".mjs",".cjs"];function U(X,N){let q=n4.resolve(X,N);if(LU.existsSync(q))return q;if(u.includes(n4.extname(N)))return;let Q=u.find((Y)=>LU.existsSync(`${q}${Y}`));if(Q)return`${q}${Q}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let g=$._executableFile||`${this._name}-${$._name}`,z=this._executableDir||"";if(this._scriptPath){let X;try{X=LU.realpathSync(this._scriptPath)}catch{X=this._scriptPath}z=n4.resolve(n4.dirname(X),z)}if(z){let X=U(z,g);if(!X&&!$._executableFile&&this._scriptPath){let N=n4.basename(this._scriptPath,n4.extname(this._scriptPath));if(N!==this._name)X=U(z,`${N}-${$._name}`)}g=X||g}_=u.includes(n4.extname(g));let G;if(I$.platform!=="win32")if(_)I.unshift(g),I=j5(I$.execArgv).concat(I),G=Gg.spawn(I$.argv[0],I,{stdio:"inherit"});else G=Gg.spawn(g,I,{stdio:"inherit"});else this._checkForMissingExecutable(g,z,$._name),I.unshift(g),I=j5(I$.execArgv).concat(I),G=Gg.spawn(I$.execPath,I,{stdio:"inherit"});if(!G.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((N)=>{I$.on(N,()=>{if(G.killed===!1&&G.exitCode===null)G.kill(N)})});let J=this._exitCallback;G.on("close",(X)=>{if(X=X??1,!J)I$.exit(X);else J(new Jg(X,"commander.executeSubCommandAsync","(close)"))}),G.on("error",(X)=>{if(X.code==="ENOENT")this._checkForMissingExecutable(g,z,$._name);else if(X.code==="EACCES")throw Error(`'${g}' not executable`);if(!J)I$.exit(1);else{let N=new Jg(1,"commander.executeSubCommandAsync","(error)");N.nestedError=X,J(N)}}),this.runningCommand=G}_dispatchSubcommand($,I,_){let u=this._findCommand($);if(!u)this.help({error:!0});u._prepareForParse();let U;return U=this._chainOrCallSubCommandHook(U,u,"preSubcommand"),U=this._chainOrCall(U,()=>{if(u._executableHandler)this._executeSubCommand(u,I.concat(_));else return u._parseCommand(I,_)}),U}_dispatchHelpCommand($){if(!$)this.help();let I=this._findCommand($);if(I&&!I._executableHandler)I.help();return this._dispatchSubcommand($,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach(($,I)=>{if($.required&&this.args[I]==null)this.missingArgument($.name())}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)return;if(this.args.length>this.registeredArguments.length)this._excessArguments(this.args)}_processArguments(){let $=(_,u,U)=>{let g=u;if(u!==null&&_.parseArg){let z=`error: command-argument value '${u}' is invalid for argument '${_.name()}'.`;g=this._callParseArg(_,u,U,z)}return g};this._checkNumberOfArguments();let I=[];this.registeredArguments.forEach((_,u)=>{let U=_.defaultValue;if(_.variadic){if(u<this.args.length){if(U=this.args.slice(u),_.parseArg)U=U.reduce((g,z)=>{return $(_,z,g)},_.defaultValue)}else if(U===void 0)U=[]}else if(u<this.args.length){if(U=this.args[u],_.parseArg)U=$(_,U,_.defaultValue)}I[u]=U}),this.processedArgs=I}_chainOrCall($,I){if($?.then&&typeof $.then==="function")return $.then(()=>I());return I()}_chainOrCallHooks($,I){let _=$,u=[];if(this._getCommandAndAncestors().reverse().filter((U)=>U._lifeCycleHooks[I]!==void 0).forEach((U)=>{U._lifeCycleHooks[I].forEach((g)=>{u.push({hookedCommand:U,callback:g})})}),I==="postAction")u.reverse();return u.forEach((U)=>{_=this._chainOrCall(_,()=>{return U.callback(U.hookedCommand,this)})}),_}_chainOrCallSubCommandHook($,I,_){let u=$;if(this._lifeCycleHooks[_]!==void 0)this._lifeCycleHooks[_].forEach((U)=>{u=this._chainOrCall(u,()=>{return U(this,I)})});return u}_parseCommand($,I){let _=this.parseOptions(I);if(this._parseOptionsEnv(),this._parseOptionsImplied(),$=$.concat(_.operands),I=_.unknown,this.args=$.concat(I),$&&this._findCommand($[0]))return this._dispatchSubcommand($[0],$.slice(1),I);if(this._getHelpCommand()&&$[0]===this._getHelpCommand().name())return this._dispatchHelpCommand($[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(I),this._dispatchSubcommand(this._defaultCommandName,$,I);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(_.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let u=()=>{if(_.unknown.length>0)this.unknownOption(_.unknown[0])},U=`command:${this.name()}`;if(this._actionHandler){u(),this._processArguments();let g;if(g=this._chainOrCallHooks(g,"preAction"),g=this._chainOrCall(g,()=>this._actionHandler(this.processedArgs)),this.parent)g=this._chainOrCall(g,()=>{this.parent.emit(U,$,I)});return g=this._chainOrCallHooks(g,"postAction"),g}if(this.parent?.listenerCount(U))u(),this._processArguments(),this.parent.emit(U,$,I);else if($.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",$,I);if(this.listenerCount("command:*"))this.emit("command:*",$,I);else if(this.commands.length)this.unknownCommand();else u(),this._processArguments()}else if(this.commands.length)u(),this.help({error:!0});else u(),this._processArguments()}_findCommand($){if(!$)return;return this.commands.find((I)=>I._name===$||I._aliases.includes($))}_findOption($){return this.options.find((I)=>I.is($))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(($)=>{$.options.forEach((I)=>{if(I.mandatory&&$.getOptionValue(I.attributeName())===void 0)$.missingMandatoryOptionValue(I)})})}_checkForConflictingLocalOptions(){let $=this.options.filter((_)=>{let u=_.attributeName();if(this.getOptionValue(u)===void 0)return!1;return this.getOptionValueSource(u)!=="default"});$.filter((_)=>_.conflictsWith.length>0).forEach((_)=>{let u=$.find((U)=>_.conflictsWith.includes(U.attributeName()));if(u)this._conflictingOption(_,u)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(($)=>{$._checkForConflictingLocalOptions()})}parseOptions($){let I=[],_=[],u=I;function U(X){return X.length>1&&X[0]==="-"}let g=(X)=>{if(!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(X))return!1;return!this._getCommandAndAncestors().some((N)=>N.options.map((q)=>q.short).some((q)=>/^-\d$/.test(q)))},z=null,G=null,J=0;while(J<$.length||G){let X=G??$[J++];if(G=null,X==="--"){if(u===_)u.push(X);u.push(...$.slice(J));break}if(z&&(!U(X)||g(X))){this.emit(`option:${z.name()}`,X);continue}if(z=null,U(X)){let N=this._findOption(X);if(N){if(N.required){let q=$[J++];if(q===void 0)this.optionMissingArgument(N);this.emit(`option:${N.name()}`,q)}else if(N.optional){let q=null;if(J<$.length&&(!U($[J])||g($[J])))q=$[J++];this.emit(`option:${N.name()}`,q)}else this.emit(`option:${N.name()}`);z=N.variadic?N:null;continue}}if(X.length>2&&X[0]==="-"&&X[1]!=="-"){let N=this._findOption(`-${X[1]}`);if(N){if(N.required||N.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${N.name()}`,X.slice(2));else this.emit(`option:${N.name()}`),G=`-${X.slice(2)}`;continue}}if(/^--[^=]+=/.test(X)){let N=X.indexOf("="),q=this._findOption(X.slice(0,N));if(q&&(q.required||q.optional)){this.emit(`option:${q.name()}`,X.slice(N+1));continue}}if(u===I&&U(X)&&!(this.commands.length===0&&g(X)))u=_;if((this._enablePositionalOptions||this._passThroughOptions)&&I.length===0&&_.length===0){if(this._findCommand(X)){I.push(X),_.push(...$.slice(J));break}else if(this._getHelpCommand()&&X===this._getHelpCommand().name()){I.push(X,...$.slice(J));break}else if(this._defaultCommandName){_.push(X,...$.slice(J));break}}if(this._passThroughOptions){u.push(X,...$.slice(J));break}u.push(X)}return{operands:I,unknown:_}}opts(){if(this._storeOptionsAsProperties){let $={},I=this.options.length;for(let _=0;_<I;_++){let u=this.options[_].attributeName();$[u]=u===this._versionOptionName?this._version:this[u]}return $}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce(($,I)=>Object.assign($,I.opts()),{})}error($,I){if(this._outputConfiguration.outputError(`${$}
|
|
22
22
|
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==="string")this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
23
23
|
`);else if(this._showHelpAfterError)this._outputConfiguration.writeErr(`
|
|
24
|
-
`),this.outputHelp({error:!0});let _=I||{},u=_.exitCode||1,U=_.code||"commander.error";this._exit(u,U,$)}_parseOptionsEnv(){this.options.forEach(($)=>{if($.envVar&&$.envVar in I$.env){let I=$.attributeName();if(this.getOptionValue(I)===void 0||["default","config","env"].includes(this.getOptionValueSource(I)))if($.required||$.optional)this.emit(`optionEnv:${$.name()}`,I$.env[$.envVar]);else this.emit(`optionEnv:${$.name()}`)}})}_parseOptionsImplied(){let $=new
|
|
25
|
-
`),this._exit(0,"commander.version",$)}),this}description($,I){if($===void 0&&I===void 0)return this._description;if(this._description=$,I)this._argsDescription=I;return this}summary($){if($===void 0)return this._summary;return this._summary=$,this}alias($){if($===void 0)return this._aliases[0];let I=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)I=this.commands[this.commands.length-1];if($===I._name)throw Error("Command alias can't be the same as its name");let _=this.parent?._findCommand($);if(_){let u=[_.name()].concat(_.aliases()).join("|");throw Error(`cannot add alias '${$}' to command '${this.name()}' as already have command '${u}'`)}return I._aliases.push($),this}aliases($){if($===void 0)return this._aliases;return $.forEach((I)=>this.alias(I)),this}usage($){if($===void 0){if(this._usage)return this._usage;let I=this.registeredArguments.map((_)=>{return
|
|
24
|
+
`),this.outputHelp({error:!0});let _=I||{},u=_.exitCode||1,U=_.code||"commander.error";this._exit(u,U,$)}_parseOptionsEnv(){this.options.forEach(($)=>{if($.envVar&&$.envVar in I$.env){let I=$.attributeName();if(this.getOptionValue(I)===void 0||["default","config","env"].includes(this.getOptionValueSource(I)))if($.required||$.optional)this.emit(`optionEnv:${$.name()}`,I$.env[$.envVar]);else this.emit(`optionEnv:${$.name()}`)}})}_parseOptionsImplied(){let $=new OD(this.options),I=(_)=>{return this.getOptionValue(_)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(_))};this.options.filter((_)=>_.implied!==void 0&&I(_.attributeName())&&$.valueFromOption(this.getOptionValue(_.attributeName()),_)).forEach((_)=>{Object.keys(_.implied).filter((u)=>!I(u)).forEach((u)=>{this.setOptionValueWithSource(u,_.implied[u],"implied")})})}missingArgument($){let I=`error: missing required argument '${$}'`;this.error(I,{code:"commander.missingArgument"})}optionMissingArgument($){let I=`error: option '${$.flags}' argument missing`;this.error(I,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue($){let I=`error: required option '${$.flags}' not specified`;this.error(I,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption($,I){let _=(g)=>{let z=g.attributeName(),G=this.getOptionValue(z),J=this.options.find((N)=>N.negate&&z===N.attributeName()),X=this.options.find((N)=>!N.negate&&z===N.attributeName());if(J&&(J.presetArg===void 0&&G===!1||J.presetArg!==void 0&&G===J.presetArg))return J;return X||g},u=(g)=>{let z=_(g),G=z.attributeName();if(this.getOptionValueSource(G)==="env")return`environment variable '${z.envVar}'`;return`option '${z.flags}'`},U=`error: ${u($)} cannot be used with ${u(I)}`;this.error(U,{code:"commander.conflictingOption"})}unknownOption($){if(this._allowUnknownOption)return;let I="";if($.startsWith("--")&&this._showSuggestionAfterError){let u=[],U=this;do{let g=U.createHelp().visibleOptions(U).filter((z)=>z.long).map((z)=>z.long);u=u.concat(g),U=U.parent}while(U&&!U._enablePositionalOptions);I=P5($,u)}let _=`error: unknown option '${$}'${I}`;this.error(_,{code:"commander.unknownOption"})}_excessArguments($){if(this._allowExcessArguments)return;let I=this.registeredArguments.length,_=I===1?"":"s",U=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${I} argument${_} but got ${$.length}.`;this.error(U,{code:"commander.excessArguments"})}unknownCommand(){let $=this.args[0],I="";if(this._showSuggestionAfterError){let u=[];this.createHelp().visibleCommands(this).forEach((U)=>{if(u.push(U.name()),U.alias())u.push(U.alias())}),I=P5($,u)}let _=`error: unknown command '${$}'${I}`;this.error(_,{code:"commander.unknownCommand"})}version($,I,_){if($===void 0)return this._version;this._version=$,I=I||"-V, --version",_=_||"output the version number";let u=this.createOption(I,_);return this._versionOptionName=u.attributeName(),this._registerOption(u),this.on("option:"+u.name(),()=>{this._outputConfiguration.writeOut(`${$}
|
|
25
|
+
`),this._exit(0,"commander.version",$)}),this}description($,I){if($===void 0&&I===void 0)return this._description;if(this._description=$,I)this._argsDescription=I;return this}summary($){if($===void 0)return this._summary;return this._summary=$,this}alias($){if($===void 0)return this._aliases[0];let I=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)I=this.commands[this.commands.length-1];if($===I._name)throw Error("Command alias can't be the same as its name");let _=this.parent?._findCommand($);if(_){let u=[_.name()].concat(_.aliases()).join("|");throw Error(`cannot add alias '${$}' to command '${this.name()}' as already have command '${u}'`)}return I._aliases.push($),this}aliases($){if($===void 0)return this._aliases;return $.forEach((I)=>this.alias(I)),this}usage($){if($===void 0){if(this._usage)return this._usage;let I=this.registeredArguments.map((_)=>{return QD(_)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?I:[]).join(" ")}return this._usage=$,this}name($){if($===void 0)return this._name;return this._name=$,this}helpGroup($){if($===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=$,this}commandsGroup($){if($===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=$,this}optionsGroup($){if($===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=$,this}_initOptionGroup($){if(this._defaultOptionGroup&&!$.helpGroupHeading)$.helpGroup(this._defaultOptionGroup)}_initCommandGroup($){if(this._defaultCommandGroup&&!$.helpGroup())$.helpGroup(this._defaultCommandGroup)}nameFromFilename($){return this._name=n4.basename($,n4.extname($)),this}executableDir($){if($===void 0)return this._executableDir;return this._executableDir=$,this}helpInformation($){let I=this.createHelp(),_=this._getOutputContext($);I.prepareContext({error:_.error,helpWidth:_.helpWidth,outputHasColors:_.hasColors});let u=I.formatHelp(this,I);if(_.hasColors)return u;return this._outputConfiguration.stripColor(u)}_getOutputContext($){$=$||{};let I=!!$.error,_,u,U;if(I)_=(z)=>this._outputConfiguration.writeErr(z),u=this._outputConfiguration.getErrHasColors(),U=this._outputConfiguration.getErrHelpWidth();else _=(z)=>this._outputConfiguration.writeOut(z),u=this._outputConfiguration.getOutHasColors(),U=this._outputConfiguration.getOutHelpWidth();return{error:I,write:(z)=>{if(!u)z=this._outputConfiguration.stripColor(z);return _(z)},hasColors:u,helpWidth:U}}outputHelp($){let I;if(typeof $==="function")I=$,$=void 0;let _=this._getOutputContext($),u={error:_.error,write:_.write,command:this};this._getCommandAndAncestors().reverse().forEach((g)=>g.emit("beforeAllHelp",u)),this.emit("beforeHelp",u);let U=this.helpInformation({error:_.error});if(I){if(U=I(U),typeof U!=="string"&&!Buffer.isBuffer(U))throw Error("outputHelp callback must return a string or a Buffer")}if(_.write(U),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",u),this._getCommandAndAncestors().forEach((g)=>g.emit("afterAllHelp",u))}helpOption($,I){if(typeof $==="boolean"){if($){if(this._helpOption===null)this._helpOption=void 0;if(this._defaultOptionGroup)this._initOptionGroup(this._getHelpOption())}else this._helpOption=null;return this}if(this._helpOption=this.createOption($??"-h, --help",I??"display help for command"),$||I)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption($){return this._helpOption=$,this._initOptionGroup($),this}help($){this.outputHelp($);let I=Number(I$.exitCode??0);if(I===0&&$&&typeof $!=="function"&&$.error)I=1;this._exit(I,"commander.help","(outputHelp)")}addHelpText($,I){let _=["beforeAll","before","after","afterAll"];if(!_.includes($))throw Error(`Unexpected value for position to addHelpText.
|
|
26
26
|
Expecting one of '${_.join("', '")}'`);let u=`${$}Help`;return this.on(u,(U)=>{let g;if(typeof I==="function")g=I({error:U.error,command:U.command});else g=I;if(g)U.write(`${g}
|
|
27
|
-
`)}),this}_outputHelpIfRequested($){let I=this._getHelpOption();if(I&&$.find((u)=>I.is(u)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function
|
|
28
|
-
`)}}J4.defaultYaml={explicit:!1,version:"1.2"};J4.defaultTags={"!!":"tag:yaml.org,2002:"};
|
|
29
|
-
`)?
|
|
27
|
+
`)}),this}_outputHelpIfRequested($){let I=this._getHelpOption();if(I&&$.find((u)=>I.is(u)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function j5($){return $.map((I)=>{if(!I.startsWith("--inspect"))return I;let _,u="127.0.0.1",U="9229",g;if((g=I.match(/^(--inspect(-brk)?)$/))!==null)_=g[1];else if((g=I.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(_=g[1],/^\d+$/.test(g[3]))U=g[3];else u=g[3];else if((g=I.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)_=g[1],u=g[3],U=g[4];if(_&&U!=="0")return`${_}=${u}:${parseInt(U)+1}`;return I})}function Xg(){if(I$.env.NO_COLOR||I$.env.FORCE_COLOR==="0"||I$.env.FORCE_COLOR==="false")return!1;if(I$.env.FORCE_COLOR||I$.env.CLICOLOR_FORCE!==void 0)return!0;return}vD.Command=qg;vD.useColor=Xg});var C5=S((BD)=>{var{Argument:F5}=DU(),{Command:Ng}=S5(),{CommanderError:DD,InvalidArgumentError:w5}=EI(),{Help:LD}=gg(),{Option:E5}=zg();BD.program=new Ng;BD.createCommand=($)=>new Ng($);BD.createOption=($,I)=>new E5($,I);BD.createArgument=($,I)=>new F5($,I);BD.Command=Ng;BD.Option=E5;BD.Argument=F5;BD.Help=LD;BD.CommanderError=DD;BD.InvalidArgumentError=w5;BD.InvalidOptionArgumentError=w5});var Z$=S((Uy,Hg)=>{var KU=process||{},x5=KU.argv||[],BU=KU.env||{},wD=!(!!BU.NO_COLOR||x5.includes("--no-color"))&&(!!BU.FORCE_COLOR||x5.includes("--color")||KU.platform==="win32"||(KU.stdout||{}).isTTY&&BU.TERM!=="dumb"||!!BU.CI),ED=($,I,_=$)=>(u)=>{let U=""+u,g=U.indexOf(I,$.length);return~g?$+CD(U,I,_,g)+I:$+U+I},CD=($,I,_,u)=>{let U="",g=0;do U+=$.substring(g,u)+_,g=u+I.length,u=$.indexOf(I,g);while(~u);return U+$.substring(g)},k5=($=wD)=>{let I=$?ED:()=>String;return{isColorSupported:$,reset:I("\x1B[0m","\x1B[0m"),bold:I("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:I("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:I("\x1B[3m","\x1B[23m"),underline:I("\x1B[4m","\x1B[24m"),inverse:I("\x1B[7m","\x1B[27m"),hidden:I("\x1B[8m","\x1B[28m"),strikethrough:I("\x1B[9m","\x1B[29m"),black:I("\x1B[30m","\x1B[39m"),red:I("\x1B[31m","\x1B[39m"),green:I("\x1B[32m","\x1B[39m"),yellow:I("\x1B[33m","\x1B[39m"),blue:I("\x1B[34m","\x1B[39m"),magenta:I("\x1B[35m","\x1B[39m"),cyan:I("\x1B[36m","\x1B[39m"),white:I("\x1B[37m","\x1B[39m"),gray:I("\x1B[90m","\x1B[39m"),bgBlack:I("\x1B[40m","\x1B[49m"),bgRed:I("\x1B[41m","\x1B[49m"),bgGreen:I("\x1B[42m","\x1B[49m"),bgYellow:I("\x1B[43m","\x1B[49m"),bgBlue:I("\x1B[44m","\x1B[49m"),bgMagenta:I("\x1B[45m","\x1B[49m"),bgCyan:I("\x1B[46m","\x1B[49m"),bgWhite:I("\x1B[47m","\x1B[49m"),blackBright:I("\x1B[90m","\x1B[39m"),redBright:I("\x1B[91m","\x1B[39m"),greenBright:I("\x1B[92m","\x1B[39m"),yellowBright:I("\x1B[93m","\x1B[39m"),blueBright:I("\x1B[94m","\x1B[39m"),magentaBright:I("\x1B[95m","\x1B[39m"),cyanBright:I("\x1B[96m","\x1B[39m"),whiteBright:I("\x1B[97m","\x1B[39m"),bgBlackBright:I("\x1B[100m","\x1B[49m"),bgRedBright:I("\x1B[101m","\x1B[49m"),bgGreenBright:I("\x1B[102m","\x1B[49m"),bgYellowBright:I("\x1B[103m","\x1B[49m"),bgBlueBright:I("\x1B[104m","\x1B[49m"),bgMagentaBright:I("\x1B[105m","\x1B[49m"),bgCyanBright:I("\x1B[106m","\x1B[49m"),bgWhiteBright:I("\x1B[107m","\x1B[49m")}};Hg.exports=k5();Hg.exports.createColors=k5});var $$=S((nD)=>{var Yg=Symbol.for("yaml.alias"),y5=Symbol.for("yaml.document"),WU=Symbol.for("yaml.map"),i5=Symbol.for("yaml.pair"),Og=Symbol.for("yaml.scalar"),RU=Symbol.for("yaml.seq"),r4=Symbol.for("yaml.node.type"),fD=($)=>!!$&&typeof $==="object"&&$[r4]===Yg,xD=($)=>!!$&&typeof $==="object"&&$[r4]===y5,kD=($)=>!!$&&typeof $==="object"&&$[r4]===WU,yD=($)=>!!$&&typeof $==="object"&&$[r4]===i5,l5=($)=>!!$&&typeof $==="object"&&$[r4]===Og,iD=($)=>!!$&&typeof $==="object"&&$[r4]===RU;function m5($){if($&&typeof $==="object")switch($[r4]){case WU:case RU:return!0}return!1}function lD($){if($&&typeof $==="object")switch($[r4]){case Yg:case WU:case Og:case RU:return!0}return!1}var mD=($)=>(l5($)||m5($))&&!!$.anchor;nD.ALIAS=Yg;nD.DOC=y5;nD.MAP=WU;nD.NODE_TYPE=r4;nD.PAIR=i5;nD.SCALAR=Og;nD.SEQ=RU;nD.hasAnchor=mD;nD.isAlias=fD;nD.isCollection=m5;nD.isDocument=xD;nD.isMap=kD;nD.isNode=lD;nD.isPair=yD;nD.isScalar=l5;nD.isSeq=iD});var CI=S((zL)=>{var A$=$$(),t$=Symbol("break visit"),n5=Symbol("skip children"),P4=Symbol("remove node");function VU($,I){let _=r5(I);if(A$.isDocument($)){if(L1(null,$.contents,_,Object.freeze([$]))===P4)$.contents=null}else L1(null,$,_,Object.freeze([]))}VU.BREAK=t$;VU.SKIP=n5;VU.REMOVE=P4;function L1($,I,_,u){let U=h5($,I,_,u);if(A$.isNode(U)||A$.isPair(U))return c5($,u,U),L1($,U,_,u);if(typeof U!=="symbol"){if(A$.isCollection(I)){u=Object.freeze(u.concat(I));for(let g=0;g<I.items.length;++g){let z=L1(g,I.items[g],_,u);if(typeof z==="number")g=z-1;else if(z===t$)return t$;else if(z===P4)I.items.splice(g,1),g-=1}}else if(A$.isPair(I)){u=Object.freeze(u.concat(I));let g=L1("key",I.key,_,u);if(g===t$)return t$;else if(g===P4)I.key=null;let z=L1("value",I.value,_,u);if(z===t$)return t$;else if(z===P4)I.value=null}}return U}async function ZU($,I){let _=r5(I);if(A$.isDocument($)){if(await B1(null,$.contents,_,Object.freeze([$]))===P4)$.contents=null}else await B1(null,$,_,Object.freeze([]))}ZU.BREAK=t$;ZU.SKIP=n5;ZU.REMOVE=P4;async function B1($,I,_,u){let U=await h5($,I,_,u);if(A$.isNode(U)||A$.isPair(U))return c5($,u,U),B1($,U,_,u);if(typeof U!=="symbol"){if(A$.isCollection(I)){u=Object.freeze(u.concat(I));for(let g=0;g<I.items.length;++g){let z=await B1(g,I.items[g],_,u);if(typeof z==="number")g=z-1;else if(z===t$)return t$;else if(z===P4)I.items.splice(g,1),g-=1}}else if(A$.isPair(I)){u=Object.freeze(u.concat(I));let g=await B1("key",I.key,_,u);if(g===t$)return t$;else if(g===P4)I.key=null;let z=await B1("value",I.value,_,u);if(z===t$)return t$;else if(z===P4)I.value=null}}return U}function r5($){if(typeof $==="object"&&($.Collection||$.Node||$.Value))return Object.assign({Alias:$.Node,Map:$.Node,Scalar:$.Node,Seq:$.Node},$.Value&&{Map:$.Value,Scalar:$.Value,Seq:$.Value},$.Collection&&{Map:$.Collection,Seq:$.Collection},$);return $}function h5($,I,_,u){if(typeof _==="function")return _($,I,u);if(A$.isMap(I))return _.Map?.($,I,u);if(A$.isSeq(I))return _.Seq?.($,I,u);if(A$.isPair(I))return _.Pair?.($,I,u);if(A$.isScalar(I))return _.Scalar?.($,I,u);if(A$.isAlias(I))return _.Alias?.($,I,u);return}function c5($,I,_){let u=I[I.length-1];if(A$.isCollection(u))u.items[$]=_;else if(A$.isPair(u))if($==="key")u.key=_;else u.value=_;else if(A$.isDocument(u))u.contents=_;else{let U=A$.isAlias(u)?"alias":"scalar";throw Error(`Cannot replace node with ${U} parent`)}}zL.visit=VU;zL.visitAsync=ZU});var vg=S((QL)=>{var d5=$$(),XL=CI(),qL={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},NL=($)=>$.replace(/[!,[\]{}]/g,(I)=>qL[I]);class J4{constructor($,I){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},J4.defaultYaml,$),this.tags=Object.assign({},J4.defaultTags,I)}clone(){let $=new J4(this.yaml,this.tags);return $.docStart=this.docStart,$}atDocument(){let $=new J4(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:J4.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},J4.defaultTags);break}return $}add($,I){if(this.atNextDocument)this.yaml={explicit:J4.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},J4.defaultTags),this.atNextDocument=!1;let _=$.trim().split(/[ \t]+/),u=_.shift();switch(u){case"%TAG":{if(_.length!==2){if(I(0,"%TAG directive should contain exactly two parts"),_.length<2)return!1}let[U,g]=_;return this.tags[U]=g,!0}case"%YAML":{if(this.yaml.explicit=!0,_.length!==1)return I(0,"%YAML directive should contain exactly one part"),!1;let[U]=_;if(U==="1.1"||U==="1.2")return this.yaml.version=U,!0;else{let g=/^\d+\.\d+$/.test(U);return I(6,`Unsupported YAML version ${U}`,g),!1}}default:return I(0,`Unknown directive ${u}`,!0),!1}}tagName($,I){if($==="!")return"!";if($[0]!=="!")return I(`Not a valid tag: ${$}`),null;if($[1]==="<"){let g=$.slice(2,-1);if(g==="!"||g==="!!")return I(`Verbatim tags aren't resolved, so ${$} is invalid.`),null;if($[$.length-1]!==">")I("Verbatim tags must end with a >");return g}let[,_,u]=$.match(/^(.*!)([^!]*)$/s);if(!u)I(`The ${$} tag has no suffix`);let U=this.tags[_];if(U)try{return U+decodeURIComponent(u)}catch(g){return I(String(g)),null}if(_==="!")return $;return I(`Could not resolve tag: ${$}`),null}tagString($){for(let[I,_]of Object.entries(this.tags))if($.startsWith(_))return I+NL($.substring(_.length));return $[0]==="!"?$:`!<${$}>`}toString($){let I=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],_=Object.entries(this.tags),u;if($&&_.length>0&&d5.isNode($.contents)){let U={};XL.visit($.contents,(g,z)=>{if(d5.isNode(z)&&z.tag)U[z.tag]=!0}),u=Object.keys(U)}else u=[];for(let[U,g]of _){if(U==="!!"&&g==="tag:yaml.org,2002:")continue;if(!$||u.some((z)=>z.startsWith(g)))I.push(`%TAG ${U} ${g}`)}return I.join(`
|
|
28
|
+
`)}}J4.defaultYaml={explicit:!1,version:"1.2"};J4.defaultTags={"!!":"tag:yaml.org,2002:"};QL.Directives=J4});var AU=S((TL)=>{var o5=$$(),YL=CI();function OL($){if(/[\x00-\x19\s,[\]{}]/.test($)){let _=`Anchor must not contain whitespace or control characters: ${JSON.stringify($)}`;throw Error(_)}return!0}function p5($){let I=new Set;return YL.visit($,{Value(_,u){if(u.anchor)I.add(u.anchor)}}),I}function t5($,I){for(let _=1;;++_){let u=`${$}${_}`;if(!I.has(u))return u}}function vL($,I){let _=[],u=new Map,U=null;return{onAnchor:(g)=>{_.push(g),U??(U=p5($));let z=t5(I,U);return U.add(z),z},setAnchors:()=>{for(let g of _){let z=u.get(g);if(typeof z==="object"&&z.anchor&&(o5.isScalar(z.node)||o5.isCollection(z.node)))z.node.anchor=z.anchor;else{let G=Error("Failed to resolve repeated object (this should not happen)");throw G.source=g,G}}},sourceObjects:u}}TL.anchorIsValid=OL;TL.anchorNames=p5;TL.createNodeAnchors=vL;TL.findNewAnchor=t5});var Tg=S((KL)=>{function fI($,I,_,u){if(u&&typeof u==="object")if(Array.isArray(u))for(let U=0,g=u.length;U<g;++U){let z=u[U],G=fI($,u,String(U),z);if(G===void 0)delete u[U];else if(G!==z)u[U]=G}else if(u instanceof Map)for(let U of Array.from(u.keys())){let g=u.get(U),z=fI($,u,U,g);if(z===void 0)u.delete(U);else if(z!==g)u.set(U,z)}else if(u instanceof Set)for(let U of Array.from(u)){let g=fI($,u,U,U);if(g===void 0)u.delete(U);else if(g!==U)u.delete(U),u.add(g)}else for(let[U,g]of Object.entries(u)){let z=fI($,u,U,g);if(z===void 0)delete u[U];else if(z!==g)u[U]=z}return $.call(I,_,u)}KL.applyReviver=fI});var G6=S((VL)=>{var RL=$$();function a5($,I,_){if(Array.isArray($))return $.map((u,U)=>a5(u,String(U),_));if($&&typeof $.toJSON==="function"){if(!_||!RL.hasAnchor($))return $.toJSON(I,_);let u={aliasCount:0,count:1,res:void 0};_.anchors.set($,u),_.onCreate=(g)=>{u.res=g,delete _.onCreate};let U=$.toJSON(I,_);if(_.onCreate)_.onCreate(U);return U}if(typeof $==="bigint"&&!_?.keep)return Number($);return $}VL.toJS=a5});var bU=S((PL)=>{var AL=Tg(),e5=$$(),bL=G6();class s5{constructor($){Object.defineProperty(this,e5.NODE_TYPE,{value:$})}clone(){let $=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)$.range=this.range.slice();return $}toJS($,{mapAsMap:I,maxAliasCount:_,onAnchor:u,reviver:U}={}){if(!e5.isDocument($))throw TypeError("A document argument is required");let g={anchors:new Map,doc:$,keep:!0,mapAsMap:I===!0,mapKeyWarned:!1,maxAliasCount:typeof _==="number"?_:100},z=bL.toJS(this,"",g);if(typeof u==="function")for(let{count:G,res:J}of g.anchors.values())u(J,G);return typeof U==="function"?AL.applyReviver(U,{"":z},"",z):z}}PL.NodeBase=s5});var xI=S((CL)=>{var SL=AU(),FL=CI(),K1=$$(),wL=bU(),EL=G6();class $N extends wL.NodeBase{constructor($){super(K1.ALIAS);this.source=$,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve($,I){let _;if(I?.aliasResolveCache)_=I.aliasResolveCache;else if(_=[],FL.visit($,{Node:(U,g)=>{if(K1.isAlias(g)||K1.hasAnchor(g))_.push(g)}}),I)I.aliasResolveCache=_;let u=void 0;for(let U of _){if(U===this)break;if(U.anchor===this.source)u=U}return u}toJSON($,I){if(!I)return{source:this.source};let{anchors:_,doc:u,maxAliasCount:U}=I,g=this.resolve(u,I);if(!g){let G=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(G)}let z=_.get(g);if(!z)EL.toJS(g,null,I),z=_.get(g);if(z?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(U>=0){if(z.count+=1,z.aliasCount===0)z.aliasCount=PU(u,g,_);if(z.count*z.aliasCount>U)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return z.res}toString($,I,_){let u=`*${this.source}`;if($){if(SL.anchorIsValid(this.source),$.options.verifyAliasOrder&&!$.anchors.has(this.source)){let U=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(U)}if($.implicitKey)return`${u} `}return u}}function PU($,I,_){if(K1.isAlias(I)){let u=I.resolve($),U=_&&u&&_.get(u);return U?U.count*U.aliasCount:0}else if(K1.isCollection(I)){let u=0;for(let U of I.items){let g=PU($,U,_);if(g>u)u=g}return u}else if(K1.isPair(I)){let u=PU($,I.key,_),U=PU($,I.value,_);return Math.max(u,U)}return 1}CL.Alias=$N});var R$=S((lL)=>{var xL=$$(),kL=bU(),yL=G6(),iL=($)=>!$||typeof $!=="function"&&typeof $!=="object";class i6 extends kL.NodeBase{constructor($){super(xL.SCALAR);this.value=$}toJSON($,I){return I?.keep?this.value:yL.toJS(this.value,$,I)}toString(){return String(this.value)}}i6.BLOCK_FOLDED="BLOCK_FOLDED";i6.BLOCK_LITERAL="BLOCK_LITERAL";i6.PLAIN="PLAIN";i6.QUOTE_DOUBLE="QUOTE_DOUBLE";i6.QUOTE_SINGLE="QUOTE_SINGLE";lL.Scalar=i6;lL.isScalarValue=iL});var kI=S((oL)=>{var rL=xI(),l6=$$(),IN=R$(),hL="tag:yaml.org,2002:";function cL($,I,_){if(I){let u=_.filter((g)=>g.tag===I),U=u.find((g)=>!g.format)??u[0];if(!U)throw Error(`Tag ${I} not found`);return U}return _.find((u)=>u.identify?.($)&&!u.format)}function dL($,I,_){if(l6.isDocument($))$=$.contents;if(l6.isNode($))return $;if(l6.isPair($)){let q=_.schema[l6.MAP].createNode?.(_.schema,null,_);return q.items.push($),q}if($ instanceof String||$ instanceof Number||$ instanceof Boolean||typeof BigInt<"u"&&$ instanceof BigInt)$=$.valueOf();let{aliasDuplicateObjects:u,onAnchor:U,onTagObj:g,schema:z,sourceObjects:G}=_,J=void 0;if(u&&$&&typeof $==="object")if(J=G.get($),J)return J.anchor??(J.anchor=U($)),new rL.Alias(J.anchor);else J={anchor:null,node:null},G.set($,J);if(I?.startsWith("!!"))I=hL+I.slice(2);let X=cL($,I,z.tags);if(!X){if($&&typeof $.toJSON==="function")$=$.toJSON();if(!$||typeof $!=="object"){let q=new IN.Scalar($);if(J)J.node=q;return q}X=$ instanceof Map?z[l6.MAP]:(Symbol.iterator in Object($))?z[l6.SEQ]:z[l6.MAP]}if(g)g(X),delete _.onTagObj;let N=X?.createNode?X.createNode(_.schema,$,_):typeof X?.nodeClass?.from==="function"?X.nodeClass.from(_.schema,$,_):new IN.Scalar($);if(I)N.tag=I;else if(!X.default)N.tag=X.tag;if(J)J.node=N;return N}oL.createNode=dL});var jU=S((eL)=>{var tL=kI(),j4=$$(),aL=bU();function Mg($,I,_){let u=_;for(let U=I.length-1;U>=0;--U){let g=I[U];if(typeof g==="number"&&Number.isInteger(g)&&g>=0){let z=[];z[g]=u,u=z}else u=new Map([[g,u]])}return tL.createNode(u,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:$,sourceObjects:new Map})}var UN=($)=>$==null||typeof $==="object"&&!!$[Symbol.iterator]().next().done;class _N extends aL.NodeBase{constructor($,I){super($);Object.defineProperty(this,"schema",{value:I,configurable:!0,enumerable:!1,writable:!0})}clone($){let I=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if($)I.schema=$;if(I.items=I.items.map((_)=>j4.isNode(_)||j4.isPair(_)?_.clone($):_),this.range)I.range=this.range.slice();return I}addIn($,I){if(UN($))this.add(I);else{let[_,...u]=$,U=this.get(_,!0);if(j4.isCollection(U))U.addIn(u,I);else if(U===void 0&&this.schema)this.set(_,Mg(this.schema,u,I));else throw Error(`Expected YAML collection at ${_}. Remaining path: ${u}`)}}deleteIn($){let[I,..._]=$;if(_.length===0)return this.delete(I);let u=this.get(I,!0);if(j4.isCollection(u))return u.deleteIn(_);else throw Error(`Expected YAML collection at ${I}. Remaining path: ${_}`)}getIn($,I){let[_,...u]=$,U=this.get(_,!0);if(u.length===0)return!I&&j4.isScalar(U)?U.value:U;else return j4.isCollection(U)?U.getIn(u,I):void 0}hasAllNullValues($){return this.items.every((I)=>{if(!j4.isPair(I))return!1;let _=I.value;return _==null||$&&j4.isScalar(_)&&_.value==null&&!_.commentBefore&&!_.comment&&!_.tag})}hasIn($){let[I,..._]=$;if(_.length===0)return this.has(I);let u=this.get(I,!0);return j4.isCollection(u)?u.hasIn(_):!1}setIn($,I){let[_,...u]=$;if(u.length===0)this.set(_,I);else{let U=this.get(_,!0);if(j4.isCollection(U))U.setIn(u,I);else if(U===void 0&&this.schema)this.set(_,Mg(this.schema,u,I));else throw Error(`Expected YAML collection at ${_}. Remaining path: ${u}`)}}}eL.Collection=_N;eL.collectionFromPath=Mg;eL.isEmptyPath=UN});var yI=S((uB)=>{var UB=($)=>$.replace(/^(?!$)(?: $)?/gm,"#");function Dg($,I){if(/^\n+$/.test($))return $.substring(1);return I?$.replace(/^(?! *$)/gm,I):$}var _B=($,I,_)=>$.endsWith(`
|
|
29
|
+
`)?Dg(_,I):_.includes(`
|
|
30
30
|
`)?`
|
|
31
|
-
`+
|
|
32
|
-
`){if(_==="block")H=
|
|
31
|
+
`+Dg(_,I):($.endsWith(" ")?"":" ")+_;uB.indentComment=Dg;uB.lineComment=_B;uB.stringifyComment=UB});var gN=S((XB)=>{function JB($,I,_="flow",{indentAtStart:u,lineWidth:U=80,minContentWidth:g=20,onFold:z,onOverflow:G}={}){if(!U||U<0)return $;if(U<g)g=0;let J=Math.max(1+g,1+U-I.length);if($.length<=J)return $;let X=[],N={},q=U-I.length;if(typeof u==="number")if(u>U-Math.max(2,g))X.push(0);else q=U-u;let Q=void 0,Y=void 0,O=!1,H=-1,v=-1,T=-1;if(_==="block"){if(H=uN($,H,I.length),H!==-1)q=H+J}for(let D;D=$[H+=1];){if(_==="quoted"&&D==="\\"){switch(v=H,$[H+1]){case"x":H+=3;break;case"u":H+=5;break;case"U":H+=9;break;default:H+=1}T=H}if(D===`
|
|
32
|
+
`){if(_==="block")H=uN($,H,I.length);q=H+I.length+J,Q=void 0}else{if(D===" "&&Y&&Y!==" "&&Y!==`
|
|
33
33
|
`&&Y!=="\t"){let B=$[H+1];if(B&&B!==" "&&B!==`
|
|
34
|
-
`&&B!=="\t")Q=H}if(H>=q)if(Q)X.push(Q),q=Q+J,Q=void 0;else if(_==="quoted"){while(Y===" "||Y==="\t")Y=
|
|
34
|
+
`&&B!=="\t")Q=H}if(H>=q)if(Q)X.push(Q),q=Q+J,Q=void 0;else if(_==="quoted"){while(Y===" "||Y==="\t")Y=D,D=$[H+=1],O=!0;let B=H>T+1?H-2:v-1;if(N[B])return $;X.push(B),N[B]=!0,q=B+J,Q=void 0}else O=!0}Y=D}if(O&&G)G();if(X.length===0)return $;if(z)z();let K=$.slice(0,X[0]);for(let D=0;D<X.length;++D){let B=X[D],R=X[D+1]||$.length;if(B===0)K=`
|
|
35
35
|
${I}${$.slice(0,R)}`;else{if(_==="quoted"&&N[B])K+=`${$[B]}\\`;K+=`
|
|
36
|
-
${I}${$.slice(B+1,R)}`}}return K}function
|
|
37
|
-
`);u=I,U=I+1,g=$[U]}return u}
|
|
38
|
-
`){if(g-z>u)return!0;if(z=g+1,U-z<=u)return!1}return!0}function
|
|
36
|
+
${I}${$.slice(B+1,R)}`}}return K}function uN($,I,_){let u=I,U=I+1,g=$[U];while(g===" "||g==="\t")if(I<U+_)g=$[++I];else{do g=$[++I];while(g&&g!==`
|
|
37
|
+
`);u=I,U=I+1,g=$[U]}return u}XB.FOLD_BLOCK="block";XB.FOLD_FLOW="flow";XB.FOLD_QUOTED="quoted";XB.foldFlowLines=JB});var lI=S((TB)=>{var T4=R$(),J6=gN(),FU=($,I)=>({indentAtStart:I?$.indent.length:$.indentAtStart,lineWidth:$.options.lineWidth,minContentWidth:$.options.minContentWidth}),wU=($)=>/^(%|---|\.\.\.)/m.test($);function YB($,I,_){if(!I||I<0)return!1;let u=I-_,U=$.length;if(U<=u)return!1;for(let g=0,z=0;g<U;++g)if($[g]===`
|
|
38
|
+
`){if(g-z>u)return!0;if(z=g+1,U-z<=u)return!1}return!0}function iI($,I){let _=JSON.stringify($);if(I.options.doubleQuotedAsJSON)return _;let{implicitKey:u}=I,U=I.options.doubleQuotedMinMultiLineLength,g=I.indent||(wU($)?" ":""),z="",G=0;for(let J=0,X=_[J];X;X=_[++J]){if(X===" "&&_[J+1]==="\\"&&_[J+2]==="n")z+=_.slice(G,J)+"\\ ",J+=1,G=J,X="\\";if(X==="\\")switch(_[J+1]){case"u":{z+=_.slice(G,J);let N=_.substr(J+2,4);switch(N){case"0000":z+="\\0";break;case"0007":z+="\\a";break;case"000b":z+="\\v";break;case"001b":z+="\\e";break;case"0085":z+="\\N";break;case"00a0":z+="\\_";break;case"2028":z+="\\L";break;case"2029":z+="\\P";break;default:if(N.substr(0,2)==="00")z+="\\x"+N.substr(2);else z+=_.substr(J,6)}J+=5,G=J+1}break;case"n":if(u||_[J+2]==='"'||_.length<U)J+=1;else{z+=_.slice(G,J)+`
|
|
39
39
|
|
|
40
40
|
`;while(_[J+2]==="\\"&&_[J+3]==="n"&&_[J+4]!=='"')z+=`
|
|
41
|
-
`,J+=2;if(z+=g,_[J+2]===" ")z+="\\";J+=1,G=J+1}break;default:J+=1}}return z=G?z+_.slice(G):_,u?z:
|
|
42
|
-
`)||/[ \t]\n|\n[ \t]/.test($))return
|
|
43
|
-
${_}`)+"'";return I.implicitKey?u:
|
|
41
|
+
`,J+=2;if(z+=g,_[J+2]===" ")z+="\\";J+=1,G=J+1}break;default:J+=1}}return z=G?z+_.slice(G):_,u?z:J6.foldFlowLines(z,g,J6.FOLD_QUOTED,FU(I,!1))}function Lg($,I){if(I.options.singleQuote===!1||I.implicitKey&&$.includes(`
|
|
42
|
+
`)||/[ \t]\n|\n[ \t]/.test($))return iI($,I);let _=I.indent||(wU($)?" ":""),u="'"+$.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
43
|
+
${_}`)+"'";return I.implicitKey?u:J6.foldFlowLines(u,_,J6.FOLD_FLOW,FU(I,!1))}function W1($,I){let{singleQuote:_}=I.options,u;if(_===!1)u=iI;else{let U=$.includes('"'),g=$.includes("'");if(U&&!g)u=Lg;else if(g&&!U)u=iI;else u=_?Lg:iI}return u($,I)}var Bg;try{Bg=new RegExp(`(^|(?<!
|
|
44
44
|
))
|
|
45
45
|
+(?!
|
|
46
|
-
|$)`,"g")}catch{
|
|
46
|
+
|$)`,"g")}catch{Bg=/\n+(?!\n|$)/g}function SU({comment:$,type:I,value:_},u,U,g){let{blockQuote:z,commentString:G,lineWidth:J}=u.options;if(!z||/\n[\t ]+$/.test(_))return W1(_,u);let X=u.indent||(u.forceBlockIndent||wU(_)?" ":""),N=z==="literal"?!0:z==="folded"||I===T4.Scalar.BLOCK_FOLDED?!1:I===T4.Scalar.BLOCK_LITERAL?!0:!YB(_,J,X.length);if(!_)return N?`|
|
|
47
47
|
`:`>
|
|
48
48
|
`;let q,Q;for(Q=_.length;Q>0;--Q){let R=_[Q-1];if(R!==`
|
|
49
49
|
`&&R!=="\t"&&R!==" ")break}let Y=_.substring(Q),O=Y.indexOf(`
|
|
50
50
|
`);if(O===-1)q="-";else if(_===Y||O!==Y.length-1){if(q="+",g)g()}else q="";if(Y){if(_=_.slice(0,-Y.length),Y[Y.length-1]===`
|
|
51
|
-
`)Y=Y.slice(0,-1);Y=Y.replace(
|
|
51
|
+
`)Y=Y.slice(0,-1);Y=Y.replace(Bg,`$&${X}`)}let H=!1,v,T=-1;for(v=0;v<_.length;++v){let R=_[v];if(R===" ")H=!0;else if(R===`
|
|
52
52
|
`)T=v;else break}let K=_.substring(0,T<v?T+1:v);if(K)_=_.substring(K.length),K=K.replace(/\n+/g,`$&${X}`);let B=(H?X?"2":"1":"")+q;if($){if(B+=" "+G($.replace(/ ?[\r\n]+/g," ")),U)U()}if(!N){let R=_.replace(/\n+/g,`
|
|
53
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${X}`),
|
|
54
|
-
${X}${
|
|
55
|
-
${X}${K}${_}${Y}`}function
|
|
56
|
-
`)||N&&/[[\]{},]/.test(g))return
|
|
57
|
-
`)?
|
|
58
|
-
`))return
|
|
59
|
-
${J}`);if(z){let Q=(H)=>H.default&&H.tag!=="tag:yaml.org,2002:str"&&H.test?.test(q),{compat:Y,tags:O}=I.doc.schema;if(O.some(Q)||Y?.some(Q))return
|
|
60
|
-
${I.indent}${G}`}
|
|
61
|
-
${G}:`}else if(v=`${v}:`,Q)v+=
|
|
62
|
-
`:"",K){let
|
|
63
|
-
${
|
|
64
|
-
`&&
|
|
53
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${X}`),V=!1,M=FU(u,!0);if(z!=="folded"&&I!==T4.Scalar.BLOCK_FOLDED)M.onOverflow=()=>{V=!0};let W=J6.foldFlowLines(`${K}${R}${Y}`,X,J6.FOLD_BLOCK,M);if(!V)return`>${B}
|
|
54
|
+
${X}${W}`}return _=_.replace(/\n+/g,`$&${X}`),`|${B}
|
|
55
|
+
${X}${K}${_}${Y}`}function OB($,I,_,u){let{type:U,value:g}=$,{actualString:z,implicitKey:G,indent:J,indentStep:X,inFlow:N}=I;if(G&&g.includes(`
|
|
56
|
+
`)||N&&/[[\]{},]/.test(g))return W1(g,I);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(g))return G||N||!g.includes(`
|
|
57
|
+
`)?W1(g,I):SU($,I,_,u);if(!G&&!N&&U!==T4.Scalar.PLAIN&&g.includes(`
|
|
58
|
+
`))return SU($,I,_,u);if(wU(g)){if(J==="")return I.forceBlockIndent=!0,SU($,I,_,u);else if(G&&J===X)return W1(g,I)}let q=g.replace(/\n+/g,`$&
|
|
59
|
+
${J}`);if(z){let Q=(H)=>H.default&&H.tag!=="tag:yaml.org,2002:str"&&H.test?.test(q),{compat:Y,tags:O}=I.doc.schema;if(O.some(Q)||Y?.some(Q))return W1(g,I)}return G?q:J6.foldFlowLines(q,J,J6.FOLD_FLOW,FU(I,!1))}function vB($,I,_,u){let{implicitKey:U,inFlow:g}=I,z=typeof $.value==="string"?$:Object.assign({},$,{value:String($.value)}),{type:G}=$;if(G!==T4.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(z.value))G=T4.Scalar.QUOTE_DOUBLE}let J=(N)=>{switch(N){case T4.Scalar.BLOCK_FOLDED:case T4.Scalar.BLOCK_LITERAL:return U||g?W1(z.value,I):SU(z,I,_,u);case T4.Scalar.QUOTE_DOUBLE:return iI(z.value,I);case T4.Scalar.QUOTE_SINGLE:return Lg(z.value,I);case T4.Scalar.PLAIN:return OB(z,I,_,u);default:return null}},X=J(G);if(X===null){let{defaultKeyType:N,defaultStringType:q}=I.options,Q=U&&N||q;if(X=J(Q),X===null)throw Error(`Unsupported default string type ${Q}`)}return X}TB.stringifyString=vB});var mI=S((ZB)=>{var DB=AU(),X6=$$(),LB=yI(),BB=lI();function KB($,I){let _=Object.assign({blockQuote:!0,commentString:LB.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},$.schema.toStringOptions,I),u;switch(_.collectionStyle){case"block":u=!1;break;case"flow":u=!0;break;default:u=null}return{anchors:new Set,doc:$,flowCollectionPadding:_.flowCollectionPadding?" ":"",indent:"",indentStep:typeof _.indent==="number"?" ".repeat(_.indent):" ",inFlow:u,options:_}}function WB($,I){if(I.tag){let U=$.filter((g)=>g.tag===I.tag);if(U.length>0)return U.find((g)=>g.format===I.format)??U[0]}let _=void 0,u;if(X6.isScalar(I)){u=I.value;let U=$.filter((g)=>g.identify?.(u));if(U.length>1){let g=U.filter((z)=>z.test);if(g.length>0)U=g}_=U.find((g)=>g.format===I.format)??U.find((g)=>!g.format)}else u=I,_=$.find((U)=>U.nodeClass&&u instanceof U.nodeClass);if(!_){let U=u?.constructor?.name??(u===null?"null":typeof u);throw Error(`Tag not resolved for ${U} value`)}return _}function RB($,I,{anchors:_,doc:u}){if(!u.directives)return"";let U=[],g=(X6.isScalar($)||X6.isCollection($))&&$.anchor;if(g&&DB.anchorIsValid(g))_.add(g),U.push(`&${g}`);let z=$.tag??(I.default?null:I.tag);if(z)U.push(u.directives.tagString(z));return U.join(" ")}function VB($,I,_,u){if(X6.isPair($))return $.toString(I,_,u);if(X6.isAlias($)){if(I.doc.directives)return $.toString(I);if(I.resolvedAliases?.has($))throw TypeError("Cannot stringify circular structure without alias nodes");else{if(I.resolvedAliases)I.resolvedAliases.add($);else I.resolvedAliases=new Set([$]);$=$.resolve(I.doc)}}let U=void 0,g=X6.isNode($)?$:I.doc.createNode($,{onTagObj:(J)=>U=J});U??(U=WB(I.doc.schema.tags,g));let z=RB(g,U,I);if(z.length>0)I.indentAtStart=(I.indentAtStart??0)+z.length+1;let G=typeof U.stringify==="function"?U.stringify(g,I,_,u):X6.isScalar(g)?BB.stringifyString(g,I,_,u):g.toString(I,_,u);if(!z)return G;return X6.isScalar(g)||G[0]==="{"||G[0]==="["?`${z} ${G}`:`${z}
|
|
60
|
+
${I.indent}${G}`}ZB.createStringifyContext=KB;ZB.stringify=VB});var JN=S((jB)=>{var h4=$$(),zN=R$(),GN=mI(),nI=yI();function PB({key:$,value:I},_,u,U){let{allNullValues:g,doc:z,indent:G,indentStep:J,options:{commentString:X,indentSeq:N,simpleKeys:q}}=_,Q=h4.isNode($)&&$.comment||null;if(q){if(Q)throw Error("With simple keys, key nodes cannot have comments");if(h4.isCollection($)||!h4.isNode($)&&typeof $==="object")throw Error("With simple keys, collection cannot be used as a key value")}let Y=!q&&(!$||Q&&I==null&&!_.inFlow||h4.isCollection($)||(h4.isScalar($)?$.type===zN.Scalar.BLOCK_FOLDED||$.type===zN.Scalar.BLOCK_LITERAL:typeof $==="object"));_=Object.assign({},_,{allNullValues:!1,implicitKey:!Y&&(q||!g),indent:G+J});let O=!1,H=!1,v=GN.stringify($,_,()=>O=!0,()=>H=!0);if(!Y&&!_.inFlow&&v.length>1024){if(q)throw Error("With simple keys, single line scalar must not span more than 1024 characters");Y=!0}if(_.inFlow){if(g||I==null){if(O&&u)u();return v===""?"?":Y?`? ${v}`:v}}else if(g&&!q||I==null&&Y){if(v=`? ${v}`,Q&&!O)v+=nI.lineComment(v,_.indent,X(Q));else if(H&&U)U();return v}if(O)Q=null;if(Y){if(Q)v+=nI.lineComment(v,_.indent,X(Q));v=`? ${v}
|
|
61
|
+
${G}:`}else if(v=`${v}:`,Q)v+=nI.lineComment(v,_.indent,X(Q));let T,K,D;if(h4.isNode(I))T=!!I.spaceBefore,K=I.commentBefore,D=I.comment;else if(T=!1,K=null,D=null,I&&typeof I==="object")I=z.createNode(I);if(_.implicitKey=!1,!Y&&!Q&&h4.isScalar(I))_.indentAtStart=v.length+1;if(H=!1,!N&&J.length>=2&&!_.inFlow&&!Y&&h4.isSeq(I)&&!I.flow&&!I.tag&&!I.anchor)_.indent=_.indent.substring(2);let B=!1,R=GN.stringify(I,_,()=>B=!0,()=>H=!0),V=" ";if(Q||T||K){if(V=T?`
|
|
62
|
+
`:"",K){let M=X(K);V+=`
|
|
63
|
+
${nI.indentComment(M,_.indent)}`}if(R===""&&!_.inFlow){if(V===`
|
|
64
|
+
`&&D)V=`
|
|
65
65
|
|
|
66
|
-
`}else
|
|
67
|
-
${_.indent}`}else if(!Y&&h4.isCollection(I)){let
|
|
68
|
-
`),E=
|
|
66
|
+
`}else V+=`
|
|
67
|
+
${_.indent}`}else if(!Y&&h4.isCollection(I)){let M=R[0],W=R.indexOf(`
|
|
68
|
+
`),E=W!==-1,C=_.inFlow??I.flow??I.items.length===0;if(E||!C){let k=!1;if(E&&(M==="&"||M==="!")){let w=R.indexOf(" ");if(M==="&"&&w!==-1&&w<W&&R[w+1]==="!")w=R.indexOf(" ",w+1);if(w===-1||W<w)k=!0}if(!k)V=`
|
|
69
69
|
${_.indent}`}}else if(R===""||R[0]===`
|
|
70
|
-
`)
|
|
70
|
+
`)V="";if(v+=V+R,_.inFlow){if(B&&u)u()}else if(D&&!B)v+=nI.lineComment(v,_.indent,X(D));else if(H&&U)U();return v}jB.stringifyPair=PB});var Kg=S((EB)=>{var XN=z$("process");function FB($,...I){if($==="debug")console.log(...I)}function wB($,I){if($==="debug"||$==="warn")if(typeof XN.emitWarning==="function")XN.emitWarning(I);else console.warn(I)}EB.debug=FB;EB.warn=wB});var fU=S((kB)=>{var rI=$$(),qN=R$(),EU="<<",CU={identify:($)=>$===EU||typeof $==="symbol"&&$.description===EU,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new qN.Scalar(Symbol(EU)),{addToJSMap:NN}),stringify:()=>EU},xB=($,I)=>(CU.identify(I)||rI.isScalar(I)&&(!I.type||I.type===qN.Scalar.PLAIN)&&CU.identify(I.value))&&$?.doc.schema.tags.some((_)=>_.tag===CU.tag&&_.default);function NN($,I,_){if(_=$&&rI.isAlias(_)?_.resolve($.doc):_,rI.isSeq(_))for(let u of _.items)Wg($,I,u);else if(Array.isArray(_))for(let u of _)Wg($,I,u);else Wg($,I,_)}function Wg($,I,_){let u=$&&rI.isAlias(_)?_.resolve($.doc):_;if(!rI.isMap(u))throw Error("Merge sources must be maps or map aliases");let U=u.toJSON(null,$,Map);for(let[g,z]of U)if(I instanceof Map){if(!I.has(g))I.set(g,z)}else if(I instanceof Set)I.add(g);else if(!Object.prototype.hasOwnProperty.call(I,g))Object.defineProperty(I,g,{value:z,writable:!0,enumerable:!0,configurable:!0});return I}kB.addMergeToJSMap=NN;kB.isMergeKey=xB;kB.merge=CU});var Vg=S((cB)=>{var mB=Kg(),QN=fU(),nB=mI(),HN=$$(),Rg=G6();function rB($,I,{key:_,value:u}){if(HN.isNode(_)&&_.addToJSMap)_.addToJSMap($,I,u);else if(QN.isMergeKey($,_))QN.addMergeToJSMap($,I,u);else{let U=Rg.toJS(_,"",$);if(I instanceof Map)I.set(U,Rg.toJS(u,U,$));else if(I instanceof Set)I.add(U);else{let g=hB(_,U,$),z=Rg.toJS(u,g,$);if(g in I)Object.defineProperty(I,g,{value:z,writable:!0,enumerable:!0,configurable:!0});else I[g]=z}}return I}function hB($,I,_){if(I===null)return"";if(typeof I!=="object")return String(I);if(HN.isNode($)&&_?.doc){let u=nB.createStringifyContext(_.doc,{});u.anchors=new Set;for(let g of _.anchors.keys())u.anchors.add(g.anchor);u.inFlow=!0,u.inStringifyKey=!0;let U=$.toString(u);if(!_.mapKeyWarned){let g=JSON.stringify(U);if(g.length>40)g=g.substring(0,36)+'..."';mB.warn(_.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${g}. Set mapAsMap: true to use object keys.`),_.mapKeyWarned=!0}return U}return JSON.stringify(I)}cB.addPairToJSMap=rB});var q6=S((aB)=>{var YN=kI(),oB=JN(),pB=Vg(),xU=$$();function tB($,I,_){let u=YN.createNode($,void 0,_),U=YN.createNode(I,void 0,_);return new kU(u,U)}class kU{constructor($,I=null){Object.defineProperty(this,xU.NODE_TYPE,{value:xU.PAIR}),this.key=$,this.value=I}clone($){let{key:I,value:_}=this;if(xU.isNode(I))I=I.clone($);if(xU.isNode(_))_=_.clone($);return new kU(I,_)}toJSON($,I){let _=I?.mapAsMap?new Map:{};return pB.addPairToJSMap(I,_,this)}toString($,I,_){return $?.doc?oB.stringifyPair(this,$,I,_):JSON.stringify(this)}}aB.Pair=kU;aB.createPair=tB});var Zg=S((_K)=>{var m6=$$(),ON=mI(),yU=yI();function $K($,I,_){return(I.inFlow??$.flow?UK:IK)($,I,_)}function IK({comment:$,items:I},_,{blockItemPrefix:u,flowChars:U,itemIndent:g,onChompKeep:z,onComment:G}){let{indent:J,options:{commentString:X}}=_,N=Object.assign({},_,{indent:g,type:null}),q=!1,Q=[];for(let O=0;O<I.length;++O){let H=I[O],v=null;if(m6.isNode(H)){if(!q&&H.spaceBefore)Q.push("");if(iU(_,Q,H.commentBefore,q),H.comment)v=H.comment}else if(m6.isPair(H)){let K=m6.isNode(H.key)?H.key:null;if(K){if(!q&&K.spaceBefore)Q.push("");iU(_,Q,K.commentBefore,q)}}q=!1;let T=ON.stringify(H,N,()=>v=null,()=>q=!0);if(v)T+=yU.lineComment(T,g,X(v));if(q&&v)q=!1;Q.push(u+T)}let Y;if(Q.length===0)Y=U.start+U.end;else{Y=Q[0];for(let O=1;O<Q.length;++O){let H=Q[O];Y+=H?`
|
|
71
71
|
${J}${H}`:`
|
|
72
72
|
`}}if($){if(Y+=`
|
|
73
|
-
`+
|
|
73
|
+
`+yU.indentComment(X($),J),G)G()}else if(q&&z)z();return Y}function UK({items:$},I,{flowChars:_,itemIndent:u}){let{indent:U,indentStep:g,flowCollectionPadding:z,options:{commentString:G}}=I;u+=g;let J=Object.assign({},I,{indent:u,inFlow:!0,type:null}),X=!1,N=0,q=[];for(let O=0;O<$.length;++O){let H=$[O],v=null;if(m6.isNode(H)){if(H.spaceBefore)q.push("");if(iU(I,q,H.commentBefore,!1),H.comment)v=H.comment}else if(m6.isPair(H)){let K=m6.isNode(H.key)?H.key:null;if(K){if(K.spaceBefore)q.push("");if(iU(I,q,K.commentBefore,!1),K.comment)X=!0}let D=m6.isNode(H.value)?H.value:null;if(D){if(D.comment)v=D.comment;if(D.commentBefore)X=!0}else if(H.value==null&&K?.comment)v=K.comment}if(v)X=!0;let T=ON.stringify(H,J,()=>v=null);if(O<$.length-1)T+=",";if(v)T+=yU.lineComment(T,u,G(v));if(!X&&(q.length>N||T.includes(`
|
|
74
74
|
`)))X=!0;q.push(T),N=q.length}let{start:Q,end:Y}=_;if(q.length===0)return Q+Y;else{if(!X){let O=q.reduce((H,v)=>H+v.length+2,2);X=I.options.lineWidth>0&&O>I.options.lineWidth}if(X){let O=Q;for(let H of q)O+=H?`
|
|
75
75
|
${g}${U}${H}`:`
|
|
76
76
|
`;return`${O}
|
|
77
|
-
${U}${Y}`}else return`${Q}${z}${q.join(" ")}${z}${Y}`}}function
|
|
78
|
-
`:" ")}return
|
|
77
|
+
${U}${Y}`}else return`${Q}${z}${q.join(" ")}${z}${Y}`}}function iU({indent:$,options:{commentString:I}},_,u,U){if(u&&U)u=u.replace(/^\n+/,"");if(u){let g=yU.indentComment(I(u),$);_.push(g.trimStart())}}_K.stringifyCollection=$K});var Q6=S((XK)=>{var gK=Zg(),zK=Vg(),GK=jU(),N6=$$(),lU=q6(),JK=R$();function hI($,I){let _=N6.isScalar(I)?I.value:I;for(let u of $)if(N6.isPair(u)){if(u.key===I||u.key===_)return u;if(N6.isScalar(u.key)&&u.key.value===_)return u}return}class vN extends GK.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor($){super(N6.MAP,$);this.items=[]}static from($,I,_){let{keepUndefined:u,replacer:U}=_,g=new this($),z=(G,J)=>{if(typeof U==="function")J=U.call(I,G,J);else if(Array.isArray(U)&&!U.includes(G))return;if(J!==void 0||u)g.items.push(lU.createPair(G,J,_))};if(I instanceof Map)for(let[G,J]of I)z(G,J);else if(I&&typeof I==="object")for(let G of Object.keys(I))z(G,I[G]);if(typeof $.sortMapEntries==="function")g.items.sort($.sortMapEntries);return g}add($,I){let _;if(N6.isPair($))_=$;else if(!$||typeof $!=="object"||!("key"in $))_=new lU.Pair($,$?.value);else _=new lU.Pair($.key,$.value);let u=hI(this.items,_.key),U=this.schema?.sortMapEntries;if(u){if(!I)throw Error(`Key ${_.key} already set`);if(N6.isScalar(u.value)&&JK.isScalarValue(_.value))u.value.value=_.value;else u.value=_.value}else if(U){let g=this.items.findIndex((z)=>U(_,z)<0);if(g===-1)this.items.push(_);else this.items.splice(g,0,_)}else this.items.push(_)}delete($){let I=hI(this.items,$);if(!I)return!1;return this.items.splice(this.items.indexOf(I),1).length>0}get($,I){let u=hI(this.items,$)?.value;return(!I&&N6.isScalar(u)?u.value:u)??void 0}has($){return!!hI(this.items,$)}set($,I){this.add(new lU.Pair($,I),!0)}toJSON($,I,_){let u=_?new _:I?.mapAsMap?new Map:{};if(I?.onCreate)I.onCreate(u);for(let U of this.items)zK.addPairToJSMap(I,u,U);return u}toString($,I,_){if(!$)return JSON.stringify(this);for(let u of this.items)if(!N6.isPair(u))throw Error(`Map items must all be pairs; found ${JSON.stringify(u)} instead`);if(!$.allNullValues&&this.hasAllNullValues(!1))$=Object.assign({},$,{allNullValues:!0});return gK.stringifyCollection(this,$,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:$.indent||"",onChompKeep:_,onComment:I})}}XK.YAMLMap=vN;XK.findPair=hI});var R1=S((YK)=>{var QK=$$(),TN=Q6(),HK={collection:"map",default:!0,nodeClass:TN.YAMLMap,tag:"tag:yaml.org,2002:map",resolve($,I){if(!QK.isMap($))I("Expected a mapping for this tag");return $},createNode:($,I,_)=>TN.YAMLMap.from($,I,_)};YK.map=HK});var H6=S((BK)=>{var vK=kI(),TK=Zg(),MK=jU(),nU=$$(),DK=R$(),LK=G6();class MN extends MK.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor($){super(nU.SEQ,$);this.items=[]}add($){this.items.push($)}delete($){let I=mU($);if(typeof I!=="number")return!1;return this.items.splice(I,1).length>0}get($,I){let _=mU($);if(typeof _!=="number")return;let u=this.items[_];return!I&&nU.isScalar(u)?u.value:u}has($){let I=mU($);return typeof I==="number"&&I<this.items.length}set($,I){let _=mU($);if(typeof _!=="number")throw Error(`Expected a valid index, not ${$}.`);let u=this.items[_];if(nU.isScalar(u)&&DK.isScalarValue(I))u.value=I;else this.items[_]=I}toJSON($,I){let _=[];if(I?.onCreate)I.onCreate(_);let u=0;for(let U of this.items)_.push(LK.toJS(U,String(u++),I));return _}toString($,I,_){if(!$)return JSON.stringify(this);return TK.stringifyCollection(this,$,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:($.indent||"")+" ",onChompKeep:_,onComment:I})}static from($,I,_){let{replacer:u}=_,U=new this($);if(I&&Symbol.iterator in Object(I)){let g=0;for(let z of I){if(typeof u==="function"){let G=I instanceof Set?z:String(g++);z=u.call(I,G,z)}U.items.push(vK.createNode(z,void 0,_))}}return U}}function mU($){let I=nU.isScalar($)?$.value:$;if(I&&typeof I==="string")I=Number(I);return typeof I==="number"&&Number.isInteger(I)&&I>=0?I:null}BK.YAMLSeq=MN});var V1=S((VK)=>{var WK=$$(),DN=H6(),RK={collection:"seq",default:!0,nodeClass:DN.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve($,I){if(!WK.isSeq($))I("Expected a sequence for this tag");return $},createNode:($,I,_)=>DN.YAMLSeq.from($,I,_)};VK.seq=RK});var cI=S((PK)=>{var AK=lI(),bK={identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify($,I,_,u){return I=Object.assign({actualString:!0},I),AK.stringifyString($,I,_,u)}};PK.string=bK});var rU=S((SK)=>{var LN=R$(),BN={identify:($)=>$==null,createNode:()=>new LN.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new LN.Scalar(null),stringify:({source:$},I)=>typeof $==="string"&&BN.test.test($)?$:I.options.nullStr};SK.nullTag=BN});var Ag=S((EK)=>{var wK=R$(),KN={identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:($)=>new wK.Scalar($[0]==="t"||$[0]==="T"),stringify({source:$,value:I},_){if($&&KN.test.test($)){let u=$[0]==="t"||$[0]==="T";if(I===u)return $}return I?_.options.trueStr:_.options.falseStr}};EK.boolTag=KN});var Z1=S((xK)=>{function fK({format:$,minFractionDigits:I,tag:_,value:u}){if(typeof u==="bigint")return String(u);let U=typeof u==="number"?u:Number(u);if(!isFinite(U))return isNaN(U)?".nan":U<0?"-.inf":".inf";let g=Object.is(u,-0)?"-0":JSON.stringify(u);if(!$&&I&&(!_||_==="tag:yaml.org,2002:float")&&/^\d/.test(g)){let z=g.indexOf(".");if(z<0)z=g.length,g+=".";let G=I-(g.length-z-1);while(G-- >0)g+="0"}return g}xK.stringifyNumber=fK});var Pg=S((nK)=>{var yK=R$(),bg=Z1(),iK={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:($)=>$.slice(-3).toLowerCase()==="nan"?NaN:$[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:bg.stringifyNumber},lK={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:($)=>parseFloat($),stringify($){let I=Number($.value);return isFinite(I)?I.toExponential():bg.stringifyNumber($)}},mK={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve($){let I=new yK.Scalar(parseFloat($)),_=$.indexOf(".");if(_!==-1&&$[$.length-1]==="0")I.minFractionDigits=$.length-_-1;return I},stringify:bg.stringifyNumber};nK.float=mK;nK.floatExp=lK;nK.floatNaN=iK});var Sg=S((tK)=>{var WN=Z1(),hU=($)=>typeof $==="bigint"||Number.isInteger($),jg=($,I,_,{intAsBigInt:u})=>u?BigInt($):parseInt($.substring(I),_);function RN($,I,_){let{value:u}=$;if(hU(u)&&u>=0)return _+u.toString(I);return WN.stringifyNumber($)}var dK={identify:($)=>hU($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:($,I,_)=>jg($,2,8,_),stringify:($)=>RN($,8,"0o")},oK={identify:hU,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:($,I,_)=>jg($,0,10,_),stringify:WN.stringifyNumber},pK={identify:($)=>hU($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:($,I,_)=>jg($,2,16,_),stringify:($)=>RN($,16,"0x")};tK.int=oK;tK.intHex=pK;tK.intOct=dK});var VN=S((zW)=>{var $W=R1(),IW=rU(),UW=V1(),_W=cI(),uW=Ag(),Fg=Pg(),wg=Sg(),gW=[$W.map,UW.seq,_W.string,IW.nullTag,uW.boolTag,wg.intOct,wg.int,wg.intHex,Fg.floatNaN,Fg.floatExp,Fg.float];zW.schema=gW});var AN=S((YW)=>{var JW=R$(),XW=R1(),qW=V1();function ZN($){return typeof $==="bigint"||Number.isInteger($)}var cU=({value:$})=>JSON.stringify($),NW=[{identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify:cU},{identify:($)=>$==null,createNode:()=>new JW.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:cU},{identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:($)=>$==="true",stringify:cU},{identify:ZN,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:($,I,{intAsBigInt:_})=>_?BigInt($):parseInt($,10),stringify:({value:$})=>ZN($)?$.toString():JSON.stringify($)},{identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:($)=>parseFloat($),stringify:cU}],QW={default:!0,tag:"",test:/^/,resolve($,I){return I(`Unresolved plain scalar ${JSON.stringify($)}`),$}},HW=[XW.map,qW.seq].concat(NW,QW);YW.schema=HW});var Cg=S((MW)=>{var dI=z$("buffer"),Eg=R$(),vW=lI(),TW={identify:($)=>$ instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve($,I){if(typeof dI.Buffer==="function")return dI.Buffer.from($,"base64");else if(typeof atob==="function"){let _=atob($.replace(/[\n\r]/g,"")),u=new Uint8Array(_.length);for(let U=0;U<_.length;++U)u[U]=_.charCodeAt(U);return u}else return I("This environment does not support reading binary tags; either Buffer or atob is required"),$},stringify({comment:$,type:I,value:_},u,U,g){if(!_)return"";let z=_,G;if(typeof dI.Buffer==="function")G=z instanceof dI.Buffer?z.toString("base64"):dI.Buffer.from(z.buffer).toString("base64");else if(typeof btoa==="function"){let J="";for(let X=0;X<z.length;++X)J+=String.fromCharCode(z[X]);G=btoa(J)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(I??(I=Eg.Scalar.BLOCK_LITERAL),I!==Eg.Scalar.QUOTE_DOUBLE){let J=Math.max(u.options.lineWidth-u.indent.length,u.options.minContentWidth),X=Math.ceil(G.length/J),N=Array(X);for(let q=0,Q=0;q<X;++q,Q+=J)N[q]=G.substr(Q,J);G=N.join(I===Eg.Scalar.BLOCK_LITERAL?`
|
|
78
|
+
`:" ")}return vW.stringifyString({comment:$,type:I,value:G},u,U,g)}};MW.binary=TW});var oU=S((WW)=>{var dU=$$(),fg=q6(),LW=R$(),BW=H6();function bN($,I){if(dU.isSeq($))for(let _=0;_<$.items.length;++_){let u=$.items[_];if(dU.isPair(u))continue;else if(dU.isMap(u)){if(u.items.length>1)I("Each pair must have its own sequence indicator");let U=u.items[0]||new fg.Pair(new LW.Scalar(null));if(u.commentBefore)U.key.commentBefore=U.key.commentBefore?`${u.commentBefore}
|
|
79
79
|
${U.key.commentBefore}`:u.commentBefore;if(u.comment){let g=U.value??U.key;g.comment=g.comment?`${u.comment}
|
|
80
|
-
${g.comment}`:u.comment}u=U}$.items[_]=iU.isPair(u)?u:new bg.Pair(u)}else I("Expected a sequence for this tag");return $}function KN($,I,_){let{replacer:u}=_,U=new HV.YAMLSeq($);U.tag="tag:yaml.org,2002:pairs";let g=0;if(I&&Symbol.iterator in Object(I))for(let z of I){if(typeof u==="function")z=u.call(I,String(g++),z);let G,J;if(Array.isArray(z))if(z.length===2)G=z[0],J=z[1];else throw TypeError(`Expected [key, value] tuple: ${z}`);else if(z&&z instanceof Object){let X=Object.keys(z);if(X.length===1)G=X[0],J=z[G];else throw TypeError(`Expected tuple with one key, not ${X.length} keys`)}else G=z;U.items.push(bg.createPair(G,J,_))}return U}var YV={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:BN,createNode:KN};OV.createPairs=KN;OV.pairs=YV;OV.resolvePairs=BN});var Sg=j((BV)=>{var VN=$$(),Pg=g6(),lI=q6(),DV=N6(),RN=yU();class y6 extends DV.YAMLSeq{constructor(){super();this.add=lI.YAMLMap.prototype.add.bind(this),this.delete=lI.YAMLMap.prototype.delete.bind(this),this.get=lI.YAMLMap.prototype.get.bind(this),this.has=lI.YAMLMap.prototype.has.bind(this),this.set=lI.YAMLMap.prototype.set.bind(this),this.tag=y6.tag}toJSON($,I){if(!I)return super.toJSON($);let _=new Map;if(I?.onCreate)I.onCreate(_);for(let u of this.items){let U,g;if(VN.isPair(u))U=Pg.toJS(u.key,"",I),g=Pg.toJS(u.value,U,I);else U=Pg.toJS(u,"",I);if(_.has(U))throw Error("Ordered maps must not include duplicate keys");_.set(U,g)}return _}static from($,I,_){let u=RN.createPairs($,I,_),U=new this;return U.items=u.items,U}}y6.tag="tag:yaml.org,2002:omap";var LV={collection:"seq",identify:($)=>$ instanceof Map,nodeClass:y6,default:!1,tag:"tag:yaml.org,2002:omap",resolve($,I){let _=RN.resolvePairs($,I),u=[];for(let{key:U}of _.items)if(VN.isScalar(U))if(u.includes(U.value))I(`Ordered maps must not include duplicate keys: ${U.value}`);else u.push(U.value);return Object.assign(new y6,_)},createNode:($,I,_)=>y6.from($,I,_)};BV.YAMLOMap=y6;BV.omap=LV});var PN=j((RV)=>{var WN=R$();function AN({value:$,source:I},_){if(I&&($?ZN:bN).test.test(I))return I;return $?_.options.trueStr:_.options.falseStr}var ZN={identify:($)=>$===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new WN.Scalar(!0),stringify:AN},bN={identify:($)=>$===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new WN.Scalar(!1),stringify:AN};RV.falseTag=bN;RV.trueTag=ZN});var SN=j((jV)=>{var ZV=R$(),jg=V1(),bV={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:($)=>$.slice(-3).toLowerCase()==="nan"?NaN:$[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:jg.stringifyNumber},PV={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:($)=>parseFloat($.replace(/_/g,"")),stringify($){let I=Number($.value);return isFinite(I)?I.toExponential():jg.stringifyNumber($)}},SV={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve($){let I=new ZV.Scalar(parseFloat($.replace(/_/g,""))),_=$.indexOf(".");if(_!==-1){let u=$.substring(_+1).replace(/_/g,"");if(u[u.length-1]==="0")I.minFractionDigits=u.length}return I},stringify:jg.stringifyNumber};jV.float=SV;jV.floatExp=PV;jV.floatNaN=bV});var FN=j((iV)=>{var jN=V1(),mI=($)=>typeof $==="bigint"||Number.isInteger($);function lU($,I,_,{intAsBigInt:u}){let U=$[0];if(U==="-"||U==="+")I+=1;if($=$.substring(I).replace(/_/g,""),u){switch(_){case 2:$=`0b${$}`;break;case 8:$=`0o${$}`;break;case 16:$=`0x${$}`;break}let z=BigInt($);return U==="-"?BigInt(-1)*z:z}let g=parseInt($,_);return U==="-"?-1*g:g}function Fg($,I,_){let{value:u}=$;if(mI(u)){let U=u.toString(I);return u<0?"-"+_+U.substr(1):_+U}return jN.stringifyNumber($)}var CV={identify:mI,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:($,I,_)=>lU($,2,2,_),stringify:($)=>Fg($,2,"0b")},fV={identify:mI,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:($,I,_)=>lU($,1,8,_),stringify:($)=>Fg($,8,"0")},xV={identify:mI,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:($,I,_)=>lU($,0,10,_),stringify:jN.stringifyNumber},kV={identify:mI,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:($,I,_)=>lU($,2,16,_),stringify:($)=>Fg($,16,"0x")};iV.int=xV;iV.intBin=CV;iV.intHex=kV;iV.intOct=fV});var wg=j((hV)=>{var rU=$$(),mU=J6(),nU=q6();class l6 extends nU.YAMLMap{constructor($){super($);this.tag=l6.tag}add($){let I;if(rU.isPair($))I=$;else if($&&typeof $==="object"&&"key"in $&&"value"in $&&$.value===null)I=new mU.Pair($.key,null);else I=new mU.Pair($,null);if(!nU.findPair(this.items,I.key))this.items.push(I)}get($,I){let _=nU.findPair(this.items,$);return!I&&rU.isPair(_)?rU.isScalar(_.key)?_.key.value:_.key:_}set($,I){if(typeof I!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof I}`);let _=nU.findPair(this.items,$);if(_&&!I)this.items.splice(this.items.indexOf(_),1);else if(!_&&I)this.items.push(new mU.Pair($))}toJSON($,I){return super.toJSON($,I,Set)}toString($,I,_){if(!$)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},$,{allNullValues:!0}),I,_);else throw Error("Set items must all have null values")}static from($,I,_){let{replacer:u}=_,U=new this($);if(I&&Symbol.iterator in Object(I))for(let g of I){if(typeof u==="function")g=u.call(I,g,g);U.items.push(mU.createPair(g,null,_))}return U}}l6.tag="tag:yaml.org,2002:set";var rV={collection:"map",identify:($)=>$ instanceof Set,nodeClass:l6,default:!1,tag:"tag:yaml.org,2002:set",createNode:($,I,_)=>l6.from($,I,_),resolve($,I){if(rU.isMap($))if($.hasAllNullValues(!0))return Object.assign(new l6,$);else I("Set items must all have null values");else I("Expected a mapping for this tag");return $}};hV.YAMLSet=l6;hV.set=rV});var Cg=j((aV)=>{var oV=V1();function Eg($,I){let _=$[0],u=_==="-"||_==="+"?$.substring(1):$,U=(z)=>I?BigInt(z):Number(z),g=u.replace(/_/g,"").split(":").reduce((z,G)=>z*U(60)+U(G),U(0));return _==="-"?U(-1)*g:g}function wN($){let{value:I}=$,_=(z)=>z;if(typeof I==="bigint")_=(z)=>BigInt(z);else if(isNaN(I)||!isFinite(I))return oV.stringifyNumber($);let u="";if(I<0)u="-",I*=_(-1);let U=_(60),g=[I%U];if(I<60)g.unshift(0);else if(I=(I-g[0])/U,g.unshift(I%U),I>=60)I=(I-g[0])/U,g.unshift(I);return u+g.map((z)=>String(z).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var pV={identify:($)=>typeof $==="bigint"||Number.isInteger($),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:($,I,{intAsBigInt:_})=>Eg($,_),stringify:wN},tV={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:($)=>Eg($,!1),stringify:wN},EN={identify:($)=>$ instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve($){let I=$.match(EN.test);if(!I)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,_,u,U,g,z,G]=I.map(Number),J=I[7]?Number((I[7]+"00").substr(1,3)):0,X=Date.UTC(_,u-1,U,g||0,z||0,G||0,J),N=I[8];if(N&&N!=="Z"){let q=Eg(N,!1);if(Math.abs(q)<30)q*=60;X-=60000*q}return new Date(X)},stringify:({value:$})=>$?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};aV.floatTime=tV;aV.intTime=pV;aV.timestamp=EN});var fN=j((NR)=>{var IR=B1(),UR=fU(),_R=K1(),uR=iI(),gR=Zg(),CN=PN(),fg=SN(),hU=FN(),zR=bU(),GR=Sg(),JR=yU(),XR=wg(),xg=Cg(),qR=[IR.map,_R.seq,uR.string,UR.nullTag,CN.trueTag,CN.falseTag,hU.intBin,hU.intOct,hU.int,hU.intHex,fg.floatNaN,fg.floatExp,fg.float,gR.binary,zR.merge,GR.omap,JR.pairs,XR.set,xg.intTime,xg.floatTime,xg.timestamp];NR.schema=qR});var cN=j((LR)=>{var yN=B1(),HR=fU(),lN=K1(),YR=iI(),OR=Dg(),kg=Bg(),ig=Vg(),vR=MN(),TR=LN(),mN=Zg(),nI=bU(),nN=Sg(),rN=yU(),xN=fN(),hN=wg(),cU=Cg(),kN=new Map([["core",vR.schema],["failsafe",[yN.map,lN.seq,YR.string]],["json",TR.schema],["yaml11",xN.schema],["yaml-1.1",xN.schema]]),iN={binary:mN.binary,bool:OR.boolTag,float:kg.float,floatExp:kg.floatExp,floatNaN:kg.floatNaN,floatTime:cU.floatTime,int:ig.int,intHex:ig.intHex,intOct:ig.intOct,intTime:cU.intTime,map:yN.map,merge:nI.merge,null:HR.nullTag,omap:nN.omap,pairs:rN.pairs,seq:lN.seq,set:hN.set,timestamp:cU.timestamp},MR={"tag:yaml.org,2002:binary":mN.binary,"tag:yaml.org,2002:merge":nI.merge,"tag:yaml.org,2002:omap":nN.omap,"tag:yaml.org,2002:pairs":rN.pairs,"tag:yaml.org,2002:set":hN.set,"tag:yaml.org,2002:timestamp":cU.timestamp};function DR($,I,_){let u=kN.get(I);if(u&&!$)return _&&!u.includes(nI.merge)?u.concat(nI.merge):u.slice();let U=u;if(!U)if(Array.isArray($))U=[];else{let g=Array.from(kN.keys()).filter((z)=>z!=="yaml11").map((z)=>JSON.stringify(z)).join(", ");throw Error(`Unknown schema "${I}"; use one of ${g} or define customTags array`)}if(Array.isArray($))for(let g of $)U=U.concat(g);else if(typeof $==="function")U=$(U.slice());if(_)U=U.concat(nI.merge);return U.reduce((g,z)=>{let G=typeof z==="string"?iN[z]:z;if(!G){let J=JSON.stringify(z),X=Object.keys(iN).map((N)=>JSON.stringify(N)).join(", ");throw Error(`Unknown custom tag ${J}; use one of ${X}`)}if(!g.includes(G))g.push(G);return g},[])}LR.coreKnownTags=MR;LR.getTags=DR});var mg=j((ZR)=>{var yg=$$(),VR=B1(),RR=K1(),WR=iI(),dU=cN(),AR=($,I)=>$.key<I.key?-1:$.key>I.key?1:0;class lg{constructor({compat:$,customTags:I,merge:_,resolveKnownTags:u,schema:U,sortMapEntries:g,toStringDefaults:z}){this.compat=Array.isArray($)?dU.getTags($,"compat"):$?dU.getTags(null,$):null,this.name=typeof U==="string"&&U||"core",this.knownTags=u?dU.coreKnownTags:{},this.tags=dU.getTags(I,this.name,_),this.toStringOptions=z??null,Object.defineProperty(this,yg.MAP,{value:VR.map}),Object.defineProperty(this,yg.SCALAR,{value:WR.string}),Object.defineProperty(this,yg.SEQ,{value:RR.seq}),this.sortMapEntries=typeof g==="function"?g:g===!0?AR:null}clone(){let $=Object.create(lg.prototype,Object.getOwnPropertyDescriptors(this));return $.tags=this.tags.slice(),$}}ZR.Schema=lg});var dN=j((jR)=>{var PR=$$(),ng=CI(),rI=FI();function SR($,I){let _=[],u=I.directives===!0;if(I.directives!==!1&&$.directives){let J=$.directives.toString($);if(J)_.push(J),u=!0;else if($.directives.docStart)u=!0}if(u)_.push("---");let U=ng.createStringifyContext($,I),{commentString:g}=U.options;if($.commentBefore){if(_.length!==1)_.unshift("");let J=g($.commentBefore);_.unshift(rI.indentComment(J,""))}let z=!1,G=null;if($.contents){if(PR.isNode($.contents)){if($.contents.spaceBefore&&u)_.push("");if($.contents.commentBefore){let N=g($.contents.commentBefore);_.push(rI.indentComment(N,""))}U.forceBlockIndent=!!$.comment,G=$.contents.comment}let J=G?void 0:()=>z=!0,X=ng.stringify($.contents,U,()=>G=null,J);if(G)X+=rI.lineComment(X,"",g(G));if((X[0]==="|"||X[0]===">")&&_[_.length-1]==="---")_[_.length-1]=`--- ${X}`;else _.push(X)}else _.push(ng.stringify($.contents,U));if($.directives?.docEnd)if($.comment){let J=g($.comment);if(J.includes(`
|
|
81
|
-
`))_.push("..."),_.push(
|
|
80
|
+
${g.comment}`:u.comment}u=U}$.items[_]=dU.isPair(u)?u:new fg.Pair(u)}else I("Expected a sequence for this tag");return $}function PN($,I,_){let{replacer:u}=_,U=new BW.YAMLSeq($);U.tag="tag:yaml.org,2002:pairs";let g=0;if(I&&Symbol.iterator in Object(I))for(let z of I){if(typeof u==="function")z=u.call(I,String(g++),z);let G,J;if(Array.isArray(z))if(z.length===2)G=z[0],J=z[1];else throw TypeError(`Expected [key, value] tuple: ${z}`);else if(z&&z instanceof Object){let X=Object.keys(z);if(X.length===1)G=X[0],J=z[G];else throw TypeError(`Expected tuple with one key, not ${X.length} keys`)}else G=z;U.items.push(fg.createPair(G,J,_))}return U}var KW={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:bN,createNode:PN};WW.createPairs=PN;WW.pairs=KW;WW.resolvePairs=bN});var kg=S((PW)=>{var jN=$$(),xg=G6(),oI=Q6(),AW=H6(),SN=oU();class n6 extends AW.YAMLSeq{constructor(){super();this.add=oI.YAMLMap.prototype.add.bind(this),this.delete=oI.YAMLMap.prototype.delete.bind(this),this.get=oI.YAMLMap.prototype.get.bind(this),this.has=oI.YAMLMap.prototype.has.bind(this),this.set=oI.YAMLMap.prototype.set.bind(this),this.tag=n6.tag}toJSON($,I){if(!I)return super.toJSON($);let _=new Map;if(I?.onCreate)I.onCreate(_);for(let u of this.items){let U,g;if(jN.isPair(u))U=xg.toJS(u.key,"",I),g=xg.toJS(u.value,U,I);else U=xg.toJS(u,"",I);if(_.has(U))throw Error("Ordered maps must not include duplicate keys");_.set(U,g)}return _}static from($,I,_){let u=SN.createPairs($,I,_),U=new this;return U.items=u.items,U}}n6.tag="tag:yaml.org,2002:omap";var bW={collection:"seq",identify:($)=>$ instanceof Map,nodeClass:n6,default:!1,tag:"tag:yaml.org,2002:omap",resolve($,I){let _=SN.resolvePairs($,I),u=[];for(let{key:U}of _.items)if(jN.isScalar(U))if(u.includes(U.value))I(`Ordered maps must not include duplicate keys: ${U.value}`);else u.push(U.value);return Object.assign(new n6,_)},createNode:($,I,_)=>n6.from($,I,_)};PW.YAMLOMap=n6;PW.omap=bW});var fN=S((FW)=>{var FN=R$();function wN({value:$,source:I},_){if(I&&($?EN:CN).test.test(I))return I;return $?_.options.trueStr:_.options.falseStr}var EN={identify:($)=>$===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new FN.Scalar(!0),stringify:wN},CN={identify:($)=>$===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new FN.Scalar(!1),stringify:wN};FW.falseTag=CN;FW.trueTag=EN});var xN=S((yW)=>{var CW=R$(),yg=Z1(),fW={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:($)=>$.slice(-3).toLowerCase()==="nan"?NaN:$[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:yg.stringifyNumber},xW={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:($)=>parseFloat($.replace(/_/g,"")),stringify($){let I=Number($.value);return isFinite(I)?I.toExponential():yg.stringifyNumber($)}},kW={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve($){let I=new CW.Scalar(parseFloat($.replace(/_/g,""))),_=$.indexOf(".");if(_!==-1){let u=$.substring(_+1).replace(/_/g,"");if(u[u.length-1]==="0")I.minFractionDigits=u.length}return I},stringify:yg.stringifyNumber};yW.float=kW;yW.floatExp=xW;yW.floatNaN=fW});var yN=S((dW)=>{var kN=Z1(),pI=($)=>typeof $==="bigint"||Number.isInteger($);function pU($,I,_,{intAsBigInt:u}){let U=$[0];if(U==="-"||U==="+")I+=1;if($=$.substring(I).replace(/_/g,""),u){switch(_){case 2:$=`0b${$}`;break;case 8:$=`0o${$}`;break;case 16:$=`0x${$}`;break}let z=BigInt($);return U==="-"?BigInt(-1)*z:z}let g=parseInt($,_);return U==="-"?-1*g:g}function ig($,I,_){let{value:u}=$;if(pI(u)){let U=u.toString(I);return u<0?"-"+_+U.substr(1):_+U}return kN.stringifyNumber($)}var nW={identify:pI,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:($,I,_)=>pU($,2,2,_),stringify:($)=>ig($,2,"0b")},rW={identify:pI,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:($,I,_)=>pU($,1,8,_),stringify:($)=>ig($,8,"0")},hW={identify:pI,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:($,I,_)=>pU($,0,10,_),stringify:kN.stringifyNumber},cW={identify:pI,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:($,I,_)=>pU($,2,16,_),stringify:($)=>ig($,16,"0x")};dW.int=hW;dW.intBin=nW;dW.intHex=cW;dW.intOct=rW});var lg=S((sW)=>{var eU=$$(),tU=q6(),aU=Q6();class r6 extends aU.YAMLMap{constructor($){super($);this.tag=r6.tag}add($){let I;if(eU.isPair($))I=$;else if($&&typeof $==="object"&&"key"in $&&"value"in $&&$.value===null)I=new tU.Pair($.key,null);else I=new tU.Pair($,null);if(!aU.findPair(this.items,I.key))this.items.push(I)}get($,I){let _=aU.findPair(this.items,$);return!I&&eU.isPair(_)?eU.isScalar(_.key)?_.key.value:_.key:_}set($,I){if(typeof I!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof I}`);let _=aU.findPair(this.items,$);if(_&&!I)this.items.splice(this.items.indexOf(_),1);else if(!_&&I)this.items.push(new tU.Pair($))}toJSON($,I){return super.toJSON($,I,Set)}toString($,I,_){if(!$)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},$,{allNullValues:!0}),I,_);else throw Error("Set items must all have null values")}static from($,I,_){let{replacer:u}=_,U=new this($);if(I&&Symbol.iterator in Object(I))for(let g of I){if(typeof u==="function")g=u.call(I,g,g);U.items.push(tU.createPair(g,null,_))}return U}}r6.tag="tag:yaml.org,2002:set";var eW={collection:"map",identify:($)=>$ instanceof Set,nodeClass:r6,default:!1,tag:"tag:yaml.org,2002:set",createNode:($,I,_)=>r6.from($,I,_),resolve($,I){if(eU.isMap($))if($.hasAllNullValues(!0))return Object.assign(new r6,$);else I("Set items must all have null values");else I("Expected a mapping for this tag");return $}};sW.YAMLSet=r6;sW.set=eW});var ng=S((gR)=>{var UR=Z1();function mg($,I){let _=$[0],u=_==="-"||_==="+"?$.substring(1):$,U=(z)=>I?BigInt(z):Number(z),g=u.replace(/_/g,"").split(":").reduce((z,G)=>z*U(60)+U(G),U(0));return _==="-"?U(-1)*g:g}function iN($){let{value:I}=$,_=(z)=>z;if(typeof I==="bigint")_=(z)=>BigInt(z);else if(isNaN(I)||!isFinite(I))return UR.stringifyNumber($);let u="";if(I<0)u="-",I*=_(-1);let U=_(60),g=[I%U];if(I<60)g.unshift(0);else if(I=(I-g[0])/U,g.unshift(I%U),I>=60)I=(I-g[0])/U,g.unshift(I);return u+g.map((z)=>String(z).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var _R={identify:($)=>typeof $==="bigint"||Number.isInteger($),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:($,I,{intAsBigInt:_})=>mg($,_),stringify:iN},uR={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:($)=>mg($,!1),stringify:iN},lN={identify:($)=>$ instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve($){let I=$.match(lN.test);if(!I)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,_,u,U,g,z,G]=I.map(Number),J=I[7]?Number((I[7]+"00").substr(1,3)):0,X=Date.UTC(_,u-1,U,g||0,z||0,G||0,J),N=I[8];if(N&&N!=="Z"){let q=mg(N,!1);if(Math.abs(q)<30)q*=60;X-=60000*q}return new Date(X)},stringify:({value:$})=>$?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};gR.floatTime=uR;gR.intTime=_R;gR.timestamp=lN});var nN=S((DR)=>{var XR=R1(),qR=rU(),NR=V1(),QR=cI(),HR=Cg(),mN=fN(),rg=xN(),sU=yN(),YR=fU(),OR=kg(),vR=oU(),TR=lg(),hg=ng(),MR=[XR.map,NR.seq,QR.string,qR.nullTag,mN.trueTag,mN.falseTag,sU.intBin,sU.intOct,sU.int,sU.intHex,rg.floatNaN,rg.floatExp,rg.float,HR.binary,YR.merge,OR.omap,vR.pairs,TR.set,hg.intTime,hg.floatTime,hg.timestamp];DR.schema=MR});var sN=S((bR)=>{var dN=R1(),BR=rU(),oN=V1(),KR=cI(),WR=Ag(),cg=Pg(),dg=Sg(),RR=VN(),VR=AN(),pN=Cg(),tI=fU(),tN=kg(),aN=oU(),rN=nN(),eN=lg(),$_=ng(),hN=new Map([["core",RR.schema],["failsafe",[dN.map,oN.seq,KR.string]],["json",VR.schema],["yaml11",rN.schema],["yaml-1.1",rN.schema]]),cN={binary:pN.binary,bool:WR.boolTag,float:cg.float,floatExp:cg.floatExp,floatNaN:cg.floatNaN,floatTime:$_.floatTime,int:dg.int,intHex:dg.intHex,intOct:dg.intOct,intTime:$_.intTime,map:dN.map,merge:tI.merge,null:BR.nullTag,omap:tN.omap,pairs:aN.pairs,seq:oN.seq,set:eN.set,timestamp:$_.timestamp},ZR={"tag:yaml.org,2002:binary":pN.binary,"tag:yaml.org,2002:merge":tI.merge,"tag:yaml.org,2002:omap":tN.omap,"tag:yaml.org,2002:pairs":aN.pairs,"tag:yaml.org,2002:set":eN.set,"tag:yaml.org,2002:timestamp":$_.timestamp};function AR($,I,_){let u=hN.get(I);if(u&&!$)return _&&!u.includes(tI.merge)?u.concat(tI.merge):u.slice();let U=u;if(!U)if(Array.isArray($))U=[];else{let g=Array.from(hN.keys()).filter((z)=>z!=="yaml11").map((z)=>JSON.stringify(z)).join(", ");throw Error(`Unknown schema "${I}"; use one of ${g} or define customTags array`)}if(Array.isArray($))for(let g of $)U=U.concat(g);else if(typeof $==="function")U=$(U.slice());if(_)U=U.concat(tI.merge);return U.reduce((g,z)=>{let G=typeof z==="string"?cN[z]:z;if(!G){let J=JSON.stringify(z),X=Object.keys(cN).map((N)=>JSON.stringify(N)).join(", ");throw Error(`Unknown custom tag ${J}; use one of ${X}`)}if(!g.includes(G))g.push(G);return g},[])}bR.coreKnownTags=ZR;bR.getTags=AR});var tg=S((CR)=>{var og=$$(),SR=R1(),FR=V1(),wR=cI(),I_=sN(),ER=($,I)=>$.key<I.key?-1:$.key>I.key?1:0;class pg{constructor({compat:$,customTags:I,merge:_,resolveKnownTags:u,schema:U,sortMapEntries:g,toStringDefaults:z}){this.compat=Array.isArray($)?I_.getTags($,"compat"):$?I_.getTags(null,$):null,this.name=typeof U==="string"&&U||"core",this.knownTags=u?I_.coreKnownTags:{},this.tags=I_.getTags(I,this.name,_),this.toStringOptions=z??null,Object.defineProperty(this,og.MAP,{value:SR.map}),Object.defineProperty(this,og.SCALAR,{value:wR.string}),Object.defineProperty(this,og.SEQ,{value:FR.seq}),this.sortMapEntries=typeof g==="function"?g:g===!0?ER:null}clone(){let $=Object.create(pg.prototype,Object.getOwnPropertyDescriptors(this));return $.tags=this.tags.slice(),$}}CR.Schema=pg});var $Q=S((yR)=>{var xR=$$(),ag=mI(),aI=yI();function kR($,I){let _=[],u=I.directives===!0;if(I.directives!==!1&&$.directives){let J=$.directives.toString($);if(J)_.push(J),u=!0;else if($.directives.docStart)u=!0}if(u)_.push("---");let U=ag.createStringifyContext($,I),{commentString:g}=U.options;if($.commentBefore){if(_.length!==1)_.unshift("");let J=g($.commentBefore);_.unshift(aI.indentComment(J,""))}let z=!1,G=null;if($.contents){if(xR.isNode($.contents)){if($.contents.spaceBefore&&u)_.push("");if($.contents.commentBefore){let N=g($.contents.commentBefore);_.push(aI.indentComment(N,""))}U.forceBlockIndent=!!$.comment,G=$.contents.comment}let J=G?void 0:()=>z=!0,X=ag.stringify($.contents,U,()=>G=null,J);if(G)X+=aI.lineComment(X,"",g(G));if((X[0]==="|"||X[0]===">")&&_[_.length-1]==="---")_[_.length-1]=`--- ${X}`;else _.push(X)}else _.push(ag.stringify($.contents,U));if($.directives?.docEnd)if($.comment){let J=g($.comment);if(J.includes(`
|
|
81
|
+
`))_.push("..."),_.push(aI.indentComment(J,""));else _.push(`... ${J}`)}else _.push("...");else{let J=$.comment;if(J&&z)J=J.replace(/^\n+/,"");if(J){if((!z||G)&&_[_.length-1]!=="")_.push("");_.push(aI.indentComment(g(J),""))}}return _.join(`
|
|
82
82
|
`)+`
|
|
83
|
-
`}
|
|
83
|
+
`}yR.stringifyDocument=kR});var eI=S((oR)=>{var lR=xI(),A1=jU(),X4=$$(),mR=q6(),nR=G6(),rR=tg(),hR=$Q(),eg=AU(),cR=Tg(),dR=kI(),sg=vg();class $z{constructor($,I,_){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,X4.NODE_TYPE,{value:X4.DOC});let u=null;if(typeof I==="function"||Array.isArray(I))u=I;else if(_===void 0&&I)_=I,I=void 0;let U=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},_);this.options=U;let{version:g}=U;if(_?._directives){if(this.directives=_._directives.atDocument(),this.directives.yaml.explicit)g=this.directives.yaml.version}else this.directives=new sg.Directives({version:g});this.setSchema(g,_),this.contents=$===void 0?null:this.createNode($,u,_)}clone(){let $=Object.create($z.prototype,{[X4.NODE_TYPE]:{value:X4.DOC}});if($.commentBefore=this.commentBefore,$.comment=this.comment,$.errors=this.errors.slice(),$.warnings=this.warnings.slice(),$.options=Object.assign({},this.options),this.directives)$.directives=this.directives.clone();if($.schema=this.schema.clone(),$.contents=X4.isNode(this.contents)?this.contents.clone($.schema):this.contents,this.range)$.range=this.range.slice();return $}add($){if(b1(this.contents))this.contents.add($)}addIn($,I){if(b1(this.contents))this.contents.addIn($,I)}createAlias($,I){if(!$.anchor){let _=eg.anchorNames(this);$.anchor=!I||_.has(I)?eg.findNewAnchor(I||"a",_):I}return new lR.Alias($.anchor)}createNode($,I,_){let u=void 0;if(typeof I==="function")$=I.call({"":$},"",$),u=I;else if(Array.isArray(I)){let H=(T)=>typeof T==="number"||T instanceof String||T instanceof Number,v=I.filter(H).map(String);if(v.length>0)I=I.concat(v);u=I}else if(_===void 0&&I)_=I,I=void 0;let{aliasDuplicateObjects:U,anchorPrefix:g,flow:z,keepUndefined:G,onTagObj:J,tag:X}=_??{},{onAnchor:N,setAnchors:q,sourceObjects:Q}=eg.createNodeAnchors(this,g||"a"),Y={aliasDuplicateObjects:U??!0,keepUndefined:G??!1,onAnchor:N,onTagObj:J,replacer:u,schema:this.schema,sourceObjects:Q},O=dR.createNode($,X,Y);if(z&&X4.isCollection(O))O.flow=!0;return q(),O}createPair($,I,_={}){let u=this.createNode($,null,_),U=this.createNode(I,null,_);return new mR.Pair(u,U)}delete($){return b1(this.contents)?this.contents.delete($):!1}deleteIn($){if(A1.isEmptyPath($)){if(this.contents==null)return!1;return this.contents=null,!0}return b1(this.contents)?this.contents.deleteIn($):!1}get($,I){return X4.isCollection(this.contents)?this.contents.get($,I):void 0}getIn($,I){if(A1.isEmptyPath($))return!I&&X4.isScalar(this.contents)?this.contents.value:this.contents;return X4.isCollection(this.contents)?this.contents.getIn($,I):void 0}has($){return X4.isCollection(this.contents)?this.contents.has($):!1}hasIn($){if(A1.isEmptyPath($))return this.contents!==void 0;return X4.isCollection(this.contents)?this.contents.hasIn($):!1}set($,I){if(this.contents==null)this.contents=A1.collectionFromPath(this.schema,[$],I);else if(b1(this.contents))this.contents.set($,I)}setIn($,I){if(A1.isEmptyPath($))this.contents=I;else if(this.contents==null)this.contents=A1.collectionFromPath(this.schema,Array.from($),I);else if(b1(this.contents))this.contents.setIn($,I)}setSchema($,I={}){if(typeof $==="number")$=String($);let _;switch($){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new sg.Directives({version:"1.1"});_={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=$;else this.directives=new sg.Directives({version:$});_={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;_=null;break;default:{let u=JSON.stringify($);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${u}`)}}if(I.schema instanceof Object)this.schema=I.schema;else if(_)this.schema=new rR.Schema(Object.assign(_,I));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:$,jsonArg:I,mapAsMap:_,maxAliasCount:u,onAnchor:U,reviver:g}={}){let z={anchors:new Map,doc:this,keep:!$,mapAsMap:_===!0,mapKeyWarned:!1,maxAliasCount:typeof u==="number"?u:100},G=nR.toJS(this.contents,I??"",z);if(typeof U==="function")for(let{count:J,res:X}of z.anchors.values())U(X,J);return typeof g==="function"?cR.applyReviver(g,{"":G},"",G):G}toJSON($,I){return this.toJS({json:!0,jsonArg:$,mapAsMap:!1,onAnchor:I})}toString($={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in $&&(!Number.isInteger($.indent)||Number($.indent)<=0)){let I=JSON.stringify($.indent);throw Error(`"indent" option must be a positive integer, not ${I}`)}return hR.stringifyDocument(this,$)}}function b1($){if(X4.isCollection($))return!0;throw Error("Expected a YAML collection as document contents")}oR.Document=$z});var sI=S((aR)=>{class U_ extends Error{constructor($,I,_,u){super();this.name=$,this.code=_,this.message=u,this.pos=I}}class IQ extends U_{constructor($,I,_){super("YAMLParseError",$,I,_)}}class UQ extends U_{constructor($,I,_){super("YAMLWarning",$,I,_)}}var tR=($,I)=>(_)=>{if(_.pos[0]===-1)return;_.linePos=_.pos.map((G)=>I.linePos(G));let{line:u,col:U}=_.linePos[0];_.message+=` at line ${u}, column ${U}`;let g=U-1,z=$.substring(I.lineStarts[u-1],I.lineStarts[u]).replace(/[\n\r]+$/,"");if(g>=60&&z.length>80){let G=Math.min(g-39,z.length-79);z="…"+z.substring(G),g-=G-1}if(z.length>80)z=z.substring(0,79)+"…";if(u>1&&/^ *$/.test(z.substring(0,g))){let G=$.substring(I.lineStarts[u-2],I.lineStarts[u-1]);if(G.length>80)G=G.substring(0,79)+`…
|
|
84
84
|
`;z=G+z}if(/[^ ]/.test(z)){let G=1,J=_.linePos[1];if(J?.line===u&&J.col>U)G=Math.max(1,Math.min(J.col-U,80-g));let X=" ".repeat(g)+"^".repeat(G);_.message+=`:
|
|
85
85
|
|
|
86
86
|
${z}
|
|
87
87
|
${X}
|
|
88
|
-
`}};
|
|
89
|
-
`))return!0;if($.end){for(let I of $.end)if(I.type==="newline")return!0}return!1;case"flow-collection":for(let I of $.items){for(let _ of I.start)if(_.type==="newline")return!0;if(I.sep){for(let _ of I.sep)if(_.type==="newline")return!0}if(
|
|
90
|
-
`+H.comment;else G.comment=H.comment;continue}if(H.newlineAfterProp||
|
|
91
|
-
`+
|
|
92
|
-
`+
|
|
93
|
-
`+
|
|
94
|
-
`+E.comment;else
|
|
95
|
-
`+v.comment;else X.comment=v.comment;X.range=[u.offset,H,v.offset]}else X.range=[u.offset,H,H];return X}
|
|
88
|
+
`}};aR.YAMLError=U_;aR.YAMLParseError=IQ;aR.YAMLWarning=UQ;aR.prettifyError=tR});var $0=S((_V)=>{function UV($,{flow:I,indicator:_,next:u,offset:U,onError:g,parentIndent:z,startOnNewline:G}){let J=!1,X=G,N=G,q="",Q="",Y=!1,O=!1,H=null,v=null,T=null,K=null,D=null,B=null,R=null;for(let W of $){if(O){if(W.type!=="space"&&W.type!=="newline"&&W.type!=="comma")g(W.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");O=!1}if(H){if(X&&W.type!=="comment"&&W.type!=="newline")g(H,"TAB_AS_INDENT","Tabs are not allowed as indentation");H=null}switch(W.type){case"space":if(!I&&(_!=="doc-start"||u?.type!=="flow-collection")&&W.source.includes("\t"))H=W;N=!0;break;case"comment":{if(!N)g(W,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let E=W.source.substring(1)||" ";if(!q)q=E;else q+=Q+E;Q="",X=!1;break}case"newline":if(X){if(q)q+=W.source;else if(!B||_!=="seq-item-ind")J=!0}else Q+=W.source;if(X=!0,Y=!0,v||T)K=W;N=!0;break;case"anchor":if(v)g(W,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(W.source.endsWith(":"))g(W.offset+W.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);v=W,R??(R=W.offset),X=!1,N=!1,O=!0;break;case"tag":{if(T)g(W,"MULTIPLE_TAGS","A node can have at most one tag");T=W,R??(R=W.offset),X=!1,N=!1,O=!0;break}case _:if(v||T)g(W,"BAD_PROP_ORDER",`Anchors and tags must be after the ${W.source} indicator`);if(B)g(W,"UNEXPECTED_TOKEN",`Unexpected ${W.source} in ${I??"collection"}`);B=W,X=_==="seq-item-ind"||_==="explicit-key-ind",N=!1;break;case"comma":if(I){if(D)g(W,"UNEXPECTED_TOKEN",`Unexpected , in ${I}`);D=W,X=!1,N=!1;break}default:g(W,"UNEXPECTED_TOKEN",`Unexpected ${W.type} token`),X=!1,N=!1}}let V=$[$.length-1],M=V?V.offset+V.source.length:U;if(O&&u&&u.type!=="space"&&u.type!=="newline"&&u.type!=="comma"&&(u.type!=="scalar"||u.source!==""))g(u.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(H&&(X&&H.indent<=z||u?.type==="block-map"||u?.type==="block-seq"))g(H,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:D,found:B,spaceBefore:J,comment:q,hasNewline:Y,anchor:v,tag:T,newlineAfterProp:K,end:M,start:R??M}}_V.resolveProps=UV});var __=S((gV)=>{function Iz($){if(!$)return null;switch($.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if($.source.includes(`
|
|
89
|
+
`))return!0;if($.end){for(let I of $.end)if(I.type==="newline")return!0}return!1;case"flow-collection":for(let I of $.items){for(let _ of I.start)if(_.type==="newline")return!0;if(I.sep){for(let _ of I.sep)if(_.type==="newline")return!0}if(Iz(I.key)||Iz(I.value))return!0}return!1;default:return!0}}gV.containsNewline=Iz});var Uz=S((XV)=>{var GV=__();function JV($,I,_){if(I?.type==="flow-collection"){let u=I.end[0];if(u.indent===$&&(u.source==="]"||u.source==="}")&&GV.containsNewline(I))_(u,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}XV.flowIndentCheck=JV});var _z=S((QV)=>{var _Q=$$();function NV($,I,_){let{uniqueKeys:u}=$.options;if(u===!1)return!1;let U=typeof u==="function"?u:(g,z)=>g===z||_Q.isScalar(g)&&_Q.isScalar(z)&&g.value===z.value;return I.some((g)=>U(g.key,_))}QV.mapIncludes=NV});var JQ=S((MV)=>{var uQ=q6(),YV=Q6(),gQ=$0(),OV=__(),zQ=Uz(),vV=_z(),GQ="All mapping items must start at the same column";function TV({composeNode:$,composeEmptyNode:I},_,u,U,g){let G=new(g?.nodeClass??YV.YAMLMap)(_.schema);if(_.atRoot)_.atRoot=!1;let J=u.offset,X=null;for(let N of u.items){let{start:q,key:Q,sep:Y,value:O}=N,H=gQ.resolveProps(q,{indicator:"explicit-key-ind",next:Q??Y?.[0],offset:J,onError:U,parentIndent:u.indent,startOnNewline:!0}),v=!H.found;if(v){if(Q){if(Q.type==="block-seq")U(J,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in Q&&Q.indent!==u.indent)U(J,"BAD_INDENT",GQ)}if(!H.anchor&&!H.tag&&!Y){if(X=H.end,H.comment)if(G.comment)G.comment+=`
|
|
90
|
+
`+H.comment;else G.comment=H.comment;continue}if(H.newlineAfterProp||OV.containsNewline(Q))U(Q??q[q.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(H.found?.indent!==u.indent)U(J,"BAD_INDENT",GQ);_.atKey=!0;let T=H.end,K=Q?$(_,Q,H,U):I(_,T,q,null,H,U);if(_.schema.compat)zQ.flowIndentCheck(u.indent,Q,U);if(_.atKey=!1,vV.mapIncludes(_,G.items,K))U(T,"DUPLICATE_KEY","Map keys must be unique");let D=gQ.resolveProps(Y??[],{indicator:"map-value-ind",next:O,offset:K.range[2],onError:U,parentIndent:u.indent,startOnNewline:!Q||Q.type==="block-scalar"});if(J=D.end,D.found){if(v){if(O?.type==="block-map"&&!D.hasNewline)U(J,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(_.options.strict&&H.start<D.found.offset-1024)U(K.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let B=O?$(_,O,D,U):I(_,J,Y,null,D,U);if(_.schema.compat)zQ.flowIndentCheck(u.indent,O,U);J=B.range[2];let R=new uQ.Pair(K,B);if(_.options.keepSourceTokens)R.srcToken=N;G.items.push(R)}else{if(v)U(K.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(D.comment)if(K.comment)K.comment+=`
|
|
91
|
+
`+D.comment;else K.comment=D.comment;let B=new uQ.Pair(K);if(_.options.keepSourceTokens)B.srcToken=N;G.items.push(B)}}if(X&&X<J)U(X,"IMPOSSIBLE","Map comment with trailing content");return G.range=[u.offset,J,X??J],G}MV.resolveBlockMap=TV});var XQ=S((RV)=>{var LV=H6(),BV=$0(),KV=Uz();function WV({composeNode:$,composeEmptyNode:I},_,u,U,g){let G=new(g?.nodeClass??LV.YAMLSeq)(_.schema);if(_.atRoot)_.atRoot=!1;if(_.atKey)_.atKey=!1;let J=u.offset,X=null;for(let{start:N,value:q}of u.items){let Q=BV.resolveProps(N,{indicator:"seq-item-ind",next:q,offset:J,onError:U,parentIndent:u.indent,startOnNewline:!0});if(!Q.found)if(Q.anchor||Q.tag||q)if(q?.type==="block-seq")U(Q.end,"BAD_INDENT","All sequence items must start at the same column");else U(J,"MISSING_CHAR","Sequence item without - indicator");else{if(X=Q.end,Q.comment)G.comment=Q.comment;continue}let Y=q?$(_,q,Q,U):I(_,Q.end,N,null,Q,U);if(_.schema.compat)KV.flowIndentCheck(u.indent,q,U);J=Y.range[2],G.items.push(Y)}return G.range=[u.offset,J,X??J],G}RV.resolveBlockSeq=WV});var P1=S((AV)=>{function ZV($,I,_,u){let U="";if($){let g=!1,z="";for(let G of $){let{source:J,type:X}=G;switch(X){case"space":g=!0;break;case"comment":{if(_&&!g)u(G,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let N=J.substring(1)||" ";if(!U)U=N;else U+=z+N;z="";break}case"newline":if(U)z+=J;g=!0;break;default:u(G,"UNEXPECTED_TOKEN",`Unexpected ${X} at node end`)}I+=J.length}}return{comment:U,offset:I}}AV.resolveEnd=ZV});var QQ=S((fV)=>{var PV=$$(),jV=q6(),qQ=Q6(),SV=H6(),FV=P1(),NQ=$0(),wV=__(),EV=_z(),uz="Block collections are not allowed within flow collections",gz=($)=>$&&($.type==="block-map"||$.type==="block-seq");function CV({composeNode:$,composeEmptyNode:I},_,u,U,g){let z=u.start.source==="{",G=z?"flow map":"flow sequence",X=new(g?.nodeClass??(z?qQ.YAMLMap:SV.YAMLSeq))(_.schema);X.flow=!0;let N=_.atRoot;if(N)_.atRoot=!1;if(_.atKey)_.atKey=!1;let q=u.offset+u.start.source.length;for(let v=0;v<u.items.length;++v){let T=u.items[v],{start:K,key:D,sep:B,value:R}=T,V=NQ.resolveProps(K,{flow:G,indicator:"explicit-key-ind",next:D??B?.[0],offset:q,onError:U,parentIndent:u.indent,startOnNewline:!1});if(!V.found){if(!V.anchor&&!V.tag&&!B&&!R){if(v===0&&V.comma)U(V.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${G}`);else if(v<u.items.length-1)U(V.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${G}`);if(V.comment)if(X.comment)X.comment+=`
|
|
92
|
+
`+V.comment;else X.comment=V.comment;q=V.end;continue}if(!z&&_.options.strict&&wV.containsNewline(D))U(D,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(v===0){if(V.comma)U(V.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${G}`)}else{if(!V.comma)U(V.start,"MISSING_CHAR",`Missing , between ${G} items`);if(V.comment){let M="";$:for(let W of K)switch(W.type){case"comma":case"space":break;case"comment":M=W.source.substring(1);break $;default:break $}if(M){let W=X.items[X.items.length-1];if(PV.isPair(W))W=W.value??W.key;if(W.comment)W.comment+=`
|
|
93
|
+
`+M;else W.comment=M;V.comment=V.comment.substring(M.length+1)}}}if(!z&&!B&&!V.found){let M=R?$(_,R,V,U):I(_,V.end,B,null,V,U);if(X.items.push(M),q=M.range[2],gz(R))U(M.range,"BLOCK_IN_FLOW",uz)}else{_.atKey=!0;let M=V.end,W=D?$(_,D,V,U):I(_,M,K,null,V,U);if(gz(D))U(W.range,"BLOCK_IN_FLOW",uz);_.atKey=!1;let E=NQ.resolveProps(B??[],{flow:G,indicator:"map-value-ind",next:R,offset:W.range[2],onError:U,parentIndent:u.indent,startOnNewline:!1});if(E.found){if(!z&&!V.found&&_.options.strict){if(B)for(let w of B){if(w===E.found)break;if(w.type==="newline"){U(w,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(V.start<E.found.offset-1024)U(E.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(R)if("source"in R&&R.source?.[0]===":")U(R,"MISSING_CHAR",`Missing space after : in ${G}`);else U(E.start,"MISSING_CHAR",`Missing , or : between ${G} items`);let C=R?$(_,R,E,U):E.found?I(_,E.end,B,null,E,U):null;if(C){if(gz(R))U(C.range,"BLOCK_IN_FLOW",uz)}else if(E.comment)if(W.comment)W.comment+=`
|
|
94
|
+
`+E.comment;else W.comment=E.comment;let k=new jV.Pair(W,C);if(_.options.keepSourceTokens)k.srcToken=T;if(z){let w=X;if(EV.mapIncludes(_,w.items,W))U(M,"DUPLICATE_KEY","Map keys must be unique");w.items.push(k)}else{let w=new qQ.YAMLMap(_.schema);w.flow=!0,w.items.push(k);let X$=(C??W).range;w.range=[W.range[0],X$[1],X$[2]],X.items.push(w)}q=C?C.range[2]:E.end}}let Q=z?"}":"]",[Y,...O]=u.end,H=q;if(Y?.source===Q)H=Y.offset+Y.source.length;else{let v=G[0].toUpperCase()+G.substring(1),T=N?`${v} must end with a ${Q}`:`${v} in block collection must be sufficiently indented and end with a ${Q}`;if(U(q,N?"MISSING_CHAR":"BAD_INDENT",T),Y&&Y.source.length!==1)O.unshift(Y)}if(O.length>0){let v=FV.resolveEnd(O,H,_.options.strict,U);if(v.comment)if(X.comment)X.comment+=`
|
|
95
|
+
`+v.comment;else X.comment=v.comment;X.range=[u.offset,H,v.offset]}else X.range=[u.offset,H,H];return X}fV.resolveFlowCollection=CV});var HQ=S((cV)=>{var kV=$$(),yV=R$(),iV=Q6(),lV=H6(),mV=JQ(),nV=XQ(),rV=QQ();function zz($,I,_,u,U,g){let z=_.type==="block-map"?mV.resolveBlockMap($,I,_,u,g):_.type==="block-seq"?nV.resolveBlockSeq($,I,_,u,g):rV.resolveFlowCollection($,I,_,u,g),G=z.constructor;if(U==="!"||U===G.tagName)return z.tag=G.tagName,z;if(U)z.tag=U;return z}function hV($,I,_,u,U){let g=u.tag,z=!g?null:I.directives.tagName(g.source,(Q)=>U(g,"TAG_RESOLVE_FAILED",Q));if(_.type==="block-seq"){let{anchor:Q,newlineAfterProp:Y}=u,O=Q&&g?Q.offset>g.offset?Q:g:Q??g;if(O&&(!Y||Y.offset<O.offset))U(O,"MISSING_CHAR","Missing newline after block sequence props")}let G=_.type==="block-map"?"map":_.type==="block-seq"?"seq":_.start.source==="{"?"map":"seq";if(!g||!z||z==="!"||z===iV.YAMLMap.tagName&&G==="map"||z===lV.YAMLSeq.tagName&&G==="seq")return zz($,I,_,U,z);let J=I.schema.tags.find((Q)=>Q.tag===z&&Q.collection===G);if(!J){let Q=I.schema.knownTags[z];if(Q?.collection===G)I.schema.tags.push(Object.assign({},Q,{default:!1})),J=Q;else{if(Q)U(g,"BAD_COLLECTION_TYPE",`${Q.tag} used for ${G} collection, but expects ${Q.collection??"scalar"}`,!0);else U(g,"TAG_RESOLVE_FAILED",`Unresolved tag: ${z}`,!0);return zz($,I,_,U,z)}}let X=zz($,I,_,U,z,J),N=J.resolve?.(X,(Q)=>U(g,"TAG_RESOLVE_FAILED",Q),I.options)??X,q=kV.isNode(N)?N:new yV.Scalar(N);if(q.range=X.range,q.tag=z,J?.format)q.format=J.format;return q}cV.composeCollection=hV});var Jz=S((aV)=>{var Gz=R$();function oV($,I,_){let u=I.offset,U=pV(I,$.options.strict,_);if(!U)return{value:"",type:null,comment:"",range:[u,u,u]};let g=U.mode===">"?Gz.Scalar.BLOCK_FOLDED:Gz.Scalar.BLOCK_LITERAL,z=I.source?tV(I.source):[],G=z.length;for(let H=z.length-1;H>=0;--H){let v=z[H][1];if(v===""||v==="\r")G=H;else break}if(G===0){let H=U.chomp==="+"&&z.length>0?`
|
|
96
96
|
`.repeat(Math.max(1,z.length-1)):"",v=u+U.length;if(I.source)v+=I.source.length;return{value:H,type:g,comment:U.comment,range:[u,v,v]}}let J=I.indent+U.indent,X=I.offset+U.length,N=0;for(let H=0;H<G;++H){let[v,T]=z[H];if(T===""||T==="\r"){if(U.indent===0&&v.length>J)J=v.length}else{if(v.length<J)_(X+v.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(U.indent===0)J=v.length;if(N=H,J===0&&!$.atRoot)_(X,"BAD_INDENT","Block scalar values in collections must be indented");break}X+=v.length+T.length+1}for(let H=z.length-1;H>=G;--H)if(z[H][0].length>J)G=H+1;let q="",Q="",Y=!1;for(let H=0;H<N;++H)q+=z[H][0].slice(J)+`
|
|
97
|
-
`;for(let H=N;H<G;++H){let[v,T]=z[H];X+=v.length+T.length+1;let K=T[T.length-1]==="\r";if(K)T=T.slice(0,-1);if(T&&v.length<J){let B=`Block scalar lines must not be less indented than their ${U.indent?"explicit indentation indicator":"first line"}`;_(X-T.length-(K?2:1),"BAD_INDENT",B),v=""}if(g===
|
|
97
|
+
`;for(let H=N;H<G;++H){let[v,T]=z[H];X+=v.length+T.length+1;let K=T[T.length-1]==="\r";if(K)T=T.slice(0,-1);if(T&&v.length<J){let B=`Block scalar lines must not be less indented than their ${U.indent?"explicit indentation indicator":"first line"}`;_(X-T.length-(K?2:1),"BAD_INDENT",B),v=""}if(g===Gz.Scalar.BLOCK_LITERAL)q+=Q+v.slice(J)+T,Q=`
|
|
98
98
|
`;else if(v.length>J||T[0]==="\t"){if(Q===" ")Q=`
|
|
99
99
|
`;else if(!Y&&Q===`
|
|
100
100
|
`)Q=`
|
|
@@ -107,172 +107,172 @@ ${X}
|
|
|
107
107
|
`+z[H][0].slice(J);if(q[q.length-1]!==`
|
|
108
108
|
`)q+=`
|
|
109
109
|
`;break;default:q+=`
|
|
110
|
-
`}let O=u+U.length+I.source.length;return{value:q,type:g,comment:U.comment,range:[u,O,O]}}function
|
|
110
|
+
`}let O=u+U.length+I.source.length;return{value:q,type:g,comment:U.comment,range:[u,O,O]}}function pV({offset:$,props:I},_,u){if(I[0].type!=="block-scalar-header")return u(I[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:U}=I[0],g=U[0],z=0,G="",J=-1;for(let Q=1;Q<U.length;++Q){let Y=U[Q];if(!G&&(Y==="-"||Y==="+"))G=Y;else{let O=Number(Y);if(!z&&O)z=O;else if(J===-1)J=$+Q}}if(J!==-1)u(J,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${U}`);let X=!1,N="",q=U.length;for(let Q=1;Q<I.length;++Q){let Y=I[Q];switch(Y.type){case"space":X=!0;case"newline":q+=Y.source.length;break;case"comment":if(_&&!X)u(Y,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");q+=Y.source.length,N=Y.source.substring(1);break;case"error":u(Y,"UNEXPECTED_TOKEN",Y.message),q+=Y.source.length;break;default:{let O=`Unexpected token in block scalar header: ${Y.type}`;u(Y,"UNEXPECTED_TOKEN",O);let H=Y.source;if(H&&typeof H==="string")q+=H.length}}}return{mode:g,indent:z,chomp:G,comment:N,length:q}}function tV($){let I=$.split(/\n( *)/),_=I[0],u=_.match(/^( *)/),g=[u?.[1]?[u[1],_.slice(u[1].length)]:["",_]];for(let z=1;z<I.length;z+=2)g.push([I[z],I[z+1]]);return g}aV.resolveBlockScalar=oV});var qz=S((GZ)=>{var Xz=R$(),sV=P1();function $Z($,I,_){let{offset:u,type:U,source:g,end:z}=$,G,J,X=(Q,Y,O)=>_(u+Q,Y,O);switch(U){case"scalar":G=Xz.Scalar.PLAIN,J=IZ(g,X);break;case"single-quoted-scalar":G=Xz.Scalar.QUOTE_SINGLE,J=UZ(g,X);break;case"double-quoted-scalar":G=Xz.Scalar.QUOTE_DOUBLE,J=_Z(g,X);break;default:return _($,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${U}`),{value:"",type:null,comment:"",range:[u,u+g.length,u+g.length]}}let N=u+g.length,q=sV.resolveEnd(z,N,I,_);return{value:J,type:G,comment:q.comment,range:[u,N,q.offset]}}function IZ($,I){let _="";switch($[0]){case"\t":_="a tab character";break;case",":_="flow indicator character ,";break;case"%":_="directive indicator character %";break;case"|":case">":{_=`block scalar indicator ${$[0]}`;break}case"@":case"`":{_=`reserved character ${$[0]}`;break}}if(_)I(0,"BAD_SCALAR_START",`Plain value cannot start with ${_}`);return YQ($)}function UZ($,I){if($[$.length-1]!=="'"||$.length===1)I($.length,"MISSING_CHAR","Missing closing 'quote");return YQ($.slice(1,-1)).replace(/''/g,"'")}function YQ($){let I,_;try{I=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
111
111
|
`,"sy"),_=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
112
112
|
`,"sy")}catch{I=/(.*?)[ \t]*\r?\n/sy,_=/[ \t]*(.*?)[ \t]*\r?\n/sy}let u=I.exec($);if(!u)return $;let U=u[1],g=" ",z=I.lastIndex;_.lastIndex=z;while(u=_.exec($)){if(u[1]==="")if(g===`
|
|
113
113
|
`)U+=g;else g=`
|
|
114
|
-
`;else U+=g+u[1],g=" ";z=_.lastIndex}let G=/[ \t]*(.*)/sy;return G.lastIndex=z,u=G.exec($),U+g+(u?.[1]??"")}function
|
|
114
|
+
`;else U+=g+u[1],g=" ";z=_.lastIndex}let G=/[ \t]*(.*)/sy;return G.lastIndex=z,u=G.exec($),U+g+(u?.[1]??"")}function _Z($,I){let _="";for(let u=1;u<$.length-1;++u){let U=$[u];if(U==="\r"&&$[u+1]===`
|
|
115
115
|
`)continue;if(U===`
|
|
116
|
-
`){let{fold:g,offset:z}=
|
|
116
|
+
`){let{fold:g,offset:z}=uZ($,u);_+=g,u=z}else if(U==="\\"){let g=$[++u],z=gZ[g];if(z)_+=z;else if(g===`
|
|
117
117
|
`){g=$[u+1];while(g===" "||g==="\t")g=$[++u+1]}else if(g==="\r"&&$[u+1]===`
|
|
118
|
-
`){g=$[++u+1];while(g===" "||g==="\t")g=$[++u+1]}else if(g==="x"||g==="u"||g==="U"){let G={x:2,u:4,U:8}[g];_+=
|
|
118
|
+
`){g=$[++u+1];while(g===" "||g==="\t")g=$[++u+1]}else if(g==="x"||g==="u"||g==="U"){let G={x:2,u:4,U:8}[g];_+=zZ($,u+1,G,I),u+=G}else{let G=$.substr(u-1,2);I(u-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${G}`),_+=G}}else if(U===" "||U==="\t"){let g=u,z=$[u+1];while(z===" "||z==="\t")z=$[++u+1];if(z!==`
|
|
119
119
|
`&&!(z==="\r"&&$[u+2]===`
|
|
120
|
-
`))_+=u>g?$.slice(g,u+1):U}else _+=U}if($[$.length-1]!=='"'||$.length===1)I($.length,"MISSING_CHAR",'Missing closing "quote');return _}function
|
|
120
|
+
`))_+=u>g?$.slice(g,u+1):U}else _+=U}if($[$.length-1]!=='"'||$.length===1)I($.length,"MISSING_CHAR",'Missing closing "quote');return _}function uZ($,I){let _="",u=$[I+1];while(u===" "||u==="\t"||u===`
|
|
121
121
|
`||u==="\r"){if(u==="\r"&&$[I+2]!==`
|
|
122
122
|
`)break;if(u===`
|
|
123
123
|
`)_+=`
|
|
124
|
-
`;I+=1,u=$[I+1]}if(!_)_=" ";return{fold:_,offset:I}}var
|
|
125
|
-
`,r:"\r",t:"\t",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function
|
|
124
|
+
`;I+=1,u=$[I+1]}if(!_)_=" ";return{fold:_,offset:I}}var gZ={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
125
|
+
`,r:"\r",t:"\t",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function zZ($,I,_,u){let U=$.substr(I,_),z=U.length===_&&/^[0-9a-fA-F]+$/.test(U)?parseInt(U,16):NaN;if(isNaN(z)){let G=$.substr(I-2,_+2);return u(I-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${G}`),G}return String.fromCodePoint(z)}GZ.resolveFlowScalar=$Z});var vQ=S((YZ)=>{var h6=$$(),OQ=R$(),XZ=Jz(),qZ=qz();function NZ($,I,_,u){let{value:U,type:g,comment:z,range:G}=I.type==="block-scalar"?XZ.resolveBlockScalar($,I,u):qZ.resolveFlowScalar(I,$.options.strict,u),J=_?$.directives.tagName(_.source,(q)=>u(_,"TAG_RESOLVE_FAILED",q)):null,X;if($.options.stringKeys&&$.atKey)X=$.schema[h6.SCALAR];else if(J)X=QZ($.schema,U,J,_,u);else if(I.type==="scalar")X=HZ($,U,I,u);else X=$.schema[h6.SCALAR];let N;try{let q=X.resolve(U,(Q)=>u(_??I,"TAG_RESOLVE_FAILED",Q),$.options);N=h6.isScalar(q)?q:new OQ.Scalar(q)}catch(q){let Q=q instanceof Error?q.message:String(q);u(_??I,"TAG_RESOLVE_FAILED",Q),N=new OQ.Scalar(U)}if(N.range=G,N.source=U,g)N.type=g;if(J)N.tag=J;if(X.format)N.format=X.format;if(z)N.comment=z;return N}function QZ($,I,_,u,U){if(_==="!")return $[h6.SCALAR];let g=[];for(let G of $.tags)if(!G.collection&&G.tag===_)if(G.default&&G.test)g.push(G);else return G;for(let G of g)if(G.test?.test(I))return G;let z=$.knownTags[_];if(z&&!z.collection)return $.tags.push(Object.assign({},z,{default:!1,test:void 0})),z;return U(u,"TAG_RESOLVE_FAILED",`Unresolved tag: ${_}`,_!=="tag:yaml.org,2002:str"),$[h6.SCALAR]}function HZ({atKey:$,directives:I,schema:_},u,U,g){let z=_.tags.find((G)=>(G.default===!0||$&&G.default==="key")&&G.test?.test(u))||_[h6.SCALAR];if(_.compat){let G=_.compat.find((J)=>J.default&&J.test?.test(u))??_[h6.SCALAR];if(z.tag!==G.tag){let J=I.tagString(z.tag),X=I.tagString(G.tag),N=`Value may be parsed as either ${J} or ${X}`;g(U,"TAG_RESOLVE_FAILED",N,!0)}}return z}YZ.composeScalar=NZ});var TQ=S((TZ)=>{function vZ($,I,_){if(I){_??(_=I.length);for(let u=_-1;u>=0;--u){let U=I[u];switch(U.type){case"space":case"comment":case"newline":$-=U.source.length;continue}U=I[++u];while(U?.type==="space")$+=U.source.length,U=I[++u];break}}return $}TZ.emptyScalarPosition=vZ});var LQ=S((ZZ)=>{var DZ=xI(),LZ=$$(),BZ=HQ(),MQ=vQ(),KZ=P1(),WZ=TQ(),RZ={composeNode:DQ,composeEmptyNode:Nz};function DQ($,I,_,u){let U=$.atKey,{spaceBefore:g,comment:z,anchor:G,tag:J}=_,X,N=!0;switch(I.type){case"alias":if(X=VZ($,I,u),G||J)u(I,"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(X=MQ.composeScalar($,I,J,u),G)X.anchor=G.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":if(X=BZ.composeCollection(RZ,$,I,_,u),G)X.anchor=G.source.substring(1);break;default:{let q=I.type==="error"?I.message:`Unsupported token (type: ${I.type})`;u(I,"UNEXPECTED_TOKEN",q),X=Nz($,I.offset,void 0,null,_,u),N=!1}}if(G&&X.anchor==="")u(G,"BAD_ALIAS","Anchor cannot be an empty string");if(U&&$.options.stringKeys&&(!LZ.isScalar(X)||typeof X.value!=="string"||X.tag&&X.tag!=="tag:yaml.org,2002:str"))u(J??I,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(g)X.spaceBefore=!0;if(z)if(I.type==="scalar"&&I.source==="")X.comment=z;else X.commentBefore=z;if($.options.keepSourceTokens&&N)X.srcToken=I;return X}function Nz($,I,_,u,{spaceBefore:U,comment:g,anchor:z,tag:G,end:J},X){let N={type:"scalar",offset:WZ.emptyScalarPosition(I,_,u),indent:-1,source:""},q=MQ.composeScalar($,N,G,X);if(z){if(q.anchor=z.source.substring(1),q.anchor==="")X(z,"BAD_ALIAS","Anchor cannot be an empty string")}if(U)q.spaceBefore=!0;if(g)q.comment=g,q.range[2]=J;return q}function VZ({options:$},{offset:I,source:_,end:u},U){let g=new DZ.Alias(_.substring(1));if(g.source==="")U(I,"BAD_ALIAS","Alias cannot be an empty string");if(g.source.endsWith(":"))U(I+_.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let z=I+_.length,G=KZ.resolveEnd(u,z,$.strict,U);if(g.range=[I,z,G.offset],G.comment)g.comment=G.comment;return g}ZZ.composeEmptyNode=Nz;ZZ.composeNode=DQ});var KQ=S((wZ)=>{var PZ=eI(),BQ=LQ(),jZ=P1(),SZ=$0();function FZ($,I,{offset:_,start:u,value:U,end:g},z){let G=Object.assign({_directives:I},$),J=new PZ.Document(void 0,G),X={atKey:!1,atRoot:!0,directives:J.directives,options:J.options,schema:J.schema},N=SZ.resolveProps(u,{indicator:"doc-start",next:U??g?.[0],offset:_,onError:z,parentIndent:0,startOnNewline:!0});if(N.found){if(J.directives.docStart=!0,U&&(U.type==="block-map"||U.type==="block-seq")&&!N.hasNewline)z(N.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}J.contents=U?BQ.composeNode(X,U,N,z):BQ.composeEmptyNode(X,N.end,u,null,N,z);let q=J.contents.range[2],Q=jZ.resolveEnd(g,q,!1,z);if(Q.comment)J.comment=Q.comment;return J.range=[_,q,Q.offset],J}wZ.composeDoc=FZ});var Qz=S((iZ)=>{var CZ=z$("process"),fZ=vg(),xZ=eI(),I0=sI(),WQ=$$(),kZ=KQ(),yZ=P1();function U0($){if(typeof $==="number")return[$,$+1];if(Array.isArray($))return $.length===2?$:[$[0],$[1]];let{offset:I,source:_}=$;return[I,I+(typeof _==="string"?_.length:1)]}function RQ($){let I="",_=!1,u=!1;for(let U=0;U<$.length;++U){let g=$[U];switch(g[0]){case"#":I+=(I===""?"":u?`
|
|
126
126
|
|
|
127
127
|
`:`
|
|
128
|
-
`)+(g.substring(1)||" "),_=!0,u=!1;break;case"%":if($[U+1]?.[0]!=="#")U+=1;_=!1;break;default:if(!_)u=!0;_=!1}}return{comment:I,afterEmptyLine:u}}class
|
|
129
|
-
${_}`:_;else if(u||$.directives.docStart||!U)$.commentBefore=_;else if(
|
|
128
|
+
`)+(g.substring(1)||" "),_=!0,u=!1;break;case"%":if($[U+1]?.[0]!=="#")U+=1;_=!1;break;default:if(!_)u=!0;_=!1}}return{comment:I,afterEmptyLine:u}}class VQ{constructor($={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(I,_,u,U)=>{let g=U0(I);if(U)this.warnings.push(new I0.YAMLWarning(g,_,u));else this.errors.push(new I0.YAMLParseError(g,_,u))},this.directives=new fZ.Directives({version:$.version||"1.2"}),this.options=$}decorate($,I){let{comment:_,afterEmptyLine:u}=RQ(this.prelude);if(_){let U=$.contents;if(I)$.comment=$.comment?`${$.comment}
|
|
129
|
+
${_}`:_;else if(u||$.directives.docStart||!U)$.commentBefore=_;else if(WQ.isCollection(U)&&!U.flow&&U.items.length>0){let g=U.items[0];if(WQ.isPair(g))g=g.key;let z=g.commentBefore;g.commentBefore=z?`${_}
|
|
130
130
|
${z}`:_}else{let g=U.commentBefore;U.commentBefore=g?`${_}
|
|
131
|
-
${g}`:_}}if(I)Array.prototype.push.apply($.errors,this.errors),Array.prototype.push.apply($.warnings,this.warnings);else $.errors=this.errors,$.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:
|
|
132
|
-
${I.comment}`:I.comment}this.doc.range[2]=I.offset;break}default:this.errors.push(new
|
|
131
|
+
${g}`:_}}if(I)Array.prototype.push.apply($.errors,this.errors),Array.prototype.push.apply($.warnings,this.warnings);else $.errors=this.errors,$.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:RQ(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose($,I=!1,_=-1){for(let u of $)yield*this.next(u);yield*this.end(I,_)}*next($){if(CZ.env.LOG_STREAM)console.dir($,{depth:null});switch($.type){case"directive":this.directives.add($.source,(I,_,u)=>{let U=U0($);U[0]+=I,this.onError(U,"BAD_DIRECTIVE",_,u)}),this.prelude.push($.source),this.atDirectives=!0;break;case"document":{let I=kZ.composeDoc(this.options,this.directives,$,this.onError);if(this.atDirectives&&!I.directives.docStart)this.onError($,"MISSING_CHAR","Missing directives-end/doc-start indicator line");if(this.decorate(I,!1),this.doc)yield this.doc;this.doc=I,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push($.source);break;case"error":{let I=$.source?`${$.message}: ${JSON.stringify($.source)}`:$.message,_=new I0.YAMLParseError(U0($),"UNEXPECTED_TOKEN",I);if(this.atDirectives||!this.doc)this.errors.push(_);else this.doc.errors.push(_);break}case"doc-end":{if(!this.doc){this.errors.push(new I0.YAMLParseError(U0($),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let I=yZ.resolveEnd($.end,$.offset+$.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),I.comment){let _=this.doc.comment;this.doc.comment=_?`${_}
|
|
132
|
+
${I.comment}`:I.comment}this.doc.range[2]=I.offset;break}default:this.errors.push(new I0.YAMLParseError(U0($),"UNEXPECTED_TOKEN",`Unsupported token ${$.type}`))}}*end($=!1,I=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if($){let _=Object.assign({_directives:this.directives},this.options),u=new xZ.Document(void 0,_);if(this.atDirectives)this.onError(I,"MISSING_CHAR","Missing directives-end indicator line");u.range=[0,I,I],this.decorate(u,!1),yield u}}}iZ.Composer=VQ});var bQ=S((pZ)=>{var mZ=Jz(),nZ=qz(),rZ=sI(),ZQ=lI();function hZ($,I=!0,_){if($){let u=(U,g,z)=>{let G=typeof U==="number"?U:Array.isArray(U)?U[0]:U.offset;if(_)_(G,g,z);else throw new rZ.YAMLParseError([G,G+1],g,z)};switch($.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return nZ.resolveFlowScalar($,I,u);case"block-scalar":return mZ.resolveBlockScalar({options:{strict:I}},$,u)}}return null}function cZ($,I){let{implicitKey:_=!1,indent:u,inFlow:U=!1,offset:g=-1,type:z="PLAIN"}=I,G=ZQ.stringifyString({type:z,value:$},{implicitKey:_,indent:u>0?" ".repeat(u):"",inFlow:U,options:{blockQuote:!0,lineWidth:-1}}),J=I.end??[{type:"newline",offset:-1,indent:u,source:`
|
|
133
133
|
`}];switch(G[0]){case"|":case">":{let X=G.indexOf(`
|
|
134
134
|
`),N=G.substring(0,X),q=G.substring(X+1)+`
|
|
135
|
-
`,Q=[{type:"block-scalar-header",offset:g,indent:u,source:N}];if(!
|
|
136
|
-
`});return{type:"block-scalar",offset:g,indent:u,props:Q,source:q}}case'"':return{type:"double-quoted-scalar",offset:g,indent:u,source:G,end:J};case"'":return{type:"single-quoted-scalar",offset:g,indent:u,source:G,end:J};default:return{type:"scalar",offset:g,indent:u,source:G,end:J}}}function
|
|
135
|
+
`,Q=[{type:"block-scalar-header",offset:g,indent:u,source:N}];if(!AQ(Q,J))Q.push({type:"newline",offset:-1,indent:u,source:`
|
|
136
|
+
`});return{type:"block-scalar",offset:g,indent:u,props:Q,source:q}}case'"':return{type:"double-quoted-scalar",offset:g,indent:u,source:G,end:J};case"'":return{type:"single-quoted-scalar",offset:g,indent:u,source:G,end:J};default:return{type:"scalar",offset:g,indent:u,source:G,end:J}}}function dZ($,I,_={}){let{afterKey:u=!1,implicitKey:U=!1,inFlow:g=!1,type:z}=_,G="indent"in $?$.indent:null;if(u&&typeof G==="number")G+=2;if(!z)switch($.type){case"single-quoted-scalar":z="QUOTE_SINGLE";break;case"double-quoted-scalar":z="QUOTE_DOUBLE";break;case"block-scalar":{let X=$.props[0];if(X.type!=="block-scalar-header")throw Error("Invalid block scalar header");z=X.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:z="PLAIN"}let J=ZQ.stringifyString({type:z,value:I},{implicitKey:U||G===null,indent:G!==null&&G>0?" ".repeat(G):"",inFlow:g,options:{blockQuote:!0,lineWidth:-1}});switch(J[0]){case"|":case">":oZ($,J);break;case'"':Hz($,J,"double-quoted-scalar");break;case"'":Hz($,J,"single-quoted-scalar");break;default:Hz($,J,"scalar")}}function oZ($,I){let _=I.indexOf(`
|
|
137
137
|
`),u=I.substring(0,_),U=I.substring(_+1)+`
|
|
138
|
-
`;if($.type==="block-scalar"){let g=$.props[0];if(g.type!=="block-scalar-header")throw Error("Invalid block scalar header");g.source=u,$.source=U}else{let{offset:g}=$,z="indent"in $?$.indent:-1,G=[{type:"block-scalar-header",offset:g,indent:z,source:u}];if(!
|
|
139
|
-
`});for(let J of Object.keys($))if(J!=="type"&&J!=="offset")delete $[J];Object.assign($,{type:"block-scalar",indent:z,props:G,source:U})}}function
|
|
140
|
-
`};delete $.items,Object.assign($,{type:_,source:I,end:[U]});break}default:{let u="indent"in $?$.indent:-1,U="end"in $&&Array.isArray($.end)?$.end.filter((g)=>g.type==="space"||g.type==="comment"||g.type==="newline"):[];for(let g of Object.keys($))if(g!=="type"&&g!=="offset")delete $[g];Object.assign($,{type:_,indent:u,source:I,end:U})}}}
|
|
138
|
+
`;if($.type==="block-scalar"){let g=$.props[0];if(g.type!=="block-scalar-header")throw Error("Invalid block scalar header");g.source=u,$.source=U}else{let{offset:g}=$,z="indent"in $?$.indent:-1,G=[{type:"block-scalar-header",offset:g,indent:z,source:u}];if(!AQ(G,"end"in $?$.end:void 0))G.push({type:"newline",offset:-1,indent:z,source:`
|
|
139
|
+
`});for(let J of Object.keys($))if(J!=="type"&&J!=="offset")delete $[J];Object.assign($,{type:"block-scalar",indent:z,props:G,source:U})}}function AQ($,I){if(I)for(let _ of I)switch(_.type){case"space":case"comment":$.push(_);break;case"newline":return $.push(_),!0}return!1}function Hz($,I,_){switch($.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":$.type=_,$.source=I;break;case"block-scalar":{let u=$.props.slice(1),U=I.length;if($.props[0].type==="block-scalar-header")U-=$.props[0].source.length;for(let g of u)g.offset+=U;delete $.props,Object.assign($,{type:_,source:I,end:u});break}case"block-map":case"block-seq":{let U={type:"newline",offset:$.offset+I.length,indent:$.indent,source:`
|
|
140
|
+
`};delete $.items,Object.assign($,{type:_,source:I,end:[U]});break}default:{let u="indent"in $?$.indent:-1,U="end"in $&&Array.isArray($.end)?$.end.filter((g)=>g.type==="space"||g.type==="comment"||g.type==="newline"):[];for(let g of Object.keys($))if(g!=="type"&&g!=="offset")delete $[g];Object.assign($,{type:_,indent:u,source:I,end:U})}}}pZ.createScalarToken=cZ;pZ.resolveAsScalar=hZ;pZ.setScalarValue=dZ});var PQ=S(($A)=>{var sZ=($)=>("type"in $)?g_($):u_($);function g_($){switch($.type){case"block-scalar":{let I="";for(let _ of $.props)I+=g_(_);return I+$.source}case"block-map":case"block-seq":{let I="";for(let _ of $.items)I+=u_(_);return I}case"flow-collection":{let I=$.start.source;for(let _ of $.items)I+=u_(_);for(let _ of $.end)I+=_.source;return I}case"document":{let I=u_($);if($.end)for(let _ of $.end)I+=_.source;return I}default:{let I=$.source;if("end"in $&&$.end)for(let _ of $.end)I+=_.source;return I}}}function u_({start:$,key:I,sep:_,value:u}){let U="";for(let g of $)U+=g.source;if(I)U+=g_(I);if(_)for(let g of _)U+=g.source;if(u)U+=g_(u);return U}$A.stringify=sZ});var FQ=S((_A)=>{var Yz=Symbol("break visit"),UA=Symbol("skip children"),jQ=Symbol("remove item");function c6($,I){if("type"in $&&$.type==="document")$={start:$.start,value:$.value};SQ(Object.freeze([]),$,I)}c6.BREAK=Yz;c6.SKIP=UA;c6.REMOVE=jQ;c6.itemAtPath=($,I)=>{let _=$;for(let[u,U]of I){let g=_?.[u];if(g&&"items"in g)_=g.items[U];else return}return _};c6.parentCollection=($,I)=>{let _=c6.itemAtPath($,I.slice(0,-1)),u=I[I.length-1][0],U=_?.[u];if(U&&"items"in U)return U;throw Error("Parent collection not found")};function SQ($,I,_){let u=_(I,$);if(typeof u==="symbol")return u;for(let U of["key","value"]){let g=I[U];if(g&&"items"in g){for(let z=0;z<g.items.length;++z){let G=SQ(Object.freeze($.concat([[U,z]])),g.items[z],_);if(typeof G==="number")z=G-1;else if(G===Yz)return Yz;else if(G===jQ)g.items.splice(z,1),z-=1}if(typeof u==="function"&&U==="key")u=u(I,$)}}return typeof u==="function"?u(I,$):u}_A.visit=c6});var z_=S((NA)=>{var Oz=bQ(),gA=PQ(),zA=FQ(),vz="\uFEFF",Tz="\x02",Mz="\x18",Dz="\x1F",GA=($)=>!!$&&("items"in $),JA=($)=>!!$&&($.type==="scalar"||$.type==="single-quoted-scalar"||$.type==="double-quoted-scalar"||$.type==="block-scalar");function XA($){switch($){case vz:return"<BOM>";case Tz:return"<DOC>";case Mz:return"<FLOW_END>";case Dz:return"<SCALAR>";default:return JSON.stringify($)}}function qA($){switch($){case vz:return"byte-order-mark";case Tz:return"doc-mode";case Mz:return"flow-error-end";case Dz:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
141
141
|
`:case`\r
|
|
142
|
-
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch($[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}
|
|
143
|
-
`:case"\r":case"\t":return!0;default:return!1}}var
|
|
144
|
-
\r `),
|
|
142
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch($[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}NA.createScalarToken=Oz.createScalarToken;NA.resolveAsScalar=Oz.resolveAsScalar;NA.setScalarValue=Oz.setScalarValue;NA.stringify=gA.stringify;NA.visit=zA.visit;NA.BOM=vz;NA.DOCUMENT=Tz;NA.FLOW_END=Mz;NA.SCALAR=Dz;NA.isCollection=GA;NA.isScalar=JA;NA.prettyToken=XA;NA.tokenType=qA});var Bz=S((AA)=>{var _0=z_();function M4($){switch($){case void 0:case" ":case`
|
|
143
|
+
`:case"\r":case"\t":return!0;default:return!1}}var wQ=new Set("0123456789ABCDEFabcdef"),VA=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),G_=new Set(",[]{}"),ZA=new Set(` ,[]{}
|
|
144
|
+
\r `),Lz=($)=>!$||ZA.has($);class EQ{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($,I=!1){if($){if(typeof $!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+$:$,this.lineEndPos=null}this.atEnd=!I;let _=this.next??"stream";while(_&&(I||this.hasChars(1)))_=yield*this.parseNext(_)}atLineEnd(){let $=this.pos,I=this.buffer[$];while(I===" "||I==="\t")I=this.buffer[++$];if(!I||I==="#"||I===`
|
|
145
145
|
`)return!0;if(I==="\r")return this.buffer[$+1]===`
|
|
146
146
|
`;return!1}charAt($){return this.buffer[this.pos+$]}continueScalar($){let I=this.buffer[$];if(this.indentNext>0){let _=0;while(I===" ")I=this.buffer[++_+$];if(I==="\r"){let u=this.buffer[_+$+1];if(u===`
|
|
147
147
|
`||!u&&!this.atEnd)return $+_+1}return I===`
|
|
148
148
|
`||_>=this.indentNext||!I&&!this.atEnd?$+_:-1}if(I==="-"||I==="."){let _=this.buffer.substr($,3);if((_==="---"||_==="...")&&M4(this.buffer[$+3]))return-1}return $}getLine(){let $=this.lineEndPos;if(typeof $!=="number"||$!==-1&&$<this.pos)$=this.buffer.indexOf(`
|
|
149
|
-
`,this.pos),this.lineEndPos=$;if($===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[$-1]==="\r")$-=1;return this.buffer.substring(this.pos,$)}hasChars($){return this.pos+$<=this.buffer.length}setNext($){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=$,null}peek($){return this.buffer.substr(this.pos,$)}*parseNext($){switch($){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let $=this.getLine();if($===null)return this.setNext("stream");if($[0]===
|
|
149
|
+
`,this.pos),this.lineEndPos=$;if($===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[$-1]==="\r")$-=1;return this.buffer.substring(this.pos,$)}hasChars($){return this.pos+$<=this.buffer.length}setNext($){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=$,null}peek($){return this.buffer.substr(this.pos,$)}*parseNext($){switch($){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let $=this.getLine();if($===null)return this.setNext("stream");if($[0]===_0.BOM)yield*this.pushCount(1),$=$.substring(1);if($[0]==="%"){let I=$.length,_=$.indexOf("#");while(_!==-1){let U=$[_-1];if(U===" "||U==="\t"){I=_-1;break}else _=$.indexOf("#",_+1)}while(!0){let U=$[I-1];if(U===" "||U==="\t")I-=1;else break}let u=(yield*this.pushCount(I))+(yield*this.pushSpaces(!0));return yield*this.pushCount($.length-u),this.pushNewline(),"stream"}if(this.atLineEnd()){let I=yield*this.pushSpaces(!0);return yield*this.pushCount($.length-I),yield*this.pushNewline(),"stream"}return yield _0.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let $=this.charAt(0);if(!$&&!this.atEnd)return this.setNext("line-start");if($==="-"||$==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let I=this.peek(3);if((I==="---"||I==="...")&&M4(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,I==="---"?"doc":"stream"}if(this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!M4(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){let[$,I]=this.peek(2);if(!I&&!this.atEnd)return this.setNext("block-start");if(($==="-"||$==="?"||$===":")&&M4(I)){let _=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=_,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let $=this.getLine();if($===null)return this.setNext("doc");let I=yield*this.pushIndicators();switch($[I]){case"#":yield*this.pushCount($.length-I);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Lz),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return I+=yield*this.parseBlockScalarHeader(),I+=yield*this.pushSpaces(!0),yield*this.pushCount($.length-I),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let $,I,_=-1;do{if($=yield*this.pushNewline(),$>0)I=yield*this.pushSpaces(!1),this.indentValue=_=I;else I=0;I+=yield*this.pushSpaces(!0)}while($+I>0);let u=this.getLine();if(u===null)return this.setNext("flow");if(_!==-1&&_<this.indentNext&&u[0]!=="#"||_===0&&(u.startsWith("---")||u.startsWith("..."))&&M4(u[3])){if(!(_===this.indentNext-1&&this.flowLevel===1&&(u[0]==="]"||u[0]==="}")))return this.flowLevel=0,yield _0.FLOW_END,yield*this.parseLineStart()}let U=0;while(u[U]===",")U+=yield*this.pushCount(1),U+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(U+=yield*this.pushIndicators(),u[U]){case void 0:return"flow";case"#":return yield*this.pushCount(u.length-U),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Lz),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let g=this.charAt(1);if(this.flowKey||M4(g)||g===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let $=this.charAt(0),I=this.buffer.indexOf($,this.pos+1);if($==="'")while(I!==-1&&this.buffer[I+1]==="'")I=this.buffer.indexOf("'",I+2);else while(I!==-1){let U=0;while(this.buffer[I-1-U]==="\\")U+=1;if(U%2===0)break;I=this.buffer.indexOf('"',I+1)}let _=this.buffer.substring(0,I),u=_.indexOf(`
|
|
150
150
|
`,this.pos);if(u!==-1){while(u!==-1){let U=this.continueScalar(u+1);if(U===-1)break;u=_.indexOf(`
|
|
151
151
|
`,U)}if(u!==-1)I=u-(_[u-1]==="\r"?2:1)}if(I===-1){if(!this.atEnd)return this.setNext("quoted-scalar");I=this.buffer.length}return yield*this.pushToIndex(I+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let $=this.pos;while(!0){let I=this.buffer[++$];if(I==="+")this.blockScalarKeep=!0;else if(I>"0"&&I<="9")this.blockScalarIndent=Number(I)-1;else if(I!=="-")break}return yield*this.pushUntil((I)=>M4(I)||I==="#")}*parseBlockScalar(){let $=this.pos-1,I=0,_;$:for(let U=this.pos;_=this.buffer[U];++U)switch(_){case" ":I+=1;break;case`
|
|
152
152
|
`:$=U,I=0;break;case"\r":{let g=this.buffer[U+1];if(!g&&!this.atEnd)return this.setNext("block-scalar");if(g===`
|
|
153
153
|
`)break}default:break $}if(!_&&!this.atEnd)return this.setNext("block-scalar");if(I>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=I;else this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let U=this.continueScalar($+1);if(U===-1)break;$=this.buffer.indexOf(`
|
|
154
154
|
`,U)}while($!==-1);if($===-1){if(!this.atEnd)return this.setNext("block-scalar");$=this.buffer.length}}let u=$+1;_=this.buffer[u];while(_===" ")_=this.buffer[++u];if(_==="\t"){while(_==="\t"||_===" "||_==="\r"||_===`
|
|
155
155
|
`)_=this.buffer[++u];$=u-1}else if(!this.blockScalarKeep)do{let U=$-1,g=this.buffer[U];if(g==="\r")g=this.buffer[--U];let z=U;while(g===" ")g=this.buffer[--U];if(g===`
|
|
156
|
-
`&&U>=this.pos&&U+1+I>z)$=U;else break}while(!0);return yield
|
|
156
|
+
`&&U>=this.pos&&U+1+I>z)$=U;else break}while(!0);return yield _0.SCALAR,yield*this.pushToIndex($+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let $=this.flowLevel>0,I=this.pos-1,_=this.pos-1,u;while(u=this.buffer[++_])if(u===":"){let U=this.buffer[_+1];if(M4(U)||$&&G_.has(U))break;I=_}else if(M4(u)){let U=this.buffer[_+1];if(u==="\r")if(U===`
|
|
157
157
|
`)_+=1,u=`
|
|
158
|
-
`,U=this.buffer[_+1];else I=_;if(U==="#"||$&&
|
|
159
|
-
`){let g=this.continueScalar(_+1);if(g===-1)break;_=Math.max(_,g-2)}}else{if($&&
|
|
158
|
+
`,U=this.buffer[_+1];else I=_;if(U==="#"||$&&G_.has(U))break;if(u===`
|
|
159
|
+
`){let g=this.continueScalar(_+1);if(g===-1)break;_=Math.max(_,g-2)}}else{if($&&G_.has(u))break;I=_}if(!u&&!this.atEnd)return this.setNext("plain-scalar");return yield _0.SCALAR,yield*this.pushToIndex(I+1,!0),$?"flow":"doc"}*pushCount($){if($>0)return yield this.buffer.substr(this.pos,$),this.pos+=$,$;return 0}*pushToIndex($,I){let _=this.buffer.slice(this.pos,$);if(_)return yield _,this.pos+=_.length,_.length;else if(I)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(Lz))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let $=this.flowLevel>0,I=this.charAt(1);if(M4(I)||$&&G_.has(I)){if(!$)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=!1;return(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}}return 0}*pushTag(){if(this.charAt(1)==="<"){let $=this.pos+2,I=this.buffer[$];while(!M4(I)&&I!==">")I=this.buffer[++$];return yield*this.pushToIndex(I===">"?$+1:$,!1)}else{let $=this.pos+1,I=this.buffer[$];while(I)if(VA.has(I))I=this.buffer[++$];else if(I==="%"&&wQ.has(this.buffer[$+1])&&wQ.has(this.buffer[$+2]))I=this.buffer[$+=3];else break;return yield*this.pushToIndex($,!1)}}*pushNewline(){let $=this.buffer[this.pos];if($===`
|
|
160
160
|
`)return yield*this.pushCount(1);else if($==="\r"&&this.charAt(1)===`
|
|
161
|
-
`)return yield*this.pushCount(2);else return 0}*pushSpaces($){let I=this.pos-1,_;do _=this.buffer[++I];while(_===" "||$&&_==="\t");let u=I-this.pos;if(u>0)yield this.buffer.substr(this.pos,u),this.pos=I;return u}*pushUntil($){let I=this.pos,_=this.buffer[I];while(!$(_))_=this.buffer[++I];return yield*this.pushToIndex(I,!1)}}
|
|
161
|
+
`)return yield*this.pushCount(2);else return 0}*pushSpaces($){let I=this.pos-1,_;do _=this.buffer[++I];while(_===" "||$&&_==="\t");let u=I-this.pos;if(u>0)yield this.buffer.substr(this.pos,u),this.pos=I;return u}*pushUntil($){let I=this.pos,_=this.buffer[I];while(!$(_))_=this.buffer[++I];return yield*this.pushToIndex(I,!1)}}AA.Lexer=EQ});var Kz=S((PA)=>{class CQ{constructor(){this.lineStarts=[],this.addNewLine=($)=>this.lineStarts.push($),this.linePos=($)=>{let I=0,_=this.lineStarts.length;while(I<_){let U=I+_>>1;if(this.lineStarts[U]<$)I=U+1;else _=U}if(this.lineStarts[I]===$)return{line:I+1,col:1};if(I===0)return{line:0,col:$};let u=this.lineStarts[I-1];return{line:I,col:$-u+1}}}}PA.LineCounter=CQ});var Wz=S((wA)=>{var SA=z$("process"),fQ=z_(),FA=Bz();function Y6($,I){for(let _=0;_<$.length;++_)if($[_].type===I)return!0;return!1}function xQ($){for(let I=0;I<$.length;++I)switch($[I].type){case"space":case"comment":case"newline":break;default:return I}return-1}function yQ($){switch($?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function J_($){switch($.type){case"document":return $.start;case"block-map":{let I=$.items[$.items.length-1];return I.sep??I.start}case"block-seq":return $.items[$.items.length-1].start;default:return[]}}function j1($){if($.length===0)return[];let I=$.length;$:while(--I>=0)switch($[I].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break $}while($[++I]?.type==="space");return $.splice(I,$.length)}function kQ($){if($.start.type==="flow-seq-start"){for(let I of $.items)if(I.sep&&!I.value&&!Y6(I.start,"explicit-key-ind")&&!Y6(I.sep,"map-value-ind")){if(I.key)I.value=I.key;if(delete I.key,yQ(I.value))if(I.value.end)Array.prototype.push.apply(I.value.end,I.sep);else I.value.end=I.sep;else Array.prototype.push.apply(I.start,I.sep);delete I.sep}}}class iQ{constructor($){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new FA.Lexer,this.onNewLine=$}*parse($,I=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let _ of this.lexer.lex($,I))yield*this.next(_);if(!I)yield*this.end()}*next($){if(this.source=$,SA.env.LOG_TOKENS)console.log("|",fQ.prettyToken($));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=$.length;return}let I=fQ.tokenType($);if(!I){let _=`Not a YAML token: ${$}`;yield*this.pop({type:"error",offset:this.offset,message:_,source:$}),this.offset+=$.length}else if(I==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=I,yield*this.step(),I){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+$.length);break;case"space":if(this.atNewLine&&$[0]===" ")this.indent+=$.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=$.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=$.length}}*end(){while(this.stack.length>0)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let $=this.peek(1);if(this.type==="doc-end"&&$?.type!=="doc-end"){while(this.stack.length>0)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!$)return yield*this.stream();switch($.type){case"document":return yield*this.document($);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar($);case"block-scalar":return yield*this.blockScalar($);case"block-map":return yield*this.blockMap($);case"block-seq":return yield*this.blockSequence($);case"flow-collection":return yield*this.flowCollection($);case"doc-end":return yield*this.documentEnd($)}yield*this.pop()}peek($){return this.stack[this.stack.length-$]}*pop($){let I=$??this.stack.pop();if(!I)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield I;else{let _=this.peek(1);if(I.type==="block-scalar")I.indent="indent"in _?_.indent:0;else if(I.type==="flow-collection"&&_.type==="document")I.indent=0;if(I.type==="flow-collection")kQ(I);switch(_.type){case"document":_.value=I;break;case"block-scalar":_.props.push(I);break;case"block-map":{let u=_.items[_.items.length-1];if(u.value){_.items.push({start:[],key:I,sep:[]}),this.onKeyLine=!0;return}else if(u.sep)u.value=I;else{Object.assign(u,{key:I,sep:[]}),this.onKeyLine=!u.explicitKey;return}break}case"block-seq":{let u=_.items[_.items.length-1];if(u.value)_.items.push({start:[],value:I});else u.value=I;break}case"flow-collection":{let u=_.items[_.items.length-1];if(!u||u.value)_.items.push({start:[],key:I,sep:[]});else if(u.sep)u.value=I;else Object.assign(u,{key:I,sep:[]});return}default:yield*this.pop(),yield*this.pop(I)}if((_.type==="document"||_.type==="block-map"||_.type==="block-seq")&&(I.type==="block-map"||I.type==="block-seq")){let u=I.items[I.items.length-1];if(u&&!u.sep&&!u.value&&u.start.length>0&&xQ(u.start)===-1&&(I.indent===0||u.start.every((U)=>U.type!=="comment"||U.indent<I.indent))){if(_.type==="document")_.end=u.start;else _.items.push({start:u.start});I.items.splice(-1,1)}}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let $={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")$.start.push(this.sourceToken);this.stack.push($);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document($){if($.value)return yield*this.lineEnd($);switch(this.type){case"doc-start":{if(xQ($.start)!==-1)yield*this.pop(),yield*this.step();else $.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":$.start.push(this.sourceToken);return}let I=this.startBlockValue($);if(I)this.stack.push(I);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar($){if(this.type==="map-value-ind"){let I=J_(this.peek(2)),_=j1(I),u;if($.end)u=$.end,u.push(this.sourceToken),delete $.end;else u=[this.sourceToken];let U={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:_,key:$,sep:u}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=U}else yield*this.lineEnd($)}*blockScalar($){switch(this.type){case"space":case"comment":case"newline":$.props.push(this.sourceToken);return;case"scalar":if($.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let I=this.source.indexOf(`
|
|
162
162
|
`)+1;while(I!==0)this.onNewLine(this.offset+I),I=this.source.indexOf(`
|
|
163
|
-
`,I)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap($){let I=$.items[$.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,I.value){let _="end"in I.value?I.value.end:void 0;if((Array.isArray(_)?_[_.length-1]:void 0)?.type==="comment")_?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else if(I.sep)I.sep.push(this.sourceToken);else I.start.push(this.sourceToken);return;case"space":case"comment":if(I.value)$.items.push({start:[this.sourceToken]});else if(I.sep)I.sep.push(this.sourceToken);else{if(this.atIndentedComment(I.start,$.indent)){let u=$.items[$.items.length-2]?.value?.end;if(Array.isArray(u)){Array.prototype.push.apply(u,I.start),u.push(this.sourceToken),$.items.pop();return}}I.start.push(this.sourceToken)}return}if(this.indent>=$.indent){let _=!this.onKeyLine&&this.indent===$.indent,u=_&&(I.sep||I.explicitKey)&&this.type!=="seq-item-ind",U=[];if(u&&I.sep&&!I.value){let g=[];for(let z=0;z<I.sep.length;++z){let G=I.sep[z];switch(G.type){case"newline":g.push(z);break;case"space":break;case"comment":if(G.indent>$.indent)g.length=0;break;default:g.length=0}}if(g.length>=2)U=I.sep.splice(g[1])}switch(this.type){case"anchor":case"tag":if(u||I.value)U.push(this.sourceToken),$.items.push({start:U}),this.onKeyLine=!0;else if(I.sep)I.sep.push(this.sourceToken);else I.start.push(this.sourceToken);return;case"explicit-key-ind":if(!I.sep&&!I.explicitKey)I.start.push(this.sourceToken),I.explicitKey=!0;else if(u||I.value)U.push(this.sourceToken),$.items.push({start:U,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(I.explicitKey)if(!I.sep)if(
|
|
163
|
+
`,I)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap($){let I=$.items[$.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,I.value){let _="end"in I.value?I.value.end:void 0;if((Array.isArray(_)?_[_.length-1]:void 0)?.type==="comment")_?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else if(I.sep)I.sep.push(this.sourceToken);else I.start.push(this.sourceToken);return;case"space":case"comment":if(I.value)$.items.push({start:[this.sourceToken]});else if(I.sep)I.sep.push(this.sourceToken);else{if(this.atIndentedComment(I.start,$.indent)){let u=$.items[$.items.length-2]?.value?.end;if(Array.isArray(u)){Array.prototype.push.apply(u,I.start),u.push(this.sourceToken),$.items.pop();return}}I.start.push(this.sourceToken)}return}if(this.indent>=$.indent){let _=!this.onKeyLine&&this.indent===$.indent,u=_&&(I.sep||I.explicitKey)&&this.type!=="seq-item-ind",U=[];if(u&&I.sep&&!I.value){let g=[];for(let z=0;z<I.sep.length;++z){let G=I.sep[z];switch(G.type){case"newline":g.push(z);break;case"space":break;case"comment":if(G.indent>$.indent)g.length=0;break;default:g.length=0}}if(g.length>=2)U=I.sep.splice(g[1])}switch(this.type){case"anchor":case"tag":if(u||I.value)U.push(this.sourceToken),$.items.push({start:U}),this.onKeyLine=!0;else if(I.sep)I.sep.push(this.sourceToken);else I.start.push(this.sourceToken);return;case"explicit-key-ind":if(!I.sep&&!I.explicitKey)I.start.push(this.sourceToken),I.explicitKey=!0;else if(u||I.value)U.push(this.sourceToken),$.items.push({start:U,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(I.explicitKey)if(!I.sep)if(Y6(I.start,"newline"))Object.assign(I,{key:null,sep:[this.sourceToken]});else{let g=j1(I.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:g,key:null,sep:[this.sourceToken]}]})}else if(I.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Y6(I.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:U,key:null,sep:[this.sourceToken]}]});else if(yQ(I.key)&&!Y6(I.sep,"newline")){let g=j1(I.start),z=I.key,G=I.sep;G.push(this.sourceToken),delete I.key,delete I.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:g,key:z,sep:G}]})}else if(U.length>0)I.sep=I.sep.concat(U,this.sourceToken);else I.sep.push(this.sourceToken);else if(!I.sep)Object.assign(I,{key:null,sep:[this.sourceToken]});else if(I.value||u)$.items.push({start:U,key:null,sep:[this.sourceToken]});else if(Y6(I.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else I.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let g=this.flowScalar(this.type);if(u||I.value)$.items.push({start:U,key:g,sep:[]}),this.onKeyLine=!0;else if(I.sep)this.stack.push(g);else Object.assign(I,{key:g,sep:[]}),this.onKeyLine=!0;return}default:{let g=this.startBlockValue($);if(g){if(g.type==="block-seq"){if(!I.explicitKey&&I.sep&&!Y6(I.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(_)$.items.push({start:U});this.stack.push(g);return}}}}yield*this.pop(),yield*this.step()}*blockSequence($){let I=$.items[$.items.length-1];switch(this.type){case"newline":if(I.value){let _="end"in I.value?I.value.end:void 0;if((Array.isArray(_)?_[_.length-1]:void 0)?.type==="comment")_?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else I.start.push(this.sourceToken);return;case"space":case"comment":if(I.value)$.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(I.start,$.indent)){let u=$.items[$.items.length-2]?.value?.end;if(Array.isArray(u)){Array.prototype.push.apply(u,I.start),u.push(this.sourceToken),$.items.pop();return}}I.start.push(this.sourceToken)}return;case"anchor":case"tag":if(I.value||this.indent<=$.indent)break;I.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==$.indent)break;if(I.value||Y6(I.start,"seq-item-ind"))$.items.push({start:[this.sourceToken]});else I.start.push(this.sourceToken);return}if(this.indent>$.indent){let _=this.startBlockValue($);if(_){this.stack.push(_);return}}yield*this.pop(),yield*this.step()}*flowCollection($){let I=$.items[$.items.length-1];if(this.type==="flow-error-end"){let _;do yield*this.pop(),_=this.peek(1);while(_?.type==="flow-collection")}else if($.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!I||I.sep)$.items.push({start:[this.sourceToken]});else I.start.push(this.sourceToken);return;case"map-value-ind":if(!I||I.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(I.sep)I.sep.push(this.sourceToken);else Object.assign(I,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!I||I.value)$.items.push({start:[this.sourceToken]});else if(I.sep)I.sep.push(this.sourceToken);else I.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let u=this.flowScalar(this.type);if(!I||I.value)$.items.push({start:[],key:u,sep:[]});else if(I.sep)this.stack.push(u);else Object.assign(I,{key:u,sep:[]});return}case"flow-map-end":case"flow-seq-end":$.end.push(this.sourceToken);return}let _=this.startBlockValue($);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===$.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 u=J_(_),U=j1(u);kQ($);let g=$.end.splice(1,$.end.length);g.push(this.sourceToken);let z={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:U,key:$,sep:g}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=z}else yield*this.lineEnd($)}}flowScalar($){if(this.onNewLine){let I=this.source.indexOf(`
|
|
164
164
|
`)+1;while(I!==0)this.onNewLine(this.offset+I),I=this.source.indexOf(`
|
|
165
|
-
`,I)+1}return{type:$,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue($){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let I
|
|
166
|
-
`)}function
|
|
167
|
-
`)}function
|
|
168
|
-
`).map((X)=>X.trim()).find((X)=>/^##\s*Status:/i.test(X)||/^Status:/i.test(X));if(J){if(J.match(/status[^:]*:\s*([a-z_]+)/i)?.[1]?.toLowerCase()==="completed")_+=1}}let U
|
|
169
|
-
`).map((G)=>G.trim()).filter((G)=>/status/i.test(G)).reduce((G,J)=>{if(J.match(/status[^:]*:\s*([a-z_]+)/i)?.[1]?.toLowerCase()==="completed")return G+1;return G},0);_=Math.max(_,z)}let g
|
|
165
|
+
`,I)+1}return{type:$,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue($){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let I=J_($),_=j1(I);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 I=J_($),_=j1(I);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:_,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment($,I){if(this.type!=="comment")return!1;if(this.indent<=I)return!1;return $.every((_)=>_.type==="newline"||_.type==="space")}*documentEnd($){if(this.type!=="doc-mode"){if($.end)$.end.push(this.sourceToken);else $.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd($){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:if($.end)$.end.push(this.sourceToken);else $.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}wA.Parser=iQ});var hQ=S((mA)=>{var lQ=Qz(),CA=eI(),u0=sI(),fA=Kg(),xA=$$(),kA=Kz(),mQ=Wz();function nQ($){let I=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||I&&new kA.LineCounter||null,prettyErrors:I}}function yA($,I={}){let{lineCounter:_,prettyErrors:u}=nQ(I),U=new mQ.Parser(_?.addNewLine),g=new lQ.Composer(I),z=Array.from(g.compose(U.parse($)));if(u&&_)for(let G of z)G.errors.forEach(u0.prettifyError($,_)),G.warnings.forEach(u0.prettifyError($,_));if(z.length>0)return z;return Object.assign([],{empty:!0},g.streamInfo())}function rQ($,I={}){let{lineCounter:_,prettyErrors:u}=nQ(I),U=new mQ.Parser(_?.addNewLine),g=new lQ.Composer(I),z=null;for(let G of g.compose(U.parse($),!0,$.length))if(!z)z=G;else if(z.options.logLevel!=="silent"){z.errors.push(new u0.YAMLParseError(G.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(u&&_)z.errors.forEach(u0.prettifyError($,_)),z.warnings.forEach(u0.prettifyError($,_));return z}function iA($,I,_){let u=void 0;if(typeof I==="function")u=I;else if(_===void 0&&I&&typeof I==="object")_=I;let U=rQ($,_);if(!U)return null;if(U.warnings.forEach((g)=>fA.warn(U.options.logLevel,g)),U.errors.length>0)if(U.options.logLevel!=="silent")throw U.errors[0];else U.errors=[];return U.toJS(Object.assign({reviver:u},_))}function lA($,I,_){let u=null;if(typeof I==="function"||Array.isArray(I))u=I;else if(_===void 0&&I)_=I;if(typeof _==="string")_=_.length;if(typeof _==="number"){let U=Math.round(_);_=U<1?void 0:U>8?{indent:8}:{indent:U}}if($===void 0){let{keepUndefined:U}=_??I??{};if(!U)return}if(xA.isDocument($)&&!u)return $.toString(_);return new CA.Document($,u,_).toString(_)}mA.parse=iA;mA.parseAllDocuments=yA;mA.parseDocument=rQ;mA.stringify=lA});import{existsSync as u1,mkdirSync as vS,readdirSync as TS,readFileSync as ru,writeFileSync as hH}from"node:fs";import{join as L4}from"node:path";function GI($){return L4($,".serena","memories")}function _1($){try{return ru($,"utf-8")}catch{return""}}function MX($){return($.match(/##\s*ID:\s*(.+)/i)||[])[1]||($.match(/session-id:\s*(.+)/i)||[])[1]||$.match(/(session-\d{8}-\d{6})/)?.[1]}function MS($){let I=$.trim();return I===""||I==="---"}function DX($){let I=(J)=>String(J).padStart(2,"0"),_=$.getFullYear(),u=I($.getMonth()+1),U=I($.getDate()),g=I($.getHours()),z=I($.getMinutes()),G=I($.getSeconds());return`session-${_}${u}${U}-${g}${z}${G}`}function DS($,I){return["# Orchestrator Session",`## ID: ${$}`,`## Started: ${I}`,"## Status: idle","","## Agents","| Agent ID | CLI | PID | Status | Task |","|----------|-----|-----|--------|------|","","## Summary (filled on completion)","- Total Tasks: 0","- Completed: 0","- Failed: 0","- Files Created: []","- Issues: []",""].join(`
|
|
166
|
+
`)}function LS($){return["# Task Board",`## Session: ${$}`,"","| Agent | Status | Task |","|-------|--------|------|",""].join(`
|
|
167
|
+
`)}function LX($){let I=GI($);if(!u1(I))return[];try{return TS(I).filter((_)=>_.endsWith(".md")&&_!==".gitkeep")}catch{return[]}}function cH($,I){let _=$.match(/^progress-(\w+)(?:-[\w-]+)?\.md$/),u=$.match(/^result-(\w+)(?:-[\w-]+)?\.md$/);if(_?.[1])return{agent:_[1],type:"progress",content:I.slice(0,500)};if(u?.[1])return{agent:u[1],type:"result",content:I.slice(0,500)};return null}function dH($){let I=GI($),_={agents:[],activities:[],completedTasks:[],inProgressTasks:[]};if(!u1(I))return _;let u=LX($);for(let U of u){if(U==="orchestrator-session.md"){try{let z=ru(L4(I,U),"utf-8").match(/session[:\s]+(\S+)/i);if(z)_.sessionId=z[1]}catch{}continue}try{let g=ru(L4(I,U),"utf-8"),z=cH(U,g);if(z){if(_.activities.push(z),!_.agents.includes(z.agent))_.agents.push(z.agent);if(z.type==="result"){let G=g.match(/task[:\s]+(.+)/i)||g.match(/##\s*(.+)/);if(G?.[1])_.completedTasks.push(G[1].trim())}else if(z.type==="progress"){let G=g.match(/current[:\s]+(.+)/i)||g.match(/working on[:\s]+(.+)/i);if(G?.[1]&&!_.completedTasks.includes(G[1].trim()))_.inProgressTasks.push(G[1].trim())}}}catch{}}return _}function hu($){let I=GI($),_=L4(I,"orchestrator-session.md");if(!u1(_))return{};let u=_1(_);if(!u)return{};let U=MX(u)?.trim(),g=(u.match(/##\s*Status:\s*(.+)/i)||[])[1]||(u.match(/status:\s*(running|completed|failed|aborted)/i)||[])[1],z=(u.match(/##\s*Started:\s*(.+)/i)||[])[1]||(u.match(/started:\s*(.+)/i)||[])[1];return{id:U,status:g?.trim().toLowerCase(),startedAt:z?.trim()}}function oH($){let I=GI($);if(!u1(I))return 0;let _=0,u=LX($);for(let z of u){if(!z.startsWith("result-"))continue;let G=_1(L4(I,z));if(!G)continue;let J=G.split(`
|
|
168
|
+
`).map((X)=>X.trim()).find((X)=>/^##\s*Status:/i.test(X)||/^Status:/i.test(X));if(J){if(J.match(/status[^:]*:\s*([a-z_]+)/i)?.[1]?.toLowerCase()==="completed")_+=1}}let U=_1(L4(I,"task-board.md"));if(U){let z=U.split(`
|
|
169
|
+
`).map((G)=>G.trim()).filter((G)=>/status/i.test(G)).reduce((G,J)=>{if(J.match(/status[^:]*:\s*([a-z_]+)/i)?.[1]?.toLowerCase()==="completed")return G+1;return G},0);_=Math.max(_,z)}let g=_1(L4(I,"orchestrator-session.md"));if(g){let z=g.match(/Completed:\s*(\d+)/i);if(z?.[1]){let G=parseInt(z[1],10);if(!Number.isNaN(G))_=Math.max(_,G)}}return _}function pH($,I){let _=[],u=GI($);if(!u1(u))return _;let U=I?new Date(I).getTime():0,g=LX($);for(let z of g){if(z==="orchestrator-session.md")continue;try{let G=L4(u,z),J=ru(G,"utf-8"),X=cH(z,J);if(X)_.push(X)}catch{}}return _}function tH($){let I=[];for(let _ of $){let u=_.content.toLowerCase();if(u.includes("error")||u.includes("fail"))I.push(`${_.agent}: Error handling improved`);if(u.includes("refactor"))I.push(`${_.agent}: Code structure refactored`);if(u.includes("test"))I.push(`${_.agent}: Test coverage added`);if(u.includes("performance")||u.includes("optimize"))I.push(`${_.agent}: Performance optimized`)}return[...new Set(I)].slice(0,5)}function aH($,I={}){let _=GI($);if(!u1(_))vS(_,{recursive:!0});let u=_1(L4(_,"orchestrator-session.md")),U=_1(L4(_,"task-board.md")),g=MX(u)||MX(U)||DX(new Date),z=new Date().toISOString(),G=DS(g,z),J=LS(g),X=[],N=[],q=[],Q=(Y,O)=>{let H=L4(_,Y);if(!u1(H)){hH(H,O,"utf-8"),X.push(Y);return}let v=_1(H);if(I.force||MS(v)){hH(H,O,"utf-8"),N.push(Y);return}q.push(Y)};return Q("orchestrator-session.md",G),Q("task-board.md",J),Q(".gitkeep",""),{memoriesDir:_,sessionId:g,created:X,updated:N,skipped:q}}var i0=()=>{};var VX=S((Bn,qY)=>{var RX={to($,I){if(!I)return`\x1B[${$+1}G`;return`\x1B[${I+1};${$+1}H`},move($,I){let _="";if($<0)_+=`\x1B[${-$}D`;else if($>0)_+=`\x1B[${$}C`;if(I<0)_+=`\x1B[${-I}A`;else if(I>0)_+=`\x1B[${I}B`;return _},up:($=1)=>`\x1B[${$}A`,down:($=1)=>`\x1B[${$}B`,forward:($=1)=>`\x1B[${$}C`,backward:($=1)=>`\x1B[${$}D`,nextLine:($=1)=>"\x1B[E".repeat($),prevLine:($=1)=>"\x1B[F".repeat($),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},oS={up:($=1)=>"\x1B[S".repeat($),down:($=1)=>"\x1B[T".repeat($)},pS={screen:"\x1B[2J",up:($=1)=>"\x1B[1J".repeat($),down:($=1)=>"\x1B[J".repeat($),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines($){let I="";for(let _=0;_<$;_++)I+=this.line+(_<$-1?RX.up():"");if($)I+=RX.left;return I}};qY.exports={cursor:RX,scroll:oS,erase:pS,beep:"\x07"}});import{styleText as PX}from"node:util";import{stdout as FX,stdin as OY}from"node:process";import*as V6 from"node:readline";import tS from"node:readline";import{ReadStream as NY}from"node:tty";function p4($,I,_){if(!_.some((z)=>!z.disabled))return $;let u=$+I,U=Math.max(_.length-1,0),g=u<0?U:u>U?0:u;return _[g].disabled?p4(g,I<0?-1:1,_):g}function jX($,I,_){return String($).normalize().replaceAll(`\r
|
|
170
170
|
`,`
|
|
171
171
|
`).split(`
|
|
172
|
-
`).map((u)
|
|
173
|
-
`)}function
|
|
172
|
+
`).map((u)=>JF(u,I,_)).join(`
|
|
173
|
+
`)}function CX($,I){if(typeof $=="string")return F$.aliases.get($)===I;for(let _ of $)if(_!==void 0&&CX(_,I))return!0;return!1}function qF($,I){if($===I)return;let _=$.split(`
|
|
174
174
|
`),u=I.split(`
|
|
175
|
-
`),U=Math.max(_.length,u.length),g=[];for(let z=0;z<U;z++)_[z]!==u[z]&&g.push(z);return{lines:g,numLinesBefore:_.length,numLinesAfter:u.length,numLines:U}}function
|
|
175
|
+
`),U=Math.max(_.length,u.length),g=[];for(let z=0;z<U;z++)_[z]!==u[z]&&g.push(z);return{lines:g,numLinesBefore:_.length,numLinesAfter:u.length,numLines:U}}function J$($){return $===SX}function tu($,I){let _=$;_.isTTY&&_.setRawMode(I)}function LY({input:$=OY,output:I=FX,overwrite:_=!0,hideCursor:u=!0}={}){let U=V6.createInterface({input:$,output:I,prompt:"",tabSize:1});V6.emitKeypressEvents($,U),$ instanceof NY&&$.isTTY&&$.setRawMode(!0);let g=(z,{name:G,sequence:J})=>{let X=String(z);if(CX([X,G,J],"cancel")){u&&I.write(C$.cursor.show),process.exit(0);return}if(!_)return;V6.moveCursor(I,G==="return"?0:-1,G==="return"?-1:0,()=>{V6.clearLine(I,1,()=>{$.once("keypress",g)})})};return u&&I.write(C$.cursor.hide),$.once("keypress",g),()=>{$.off("keypress",g),u&&I.write(C$.cursor.show),$ instanceof NY&&$.isTTY&&!NF&&$.setRawMode(!1),U.terminal=!1,U.close()}}function g1($,I,_,u=_){let U=n0($??FX);return jX(I,U-_.length,{hard:!0,trim:!1}).split(`
|
|
176
176
|
`).map((g,z)=>`${z===0?u:_}${g}`).join(`
|
|
177
|
-
`)}class
|
|
178
|
-
`),
|
|
179
|
-
`).length-1;this.output.write(C$.cursor.move(-999,$*-1))}render(){let $=
|
|
177
|
+
`)}class z1{input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame="";_subscribers=new Map;_cursor=0;state="initial";error="";value;userInput="";constructor($,I=!0){let{input:_=OY,output:u=FX,render:U,signal:g,...z}=$;this.opts=z,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=U.bind(this),this._track=I,this._abortSignal=g,this.input=_,this.output=u}unsubscribe(){this._subscribers.clear()}setSubscriber($,I){let _=this._subscribers.get($)??[];_.push(I),this._subscribers.set($,_)}on($,I){this.setSubscriber($,{cb:I})}once($,I){this.setSubscriber($,{cb:I,once:!0})}emit($,...I){let _=this._subscribers.get($)??[],u=[];for(let U of _)U.cb(...I),U.once&&u.push(()=>_.splice(_.indexOf(U),1));for(let U of u)U()}prompt(){return new Promise(($)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),$(SX);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}this.rl=tS.createInterface({input:this.input,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),this.rl.prompt(),this.opts.initialUserInput!==void 0&&this._setUserInput(this.opts.initialUserInput,!0),this.input.on("keypress",this.onKeypress),tu(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(C$.cursor.show),this.output.off("resize",this.render),tu(this.input,!1),$(this.value)}),this.once("cancel",()=>{this.output.write(C$.cursor.show),this.output.off("resize",this.render),tu(this.input,!1),$(SX)})})}_isActionKey($,I){return $==="\t"}_setValue($){this.value=$,this.emit("value",this.value)}_setUserInput($,I){this.userInput=$??"",this.emit("userInput",this.userInput),I&&this._track&&this.rl&&(this.rl.write(this.userInput),this._cursor=this.rl.cursor)}_clearUserInput(){this.rl?.write(null,{ctrl:!0,name:"u"}),this._setUserInput("")}onKeypress($,I){if(this._track&&I.name!=="return"&&(I.name&&this._isActionKey($,I)&&this.rl?.write(null,{ctrl:!0,name:"h"}),this._cursor=this.rl?.cursor??0,this._setUserInput(this.rl?.line)),this.state==="error"&&(this.state="active"),I?.name&&(!this._track&&F$.aliases.has(I.name)&&this.emit("cursor",F$.aliases.get(I.name)),F$.actions.has(I.name)&&this.emit("cursor",I.name)),$&&($.toLowerCase()==="y"||$.toLowerCase()==="n")&&this.emit("confirm",$.toLowerCase()==="y"),this.emit("key",$?.toLowerCase(),I),I?.name==="return"){if(this.opts.validate){let _=this.opts.validate(this.value);_&&(this.error=_ instanceof Error?_.message:_,this.state="error",this.rl?.write(this.userInput))}this.state!=="error"&&(this.state="submit")}CX([$,I?.name,I?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
|
|
178
|
+
`),tu(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let $=jX(this._prevFrame,process.stdout.columns,{hard:!0,trim:!1}).split(`
|
|
179
|
+
`).length-1;this.output.write(C$.cursor.move(-999,$*-1))}render(){let $=jX(this._render(this)??"",process.stdout.columns,{hard:!0,trim:!1});if($!==this._prevFrame){if(this.state==="initial")this.output.write(C$.cursor.hide);else{let I=qF(this._prevFrame,$),_=fX(this.output);if(this.restoreCursor(),I){let u=Math.max(0,I.numLinesAfter-_),U=Math.max(0,I.numLinesBefore-_),g=I.lines.find((z)=>z>=u);if(g===void 0){this._prevFrame=$;return}if(I.lines.length===1){this.output.write(C$.cursor.move(0,g-U)),this.output.write(C$.erase.lines(1));let z=$.split(`
|
|
180
180
|
`);this.output.write(z[g]),this._prevFrame=$,this.output.write(C$.cursor.move(0,z.length-g-1));return}else if(I.lines.length>1){if(u<U)g=u;else{let G=g-U;G>0&&this.output.write(C$.cursor.move(0,G))}this.output.write(C$.erase.down());let z=$.split(`
|
|
181
181
|
`).slice(g);this.output.write(z.join(`
|
|
182
|
-
`)),this._prevFrame=$;return}}this.output.write(C$.erase.down())}this.output.write($),this.state==="initial"&&(this.state="active"),this._prevFrame=$}}}function
|
|
183
|
-
`),N=X[Symbol.iterator](),q=N.next(),Q=N.next(),Y=0;for(;!q.done;){let O=q.value,H=Q.value;if(u+=O,O===
|
|
184
|
-
`?(g&&(u+=
|
|
185
|
-
`&&(U&&v&&(u+=
|
|
182
|
+
`)),this._prevFrame=$;return}}this.output.write(C$.erase.down())}this.output.write($),this.state==="initial"&&(this.state="active"),this._prevFrame=$}}}function QF($,I){if($===void 0||I.length===0)return 0;let _=I.findIndex((u)=>u.value===$);return _!==-1?_:0}function HF($,I){return(I.label??String(I.value)).toLowerCase().includes($.toLowerCase())}function YF($,I){if(I)return $?I:I[0]}var C$,aS=($)=>$===161||$===164||$===167||$===168||$===170||$===173||$===174||$>=176&&$<=180||$>=182&&$<=186||$>=188&&$<=191||$===198||$===208||$===215||$===216||$>=222&&$<=225||$===230||$>=232&&$<=234||$===236||$===237||$===240||$===242||$===243||$>=247&&$<=250||$===252||$===254||$===257||$===273||$===275||$===283||$===294||$===295||$===299||$>=305&&$<=307||$===312||$>=319&&$<=322||$===324||$>=328&&$<=331||$===333||$===338||$===339||$===358||$===359||$===363||$===462||$===464||$===466||$===468||$===470||$===472||$===474||$===476||$===593||$===609||$===708||$===711||$>=713&&$<=715||$===717||$===720||$>=728&&$<=731||$===733||$===735||$>=768&&$<=879||$>=913&&$<=929||$>=931&&$<=937||$>=945&&$<=961||$>=963&&$<=969||$===1025||$>=1040&&$<=1103||$===1105||$===8208||$>=8211&&$<=8214||$===8216||$===8217||$===8220||$===8221||$>=8224&&$<=8226||$>=8228&&$<=8231||$===8240||$===8242||$===8243||$===8245||$===8251||$===8254||$===8308||$===8319||$>=8321&&$<=8324||$===8364||$===8451||$===8453||$===8457||$===8467||$===8470||$===8481||$===8482||$===8486||$===8491||$===8531||$===8532||$>=8539&&$<=8542||$>=8544&&$<=8555||$>=8560&&$<=8569||$===8585||$>=8592&&$<=8601||$===8632||$===8633||$===8658||$===8660||$===8679||$===8704||$===8706||$===8707||$===8711||$===8712||$===8715||$===8719||$===8721||$===8725||$===8730||$>=8733&&$<=8736||$===8739||$===8741||$>=8743&&$<=8748||$===8750||$>=8756&&$<=8759||$===8764||$===8765||$===8776||$===8780||$===8786||$===8800||$===8801||$>=8804&&$<=8807||$===8810||$===8811||$===8814||$===8815||$===8834||$===8835||$===8838||$===8839||$===8853||$===8857||$===8869||$===8895||$===8978||$>=9312&&$<=9449||$>=9451&&$<=9547||$>=9552&&$<=9587||$>=9600&&$<=9615||$>=9618&&$<=9621||$===9632||$===9633||$>=9635&&$<=9641||$===9650||$===9651||$===9654||$===9655||$===9660||$===9661||$===9664||$===9665||$>=9670&&$<=9672||$===9675||$>=9678&&$<=9681||$>=9698&&$<=9701||$===9711||$===9733||$===9734||$===9737||$===9742||$===9743||$===9756||$===9758||$===9792||$===9794||$===9824||$===9825||$>=9827&&$<=9829||$>=9831&&$<=9834||$===9836||$===9837||$===9839||$===9886||$===9887||$===9919||$>=9926&&$<=9933||$>=9935&&$<=9939||$>=9941&&$<=9953||$===9955||$===9960||$===9961||$>=9963&&$<=9969||$===9972||$>=9974&&$<=9977||$===9979||$===9980||$===9982||$===9983||$===10045||$>=10102&&$<=10111||$>=11094&&$<=11097||$>=12872&&$<=12879||$>=57344&&$<=63743||$>=65024&&$<=65039||$===65533||$>=127232&&$<=127242||$>=127248&&$<=127277||$>=127280&&$<=127337||$>=127344&&$<=127373||$===127375||$===127376||$>=127387&&$<=127404||$>=917760&&$<=917999||$>=983040&&$<=1048573||$>=1048576&&$<=1114109,eS=($)=>$===12288||$>=65281&&$<=65376||$>=65504&&$<=65510,sS=($)=>$>=4352&&$<=4447||$===8986||$===8987||$===9001||$===9002||$>=9193&&$<=9196||$===9200||$===9203||$===9725||$===9726||$===9748||$===9749||$>=9800&&$<=9811||$===9855||$===9875||$===9889||$===9898||$===9899||$===9917||$===9918||$===9924||$===9925||$===9934||$===9940||$===9962||$===9970||$===9971||$===9973||$===9978||$===9981||$===9989||$===9994||$===9995||$===10024||$===10060||$===10062||$>=10067&&$<=10069||$===10071||$>=10133&&$<=10135||$===10160||$===10175||$===11035||$===11036||$===11088||$===11093||$>=11904&&$<=11929||$>=11931&&$<=12019||$>=12032&&$<=12245||$>=12272&&$<=12287||$>=12289&&$<=12350||$>=12353&&$<=12438||$>=12441&&$<=12543||$>=12549&&$<=12591||$>=12593&&$<=12686||$>=12688&&$<=12771||$>=12783&&$<=12830||$>=12832&&$<=12871||$>=12880&&$<=19903||$>=19968&&$<=42124||$>=42128&&$<=42182||$>=43360&&$<=43388||$>=44032&&$<=55203||$>=63744&&$<=64255||$>=65040&&$<=65049||$>=65072&&$<=65106||$>=65108&&$<=65126||$>=65128&&$<=65131||$>=94176&&$<=94180||$===94192||$===94193||$>=94208&&$<=100343||$>=100352&&$<=101589||$>=101632&&$<=101640||$>=110576&&$<=110579||$>=110581&&$<=110587||$===110589||$===110590||$>=110592&&$<=110882||$===110898||$>=110928&&$<=110930||$===110933||$>=110948&&$<=110951||$>=110960&&$<=111355||$===126980||$===127183||$===127374||$>=127377&&$<=127386||$>=127488&&$<=127490||$>=127504&&$<=127547||$>=127552&&$<=127560||$===127568||$===127569||$>=127584&&$<=127589||$>=127744&&$<=127776||$>=127789&&$<=127797||$>=127799&&$<=127868||$>=127870&&$<=127891||$>=127904&&$<=127946||$>=127951&&$<=127955||$>=127968&&$<=127984||$===127988||$>=127992&&$<=128062||$===128064||$>=128066&&$<=128252||$>=128255&&$<=128317||$>=128331&&$<=128334||$>=128336&&$<=128359||$===128378||$===128405||$===128406||$===128420||$>=128507&&$<=128591||$>=128640&&$<=128709||$===128716||$>=128720&&$<=128722||$>=128725&&$<=128727||$>=128732&&$<=128735||$===128747||$===128748||$>=128756&&$<=128764||$>=128992&&$<=129003||$===129008||$>=129292&&$<=129338||$>=129340&&$<=129349||$>=129351&&$<=129535||$>=129648&&$<=129660||$>=129664&&$<=129672||$>=129680&&$<=129725||$>=129727&&$<=129733||$>=129742&&$<=129755||$>=129760&&$<=129768||$>=129776&&$<=129784||$>=131072&&$<=196605||$>=196608&&$<=262141,ZX,du,ou,AX,pu,$F,IF,vY=($,I={},_={})=>{let u=I.limit??1/0,U=I.ellipsis??"",g=I?.ellipsisWidth??(U?vY(U,IF,_).width:0),z=_.ansiWidth??0,G=_.controlWidth??0,J=_.tabWidth??8,X=_.ambiguousWidth??1,N=_.emojiWidth??2,q=_.fullWidthWidth??2,Q=_.regularWidth??1,Y=_.wideWidth??2,O=0,H=0,v=$.length,T=0,K=!1,D=v,B=Math.max(0,u-g),R=0,V=0,M=0,W=0;$:for(;;){if(V>R||H>=v&&H>O){let E=$.slice(R,V)||$.slice(O,H);T=0;for(let C of E.replaceAll($F,"")){let k=C.codePointAt(0)||0;if(eS(k)?W=q:sS(k)?W=Y:X!==Q&&aS(k)?W=X:W=Q,M+W>B&&(D=Math.min(D,Math.max(R,O)+T)),M+W>u){K=!0;break $}T+=C.length,M+=W}R=V=0}if(H>=v)break;if(pu.lastIndex=H,pu.test($)){if(T=pu.lastIndex-H,W=T*Q,M+W>B&&(D=Math.min(D,H+Math.floor((B-M)/Q))),M+W>u){K=!0;break}M+=W,R=O,V=H,H=O=pu.lastIndex;continue}if(ZX.lastIndex=H,ZX.test($)){if(M+z>B&&(D=Math.min(D,H)),M+z>u){K=!0;break}M+=z,R=O,V=H,H=O=ZX.lastIndex;continue}if(du.lastIndex=H,du.test($)){if(T=du.lastIndex-H,W=T*G,M+W>B&&(D=Math.min(D,H+Math.floor((B-M)/G))),M+W>u){K=!0;break}M+=W,R=O,V=H,H=O=du.lastIndex;continue}if(ou.lastIndex=H,ou.test($)){if(T=ou.lastIndex-H,W=T*J,M+W>B&&(D=Math.min(D,H+Math.floor((B-M)/J))),M+W>u){K=!0;break}M+=W,R=O,V=H,H=O=ou.lastIndex;continue}if(AX.lastIndex=H,AX.test($)){if(M+N>B&&(D=Math.min(D,H)),M+N>u){K=!0;break}M+=N,R=O,V=H,H=O=AX.lastIndex;continue}H+=1}return{width:K?B:M,index:K?D:v,truncated:K,ellipsed:K&&u>=g}},UF,m0=($,I={})=>vY($,UF,I).width,au="\x1B",TY="",_F=39,wX="\x07",MY="[",uF="]",DY="m",EX,QY,gF=($)=>{if($>=30&&$<=37||$>=90&&$<=97)return 39;if($>=40&&$<=47||$>=100&&$<=107)return 49;if($===1||$===2)return 22;if($===3)return 23;if($===4)return 24;if($===7)return 27;if($===8)return 28;if($===9)return 29;if($===0)return 0},HY=($)=>`${au}${MY}${$}${DY}`,YY=($)=>`${au}${EX}${$}${wX}`,zF=($)=>$.map((I)=>m0(I)),bX=($,I,_)=>{let u=I[Symbol.iterator](),U=!1,g=!1,z=$.at(-1),G=z===void 0?0:m0(z),J=u.next(),X=u.next(),N=0;for(;!J.done;){let q=J.value,Q=m0(q);G+Q<=_?$[$.length-1]+=q:($.push(q),G=0),(q===au||q===TY)&&(U=!0,g=I.startsWith(EX,N+1)),U?g?q===wX&&(U=!1,g=!1):q===DY&&(U=!1):(G+=Q,G===_&&!X.done&&($.push(""),G=0)),J=X,X=u.next(),N+=q.length}z=$.at(-1),!G&&z!==void 0&&z.length>0&&$.length>1&&($[$.length-2]+=$.pop())},GF=($)=>{let I=$.split(" "),_=I.length;for(;_>0&&!(m0(I[_-1])>0);)_--;return _===I.length?$:I.slice(0,_).join(" ")+I.slice(_).join("")},JF=($,I,_={})=>{if(_.trim!==!1&&$.trim()==="")return"";let u="",U,g,z=$.split(" "),G=zF(z),J=[""];for(let[O,H]of z.entries()){_.trim!==!1&&(J[J.length-1]=(J.at(-1)??"").trimStart());let v=m0(J.at(-1)??"");if(O!==0&&(v>=I&&(_.wordWrap===!1||_.trim===!1)&&(J.push(""),v=0),(v>0||_.trim===!1)&&(J[J.length-1]+=" ",v++)),_.hard&&G[O]>I){let T=I-v,K=1+Math.floor((G[O]-T-1)/I);Math.floor((G[O]-1)/I)<K&&J.push(""),bX(J,H,I);continue}if(v+G[O]>I&&v>0&&G[O]>0){if(_.wordWrap===!1&&v<I){bX(J,H,I);continue}J.push("")}if(v+G[O]>I&&_.wordWrap===!1){bX(J,H,I);continue}J[J.length-1]+=H}_.trim!==!1&&(J=J.map((O)=>GF(O)));let X=J.join(`
|
|
183
|
+
`),N=X[Symbol.iterator](),q=N.next(),Q=N.next(),Y=0;for(;!q.done;){let O=q.value,H=Q.value;if(u+=O,O===au||O===TY){QY.lastIndex=Y+1;let T=QY.exec(X)?.groups;if(T?.code!==void 0){let K=Number.parseFloat(T.code);U=K===_F?void 0:K}else T?.uri!==void 0&&(g=T.uri.length===0?void 0:T.uri)}let v=U?gF(U):void 0;H===`
|
|
184
|
+
`?(g&&(u+=YY("")),U&&v&&(u+=HY(v))):O===`
|
|
185
|
+
`&&(U&&v&&(u+=HY(U)),g&&(u+=YY(g))),Y+=O.length,q=Q,Q=N.next()}return u},XF,F$,NF,SX,n0=($)=>("columns"in $)&&typeof $.columns=="number"?$.columns:80,fX=($)=>("rows"in $)&&typeof $.rows=="number"?$.rows:20,BY,xX,KY,WY,kX,yX;var iX=wI(()=>{C$=O$(VX(),1);ZX=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,du=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,ou=/\t{1,1000}/y,AX=/[\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,pu=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,$F=/\p{M}+/gu,IF={limit:1/0,ellipsis:""},UF={limit:1/0,ellipsis:"",ellipsisWidth:0},EX=`${uF}8;;`,QY=new RegExp(`(?:\\${MY}(?<code>\\d+)m|\\${EX}(?<uri>.*)${wX})`,"y");XF=["up","down","left","right","space","enter","cancel"],F$={actions:new Set(XF),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"},withGuide:!0};NF=globalThis.process.platform.startsWith("win"),SX=Symbol("clack:cancel");BY=class BY extends z1{filteredOptions;multiple;isNavigating=!1;selectedValues=[];focusedValue;#$=0;#U="";#_;#I;get cursor(){return this.#$}get userInputWithCursor(){if(!this.userInput)return PX(["inverse","hidden"],"_");if(this._cursor>=this.userInput.length)return`${this.userInput}█`;let $=this.userInput.slice(0,this._cursor),[I,..._]=this.userInput.slice(this._cursor);return`${$}${PX("inverse",I)}${_.join("")}`}get options(){return typeof this.#I=="function"?this.#I():this.#I}constructor($){super($),this.#I=$.options;let I=this.options;this.filteredOptions=[...I],this.multiple=$.multiple===!0,this.#_=$.filter??HF;let _;if($.initialValue&&Array.isArray($.initialValue)?this.multiple?_=$.initialValue:_=$.initialValue.slice(0,1):!this.multiple&&this.options.length>0&&(_=[this.options[0].value]),_)for(let u of _){let U=I.findIndex((g)=>g.value===u);U!==-1&&(this.toggleSelected(u),this.#$=U)}this.focusedValue=this.options[this.#$]?.value,this.on("key",(u,U)=>this.#u(u,U)),this.on("userInput",(u)=>this.#g(u))}_isActionKey($,I){return $==="\t"||this.multiple&&this.isNavigating&&I.name==="space"&&$!==void 0&&$!==""}#u($,I){let _=I.name==="up",u=I.name==="down",U=I.name==="return";_||u?(this.#$=p4(this.#$,_?-1:1,this.filteredOptions),this.focusedValue=this.filteredOptions[this.#$]?.value,this.multiple||(this.selectedValues=[this.focusedValue]),this.isNavigating=!0):U?this.value=YF(this.multiple,this.selectedValues):this.multiple?this.focusedValue!==void 0&&(I.name==="tab"||this.isNavigating&&I.name==="space")?this.toggleSelected(this.focusedValue):this.isNavigating=!1:(this.focusedValue&&(this.selectedValues=[this.focusedValue]),this.isNavigating=!1)}deselectAll(){this.selectedValues=[]}toggleSelected($){this.filteredOptions.length!==0&&(this.multiple?this.selectedValues.includes($)?this.selectedValues=this.selectedValues.filter((I)=>I!==$):this.selectedValues=[...this.selectedValues,$]:this.selectedValues=[$])}#g($){if($!==this.#U){this.#U=$;let I=this.options;$?this.filteredOptions=I.filter((U)=>this.#_($,U)):this.filteredOptions=[...I];let _=QF(this.focusedValue,this.filteredOptions);this.#$=p4(_,0,this.filteredOptions);let u=this.filteredOptions[this.#$];u&&!u.disabled?this.focusedValue=u.value:this.focusedValue=void 0,this.multiple||(this.focusedValue!==void 0?this.toggleSelected(this.focusedValue):this.deselectAll())}}};xX=class xX extends z1{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor($){super($,!1),this.value=!!$.initialValue,this.on("userInput",()=>{this.value=this._value}),this.on("confirm",(I)=>{this.output.write(C$.cursor.move(0,-1)),this.value=I,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};KY=class KY extends z1{options;cursor=0;#$;getGroupItems($){return this.options.filter((I)=>I.group===$)}isGroupSelected($){let I=this.getGroupItems($),_=this.value;return _===void 0?!1:I.every((u)=>_.includes(u.value))}toggleValue(){let $=this.options[this.cursor];if(this.value===void 0&&(this.value=[]),$.group===!0){let I=$.value,_=this.getGroupItems(I);this.isGroupSelected(I)?this.value=this.value.filter((u)=>_.findIndex((U)=>U.value===u)===-1):this.value=[...this.value,..._.map((u)=>u.value)],this.value=Array.from(new Set(this.value))}else{let I=this.value.includes($.value);this.value=I?this.value.filter((_)=>_!==$.value):[...this.value,$.value]}}constructor($){super($,!1);let{options:I}=$;this.#$=$.selectableGroups!==!1,this.options=Object.entries(I).flatMap(([_,u])=>[{value:_,group:!0,label:_},...u.map((U)=>({...U,group:_}))]),this.value=[...$.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:_})=>_===$.cursorAt),this.#$?0:1),this.on("cursor",(_)=>{switch(_){case"left":case"up":{this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;let u=this.options[this.cursor]?.group===!0;!this.#$&&u&&(this.cursor=this.cursor===0?this.options.length-1:this.cursor-1);break}case"down":case"right":{this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;let u=this.options[this.cursor]?.group===!0;!this.#$&&u&&(this.cursor=this.cursor===this.options.length-1?0:this.cursor+1);break}case"space":this.toggleValue();break}})}};WY=class extends z1{options;cursor=0;get _value(){return this.options[this.cursor].value}get _enabledOptions(){return this.options.filter(($)=>$.disabled!==!0)}toggleAll(){let $=this._enabledOptions,I=this.value!==void 0&&this.value.length===$.length;this.value=I?[]:$.map((_)=>_.value)}toggleInvert(){let $=this.value;if(!$)return;let I=this._enabledOptions.filter((_)=>!$.includes(_.value));this.value=I.map((_)=>_.value)}toggleValue(){this.value===void 0&&(this.value=[]);let $=this.value.includes(this._value);this.value=$?this.value.filter((I)=>I!==this._value):[...this.value,this._value]}constructor($){super($,!1),this.options=$.options,this.value=[...$.initialValues??[]];let I=Math.max(this.options.findIndex(({value:_})=>_===$.cursorAt),0);this.cursor=this.options[I].disabled?p4(I,1,this.options):I,this.on("key",(_)=>{_==="a"&&this.toggleAll(),_==="i"&&this.toggleInvert()}),this.on("cursor",(_)=>{switch(_){case"left":case"up":this.cursor=p4(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=p4(this.cursor,1,this.options);break;case"space":this.toggleValue();break}})}};kX=class kX extends z1{options;cursor=0;get _selectedValue(){return this.options[this.cursor]}changeValue(){this.value=this._selectedValue.value}constructor($){super($,!1),this.options=$.options;let I=this.options.findIndex(({value:u})=>u===$.initialValue),_=I===-1?0:I;this.cursor=this.options[_].disabled?p4(_,1,this.options):_,this.changeValue(),this.on("cursor",(u)=>{switch(u){case"left":case"up":this.cursor=p4(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=p4(this.cursor,1,this.options);break}this.changeValue()})}};yX=class yX extends z1{get userInputWithCursor(){if(this.state==="submit")return this.userInput;let $=this.userInput;if(this.cursor>=$.length)return`${this.userInput}█`;let I=$.slice(0,this.cursor),[_,...u]=$.slice(this.cursor);return`${I}${PX("inverse",_)}${u.join("")}`}get cursor(){return this._cursor}constructor($){super({...$,initialUserInput:$.initialUserInput??$.initialValue}),this.on("userInput",(I)=>{this._setValue(I)}),this.on("finalize",()=>{this.value||(this.value=$.defaultValue),this.value===void 0&&(this.value="")})}}});import{styleText as A,stripVTControlCharacters as wn}from"node:util";import Q4 from"node:process";function OF(){return Q4.platform!=="win32"?Q4.env.TERM!=="linux":!!Q4.env.CI||!!Q4.env.WT_SESSION||!!Q4.env.TERMINUS_SUBLIME||Q4.env.ConEmuTask==="{cmd::Cmder}"||Q4.env.TERM_PROGRAM==="Terminus-Sublime"||Q4.env.TERM_PROGRAM==="vscode"||Q4.env.TERM==="xterm-256color"||Q4.env.TERM==="alacritty"||Q4.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}function c0($,I,_){return String($).normalize().replaceAll(`\r
|
|
186
186
|
`,`
|
|
187
187
|
`).split(`
|
|
188
|
-
`).map((u)=>
|
|
189
|
-
`)}var
|
|
190
|
-
`),N=X[Symbol.iterator](),q=N.next(),Q=N.next(),Y=0;for(;!q.done;){let O=q.value,H=Q.value;if(u+=O,O===
|
|
191
|
-
`?(g&&(u+=
|
|
192
|
-
`&&(U&&v&&(u+=
|
|
193
|
-
`);v.push(
|
|
194
|
-
`:""}${
|
|
195
|
-
`,g=this.value?I:_;switch(this.state){case"submit":{let z=u?`${
|
|
196
|
-
${
|
|
197
|
-
${
|
|
198
|
-
`:` ${
|
|
188
|
+
`).map((u)=>yF(u,I,_)).join(`
|
|
189
|
+
`)}var h0,rX,vF=()=>process.env.CI==="true",Q$=($,I)=>rX?$:I,TF,jY,SY,_2,MF,s,Z6,Cn,fn,hX,U2,DF,RY,VY,xn,ZY,LF,BF,KF,WF,kn,RF,VF,ZF,AF,u2=($)=>{switch($){case"initial":case"active":return A("cyan",TF);case"cancel":return A("red",jY);case"error":return A("yellow",SY);case"submit":return A("green",_2)}},FY=($)=>{switch($){case"initial":case"active":return A("cyan",s);case"cancel":return A("red",s);case"error":return A("yellow",s);case"submit":return A("green",s)}},bF=($)=>$===161||$===164||$===167||$===168||$===170||$===173||$===174||$>=176&&$<=180||$>=182&&$<=186||$>=188&&$<=191||$===198||$===208||$===215||$===216||$>=222&&$<=225||$===230||$>=232&&$<=234||$===236||$===237||$===240||$===242||$===243||$>=247&&$<=250||$===252||$===254||$===257||$===273||$===275||$===283||$===294||$===295||$===299||$>=305&&$<=307||$===312||$>=319&&$<=322||$===324||$>=328&&$<=331||$===333||$===338||$===339||$===358||$===359||$===363||$===462||$===464||$===466||$===468||$===470||$===472||$===474||$===476||$===593||$===609||$===708||$===711||$>=713&&$<=715||$===717||$===720||$>=728&&$<=731||$===733||$===735||$>=768&&$<=879||$>=913&&$<=929||$>=931&&$<=937||$>=945&&$<=961||$>=963&&$<=969||$===1025||$>=1040&&$<=1103||$===1105||$===8208||$>=8211&&$<=8214||$===8216||$===8217||$===8220||$===8221||$>=8224&&$<=8226||$>=8228&&$<=8231||$===8240||$===8242||$===8243||$===8245||$===8251||$===8254||$===8308||$===8319||$>=8321&&$<=8324||$===8364||$===8451||$===8453||$===8457||$===8467||$===8470||$===8481||$===8482||$===8486||$===8491||$===8531||$===8532||$>=8539&&$<=8542||$>=8544&&$<=8555||$>=8560&&$<=8569||$===8585||$>=8592&&$<=8601||$===8632||$===8633||$===8658||$===8660||$===8679||$===8704||$===8706||$===8707||$===8711||$===8712||$===8715||$===8719||$===8721||$===8725||$===8730||$>=8733&&$<=8736||$===8739||$===8741||$>=8743&&$<=8748||$===8750||$>=8756&&$<=8759||$===8764||$===8765||$===8776||$===8780||$===8786||$===8800||$===8801||$>=8804&&$<=8807||$===8810||$===8811||$===8814||$===8815||$===8834||$===8835||$===8838||$===8839||$===8853||$===8857||$===8869||$===8895||$===8978||$>=9312&&$<=9449||$>=9451&&$<=9547||$>=9552&&$<=9587||$>=9600&&$<=9615||$>=9618&&$<=9621||$===9632||$===9633||$>=9635&&$<=9641||$===9650||$===9651||$===9654||$===9655||$===9660||$===9661||$===9664||$===9665||$>=9670&&$<=9672||$===9675||$>=9678&&$<=9681||$>=9698&&$<=9701||$===9711||$===9733||$===9734||$===9737||$===9742||$===9743||$===9756||$===9758||$===9792||$===9794||$===9824||$===9825||$>=9827&&$<=9829||$>=9831&&$<=9834||$===9836||$===9837||$===9839||$===9886||$===9887||$===9919||$>=9926&&$<=9933||$>=9935&&$<=9939||$>=9941&&$<=9953||$===9955||$===9960||$===9961||$>=9963&&$<=9969||$===9972||$>=9974&&$<=9977||$===9979||$===9980||$===9982||$===9983||$===10045||$>=10102&&$<=10111||$>=11094&&$<=11097||$>=12872&&$<=12879||$>=57344&&$<=63743||$>=65024&&$<=65039||$===65533||$>=127232&&$<=127242||$>=127248&&$<=127277||$>=127280&&$<=127337||$>=127344&&$<=127373||$===127375||$===127376||$>=127387&&$<=127404||$>=917760&&$<=917999||$>=983040&&$<=1048573||$>=1048576&&$<=1114109,PF=($)=>$===12288||$>=65281&&$<=65376||$>=65504&&$<=65510,jF=($)=>$>=4352&&$<=4447||$===8986||$===8987||$===9001||$===9002||$>=9193&&$<=9196||$===9200||$===9203||$===9725||$===9726||$===9748||$===9749||$>=9800&&$<=9811||$===9855||$===9875||$===9889||$===9898||$===9899||$===9917||$===9918||$===9924||$===9925||$===9934||$===9940||$===9962||$===9970||$===9971||$===9973||$===9978||$===9981||$===9989||$===9994||$===9995||$===10024||$===10060||$===10062||$>=10067&&$<=10069||$===10071||$>=10133&&$<=10135||$===10160||$===10175||$===11035||$===11036||$===11088||$===11093||$>=11904&&$<=11929||$>=11931&&$<=12019||$>=12032&&$<=12245||$>=12272&&$<=12287||$>=12289&&$<=12350||$>=12353&&$<=12438||$>=12441&&$<=12543||$>=12549&&$<=12591||$>=12593&&$<=12686||$>=12688&&$<=12771||$>=12783&&$<=12830||$>=12832&&$<=12871||$>=12880&&$<=19903||$>=19968&&$<=42124||$>=42128&&$<=42182||$>=43360&&$<=43388||$>=44032&&$<=55203||$>=63744&&$<=64255||$>=65040&&$<=65049||$>=65072&&$<=65106||$>=65108&&$<=65126||$>=65128&&$<=65131||$>=94176&&$<=94180||$===94192||$===94193||$>=94208&&$<=100343||$>=100352&&$<=101589||$>=101632&&$<=101640||$>=110576&&$<=110579||$>=110581&&$<=110587||$===110589||$===110590||$>=110592&&$<=110882||$===110898||$>=110928&&$<=110930||$===110933||$>=110948&&$<=110951||$>=110960&&$<=111355||$===126980||$===127183||$===127374||$>=127377&&$<=127386||$>=127488&&$<=127490||$>=127504&&$<=127547||$>=127552&&$<=127560||$===127568||$===127569||$>=127584&&$<=127589||$>=127744&&$<=127776||$>=127789&&$<=127797||$>=127799&&$<=127868||$>=127870&&$<=127891||$>=127904&&$<=127946||$>=127951&&$<=127955||$>=127968&&$<=127984||$===127988||$>=127992&&$<=128062||$===128064||$>=128066&&$<=128252||$>=128255&&$<=128317||$>=128331&&$<=128334||$>=128336&&$<=128359||$===128378||$===128405||$===128406||$===128420||$>=128507&&$<=128591||$>=128640&&$<=128709||$===128716||$>=128720&&$<=128722||$>=128725&&$<=128727||$>=128732&&$<=128735||$===128747||$===128748||$>=128756&&$<=128764||$>=128992&&$<=129003||$===129008||$>=129292&&$<=129338||$>=129340&&$<=129349||$>=129351&&$<=129535||$>=129648&&$<=129660||$>=129664&&$<=129672||$>=129680&&$<=129725||$>=129727&&$<=129733||$>=129742&&$<=129755||$>=129760&&$<=129768||$>=129776&&$<=129784||$>=131072&&$<=196605||$>=196608&&$<=262141,lX,eu,su,mX,$2,SF,FF,wY=($,I={},_={})=>{let u=I.limit??1/0,U=I.ellipsis??"",g=I?.ellipsisWidth??(U?wY(U,FF,_).width:0),z=_.ansiWidth??0,G=_.controlWidth??0,J=_.tabWidth??8,X=_.ambiguousWidth??1,N=_.emojiWidth??2,q=_.fullWidthWidth??2,Q=_.regularWidth??1,Y=_.wideWidth??2,O=0,H=0,v=$.length,T=0,K=!1,D=v,B=Math.max(0,u-g),R=0,V=0,M=0,W=0;$:for(;;){if(V>R||H>=v&&H>O){let E=$.slice(R,V)||$.slice(O,H);T=0;for(let C of E.replaceAll(SF,"")){let k=C.codePointAt(0)||0;if(PF(k)?W=q:jF(k)?W=Y:X!==Q&&bF(k)?W=X:W=Q,M+W>B&&(D=Math.min(D,Math.max(R,O)+T)),M+W>u){K=!0;break $}T+=C.length,M+=W}R=V=0}if(H>=v)break;if($2.lastIndex=H,$2.test($)){if(T=$2.lastIndex-H,W=T*Q,M+W>B&&(D=Math.min(D,H+Math.floor((B-M)/Q))),M+W>u){K=!0;break}M+=W,R=O,V=H,H=O=$2.lastIndex;continue}if(lX.lastIndex=H,lX.test($)){if(M+z>B&&(D=Math.min(D,H)),M+z>u){K=!0;break}M+=z,R=O,V=H,H=O=lX.lastIndex;continue}if(eu.lastIndex=H,eu.test($)){if(T=eu.lastIndex-H,W=T*G,M+W>B&&(D=Math.min(D,H+Math.floor((B-M)/G))),M+W>u){K=!0;break}M+=W,R=O,V=H,H=O=eu.lastIndex;continue}if(su.lastIndex=H,su.test($)){if(T=su.lastIndex-H,W=T*J,M+W>B&&(D=Math.min(D,H+Math.floor((B-M)/J))),M+W>u){K=!0;break}M+=W,R=O,V=H,H=O=su.lastIndex;continue}if(mX.lastIndex=H,mX.test($)){if(M+N>B&&(D=Math.min(D,H)),M+N>u){K=!0;break}M+=N,R=O,V=H,H=O=mX.lastIndex;continue}H+=1}return{width:K?B:M,index:K?D:v,truncated:K,ellipsed:K&&u>=g}},wF,f4=($,I={})=>wY($,wF,I).width,g2="\x1B",EY="",EF=39,dX="\x07",CY="[",CF="]",fY="m",oX,AY,fF=($)=>{if($>=30&&$<=37||$>=90&&$<=97)return 39;if($>=40&&$<=47||$>=100&&$<=107)return 49;if($===1||$===2)return 22;if($===3)return 23;if($===4)return 24;if($===7)return 27;if($===8)return 28;if($===9)return 29;if($===0)return 0},bY=($)=>`${g2}${CY}${$}${fY}`,PY=($)=>`${g2}${oX}${$}${dX}`,xF=($)=>$.map((I)=>f4(I)),nX=($,I,_)=>{let u=I[Symbol.iterator](),U=!1,g=!1,z=$.at(-1),G=z===void 0?0:f4(z),J=u.next(),X=u.next(),N=0;for(;!J.done;){let q=J.value,Q=f4(q);G+Q<=_?$[$.length-1]+=q:($.push(q),G=0),(q===g2||q===EY)&&(U=!0,g=I.startsWith(oX,N+1)),U?g?q===dX&&(U=!1,g=!1):q===fY&&(U=!1):(G+=Q,G===_&&!X.done&&($.push(""),G=0)),J=X,X=u.next(),N+=q.length}z=$.at(-1),!G&&z!==void 0&&z.length>0&&$.length>1&&($[$.length-2]+=$.pop())},kF=($)=>{let I=$.split(" "),_=I.length;for(;_>0&&!(f4(I[_-1])>0);)_--;return _===I.length?$:I.slice(0,_).join(" ")+I.slice(_).join("")},yF=($,I,_={})=>{if(_.trim!==!1&&$.trim()==="")return"";let u="",U,g,z=$.split(" "),G=xF(z),J=[""];for(let[O,H]of z.entries()){_.trim!==!1&&(J[J.length-1]=(J.at(-1)??"").trimStart());let v=f4(J.at(-1)??"");if(O!==0&&(v>=I&&(_.wordWrap===!1||_.trim===!1)&&(J.push(""),v=0),(v>0||_.trim===!1)&&(J[J.length-1]+=" ",v++)),_.hard&&G[O]>I){let T=I-v,K=1+Math.floor((G[O]-T-1)/I);Math.floor((G[O]-1)/I)<K&&J.push(""),nX(J,H,I);continue}if(v+G[O]>I&&v>0&&G[O]>0){if(_.wordWrap===!1&&v<I){nX(J,H,I);continue}J.push("")}if(v+G[O]>I&&_.wordWrap===!1){nX(J,H,I);continue}J[J.length-1]+=H}_.trim!==!1&&(J=J.map((O)=>kF(O)));let X=J.join(`
|
|
190
|
+
`),N=X[Symbol.iterator](),q=N.next(),Q=N.next(),Y=0;for(;!q.done;){let O=q.value,H=Q.value;if(u+=O,O===g2||O===EY){AY.lastIndex=Y+1;let T=AY.exec(X)?.groups;if(T?.code!==void 0){let K=Number.parseFloat(T.code);U=K===EF?void 0:K}else T?.uri!==void 0&&(g=T.uri.length===0?void 0:T.uri)}let v=U?fF(U):void 0;H===`
|
|
191
|
+
`?(g&&(u+=PY("")),U&&v&&(u+=bY(v))):O===`
|
|
192
|
+
`&&(U&&v&&(u+=bY(U)),g&&(u+=PY(g))),Y+=O.length,q=Q,Q=N.next()}return u},iF=($,I,_,u,U)=>{let g=I,z=0;for(let G=_;G<u;G++){let J=$[G];if(g=g-J.length,z++,g<=U)break}return{lineCount:g,removals:z}},cX=({cursor:$,options:I,style:_,output:u=process.stdout,maxItems:U=Number.POSITIVE_INFINITY,columnPadding:g=0,rowPadding:z=4})=>{let G=n0(u)-g,J=fX(u),X=A("dim","..."),N=Math.max(J-z,0),q=Math.max(Math.min(U,N),5),Q=0;$>=q-3&&(Q=Math.max(Math.min($-q+3,I.length-q),0));let Y=q<I.length&&Q>0,O=q<I.length&&Q+q<I.length,H=Math.min(Q+q,I.length),v=[],T=0;Y&&T++,O&&T++;let K=Q+(Y?1:0),D=H-(O?1:0);for(let R=K;R<D;R++){let V=c0(_(I[R],R===$),G,{hard:!0,trim:!1}).split(`
|
|
193
|
+
`);v.push(V),T+=V.length}if(T>N){let R=0,V=0,M=T,W=$-K,E=(C,k)=>iF(v,M,C,k,N);Y?({lineCount:M,removals:R}=E(0,W),M>N&&({lineCount:M,removals:V}=E(W+1,v.length))):({lineCount:M,removals:V}=E(W+1,v.length),M>N&&({lineCount:M,removals:R}=E(0,W))),R>0&&(Y=!0,v.splice(0,R)),V>0&&(O=!0,v.splice(v.length-V,V))}let B=[];Y&&B.push(X);for(let R of v)for(let V of R)B.push(V);return O&&B.push(X),B},f$=($)=>{let I=$.active??"Yes",_=$.inactive??"No";return new xX({active:I,inactive:_,signal:$.signal,input:$.input,output:$.output,initialValue:$.initialValue??!0,render(){let u=$.withGuide??F$.withGuide,U=`${u?`${A("gray",s)}
|
|
194
|
+
`:""}${u2(this.state)} ${$.message}
|
|
195
|
+
`,g=this.value?I:_;switch(this.state){case"submit":{let z=u?`${A("gray",s)} `:"";return`${U}${z}${A("dim",g)}`}case"cancel":{let z=u?`${A("gray",s)} `:"";return`${U}${z}${A(["strikethrough","dim"],g)}${u?`
|
|
196
|
+
${A("gray",s)}`:""}`}default:{let z=u?`${A("cyan",s)} `:"",G=u?A("cyan",Z6):"";return`${U}${z}${this.value?`${A("green",hX)} ${I}`:`${A("dim",U2)} ${A("dim",I)}`}${$.vertical?u?`
|
|
197
|
+
${A("cyan",s)} `:`
|
|
198
|
+
`:` ${A("dim","/")} `}${this.value?`${A("dim",U2)} ${A("dim",_)}`:`${A("green",hX)} ${_}`}
|
|
199
199
|
${G}
|
|
200
|
-
`}}}}).prompt()},U$,
|
|
200
|
+
`}}}}).prompt()},U$,c$=($="",I)=>{let _=I?.output??process.stdout,u=I?.withGuide??F$.withGuide?`${A("gray",Z6)} `:"";_.write(`${u}${A("red",$)}
|
|
201
201
|
|
|
202
|
-
`)},L$=($="",I)=>{let _=I?.output??process.stdout,u=I?.withGuide??F$.withGuide?`${
|
|
203
|
-
`)},p=($="",I)=>{let _=I?.output??process.stdout,u=I?.withGuide??F$.withGuide?`${
|
|
204
|
-
${
|
|
202
|
+
`)},L$=($="",I)=>{let _=I?.output??process.stdout,u=I?.withGuide??F$.withGuide?`${A("gray",MF)} `:"";_.write(`${u}${$}
|
|
203
|
+
`)},p=($="",I)=>{let _=I?.output??process.stdout,u=I?.withGuide??F$.withGuide?`${A("gray",s)}
|
|
204
|
+
${A("gray",Z6)} `:"";_.write(`${u}${$}
|
|
205
205
|
|
|
206
|
-
`)},
|
|
206
|
+
`)},r0=($,I)=>$.split(`
|
|
207
207
|
`).map((_)=>I(_)).join(`
|
|
208
|
-
`),
|
|
209
|
-
${
|
|
208
|
+
`),d0=($)=>{let I=(u,U)=>{let g=u.label??String(u.value);return U==="disabled"?`${A("gray",VY)} ${r0(g,(z)=>A(["strikethrough","gray"],z))}${u.hint?` ${A("dim",`(${u.hint??"disabled"})`)}`:""}`:U==="active"?`${A("cyan",DF)} ${g}${u.hint?` ${A("dim",`(${u.hint})`)}`:""}`:U==="selected"?`${A("green",RY)} ${r0(g,(z)=>A("dim",z))}${u.hint?` ${A("dim",`(${u.hint})`)}`:""}`:U==="cancelled"?`${r0(g,(z)=>A(["strikethrough","dim"],z))}`:U==="active-selected"?`${A("green",RY)} ${g}${u.hint?` ${A("dim",`(${u.hint})`)}`:""}`:U==="submitted"?`${r0(g,(z)=>A("dim",z))}`:`${A("dim",VY)} ${r0(g,(z)=>A("dim",z))}`},_=$.required??!0;return new WY({options:$.options,signal:$.signal,input:$.input,output:$.output,initialValues:$.initialValues,required:_,cursorAt:$.cursorAt,validate(u){if(_&&(u===void 0||u.length===0))return`Please select at least one option.
|
|
209
|
+
${A("reset",A("dim",`Press ${A(["gray","bgWhite","inverse"]," space ")} to select, ${A("gray",A("bgWhite",A("inverse"," enter ")))} to submit`))}`},render(){let u=g1($.output,$.message,`${FY(this.state)} `,`${u2(this.state)} `),U=`${A("gray",s)}
|
|
210
210
|
${u}
|
|
211
|
-
`,g=this.value??[],z=(G,J)=>{if(G.disabled)return I(G,"disabled");let X=g.includes(G.value);return J&&X?I(G,"active-selected"):X?I(G,"selected"):I(G,J?"active":"inactive")};switch(this.state){case"submit":{let G=this.options.filter(({value:X})=>g.includes(X)).map((X)=>I(X,"submitted")).join(
|
|
212
|
-
${
|
|
213
|
-
`).map((q,Q)=>Q===0?`${
|
|
211
|
+
`,g=this.value??[],z=(G,J)=>{if(G.disabled)return I(G,"disabled");let X=g.includes(G.value);return J&&X?I(G,"active-selected"):X?I(G,"selected"):I(G,J?"active":"inactive")};switch(this.state){case"submit":{let G=this.options.filter(({value:X})=>g.includes(X)).map((X)=>I(X,"submitted")).join(A("dim",", "))||A("dim","none"),J=g1($.output,G,`${A("gray",s)} `);return`${U}${J}`}case"cancel":{let G=this.options.filter(({value:X})=>g.includes(X)).map((X)=>I(X,"cancelled")).join(A("dim",", "));if(G.trim()==="")return`${U}${A("gray",s)}`;let J=g1($.output,G,`${A("gray",s)} `);return`${U}${J}
|
|
212
|
+
${A("gray",s)}`}case"error":{let G=`${A("yellow",s)} `,J=this.error.split(`
|
|
213
|
+
`).map((q,Q)=>Q===0?`${A("yellow",Z6)} ${A("yellow",q)}`:` ${q}`).join(`
|
|
214
214
|
`),X=U.split(`
|
|
215
215
|
`).length,N=J.split(`
|
|
216
|
-
`).length+1;return`${U}${G}${
|
|
216
|
+
`).length+1;return`${U}${G}${cX({output:$.output,options:this.options,cursor:this.cursor,maxItems:$.maxItems,columnPadding:G.length,rowPadding:X+N,style:z}).join(`
|
|
217
217
|
${G}`)}
|
|
218
218
|
${J}
|
|
219
|
-
`}default:{let G=`${
|
|
220
|
-
`).length;return`${U}${G}${
|
|
219
|
+
`}default:{let G=`${A("cyan",s)} `,J=U.split(`
|
|
220
|
+
`).length;return`${U}${G}${cX({output:$.output,options:this.options,cursor:this.cursor,maxItems:$.maxItems,columnPadding:G.length,rowPadding:J+2,style:z}).join(`
|
|
221
221
|
${G}`)}
|
|
222
|
-
${
|
|
223
|
-
`}}}}).prompt()},
|
|
224
|
-
`),g=U.reduce((J,X)=>Math.max(f4(X),J),0),z=U.map(_).reduce((J,X)=>Math.max(f4(X),J),0),G=I-(z-g);return
|
|
225
|
-
`).map(g),""],G=f4(I),J=Math.max(z.reduce((Q,Y)=>{let O=f4(Y);return O>Q?O:Q},0),G)+2,X=z.map((Q)=>`${
|
|
226
|
-
`),N=U?`${
|
|
227
|
-
`:"",q=U?
|
|
222
|
+
${A("cyan",Z6)}
|
|
223
|
+
`}}}}).prompt()},lF=($)=>A("dim",$),mF=($,I,_)=>{let u={hard:!0,trim:!1},U=c0($,I,u).split(`
|
|
224
|
+
`),g=U.reduce((J,X)=>Math.max(f4(X),J),0),z=U.map(_).reduce((J,X)=>Math.max(f4(X),J),0),G=I-(z-g);return c0($,G,u)},i=($="",I="",_)=>{let u=_?.output??Q4.stdout,U=_?.withGuide??F$.withGuide,g=_?.format??lF,z=["",...mF($,n0(u)-6,g).split(`
|
|
225
|
+
`).map(g),""],G=f4(I),J=Math.max(z.reduce((Q,Y)=>{let O=f4(Y);return O>Q?O:Q},0),G)+2,X=z.map((Q)=>`${A("gray",s)} ${Q}${" ".repeat(J-f4(Q))}${A("gray",s)}`).join(`
|
|
226
|
+
`),N=U?`${A("gray",s)}
|
|
227
|
+
`:"",q=U?BF:WF;u.write(`${N}${A("green",_2)} ${A("reset",I)} ${A("gray",ZY.repeat(Math.max(J-G-1,1))+LF)}
|
|
228
228
|
${X}
|
|
229
|
-
${
|
|
230
|
-
`)},
|
|
231
|
-
`);let t=
|
|
232
|
-
`);t.length>1&&_.write(
|
|
233
|
-
`);let
|
|
229
|
+
${A("gray",q+ZY.repeat(J+2)+KF)}
|
|
230
|
+
`)},nF=($)=>A("magenta",$),H4=({indicator:$="dots",onCancel:I,output:_=process.stdout,cancelMessage:u,errorMessage:U,frames:g=rX?["◒","◐","◓","◑"]:["•","o","O","0"],delay:z=rX?80:120,signal:G,...J}={})=>{let X=vF(),N,q,Q=!1,Y=!1,O="",H,v=performance.now(),T=n0(_),K=J?.styleFrame??nF,D=(t)=>{let l=t>1?U??F$.messages.error:u??F$.messages.cancel;Y=t===1,Q&&(X$(l,t),Y&&typeof I=="function"&&I())},B=()=>D(2),R=()=>D(1),V=()=>{process.on("uncaughtExceptionMonitor",B),process.on("unhandledRejection",B),process.on("SIGINT",R),process.on("SIGTERM",R),process.on("exit",D),G&&G.addEventListener("abort",R)},M=()=>{process.removeListener("uncaughtExceptionMonitor",B),process.removeListener("unhandledRejection",B),process.removeListener("SIGINT",R),process.removeListener("SIGTERM",R),process.removeListener("exit",D),G&&G.removeEventListener("abort",R)},W=()=>{if(H===void 0)return;X&&_.write(`
|
|
231
|
+
`);let t=c0(H,T,{hard:!0,trim:!1}).split(`
|
|
232
|
+
`);t.length>1&&_.write(h0.cursor.up(t.length-1)),_.write(h0.cursor.to(0)),_.write(h0.erase.down())},E=(t)=>t.replace(/\.+$/,""),C=(t)=>{let l=(performance.now()-t)/1000,u$=Math.floor(l/60),w$=Math.floor(l%60);return u$>0?`[${u$}m ${w$}s]`:`[${w$}s]`},k=J.withGuide??F$.withGuide,w=(t="")=>{Q=!0,N=LY({output:_}),O=E(t),v=performance.now(),k&&_.write(`${A("gray",s)}
|
|
233
|
+
`);let l=0,u$=0;V(),q=setInterval(()=>{if(X&&O===H)return;W(),H=O;let w$=K(g[l]),A4;if(X)A4=`${w$} ${O}...`;else if($==="timer")A4=`${w$} ${O} ${C(v)}`;else{let z6=".".repeat(Math.floor(u$)).slice(0,3);A4=`${w$} ${O}${z6}`}let Ug=c0(A4,T,{hard:!0,trim:!1});_.write(Ug),l=l+1<g.length?l+1:0,u$=u$<4?u$+0.125:0},z)},X$=(t="",l=0,u$=!1)=>{if(!Q)return;Q=!1,clearInterval(q),W();let w$=l===0?A("green",_2):l===1?A("red",jY):A("red",SY);O=t??O,u$||($==="timer"?_.write(`${w$} ${O} ${C(v)}
|
|
234
234
|
`):_.write(`${w$} ${O}
|
|
235
|
-
`)),
|
|
235
|
+
`)),M(),N()};return{start:w,stop:(t="")=>X$(t,0),message:(t="")=>{O=E(t??O)},cancel:(t="")=>X$(t,1),error:(t="")=>X$(t,2),clear:()=>X$("",0,!0),get isCancelled(){return Y}}},yn,I2=($,I)=>$.includes(`
|
|
236
236
|
`)?$.split(`
|
|
237
237
|
`).map((_)=>I(_)).join(`
|
|
238
|
-
`):I($),
|
|
238
|
+
`):I($),A6=($)=>{let I=(_,u)=>{let U=_.label??String(_.value);switch(u){case"disabled":return`${A("gray",U2)} ${I2(U,(g)=>A("gray",g))}${_.hint?` ${A("dim",`(${_.hint??"disabled"})`)}`:""}`;case"selected":return`${I2(U,(g)=>A("dim",g))}`;case"active":return`${A("green",hX)} ${U}${_.hint?` ${A("dim",`(${_.hint})`)}`:""}`;case"cancelled":return`${I2(U,(g)=>A(["strikethrough","dim"],g))}`;default:return`${A("dim",U2)} ${I2(U,(g)=>A("dim",g))}`}};return new kX({options:$.options,signal:$.signal,input:$.input,output:$.output,initialValue:$.initialValue,render(){let _=$.withGuide??F$.withGuide,u=`${u2(this.state)} `,U=`${FY(this.state)} `,g=g1($.output,$.message,U,u),z=`${_?`${A("gray",s)}
|
|
239
239
|
`:""}${g}
|
|
240
|
-
`;switch(this.state){case"submit":{let G=_?`${
|
|
241
|
-
${
|
|
242
|
-
`).length,N=_?2:1;return`${z}${G}${
|
|
240
|
+
`;switch(this.state){case"submit":{let G=_?`${A("gray",s)} `:"",J=g1($.output,I(this.options[this.cursor],"selected"),G);return`${z}${J}`}case"cancel":{let G=_?`${A("gray",s)} `:"",J=g1($.output,I(this.options[this.cursor],"cancelled"),G);return`${z}${J}${_?`
|
|
241
|
+
${A("gray",s)}`:""}`}default:{let G=_?`${A("cyan",s)} `:"",J=_?A("cyan",Z6):"",X=z.split(`
|
|
242
|
+
`).length,N=_?2:1;return`${z}${G}${cX({output:$.output,cursor:this.cursor,options:this.options,maxItems:$.maxItems,columnPadding:G.length,rowPadding:X+N,style:(q,Q)=>I(q,q.disabled?"disabled":Q?"active":"inactive")}).join(`
|
|
243
243
|
${G}`)}
|
|
244
244
|
${J}
|
|
245
|
-
`}}}}).prompt()},
|
|
246
|
-
`:""}${
|
|
247
|
-
`,u=$.placeholder?
|
|
245
|
+
`}}}}).prompt()},ln,z2=($)=>new yX({validate:$.validate,placeholder:$.placeholder,defaultValue:$.defaultValue,initialValue:$.initialValue,output:$.output,signal:$.signal,input:$.input,render(){let I=$?.withGuide??F$.withGuide,_=`${`${I?`${A("gray",s)}
|
|
246
|
+
`:""}${u2(this.state)} `}${$.message}
|
|
247
|
+
`,u=$.placeholder?A("inverse",$.placeholder[0])+A("dim",$.placeholder.slice(1)):A(["inverse","hidden"],"_"),U=this.userInput?this.userInputWithCursor:u,g=this.value??"";switch(this.state){case"error":{let z=this.error?` ${A("yellow",this.error)}`:"",G=I?`${A("yellow",s)} `:"",J=I?A("yellow",Z6):"";return`${_.trim()}
|
|
248
248
|
${G}${U}
|
|
249
249
|
${J}${z}
|
|
250
|
-
`}case"submit":{let z=g?` ${
|
|
251
|
-
${G}`:""}`}default:{let z=I?`${
|
|
250
|
+
`}case"submit":{let z=g?` ${A("dim",g)}`:"",G=I?A("gray",s):"";return`${_}${G}${z}`}case"cancel":{let z=g?` ${A(["strikethrough","dim"],g)}`:"",G=I?A("gray",s):"";return`${_}${G}${z}${g.trim()?`
|
|
251
|
+
${G}`:""}`}default:{let z=I?`${A("cyan",s)} `:"",G=I?A("cyan",Z6):"";return`${_}${z}${U}
|
|
252
252
|
${G}
|
|
253
|
-
`}}}}).prompt();var U4=
|
|
253
|
+
`}}}}).prompt();var U4=wI(()=>{iX();iX();h0=O$(VX(),1);rX=OF(),TF=Q$("◆","*"),jY=Q$("■","x"),SY=Q$("▲","x"),_2=Q$("◇","o"),MF=Q$("┌","T"),s=Q$("│","|"),Z6=Q$("└","—"),Cn=Q$("┐","T"),fn=Q$("┘","—"),hX=Q$("●",">"),U2=Q$("○"," "),DF=Q$("◻","[•]"),RY=Q$("◼","[+]"),VY=Q$("◻","[ ]"),xn=Q$("▪","•"),ZY=Q$("─","-"),LF=Q$("╮","+"),BF=Q$("├","+"),KF=Q$("╯","+"),WF=Q$("╰","+"),kn=Q$("╭","+"),RF=Q$("●","•"),VF=Q$("◆","*"),ZF=Q$("▲","!"),AF=Q$("■","x"),lX=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,eu=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,su=/\t{1,1000}/y,mX=/[\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,$2=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,SF=/\p{M}+/gu,FF={limit:1/0,ellipsis:""},wF={limit:1/0,ellipsis:"",ellipsisWidth:0},oX=`${CF}8;;`,AY=new RegExp(`(?:\\${CY}(?<code>\\d+)m|\\${oX}(?<uri>.*)${dX})`,"y");U$={message:($=[],{symbol:I=A("gray",s),secondarySymbol:_=A("gray",s),output:u=process.stdout,spacing:U=1,withGuide:g}={})=>{let z=[],G=g??F$.withGuide,J=G?_:"",X=G?`${I} `:"",N=G?`${_} `:"";for(let Q=0;Q<U;Q++)z.push(J);let q=Array.isArray($)?$:$.split(`
|
|
254
254
|
`);if(q.length>0){let[Q,...Y]=q;Q.length>0?z.push(`${X}${Q}`):z.push(G?I:"");for(let O of Y)O.length>0?z.push(`${N}${O}`):z.push(G?_:"")}u.write(`${z.join(`
|
|
255
255
|
`)}
|
|
256
|
-
`)},info:($,I)=>{U$.message($,{...I,symbol:
|
|
257
|
-
`),u=_[_.length-1]||"",U=u.match(/(\d+) files? changed/),g=u.match(/(\d+) insertions?\(\+\)/),z=u.match(/(\d+) deletions?\(-\)/);return{filesChanged:U?.[1]?parseInt(U[1],10):0,linesAdded:g?.[1]?parseInt(g[1],10):0,linesRemoved:z?.[1]?parseInt(z[1],10):0}}catch{return{filesChanged:0,linesAdded:0,linesRemoved:0}}}function
|
|
258
|
-
`).filter(Boolean)}catch{return[]}}function
|
|
259
|
-
`).filter(Boolean).slice(0,10)}catch{return[]}}function
|
|
260
|
-
`).filter(Boolean)}catch{return[]}}function
|
|
261
|
-
`).filter(Boolean)}catch{return
|
|
262
|
-
`),"Previous Session");let U=await
|
|
263
|
-
`);
|
|
264
|
-
`),"Preview");let H=await f$({message:"Save this retrospective?",initialValue:!0});if(
|
|
265
|
-
`),"Recent Commits");if(z.length>0)
|
|
266
|
-
`),"Changed Files");let G=await eu({message:"What did you accomplish in this session?",placeholder:"e.g., Implemented user authentication flow"});if(G$(G)){h$("Cancelled.");return}let J=await eu({message:"Key learnings? (comma-separated)",placeholder:"e.g., JWT needs refresh token, bcrypt is slow"});if(G$(J)){h$("Cancelled.");return}let X=await eu({message:"Next steps? (comma-separated)",placeholder:"e.g., Add password reset, Write tests"});if(G$(X)){h$("Cancelled.");return}let N={id:Math.random().toString(36).slice(2,8),date:new Date().toISOString(),summary:G,keyLearnings:J.split(",").map((q)=>q.trim()).filter(Boolean),filesChanged:z,nextSteps:X.split(",").map((q)=>q.trim()).filter(Boolean)};vv($,N),y(b$.default.green("Retrospective saved!"),"Done"),p(b$.default.dim(`Stored in: ${I}`))}var b$;var Dv=AI(()=>{U4();Kq();w0();b$=Y$(Z$(),1)});var $6=j((gd,NT)=>{var XT=["nodebuffer","arraybuffer","fragments"],qT=typeof Blob<"u";if(qT)XT.push("blob");NT.exports={BINARY_TYPES:XT,CLOSE_TIMEOUT:30000,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:qT,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var a0=j((zd,f2)=>{var{EMPTY_BUFFER:Of}=$6(),nq=Buffer[Symbol.species];function vf($,I){if($.length===0)return Of;if($.length===1)return $[0];let _=Buffer.allocUnsafe(I),u=0;for(let U=0;U<$.length;U++){let g=$[U];_.set(g,u),u+=g.length}if(u<I)return new nq(_.buffer,_.byteOffset,u);return _}function QT($,I,_,u,U){for(let g=0;g<U;g++)_[u+g]=$[g]^I[g&3]}function HT($,I){for(let _=0;_<$.length;_++)$[_]^=I[_&3]}function Tf($){if($.length===$.buffer.byteLength)return $.buffer;return $.buffer.slice($.byteOffset,$.byteOffset+$.length)}function rq($){if(rq.readOnly=!0,Buffer.isBuffer($))return $;let I;if($ instanceof ArrayBuffer)I=new nq($);else if(ArrayBuffer.isView($))I=new nq($.buffer,$.byteOffset,$.byteLength);else I=Buffer.from($),rq.readOnly=!1;return I}f2.exports={concat:vf,mask:QT,toArrayBuffer:Tf,toBuffer:rq,unmask:HT};if(!process.env.WS_NO_BUFFER_UTIL)try{let $=(()=>{throw new Error("Cannot require module "+"bufferutil");})();f2.exports.mask=function(I,_,u,U,g){if(g<48)QT(I,_,u,U,g);else $.mask(I,_,u,U,g)},f2.exports.unmask=function(I,_){if(I.length<32)HT(I,_);else $.unmask(I,_)}}catch($){}});var TT=j((Gd,vT)=>{var YT=Symbol("kDone"),hq=Symbol("kRun");class OT{constructor($){this[YT]=()=>{this.pending--,this[hq]()},this.concurrency=$||1/0,this.jobs=[],this.pending=0}add($){this.jobs.push($),this[hq]()}[hq](){if(this.pending===this.concurrency)return;if(this.jobs.length){let $=this.jobs.shift();this.pending++,$(this[YT])}}}vT.exports=OT});var s0=j((Jd,KT)=>{var e0=g$("zlib"),MT=a0(),Mf=TT(),{kStatusCode:DT}=$6(),Df=Buffer[Symbol.species],Lf=Buffer.from([0,0,255,255]),k2=Symbol("permessage-deflate"),I6=Symbol("total-length"),MI=Symbol("callback"),F6=Symbol("buffers"),DI=Symbol("error"),x2;class LT{constructor($,I,_){if(this._maxPayload=_|0,this._options=$||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!I,this._deflate=null,this._inflate=null,this.params=null,!x2){let u=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;x2=new Mf(u)}}static get extensionName(){return"permessage-deflate"}offer(){let $={};if(this._options.serverNoContextTakeover)$.server_no_context_takeover=!0;if(this._options.clientNoContextTakeover)$.client_no_context_takeover=!0;if(this._options.serverMaxWindowBits)$.server_max_window_bits=this._options.serverMaxWindowBits;if(this._options.clientMaxWindowBits)$.client_max_window_bits=this._options.clientMaxWindowBits;else if(this._options.clientMaxWindowBits==null)$.client_max_window_bits=!0;return $}accept($){return $=this.normalizeParams($),this.params=this._isServer?this.acceptAsServer($):this.acceptAsClient($),this.params}cleanup(){if(this._inflate)this._inflate.close(),this._inflate=null;if(this._deflate){let $=this._deflate[MI];if(this._deflate.close(),this._deflate=null,$)$(Error("The deflate stream was closed while data was being processed"))}}acceptAsServer($){let I=this._options,_=$.find((u)=>{if(I.serverNoContextTakeover===!1&&u.server_no_context_takeover||u.server_max_window_bits&&(I.serverMaxWindowBits===!1||typeof I.serverMaxWindowBits==="number"&&I.serverMaxWindowBits>u.server_max_window_bits)||typeof I.clientMaxWindowBits==="number"&&!u.client_max_window_bits)return!1;return!0});if(!_)throw Error("None of the extension offers can be accepted");if(I.serverNoContextTakeover)_.server_no_context_takeover=!0;if(I.clientNoContextTakeover)_.client_no_context_takeover=!0;if(typeof I.serverMaxWindowBits==="number")_.server_max_window_bits=I.serverMaxWindowBits;if(typeof I.clientMaxWindowBits==="number")_.client_max_window_bits=I.clientMaxWindowBits;else if(_.client_max_window_bits===!0||I.clientMaxWindowBits===!1)delete _.client_max_window_bits;return _}acceptAsClient($){let I=$[0];if(this._options.clientNoContextTakeover===!1&&I.client_no_context_takeover)throw Error('Unexpected parameter "client_no_context_takeover"');if(!I.client_max_window_bits){if(typeof this._options.clientMaxWindowBits==="number")I.client_max_window_bits=this._options.clientMaxWindowBits}else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits==="number"&&I.client_max_window_bits>this._options.clientMaxWindowBits)throw Error('Unexpected or invalid parameter "client_max_window_bits"');return I}normalizeParams($){return $.forEach((I)=>{Object.keys(I).forEach((_)=>{let u=I[_];if(u.length>1)throw Error(`Parameter "${_}" must have only a single value`);if(u=u[0],_==="client_max_window_bits"){if(u!==!0){let U=+u;if(!Number.isInteger(U)||U<8||U>15)throw TypeError(`Invalid value for parameter "${_}": ${u}`);u=U}else if(!this._isServer)throw TypeError(`Invalid value for parameter "${_}": ${u}`)}else if(_==="server_max_window_bits"){let U=+u;if(!Number.isInteger(U)||U<8||U>15)throw TypeError(`Invalid value for parameter "${_}": ${u}`);u=U}else if(_==="client_no_context_takeover"||_==="server_no_context_takeover"){if(u!==!0)throw TypeError(`Invalid value for parameter "${_}": ${u}`)}else throw Error(`Unknown parameter "${_}"`);I[_]=u})}),$}decompress($,I,_){x2.add((u)=>{this._decompress($,I,(U,g)=>{u(),_(U,g)})})}compress($,I,_){x2.add((u)=>{this._compress($,I,(U,g)=>{u(),_(U,g)})})}_decompress($,I,_){let u=this._isServer?"client":"server";if(!this._inflate){let U=`${u}_max_window_bits`,g=typeof this.params[U]!=="number"?e0.Z_DEFAULT_WINDOWBITS:this.params[U];this._inflate=e0.createInflateRaw({...this._options.zlibInflateOptions,windowBits:g}),this._inflate[k2]=this,this._inflate[I6]=0,this._inflate[F6]=[],this._inflate.on("error",Kf),this._inflate.on("data",BT)}if(this._inflate[MI]=_,this._inflate.write($),I)this._inflate.write(Lf);this._inflate.flush(()=>{let U=this._inflate[DI];if(U){this._inflate.close(),this._inflate=null,_(U);return}let g=MT.concat(this._inflate[F6],this._inflate[I6]);if(this._inflate._readableState.endEmitted)this._inflate.close(),this._inflate=null;else if(this._inflate[I6]=0,this._inflate[F6]=[],I&&this.params[`${u}_no_context_takeover`])this._inflate.reset();_(null,g)})}_compress($,I,_){let u=this._isServer?"server":"client";if(!this._deflate){let U=`${u}_max_window_bits`,g=typeof this.params[U]!=="number"?e0.Z_DEFAULT_WINDOWBITS:this.params[U];this._deflate=e0.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:g}),this._deflate[I6]=0,this._deflate[F6]=[],this._deflate.on("data",Bf)}this._deflate[MI]=_,this._deflate.write($),this._deflate.flush(e0.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let U=MT.concat(this._deflate[F6],this._deflate[I6]);if(I)U=new Df(U.buffer,U.byteOffset,U.length-4);if(this._deflate[MI]=null,this._deflate[I6]=0,this._deflate[F6]=[],I&&this.params[`${u}_no_context_takeover`])this._deflate.reset();_(null,U)})}}KT.exports=LT;function Bf($){this[F6].push($),this[I6]+=$.length}function BT($){if(this[I6]+=$.length,this[k2]._maxPayload<1||this[I6]<=this[k2]._maxPayload){this[F6].push($);return}this[DI]=RangeError("Max payload size exceeded"),this[DI].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[DI][DT]=1009,this.removeListener("data",BT),this.reset()}function Kf($){if(this[k2]._inflate=null,this[DI]){this[MI](this[DI]);return}$[DT]=1007,this[MI]($)}});var LI=j((Xd,i2)=>{var{isUtf8:VT}=g$("buffer"),{hasBlob:Vf}=$6(),Rf=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function Wf($){return $>=1000&&$<=1014&&$!==1004&&$!==1005&&$!==1006||$>=3000&&$<=4999}function cq($){let I=$.length,_=0;while(_<I)if(($[_]&128)===0)_++;else if(($[_]&224)===192){if(_+1===I||($[_+1]&192)!==128||($[_]&254)===192)return!1;_+=2}else if(($[_]&240)===224){if(_+2>=I||($[_+1]&192)!==128||($[_+2]&192)!==128||$[_]===224&&($[_+1]&224)===128||$[_]===237&&($[_+1]&224)===160)return!1;_+=3}else if(($[_]&248)===240){if(_+3>=I||($[_+1]&192)!==128||($[_+2]&192)!==128||($[_+3]&192)!==128||$[_]===240&&($[_+1]&240)===128||$[_]===244&&$[_+1]>143||$[_]>244)return!1;_+=4}else return!1;return!0}function Af($){return Vf&&typeof $==="object"&&typeof $.arrayBuffer==="function"&&typeof $.type==="string"&&typeof $.stream==="function"&&($[Symbol.toStringTag]==="Blob"||$[Symbol.toStringTag]==="File")}i2.exports={isBlob:Af,isValidStatusCode:Wf,isValidUTF8:cq,tokenChars:Rf};if(VT)i2.exports.isValidUTF8=function($){return $.length<24?cq($):VT($)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let $=(()=>{throw new Error("Cannot require module "+"utf-8-validate");})();i2.exports.isValidUTF8=function(I){return I.length<32?cq(I):$(I)}}catch($){}});var oq=j((qd,bT)=>{var{Writable:Zf}=g$("stream"),RT=s0(),{BINARY_TYPES:bf,EMPTY_BUFFER:WT,kStatusCode:Pf,kWebSocket:Sf}=$6(),{concat:dq,toArrayBuffer:jf,unmask:Ff}=a0(),{isValidStatusCode:wf,isValidUTF8:AT}=LI(),y2=Buffer[Symbol.species];class ZT extends Zf{constructor($={}){super();this._allowSynchronousEvents=$.allowSynchronousEvents!==void 0?$.allowSynchronousEvents:!0,this._binaryType=$.binaryType||bf[0],this._extensions=$.extensions||{},this._isServer=!!$.isServer,this._maxPayload=$.maxPayload|0,this._skipUTF8Validation=!!$.skipUTF8Validation,this[Sf]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=0}_write($,I,_){if(this._opcode===8&&this._state==0)return _();this._bufferedBytes+=$.length,this._buffers.push($),this.startLoop(_)}consume($){if(this._bufferedBytes-=$,$===this._buffers[0].length)return this._buffers.shift();if($<this._buffers[0].length){let _=this._buffers[0];return this._buffers[0]=new y2(_.buffer,_.byteOffset+$,_.length-$),new y2(_.buffer,_.byteOffset,$)}let I=Buffer.allocUnsafe($);do{let _=this._buffers[0],u=I.length-$;if($>=_.length)I.set(this._buffers.shift(),u);else I.set(new Uint8Array(_.buffer,_.byteOffset,$),u),this._buffers[0]=new y2(_.buffer,_.byteOffset+$,_.length-$);$-=_.length}while($>0);return I}startLoop($){this._loop=!0;do switch(this._state){case 0:this.getInfo($);break;case 1:this.getPayloadLength16($);break;case 2:this.getPayloadLength64($);break;case 3:this.getMask();break;case 4:this.getData($);break;case 5:case 6:this._loop=!1;return}while(this._loop);if(!this._errored)$()}getInfo($){if(this._bufferedBytes<2){this._loop=!1;return}let I=this.consume(2);if((I[0]&48)!==0){let u=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");$(u);return}let _=(I[0]&64)===64;if(_&&!this._extensions[RT.extensionName]){let u=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");$(u);return}if(this._fin=(I[0]&128)===128,this._opcode=I[0]&15,this._payloadLength=I[1]&127,this._opcode===0){if(_){let u=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");$(u);return}if(!this._fragmented){let u=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");$(u);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let u=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");$(u);return}this._compressed=_}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let u=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");$(u);return}if(_){let u=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");$(u);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let u=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");$(u);return}}else{let u=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");$(u);return}if(!this._fin&&!this._fragmented)this._fragmented=this._opcode;if(this._masked=(I[1]&128)===128,this._isServer){if(!this._masked){let u=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");$(u);return}}else if(this._masked){let u=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");$(u);return}if(this._payloadLength===126)this._state=1;else if(this._payloadLength===127)this._state=2;else this.haveLength($)}getPayloadLength16($){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength($)}getPayloadLength64($){if(this._bufferedBytes<8){this._loop=!1;return}let I=this.consume(8),_=I.readUInt32BE(0);if(_>Math.pow(2,21)-1){let u=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");$(u);return}this._payloadLength=_*Math.pow(2,32)+I.readUInt32BE(4),this.haveLength($)}haveLength($){if(this._payloadLength&&this._opcode<8){if(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0){let I=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");$(I);return}}if(this._masked)this._state=3;else this._state=4}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=4}getData($){let I=WT;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}if(I=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0)Ff(I,this._mask)}if(this._opcode>7){this.controlMessage(I,$);return}if(this._compressed){this._state=5,this.decompress(I,$);return}if(I.length)this._messageLength=this._totalPayloadLength,this._fragments.push(I);this.dataMessage($)}decompress($,I){this._extensions[RT.extensionName].decompress($,this._fin,(u,U)=>{if(u)return I(u);if(U.length){if(this._messageLength+=U.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let g=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");I(g);return}this._fragments.push(U)}if(this.dataMessage(I),this._state===0)this.startLoop(I)})}dataMessage($){if(!this._fin){this._state=0;return}let I=this._messageLength,_=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let u;if(this._binaryType==="nodebuffer")u=dq(_,I);else if(this._binaryType==="arraybuffer")u=jf(dq(_,I));else if(this._binaryType==="blob")u=new Blob(_);else u=_;if(this._allowSynchronousEvents)this.emit("message",u,!0),this._state=0;else this._state=6,setImmediate(()=>{this.emit("message",u,!0),this._state=0,this.startLoop($)})}else{let u=dq(_,I);if(!this._skipUTF8Validation&&!AT(u)){let U=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");$(U);return}if(this._state===5||this._allowSynchronousEvents)this.emit("message",u,!1),this._state=0;else this._state=6,setImmediate(()=>{this.emit("message",u,!1),this._state=0,this.startLoop($)})}}controlMessage($,I){if(this._opcode===8){if($.length===0)this._loop=!1,this.emit("conclude",1005,WT),this.end();else{let _=$.readUInt16BE(0);if(!wf(_)){let U=this.createError(RangeError,`invalid status code ${_}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");I(U);return}let u=new y2($.buffer,$.byteOffset+2,$.length-2);if(!this._skipUTF8Validation&&!AT(u)){let U=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");I(U);return}this._loop=!1,this.emit("conclude",_,u),this.end()}this._state=0;return}if(this._allowSynchronousEvents)this.emit(this._opcode===9?"ping":"pong",$),this._state=0;else this._state=6,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",$),this._state=0,this.startLoop(I)})}createError($,I,_,u,U){this._loop=!1,this._errored=!0;let g=new $(_?`Invalid WebSocket frame: ${I}`:I);return Error.captureStackTrace(g,this.createError),g.code=U,g[Pf]=u,g}}bT.exports=ZT});var tq=j((Qd,jT)=>{var{Duplex:Nd}=g$("stream"),{randomFillSync:Ef}=g$("crypto"),PT=s0(),{EMPTY_BUFFER:Cf,kWebSocket:ff,NOOP:xf}=$6(),{isBlob:BI,isValidStatusCode:kf}=LI(),{mask:ST,toBuffer:Q1}=a0(),v4=Symbol("kByteLength"),yf=Buffer.alloc(4),H1,KI=8192,R4=0,lf=1,mf=2;class w6{constructor($,I,_){if(this._extensions=I||{},_)this._generateMask=_,this._maskBuffer=Buffer.alloc(4);this._socket=$,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=R4,this.onerror=xf,this[ff]=void 0}static frame($,I){let _,u=!1,U=2,g=!1;if(I.mask){if(_=I.maskBuffer||yf,I.generateMask)I.generateMask(_);else{if(KI===8192){if(H1===void 0)H1=Buffer.alloc(8192);Ef(H1,0,8192),KI=0}_[0]=H1[KI++],_[1]=H1[KI++],_[2]=H1[KI++],_[3]=H1[KI++]}g=(_[0]|_[1]|_[2]|_[3])===0,U=6}let z;if(typeof $==="string")if((!I.mask||g)&&I[v4]!==void 0)z=I[v4];else $=Buffer.from($),z=$.length;else z=$.length,u=I.mask&&I.readOnly&&!g;let G=z;if(z>=65536)U+=8,G=127;else if(z>125)U+=2,G=126;let J=Buffer.allocUnsafe(u?z+U:U);if(J[0]=I.fin?I.opcode|128:I.opcode,I.rsv1)J[0]|=64;if(J[1]=G,G===126)J.writeUInt16BE(z,2);else if(G===127)J[2]=J[3]=0,J.writeUIntBE(z,4,6);if(!I.mask)return[J,$];if(J[1]|=128,J[U-4]=_[0],J[U-3]=_[1],J[U-2]=_[2],J[U-1]=_[3],g)return[J,$];if(u)return ST($,_,J,U,z),[J];return ST($,_,$,0,z),[J,$]}close($,I,_,u){let U;if($===void 0)U=Cf;else if(typeof $!=="number"||!kf($))throw TypeError("First argument must be a valid error code number");else if(I===void 0||!I.length)U=Buffer.allocUnsafe(2),U.writeUInt16BE($,0);else{let z=Buffer.byteLength(I);if(z>123)throw RangeError("The message must not be greater than 123 bytes");if(U=Buffer.allocUnsafe(2+z),U.writeUInt16BE($,0),typeof I==="string")U.write(I,2);else U.set(I,2)}let g={[v4]:U.length,fin:!0,generateMask:this._generateMask,mask:_,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};if(this._state!==R4)this.enqueue([this.dispatch,U,!1,g,u]);else this.sendFrame(w6.frame(U,g),u)}ping($,I,_){let u,U;if(typeof $==="string")u=Buffer.byteLength($),U=!1;else if(BI($))u=$.size,U=!1;else $=Q1($),u=$.length,U=Q1.readOnly;if(u>125)throw RangeError("The data size must not be greater than 125 bytes");let g={[v4]:u,fin:!0,generateMask:this._generateMask,mask:I,maskBuffer:this._maskBuffer,opcode:9,readOnly:U,rsv1:!1};if(BI($))if(this._state!==R4)this.enqueue([this.getBlobData,$,!1,g,_]);else this.getBlobData($,!1,g,_);else if(this._state!==R4)this.enqueue([this.dispatch,$,!1,g,_]);else this.sendFrame(w6.frame($,g),_)}pong($,I,_){let u,U;if(typeof $==="string")u=Buffer.byteLength($),U=!1;else if(BI($))u=$.size,U=!1;else $=Q1($),u=$.length,U=Q1.readOnly;if(u>125)throw RangeError("The data size must not be greater than 125 bytes");let g={[v4]:u,fin:!0,generateMask:this._generateMask,mask:I,maskBuffer:this._maskBuffer,opcode:10,readOnly:U,rsv1:!1};if(BI($))if(this._state!==R4)this.enqueue([this.getBlobData,$,!1,g,_]);else this.getBlobData($,!1,g,_);else if(this._state!==R4)this.enqueue([this.dispatch,$,!1,g,_]);else this.sendFrame(w6.frame($,g),_)}send($,I,_){let u=this._extensions[PT.extensionName],U=I.binary?2:1,g=I.compress,z,G;if(typeof $==="string")z=Buffer.byteLength($),G=!1;else if(BI($))z=$.size,G=!1;else $=Q1($),z=$.length,G=Q1.readOnly;if(this._firstFragment){if(this._firstFragment=!1,g&&u&&u.params[u._isServer?"server_no_context_takeover":"client_no_context_takeover"])g=z>=u._threshold;this._compress=g}else g=!1,U=0;if(I.fin)this._firstFragment=!0;let J={[v4]:z,fin:I.fin,generateMask:this._generateMask,mask:I.mask,maskBuffer:this._maskBuffer,opcode:U,readOnly:G,rsv1:g};if(BI($))if(this._state!==R4)this.enqueue([this.getBlobData,$,this._compress,J,_]);else this.getBlobData($,this._compress,J,_);else if(this._state!==R4)this.enqueue([this.dispatch,$,this._compress,J,_]);else this.dispatch($,this._compress,J,_)}getBlobData($,I,_,u){this._bufferedBytes+=_[v4],this._state=mf,$.arrayBuffer().then((U)=>{if(this._socket.destroyed){let z=Error("The socket was closed while the blob was being read");process.nextTick(pq,this,z,u);return}this._bufferedBytes-=_[v4];let g=Q1(U);if(!I)this._state=R4,this.sendFrame(w6.frame(g,_),u),this.dequeue();else this.dispatch(g,I,_,u)}).catch((U)=>{process.nextTick(nf,this,U,u)})}dispatch($,I,_,u){if(!I){this.sendFrame(w6.frame($,_),u);return}let U=this._extensions[PT.extensionName];this._bufferedBytes+=_[v4],this._state=lf,U.compress($,_.fin,(g,z)=>{if(this._socket.destroyed){let G=Error("The socket was closed while data was being compressed");pq(this,G,u);return}this._bufferedBytes-=_[v4],this._state=R4,_.readOnly=!1,this.sendFrame(w6.frame(z,_),u),this.dequeue()})}dequeue(){while(this._state===R4&&this._queue.length){let $=this._queue.shift();this._bufferedBytes-=$[3][v4],Reflect.apply($[0],this,$.slice(1))}}enqueue($){this._bufferedBytes+=$[3][v4],this._queue.push($)}sendFrame($,I){if($.length===2)this._socket.cork(),this._socket.write($[0]),this._socket.write($[1],I),this._socket.uncork();else this._socket.write($[0],I)}}jT.exports=w6;function pq($,I,_){if(typeof _==="function")_(I);for(let u=0;u<$._queue.length;u++){let U=$._queue[u],g=U[U.length-1];if(typeof g==="function")g(I)}}function nf($,I,_){pq($,I,_),$.onerror(I)}});var yT=j((Hd,iT)=>{var{kForOnEventAttribute:$U,kListener:aq}=$6(),FT=Symbol("kCode"),wT=Symbol("kData"),ET=Symbol("kError"),CT=Symbol("kMessage"),fT=Symbol("kReason"),VI=Symbol("kTarget"),xT=Symbol("kType"),kT=Symbol("kWasClean");class E6{constructor($){this[VI]=null,this[xT]=$}get target(){return this[VI]}get type(){return this[xT]}}Object.defineProperty(E6.prototype,"target",{enumerable:!0});Object.defineProperty(E6.prototype,"type",{enumerable:!0});class RI extends E6{constructor($,I={}){super($);this[FT]=I.code===void 0?0:I.code,this[fT]=I.reason===void 0?"":I.reason,this[kT]=I.wasClean===void 0?!1:I.wasClean}get code(){return this[FT]}get reason(){return this[fT]}get wasClean(){return this[kT]}}Object.defineProperty(RI.prototype,"code",{enumerable:!0});Object.defineProperty(RI.prototype,"reason",{enumerable:!0});Object.defineProperty(RI.prototype,"wasClean",{enumerable:!0});class IU extends E6{constructor($,I={}){super($);this[ET]=I.error===void 0?null:I.error,this[CT]=I.message===void 0?"":I.message}get error(){return this[ET]}get message(){return this[CT]}}Object.defineProperty(IU.prototype,"error",{enumerable:!0});Object.defineProperty(IU.prototype,"message",{enumerable:!0});class m2 extends E6{constructor($,I={}){super($);this[wT]=I.data===void 0?null:I.data}get data(){return this[wT]}}Object.defineProperty(m2.prototype,"data",{enumerable:!0});var rf={addEventListener($,I,_={}){for(let U of this.listeners($))if(!_[$U]&&U[aq]===I&&!U[$U])return;let u;if($==="message")u=function(g,z){let G=new m2("message",{data:z?g:g.toString()});G[VI]=this,l2(I,this,G)};else if($==="close")u=function(g,z){let G=new RI("close",{code:g,reason:z.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});G[VI]=this,l2(I,this,G)};else if($==="error")u=function(g){let z=new IU("error",{error:g,message:g.message});z[VI]=this,l2(I,this,z)};else if($==="open")u=function(){let g=new E6("open");g[VI]=this,l2(I,this,g)};else return;if(u[$U]=!!_[$U],u[aq]=I,_.once)this.once($,u);else this.on($,u)},removeEventListener($,I){for(let _ of this.listeners($))if(_[aq]===I&&!_[$U]){this.removeListener($,_);break}}};iT.exports={CloseEvent:RI,ErrorEvent:IU,Event:E6,EventTarget:rf,MessageEvent:m2};function l2($,I,_){if(typeof $==="object"&&$.handleEvent)$.handleEvent.call($,_);else $.call(I,_)}});var eq=j((Yd,lT)=>{var{tokenChars:UU}=LI();function l4($,I,_){if($[I]===void 0)$[I]=[_];else $[I].push(_)}function hf($){let I=Object.create(null),_=Object.create(null),u=!1,U=!1,g=!1,z,G,J=-1,X=-1,N=-1,q=0;for(;q<$.length;q++)if(X=$.charCodeAt(q),z===void 0)if(N===-1&&UU[X]===1){if(J===-1)J=q}else if(q!==0&&(X===32||X===9)){if(N===-1&&J!==-1)N=q}else if(X===59||X===44){if(J===-1)throw SyntaxError(`Unexpected character at index ${q}`);if(N===-1)N=q;let Y=$.slice(J,N);if(X===44)l4(I,Y,_),_=Object.create(null);else z=Y;J=N=-1}else throw SyntaxError(`Unexpected character at index ${q}`);else if(G===void 0)if(N===-1&&UU[X]===1){if(J===-1)J=q}else if(X===32||X===9){if(N===-1&&J!==-1)N=q}else if(X===59||X===44){if(J===-1)throw SyntaxError(`Unexpected character at index ${q}`);if(N===-1)N=q;if(l4(_,$.slice(J,N),!0),X===44)l4(I,z,_),_=Object.create(null),z=void 0;J=N=-1}else if(X===61&&J!==-1&&N===-1)G=$.slice(J,q),J=N=-1;else throw SyntaxError(`Unexpected character at index ${q}`);else if(U){if(UU[X]!==1)throw SyntaxError(`Unexpected character at index ${q}`);if(J===-1)J=q;else if(!u)u=!0;U=!1}else if(g)if(UU[X]===1){if(J===-1)J=q}else if(X===34&&J!==-1)g=!1,N=q;else if(X===92)U=!0;else throw SyntaxError(`Unexpected character at index ${q}`);else if(X===34&&$.charCodeAt(q-1)===61)g=!0;else if(N===-1&&UU[X]===1){if(J===-1)J=q}else if(J!==-1&&(X===32||X===9)){if(N===-1)N=q}else if(X===59||X===44){if(J===-1)throw SyntaxError(`Unexpected character at index ${q}`);if(N===-1)N=q;let Y=$.slice(J,N);if(u)Y=Y.replace(/\\/g,""),u=!1;if(l4(_,G,Y),X===44)l4(I,z,_),_=Object.create(null),z=void 0;G=void 0,J=N=-1}else throw SyntaxError(`Unexpected character at index ${q}`);if(J===-1||g||X===32||X===9)throw SyntaxError("Unexpected end of input");if(N===-1)N=q;let Q=$.slice(J,N);if(z===void 0)l4(I,Q,_);else{if(G===void 0)l4(_,Q,!0);else if(u)l4(_,G,Q.replace(/\\/g,""));else l4(_,G,Q);l4(I,z,_)}return I}function cf($){return Object.keys($).map((I)=>{let _=$[I];if(!Array.isArray(_))_=[_];return _.map((u)=>{return[I].concat(Object.keys(u).map((U)=>{let g=u[U];if(!Array.isArray(g))g=[g];return g.map((z)=>z===!0?U:`${U}=${z}`).join("; ")})).join("; ")}).join(", ")}).join(", ")}lT.exports={format:cf,parse:hf}});var c2=j((Td,sT)=>{var df=g$("events"),of=g$("https"),pf=g$("http"),rT=g$("net"),tf=g$("tls"),{randomBytes:af,createHash:ef}=g$("crypto"),{Duplex:Od,Readable:vd}=g$("stream"),{URL:sq}=g$("url"),C6=s0(),sf=oq(),$x=tq(),{isBlob:Ix}=LI(),{BINARY_TYPES:mT,CLOSE_TIMEOUT:Ux,EMPTY_BUFFER:n2,GUID:_x,kForOnEventAttribute:$5,kListener:ux,kStatusCode:gx,kWebSocket:S$,NOOP:hT}=$6(),{EventTarget:{addEventListener:zx,removeEventListener:Gx}}=yT(),{format:Jx,parse:Xx}=eq(),{toBuffer:qx}=a0(),cT=Symbol("kAborted"),I5=[8,13],U6=["CONNECTING","OPEN","CLOSING","CLOSED"],Nx=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/;class h extends df{constructor($,I,_){super();if(this._binaryType=mT[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=n2,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=h.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,$!==null){if(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,I===void 0)I=[];else if(!Array.isArray(I))if(typeof I==="object"&&I!==null)_=I,I=[];else I=[I];dT(this,$,I,_)}else this._autoPong=_.autoPong,this._closeTimeout=_.closeTimeout,this._isServer=!0}get binaryType(){return this._binaryType}set binaryType($){if(!mT.includes($))return;if(this._binaryType=$,this._receiver)this._receiver._binaryType=$}get bufferedAmount(){if(!this._socket)return this._bufferedAmount;return this._socket._writableState.length+this._sender._bufferedBytes}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket($,I,_){let u=new sf({allowSynchronousEvents:_.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:_.maxPayload,skipUTF8Validation:_.skipUTF8Validation}),U=new $x($,this._extensions,_.generateMask);if(this._receiver=u,this._sender=U,this._socket=$,u[S$]=this,U[S$]=this,$[S$]=this,u.on("conclude",Yx),u.on("drain",Ox),u.on("error",vx),u.on("message",Tx),u.on("ping",Mx),u.on("pong",Dx),U.onerror=Lx,$.setTimeout)$.setTimeout(0);if($.setNoDelay)$.setNoDelay();if(I.length>0)$.unshift(I);$.on("close",tT),$.on("data",h2),$.on("end",aT),$.on("error",eT),this._readyState=h.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=h.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}if(this._extensions[C6.extensionName])this._extensions[C6.extensionName].cleanup();this._receiver.removeAllListeners(),this._readyState=h.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close($,I){if(this.readyState===h.CLOSED)return;if(this.readyState===h.CONNECTING){G4(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===h.CLOSING){if(this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted))this._socket.end();return}this._readyState=h.CLOSING,this._sender.close($,I,!this._isServer,(_)=>{if(_)return;if(this._closeFrameSent=!0,this._closeFrameReceived||this._receiver._writableState.errorEmitted)this._socket.end()}),pT(this)}pause(){if(this.readyState===h.CONNECTING||this.readyState===h.CLOSED)return;this._paused=!0,this._socket.pause()}ping($,I,_){if(this.readyState===h.CONNECTING)throw Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof $==="function")_=$,$=I=void 0;else if(typeof I==="function")_=I,I=void 0;if(typeof $==="number")$=$.toString();if(this.readyState!==h.OPEN){U5(this,$,_);return}if(I===void 0)I=!this._isServer;this._sender.ping($||n2,I,_)}pong($,I,_){if(this.readyState===h.CONNECTING)throw Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof $==="function")_=$,$=I=void 0;else if(typeof I==="function")_=I,I=void 0;if(typeof $==="number")$=$.toString();if(this.readyState!==h.OPEN){U5(this,$,_);return}if(I===void 0)I=!this._isServer;this._sender.pong($||n2,I,_)}resume(){if(this.readyState===h.CONNECTING||this.readyState===h.CLOSED)return;if(this._paused=!1,!this._receiver._writableState.needDrain)this._socket.resume()}send($,I,_){if(this.readyState===h.CONNECTING)throw Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof I==="function")_=I,I={};if(typeof $==="number")$=$.toString();if(this.readyState!==h.OPEN){U5(this,$,_);return}let u={binary:typeof $!=="string",mask:!this._isServer,compress:!0,fin:!0,...I};if(!this._extensions[C6.extensionName])u.compress=!1;this._sender.send($||n2,u,_)}terminate(){if(this.readyState===h.CLOSED)return;if(this.readyState===h.CONNECTING){G4(this,this._req,"WebSocket was closed before the connection was established");return}if(this._socket)this._readyState=h.CLOSING,this._socket.destroy()}}Object.defineProperty(h,"CONNECTING",{enumerable:!0,value:U6.indexOf("CONNECTING")});Object.defineProperty(h.prototype,"CONNECTING",{enumerable:!0,value:U6.indexOf("CONNECTING")});Object.defineProperty(h,"OPEN",{enumerable:!0,value:U6.indexOf("OPEN")});Object.defineProperty(h.prototype,"OPEN",{enumerable:!0,value:U6.indexOf("OPEN")});Object.defineProperty(h,"CLOSING",{enumerable:!0,value:U6.indexOf("CLOSING")});Object.defineProperty(h.prototype,"CLOSING",{enumerable:!0,value:U6.indexOf("CLOSING")});Object.defineProperty(h,"CLOSED",{enumerable:!0,value:U6.indexOf("CLOSED")});Object.defineProperty(h.prototype,"CLOSED",{enumerable:!0,value:U6.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(($)=>{Object.defineProperty(h.prototype,$,{enumerable:!0})});["open","error","close","message"].forEach(($)=>{Object.defineProperty(h.prototype,`on${$}`,{enumerable:!0,get(){for(let I of this.listeners($))if(I[$5])return I[ux];return null},set(I){for(let _ of this.listeners($))if(_[$5]){this.removeListener($,_);break}if(typeof I!=="function")return;this.addEventListener($,I,{[$5]:!0})}})});h.prototype.addEventListener=zx;h.prototype.removeEventListener=Gx;sT.exports=h;function dT($,I,_,u){let U={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:Ux,protocolVersion:I5[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...u,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if($._autoPong=U.autoPong,$._closeTimeout=U.closeTimeout,!I5.includes(U.protocolVersion))throw RangeError(`Unsupported protocol version: ${U.protocolVersion} (supported versions: ${I5.join(", ")})`);let g;if(I instanceof sq)g=I;else try{g=new sq(I)}catch(H){throw SyntaxError(`Invalid URL: ${I}`)}if(g.protocol==="http:")g.protocol="ws:";else if(g.protocol==="https:")g.protocol="wss:";$._url=g.href;let z=g.protocol==="wss:",G=g.protocol==="ws+unix:",J;if(g.protocol!=="ws:"&&!z&&!G)J=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`;else if(G&&!g.pathname)J="The URL's pathname is empty";else if(g.hash)J="The URL contains a fragment identifier";if(J){let H=SyntaxError(J);if($._redirects===0)throw H;else{r2($,H);return}}let X=z?443:80,N=af(16).toString("base64"),q=z?of.request:pf.request,Q=new Set,Y;if(U.createConnection=U.createConnection||(z?Hx:Qx),U.defaultPort=U.defaultPort||X,U.port=g.port||X,U.host=g.hostname.startsWith("[")?g.hostname.slice(1,-1):g.hostname,U.headers={...U.headers,"Sec-WebSocket-Version":U.protocolVersion,"Sec-WebSocket-Key":N,Connection:"Upgrade",Upgrade:"websocket"},U.path=g.pathname+g.search,U.timeout=U.handshakeTimeout,U.perMessageDeflate)Y=new C6(U.perMessageDeflate!==!0?U.perMessageDeflate:{},!1,U.maxPayload),U.headers["Sec-WebSocket-Extensions"]=Jx({[C6.extensionName]:Y.offer()});if(_.length){for(let H of _){if(typeof H!=="string"||!Nx.test(H)||Q.has(H))throw SyntaxError("An invalid or duplicated subprotocol was specified");Q.add(H)}U.headers["Sec-WebSocket-Protocol"]=_.join(",")}if(U.origin)if(U.protocolVersion<13)U.headers["Sec-WebSocket-Origin"]=U.origin;else U.headers.Origin=U.origin;if(g.username||g.password)U.auth=`${g.username}:${g.password}`;if(G){let H=U.path.split(":");U.socketPath=H[0],U.path=H[1]}let O;if(U.followRedirects){if($._redirects===0){$._originalIpc=G,$._originalSecure=z,$._originalHostOrSocketPath=G?U.socketPath:g.host;let H=u&&u.headers;if(u={...u,headers:{}},H)for(let[v,T]of Object.entries(H))u.headers[v.toLowerCase()]=T}else if($.listenerCount("redirect")===0){let H=G?$._originalIpc?U.socketPath===$._originalHostOrSocketPath:!1:$._originalIpc?!1:g.host===$._originalHostOrSocketPath;if(!H||$._originalSecure&&!z){if(delete U.headers.authorization,delete U.headers.cookie,!H)delete U.headers.host;U.auth=void 0}}if(U.auth&&!u.headers.authorization)u.headers.authorization="Basic "+Buffer.from(U.auth).toString("base64");if(O=$._req=q(U),$._redirects)$.emit("redirect",$.url,O)}else O=$._req=q(U);if(U.timeout)O.on("timeout",()=>{G4($,O,"Opening handshake has timed out")});if(O.on("error",(H)=>{if(O===null||O[cT])return;O=$._req=null,r2($,H)}),O.on("response",(H)=>{let v=H.headers.location,T=H.statusCode;if(v&&U.followRedirects&&T>=300&&T<400){if(++$._redirects>U.maxRedirects){G4($,O,"Maximum redirects exceeded");return}O.abort();let K;try{K=new sq(v,I)}catch(M){let B=SyntaxError(`Invalid URL: ${v}`);r2($,B);return}dT($,K,_,u)}else if(!$.emit("unexpected-response",O,H))G4($,O,`Unexpected server response: ${H.statusCode}`)}),O.on("upgrade",(H,v,T)=>{if($.emit("upgrade",H),$.readyState!==h.CONNECTING)return;O=$._req=null;let K=H.headers.upgrade;if(K===void 0||K.toLowerCase()!=="websocket"){G4($,v,"Invalid Upgrade header");return}let M=ef("sha1").update(N+_x).digest("base64");if(H.headers["sec-websocket-accept"]!==M){G4($,v,"Invalid Sec-WebSocket-Accept header");return}let B=H.headers["sec-websocket-protocol"],R;if(B!==void 0){if(!Q.size)R="Server sent a subprotocol but none was requested";else if(!Q.has(B))R="Server sent an invalid subprotocol"}else if(Q.size)R="Server sent no subprotocol";if(R){G4($,v,R);return}if(B)$._protocol=B;let A=H.headers["sec-websocket-extensions"];if(A!==void 0){if(!Y){G4($,v,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let D;try{D=Xx(A)}catch(E){G4($,v,"Invalid Sec-WebSocket-Extensions header");return}let V=Object.keys(D);if(V.length!==1||V[0]!==C6.extensionName){G4($,v,"Server indicated an extension that was not requested");return}try{Y.accept(D[C6.extensionName])}catch(E){G4($,v,"Invalid Sec-WebSocket-Extensions header");return}$._extensions[C6.extensionName]=Y}$.setSocket(v,T,{allowSynchronousEvents:U.allowSynchronousEvents,generateMask:U.generateMask,maxPayload:U.maxPayload,skipUTF8Validation:U.skipUTF8Validation})}),U.finishRequest)U.finishRequest(O,$);else O.end()}function r2($,I){$._readyState=h.CLOSING,$._errorEmitted=!0,$.emit("error",I),$.emitClose()}function Qx($){return $.path=$.socketPath,rT.connect($)}function Hx($){if($.path=void 0,!$.servername&&$.servername!=="")$.servername=rT.isIP($.host)?"":$.host;return tf.connect($)}function G4($,I,_){$._readyState=h.CLOSING;let u=Error(_);if(Error.captureStackTrace(u,G4),I.setHeader){if(I[cT]=!0,I.abort(),I.socket&&!I.socket.destroyed)I.socket.destroy();process.nextTick(r2,$,u)}else I.destroy(u),I.once("error",$.emit.bind($,"error")),I.once("close",$.emitClose.bind($))}function U5($,I,_){if(I){let u=Ix(I)?I.size:qx(I).length;if($._socket)$._sender._bufferedBytes+=u;else $._bufferedAmount+=u}if(_){let u=Error(`WebSocket is not open: readyState ${$.readyState} (${U6[$.readyState]})`);process.nextTick(_,u)}}function Yx($,I){let _=this[S$];if(_._closeFrameReceived=!0,_._closeMessage=I,_._closeCode=$,_._socket[S$]===void 0)return;if(_._socket.removeListener("data",h2),process.nextTick(oT,_._socket),$===1005)_.close();else _.close($,I)}function Ox(){let $=this[S$];if(!$.isPaused)$._socket.resume()}function vx($){let I=this[S$];if(I._socket[S$]!==void 0)I._socket.removeListener("data",h2),process.nextTick(oT,I._socket),I.close($[gx]);if(!I._errorEmitted)I._errorEmitted=!0,I.emit("error",$)}function nT(){this[S$].emitClose()}function Tx($,I){this[S$].emit("message",$,I)}function Mx($){let I=this[S$];if(I._autoPong)I.pong($,!this._isServer,hT);I.emit("ping",$)}function Dx($){this[S$].emit("pong",$)}function oT($){$.resume()}function Lx($){let I=this[S$];if(I.readyState===h.CLOSED)return;if(I.readyState===h.OPEN)I._readyState=h.CLOSING,pT(I);if(this._socket.end(),!I._errorEmitted)I._errorEmitted=!0,I.emit("error",$)}function pT($){$._closeTimer=setTimeout($._socket.destroy.bind($._socket),$._closeTimeout)}function tT(){let $=this[S$];if(this.removeListener("close",tT),this.removeListener("data",h2),this.removeListener("end",aT),$._readyState=h.CLOSING,!this._readableState.endEmitted&&!$._closeFrameReceived&&!$._receiver._writableState.errorEmitted&&this._readableState.length!==0){let I=this.read(this._readableState.length);$._receiver.write(I)}if($._receiver.end(),this[S$]=void 0,clearTimeout($._closeTimer),$._receiver._writableState.finished||$._receiver._writableState.errorEmitted)$.emitClose();else $._receiver.on("error",nT),$._receiver.on("finish",nT)}function h2($){if(!this[S$]._receiver.write($))this.pause()}function aT(){let $=this[S$];$._readyState=h.CLOSING,$._receiver.end(),this.end()}function eT(){let $=this[S$];if(this.removeListener("error",eT),this.on("error",hT),$)$._readyState=h.CLOSING,this.destroy()}});var _M=j((Dd,UM)=>{var Md=c2(),{Duplex:Bx}=g$("stream");function $M($){$.emit("close")}function Kx(){if(!this.destroyed&&this._writableState.finished)this.destroy()}function IM($){if(this.removeListener("error",IM),this.destroy(),this.listenerCount("error")===0)this.emit("error",$)}function Vx($,I){let _=!0,u=new Bx({...I,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return $.on("message",function(g,z){let G=!z&&u._readableState.objectMode?g.toString():g;if(!u.push(G))$.pause()}),$.once("error",function(g){if(u.destroyed)return;_=!1,u.destroy(g)}),$.once("close",function(){if(u.destroyed)return;u.push(null)}),u._destroy=function(U,g){if($.readyState===$.CLOSED){g(U),process.nextTick($M,u);return}let z=!1;if($.once("error",function(J){z=!0,g(J)}),$.once("close",function(){if(!z)g(U);process.nextTick($M,u)}),_)$.terminate()},u._final=function(U){if($.readyState===$.CONNECTING){$.once("open",function(){u._final(U)});return}if($._socket===null)return;if($._socket._writableState.finished){if(U(),u._readableState.endEmitted)u.destroy()}else $._socket.once("finish",function(){U()}),$.close()},u._read=function(){if($.isPaused)$.resume()},u._write=function(U,g,z){if($.readyState===$.CONNECTING){$.once("open",function(){u._write(U,g,z)});return}$.send(U,z)},u.on("end",Kx),u.on("error",IM),u}UM.exports=Vx});var gM=j((Ld,uM)=>{var{tokenChars:Rx}=LI();function Wx($){let I=new Set,_=-1,u=-1,U=0;for(U;U<$.length;U++){let z=$.charCodeAt(U);if(u===-1&&Rx[z]===1){if(_===-1)_=U}else if(U!==0&&(z===32||z===9)){if(u===-1&&_!==-1)u=U}else if(z===44){if(_===-1)throw SyntaxError(`Unexpected character at index ${U}`);if(u===-1)u=U;let G=$.slice(_,u);if(I.has(G))throw SyntaxError(`The "${G}" subprotocol is duplicated`);I.add(G),_=u=-1}else throw SyntaxError(`Unexpected character at index ${U}`)}if(_===-1||u!==-1)throw SyntaxError("Unexpected end of input");let g=$.slice(_,U);if(I.has(g))throw SyntaxError(`The "${g}" subprotocol is duplicated`);return I.add(g),I}uM.exports={parse:Wx}});var qM=j((Kd,XM)=>{var Ax=g$("events"),d2=g$("http"),{Duplex:Bd}=g$("stream"),{createHash:Zx}=g$("crypto"),zM=eq(),Y1=s0(),bx=gM(),Px=c2(),{CLOSE_TIMEOUT:Sx,GUID:jx,kWebSocket:Fx}=$6(),wx=/^[+/0-9A-Za-z]{22}==$/;class JM extends Ax{constructor($,I){super();if($={allowSynchronousEvents:!0,autoPong:!0,maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:Sx,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:Px,...$},$.port==null&&!$.server&&!$.noServer||$.port!=null&&($.server||$.noServer)||$.server&&$.noServer)throw TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if($.port!=null)this._server=d2.createServer((_,u)=>{let U=d2.STATUS_CODES[426];u.writeHead(426,{"Content-Length":U.length,"Content-Type":"text/plain"}),u.end(U)}),this._server.listen($.port,$.host,$.backlog,I);else if($.server)this._server=$.server;if(this._server){let _=this.emit.bind(this,"connection");this._removeListeners=Ex(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(u,U,g)=>{this.handleUpgrade(u,U,g,_)}})}if($.perMessageDeflate===!0)$.perMessageDeflate={};if($.clientTracking)this.clients=new Set,this._shouldEmitClose=!1;this.options=$,this._state=0}address(){if(this.options.noServer)throw Error('The server is operating in "noServer" mode');if(!this._server)return null;return this._server.address()}close($){if(this._state===2){if($)this.once("close",()=>{$(Error("The server is not running"))});process.nextTick(_U,this);return}if($)this.once("close",$);if(this._state===1)return;if(this._state=1,this.options.noServer||this.options.server){if(this._server)this._removeListeners(),this._removeListeners=this._server=null;if(this.clients)if(!this.clients.size)process.nextTick(_U,this);else this._shouldEmitClose=!0;else process.nextTick(_U,this)}else{let I=this._server;this._removeListeners(),this._removeListeners=this._server=null,I.close(()=>{_U(this)})}}shouldHandle($){if(this.options.path){let I=$.url.indexOf("?");if((I!==-1?$.url.slice(0,I):$.url)!==this.options.path)return!1}return!0}handleUpgrade($,I,_,u){I.on("error",GM);let U=$.headers["sec-websocket-key"],g=$.headers.upgrade,z=+$.headers["sec-websocket-version"];if($.method!=="GET"){O1(this,$,I,405,"Invalid HTTP method");return}if(g===void 0||g.toLowerCase()!=="websocket"){O1(this,$,I,400,"Invalid Upgrade header");return}if(U===void 0||!wx.test(U)){O1(this,$,I,400,"Missing or invalid Sec-WebSocket-Key header");return}if(z!==13&&z!==8){O1(this,$,I,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle($)){uU(I,400);return}let G=$.headers["sec-websocket-protocol"],J=new Set;if(G!==void 0)try{J=bx.parse(G)}catch(q){O1(this,$,I,400,"Invalid Sec-WebSocket-Protocol header");return}let X=$.headers["sec-websocket-extensions"],N={};if(this.options.perMessageDeflate&&X!==void 0){let q=new Y1(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let Q=zM.parse(X);if(Q[Y1.extensionName])q.accept(Q[Y1.extensionName]),N[Y1.extensionName]=q}catch(Q){O1(this,$,I,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let q={origin:$.headers[`${z===8?"sec-websocket-origin":"origin"}`],secure:!!($.socket.authorized||$.socket.encrypted),req:$};if(this.options.verifyClient.length===2){this.options.verifyClient(q,(Q,Y,O,H)=>{if(!Q)return uU(I,Y||401,O,H);this.completeUpgrade(N,U,J,$,I,_,u)});return}if(!this.options.verifyClient(q))return uU(I,401)}this.completeUpgrade(N,U,J,$,I,_,u)}completeUpgrade($,I,_,u,U,g,z){if(!U.readable||!U.writable)return U.destroy();if(U[Fx])throw Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>0)return uU(U,503);let J=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${Zx("sha1").update(I+jx).digest("base64")}`],X=new this.options.WebSocket(null,void 0,this.options);if(_.size){let N=this.options.handleProtocols?this.options.handleProtocols(_,u):_.values().next().value;if(N)J.push(`Sec-WebSocket-Protocol: ${N}`),X._protocol=N}if($[Y1.extensionName]){let N=$[Y1.extensionName].params,q=zM.format({[Y1.extensionName]:[N]});J.push(`Sec-WebSocket-Extensions: ${q}`),X._extensions=$}if(this.emit("headers",J,u),U.write(J.concat(`\r
|
|
256
|
+
`)},info:($,I)=>{U$.message($,{...I,symbol:A("blue",RF)})},success:($,I)=>{U$.message($,{...I,symbol:A("green",VF)})},step:($,I)=>{U$.message($,{...I,symbol:A("green",_2)})},warn:($,I)=>{U$.message($,{...I,symbol:A("yellow",ZF)})},warning:($,I)=>{U$.warn($,I)},error:($,I)=>{U$.message($,{...I,symbol:A("red",AF)})}},yn={light:Q$("─","-"),heavy:Q$("━","="),block:Q$("█","#")},ln=`${A("gray",s)} `});import{execSync as H1}from"node:child_process";function F2($){try{let _=H1("git diff --stat HEAD~10 2>/dev/null || git diff --stat",{cwd:$,encoding:"utf-8",stdio:["pipe","pipe","ignore"]}).trim().split(`
|
|
257
|
+
`),u=_[_.length-1]||"",U=u.match(/(\d+) files? changed/),g=u.match(/(\d+) insertions?\(\+\)/),z=u.match(/(\d+) deletions?\(-\)/);return{filesChanged:U?.[1]?parseInt(U[1],10):0,linesAdded:g?.[1]?parseInt(g[1],10):0,linesRemoved:z?.[1]?parseInt(z[1],10):0}}catch{return{filesChanged:0,linesAdded:0,linesRemoved:0}}}function Lv($,I=5){try{return H1(`git log --oneline -${I} 2>/dev/null`,{cwd:$,encoding:"utf-8",stdio:["pipe","pipe","ignore"]}).trim().split(`
|
|
258
|
+
`).filter(Boolean)}catch{return[]}}function Pq($){try{return H1("git diff --name-only HEAD~5 2>/dev/null || git diff --name-only",{cwd:$,encoding:"utf-8",stdio:["pipe","pipe","ignore"]}).trim().split(`
|
|
259
|
+
`).filter(Boolean).slice(0,10)}catch{return[]}}function Dv($,I=10){try{return H1(`git log --format="%s" -${I} 2>/dev/null`,{cwd:$,encoding:"utf-8",stdio:["pipe","pipe","ignore"]}).trim().split(`
|
|
260
|
+
`).filter(Boolean)}catch{return[]}}function Bv($){let I={},_=/^(feat|fix|docs|style|refactor|test|chore|build|ci|perf)(\(.+\))?:/;for(let u of $){let U=u.match(_);if(U){let g=U[1];if(g)I[g]=(I[g]||0)+1}}return I}function Kv($){try{let I=`${$}/.serena/retrospectives`,_=H1(`ls -t "${I}"/*.json 2>/dev/null | head -1`,{encoding:"utf-8",stdio:["pipe","pipe","ignore"]}).trim();if(!_)return null;let u=H1(`cat "${_}"`,{encoding:"utf-8",stdio:["pipe","pipe","ignore"]});return JSON.parse(u).date||null}catch{return null}}function Wv($,I){if(!I)return Dv($,10);try{let u=new Date(I).toISOString().split("T")[0];return H1(`git log --format="%s" --since="${u}" 2>/dev/null`,{cwd:$,encoding:"utf-8",stdio:["pipe","pipe","ignore"]}).trim().split(`
|
|
261
|
+
`).filter(Boolean)}catch{return Dv($,10)}}var jq=()=>{};var Zv={};b4(Zv,{retro:()=>eE});import{existsSync as Vv,mkdirSync as cE,readdirSync as dE,readFileSync as oE,writeFileSync as pE}from"node:fs";import{join as Sq}from"node:path";function Fq($){return Sq($,".serena","retrospectives")}function tE($){let I=Fq($);if(!Vv(I))return[];try{return dE(I).filter((u)=>u.endsWith(".json")).sort().reverse().slice(0,10).map((u)=>JSON.parse(oE(Sq(I,u),"utf-8")))}catch{return[]}}function Rv($,I){let _=Fq($);if(!Vv(_))cE(_,{recursive:!0});let u=`${I.date.replace(/[:.]/g,"-")}_${I.id}.json`;pE(Sq(_,u),JSON.stringify(I,null,2),"utf-8")}function aE($){let I=Kv($),_=Wv($,I),u=Bv(_),U=F2($),g=dH($),z=pH($,I||void 0),G=Object.entries(u).sort(([,q],[,Q])=>Q-q)[0],J="Development session";if(G){let[q]=G;J={feat:"Feature development",fix:"Bug fixes and improvements",refactor:"Code refactoring",docs:"Documentation updates",test:"Testing improvements",chore:"Maintenance tasks",build:"Build system updates",perf:"Performance improvements"}[q]||"Development session"}if(U.filesChanged>0)J+=` (${U.filesChanged} files, +${U.linesAdded}/-${U.linesRemoved})`;if(g.agents.length>0)J+=` with ${g.agents.join(", ")}`;let X=tH(z);if(_.length>0&&X.length===0){if(u.refactor||u.perf)X.push("Code quality and performance improvements");if(u.test)X.push("Enhanced test coverage");if(u.fix)X.push("Issue resolution and stability improvements")}let N=[];if(g.inProgressTasks.length>0)N.push(...g.inProgressTasks.slice(0,3));if(_.length>0){let q=_[0]?.toLowerCase()||"";if(q.includes("wip")||q.includes("todo"))N.push("Complete work-in-progress items")}if(N.length===0)N.push("Continue development","Review and test changes");return{summary:J,learnings:X.slice(0,5),nextSteps:N.slice(0,5)}}async function eE(){let $=process.cwd(),I=Fq($),_=tE($);console.clear(),L$(b$.default.bgMagenta(b$.default.white(" retro (interactive) ")));let u=_[0];if(u)i([b$.default.bold("Last Retrospective"),`Date: ${u.date}`,"",b$.default.bold("Summary:"),u.summary,"",b$.default.bold("Key Learnings:"),...u.keyLearnings.map((q)=>` - ${q}`),"",b$.default.bold("Next Steps:"),...u.nextSteps.map((q)=>` > ${q}`)].join(`
|
|
262
|
+
`),"Previous Session");let U=await A6({message:"What would you like to do?",options:[{value:"auto",label:"Auto-generate from git history",hint:"Analyze commits and agent activity"},{value:"manual",label:"Create manually",hint:"Write your own retrospective"},{value:"list",label:"View past retrospectives"},{value:"exit",label:"Exit"}]});if(J$(U)||U==="exit"){p(b$.default.dim("Goodbye!"));return}if(U==="list"){if(_.length===0)i(b$.default.yellow("No retrospectives found."),"History");else{let q=_.map((Q,Y)=>`${Y+1}. [${Q.date.split("T")[0]}] ${Q.summary.slice(0,50)}...`).join(`
|
|
263
|
+
`);i(q,`Past Retrospectives (${_.length})`)}p(b$.default.dim(`Stored in: ${I}`));return}if(U==="auto"){let{summary:q,learnings:Q,nextSteps:Y}=aE($),O=Pq($);i([b$.default.bold("Auto-generated Content"),"",b$.default.bold("Summary:"),q,"",b$.default.bold("Key Learnings:"),...Q.map((T)=>` - ${T}`),"",b$.default.bold("Next Steps:"),...Y.map((T)=>` > ${T}`)].join(`
|
|
264
|
+
`),"Preview");let H=await f$({message:"Save this retrospective?",initialValue:!0});if(J$(H)||!H){c$("Cancelled.");return}let v={id:Math.random().toString(36).slice(2,8),date:new Date().toISOString(),summary:q,keyLearnings:Q,filesChanged:O,nextSteps:Y};Rv($,v),i(b$.default.green("Retrospective saved!"),"Done"),p(b$.default.dim(`Stored in: ${I}`));return}let g=Lv($),z=Pq($);if(g.length>0)i(g.join(`
|
|
265
|
+
`),"Recent Commits");if(z.length>0)i(z.join(`
|
|
266
|
+
`),"Changed Files");let G=await z2({message:"What did you accomplish in this session?",placeholder:"e.g., Implemented user authentication flow"});if(J$(G)){c$("Cancelled.");return}let J=await z2({message:"Key learnings? (comma-separated)",placeholder:"e.g., JWT needs refresh token, bcrypt is slow"});if(J$(J)){c$("Cancelled.");return}let X=await z2({message:"Next steps? (comma-separated)",placeholder:"e.g., Add password reset, Write tests"});if(J$(X)){c$("Cancelled.");return}let N={id:Math.random().toString(36).slice(2,8),date:new Date().toISOString(),summary:G,keyLearnings:J.split(",").map((q)=>q.trim()).filter(Boolean),filesChanged:z,nextSteps:X.split(",").map((q)=>q.trim()).filter(Boolean)};Rv($,N),i(b$.default.green("Retrospective saved!"),"Done"),p(b$.default.dim(`Stored in: ${I}`))}var b$;var Av=wI(()=>{U4();jq();i0();b$=O$(Z$(),1)});var U6=S((Vd,DT)=>{var TT=["nodebuffer","arraybuffer","fragments"],MT=typeof Blob<"u";if(MT)TT.push("blob");DT.exports={BINARY_TYPES:TT,CLOSE_TIMEOUT:30000,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:MT,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var gU=S((Zd,r2)=>{var{EMPTY_BUFFER:Zf}=U6(),tq=Buffer[Symbol.species];function Af($,I){if($.length===0)return Zf;if($.length===1)return $[0];let _=Buffer.allocUnsafe(I),u=0;for(let U=0;U<$.length;U++){let g=$[U];_.set(g,u),u+=g.length}if(u<I)return new tq(_.buffer,_.byteOffset,u);return _}function LT($,I,_,u,U){for(let g=0;g<U;g++)_[u+g]=$[g]^I[g&3]}function BT($,I){for(let _=0;_<$.length;_++)$[_]^=I[_&3]}function bf($){if($.length===$.buffer.byteLength)return $.buffer;return $.buffer.slice($.byteOffset,$.byteOffset+$.length)}function aq($){if(aq.readOnly=!0,Buffer.isBuffer($))return $;let I;if($ instanceof ArrayBuffer)I=new tq($);else if(ArrayBuffer.isView($))I=new tq($.buffer,$.byteOffset,$.byteLength);else I=Buffer.from($),aq.readOnly=!1;return I}r2.exports={concat:Af,mask:LT,toArrayBuffer:bf,toBuffer:aq,unmask:BT};if(!process.env.WS_NO_BUFFER_UTIL)try{let $=(()=>{throw new Error("Cannot require module "+"bufferutil");})();r2.exports.mask=function(I,_,u,U,g){if(g<48)LT(I,_,u,U,g);else $.mask(I,_,u,U,g)},r2.exports.unmask=function(I,_){if(I.length<32)BT(I,_);else $.unmask(I,_)}}catch($){}});var VT=S((Ad,RT)=>{var KT=Symbol("kDone"),eq=Symbol("kRun");class WT{constructor($){this[KT]=()=>{this.pending--,this[eq]()},this.concurrency=$||1/0,this.jobs=[],this.pending=0}add($){this.jobs.push($),this[eq]()}[eq](){if(this.pending===this.concurrency)return;if(this.jobs.length){let $=this.jobs.shift();this.pending++,$(this[KT])}}}RT.exports=WT});var GU=S((bd,jT)=>{var zU=z$("zlib"),ZT=gU(),Pf=VT(),{kStatusCode:AT}=U6(),jf=Buffer[Symbol.species],Sf=Buffer.from([0,0,255,255]),c2=Symbol("permessage-deflate"),_6=Symbol("total-length"),VI=Symbol("callback"),C6=Symbol("buffers"),ZI=Symbol("error"),h2;class bT{constructor($,I,_){if(this._maxPayload=_|0,this._options=$||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!I,this._deflate=null,this._inflate=null,this.params=null,!h2){let u=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;h2=new Pf(u)}}static get extensionName(){return"permessage-deflate"}offer(){let $={};if(this._options.serverNoContextTakeover)$.server_no_context_takeover=!0;if(this._options.clientNoContextTakeover)$.client_no_context_takeover=!0;if(this._options.serverMaxWindowBits)$.server_max_window_bits=this._options.serverMaxWindowBits;if(this._options.clientMaxWindowBits)$.client_max_window_bits=this._options.clientMaxWindowBits;else if(this._options.clientMaxWindowBits==null)$.client_max_window_bits=!0;return $}accept($){return $=this.normalizeParams($),this.params=this._isServer?this.acceptAsServer($):this.acceptAsClient($),this.params}cleanup(){if(this._inflate)this._inflate.close(),this._inflate=null;if(this._deflate){let $=this._deflate[VI];if(this._deflate.close(),this._deflate=null,$)$(Error("The deflate stream was closed while data was being processed"))}}acceptAsServer($){let I=this._options,_=$.find((u)=>{if(I.serverNoContextTakeover===!1&&u.server_no_context_takeover||u.server_max_window_bits&&(I.serverMaxWindowBits===!1||typeof I.serverMaxWindowBits==="number"&&I.serverMaxWindowBits>u.server_max_window_bits)||typeof I.clientMaxWindowBits==="number"&&!u.client_max_window_bits)return!1;return!0});if(!_)throw Error("None of the extension offers can be accepted");if(I.serverNoContextTakeover)_.server_no_context_takeover=!0;if(I.clientNoContextTakeover)_.client_no_context_takeover=!0;if(typeof I.serverMaxWindowBits==="number")_.server_max_window_bits=I.serverMaxWindowBits;if(typeof I.clientMaxWindowBits==="number")_.client_max_window_bits=I.clientMaxWindowBits;else if(_.client_max_window_bits===!0||I.clientMaxWindowBits===!1)delete _.client_max_window_bits;return _}acceptAsClient($){let I=$[0];if(this._options.clientNoContextTakeover===!1&&I.client_no_context_takeover)throw Error('Unexpected parameter "client_no_context_takeover"');if(!I.client_max_window_bits){if(typeof this._options.clientMaxWindowBits==="number")I.client_max_window_bits=this._options.clientMaxWindowBits}else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits==="number"&&I.client_max_window_bits>this._options.clientMaxWindowBits)throw Error('Unexpected or invalid parameter "client_max_window_bits"');return I}normalizeParams($){return $.forEach((I)=>{Object.keys(I).forEach((_)=>{let u=I[_];if(u.length>1)throw Error(`Parameter "${_}" must have only a single value`);if(u=u[0],_==="client_max_window_bits"){if(u!==!0){let U=+u;if(!Number.isInteger(U)||U<8||U>15)throw TypeError(`Invalid value for parameter "${_}": ${u}`);u=U}else if(!this._isServer)throw TypeError(`Invalid value for parameter "${_}": ${u}`)}else if(_==="server_max_window_bits"){let U=+u;if(!Number.isInteger(U)||U<8||U>15)throw TypeError(`Invalid value for parameter "${_}": ${u}`);u=U}else if(_==="client_no_context_takeover"||_==="server_no_context_takeover"){if(u!==!0)throw TypeError(`Invalid value for parameter "${_}": ${u}`)}else throw Error(`Unknown parameter "${_}"`);I[_]=u})}),$}decompress($,I,_){h2.add((u)=>{this._decompress($,I,(U,g)=>{u(),_(U,g)})})}compress($,I,_){h2.add((u)=>{this._compress($,I,(U,g)=>{u(),_(U,g)})})}_decompress($,I,_){let u=this._isServer?"client":"server";if(!this._inflate){let U=`${u}_max_window_bits`,g=typeof this.params[U]!=="number"?zU.Z_DEFAULT_WINDOWBITS:this.params[U];this._inflate=zU.createInflateRaw({...this._options.zlibInflateOptions,windowBits:g}),this._inflate[c2]=this,this._inflate[_6]=0,this._inflate[C6]=[],this._inflate.on("error",wf),this._inflate.on("data",PT)}if(this._inflate[VI]=_,this._inflate.write($),I)this._inflate.write(Sf);this._inflate.flush(()=>{let U=this._inflate[ZI];if(U){this._inflate.close(),this._inflate=null,_(U);return}let g=ZT.concat(this._inflate[C6],this._inflate[_6]);if(this._inflate._readableState.endEmitted)this._inflate.close(),this._inflate=null;else if(this._inflate[_6]=0,this._inflate[C6]=[],I&&this.params[`${u}_no_context_takeover`])this._inflate.reset();_(null,g)})}_compress($,I,_){let u=this._isServer?"server":"client";if(!this._deflate){let U=`${u}_max_window_bits`,g=typeof this.params[U]!=="number"?zU.Z_DEFAULT_WINDOWBITS:this.params[U];this._deflate=zU.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:g}),this._deflate[_6]=0,this._deflate[C6]=[],this._deflate.on("data",Ff)}this._deflate[VI]=_,this._deflate.write($),this._deflate.flush(zU.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let U=ZT.concat(this._deflate[C6],this._deflate[_6]);if(I)U=new jf(U.buffer,U.byteOffset,U.length-4);if(this._deflate[VI]=null,this._deflate[_6]=0,this._deflate[C6]=[],I&&this.params[`${u}_no_context_takeover`])this._deflate.reset();_(null,U)})}}jT.exports=bT;function Ff($){this[C6].push($),this[_6]+=$.length}function PT($){if(this[_6]+=$.length,this[c2]._maxPayload<1||this[_6]<=this[c2]._maxPayload){this[C6].push($);return}this[ZI]=RangeError("Max payload size exceeded"),this[ZI].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[ZI][AT]=1009,this.removeListener("data",PT),this.reset()}function wf($){if(this[c2]._inflate=null,this[ZI]){this[VI](this[ZI]);return}$[AT]=1007,this[VI]($)}});var AI=S((Pd,d2)=>{var{isUtf8:ST}=z$("buffer"),{hasBlob:Ef}=U6(),Cf=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function ff($){return $>=1000&&$<=1014&&$!==1004&&$!==1005&&$!==1006||$>=3000&&$<=4999}function sq($){let I=$.length,_=0;while(_<I)if(($[_]&128)===0)_++;else if(($[_]&224)===192){if(_+1===I||($[_+1]&192)!==128||($[_]&254)===192)return!1;_+=2}else if(($[_]&240)===224){if(_+2>=I||($[_+1]&192)!==128||($[_+2]&192)!==128||$[_]===224&&($[_+1]&224)===128||$[_]===237&&($[_+1]&224)===160)return!1;_+=3}else if(($[_]&248)===240){if(_+3>=I||($[_+1]&192)!==128||($[_+2]&192)!==128||($[_+3]&192)!==128||$[_]===240&&($[_+1]&240)===128||$[_]===244&&$[_+1]>143||$[_]>244)return!1;_+=4}else return!1;return!0}function xf($){return Ef&&typeof $==="object"&&typeof $.arrayBuffer==="function"&&typeof $.type==="string"&&typeof $.stream==="function"&&($[Symbol.toStringTag]==="Blob"||$[Symbol.toStringTag]==="File")}d2.exports={isBlob:xf,isValidStatusCode:ff,isValidUTF8:sq,tokenChars:Cf};if(ST)d2.exports.isValidUTF8=function($){return $.length<24?sq($):ST($)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let $=(()=>{throw new Error("Cannot require module "+"utf-8-validate");})();d2.exports.isValidUTF8=function(I){return I.length<32?sq(I):$(I)}}catch($){}});var I5=S((jd,fT)=>{var{Writable:kf}=z$("stream"),FT=GU(),{BINARY_TYPES:yf,EMPTY_BUFFER:wT,kStatusCode:lf,kWebSocket:mf}=U6(),{concat:$5,toArrayBuffer:nf,unmask:rf}=gU(),{isValidStatusCode:hf,isValidUTF8:ET}=AI(),o2=Buffer[Symbol.species];class CT extends kf{constructor($={}){super();this._allowSynchronousEvents=$.allowSynchronousEvents!==void 0?$.allowSynchronousEvents:!0,this._binaryType=$.binaryType||yf[0],this._extensions=$.extensions||{},this._isServer=!!$.isServer,this._maxPayload=$.maxPayload|0,this._skipUTF8Validation=!!$.skipUTF8Validation,this[mf]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=0}_write($,I,_){if(this._opcode===8&&this._state==0)return _();this._bufferedBytes+=$.length,this._buffers.push($),this.startLoop(_)}consume($){if(this._bufferedBytes-=$,$===this._buffers[0].length)return this._buffers.shift();if($<this._buffers[0].length){let _=this._buffers[0];return this._buffers[0]=new o2(_.buffer,_.byteOffset+$,_.length-$),new o2(_.buffer,_.byteOffset,$)}let I=Buffer.allocUnsafe($);do{let _=this._buffers[0],u=I.length-$;if($>=_.length)I.set(this._buffers.shift(),u);else I.set(new Uint8Array(_.buffer,_.byteOffset,$),u),this._buffers[0]=new o2(_.buffer,_.byteOffset+$,_.length-$);$-=_.length}while($>0);return I}startLoop($){this._loop=!0;do switch(this._state){case 0:this.getInfo($);break;case 1:this.getPayloadLength16($);break;case 2:this.getPayloadLength64($);break;case 3:this.getMask();break;case 4:this.getData($);break;case 5:case 6:this._loop=!1;return}while(this._loop);if(!this._errored)$()}getInfo($){if(this._bufferedBytes<2){this._loop=!1;return}let I=this.consume(2);if((I[0]&48)!==0){let u=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");$(u);return}let _=(I[0]&64)===64;if(_&&!this._extensions[FT.extensionName]){let u=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");$(u);return}if(this._fin=(I[0]&128)===128,this._opcode=I[0]&15,this._payloadLength=I[1]&127,this._opcode===0){if(_){let u=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");$(u);return}if(!this._fragmented){let u=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");$(u);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let u=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");$(u);return}this._compressed=_}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let u=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");$(u);return}if(_){let u=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");$(u);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let u=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");$(u);return}}else{let u=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");$(u);return}if(!this._fin&&!this._fragmented)this._fragmented=this._opcode;if(this._masked=(I[1]&128)===128,this._isServer){if(!this._masked){let u=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");$(u);return}}else if(this._masked){let u=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");$(u);return}if(this._payloadLength===126)this._state=1;else if(this._payloadLength===127)this._state=2;else this.haveLength($)}getPayloadLength16($){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength($)}getPayloadLength64($){if(this._bufferedBytes<8){this._loop=!1;return}let I=this.consume(8),_=I.readUInt32BE(0);if(_>Math.pow(2,21)-1){let u=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");$(u);return}this._payloadLength=_*Math.pow(2,32)+I.readUInt32BE(4),this.haveLength($)}haveLength($){if(this._payloadLength&&this._opcode<8){if(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0){let I=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");$(I);return}}if(this._masked)this._state=3;else this._state=4}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=4}getData($){let I=wT;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}if(I=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0)rf(I,this._mask)}if(this._opcode>7){this.controlMessage(I,$);return}if(this._compressed){this._state=5,this.decompress(I,$);return}if(I.length)this._messageLength=this._totalPayloadLength,this._fragments.push(I);this.dataMessage($)}decompress($,I){this._extensions[FT.extensionName].decompress($,this._fin,(u,U)=>{if(u)return I(u);if(U.length){if(this._messageLength+=U.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let g=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");I(g);return}this._fragments.push(U)}if(this.dataMessage(I),this._state===0)this.startLoop(I)})}dataMessage($){if(!this._fin){this._state=0;return}let I=this._messageLength,_=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let u;if(this._binaryType==="nodebuffer")u=$5(_,I);else if(this._binaryType==="arraybuffer")u=nf($5(_,I));else if(this._binaryType==="blob")u=new Blob(_);else u=_;if(this._allowSynchronousEvents)this.emit("message",u,!0),this._state=0;else this._state=6,setImmediate(()=>{this.emit("message",u,!0),this._state=0,this.startLoop($)})}else{let u=$5(_,I);if(!this._skipUTF8Validation&&!ET(u)){let U=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");$(U);return}if(this._state===5||this._allowSynchronousEvents)this.emit("message",u,!1),this._state=0;else this._state=6,setImmediate(()=>{this.emit("message",u,!1),this._state=0,this.startLoop($)})}}controlMessage($,I){if(this._opcode===8){if($.length===0)this._loop=!1,this.emit("conclude",1005,wT),this.end();else{let _=$.readUInt16BE(0);if(!hf(_)){let U=this.createError(RangeError,`invalid status code ${_}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");I(U);return}let u=new o2($.buffer,$.byteOffset+2,$.length-2);if(!this._skipUTF8Validation&&!ET(u)){let U=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");I(U);return}this._loop=!1,this.emit("conclude",_,u),this.end()}this._state=0;return}if(this._allowSynchronousEvents)this.emit(this._opcode===9?"ping":"pong",$),this._state=0;else this._state=6,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",$),this._state=0,this.startLoop(I)})}createError($,I,_,u,U){this._loop=!1,this._errored=!0;let g=new $(_?`Invalid WebSocket frame: ${I}`:I);return Error.captureStackTrace(g,this.createError),g.code=U,g[lf]=u,g}}fT.exports=CT});var _5=S((Fd,yT)=>{var{Duplex:Sd}=z$("stream"),{randomFillSync:cf}=z$("crypto"),xT=GU(),{EMPTY_BUFFER:df,kWebSocket:of,NOOP:pf}=U6(),{isBlob:bI,isValidStatusCode:tf}=AI(),{mask:kT,toBuffer:O1}=gU(),v4=Symbol("kByteLength"),af=Buffer.alloc(4),v1,PI=8192,R4=0,ef=1,sf=2;class f6{constructor($,I,_){if(this._extensions=I||{},_)this._generateMask=_,this._maskBuffer=Buffer.alloc(4);this._socket=$,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=R4,this.onerror=pf,this[of]=void 0}static frame($,I){let _,u=!1,U=2,g=!1;if(I.mask){if(_=I.maskBuffer||af,I.generateMask)I.generateMask(_);else{if(PI===8192){if(v1===void 0)v1=Buffer.alloc(8192);cf(v1,0,8192),PI=0}_[0]=v1[PI++],_[1]=v1[PI++],_[2]=v1[PI++],_[3]=v1[PI++]}g=(_[0]|_[1]|_[2]|_[3])===0,U=6}let z;if(typeof $==="string")if((!I.mask||g)&&I[v4]!==void 0)z=I[v4];else $=Buffer.from($),z=$.length;else z=$.length,u=I.mask&&I.readOnly&&!g;let G=z;if(z>=65536)U+=8,G=127;else if(z>125)U+=2,G=126;let J=Buffer.allocUnsafe(u?z+U:U);if(J[0]=I.fin?I.opcode|128:I.opcode,I.rsv1)J[0]|=64;if(J[1]=G,G===126)J.writeUInt16BE(z,2);else if(G===127)J[2]=J[3]=0,J.writeUIntBE(z,4,6);if(!I.mask)return[J,$];if(J[1]|=128,J[U-4]=_[0],J[U-3]=_[1],J[U-2]=_[2],J[U-1]=_[3],g)return[J,$];if(u)return kT($,_,J,U,z),[J];return kT($,_,$,0,z),[J,$]}close($,I,_,u){let U;if($===void 0)U=df;else if(typeof $!=="number"||!tf($))throw TypeError("First argument must be a valid error code number");else if(I===void 0||!I.length)U=Buffer.allocUnsafe(2),U.writeUInt16BE($,0);else{let z=Buffer.byteLength(I);if(z>123)throw RangeError("The message must not be greater than 123 bytes");if(U=Buffer.allocUnsafe(2+z),U.writeUInt16BE($,0),typeof I==="string")U.write(I,2);else U.set(I,2)}let g={[v4]:U.length,fin:!0,generateMask:this._generateMask,mask:_,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};if(this._state!==R4)this.enqueue([this.dispatch,U,!1,g,u]);else this.sendFrame(f6.frame(U,g),u)}ping($,I,_){let u,U;if(typeof $==="string")u=Buffer.byteLength($),U=!1;else if(bI($))u=$.size,U=!1;else $=O1($),u=$.length,U=O1.readOnly;if(u>125)throw RangeError("The data size must not be greater than 125 bytes");let g={[v4]:u,fin:!0,generateMask:this._generateMask,mask:I,maskBuffer:this._maskBuffer,opcode:9,readOnly:U,rsv1:!1};if(bI($))if(this._state!==R4)this.enqueue([this.getBlobData,$,!1,g,_]);else this.getBlobData($,!1,g,_);else if(this._state!==R4)this.enqueue([this.dispatch,$,!1,g,_]);else this.sendFrame(f6.frame($,g),_)}pong($,I,_){let u,U;if(typeof $==="string")u=Buffer.byteLength($),U=!1;else if(bI($))u=$.size,U=!1;else $=O1($),u=$.length,U=O1.readOnly;if(u>125)throw RangeError("The data size must not be greater than 125 bytes");let g={[v4]:u,fin:!0,generateMask:this._generateMask,mask:I,maskBuffer:this._maskBuffer,opcode:10,readOnly:U,rsv1:!1};if(bI($))if(this._state!==R4)this.enqueue([this.getBlobData,$,!1,g,_]);else this.getBlobData($,!1,g,_);else if(this._state!==R4)this.enqueue([this.dispatch,$,!1,g,_]);else this.sendFrame(f6.frame($,g),_)}send($,I,_){let u=this._extensions[xT.extensionName],U=I.binary?2:1,g=I.compress,z,G;if(typeof $==="string")z=Buffer.byteLength($),G=!1;else if(bI($))z=$.size,G=!1;else $=O1($),z=$.length,G=O1.readOnly;if(this._firstFragment){if(this._firstFragment=!1,g&&u&&u.params[u._isServer?"server_no_context_takeover":"client_no_context_takeover"])g=z>=u._threshold;this._compress=g}else g=!1,U=0;if(I.fin)this._firstFragment=!0;let J={[v4]:z,fin:I.fin,generateMask:this._generateMask,mask:I.mask,maskBuffer:this._maskBuffer,opcode:U,readOnly:G,rsv1:g};if(bI($))if(this._state!==R4)this.enqueue([this.getBlobData,$,this._compress,J,_]);else this.getBlobData($,this._compress,J,_);else if(this._state!==R4)this.enqueue([this.dispatch,$,this._compress,J,_]);else this.dispatch($,this._compress,J,_)}getBlobData($,I,_,u){this._bufferedBytes+=_[v4],this._state=sf,$.arrayBuffer().then((U)=>{if(this._socket.destroyed){let z=Error("The socket was closed while the blob was being read");process.nextTick(U5,this,z,u);return}this._bufferedBytes-=_[v4];let g=O1(U);if(!I)this._state=R4,this.sendFrame(f6.frame(g,_),u),this.dequeue();else this.dispatch(g,I,_,u)}).catch((U)=>{process.nextTick($x,this,U,u)})}dispatch($,I,_,u){if(!I){this.sendFrame(f6.frame($,_),u);return}let U=this._extensions[xT.extensionName];this._bufferedBytes+=_[v4],this._state=ef,U.compress($,_.fin,(g,z)=>{if(this._socket.destroyed){let G=Error("The socket was closed while data was being compressed");U5(this,G,u);return}this._bufferedBytes-=_[v4],this._state=R4,_.readOnly=!1,this.sendFrame(f6.frame(z,_),u),this.dequeue()})}dequeue(){while(this._state===R4&&this._queue.length){let $=this._queue.shift();this._bufferedBytes-=$[3][v4],Reflect.apply($[0],this,$.slice(1))}}enqueue($){this._bufferedBytes+=$[3][v4],this._queue.push($)}sendFrame($,I){if($.length===2)this._socket.cork(),this._socket.write($[0]),this._socket.write($[1],I),this._socket.uncork();else this._socket.write($[0],I)}}yT.exports=f6;function U5($,I,_){if(typeof _==="function")_(I);for(let u=0;u<$._queue.length;u++){let U=$._queue[u],g=U[U.length-1];if(typeof g==="function")g(I)}}function $x($,I,_){U5($,I,_),$.onerror(I)}});var oT=S((wd,dT)=>{var{kForOnEventAttribute:JU,kListener:u5}=U6(),iT=Symbol("kCode"),lT=Symbol("kData"),mT=Symbol("kError"),nT=Symbol("kMessage"),rT=Symbol("kReason"),jI=Symbol("kTarget"),hT=Symbol("kType"),cT=Symbol("kWasClean");class x6{constructor($){this[jI]=null,this[hT]=$}get target(){return this[jI]}get type(){return this[hT]}}Object.defineProperty(x6.prototype,"target",{enumerable:!0});Object.defineProperty(x6.prototype,"type",{enumerable:!0});class SI extends x6{constructor($,I={}){super($);this[iT]=I.code===void 0?0:I.code,this[rT]=I.reason===void 0?"":I.reason,this[cT]=I.wasClean===void 0?!1:I.wasClean}get code(){return this[iT]}get reason(){return this[rT]}get wasClean(){return this[cT]}}Object.defineProperty(SI.prototype,"code",{enumerable:!0});Object.defineProperty(SI.prototype,"reason",{enumerable:!0});Object.defineProperty(SI.prototype,"wasClean",{enumerable:!0});class XU extends x6{constructor($,I={}){super($);this[mT]=I.error===void 0?null:I.error,this[nT]=I.message===void 0?"":I.message}get error(){return this[mT]}get message(){return this[nT]}}Object.defineProperty(XU.prototype,"error",{enumerable:!0});Object.defineProperty(XU.prototype,"message",{enumerable:!0});class t2 extends x6{constructor($,I={}){super($);this[lT]=I.data===void 0?null:I.data}get data(){return this[lT]}}Object.defineProperty(t2.prototype,"data",{enumerable:!0});var Ix={addEventListener($,I,_={}){for(let U of this.listeners($))if(!_[JU]&&U[u5]===I&&!U[JU])return;let u;if($==="message")u=function(g,z){let G=new t2("message",{data:z?g:g.toString()});G[jI]=this,p2(I,this,G)};else if($==="close")u=function(g,z){let G=new SI("close",{code:g,reason:z.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});G[jI]=this,p2(I,this,G)};else if($==="error")u=function(g){let z=new XU("error",{error:g,message:g.message});z[jI]=this,p2(I,this,z)};else if($==="open")u=function(){let g=new x6("open");g[jI]=this,p2(I,this,g)};else return;if(u[JU]=!!_[JU],u[u5]=I,_.once)this.once($,u);else this.on($,u)},removeEventListener($,I){for(let _ of this.listeners($))if(_[u5]===I&&!_[JU]){this.removeListener($,_);break}}};dT.exports={CloseEvent:SI,ErrorEvent:XU,Event:x6,EventTarget:Ix,MessageEvent:t2};function p2($,I,_){if(typeof $==="object"&&$.handleEvent)$.handleEvent.call($,_);else $.call(I,_)}});var g5=S((Ed,pT)=>{var{tokenChars:qU}=AI();function l4($,I,_){if($[I]===void 0)$[I]=[_];else $[I].push(_)}function Ux($){let I=Object.create(null),_=Object.create(null),u=!1,U=!1,g=!1,z,G,J=-1,X=-1,N=-1,q=0;for(;q<$.length;q++)if(X=$.charCodeAt(q),z===void 0)if(N===-1&&qU[X]===1){if(J===-1)J=q}else if(q!==0&&(X===32||X===9)){if(N===-1&&J!==-1)N=q}else if(X===59||X===44){if(J===-1)throw SyntaxError(`Unexpected character at index ${q}`);if(N===-1)N=q;let Y=$.slice(J,N);if(X===44)l4(I,Y,_),_=Object.create(null);else z=Y;J=N=-1}else throw SyntaxError(`Unexpected character at index ${q}`);else if(G===void 0)if(N===-1&&qU[X]===1){if(J===-1)J=q}else if(X===32||X===9){if(N===-1&&J!==-1)N=q}else if(X===59||X===44){if(J===-1)throw SyntaxError(`Unexpected character at index ${q}`);if(N===-1)N=q;if(l4(_,$.slice(J,N),!0),X===44)l4(I,z,_),_=Object.create(null),z=void 0;J=N=-1}else if(X===61&&J!==-1&&N===-1)G=$.slice(J,q),J=N=-1;else throw SyntaxError(`Unexpected character at index ${q}`);else if(U){if(qU[X]!==1)throw SyntaxError(`Unexpected character at index ${q}`);if(J===-1)J=q;else if(!u)u=!0;U=!1}else if(g)if(qU[X]===1){if(J===-1)J=q}else if(X===34&&J!==-1)g=!1,N=q;else if(X===92)U=!0;else throw SyntaxError(`Unexpected character at index ${q}`);else if(X===34&&$.charCodeAt(q-1)===61)g=!0;else if(N===-1&&qU[X]===1){if(J===-1)J=q}else if(J!==-1&&(X===32||X===9)){if(N===-1)N=q}else if(X===59||X===44){if(J===-1)throw SyntaxError(`Unexpected character at index ${q}`);if(N===-1)N=q;let Y=$.slice(J,N);if(u)Y=Y.replace(/\\/g,""),u=!1;if(l4(_,G,Y),X===44)l4(I,z,_),_=Object.create(null),z=void 0;G=void 0,J=N=-1}else throw SyntaxError(`Unexpected character at index ${q}`);if(J===-1||g||X===32||X===9)throw SyntaxError("Unexpected end of input");if(N===-1)N=q;let Q=$.slice(J,N);if(z===void 0)l4(I,Q,_);else{if(G===void 0)l4(_,Q,!0);else if(u)l4(_,G,Q.replace(/\\/g,""));else l4(_,G,Q);l4(I,z,_)}return I}function _x($){return Object.keys($).map((I)=>{let _=$[I];if(!Array.isArray(_))_=[_];return _.map((u)=>{return[I].concat(Object.keys(u).map((U)=>{let g=u[U];if(!Array.isArray(g))g=[g];return g.map((z)=>z===!0?U:`${U}=${z}`).join("; ")})).join("; ")}).join(", ")}).join(", ")}pT.exports={format:_x,parse:Ux}});var $g=S((xd,GM)=>{var ux=z$("events"),gx=z$("https"),zx=z$("http"),eT=z$("net"),Gx=z$("tls"),{randomBytes:Jx,createHash:Xx}=z$("crypto"),{Duplex:Cd,Readable:fd}=z$("stream"),{URL:z5}=z$("url"),k6=GU(),qx=I5(),Nx=_5(),{isBlob:Qx}=AI(),{BINARY_TYPES:tT,CLOSE_TIMEOUT:Hx,EMPTY_BUFFER:a2,GUID:Yx,kForOnEventAttribute:G5,kListener:Ox,kStatusCode:vx,kWebSocket:j$,NOOP:sT}=U6(),{EventTarget:{addEventListener:Tx,removeEventListener:Mx}}=oT(),{format:Dx,parse:Lx}=g5(),{toBuffer:Bx}=gU(),$M=Symbol("kAborted"),J5=[8,13],u6=["CONNECTING","OPEN","CLOSING","CLOSED"],Kx=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/;class h extends ux{constructor($,I,_){super();if(this._binaryType=tT[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=a2,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=h.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,$!==null){if(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,I===void 0)I=[];else if(!Array.isArray(I))if(typeof I==="object"&&I!==null)_=I,I=[];else I=[I];IM(this,$,I,_)}else this._autoPong=_.autoPong,this._closeTimeout=_.closeTimeout,this._isServer=!0}get binaryType(){return this._binaryType}set binaryType($){if(!tT.includes($))return;if(this._binaryType=$,this._receiver)this._receiver._binaryType=$}get bufferedAmount(){if(!this._socket)return this._bufferedAmount;return this._socket._writableState.length+this._sender._bufferedBytes}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket($,I,_){let u=new qx({allowSynchronousEvents:_.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:_.maxPayload,skipUTF8Validation:_.skipUTF8Validation}),U=new Nx($,this._extensions,_.generateMask);if(this._receiver=u,this._sender=U,this._socket=$,u[j$]=this,U[j$]=this,$[j$]=this,u.on("conclude",Vx),u.on("drain",Zx),u.on("error",Ax),u.on("message",bx),u.on("ping",Px),u.on("pong",jx),U.onerror=Sx,$.setTimeout)$.setTimeout(0);if($.setNoDelay)$.setNoDelay();if(I.length>0)$.unshift(I);$.on("close",uM),$.on("data",s2),$.on("end",gM),$.on("error",zM),this._readyState=h.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=h.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}if(this._extensions[k6.extensionName])this._extensions[k6.extensionName].cleanup();this._receiver.removeAllListeners(),this._readyState=h.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close($,I){if(this.readyState===h.CLOSED)return;if(this.readyState===h.CONNECTING){G4(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===h.CLOSING){if(this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted))this._socket.end();return}this._readyState=h.CLOSING,this._sender.close($,I,!this._isServer,(_)=>{if(_)return;if(this._closeFrameSent=!0,this._closeFrameReceived||this._receiver._writableState.errorEmitted)this._socket.end()}),_M(this)}pause(){if(this.readyState===h.CONNECTING||this.readyState===h.CLOSED)return;this._paused=!0,this._socket.pause()}ping($,I,_){if(this.readyState===h.CONNECTING)throw Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof $==="function")_=$,$=I=void 0;else if(typeof I==="function")_=I,I=void 0;if(typeof $==="number")$=$.toString();if(this.readyState!==h.OPEN){X5(this,$,_);return}if(I===void 0)I=!this._isServer;this._sender.ping($||a2,I,_)}pong($,I,_){if(this.readyState===h.CONNECTING)throw Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof $==="function")_=$,$=I=void 0;else if(typeof I==="function")_=I,I=void 0;if(typeof $==="number")$=$.toString();if(this.readyState!==h.OPEN){X5(this,$,_);return}if(I===void 0)I=!this._isServer;this._sender.pong($||a2,I,_)}resume(){if(this.readyState===h.CONNECTING||this.readyState===h.CLOSED)return;if(this._paused=!1,!this._receiver._writableState.needDrain)this._socket.resume()}send($,I,_){if(this.readyState===h.CONNECTING)throw Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof I==="function")_=I,I={};if(typeof $==="number")$=$.toString();if(this.readyState!==h.OPEN){X5(this,$,_);return}let u={binary:typeof $!=="string",mask:!this._isServer,compress:!0,fin:!0,...I};if(!this._extensions[k6.extensionName])u.compress=!1;this._sender.send($||a2,u,_)}terminate(){if(this.readyState===h.CLOSED)return;if(this.readyState===h.CONNECTING){G4(this,this._req,"WebSocket was closed before the connection was established");return}if(this._socket)this._readyState=h.CLOSING,this._socket.destroy()}}Object.defineProperty(h,"CONNECTING",{enumerable:!0,value:u6.indexOf("CONNECTING")});Object.defineProperty(h.prototype,"CONNECTING",{enumerable:!0,value:u6.indexOf("CONNECTING")});Object.defineProperty(h,"OPEN",{enumerable:!0,value:u6.indexOf("OPEN")});Object.defineProperty(h.prototype,"OPEN",{enumerable:!0,value:u6.indexOf("OPEN")});Object.defineProperty(h,"CLOSING",{enumerable:!0,value:u6.indexOf("CLOSING")});Object.defineProperty(h.prototype,"CLOSING",{enumerable:!0,value:u6.indexOf("CLOSING")});Object.defineProperty(h,"CLOSED",{enumerable:!0,value:u6.indexOf("CLOSED")});Object.defineProperty(h.prototype,"CLOSED",{enumerable:!0,value:u6.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(($)=>{Object.defineProperty(h.prototype,$,{enumerable:!0})});["open","error","close","message"].forEach(($)=>{Object.defineProperty(h.prototype,`on${$}`,{enumerable:!0,get(){for(let I of this.listeners($))if(I[G5])return I[Ox];return null},set(I){for(let _ of this.listeners($))if(_[G5]){this.removeListener($,_);break}if(typeof I!=="function")return;this.addEventListener($,I,{[G5]:!0})}})});h.prototype.addEventListener=Tx;h.prototype.removeEventListener=Mx;GM.exports=h;function IM($,I,_,u){let U={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:Hx,protocolVersion:J5[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...u,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if($._autoPong=U.autoPong,$._closeTimeout=U.closeTimeout,!J5.includes(U.protocolVersion))throw RangeError(`Unsupported protocol version: ${U.protocolVersion} (supported versions: ${J5.join(", ")})`);let g;if(I instanceof z5)g=I;else try{g=new z5(I)}catch(H){throw SyntaxError(`Invalid URL: ${I}`)}if(g.protocol==="http:")g.protocol="ws:";else if(g.protocol==="https:")g.protocol="wss:";$._url=g.href;let z=g.protocol==="wss:",G=g.protocol==="ws+unix:",J;if(g.protocol!=="ws:"&&!z&&!G)J=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`;else if(G&&!g.pathname)J="The URL's pathname is empty";else if(g.hash)J="The URL contains a fragment identifier";if(J){let H=SyntaxError(J);if($._redirects===0)throw H;else{e2($,H);return}}let X=z?443:80,N=Jx(16).toString("base64"),q=z?gx.request:zx.request,Q=new Set,Y;if(U.createConnection=U.createConnection||(z?Rx:Wx),U.defaultPort=U.defaultPort||X,U.port=g.port||X,U.host=g.hostname.startsWith("[")?g.hostname.slice(1,-1):g.hostname,U.headers={...U.headers,"Sec-WebSocket-Version":U.protocolVersion,"Sec-WebSocket-Key":N,Connection:"Upgrade",Upgrade:"websocket"},U.path=g.pathname+g.search,U.timeout=U.handshakeTimeout,U.perMessageDeflate)Y=new k6(U.perMessageDeflate!==!0?U.perMessageDeflate:{},!1,U.maxPayload),U.headers["Sec-WebSocket-Extensions"]=Dx({[k6.extensionName]:Y.offer()});if(_.length){for(let H of _){if(typeof H!=="string"||!Kx.test(H)||Q.has(H))throw SyntaxError("An invalid or duplicated subprotocol was specified");Q.add(H)}U.headers["Sec-WebSocket-Protocol"]=_.join(",")}if(U.origin)if(U.protocolVersion<13)U.headers["Sec-WebSocket-Origin"]=U.origin;else U.headers.Origin=U.origin;if(g.username||g.password)U.auth=`${g.username}:${g.password}`;if(G){let H=U.path.split(":");U.socketPath=H[0],U.path=H[1]}let O;if(U.followRedirects){if($._redirects===0){$._originalIpc=G,$._originalSecure=z,$._originalHostOrSocketPath=G?U.socketPath:g.host;let H=u&&u.headers;if(u={...u,headers:{}},H)for(let[v,T]of Object.entries(H))u.headers[v.toLowerCase()]=T}else if($.listenerCount("redirect")===0){let H=G?$._originalIpc?U.socketPath===$._originalHostOrSocketPath:!1:$._originalIpc?!1:g.host===$._originalHostOrSocketPath;if(!H||$._originalSecure&&!z){if(delete U.headers.authorization,delete U.headers.cookie,!H)delete U.headers.host;U.auth=void 0}}if(U.auth&&!u.headers.authorization)u.headers.authorization="Basic "+Buffer.from(U.auth).toString("base64");if(O=$._req=q(U),$._redirects)$.emit("redirect",$.url,O)}else O=$._req=q(U);if(U.timeout)O.on("timeout",()=>{G4($,O,"Opening handshake has timed out")});if(O.on("error",(H)=>{if(O===null||O[$M])return;O=$._req=null,e2($,H)}),O.on("response",(H)=>{let v=H.headers.location,T=H.statusCode;if(v&&U.followRedirects&&T>=300&&T<400){if(++$._redirects>U.maxRedirects){G4($,O,"Maximum redirects exceeded");return}O.abort();let K;try{K=new z5(v,I)}catch(D){let B=SyntaxError(`Invalid URL: ${v}`);e2($,B);return}IM($,K,_,u)}else if(!$.emit("unexpected-response",O,H))G4($,O,`Unexpected server response: ${H.statusCode}`)}),O.on("upgrade",(H,v,T)=>{if($.emit("upgrade",H),$.readyState!==h.CONNECTING)return;O=$._req=null;let K=H.headers.upgrade;if(K===void 0||K.toLowerCase()!=="websocket"){G4($,v,"Invalid Upgrade header");return}let D=Xx("sha1").update(N+Yx).digest("base64");if(H.headers["sec-websocket-accept"]!==D){G4($,v,"Invalid Sec-WebSocket-Accept header");return}let B=H.headers["sec-websocket-protocol"],R;if(B!==void 0){if(!Q.size)R="Server sent a subprotocol but none was requested";else if(!Q.has(B))R="Server sent an invalid subprotocol"}else if(Q.size)R="Server sent no subprotocol";if(R){G4($,v,R);return}if(B)$._protocol=B;let V=H.headers["sec-websocket-extensions"];if(V!==void 0){if(!Y){G4($,v,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let M;try{M=Lx(V)}catch(E){G4($,v,"Invalid Sec-WebSocket-Extensions header");return}let W=Object.keys(M);if(W.length!==1||W[0]!==k6.extensionName){G4($,v,"Server indicated an extension that was not requested");return}try{Y.accept(M[k6.extensionName])}catch(E){G4($,v,"Invalid Sec-WebSocket-Extensions header");return}$._extensions[k6.extensionName]=Y}$.setSocket(v,T,{allowSynchronousEvents:U.allowSynchronousEvents,generateMask:U.generateMask,maxPayload:U.maxPayload,skipUTF8Validation:U.skipUTF8Validation})}),U.finishRequest)U.finishRequest(O,$);else O.end()}function e2($,I){$._readyState=h.CLOSING,$._errorEmitted=!0,$.emit("error",I),$.emitClose()}function Wx($){return $.path=$.socketPath,eT.connect($)}function Rx($){if($.path=void 0,!$.servername&&$.servername!=="")$.servername=eT.isIP($.host)?"":$.host;return Gx.connect($)}function G4($,I,_){$._readyState=h.CLOSING;let u=Error(_);if(Error.captureStackTrace(u,G4),I.setHeader){if(I[$M]=!0,I.abort(),I.socket&&!I.socket.destroyed)I.socket.destroy();process.nextTick(e2,$,u)}else I.destroy(u),I.once("error",$.emit.bind($,"error")),I.once("close",$.emitClose.bind($))}function X5($,I,_){if(I){let u=Qx(I)?I.size:Bx(I).length;if($._socket)$._sender._bufferedBytes+=u;else $._bufferedAmount+=u}if(_){let u=Error(`WebSocket is not open: readyState ${$.readyState} (${u6[$.readyState]})`);process.nextTick(_,u)}}function Vx($,I){let _=this[j$];if(_._closeFrameReceived=!0,_._closeMessage=I,_._closeCode=$,_._socket[j$]===void 0)return;if(_._socket.removeListener("data",s2),process.nextTick(UM,_._socket),$===1005)_.close();else _.close($,I)}function Zx(){let $=this[j$];if(!$.isPaused)$._socket.resume()}function Ax($){let I=this[j$];if(I._socket[j$]!==void 0)I._socket.removeListener("data",s2),process.nextTick(UM,I._socket),I.close($[vx]);if(!I._errorEmitted)I._errorEmitted=!0,I.emit("error",$)}function aT(){this[j$].emitClose()}function bx($,I){this[j$].emit("message",$,I)}function Px($){let I=this[j$];if(I._autoPong)I.pong($,!this._isServer,sT);I.emit("ping",$)}function jx($){this[j$].emit("pong",$)}function UM($){$.resume()}function Sx($){let I=this[j$];if(I.readyState===h.CLOSED)return;if(I.readyState===h.OPEN)I._readyState=h.CLOSING,_M(I);if(this._socket.end(),!I._errorEmitted)I._errorEmitted=!0,I.emit("error",$)}function _M($){$._closeTimer=setTimeout($._socket.destroy.bind($._socket),$._closeTimeout)}function uM(){let $=this[j$];if(this.removeListener("close",uM),this.removeListener("data",s2),this.removeListener("end",gM),$._readyState=h.CLOSING,!this._readableState.endEmitted&&!$._closeFrameReceived&&!$._receiver._writableState.errorEmitted&&this._readableState.length!==0){let I=this.read(this._readableState.length);$._receiver.write(I)}if($._receiver.end(),this[j$]=void 0,clearTimeout($._closeTimer),$._receiver._writableState.finished||$._receiver._writableState.errorEmitted)$.emitClose();else $._receiver.on("error",aT),$._receiver.on("finish",aT)}function s2($){if(!this[j$]._receiver.write($))this.pause()}function gM(){let $=this[j$];$._readyState=h.CLOSING,$._receiver.end(),this.end()}function zM(){let $=this[j$];if(this.removeListener("error",zM),this.on("error",sT),$)$._readyState=h.CLOSING,this.destroy()}});var NM=S((yd,qM)=>{var kd=$g(),{Duplex:Fx}=z$("stream");function JM($){$.emit("close")}function wx(){if(!this.destroyed&&this._writableState.finished)this.destroy()}function XM($){if(this.removeListener("error",XM),this.destroy(),this.listenerCount("error")===0)this.emit("error",$)}function Ex($,I){let _=!0,u=new Fx({...I,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return $.on("message",function(g,z){let G=!z&&u._readableState.objectMode?g.toString():g;if(!u.push(G))$.pause()}),$.once("error",function(g){if(u.destroyed)return;_=!1,u.destroy(g)}),$.once("close",function(){if(u.destroyed)return;u.push(null)}),u._destroy=function(U,g){if($.readyState===$.CLOSED){g(U),process.nextTick(JM,u);return}let z=!1;if($.once("error",function(J){z=!0,g(J)}),$.once("close",function(){if(!z)g(U);process.nextTick(JM,u)}),_)$.terminate()},u._final=function(U){if($.readyState===$.CONNECTING){$.once("open",function(){u._final(U)});return}if($._socket===null)return;if($._socket._writableState.finished){if(U(),u._readableState.endEmitted)u.destroy()}else $._socket.once("finish",function(){U()}),$.close()},u._read=function(){if($.isPaused)$.resume()},u._write=function(U,g,z){if($.readyState===$.CONNECTING){$.once("open",function(){u._write(U,g,z)});return}$.send(U,z)},u.on("end",wx),u.on("error",XM),u}qM.exports=Ex});var HM=S((id,QM)=>{var{tokenChars:Cx}=AI();function fx($){let I=new Set,_=-1,u=-1,U=0;for(U;U<$.length;U++){let z=$.charCodeAt(U);if(u===-1&&Cx[z]===1){if(_===-1)_=U}else if(U!==0&&(z===32||z===9)){if(u===-1&&_!==-1)u=U}else if(z===44){if(_===-1)throw SyntaxError(`Unexpected character at index ${U}`);if(u===-1)u=U;let G=$.slice(_,u);if(I.has(G))throw SyntaxError(`The "${G}" subprotocol is duplicated`);I.add(G),_=u=-1}else throw SyntaxError(`Unexpected character at index ${U}`)}if(_===-1||u!==-1)throw SyntaxError("Unexpected end of input");let g=$.slice(_,U);if(I.has(g))throw SyntaxError(`The "${g}" subprotocol is duplicated`);return I.add(g),I}QM.exports={parse:fx}});var MM=S((md,TM)=>{var xx=z$("events"),Ig=z$("http"),{Duplex:ld}=z$("stream"),{createHash:kx}=z$("crypto"),YM=g5(),T1=GU(),yx=HM(),ix=$g(),{CLOSE_TIMEOUT:lx,GUID:mx,kWebSocket:nx}=U6(),rx=/^[+/0-9A-Za-z]{22}==$/;class vM extends xx{constructor($,I){super();if($={allowSynchronousEvents:!0,autoPong:!0,maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:lx,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:ix,...$},$.port==null&&!$.server&&!$.noServer||$.port!=null&&($.server||$.noServer)||$.server&&$.noServer)throw TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if($.port!=null)this._server=Ig.createServer((_,u)=>{let U=Ig.STATUS_CODES[426];u.writeHead(426,{"Content-Length":U.length,"Content-Type":"text/plain"}),u.end(U)}),this._server.listen($.port,$.host,$.backlog,I);else if($.server)this._server=$.server;if(this._server){let _=this.emit.bind(this,"connection");this._removeListeners=hx(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(u,U,g)=>{this.handleUpgrade(u,U,g,_)}})}if($.perMessageDeflate===!0)$.perMessageDeflate={};if($.clientTracking)this.clients=new Set,this._shouldEmitClose=!1;this.options=$,this._state=0}address(){if(this.options.noServer)throw Error('The server is operating in "noServer" mode');if(!this._server)return null;return this._server.address()}close($){if(this._state===2){if($)this.once("close",()=>{$(Error("The server is not running"))});process.nextTick(NU,this);return}if($)this.once("close",$);if(this._state===1)return;if(this._state=1,this.options.noServer||this.options.server){if(this._server)this._removeListeners(),this._removeListeners=this._server=null;if(this.clients)if(!this.clients.size)process.nextTick(NU,this);else this._shouldEmitClose=!0;else process.nextTick(NU,this)}else{let I=this._server;this._removeListeners(),this._removeListeners=this._server=null,I.close(()=>{NU(this)})}}shouldHandle($){if(this.options.path){let I=$.url.indexOf("?");if((I!==-1?$.url.slice(0,I):$.url)!==this.options.path)return!1}return!0}handleUpgrade($,I,_,u){I.on("error",OM);let U=$.headers["sec-websocket-key"],g=$.headers.upgrade,z=+$.headers["sec-websocket-version"];if($.method!=="GET"){M1(this,$,I,405,"Invalid HTTP method");return}if(g===void 0||g.toLowerCase()!=="websocket"){M1(this,$,I,400,"Invalid Upgrade header");return}if(U===void 0||!rx.test(U)){M1(this,$,I,400,"Missing or invalid Sec-WebSocket-Key header");return}if(z!==13&&z!==8){M1(this,$,I,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle($)){QU(I,400);return}let G=$.headers["sec-websocket-protocol"],J=new Set;if(G!==void 0)try{J=yx.parse(G)}catch(q){M1(this,$,I,400,"Invalid Sec-WebSocket-Protocol header");return}let X=$.headers["sec-websocket-extensions"],N={};if(this.options.perMessageDeflate&&X!==void 0){let q=new T1(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let Q=YM.parse(X);if(Q[T1.extensionName])q.accept(Q[T1.extensionName]),N[T1.extensionName]=q}catch(Q){M1(this,$,I,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let q={origin:$.headers[`${z===8?"sec-websocket-origin":"origin"}`],secure:!!($.socket.authorized||$.socket.encrypted),req:$};if(this.options.verifyClient.length===2){this.options.verifyClient(q,(Q,Y,O,H)=>{if(!Q)return QU(I,Y||401,O,H);this.completeUpgrade(N,U,J,$,I,_,u)});return}if(!this.options.verifyClient(q))return QU(I,401)}this.completeUpgrade(N,U,J,$,I,_,u)}completeUpgrade($,I,_,u,U,g,z){if(!U.readable||!U.writable)return U.destroy();if(U[nx])throw Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>0)return QU(U,503);let J=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${kx("sha1").update(I+mx).digest("base64")}`],X=new this.options.WebSocket(null,void 0,this.options);if(_.size){let N=this.options.handleProtocols?this.options.handleProtocols(_,u):_.values().next().value;if(N)J.push(`Sec-WebSocket-Protocol: ${N}`),X._protocol=N}if($[T1.extensionName]){let N=$[T1.extensionName].params,q=YM.format({[T1.extensionName]:[N]});J.push(`Sec-WebSocket-Extensions: ${q}`),X._extensions=$}if(this.emit("headers",J,u),U.write(J.concat(`\r
|
|
267
267
|
`).join(`\r
|
|
268
|
-
`)),U.removeListener("error",
|
|
268
|
+
`)),U.removeListener("error",OM),X.setSocket(U,g,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients)this.clients.add(X),X.on("close",()=>{if(this.clients.delete(X),this._shouldEmitClose&&!this.clients.size)process.nextTick(NU,this)});z(X,u)}}TM.exports=vM;function hx($,I){for(let _ of Object.keys(I))$.on(_,I[_]);return function(){for(let u of Object.keys(I))$.removeListener(u,I[u])}}function NU($){$._state=2,$.emit("close")}function OM(){this.destroy()}function QU($,I,_,u){_=_||Ig.STATUS_CODES[I],u={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(_),...u},$.once("finish",$.destroy),$.end(`HTTP/1.1 ${I} ${Ig.STATUS_CODES[I]}\r
|
|
269
269
|
`+Object.keys(u).map((U)=>`${U}: ${u[U]}`).join(`\r
|
|
270
270
|
`)+`\r
|
|
271
271
|
\r
|
|
272
|
-
`+_)}function O1($,I,_,u,U,g){if($.listenerCount("wsClientError")){let z=Error(U);Error.captureStackTrace(z,O1),$.emit("wsClientError",z,_,I)}else uU(_,u,U,g)}});var P5=Y$(b5(),1),{program:Ek,createCommand:Ck,createArgument:fk,createOption:xk,CommanderError:kk,InvalidArgumentError:ik,InvalidOptionArgumentError:yk,Command:ug,Argument:lk,Option:mk,Help:nk}=P5.default;var l=Y$(Z$(),1);import{execSync as Hj,spawn as HX}from"node:child_process";import x from"node:fs";import{tmpdir as ku}from"node:os";import e from"node:path";var iZ=uz(),yZ=hI(),lZ=mg(),vz=cI(),mZ=SI(),H6=$$(),nZ=J6(),rZ=R$(),hZ=q6(),cZ=N6(),Xy=eU(),dZ=Hz(),oZ=Yz(),pZ=Oz(),I_=kQ(),iQ=bI();var tZ=iZ.Composer,aZ=yZ.Document,eZ=lZ.Schema,sZ=vz.YAMLError,$b=vz.YAMLParseError,Ib=vz.YAMLWarning,Ub=mZ.Alias,_b=H6.isAlias,ub=H6.isCollection,gb=H6.isDocument,zb=H6.isMap,Gb=H6.isNode,Jb=H6.isPair,Xb=H6.isScalar,qb=H6.isSeq,Nb=nZ.Pair,Qb=rZ.Scalar,Hb=hZ.YAMLMap,Yb=cZ.YAMLSeq;var Ob=dZ.Lexer,vb=oZ.LineCounter,Tb=pZ.Parser,r6=I_.parse,Mb=I_.parseAllDocuments,Db=I_.parseDocument,Tz=I_.stringify,Lb=iQ.visit,Bb=iQ.visitAsync;var z$={};b4(z$,{xor:()=>QH,xid:()=>C7,void:()=>zH,uuidv7:()=>Z7,uuidv6:()=>A7,uuidv4:()=>W7,uuid:()=>R7,util:()=>S,url:()=>b7,uppercase:()=>i1,unknown:()=>e6,union:()=>Pu,undefined:()=>uH,ulid:()=>E7,uint64:()=>UH,uint32:()=>s7,tuple:()=>E9,trim:()=>h1,treeifyError:()=>Pz,transform:()=>ju,toUpperCase:()=>d1,toLowerCase:()=>c1,toJSONSchema:()=>Uu,templateLiteral:()=>WH,symbol:()=>_H,superRefine:()=>GX,success:()=>KH,stringbool:()=>wH,stringFormat:()=>c7,string:()=>Ju,strictObject:()=>qH,startsWith:()=>l1,slugify:()=>o1,size:()=>p6,setErrorMap:()=>eS,set:()=>TH,safeParseAsync:()=>J9,safeParse:()=>G9,safeEncodeAsync:()=>O9,safeEncode:()=>H9,safeDecodeAsync:()=>v9,safeDecode:()=>Y9,registry:()=>Z_,regexes:()=>N4,regex:()=>x1,refine:()=>zX,record:()=>C9,readonly:()=>$X,property:()=>e_,promise:()=>AH,prettifyError:()=>Sz,preprocess:()=>CH,prefault:()=>d9,positive:()=>o_,pipe:()=>W0,partialRecord:()=>YH,parseAsync:()=>z9,parse:()=>g9,overwrite:()=>D4,optional:()=>V0,object:()=>XH,number:()=>M9,nullish:()=>BH,nullable:()=>R0,null:()=>V9,normalize:()=>r1,nonpositive:()=>t_,nonoptional:()=>o9,nonnegative:()=>a_,never:()=>bu,negative:()=>p_,nativeEnum:()=>MH,nanoid:()=>j7,nan:()=>VH,multipleOf:()=>M6,minSize:()=>E4,minLength:()=>d4,mime:()=>n1,meta:()=>jH,maxSize:()=>D6,maxLength:()=>t6,map:()=>vH,mac:()=>k7,lte:()=>I4,lt:()=>F4,lowercase:()=>k1,looseRecord:()=>OH,looseObject:()=>NH,locales:()=>M0,literal:()=>DH,length:()=>a6,lazy:()=>_X,ksuid:()=>f7,keyof:()=>JH,jwt:()=>h7,json:()=>EH,iso:()=>a1,ipv6:()=>i7,ipv4:()=>x7,intersection:()=>F9,int64:()=>IH,int32:()=>e7,int:()=>Xu,instanceof:()=>FH,includes:()=>y1,httpUrl:()=>P7,hostname:()=>d7,hex:()=>o7,hash:()=>p7,guid:()=>V7,gte:()=>n$,gt:()=>w4,globalRegistry:()=>j$,getErrorMap:()=>sS,function:()=>ZH,fromJSONSchema:()=>xH,formatError:()=>G0,float64:()=>a7,float32:()=>t7,flattenError:()=>z0,file:()=>LH,exactOptional:()=>m9,enum:()=>Su,endsWith:()=>m1,encodeAsync:()=>N9,encode:()=>X9,emoji:()=>S7,email:()=>K7,e164:()=>r7,discriminatedUnion:()=>HH,describe:()=>SH,decodeAsync:()=>Q9,decode:()=>q9,date:()=>GH,custom:()=>PH,cuid2:()=>w7,cuid:()=>F7,core:()=>o4,config:()=>K$,coerce:()=>XX,codec:()=>RH,clone:()=>m$,cidrv6:()=>l7,cidrv4:()=>y7,check:()=>bH,catch:()=>a9,boolean:()=>D9,bigint:()=>$H,base64url:()=>n7,base64:()=>m7,array:()=>b0,any:()=>gH,_function:()=>ZH,_default:()=>h9,_ZodString:()=>qu,ZodXor:()=>P9,ZodXID:()=>Tu,ZodVoid:()=>Z9,ZodUnknown:()=>W9,ZodUnion:()=>S0,ZodUndefined:()=>B9,ZodUUID:()=>C4,ZodURL:()=>A0,ZodULID:()=>vu,ZodType:()=>c,ZodTuple:()=>w9,ZodTransform:()=>y9,ZodTemplateLiteral:()=>IX,ZodSymbol:()=>L9,ZodSuccess:()=>p9,ZodStringFormat:()=>q$,ZodString:()=>s1,ZodSet:()=>x9,ZodRecord:()=>j0,ZodRealError:()=>s$,ZodReadonly:()=>s9,ZodPromise:()=>uX,ZodPrefault:()=>c9,ZodPipe:()=>Eu,ZodOptional:()=>Fu,ZodObject:()=>P0,ZodNumberFormat:()=>s6,ZodNumber:()=>II,ZodNullable:()=>n9,ZodNull:()=>K9,ZodNonOptional:()=>wu,ZodNever:()=>A9,ZodNanoID:()=>Hu,ZodNaN:()=>e9,ZodMap:()=>f9,ZodMAC:()=>T9,ZodLiteral:()=>k9,ZodLazy:()=>UX,ZodKSUID:()=>Mu,ZodJWT:()=>Au,ZodIssueCode:()=>aS,ZodIntersection:()=>j9,ZodISOTime:()=>zu,ZodISODuration:()=>Gu,ZodISODateTime:()=>uu,ZodISODate:()=>gu,ZodIPv6:()=>Lu,ZodIPv4:()=>Du,ZodGUID:()=>K0,ZodFunction:()=>gX,ZodFirstPartyTypeKind:()=>JX,ZodFile:()=>i9,ZodExactOptional:()=>l9,ZodError:()=>pS,ZodEnum:()=>e1,ZodEmoji:()=>Qu,ZodEmail:()=>Nu,ZodE164:()=>Wu,ZodDiscriminatedUnion:()=>S9,ZodDefault:()=>r9,ZodDate:()=>Z0,ZodCustomStringFormat:()=>$I,ZodCustom:()=>F0,ZodCodec:()=>Cu,ZodCatch:()=>t9,ZodCUID2:()=>Ou,ZodCUID:()=>Yu,ZodCIDRv6:()=>Ku,ZodCIDRv4:()=>Bu,ZodBoolean:()=>UI,ZodBigIntFormat:()=>Zu,ZodBigInt:()=>_I,ZodBase64URL:()=>Ru,ZodBase64:()=>Vu,ZodArray:()=>b9,ZodAny:()=>R9,TimePrecision:()=>E8,NEVER:()=>Mz,$output:()=>b8,$input:()=>P8,$brand:()=>Dz});var o4={};b4(o4,{version:()=>WG,util:()=>S,treeifyError:()=>Pz,toJSONSchema:()=>Uu,toDotPath:()=>hQ,safeParseAsync:()=>Fz,safeParse:()=>jz,safeEncodeAsync:()=>$P,safeEncode:()=>eb,safeDecodeAsync:()=>IP,safeDecode:()=>sb,registry:()=>Z_,regexes:()=>N4,process:()=>u$,prettifyError:()=>Sz,parseAsync:()=>g_,parse:()=>u_,meta:()=>Y3,locales:()=>M0,isValidJWT:()=>q7,isValidBase64URL:()=>X7,isValidBase64:()=>dG,initializeContext:()=>L6,globalRegistry:()=>j$,globalConfig:()=>eI,formatError:()=>G0,flattenError:()=>z0,finalize:()=>K6,extractDefs:()=>B6,encodeAsync:()=>tb,encode:()=>ob,describe:()=>H3,decodeAsync:()=>ab,decode:()=>pb,createToJSONSchemaMethod:()=>v3,createStandardJSONSchemaMethod:()=>t1,config:()=>K$,clone:()=>m$,_xor:()=>WS,_xid:()=>k_,_void:()=>u3,_uuidv7:()=>F_,_uuidv6:()=>j_,_uuidv4:()=>S_,_uuid:()=>P_,_url:()=>L0,_uppercase:()=>i1,_unknown:()=>U3,_union:()=>RS,_undefined:()=>s8,_ulid:()=>x_,_uint64:()=>a8,_uint32:()=>h8,_tuple:()=>bS,_trim:()=>h1,_transform:()=>CS,_toUpperCase:()=>d1,_toLowerCase:()=>c1,_templateLiteral:()=>rS,_symbol:()=>e8,_superRefine:()=>Q3,_success:()=>yS,_stringbool:()=>O3,_stringFormat:()=>p1,_string:()=>j8,_startsWith:()=>l1,_slugify:()=>o1,_size:()=>p6,_set:()=>jS,_safeParseAsync:()=>E1,_safeParse:()=>w1,_safeEncodeAsync:()=>Q_,_safeEncode:()=>q_,_safeDecodeAsync:()=>H_,_safeDecode:()=>N_,_regex:()=>x1,_refine:()=>N3,_record:()=>PS,_readonly:()=>nS,_property:()=>e_,_promise:()=>cS,_positive:()=>o_,_pipe:()=>mS,_parseAsync:()=>F1,_parse:()=>j1,_overwrite:()=>D4,_optional:()=>fS,_number:()=>i8,_nullable:()=>xS,_null:()=>$3,_normalize:()=>r1,_nonpositive:()=>t_,_nonoptional:()=>iS,_nonnegative:()=>a_,_never:()=>_3,_negative:()=>p_,_nativeEnum:()=>wS,_nanoid:()=>E_,_nan:()=>G3,_multipleOf:()=>M6,_minSize:()=>E4,_minLength:()=>d4,_min:()=>n$,_mime:()=>n1,_maxSize:()=>D6,_maxLength:()=>t6,_max:()=>I4,_map:()=>SS,_mac:()=>w8,_lte:()=>I4,_lt:()=>F4,_lowercase:()=>k1,_literal:()=>ES,_length:()=>a6,_lazy:()=>hS,_ksuid:()=>i_,_jwt:()=>d_,_isoTime:()=>x8,_isoDuration:()=>k8,_isoDateTime:()=>C8,_isoDate:()=>f8,_ipv6:()=>l_,_ipv4:()=>y_,_intersection:()=>ZS,_int64:()=>t8,_int32:()=>r8,_int:()=>l8,_includes:()=>y1,_guid:()=>D0,_gte:()=>n$,_gt:()=>w4,_float64:()=>n8,_float32:()=>m8,_file:()=>X3,_enum:()=>FS,_endsWith:()=>m1,_encodeAsync:()=>J_,_encode:()=>z_,_emoji:()=>w_,_email:()=>b_,_e164:()=>c_,_discriminatedUnion:()=>AS,_default:()=>kS,_decodeAsync:()=>X_,_decode:()=>G_,_date:()=>g3,_custom:()=>q3,_cuid2:()=>f_,_cuid:()=>C_,_coercedString:()=>F8,_coercedNumber:()=>y8,_coercedDate:()=>z3,_coercedBoolean:()=>d8,_coercedBigint:()=>p8,_cidrv6:()=>n_,_cidrv4:()=>m_,_check:()=>D7,_catch:()=>lS,_boolean:()=>c8,_bigint:()=>o8,_base64url:()=>h_,_base64:()=>r_,_array:()=>J3,_any:()=>I3,TimePrecision:()=>E8,NEVER:()=>Mz,JSONSchemaGenerator:()=>$9,JSONSchema:()=>L7,Doc:()=>T_,$output:()=>b8,$input:()=>P8,$constructor:()=>L,$brand:()=>Dz,$ZodXor:()=>NJ,$ZodXID:()=>fG,$ZodVoid:()=>GJ,$ZodUnknown:()=>gJ,$ZodUnion:()=>Q0,$ZodUndefined:()=>UJ,$ZodUUID:()=>bG,$ZodURL:()=>SG,$ZodULID:()=>CG,$ZodType:()=>r,$ZodTuple:()=>W_,$ZodTransform:()=>LJ,$ZodTemplateLiteral:()=>jJ,$ZodSymbol:()=>IJ,$ZodSuccess:()=>AJ,$ZodStringFormat:()=>X$,$ZodString:()=>o6,$ZodSet:()=>vJ,$ZodRegistry:()=>S8,$ZodRecord:()=>YJ,$ZodRealError:()=>e$,$ZodReadonly:()=>SJ,$ZodPromise:()=>wJ,$ZodPrefault:()=>RJ,$ZodPipe:()=>PJ,$ZodOptional:()=>A_,$ZodObjectJIT:()=>qJ,$ZodObject:()=>H7,$ZodNumberFormat:()=>sG,$ZodNumber:()=>V_,$ZodNullable:()=>KJ,$ZodNull:()=>_J,$ZodNonOptional:()=>WJ,$ZodNever:()=>zJ,$ZodNanoID:()=>FG,$ZodNaN:()=>bJ,$ZodMap:()=>OJ,$ZodMAC:()=>rG,$ZodLiteral:()=>MJ,$ZodLazy:()=>EJ,$ZodKSUID:()=>xG,$ZodJWT:()=>aG,$ZodIntersection:()=>HJ,$ZodISOTime:()=>yG,$ZodISODuration:()=>lG,$ZodISODateTime:()=>kG,$ZodISODate:()=>iG,$ZodIPv6:()=>nG,$ZodIPv4:()=>mG,$ZodGUID:()=>ZG,$ZodFunction:()=>FJ,$ZodFile:()=>DJ,$ZodExactOptional:()=>BJ,$ZodError:()=>g0,$ZodEnum:()=>TJ,$ZodEncodeError:()=>h6,$ZodEmoji:()=>jG,$ZodEmail:()=>PG,$ZodE164:()=>tG,$ZodDiscriminatedUnion:()=>QJ,$ZodDefault:()=>VJ,$ZodDate:()=>JJ,$ZodCustomStringFormat:()=>eG,$ZodCustom:()=>CJ,$ZodCodec:()=>H0,$ZodCheckUpperCase:()=>MG,$ZodCheckStringFormat:()=>C1,$ZodCheckStartsWith:()=>LG,$ZodCheckSizeEquals:()=>QG,$ZodCheckRegex:()=>vG,$ZodCheckProperty:()=>KG,$ZodCheckOverwrite:()=>RG,$ZodCheckNumberFormat:()=>JG,$ZodCheckMultipleOf:()=>GG,$ZodCheckMinSize:()=>NG,$ZodCheckMinLength:()=>YG,$ZodCheckMimeType:()=>VG,$ZodCheckMaxSize:()=>qG,$ZodCheckMaxLength:()=>HG,$ZodCheckLowerCase:()=>TG,$ZodCheckLessThan:()=>O_,$ZodCheckLengthEquals:()=>OG,$ZodCheckIncludes:()=>DG,$ZodCheckGreaterThan:()=>v_,$ZodCheckEndsWith:()=>BG,$ZodCheckBigIntFormat:()=>XG,$ZodCheck:()=>Q$,$ZodCatch:()=>ZJ,$ZodCUID2:()=>EG,$ZodCUID:()=>wG,$ZodCIDRv6:()=>cG,$ZodCIDRv4:()=>hG,$ZodBoolean:()=>N0,$ZodBigIntFormat:()=>$J,$ZodBigInt:()=>R_,$ZodBase64URL:()=>pG,$ZodBase64:()=>oG,$ZodAsyncError:()=>j4,$ZodArray:()=>XJ,$ZodAny:()=>uJ});var Mz=Object.freeze({status:"aborted"});function L($,I,_){function u(G,J){if(!G._zod)Object.defineProperty(G,"_zod",{value:{def:J,constr:z,traits:new Set},enumerable:!1});if(G._zod.traits.has($))return;G._zod.traits.add($),I(G,J);let X=z.prototype,N=Object.keys(X);for(let q=0;q<N.length;q++){let Q=N[q];if(!(Q in G))G[Q]=X[Q].bind(G)}}let U=_?.Parent??Object;class g extends U{}Object.defineProperty(g,"name",{value:$});function z(G){var J;let X=_?.Parent?new g:this;u(X,G),(J=X._zod).deferred??(J.deferred=[]);for(let N of X._zod.deferred)N();return X}return Object.defineProperty(z,"init",{value:u}),Object.defineProperty(z,Symbol.hasInstance,{value:(G)=>{if(_?.Parent&&G instanceof _.Parent)return!0;return G?._zod?.traits?.has($)}}),Object.defineProperty(z,"name",{value:$}),z}var Dz=Symbol("zod_brand");class j4 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class h6 extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}}var eI={};function K$($){if($)Object.assign(eI,$);return eI}var S={};b4(S,{unwrapMessage:()=>sI,uint8ArrayToHex:()=>cb,uint8ArrayToBase64url:()=>rb,uint8ArrayToBase64:()=>mQ,stringifyPrimitive:()=>b,slugify:()=>Kz,shallowClone:()=>Rz,safeExtend:()=>kb,required:()=>lb,randomString:()=>jb,propertyKeyTypes:()=>U0,promiseAllObject:()=>Sb,primitiveTypes:()=>Wz,prefixIssues:()=>$4,pick:()=>Cb,partial:()=>yb,parsedType:()=>P,optionalKeys:()=>Az,omit:()=>fb,objectClone:()=>Zb,numKeys:()=>Fb,nullish:()=>Y6,normalizeParams:()=>F,mergeDefs:()=>c4,merge:()=>ib,jsonStringifyReplacer:()=>b1,joinValues:()=>W,issue:()=>S1,isPlainObject:()=>v6,isObject:()=>c6,hexToUint8Array:()=>hb,getSizableOrigin:()=>_0,getParsedType:()=>wb,getLengthableOrigin:()=>u0,getEnumValues:()=>$0,getElementAtPath:()=>Pb,floatSafeRemainder:()=>Bz,finalizeIssue:()=>a$,extend:()=>xb,escapeRegex:()=>q4,esc:()=>U_,defineLazy:()=>o,createTransparentProxy:()=>Eb,cloneDef:()=>bb,clone:()=>m$,cleanRegex:()=>I0,cleanEnum:()=>mb,captureStackTrace:()=>__,cached:()=>P1,base64urlToUint8Array:()=>nb,base64ToUint8Array:()=>lQ,assignProp:()=>O6,assertNotEqual:()=>Vb,assertNever:()=>Wb,assertIs:()=>Rb,assertEqual:()=>Kb,assert:()=>Ab,allowsEval:()=>Vz,aborted:()=>T6,NUMBER_FORMAT_RANGES:()=>Zz,Class:()=>nQ,BIGINT_FORMAT_RANGES:()=>bz});function Kb($){return $}function Vb($){return $}function Rb($){}function Wb($){throw Error("Unexpected value in exhaustive check")}function Ab($){}function $0($){let I=Object.values($).filter((u)=>typeof u==="number");return Object.entries($).filter(([u,U])=>I.indexOf(+u)===-1).map(([u,U])=>U)}function W($,I="|"){return $.map((_)=>b(_)).join(I)}function b1($,I){if(typeof I==="bigint")return I.toString();return I}function P1($){return{get value(){{let _=$();return Object.defineProperty(this,"value",{value:_}),_}throw Error("cached value already set")}}}function Y6($){return $===null||$===void 0}function I0($){let I=$.startsWith("^")?1:0,_=$.endsWith("$")?$.length-1:$.length;return $.slice(I,_)}function Bz($,I){let _=($.toString().split(".")[1]||"").length,u=I.toString(),U=(u.split(".")[1]||"").length;if(U===0&&/\d?e-\d?/.test(u)){let J=u.match(/\d?e-(\d?)/);if(J?.[1])U=Number.parseInt(J[1])}let g=_>U?_:U,z=Number.parseInt($.toFixed(g).replace(".","")),G=Number.parseInt(I.toFixed(g).replace(".",""));return z%G/10**g}var yQ=Symbol("evaluating");function o($,I,_){let u=void 0;Object.defineProperty($,I,{get(){if(u===yQ)return;if(u===void 0)u=yQ,u=_();return u},set(U){Object.defineProperty($,I,{value:U})},configurable:!0})}function Zb($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function O6($,I,_){Object.defineProperty($,I,{value:_,writable:!0,enumerable:!0,configurable:!0})}function c4(...$){let I={};for(let _ of $){let u=Object.getOwnPropertyDescriptors(_);Object.assign(I,u)}return Object.defineProperties({},I)}function bb($){return c4($._zod.def)}function Pb($,I){if(!I)return $;return I.reduce((_,u)=>_?.[u],$)}function Sb($){let I=Object.keys($),_=I.map((u)=>$[u]);return Promise.all(_).then((u)=>{let U={};for(let g=0;g<I.length;g++)U[I[g]]=u[g];return U})}function jb($=10){let _="";for(let u=0;u<$;u++)_+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return _}function U_($){return JSON.stringify($)}function Kz($){return $.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var __="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};function c6($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var Vz=P1(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function v6($){if(c6($)===!1)return!1;let I=$.constructor;if(I===void 0)return!0;if(typeof I!=="function")return!0;let _=I.prototype;if(c6(_)===!1)return!1;if(Object.prototype.hasOwnProperty.call(_,"isPrototypeOf")===!1)return!1;return!0}function Rz($){if(v6($))return{...$};if(Array.isArray($))return[...$];return $}function Fb($){let I=0;for(let _ in $)if(Object.prototype.hasOwnProperty.call($,_))I++;return I}var wb=($)=>{let I=typeof $;switch(I){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN($)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray($))return"array";if($===null)return"null";if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return"promise";if(typeof Map<"u"&&$ instanceof Map)return"map";if(typeof Set<"u"&&$ instanceof Set)return"set";if(typeof Date<"u"&&$ instanceof Date)return"date";if(typeof File<"u"&&$ instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${I}`)}},U0=new Set(["string","number","symbol"]),Wz=new Set(["string","number","bigint","boolean","symbol","undefined"]);function q4($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function m$($,I,_){let u=new $._zod.constr(I??$._zod.def);if(!I||_?.parent)u._zod.parent=$;return u}function F($){let I=$;if(!I)return{};if(typeof I==="string")return{error:()=>I};if(I?.message!==void 0){if(I?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");I.error=I.message}if(delete I.message,typeof I.error==="string")return{...I,error:()=>I.error};return I}function Eb($){let I;return new Proxy({},{get(_,u,U){return I??(I=$()),Reflect.get(I,u,U)},set(_,u,U,g){return I??(I=$()),Reflect.set(I,u,U,g)},has(_,u){return I??(I=$()),Reflect.has(I,u)},deleteProperty(_,u){return I??(I=$()),Reflect.deleteProperty(I,u)},ownKeys(_){return I??(I=$()),Reflect.ownKeys(I)},getOwnPropertyDescriptor(_,u){return I??(I=$()),Reflect.getOwnPropertyDescriptor(I,u)},defineProperty(_,u,U){return I??(I=$()),Reflect.defineProperty(I,u,U)}})}function b($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function Az($){return Object.keys($).filter((I)=>{return $[I]._zod.optin==="optional"&&$[I]._zod.optout==="optional"})}var Zz={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},bz={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Cb($,I){let _=$._zod.def,u=_.checks;if(u&&u.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let g=c4($._zod.def,{get shape(){let z={};for(let G in I){if(!(G in _.shape))throw Error(`Unrecognized key: "${G}"`);if(!I[G])continue;z[G]=_.shape[G]}return O6(this,"shape",z),z},checks:[]});return m$($,g)}function fb($,I){let _=$._zod.def,u=_.checks;if(u&&u.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let g=c4($._zod.def,{get shape(){let z={...$._zod.def.shape};for(let G in I){if(!(G in _.shape))throw Error(`Unrecognized key: "${G}"`);if(!I[G])continue;delete z[G]}return O6(this,"shape",z),z},checks:[]});return m$($,g)}function xb($,I){if(!v6(I))throw Error("Invalid input to extend: expected a plain object");let _=$._zod.def.checks;if(_&&_.length>0){let g=$._zod.def.shape;for(let z in I)if(Object.getOwnPropertyDescriptor(g,z)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let U=c4($._zod.def,{get shape(){let g={...$._zod.def.shape,...I};return O6(this,"shape",g),g}});return m$($,U)}function kb($,I){if(!v6(I))throw Error("Invalid input to safeExtend: expected a plain object");let _=c4($._zod.def,{get shape(){let u={...$._zod.def.shape,...I};return O6(this,"shape",u),u}});return m$($,_)}function ib($,I){let _=c4($._zod.def,{get shape(){let u={...$._zod.def.shape,...I._zod.def.shape};return O6(this,"shape",u),u},get catchall(){return I._zod.def.catchall},checks:[]});return m$($,_)}function yb($,I,_){let U=I._zod.def.checks;if(U&&U.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let z=c4(I._zod.def,{get shape(){let G=I._zod.def.shape,J={...G};if(_)for(let X in _){if(!(X in G))throw Error(`Unrecognized key: "${X}"`);if(!_[X])continue;J[X]=$?new $({type:"optional",innerType:G[X]}):G[X]}else for(let X in G)J[X]=$?new $({type:"optional",innerType:G[X]}):G[X];return O6(this,"shape",J),J},checks:[]});return m$(I,z)}function lb($,I,_){let u=c4(I._zod.def,{get shape(){let U=I._zod.def.shape,g={...U};if(_)for(let z in _){if(!(z in g))throw Error(`Unrecognized key: "${z}"`);if(!_[z])continue;g[z]=new $({type:"nonoptional",innerType:U[z]})}else for(let z in U)g[z]=new $({type:"nonoptional",innerType:U[z]});return O6(this,"shape",g),g}});return m$(I,u)}function T6($,I=0){if($.aborted===!0)return!0;for(let _=I;_<$.issues.length;_++)if($.issues[_]?.continue!==!0)return!0;return!1}function $4($,I){return I.map((_)=>{var u;return(u=_).path??(u.path=[]),_.path.unshift($),_})}function sI($){return typeof $==="string"?$:$?.message}function a$($,I,_){let u={...$,path:$.path??[]};if(!$.message){let U=sI($.inst?._zod.def?.error?.($))??sI(I?.error?.($))??sI(_.customError?.($))??sI(_.localeError?.($))??"Invalid input";u.message=U}if(delete u.inst,delete u.continue,!I?.reportInput)delete u.input;return u}function _0($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function u0($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function P($){let I=typeof $;switch(I){case"number":return Number.isNaN($)?"nan":"number";case"object":{if($===null)return"null";if(Array.isArray($))return"array";let _=$;if(_&&Object.getPrototypeOf(_)!==Object.prototype&&"constructor"in _&&_.constructor)return _.constructor.name}}return I}function S1(...$){let[I,_,u]=$;if(typeof I==="string")return{message:I,code:"custom",input:_,inst:u};return{...I}}function mb($){return Object.entries($).filter(([I,_])=>{return Number.isNaN(Number.parseInt(I,10))}).map((I)=>I[1])}function lQ($){let I=atob($),_=new Uint8Array(I.length);for(let u=0;u<I.length;u++)_[u]=I.charCodeAt(u);return _}function mQ($){let I="";for(let _=0;_<$.length;_++)I+=String.fromCharCode($[_]);return btoa(I)}function nb($){let I=$.replace(/-/g,"+").replace(/_/g,"/"),_="=".repeat((4-I.length%4)%4);return lQ(I+_)}function rb($){return mQ($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function hb($){let I=$.replace(/^0x/,"");if(I.length%2!==0)throw Error("Invalid hex string length");let _=new Uint8Array(I.length/2);for(let u=0;u<I.length;u+=2)_[u/2]=Number.parseInt(I.slice(u,u+2),16);return _}function cb($){return Array.from($).map((I)=>I.toString(16).padStart(2,"0")).join("")}class nQ{constructor(...$){}}var rQ=($,I)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:I,enumerable:!1}),$.message=JSON.stringify(I,b1,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},g0=L("$ZodError",rQ),e$=L("$ZodError",rQ,{Parent:Error});function z0($,I=(_)=>_.message){let _={},u=[];for(let U of $.issues)if(U.path.length>0)_[U.path[0]]=_[U.path[0]]||[],_[U.path[0]].push(I(U));else u.push(I(U));return{formErrors:u,fieldErrors:_}}function G0($,I=(_)=>_.message){let _={_errors:[]},u=(U)=>{for(let g of U.issues)if(g.code==="invalid_union"&&g.errors.length)g.errors.map((z)=>u({issues:z}));else if(g.code==="invalid_key")u({issues:g.issues});else if(g.code==="invalid_element")u({issues:g.issues});else if(g.path.length===0)_._errors.push(I(g));else{let z=_,G=0;while(G<g.path.length){let J=g.path[G];if(G!==g.path.length-1)z[J]=z[J]||{_errors:[]};else z[J]=z[J]||{_errors:[]},z[J]._errors.push(I(g));z=z[J],G++}}};return u($),_}function Pz($,I=(_)=>_.message){let _={errors:[]},u=(U,g=[])=>{var z,G;for(let J of U.issues)if(J.code==="invalid_union"&&J.errors.length)J.errors.map((X)=>u({issues:X},J.path));else if(J.code==="invalid_key")u({issues:J.issues},J.path);else if(J.code==="invalid_element")u({issues:J.issues},J.path);else{let X=[...g,...J.path];if(X.length===0){_.errors.push(I(J));continue}let N=_,q=0;while(q<X.length){let Q=X[q],Y=q===X.length-1;if(typeof Q==="string")N.properties??(N.properties={}),(z=N.properties)[Q]??(z[Q]={errors:[]}),N=N.properties[Q];else N.items??(N.items=[]),(G=N.items)[Q]??(G[Q]={errors:[]}),N=N.items[Q];if(Y)N.errors.push(I(J));q++}}};return u($),_}function hQ($){let I=[],_=$.map((u)=>typeof u==="object"?u.key:u);for(let u of _)if(typeof u==="number")I.push(`[${u}]`);else if(typeof u==="symbol")I.push(`[${JSON.stringify(String(u))}]`);else if(/[^\w$]/.test(u))I.push(`[${JSON.stringify(u)}]`);else{if(I.length)I.push(".");I.push(u)}return I.join("")}function Sz($){let I=[],_=[...$.issues].sort((u,U)=>(u.path??[]).length-(U.path??[]).length);for(let u of _)if(I.push(`✖ ${u.message}`),u.path?.length)I.push(` → at ${hQ(u.path)}`);return I.join(`
|
|
273
|
-
`)}var j1=($)=>(I,_,u,U)=>{let g=u?Object.assign(u,{async:!1}):{async:!1},z=I._zod.run({value:_,issues:[]},g);if(z instanceof Promise)throw new j4;if(z.issues.length){let G=new(U?.Err??$)(z.issues.map((J)=>a$(J,g,K$())));throw __(G,U?.callee),G}return z.value},u_=j1(e$),F1=($)=>async(I,_,u,U)=>{let g=u?Object.assign(u,{async:!0}):{async:!0},z=I._zod.run({value:_,issues:[]},g);if(z instanceof Promise)z=await z;if(z.issues.length){let G=new(U?.Err??$)(z.issues.map((J)=>a$(J,g,K$())));throw __(G,U?.callee),G}return z.value},g_=F1(e$),w1=($)=>(I,_,u)=>{let U=u?{...u,async:!1}:{async:!1},g=I._zod.run({value:_,issues:[]},U);if(g instanceof Promise)throw new j4;return g.issues.length?{success:!1,error:new($??g0)(g.issues.map((z)=>a$(z,U,K$())))}:{success:!0,data:g.value}},jz=w1(e$),E1=($)=>async(I,_,u)=>{let U=u?Object.assign(u,{async:!0}):{async:!0},g=I._zod.run({value:_,issues:[]},U);if(g instanceof Promise)g=await g;return g.issues.length?{success:!1,error:new $(g.issues.map((z)=>a$(z,U,K$())))}:{success:!0,data:g.value}},Fz=E1(e$),z_=($)=>(I,_,u)=>{let U=u?Object.assign(u,{direction:"backward"}):{direction:"backward"};return j1($)(I,_,U)},ob=z_(e$),G_=($)=>(I,_,u)=>{return j1($)(I,_,u)},pb=G_(e$),J_=($)=>async(I,_,u)=>{let U=u?Object.assign(u,{direction:"backward"}):{direction:"backward"};return F1($)(I,_,U)},tb=J_(e$),X_=($)=>async(I,_,u)=>{return F1($)(I,_,u)},ab=X_(e$),q_=($)=>(I,_,u)=>{let U=u?Object.assign(u,{direction:"backward"}):{direction:"backward"};return w1($)(I,_,U)},eb=q_(e$),N_=($)=>(I,_,u)=>{return w1($)(I,_,u)},sb=N_(e$),Q_=($)=>async(I,_,u)=>{let U=u?Object.assign(u,{direction:"backward"}):{direction:"backward"};return E1($)(I,_,U)},$P=Q_(e$),H_=($)=>async(I,_,u)=>{return E1($)(I,_,u)},IP=H_(e$);var N4={};b4(N4,{xid:()=>fz,uuid7:()=>gP,uuid6:()=>uP,uuid4:()=>_P,uuid:()=>d6,uppercase:()=>zG,unicodeEmail:()=>cQ,undefined:()=>uG,ulid:()=>Cz,time:()=>az,string:()=>sz,sha512_hex:()=>AP,sha512_base64url:()=>bP,sha512_base64:()=>ZP,sha384_hex:()=>VP,sha384_base64url:()=>WP,sha384_base64:()=>RP,sha256_hex:()=>LP,sha256_base64url:()=>KP,sha256_base64:()=>BP,sha1_hex:()=>TP,sha1_base64url:()=>DP,sha1_base64:()=>MP,rfc5322Email:()=>GP,number:()=>J0,null:()=>_G,nanoid:()=>kz,md5_hex:()=>YP,md5_base64url:()=>vP,md5_base64:()=>OP,mac:()=>hz,lowercase:()=>gG,ksuid:()=>xz,ipv6:()=>rz,ipv4:()=>nz,integer:()=>IG,idnEmail:()=>JP,html5Email:()=>zP,hostname:()=>NP,hex:()=>HP,guid:()=>yz,extendedDuration:()=>UP,emoji:()=>mz,email:()=>lz,e164:()=>pz,duration:()=>iz,domain:()=>QP,datetime:()=>ez,date:()=>tz,cuid2:()=>Ez,cuid:()=>wz,cidrv6:()=>dz,cidrv4:()=>cz,browserEmail:()=>XP,boolean:()=>UG,bigint:()=>$G,base64url:()=>Y_,base64:()=>oz});var wz=/^[cC][^\s-]{8,}$/,Ez=/^[0-9a-z]+$/,Cz=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,fz=/^[0-9a-vA-V]{20}$/,xz=/^[A-Za-z0-9]{27}$/,kz=/^[a-zA-Z0-9_-]{21}$/,iz=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,UP=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,yz=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,d6=($)=>{if(!$)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${$}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},_P=d6(4),uP=d6(6),gP=d6(7),lz=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,zP=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,GP=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,cQ=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,JP=cQ,XP=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,qP="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function mz(){return new RegExp(qP,"u")}var nz=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,rz=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,hz=($)=>{let I=q4($??":");return new RegExp(`^(?:[0-9A-F]{2}${I}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${I}){5}[0-9a-f]{2}$`)},cz=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,dz=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,oz=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Y_=/^[A-Za-z0-9_-]*$/,NP=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,QP=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,pz=/^\+[1-9]\d{6,14}$/,dQ="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",tz=new RegExp(`^${dQ}$`);function oQ($){return typeof $.precision==="number"?$.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":$.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${$.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function az($){return new RegExp(`^${oQ($)}$`)}function ez($){let I=oQ({precision:$.precision}),_=["Z"];if($.local)_.push("");if($.offset)_.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let u=`${I}(?:${_.join("|")})`;return new RegExp(`^${dQ}T(?:${u})$`)}var sz=($)=>{let I=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${I}$`)},$G=/^-?\d+n?$/,IG=/^-?\d+$/,J0=/^-?\d+(?:\.\d+)?$/,UG=/^(?:true|false)$/i,_G=/^null$/i;var uG=/^undefined$/i;var gG=/^[^A-Z]*$/,zG=/^[^a-z]*$/,HP=/^[0-9a-fA-F]*$/;function X0($,I){return new RegExp(`^[A-Za-z0-9+/]{${$}}${I}$`)}function q0($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var YP=/^[0-9a-fA-F]{32}$/,OP=X0(22,"=="),vP=q0(22),TP=/^[0-9a-fA-F]{40}$/,MP=X0(27,"="),DP=q0(27),LP=/^[0-9a-fA-F]{64}$/,BP=X0(43,"="),KP=q0(43),VP=/^[0-9a-fA-F]{96}$/,RP=X0(64,""),WP=q0(64),AP=/^[0-9a-fA-F]{128}$/,ZP=X0(86,"=="),bP=q0(86);var Q$=L("$ZodCheck",($,I)=>{var _;$._zod??($._zod={}),$._zod.def=I,(_=$._zod).onattach??(_.onattach=[])}),tQ={number:"number",bigint:"bigint",object:"date"},O_=L("$ZodCheckLessThan",($,I)=>{Q$.init($,I);let _=tQ[typeof I.value];$._zod.onattach.push((u)=>{let U=u._zod.bag,g=(I.inclusive?U.maximum:U.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(I.value<g)if(I.inclusive)U.maximum=I.value;else U.exclusiveMaximum=I.value}),$._zod.check=(u)=>{if(I.inclusive?u.value<=I.value:u.value<I.value)return;u.issues.push({origin:_,code:"too_big",maximum:typeof I.value==="object"?I.value.getTime():I.value,input:u.value,inclusive:I.inclusive,inst:$,continue:!I.abort})}}),v_=L("$ZodCheckGreaterThan",($,I)=>{Q$.init($,I);let _=tQ[typeof I.value];$._zod.onattach.push((u)=>{let U=u._zod.bag,g=(I.inclusive?U.minimum:U.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(I.value>g)if(I.inclusive)U.minimum=I.value;else U.exclusiveMinimum=I.value}),$._zod.check=(u)=>{if(I.inclusive?u.value>=I.value:u.value>I.value)return;u.issues.push({origin:_,code:"too_small",minimum:typeof I.value==="object"?I.value.getTime():I.value,input:u.value,inclusive:I.inclusive,inst:$,continue:!I.abort})}}),GG=L("$ZodCheckMultipleOf",($,I)=>{Q$.init($,I),$._zod.onattach.push((_)=>{var u;(u=_._zod.bag).multipleOf??(u.multipleOf=I.value)}),$._zod.check=(_)=>{if(typeof _.value!==typeof I.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof _.value==="bigint"?_.value%I.value===BigInt(0):Bz(_.value,I.value)===0)return;_.issues.push({origin:typeof _.value,code:"not_multiple_of",divisor:I.value,input:_.value,inst:$,continue:!I.abort})}}),JG=L("$ZodCheckNumberFormat",($,I)=>{Q$.init($,I),I.format=I.format||"float64";let _=I.format?.includes("int"),u=_?"int":"number",[U,g]=Zz[I.format];$._zod.onattach.push((z)=>{let G=z._zod.bag;if(G.format=I.format,G.minimum=U,G.maximum=g,_)G.pattern=IG}),$._zod.check=(z)=>{let G=z.value;if(_){if(!Number.isInteger(G)){z.issues.push({expected:u,format:I.format,code:"invalid_type",continue:!1,input:G,inst:$});return}if(!Number.isSafeInteger(G)){if(G>0)z.issues.push({input:G,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:u,inclusive:!0,continue:!I.abort});else z.issues.push({input:G,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:u,inclusive:!0,continue:!I.abort});return}}if(G<U)z.issues.push({origin:"number",input:G,code:"too_small",minimum:U,inclusive:!0,inst:$,continue:!I.abort});if(G>g)z.issues.push({origin:"number",input:G,code:"too_big",maximum:g,inclusive:!0,inst:$,continue:!I.abort})}}),XG=L("$ZodCheckBigIntFormat",($,I)=>{Q$.init($,I);let[_,u]=bz[I.format];$._zod.onattach.push((U)=>{let g=U._zod.bag;g.format=I.format,g.minimum=_,g.maximum=u}),$._zod.check=(U)=>{let g=U.value;if(g<_)U.issues.push({origin:"bigint",input:g,code:"too_small",minimum:_,inclusive:!0,inst:$,continue:!I.abort});if(g>u)U.issues.push({origin:"bigint",input:g,code:"too_big",maximum:u,inclusive:!0,inst:$,continue:!I.abort})}}),qG=L("$ZodCheckMaxSize",($,I)=>{var _;Q$.init($,I),(_=$._zod.def).when??(_.when=(u)=>{let U=u.value;return!Y6(U)&&U.size!==void 0}),$._zod.onattach.push((u)=>{let U=u._zod.bag.maximum??Number.POSITIVE_INFINITY;if(I.maximum<U)u._zod.bag.maximum=I.maximum}),$._zod.check=(u)=>{let U=u.value;if(U.size<=I.maximum)return;u.issues.push({origin:_0(U),code:"too_big",maximum:I.maximum,inclusive:!0,input:U,inst:$,continue:!I.abort})}}),NG=L("$ZodCheckMinSize",($,I)=>{var _;Q$.init($,I),(_=$._zod.def).when??(_.when=(u)=>{let U=u.value;return!Y6(U)&&U.size!==void 0}),$._zod.onattach.push((u)=>{let U=u._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(I.minimum>U)u._zod.bag.minimum=I.minimum}),$._zod.check=(u)=>{let U=u.value;if(U.size>=I.minimum)return;u.issues.push({origin:_0(U),code:"too_small",minimum:I.minimum,inclusive:!0,input:U,inst:$,continue:!I.abort})}}),QG=L("$ZodCheckSizeEquals",($,I)=>{var _;Q$.init($,I),(_=$._zod.def).when??(_.when=(u)=>{let U=u.value;return!Y6(U)&&U.size!==void 0}),$._zod.onattach.push((u)=>{let U=u._zod.bag;U.minimum=I.size,U.maximum=I.size,U.size=I.size}),$._zod.check=(u)=>{let U=u.value,g=U.size;if(g===I.size)return;let z=g>I.size;u.issues.push({origin:_0(U),...z?{code:"too_big",maximum:I.size}:{code:"too_small",minimum:I.size},inclusive:!0,exact:!0,input:u.value,inst:$,continue:!I.abort})}}),HG=L("$ZodCheckMaxLength",($,I)=>{var _;Q$.init($,I),(_=$._zod.def).when??(_.when=(u)=>{let U=u.value;return!Y6(U)&&U.length!==void 0}),$._zod.onattach.push((u)=>{let U=u._zod.bag.maximum??Number.POSITIVE_INFINITY;if(I.maximum<U)u._zod.bag.maximum=I.maximum}),$._zod.check=(u)=>{let U=u.value;if(U.length<=I.maximum)return;let z=u0(U);u.issues.push({origin:z,code:"too_big",maximum:I.maximum,inclusive:!0,input:U,inst:$,continue:!I.abort})}}),YG=L("$ZodCheckMinLength",($,I)=>{var _;Q$.init($,I),(_=$._zod.def).when??(_.when=(u)=>{let U=u.value;return!Y6(U)&&U.length!==void 0}),$._zod.onattach.push((u)=>{let U=u._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(I.minimum>U)u._zod.bag.minimum=I.minimum}),$._zod.check=(u)=>{let U=u.value;if(U.length>=I.minimum)return;let z=u0(U);u.issues.push({origin:z,code:"too_small",minimum:I.minimum,inclusive:!0,input:U,inst:$,continue:!I.abort})}}),OG=L("$ZodCheckLengthEquals",($,I)=>{var _;Q$.init($,I),(_=$._zod.def).when??(_.when=(u)=>{let U=u.value;return!Y6(U)&&U.length!==void 0}),$._zod.onattach.push((u)=>{let U=u._zod.bag;U.minimum=I.length,U.maximum=I.length,U.length=I.length}),$._zod.check=(u)=>{let U=u.value,g=U.length;if(g===I.length)return;let z=u0(U),G=g>I.length;u.issues.push({origin:z,...G?{code:"too_big",maximum:I.length}:{code:"too_small",minimum:I.length},inclusive:!0,exact:!0,input:u.value,inst:$,continue:!I.abort})}}),C1=L("$ZodCheckStringFormat",($,I)=>{var _,u;if(Q$.init($,I),$._zod.onattach.push((U)=>{let g=U._zod.bag;if(g.format=I.format,I.pattern)g.patterns??(g.patterns=new Set),g.patterns.add(I.pattern)}),I.pattern)(_=$._zod).check??(_.check=(U)=>{if(I.pattern.lastIndex=0,I.pattern.test(U.value))return;U.issues.push({origin:"string",code:"invalid_format",format:I.format,input:U.value,...I.pattern?{pattern:I.pattern.toString()}:{},inst:$,continue:!I.abort})});else(u=$._zod).check??(u.check=()=>{})}),vG=L("$ZodCheckRegex",($,I)=>{C1.init($,I),$._zod.check=(_)=>{if(I.pattern.lastIndex=0,I.pattern.test(_.value))return;_.issues.push({origin:"string",code:"invalid_format",format:"regex",input:_.value,pattern:I.pattern.toString(),inst:$,continue:!I.abort})}}),TG=L("$ZodCheckLowerCase",($,I)=>{I.pattern??(I.pattern=gG),C1.init($,I)}),MG=L("$ZodCheckUpperCase",($,I)=>{I.pattern??(I.pattern=zG),C1.init($,I)}),DG=L("$ZodCheckIncludes",($,I)=>{Q$.init($,I);let _=q4(I.includes),u=new RegExp(typeof I.position==="number"?`^.{${I.position}}${_}`:_);I.pattern=u,$._zod.onattach.push((U)=>{let g=U._zod.bag;g.patterns??(g.patterns=new Set),g.patterns.add(u)}),$._zod.check=(U)=>{if(U.value.includes(I.includes,I.position))return;U.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:I.includes,input:U.value,inst:$,continue:!I.abort})}}),LG=L("$ZodCheckStartsWith",($,I)=>{Q$.init($,I);let _=new RegExp(`^${q4(I.prefix)}.*`);I.pattern??(I.pattern=_),$._zod.onattach.push((u)=>{let U=u._zod.bag;U.patterns??(U.patterns=new Set),U.patterns.add(_)}),$._zod.check=(u)=>{if(u.value.startsWith(I.prefix))return;u.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:I.prefix,input:u.value,inst:$,continue:!I.abort})}}),BG=L("$ZodCheckEndsWith",($,I)=>{Q$.init($,I);let _=new RegExp(`.*${q4(I.suffix)}$`);I.pattern??(I.pattern=_),$._zod.onattach.push((u)=>{let U=u._zod.bag;U.patterns??(U.patterns=new Set),U.patterns.add(_)}),$._zod.check=(u)=>{if(u.value.endsWith(I.suffix))return;u.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:I.suffix,input:u.value,inst:$,continue:!I.abort})}});function pQ($,I,_){if($.issues.length)I.issues.push(...$4(_,$.issues))}var KG=L("$ZodCheckProperty",($,I)=>{Q$.init($,I),$._zod.check=(_)=>{let u=I.schema._zod.run({value:_.value[I.property],issues:[]},{});if(u instanceof Promise)return u.then((U)=>pQ(U,_,I.property));pQ(u,_,I.property);return}}),VG=L("$ZodCheckMimeType",($,I)=>{Q$.init($,I);let _=new Set(I.mime);$._zod.onattach.push((u)=>{u._zod.bag.mime=I.mime}),$._zod.check=(u)=>{if(_.has(u.value.type))return;u.issues.push({code:"invalid_value",values:I.mime,input:u.value.type,inst:$,continue:!I.abort})}}),RG=L("$ZodCheckOverwrite",($,I)=>{Q$.init($,I),$._zod.check=(_)=>{_.value=I.tx(_.value)}});class T_{constructor($=[]){if(this.content=[],this.indent=0,this)this.args=$}indented($){this.indent+=1,$(this),this.indent-=1}write($){if(typeof $==="function"){$(this,{execution:"sync"}),$(this,{execution:"async"});return}let _=$.split(`
|
|
272
|
+
`+_)}function M1($,I,_,u,U,g){if($.listenerCount("wsClientError")){let z=Error(U);Error.captureStackTrace(z,M1),$.emit("wsClientError",z,_,I)}else QU(_,u,U,g)}});var f5=O$(C5(),1),{program:hk,createCommand:ck,createArgument:dk,createOption:ok,CommanderError:pk,InvalidArgumentError:tk,InvalidOptionArgumentError:ak,Command:Qg,Argument:ek,Option:sk,Help:$y}=f5.default;var m=O$(Z$(),1);import{execSync as BS,spawn as BX}from"node:child_process";import x from"node:fs";import{tmpdir as cu}from"node:os";import e from"node:path";var dA=Qz(),oA=eI(),pA=tg(),Rz=sI(),tA=xI(),O6=$$(),aA=q6(),eA=R$(),sA=Q6(),$b=H6(),Li=z_(),Ib=Bz(),Ub=Kz(),_b=Wz(),X_=hQ(),cQ=CI();var ub=dA.Composer,gb=oA.Document,zb=pA.Schema,Gb=Rz.YAMLError,Jb=Rz.YAMLParseError,Xb=Rz.YAMLWarning,qb=tA.Alias,Nb=O6.isAlias,Qb=O6.isCollection,Hb=O6.isDocument,Yb=O6.isMap,Ob=O6.isNode,vb=O6.isPair,Tb=O6.isScalar,Mb=O6.isSeq,Db=aA.Pair,Lb=eA.Scalar,Bb=sA.YAMLMap,Kb=$b.YAMLSeq;var Wb=Ib.Lexer,Rb=Ub.LineCounter,Vb=_b.Parser,d6=X_.parse,Zb=X_.parseAllDocuments,Ab=X_.parseDocument,Vz=X_.stringify,bb=cQ.visit,Pb=cQ.visitAsync;var G$={};b4(G$,{xor:()=>DH,xid:()=>m7,void:()=>HH,uuidv7:()=>E7,uuidv6:()=>w7,uuidv4:()=>F7,uuid:()=>S7,util:()=>j,url:()=>C7,uppercase:()=>m1,unknown:()=>I1,union:()=>xu,undefined:()=>NH,ulid:()=>l7,uint64:()=>XH,uint32:()=>zH,tuple:()=>m9,trim:()=>o1,treeifyError:()=>xz,transform:()=>yu,toUpperCase:()=>t1,toLowerCase:()=>p1,toJSONSchema:()=>qu,templateLiteral:()=>FH,symbol:()=>qH,superRefine:()=>OX,success:()=>PH,stringbool:()=>iH,stringFormat:()=>s7,string:()=>vu,strictObject:()=>TH,startsWith:()=>r1,slugify:()=>a1,size:()=>e6,setErrorMap:()=>zS,set:()=>RH,safeParseAsync:()=>v9,safeParse:()=>O9,safeEncodeAsync:()=>W9,safeEncode:()=>B9,safeDecodeAsync:()=>R9,safeDecode:()=>K9,registry:()=>C_,regexes:()=>N4,regex:()=>i1,refine:()=>YX,record:()=>n9,readonly:()=>JX,property:()=>zu,promise:()=>wH,prettifyError:()=>kz,preprocess:()=>mH,prefault:()=>IX,positive:()=>Uu,pipe:()=>F0,partialRecord:()=>BH,parseAsync:()=>Y9,parse:()=>H9,overwrite:()=>D4,optional:()=>j0,object:()=>vH,number:()=>Z9,nullish:()=>bH,nullable:()=>S0,null:()=>S9,normalize:()=>d1,nonpositive:()=>uu,nonoptional:()=>UX,nonnegative:()=>gu,never:()=>fu,negative:()=>_u,nativeEnum:()=>VH,nanoid:()=>k7,nan:()=>jH,multipleOf:()=>L6,minSize:()=>E4,minLength:()=>d4,mime:()=>c1,meta:()=>kH,maxSize:()=>B6,maxLength:()=>s6,map:()=>WH,mac:()=>h7,lte:()=>I4,lt:()=>F4,lowercase:()=>l1,looseRecord:()=>KH,looseObject:()=>MH,locales:()=>V0,literal:()=>ZH,length:()=>$1,lazy:()=>NX,ksuid:()=>n7,keyof:()=>OH,jwt:()=>e7,json:()=>lH,iso:()=>$I,ipv6:()=>c7,ipv4:()=>r7,intersection:()=>i9,int64:()=>JH,int32:()=>gH,int:()=>Tu,instanceof:()=>yH,includes:()=>n1,httpUrl:()=>f7,hostname:()=>$H,hex:()=>IH,hash:()=>UH,guid:()=>j7,gte:()=>r$,gt:()=>w4,globalRegistry:()=>S$,getErrorMap:()=>GS,function:()=>EH,fromJSONSchema:()=>rH,formatError:()=>Y0,float64:()=>uH,float32:()=>_H,flattenError:()=>H0,file:()=>AH,exactOptional:()=>t9,enum:()=>ku,endsWith:()=>h1,encodeAsync:()=>D9,encode:()=>T9,emoji:()=>x7,email:()=>P7,e164:()=>a7,discriminatedUnion:()=>LH,describe:()=>xH,decodeAsync:()=>L9,decode:()=>M9,date:()=>YH,custom:()=>fH,cuid2:()=>i7,cuid:()=>y7,core:()=>o4,config:()=>K$,coerce:()=>TX,codec:()=>SH,clone:()=>n$,cidrv6:()=>o7,cidrv4:()=>d7,check:()=>CH,catch:()=>gX,boolean:()=>A9,bigint:()=>GH,base64url:()=>t7,base64:()=>p7,array:()=>C0,any:()=>QH,_function:()=>EH,_default:()=>s9,_ZodString:()=>Mu,ZodXor:()=>x9,ZodXID:()=>Vu,ZodVoid:()=>C9,ZodUnknown:()=>w9,ZodUnion:()=>x0,ZodUndefined:()=>P9,ZodUUID:()=>C4,ZodURL:()=>w0,ZodULID:()=>Ru,ZodType:()=>c,ZodTuple:()=>l9,ZodTransform:()=>o9,ZodTemplateLiteral:()=>XX,ZodSymbol:()=>b9,ZodSuccess:()=>_X,ZodStringFormat:()=>N$,ZodString:()=>UI,ZodSet:()=>h9,ZodRecord:()=>k0,ZodRealError:()=>s$,ZodReadonly:()=>GX,ZodPromise:()=>QX,ZodPrefault:()=>$X,ZodPipe:()=>mu,ZodOptional:()=>iu,ZodObject:()=>f0,ZodNumberFormat:()=>U1,ZodNumber:()=>uI,ZodNullable:()=>a9,ZodNull:()=>j9,ZodNonOptional:()=>lu,ZodNever:()=>E9,ZodNanoID:()=>Bu,ZodNaN:()=>zX,ZodMap:()=>r9,ZodMAC:()=>V9,ZodLiteral:()=>c9,ZodLazy:()=>qX,ZodKSUID:()=>Zu,ZodJWT:()=>Eu,ZodIssueCode:()=>gS,ZodIntersection:()=>y9,ZodISOTime:()=>Yu,ZodISODuration:()=>Ou,ZodISODateTime:()=>Qu,ZodISODate:()=>Hu,ZodIPv6:()=>bu,ZodIPv4:()=>Au,ZodGUID:()=>P0,ZodFunction:()=>HX,ZodFirstPartyTypeKind:()=>vX,ZodFile:()=>d9,ZodExactOptional:()=>p9,ZodError:()=>_S,ZodEnum:()=>II,ZodEmoji:()=>Lu,ZodEmail:()=>Du,ZodE164:()=>wu,ZodDiscriminatedUnion:()=>k9,ZodDefault:()=>e9,ZodDate:()=>E0,ZodCustomStringFormat:()=>_I,ZodCustom:()=>y0,ZodCodec:()=>nu,ZodCatch:()=>uX,ZodCUID2:()=>Wu,ZodCUID:()=>Ku,ZodCIDRv6:()=>ju,ZodCIDRv4:()=>Pu,ZodBoolean:()=>gI,ZodBigIntFormat:()=>Cu,ZodBigInt:()=>zI,ZodBase64URL:()=>Fu,ZodBase64:()=>Su,ZodArray:()=>f9,ZodAny:()=>F9,TimePrecision:()=>m8,NEVER:()=>Zz,$output:()=>f8,$input:()=>x8,$brand:()=>Az});var o4={};b4(o4,{version:()=>wG,util:()=>j,treeifyError:()=>xz,toJSONSchema:()=>qu,toDotPath:()=>eQ,safeParseAsync:()=>iz,safeParse:()=>yz,safeEncodeAsync:()=>JP,safeEncode:()=>zP,safeDecodeAsync:()=>XP,safeDecode:()=>GP,registry:()=>C_,regexes:()=>N4,process:()=>g$,prettifyError:()=>kz,parseAsync:()=>H_,parse:()=>Q_,meta:()=>K3,locales:()=>V0,isValidJWT:()=>T7,isValidBase64URL:()=>v7,isValidBase64:()=>IJ,initializeContext:()=>K6,globalRegistry:()=>S$,globalConfig:()=>g0,formatError:()=>Y0,flattenError:()=>H0,finalize:()=>R6,extractDefs:()=>W6,encodeAsync:()=>uP,encode:()=>UP,describe:()=>B3,decodeAsync:()=>gP,decode:()=>_P,createToJSONSchemaMethod:()=>R3,createStandardJSONSchemaMethod:()=>s1,config:()=>K$,clone:()=>n$,_xor:()=>wj,_xid:()=>c_,_void:()=>Q3,_uuidv7:()=>i_,_uuidv6:()=>y_,_uuidv4:()=>k_,_uuid:()=>x_,_url:()=>A0,_uppercase:()=>m1,_unknown:()=>q3,_union:()=>Fj,_undefined:()=>G3,_ulid:()=>h_,_uint64:()=>g3,_uint32:()=>s8,_tuple:()=>fj,_trim:()=>o1,_transform:()=>nj,_toUpperCase:()=>t1,_toLowerCase:()=>p1,_templateLiteral:()=>ej,_symbol:()=>z3,_superRefine:()=>L3,_success:()=>oj,_stringbool:()=>W3,_stringFormat:()=>e1,_string:()=>y8,_startsWith:()=>r1,_slugify:()=>a1,_size:()=>e6,_set:()=>yj,_safeParseAsync:()=>x1,_safeParse:()=>f1,_safeEncodeAsync:()=>L_,_safeEncode:()=>M_,_safeDecodeAsync:()=>B_,_safeDecode:()=>D_,_regex:()=>i1,_refine:()=>D3,_record:()=>xj,_readonly:()=>aj,_property:()=>zu,_promise:()=>$S,_positive:()=>Uu,_pipe:()=>tj,_parseAsync:()=>C1,_parse:()=>E1,_overwrite:()=>D4,_optional:()=>rj,_number:()=>d8,_nullable:()=>hj,_null:()=>J3,_normalize:()=>d1,_nonpositive:()=>uu,_nonoptional:()=>dj,_nonnegative:()=>gu,_never:()=>N3,_negative:()=>_u,_nativeEnum:()=>lj,_nanoid:()=>m_,_nan:()=>O3,_multipleOf:()=>L6,_minSize:()=>E4,_minLength:()=>d4,_min:()=>r$,_mime:()=>c1,_maxSize:()=>B6,_maxLength:()=>s6,_max:()=>I4,_map:()=>kj,_mac:()=>l8,_lte:()=>I4,_lt:()=>F4,_lowercase:()=>l1,_literal:()=>mj,_length:()=>$1,_lazy:()=>sj,_ksuid:()=>d_,_jwt:()=>Iu,_isoTime:()=>h8,_isoDuration:()=>c8,_isoDateTime:()=>n8,_isoDate:()=>r8,_ipv6:()=>p_,_ipv4:()=>o_,_intersection:()=>Cj,_int64:()=>u3,_int32:()=>e8,_int:()=>p8,_includes:()=>n1,_guid:()=>Z0,_gte:()=>r$,_gt:()=>w4,_float64:()=>a8,_float32:()=>t8,_file:()=>T3,_enum:()=>ij,_endsWith:()=>h1,_encodeAsync:()=>v_,_encode:()=>Y_,_emoji:()=>l_,_email:()=>f_,_e164:()=>$u,_discriminatedUnion:()=>Ej,_default:()=>cj,_decodeAsync:()=>T_,_decode:()=>O_,_date:()=>H3,_custom:()=>M3,_cuid2:()=>r_,_cuid:()=>n_,_coercedString:()=>i8,_coercedNumber:()=>o8,_coercedDate:()=>Y3,_coercedBoolean:()=>I3,_coercedBigint:()=>_3,_cidrv6:()=>a_,_cidrv4:()=>t_,_check:()=>Z7,_catch:()=>pj,_boolean:()=>$3,_bigint:()=>U3,_base64url:()=>s_,_base64:()=>e_,_array:()=>v3,_any:()=>X3,TimePrecision:()=>m8,NEVER:()=>Zz,JSONSchemaGenerator:()=>J9,JSONSchema:()=>A7,Doc:()=>V_,$output:()=>f8,$input:()=>x8,$constructor:()=>L,$brand:()=>Az,$ZodXor:()=>DJ,$ZodXID:()=>rG,$ZodVoid:()=>OJ,$ZodUnknown:()=>HJ,$ZodUnion:()=>D0,$ZodUndefined:()=>qJ,$ZodUUID:()=>fG,$ZodURL:()=>kG,$ZodULID:()=>nG,$ZodType:()=>r,$ZodTuple:()=>w_,$ZodTransform:()=>bJ,$ZodTemplateLiteral:()=>yJ,$ZodSymbol:()=>XJ,$ZodSuccess:()=>EJ,$ZodStringFormat:()=>q$,$ZodString:()=>a6,$ZodSet:()=>RJ,$ZodRegistry:()=>k8,$ZodRecord:()=>KJ,$ZodRealError:()=>e$,$ZodReadonly:()=>kJ,$ZodPromise:()=>lJ,$ZodPrefault:()=>FJ,$ZodPipe:()=>xJ,$ZodOptional:()=>E_,$ZodObjectJIT:()=>MJ,$ZodObject:()=>L7,$ZodNumberFormat:()=>GJ,$ZodNumber:()=>S_,$ZodNullable:()=>jJ,$ZodNull:()=>NJ,$ZodNonOptional:()=>wJ,$ZodNever:()=>YJ,$ZodNanoID:()=>iG,$ZodNaN:()=>fJ,$ZodMap:()=>WJ,$ZodMAC:()=>eG,$ZodLiteral:()=>ZJ,$ZodLazy:()=>mJ,$ZodKSUID:()=>hG,$ZodJWT:()=>gJ,$ZodIntersection:()=>BJ,$ZodISOTime:()=>oG,$ZodISODuration:()=>pG,$ZodISODateTime:()=>cG,$ZodISODate:()=>dG,$ZodIPv6:()=>aG,$ZodIPv4:()=>tG,$ZodGUID:()=>CG,$ZodFunction:()=>iJ,$ZodFile:()=>AJ,$ZodExactOptional:()=>PJ,$ZodError:()=>Q0,$ZodEnum:()=>VJ,$ZodEncodeError:()=>o6,$ZodEmoji:()=>yG,$ZodEmail:()=>xG,$ZodE164:()=>uJ,$ZodDiscriminatedUnion:()=>LJ,$ZodDefault:()=>SJ,$ZodDate:()=>vJ,$ZodCustomStringFormat:()=>zJ,$ZodCustom:()=>nJ,$ZodCodec:()=>L0,$ZodCheckUpperCase:()=>ZG,$ZodCheckStringFormat:()=>k1,$ZodCheckStartsWith:()=>bG,$ZodCheckSizeEquals:()=>LG,$ZodCheckRegex:()=>RG,$ZodCheckProperty:()=>jG,$ZodCheckOverwrite:()=>FG,$ZodCheckNumberFormat:()=>vG,$ZodCheckMultipleOf:()=>OG,$ZodCheckMinSize:()=>DG,$ZodCheckMinLength:()=>KG,$ZodCheckMimeType:()=>SG,$ZodCheckMaxSize:()=>MG,$ZodCheckMaxLength:()=>BG,$ZodCheckLowerCase:()=>VG,$ZodCheckLessThan:()=>W_,$ZodCheckLengthEquals:()=>WG,$ZodCheckIncludes:()=>AG,$ZodCheckGreaterThan:()=>R_,$ZodCheckEndsWith:()=>PG,$ZodCheckBigIntFormat:()=>TG,$ZodCheck:()=>H$,$ZodCatch:()=>CJ,$ZodCUID2:()=>mG,$ZodCUID:()=>lG,$ZodCIDRv6:()=>$J,$ZodCIDRv4:()=>sG,$ZodBoolean:()=>M0,$ZodBigIntFormat:()=>JJ,$ZodBigInt:()=>F_,$ZodBase64URL:()=>_J,$ZodBase64:()=>UJ,$ZodAsyncError:()=>S4,$ZodArray:()=>TJ,$ZodAny:()=>QJ});var Zz=Object.freeze({status:"aborted"});function L($,I,_){function u(G,J){if(!G._zod)Object.defineProperty(G,"_zod",{value:{def:J,constr:z,traits:new Set},enumerable:!1});if(G._zod.traits.has($))return;G._zod.traits.add($),I(G,J);let X=z.prototype,N=Object.keys(X);for(let q=0;q<N.length;q++){let Q=N[q];if(!(Q in G))G[Q]=X[Q].bind(G)}}let U=_?.Parent??Object;class g extends U{}Object.defineProperty(g,"name",{value:$});function z(G){var J;let X=_?.Parent?new g:this;u(X,G),(J=X._zod).deferred??(J.deferred=[]);for(let N of X._zod.deferred)N();return X}return Object.defineProperty(z,"init",{value:u}),Object.defineProperty(z,Symbol.hasInstance,{value:(G)=>{if(_?.Parent&&G instanceof _.Parent)return!0;return G?._zod?.traits?.has($)}}),Object.defineProperty(z,"name",{value:$}),z}var Az=Symbol("zod_brand");class S4 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class o6 extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}}var g0={};function K$($){if($)Object.assign(g0,$);return g0}var j={};b4(j,{unwrapMessage:()=>z0,uint8ArrayToHex:()=>$P,uint8ArrayToBase64url:()=>eb,uint8ArrayToBase64:()=>pQ,stringifyPrimitive:()=>b,slugify:()=>jz,shallowClone:()=>Fz,safeExtend:()=>cb,required:()=>pb,randomString:()=>yb,propertyKeyTypes:()=>X0,promiseAllObject:()=>kb,primitiveTypes:()=>wz,prefixIssues:()=>$4,pick:()=>nb,partial:()=>ob,parsedType:()=>P,optionalKeys:()=>Ez,omit:()=>rb,objectClone:()=>Cb,numKeys:()=>ib,nullish:()=>v6,normalizeParams:()=>F,mergeDefs:()=>c4,merge:()=>db,jsonStringifyReplacer:()=>S1,joinValues:()=>Z,issue:()=>w1,isPlainObject:()=>M6,isObject:()=>p6,hexToUint8Array:()=>sb,getSizableOrigin:()=>q0,getParsedType:()=>lb,getLengthableOrigin:()=>N0,getEnumValues:()=>G0,getElementAtPath:()=>xb,floatSafeRemainder:()=>Pz,finalizeIssue:()=>a$,extend:()=>hb,escapeRegex:()=>q4,esc:()=>q_,defineLazy:()=>o,createTransparentProxy:()=>mb,cloneDef:()=>fb,clone:()=>n$,cleanRegex:()=>J0,cleanEnum:()=>tb,captureStackTrace:()=>N_,cached:()=>F1,base64urlToUint8Array:()=>ab,base64ToUint8Array:()=>oQ,assignProp:()=>T6,assertNotEqual:()=>Sb,assertNever:()=>wb,assertIs:()=>Fb,assertEqual:()=>jb,assert:()=>Eb,allowsEval:()=>Sz,aborted:()=>D6,NUMBER_FORMAT_RANGES:()=>Cz,Class:()=>tQ,BIGINT_FORMAT_RANGES:()=>fz});function jb($){return $}function Sb($){return $}function Fb($){}function wb($){throw Error("Unexpected value in exhaustive check")}function Eb($){}function G0($){let I=Object.values($).filter((u)=>typeof u==="number");return Object.entries($).filter(([u,U])=>I.indexOf(+u)===-1).map(([u,U])=>U)}function Z($,I="|"){return $.map((_)=>b(_)).join(I)}function S1($,I){if(typeof I==="bigint")return I.toString();return I}function F1($){return{get value(){{let _=$();return Object.defineProperty(this,"value",{value:_}),_}throw Error("cached value already set")}}}function v6($){return $===null||$===void 0}function J0($){let I=$.startsWith("^")?1:0,_=$.endsWith("$")?$.length-1:$.length;return $.slice(I,_)}function Pz($,I){let _=($.toString().split(".")[1]||"").length,u=I.toString(),U=(u.split(".")[1]||"").length;if(U===0&&/\d?e-\d?/.test(u)){let J=u.match(/\d?e-(\d?)/);if(J?.[1])U=Number.parseInt(J[1])}let g=_>U?_:U,z=Number.parseInt($.toFixed(g).replace(".","")),G=Number.parseInt(I.toFixed(g).replace(".",""));return z%G/10**g}var dQ=Symbol("evaluating");function o($,I,_){let u=void 0;Object.defineProperty($,I,{get(){if(u===dQ)return;if(u===void 0)u=dQ,u=_();return u},set(U){Object.defineProperty($,I,{value:U})},configurable:!0})}function Cb($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function T6($,I,_){Object.defineProperty($,I,{value:_,writable:!0,enumerable:!0,configurable:!0})}function c4(...$){let I={};for(let _ of $){let u=Object.getOwnPropertyDescriptors(_);Object.assign(I,u)}return Object.defineProperties({},I)}function fb($){return c4($._zod.def)}function xb($,I){if(!I)return $;return I.reduce((_,u)=>_?.[u],$)}function kb($){let I=Object.keys($),_=I.map((u)=>$[u]);return Promise.all(_).then((u)=>{let U={};for(let g=0;g<I.length;g++)U[I[g]]=u[g];return U})}function yb($=10){let _="";for(let u=0;u<$;u++)_+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return _}function q_($){return JSON.stringify($)}function jz($){return $.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var N_="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};function p6($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var Sz=F1(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function M6($){if(p6($)===!1)return!1;let I=$.constructor;if(I===void 0)return!0;if(typeof I!=="function")return!0;let _=I.prototype;if(p6(_)===!1)return!1;if(Object.prototype.hasOwnProperty.call(_,"isPrototypeOf")===!1)return!1;return!0}function Fz($){if(M6($))return{...$};if(Array.isArray($))return[...$];return $}function ib($){let I=0;for(let _ in $)if(Object.prototype.hasOwnProperty.call($,_))I++;return I}var lb=($)=>{let I=typeof $;switch(I){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN($)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray($))return"array";if($===null)return"null";if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return"promise";if(typeof Map<"u"&&$ instanceof Map)return"map";if(typeof Set<"u"&&$ instanceof Set)return"set";if(typeof Date<"u"&&$ instanceof Date)return"date";if(typeof File<"u"&&$ instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${I}`)}},X0=new Set(["string","number","symbol"]),wz=new Set(["string","number","bigint","boolean","symbol","undefined"]);function q4($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function n$($,I,_){let u=new $._zod.constr(I??$._zod.def);if(!I||_?.parent)u._zod.parent=$;return u}function F($){let I=$;if(!I)return{};if(typeof I==="string")return{error:()=>I};if(I?.message!==void 0){if(I?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");I.error=I.message}if(delete I.message,typeof I.error==="string")return{...I,error:()=>I.error};return I}function mb($){let I;return new Proxy({},{get(_,u,U){return I??(I=$()),Reflect.get(I,u,U)},set(_,u,U,g){return I??(I=$()),Reflect.set(I,u,U,g)},has(_,u){return I??(I=$()),Reflect.has(I,u)},deleteProperty(_,u){return I??(I=$()),Reflect.deleteProperty(I,u)},ownKeys(_){return I??(I=$()),Reflect.ownKeys(I)},getOwnPropertyDescriptor(_,u){return I??(I=$()),Reflect.getOwnPropertyDescriptor(I,u)},defineProperty(_,u,U){return I??(I=$()),Reflect.defineProperty(I,u,U)}})}function b($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function Ez($){return Object.keys($).filter((I)=>{return $[I]._zod.optin==="optional"&&$[I]._zod.optout==="optional"})}var Cz={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},fz={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function nb($,I){let _=$._zod.def,u=_.checks;if(u&&u.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let g=c4($._zod.def,{get shape(){let z={};for(let G in I){if(!(G in _.shape))throw Error(`Unrecognized key: "${G}"`);if(!I[G])continue;z[G]=_.shape[G]}return T6(this,"shape",z),z},checks:[]});return n$($,g)}function rb($,I){let _=$._zod.def,u=_.checks;if(u&&u.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let g=c4($._zod.def,{get shape(){let z={...$._zod.def.shape};for(let G in I){if(!(G in _.shape))throw Error(`Unrecognized key: "${G}"`);if(!I[G])continue;delete z[G]}return T6(this,"shape",z),z},checks:[]});return n$($,g)}function hb($,I){if(!M6(I))throw Error("Invalid input to extend: expected a plain object");let _=$._zod.def.checks;if(_&&_.length>0){let g=$._zod.def.shape;for(let z in I)if(Object.getOwnPropertyDescriptor(g,z)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let U=c4($._zod.def,{get shape(){let g={...$._zod.def.shape,...I};return T6(this,"shape",g),g}});return n$($,U)}function cb($,I){if(!M6(I))throw Error("Invalid input to safeExtend: expected a plain object");let _=c4($._zod.def,{get shape(){let u={...$._zod.def.shape,...I};return T6(this,"shape",u),u}});return n$($,_)}function db($,I){let _=c4($._zod.def,{get shape(){let u={...$._zod.def.shape,...I._zod.def.shape};return T6(this,"shape",u),u},get catchall(){return I._zod.def.catchall},checks:[]});return n$($,_)}function ob($,I,_){let U=I._zod.def.checks;if(U&&U.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let z=c4(I._zod.def,{get shape(){let G=I._zod.def.shape,J={...G};if(_)for(let X in _){if(!(X in G))throw Error(`Unrecognized key: "${X}"`);if(!_[X])continue;J[X]=$?new $({type:"optional",innerType:G[X]}):G[X]}else for(let X in G)J[X]=$?new $({type:"optional",innerType:G[X]}):G[X];return T6(this,"shape",J),J},checks:[]});return n$(I,z)}function pb($,I,_){let u=c4(I._zod.def,{get shape(){let U=I._zod.def.shape,g={...U};if(_)for(let z in _){if(!(z in g))throw Error(`Unrecognized key: "${z}"`);if(!_[z])continue;g[z]=new $({type:"nonoptional",innerType:U[z]})}else for(let z in U)g[z]=new $({type:"nonoptional",innerType:U[z]});return T6(this,"shape",g),g}});return n$(I,u)}function D6($,I=0){if($.aborted===!0)return!0;for(let _=I;_<$.issues.length;_++)if($.issues[_]?.continue!==!0)return!0;return!1}function $4($,I){return I.map((_)=>{var u;return(u=_).path??(u.path=[]),_.path.unshift($),_})}function z0($){return typeof $==="string"?$:$?.message}function a$($,I,_){let u={...$,path:$.path??[]};if(!$.message){let U=z0($.inst?._zod.def?.error?.($))??z0(I?.error?.($))??z0(_.customError?.($))??z0(_.localeError?.($))??"Invalid input";u.message=U}if(delete u.inst,delete u.continue,!I?.reportInput)delete u.input;return u}function q0($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function N0($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function P($){let I=typeof $;switch(I){case"number":return Number.isNaN($)?"nan":"number";case"object":{if($===null)return"null";if(Array.isArray($))return"array";let _=$;if(_&&Object.getPrototypeOf(_)!==Object.prototype&&"constructor"in _&&_.constructor)return _.constructor.name}}return I}function w1(...$){let[I,_,u]=$;if(typeof I==="string")return{message:I,code:"custom",input:_,inst:u};return{...I}}function tb($){return Object.entries($).filter(([I,_])=>{return Number.isNaN(Number.parseInt(I,10))}).map((I)=>I[1])}function oQ($){let I=atob($),_=new Uint8Array(I.length);for(let u=0;u<I.length;u++)_[u]=I.charCodeAt(u);return _}function pQ($){let I="";for(let _=0;_<$.length;_++)I+=String.fromCharCode($[_]);return btoa(I)}function ab($){let I=$.replace(/-/g,"+").replace(/_/g,"/"),_="=".repeat((4-I.length%4)%4);return oQ(I+_)}function eb($){return pQ($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function sb($){let I=$.replace(/^0x/,"");if(I.length%2!==0)throw Error("Invalid hex string length");let _=new Uint8Array(I.length/2);for(let u=0;u<I.length;u+=2)_[u/2]=Number.parseInt(I.slice(u,u+2),16);return _}function $P($){return Array.from($).map((I)=>I.toString(16).padStart(2,"0")).join("")}class tQ{constructor(...$){}}var aQ=($,I)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:I,enumerable:!1}),$.message=JSON.stringify(I,S1,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},Q0=L("$ZodError",aQ),e$=L("$ZodError",aQ,{Parent:Error});function H0($,I=(_)=>_.message){let _={},u=[];for(let U of $.issues)if(U.path.length>0)_[U.path[0]]=_[U.path[0]]||[],_[U.path[0]].push(I(U));else u.push(I(U));return{formErrors:u,fieldErrors:_}}function Y0($,I=(_)=>_.message){let _={_errors:[]},u=(U)=>{for(let g of U.issues)if(g.code==="invalid_union"&&g.errors.length)g.errors.map((z)=>u({issues:z}));else if(g.code==="invalid_key")u({issues:g.issues});else if(g.code==="invalid_element")u({issues:g.issues});else if(g.path.length===0)_._errors.push(I(g));else{let z=_,G=0;while(G<g.path.length){let J=g.path[G];if(G!==g.path.length-1)z[J]=z[J]||{_errors:[]};else z[J]=z[J]||{_errors:[]},z[J]._errors.push(I(g));z=z[J],G++}}};return u($),_}function xz($,I=(_)=>_.message){let _={errors:[]},u=(U,g=[])=>{var z,G;for(let J of U.issues)if(J.code==="invalid_union"&&J.errors.length)J.errors.map((X)=>u({issues:X},J.path));else if(J.code==="invalid_key")u({issues:J.issues},J.path);else if(J.code==="invalid_element")u({issues:J.issues},J.path);else{let X=[...g,...J.path];if(X.length===0){_.errors.push(I(J));continue}let N=_,q=0;while(q<X.length){let Q=X[q],Y=q===X.length-1;if(typeof Q==="string")N.properties??(N.properties={}),(z=N.properties)[Q]??(z[Q]={errors:[]}),N=N.properties[Q];else N.items??(N.items=[]),(G=N.items)[Q]??(G[Q]={errors:[]}),N=N.items[Q];if(Y)N.errors.push(I(J));q++}}};return u($),_}function eQ($){let I=[],_=$.map((u)=>typeof u==="object"?u.key:u);for(let u of _)if(typeof u==="number")I.push(`[${u}]`);else if(typeof u==="symbol")I.push(`[${JSON.stringify(String(u))}]`);else if(/[^\w$]/.test(u))I.push(`[${JSON.stringify(u)}]`);else{if(I.length)I.push(".");I.push(u)}return I.join("")}function kz($){let I=[],_=[...$.issues].sort((u,U)=>(u.path??[]).length-(U.path??[]).length);for(let u of _)if(I.push(`✖ ${u.message}`),u.path?.length)I.push(` → at ${eQ(u.path)}`);return I.join(`
|
|
273
|
+
`)}var E1=($)=>(I,_,u,U)=>{let g=u?Object.assign(u,{async:!1}):{async:!1},z=I._zod.run({value:_,issues:[]},g);if(z instanceof Promise)throw new S4;if(z.issues.length){let G=new(U?.Err??$)(z.issues.map((J)=>a$(J,g,K$())));throw N_(G,U?.callee),G}return z.value},Q_=E1(e$),C1=($)=>async(I,_,u,U)=>{let g=u?Object.assign(u,{async:!0}):{async:!0},z=I._zod.run({value:_,issues:[]},g);if(z instanceof Promise)z=await z;if(z.issues.length){let G=new(U?.Err??$)(z.issues.map((J)=>a$(J,g,K$())));throw N_(G,U?.callee),G}return z.value},H_=C1(e$),f1=($)=>(I,_,u)=>{let U=u?{...u,async:!1}:{async:!1},g=I._zod.run({value:_,issues:[]},U);if(g instanceof Promise)throw new S4;return g.issues.length?{success:!1,error:new($??Q0)(g.issues.map((z)=>a$(z,U,K$())))}:{success:!0,data:g.value}},yz=f1(e$),x1=($)=>async(I,_,u)=>{let U=u?Object.assign(u,{async:!0}):{async:!0},g=I._zod.run({value:_,issues:[]},U);if(g instanceof Promise)g=await g;return g.issues.length?{success:!1,error:new $(g.issues.map((z)=>a$(z,U,K$())))}:{success:!0,data:g.value}},iz=x1(e$),Y_=($)=>(I,_,u)=>{let U=u?Object.assign(u,{direction:"backward"}):{direction:"backward"};return E1($)(I,_,U)},UP=Y_(e$),O_=($)=>(I,_,u)=>{return E1($)(I,_,u)},_P=O_(e$),v_=($)=>async(I,_,u)=>{let U=u?Object.assign(u,{direction:"backward"}):{direction:"backward"};return C1($)(I,_,U)},uP=v_(e$),T_=($)=>async(I,_,u)=>{return C1($)(I,_,u)},gP=T_(e$),M_=($)=>(I,_,u)=>{let U=u?Object.assign(u,{direction:"backward"}):{direction:"backward"};return f1($)(I,_,U)},zP=M_(e$),D_=($)=>(I,_,u)=>{return f1($)(I,_,u)},GP=D_(e$),L_=($)=>async(I,_,u)=>{let U=u?Object.assign(u,{direction:"backward"}):{direction:"backward"};return x1($)(I,_,U)},JP=L_(e$),B_=($)=>async(I,_,u)=>{return x1($)(I,_,u)},XP=B_(e$);var N4={};b4(N4,{xid:()=>rz,uuid7:()=>HP,uuid6:()=>QP,uuid4:()=>NP,uuid:()=>t6,uppercase:()=>YG,unicodeEmail:()=>sQ,undefined:()=>QG,ulid:()=>nz,time:()=>gG,string:()=>GG,sha512_hex:()=>EP,sha512_base64url:()=>fP,sha512_base64:()=>CP,sha384_hex:()=>SP,sha384_base64url:()=>wP,sha384_base64:()=>FP,sha256_hex:()=>bP,sha256_base64url:()=>jP,sha256_base64:()=>PP,sha1_hex:()=>VP,sha1_base64url:()=>AP,sha1_base64:()=>ZP,rfc5322Email:()=>OP,number:()=>O0,null:()=>NG,nanoid:()=>cz,md5_hex:()=>KP,md5_base64url:()=>RP,md5_base64:()=>WP,mac:()=>sz,lowercase:()=>HG,ksuid:()=>hz,ipv6:()=>ez,ipv4:()=>az,integer:()=>XG,idnEmail:()=>vP,html5Email:()=>YP,hostname:()=>DP,hex:()=>BP,guid:()=>oz,extendedDuration:()=>qP,emoji:()=>tz,email:()=>pz,e164:()=>_G,duration:()=>dz,domain:()=>LP,datetime:()=>zG,date:()=>uG,cuid2:()=>mz,cuid:()=>lz,cidrv6:()=>IG,cidrv4:()=>$G,browserEmail:()=>TP,boolean:()=>qG,bigint:()=>JG,base64url:()=>K_,base64:()=>UG});var lz=/^[cC][^\s-]{8,}$/,mz=/^[0-9a-z]+$/,nz=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,rz=/^[0-9a-vA-V]{20}$/,hz=/^[A-Za-z0-9]{27}$/,cz=/^[a-zA-Z0-9_-]{21}$/,dz=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,qP=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,oz=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,t6=($)=>{if(!$)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${$}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},NP=t6(4),QP=t6(6),HP=t6(7),pz=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,YP=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,OP=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,sQ=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,vP=sQ,TP=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,MP="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function tz(){return new RegExp(MP,"u")}var az=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ez=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,sz=($)=>{let I=q4($??":");return new RegExp(`^(?:[0-9A-F]{2}${I}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${I}){5}[0-9a-f]{2}$`)},$G=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,IG=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,UG=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,K_=/^[A-Za-z0-9_-]*$/,DP=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,LP=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,_G=/^\+[1-9]\d{6,14}$/,$7="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",uG=new RegExp(`^${$7}$`);function I7($){return typeof $.precision==="number"?$.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":$.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${$.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function gG($){return new RegExp(`^${I7($)}$`)}function zG($){let I=I7({precision:$.precision}),_=["Z"];if($.local)_.push("");if($.offset)_.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let u=`${I}(?:${_.join("|")})`;return new RegExp(`^${$7}T(?:${u})$`)}var GG=($)=>{let I=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${I}$`)},JG=/^-?\d+n?$/,XG=/^-?\d+$/,O0=/^-?\d+(?:\.\d+)?$/,qG=/^(?:true|false)$/i,NG=/^null$/i;var QG=/^undefined$/i;var HG=/^[^A-Z]*$/,YG=/^[^a-z]*$/,BP=/^[0-9a-fA-F]*$/;function v0($,I){return new RegExp(`^[A-Za-z0-9+/]{${$}}${I}$`)}function T0($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var KP=/^[0-9a-fA-F]{32}$/,WP=v0(22,"=="),RP=T0(22),VP=/^[0-9a-fA-F]{40}$/,ZP=v0(27,"="),AP=T0(27),bP=/^[0-9a-fA-F]{64}$/,PP=v0(43,"="),jP=T0(43),SP=/^[0-9a-fA-F]{96}$/,FP=v0(64,""),wP=T0(64),EP=/^[0-9a-fA-F]{128}$/,CP=v0(86,"=="),fP=T0(86);var H$=L("$ZodCheck",($,I)=>{var _;$._zod??($._zod={}),$._zod.def=I,(_=$._zod).onattach??(_.onattach=[])}),_7={number:"number",bigint:"bigint",object:"date"},W_=L("$ZodCheckLessThan",($,I)=>{H$.init($,I);let _=_7[typeof I.value];$._zod.onattach.push((u)=>{let U=u._zod.bag,g=(I.inclusive?U.maximum:U.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(I.value<g)if(I.inclusive)U.maximum=I.value;else U.exclusiveMaximum=I.value}),$._zod.check=(u)=>{if(I.inclusive?u.value<=I.value:u.value<I.value)return;u.issues.push({origin:_,code:"too_big",maximum:typeof I.value==="object"?I.value.getTime():I.value,input:u.value,inclusive:I.inclusive,inst:$,continue:!I.abort})}}),R_=L("$ZodCheckGreaterThan",($,I)=>{H$.init($,I);let _=_7[typeof I.value];$._zod.onattach.push((u)=>{let U=u._zod.bag,g=(I.inclusive?U.minimum:U.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(I.value>g)if(I.inclusive)U.minimum=I.value;else U.exclusiveMinimum=I.value}),$._zod.check=(u)=>{if(I.inclusive?u.value>=I.value:u.value>I.value)return;u.issues.push({origin:_,code:"too_small",minimum:typeof I.value==="object"?I.value.getTime():I.value,input:u.value,inclusive:I.inclusive,inst:$,continue:!I.abort})}}),OG=L("$ZodCheckMultipleOf",($,I)=>{H$.init($,I),$._zod.onattach.push((_)=>{var u;(u=_._zod.bag).multipleOf??(u.multipleOf=I.value)}),$._zod.check=(_)=>{if(typeof _.value!==typeof I.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof _.value==="bigint"?_.value%I.value===BigInt(0):Pz(_.value,I.value)===0)return;_.issues.push({origin:typeof _.value,code:"not_multiple_of",divisor:I.value,input:_.value,inst:$,continue:!I.abort})}}),vG=L("$ZodCheckNumberFormat",($,I)=>{H$.init($,I),I.format=I.format||"float64";let _=I.format?.includes("int"),u=_?"int":"number",[U,g]=Cz[I.format];$._zod.onattach.push((z)=>{let G=z._zod.bag;if(G.format=I.format,G.minimum=U,G.maximum=g,_)G.pattern=XG}),$._zod.check=(z)=>{let G=z.value;if(_){if(!Number.isInteger(G)){z.issues.push({expected:u,format:I.format,code:"invalid_type",continue:!1,input:G,inst:$});return}if(!Number.isSafeInteger(G)){if(G>0)z.issues.push({input:G,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:u,inclusive:!0,continue:!I.abort});else z.issues.push({input:G,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:u,inclusive:!0,continue:!I.abort});return}}if(G<U)z.issues.push({origin:"number",input:G,code:"too_small",minimum:U,inclusive:!0,inst:$,continue:!I.abort});if(G>g)z.issues.push({origin:"number",input:G,code:"too_big",maximum:g,inclusive:!0,inst:$,continue:!I.abort})}}),TG=L("$ZodCheckBigIntFormat",($,I)=>{H$.init($,I);let[_,u]=fz[I.format];$._zod.onattach.push((U)=>{let g=U._zod.bag;g.format=I.format,g.minimum=_,g.maximum=u}),$._zod.check=(U)=>{let g=U.value;if(g<_)U.issues.push({origin:"bigint",input:g,code:"too_small",minimum:_,inclusive:!0,inst:$,continue:!I.abort});if(g>u)U.issues.push({origin:"bigint",input:g,code:"too_big",maximum:u,inclusive:!0,inst:$,continue:!I.abort})}}),MG=L("$ZodCheckMaxSize",($,I)=>{var _;H$.init($,I),(_=$._zod.def).when??(_.when=(u)=>{let U=u.value;return!v6(U)&&U.size!==void 0}),$._zod.onattach.push((u)=>{let U=u._zod.bag.maximum??Number.POSITIVE_INFINITY;if(I.maximum<U)u._zod.bag.maximum=I.maximum}),$._zod.check=(u)=>{let U=u.value;if(U.size<=I.maximum)return;u.issues.push({origin:q0(U),code:"too_big",maximum:I.maximum,inclusive:!0,input:U,inst:$,continue:!I.abort})}}),DG=L("$ZodCheckMinSize",($,I)=>{var _;H$.init($,I),(_=$._zod.def).when??(_.when=(u)=>{let U=u.value;return!v6(U)&&U.size!==void 0}),$._zod.onattach.push((u)=>{let U=u._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(I.minimum>U)u._zod.bag.minimum=I.minimum}),$._zod.check=(u)=>{let U=u.value;if(U.size>=I.minimum)return;u.issues.push({origin:q0(U),code:"too_small",minimum:I.minimum,inclusive:!0,input:U,inst:$,continue:!I.abort})}}),LG=L("$ZodCheckSizeEquals",($,I)=>{var _;H$.init($,I),(_=$._zod.def).when??(_.when=(u)=>{let U=u.value;return!v6(U)&&U.size!==void 0}),$._zod.onattach.push((u)=>{let U=u._zod.bag;U.minimum=I.size,U.maximum=I.size,U.size=I.size}),$._zod.check=(u)=>{let U=u.value,g=U.size;if(g===I.size)return;let z=g>I.size;u.issues.push({origin:q0(U),...z?{code:"too_big",maximum:I.size}:{code:"too_small",minimum:I.size},inclusive:!0,exact:!0,input:u.value,inst:$,continue:!I.abort})}}),BG=L("$ZodCheckMaxLength",($,I)=>{var _;H$.init($,I),(_=$._zod.def).when??(_.when=(u)=>{let U=u.value;return!v6(U)&&U.length!==void 0}),$._zod.onattach.push((u)=>{let U=u._zod.bag.maximum??Number.POSITIVE_INFINITY;if(I.maximum<U)u._zod.bag.maximum=I.maximum}),$._zod.check=(u)=>{let U=u.value;if(U.length<=I.maximum)return;let z=N0(U);u.issues.push({origin:z,code:"too_big",maximum:I.maximum,inclusive:!0,input:U,inst:$,continue:!I.abort})}}),KG=L("$ZodCheckMinLength",($,I)=>{var _;H$.init($,I),(_=$._zod.def).when??(_.when=(u)=>{let U=u.value;return!v6(U)&&U.length!==void 0}),$._zod.onattach.push((u)=>{let U=u._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(I.minimum>U)u._zod.bag.minimum=I.minimum}),$._zod.check=(u)=>{let U=u.value;if(U.length>=I.minimum)return;let z=N0(U);u.issues.push({origin:z,code:"too_small",minimum:I.minimum,inclusive:!0,input:U,inst:$,continue:!I.abort})}}),WG=L("$ZodCheckLengthEquals",($,I)=>{var _;H$.init($,I),(_=$._zod.def).when??(_.when=(u)=>{let U=u.value;return!v6(U)&&U.length!==void 0}),$._zod.onattach.push((u)=>{let U=u._zod.bag;U.minimum=I.length,U.maximum=I.length,U.length=I.length}),$._zod.check=(u)=>{let U=u.value,g=U.length;if(g===I.length)return;let z=N0(U),G=g>I.length;u.issues.push({origin:z,...G?{code:"too_big",maximum:I.length}:{code:"too_small",minimum:I.length},inclusive:!0,exact:!0,input:u.value,inst:$,continue:!I.abort})}}),k1=L("$ZodCheckStringFormat",($,I)=>{var _,u;if(H$.init($,I),$._zod.onattach.push((U)=>{let g=U._zod.bag;if(g.format=I.format,I.pattern)g.patterns??(g.patterns=new Set),g.patterns.add(I.pattern)}),I.pattern)(_=$._zod).check??(_.check=(U)=>{if(I.pattern.lastIndex=0,I.pattern.test(U.value))return;U.issues.push({origin:"string",code:"invalid_format",format:I.format,input:U.value,...I.pattern?{pattern:I.pattern.toString()}:{},inst:$,continue:!I.abort})});else(u=$._zod).check??(u.check=()=>{})}),RG=L("$ZodCheckRegex",($,I)=>{k1.init($,I),$._zod.check=(_)=>{if(I.pattern.lastIndex=0,I.pattern.test(_.value))return;_.issues.push({origin:"string",code:"invalid_format",format:"regex",input:_.value,pattern:I.pattern.toString(),inst:$,continue:!I.abort})}}),VG=L("$ZodCheckLowerCase",($,I)=>{I.pattern??(I.pattern=HG),k1.init($,I)}),ZG=L("$ZodCheckUpperCase",($,I)=>{I.pattern??(I.pattern=YG),k1.init($,I)}),AG=L("$ZodCheckIncludes",($,I)=>{H$.init($,I);let _=q4(I.includes),u=new RegExp(typeof I.position==="number"?`^.{${I.position}}${_}`:_);I.pattern=u,$._zod.onattach.push((U)=>{let g=U._zod.bag;g.patterns??(g.patterns=new Set),g.patterns.add(u)}),$._zod.check=(U)=>{if(U.value.includes(I.includes,I.position))return;U.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:I.includes,input:U.value,inst:$,continue:!I.abort})}}),bG=L("$ZodCheckStartsWith",($,I)=>{H$.init($,I);let _=new RegExp(`^${q4(I.prefix)}.*`);I.pattern??(I.pattern=_),$._zod.onattach.push((u)=>{let U=u._zod.bag;U.patterns??(U.patterns=new Set),U.patterns.add(_)}),$._zod.check=(u)=>{if(u.value.startsWith(I.prefix))return;u.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:I.prefix,input:u.value,inst:$,continue:!I.abort})}}),PG=L("$ZodCheckEndsWith",($,I)=>{H$.init($,I);let _=new RegExp(`.*${q4(I.suffix)}$`);I.pattern??(I.pattern=_),$._zod.onattach.push((u)=>{let U=u._zod.bag;U.patterns??(U.patterns=new Set),U.patterns.add(_)}),$._zod.check=(u)=>{if(u.value.endsWith(I.suffix))return;u.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:I.suffix,input:u.value,inst:$,continue:!I.abort})}});function U7($,I,_){if($.issues.length)I.issues.push(...$4(_,$.issues))}var jG=L("$ZodCheckProperty",($,I)=>{H$.init($,I),$._zod.check=(_)=>{let u=I.schema._zod.run({value:_.value[I.property],issues:[]},{});if(u instanceof Promise)return u.then((U)=>U7(U,_,I.property));U7(u,_,I.property);return}}),SG=L("$ZodCheckMimeType",($,I)=>{H$.init($,I);let _=new Set(I.mime);$._zod.onattach.push((u)=>{u._zod.bag.mime=I.mime}),$._zod.check=(u)=>{if(_.has(u.value.type))return;u.issues.push({code:"invalid_value",values:I.mime,input:u.value.type,inst:$,continue:!I.abort})}}),FG=L("$ZodCheckOverwrite",($,I)=>{H$.init($,I),$._zod.check=(_)=>{_.value=I.tx(_.value)}});class V_{constructor($=[]){if(this.content=[],this.indent=0,this)this.args=$}indented($){this.indent+=1,$(this),this.indent-=1}write($){if(typeof $==="function"){$(this,{execution:"sync"}),$(this,{execution:"async"});return}let _=$.split(`
|
|
274
274
|
`).filter((g)=>g),u=Math.min(..._.map((g)=>g.length-g.trimStart().length)),U=_.map((g)=>g.slice(u)).map((g)=>" ".repeat(this.indent*2)+g);for(let g of U)this.content.push(g)}compile(){let $=Function,I=this?.args,u=[...(this?.content??[""]).map((U)=>` ${U}`)];return new $(...I,u.join(`
|
|
275
|
-
`))}}var WG={major:4,minor:3,patch:6};var r=L("$ZodType",($,I)=>{var _;$??($={}),$._zod.def=I,$._zod.bag=$._zod.bag||{},$._zod.version=WG;let u=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))u.unshift($);for(let U of u)for(let g of U._zod.onattach)g($);if(u.length===0)(_=$._zod).deferred??(_.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let U=(z,G,J)=>{let X=T6(z),N;for(let q of G){if(q._zod.def.when){if(!q._zod.def.when(z))continue}else if(X)continue;let Q=z.issues.length,Y=q._zod.check(z);if(Y instanceof Promise&&J?.async===!1)throw new j4;if(N||Y instanceof Promise)N=(N??Promise.resolve()).then(async()=>{if(await Y,z.issues.length===Q)return;if(!X)X=T6(z,Q)});else{if(z.issues.length===Q)continue;if(!X)X=T6(z,Q)}}if(N)return N.then(()=>{return z});return z},g=(z,G,J)=>{if(T6(z))return z.aborted=!0,z;let X=U(G,u,J);if(X instanceof Promise){if(J.async===!1)throw new j4;return X.then((N)=>$._zod.parse(N,J))}return $._zod.parse(X,J)};$._zod.run=(z,G)=>{if(G.skipChecks)return $._zod.parse(z,G);if(G.direction==="backward"){let X=$._zod.parse({value:z.value,issues:[]},{...G,skipChecks:!0});if(X instanceof Promise)return X.then((N)=>{return g(N,z,G)});return g(X,z,G)}let J=$._zod.parse(z,G);if(J instanceof Promise){if(G.async===!1)throw new j4;return J.then((X)=>U(X,u,G))}return U(J,u,G)}}o($,"~standard",()=>({validate:(U)=>{try{let g=jz($,U);return g.success?{value:g.data}:{issues:g.error?.issues}}catch(g){return Fz($,U).then((z)=>z.success?{value:z.data}:{issues:z.error?.issues})}},vendor:"zod",version:1}))}),o6=L("$ZodString",($,I)=>{r.init($,I),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??sz($._zod.bag),$._zod.parse=(_,u)=>{if(I.coerce)try{_.value=String(_.value)}catch(U){}if(typeof _.value==="string")return _;return _.issues.push({expected:"string",code:"invalid_type",input:_.value,inst:$}),_}}),X$=L("$ZodStringFormat",($,I)=>{C1.init($,I),o6.init($,I)}),ZG=L("$ZodGUID",($,I)=>{I.pattern??(I.pattern=yz),X$.init($,I)}),bG=L("$ZodUUID",($,I)=>{if(I.version){let u={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[I.version];if(u===void 0)throw Error(`Invalid UUID version: "${I.version}"`);I.pattern??(I.pattern=d6(u))}else I.pattern??(I.pattern=d6());X$.init($,I)}),PG=L("$ZodEmail",($,I)=>{I.pattern??(I.pattern=lz),X$.init($,I)}),SG=L("$ZodURL",($,I)=>{X$.init($,I),$._zod.check=(_)=>{try{let u=_.value.trim(),U=new URL(u);if(I.hostname){if(I.hostname.lastIndex=0,!I.hostname.test(U.hostname))_.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:I.hostname.source,input:_.value,inst:$,continue:!I.abort})}if(I.protocol){if(I.protocol.lastIndex=0,!I.protocol.test(U.protocol.endsWith(":")?U.protocol.slice(0,-1):U.protocol))_.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:I.protocol.source,input:_.value,inst:$,continue:!I.abort})}if(I.normalize)_.value=U.href;else _.value=u;return}catch(u){_.issues.push({code:"invalid_format",format:"url",input:_.value,inst:$,continue:!I.abort})}}}),jG=L("$ZodEmoji",($,I)=>{I.pattern??(I.pattern=mz()),X$.init($,I)}),FG=L("$ZodNanoID",($,I)=>{I.pattern??(I.pattern=kz),X$.init($,I)}),wG=L("$ZodCUID",($,I)=>{I.pattern??(I.pattern=wz),X$.init($,I)}),EG=L("$ZodCUID2",($,I)=>{I.pattern??(I.pattern=Ez),X$.init($,I)}),CG=L("$ZodULID",($,I)=>{I.pattern??(I.pattern=Cz),X$.init($,I)}),fG=L("$ZodXID",($,I)=>{I.pattern??(I.pattern=fz),X$.init($,I)}),xG=L("$ZodKSUID",($,I)=>{I.pattern??(I.pattern=xz),X$.init($,I)}),kG=L("$ZodISODateTime",($,I)=>{I.pattern??(I.pattern=ez(I)),X$.init($,I)}),iG=L("$ZodISODate",($,I)=>{I.pattern??(I.pattern=tz),X$.init($,I)}),yG=L("$ZodISOTime",($,I)=>{I.pattern??(I.pattern=az(I)),X$.init($,I)}),lG=L("$ZodISODuration",($,I)=>{I.pattern??(I.pattern=iz),X$.init($,I)}),mG=L("$ZodIPv4",($,I)=>{I.pattern??(I.pattern=nz),X$.init($,I),$._zod.bag.format="ipv4"}),nG=L("$ZodIPv6",($,I)=>{I.pattern??(I.pattern=rz),X$.init($,I),$._zod.bag.format="ipv6",$._zod.check=(_)=>{try{new URL(`http://[${_.value}]`)}catch{_.issues.push({code:"invalid_format",format:"ipv6",input:_.value,inst:$,continue:!I.abort})}}}),rG=L("$ZodMAC",($,I)=>{I.pattern??(I.pattern=hz(I.delimiter)),X$.init($,I),$._zod.bag.format="mac"}),hG=L("$ZodCIDRv4",($,I)=>{I.pattern??(I.pattern=cz),X$.init($,I)}),cG=L("$ZodCIDRv6",($,I)=>{I.pattern??(I.pattern=dz),X$.init($,I),$._zod.check=(_)=>{let u=_.value.split("/");try{if(u.length!==2)throw Error();let[U,g]=u;if(!g)throw Error();let z=Number(g);if(`${z}`!==g)throw Error();if(z<0||z>128)throw Error();new URL(`http://[${U}]`)}catch{_.issues.push({code:"invalid_format",format:"cidrv6",input:_.value,inst:$,continue:!I.abort})}}});function dG($){if($==="")return!0;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}var oG=L("$ZodBase64",($,I)=>{I.pattern??(I.pattern=oz),X$.init($,I),$._zod.bag.contentEncoding="base64",$._zod.check=(_)=>{if(dG(_.value))return;_.issues.push({code:"invalid_format",format:"base64",input:_.value,inst:$,continue:!I.abort})}});function X7($){if(!Y_.test($))return!1;let I=$.replace(/[-_]/g,(u)=>u==="-"?"+":"/"),_=I.padEnd(Math.ceil(I.length/4)*4,"=");return dG(_)}var pG=L("$ZodBase64URL",($,I)=>{I.pattern??(I.pattern=Y_),X$.init($,I),$._zod.bag.contentEncoding="base64url",$._zod.check=(_)=>{if(X7(_.value))return;_.issues.push({code:"invalid_format",format:"base64url",input:_.value,inst:$,continue:!I.abort})}}),tG=L("$ZodE164",($,I)=>{I.pattern??(I.pattern=pz),X$.init($,I)});function q7($,I=null){try{let _=$.split(".");if(_.length!==3)return!1;let[u]=_;if(!u)return!1;let U=JSON.parse(atob(u));if("typ"in U&&U?.typ!=="JWT")return!1;if(!U.alg)return!1;if(I&&(!("alg"in U)||U.alg!==I))return!1;return!0}catch{return!1}}var aG=L("$ZodJWT",($,I)=>{X$.init($,I),$._zod.check=(_)=>{if(q7(_.value,I.alg))return;_.issues.push({code:"invalid_format",format:"jwt",input:_.value,inst:$,continue:!I.abort})}}),eG=L("$ZodCustomStringFormat",($,I)=>{X$.init($,I),$._zod.check=(_)=>{if(I.fn(_.value))return;_.issues.push({code:"invalid_format",format:I.format,input:_.value,inst:$,continue:!I.abort})}}),V_=L("$ZodNumber",($,I)=>{r.init($,I),$._zod.pattern=$._zod.bag.pattern??J0,$._zod.parse=(_,u)=>{if(I.coerce)try{_.value=Number(_.value)}catch(z){}let U=_.value;if(typeof U==="number"&&!Number.isNaN(U)&&Number.isFinite(U))return _;let g=typeof U==="number"?Number.isNaN(U)?"NaN":!Number.isFinite(U)?"Infinity":void 0:void 0;return _.issues.push({expected:"number",code:"invalid_type",input:U,inst:$,...g?{received:g}:{}}),_}}),sG=L("$ZodNumberFormat",($,I)=>{JG.init($,I),V_.init($,I)}),N0=L("$ZodBoolean",($,I)=>{r.init($,I),$._zod.pattern=UG,$._zod.parse=(_,u)=>{if(I.coerce)try{_.value=Boolean(_.value)}catch(g){}let U=_.value;if(typeof U==="boolean")return _;return _.issues.push({expected:"boolean",code:"invalid_type",input:U,inst:$}),_}}),R_=L("$ZodBigInt",($,I)=>{r.init($,I),$._zod.pattern=$G,$._zod.parse=(_,u)=>{if(I.coerce)try{_.value=BigInt(_.value)}catch(U){}if(typeof _.value==="bigint")return _;return _.issues.push({expected:"bigint",code:"invalid_type",input:_.value,inst:$}),_}}),$J=L("$ZodBigIntFormat",($,I)=>{XG.init($,I),R_.init($,I)}),IJ=L("$ZodSymbol",($,I)=>{r.init($,I),$._zod.parse=(_,u)=>{let U=_.value;if(typeof U==="symbol")return _;return _.issues.push({expected:"symbol",code:"invalid_type",input:U,inst:$}),_}}),UJ=L("$ZodUndefined",($,I)=>{r.init($,I),$._zod.pattern=uG,$._zod.values=new Set([void 0]),$._zod.optin="optional",$._zod.optout="optional",$._zod.parse=(_,u)=>{let U=_.value;if(typeof U>"u")return _;return _.issues.push({expected:"undefined",code:"invalid_type",input:U,inst:$}),_}}),_J=L("$ZodNull",($,I)=>{r.init($,I),$._zod.pattern=_G,$._zod.values=new Set([null]),$._zod.parse=(_,u)=>{let U=_.value;if(U===null)return _;return _.issues.push({expected:"null",code:"invalid_type",input:U,inst:$}),_}}),uJ=L("$ZodAny",($,I)=>{r.init($,I),$._zod.parse=(_)=>_}),gJ=L("$ZodUnknown",($,I)=>{r.init($,I),$._zod.parse=(_)=>_}),zJ=L("$ZodNever",($,I)=>{r.init($,I),$._zod.parse=(_,u)=>{return _.issues.push({expected:"never",code:"invalid_type",input:_.value,inst:$}),_}}),GJ=L("$ZodVoid",($,I)=>{r.init($,I),$._zod.parse=(_,u)=>{let U=_.value;if(typeof U>"u")return _;return _.issues.push({expected:"void",code:"invalid_type",input:U,inst:$}),_}}),JJ=L("$ZodDate",($,I)=>{r.init($,I),$._zod.parse=(_,u)=>{if(I.coerce)try{_.value=new Date(_.value)}catch(G){}let U=_.value,g=U instanceof Date;if(g&&!Number.isNaN(U.getTime()))return _;return _.issues.push({expected:"date",code:"invalid_type",input:U,...g?{received:"Invalid Date"}:{},inst:$}),_}});function eQ($,I,_){if($.issues.length)I.issues.push(...$4(_,$.issues));I.value[_]=$.value}var XJ=L("$ZodArray",($,I)=>{r.init($,I),$._zod.parse=(_,u)=>{let U=_.value;if(!Array.isArray(U))return _.issues.push({expected:"array",code:"invalid_type",input:U,inst:$}),_;_.value=Array(U.length);let g=[];for(let z=0;z<U.length;z++){let G=U[z],J=I.element._zod.run({value:G,issues:[]},u);if(J instanceof Promise)g.push(J.then((X)=>eQ(X,_,z)));else eQ(J,_,z)}if(g.length)return Promise.all(g).then(()=>_);return _}});function K_($,I,_,u,U){if($.issues.length){if(U&&!(_ in u))return;I.issues.push(...$4(_,$.issues))}if($.value===void 0){if(_ in u)I.value[_]=void 0}else I.value[_]=$.value}function N7($){let I=Object.keys($.shape);for(let u of I)if(!$.shape?.[u]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${u}": expected a Zod schema`);let _=Az($.shape);return{...$,keys:I,keySet:new Set(I),numKeys:I.length,optionalKeys:new Set(_)}}function Q7($,I,_,u,U,g){let z=[],G=U.keySet,J=U.catchall._zod,X=J.def.type,N=J.optout==="optional";for(let q in I){if(G.has(q))continue;if(X==="never"){z.push(q);continue}let Q=J.run({value:I[q],issues:[]},u);if(Q instanceof Promise)$.push(Q.then((Y)=>K_(Y,_,q,I,N)));else K_(Q,_,q,I,N)}if(z.length)_.issues.push({code:"unrecognized_keys",keys:z,input:I,inst:g});if(!$.length)return _;return Promise.all($).then(()=>{return _})}var H7=L("$ZodObject",($,I)=>{if(r.init($,I),!Object.getOwnPropertyDescriptor(I,"shape")?.get){let G=I.shape;Object.defineProperty(I,"shape",{get:()=>{let J={...G};return Object.defineProperty(I,"shape",{value:J}),J}})}let u=P1(()=>N7(I));o($._zod,"propValues",()=>{let G=I.shape,J={};for(let X in G){let N=G[X]._zod;if(N.values){J[X]??(J[X]=new Set);for(let q of N.values)J[X].add(q)}}return J});let U=c6,g=I.catchall,z;$._zod.parse=(G,J)=>{z??(z=u.value);let X=G.value;if(!U(X))return G.issues.push({expected:"object",code:"invalid_type",input:X,inst:$}),G;G.value={};let N=[],q=z.shape;for(let Q of z.keys){let Y=q[Q],O=Y._zod.optout==="optional",H=Y._zod.run({value:X[Q],issues:[]},J);if(H instanceof Promise)N.push(H.then((v)=>K_(v,G,Q,X,O)));else K_(H,G,Q,X,O)}if(!g)return N.length?Promise.all(N).then(()=>G):G;return Q7(N,X,G,J,u.value,$)}}),qJ=L("$ZodObjectJIT",($,I)=>{H7.init($,I);let _=$._zod.parse,u=P1(()=>N7(I)),U=(Q)=>{let Y=new T_(["shape","payload","ctx"]),O=u.value,H=(M)=>{let B=U_(M);return`shape[${B}]._zod.run({ value: input[${B}], issues: [] }, ctx)`};Y.write("const input = payload.value;");let v=Object.create(null),T=0;for(let M of O.keys)v[M]=`key_${T++}`;Y.write("const newResult = {};");for(let M of O.keys){let B=v[M],R=U_(M),D=Q[M]?._zod?.optout==="optional";if(Y.write(`const ${B} = ${H(M)};`),D)Y.write(`
|
|
275
|
+
`))}}var wG={major:4,minor:3,patch:6};var r=L("$ZodType",($,I)=>{var _;$??($={}),$._zod.def=I,$._zod.bag=$._zod.bag||{},$._zod.version=wG;let u=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))u.unshift($);for(let U of u)for(let g of U._zod.onattach)g($);if(u.length===0)(_=$._zod).deferred??(_.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let U=(z,G,J)=>{let X=D6(z),N;for(let q of G){if(q._zod.def.when){if(!q._zod.def.when(z))continue}else if(X)continue;let Q=z.issues.length,Y=q._zod.check(z);if(Y instanceof Promise&&J?.async===!1)throw new S4;if(N||Y instanceof Promise)N=(N??Promise.resolve()).then(async()=>{if(await Y,z.issues.length===Q)return;if(!X)X=D6(z,Q)});else{if(z.issues.length===Q)continue;if(!X)X=D6(z,Q)}}if(N)return N.then(()=>{return z});return z},g=(z,G,J)=>{if(D6(z))return z.aborted=!0,z;let X=U(G,u,J);if(X instanceof Promise){if(J.async===!1)throw new S4;return X.then((N)=>$._zod.parse(N,J))}return $._zod.parse(X,J)};$._zod.run=(z,G)=>{if(G.skipChecks)return $._zod.parse(z,G);if(G.direction==="backward"){let X=$._zod.parse({value:z.value,issues:[]},{...G,skipChecks:!0});if(X instanceof Promise)return X.then((N)=>{return g(N,z,G)});return g(X,z,G)}let J=$._zod.parse(z,G);if(J instanceof Promise){if(G.async===!1)throw new S4;return J.then((X)=>U(X,u,G))}return U(J,u,G)}}o($,"~standard",()=>({validate:(U)=>{try{let g=yz($,U);return g.success?{value:g.data}:{issues:g.error?.issues}}catch(g){return iz($,U).then((z)=>z.success?{value:z.data}:{issues:z.error?.issues})}},vendor:"zod",version:1}))}),a6=L("$ZodString",($,I)=>{r.init($,I),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??GG($._zod.bag),$._zod.parse=(_,u)=>{if(I.coerce)try{_.value=String(_.value)}catch(U){}if(typeof _.value==="string")return _;return _.issues.push({expected:"string",code:"invalid_type",input:_.value,inst:$}),_}}),q$=L("$ZodStringFormat",($,I)=>{k1.init($,I),a6.init($,I)}),CG=L("$ZodGUID",($,I)=>{I.pattern??(I.pattern=oz),q$.init($,I)}),fG=L("$ZodUUID",($,I)=>{if(I.version){let u={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[I.version];if(u===void 0)throw Error(`Invalid UUID version: "${I.version}"`);I.pattern??(I.pattern=t6(u))}else I.pattern??(I.pattern=t6());q$.init($,I)}),xG=L("$ZodEmail",($,I)=>{I.pattern??(I.pattern=pz),q$.init($,I)}),kG=L("$ZodURL",($,I)=>{q$.init($,I),$._zod.check=(_)=>{try{let u=_.value.trim(),U=new URL(u);if(I.hostname){if(I.hostname.lastIndex=0,!I.hostname.test(U.hostname))_.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:I.hostname.source,input:_.value,inst:$,continue:!I.abort})}if(I.protocol){if(I.protocol.lastIndex=0,!I.protocol.test(U.protocol.endsWith(":")?U.protocol.slice(0,-1):U.protocol))_.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:I.protocol.source,input:_.value,inst:$,continue:!I.abort})}if(I.normalize)_.value=U.href;else _.value=u;return}catch(u){_.issues.push({code:"invalid_format",format:"url",input:_.value,inst:$,continue:!I.abort})}}}),yG=L("$ZodEmoji",($,I)=>{I.pattern??(I.pattern=tz()),q$.init($,I)}),iG=L("$ZodNanoID",($,I)=>{I.pattern??(I.pattern=cz),q$.init($,I)}),lG=L("$ZodCUID",($,I)=>{I.pattern??(I.pattern=lz),q$.init($,I)}),mG=L("$ZodCUID2",($,I)=>{I.pattern??(I.pattern=mz),q$.init($,I)}),nG=L("$ZodULID",($,I)=>{I.pattern??(I.pattern=nz),q$.init($,I)}),rG=L("$ZodXID",($,I)=>{I.pattern??(I.pattern=rz),q$.init($,I)}),hG=L("$ZodKSUID",($,I)=>{I.pattern??(I.pattern=hz),q$.init($,I)}),cG=L("$ZodISODateTime",($,I)=>{I.pattern??(I.pattern=zG(I)),q$.init($,I)}),dG=L("$ZodISODate",($,I)=>{I.pattern??(I.pattern=uG),q$.init($,I)}),oG=L("$ZodISOTime",($,I)=>{I.pattern??(I.pattern=gG(I)),q$.init($,I)}),pG=L("$ZodISODuration",($,I)=>{I.pattern??(I.pattern=dz),q$.init($,I)}),tG=L("$ZodIPv4",($,I)=>{I.pattern??(I.pattern=az),q$.init($,I),$._zod.bag.format="ipv4"}),aG=L("$ZodIPv6",($,I)=>{I.pattern??(I.pattern=ez),q$.init($,I),$._zod.bag.format="ipv6",$._zod.check=(_)=>{try{new URL(`http://[${_.value}]`)}catch{_.issues.push({code:"invalid_format",format:"ipv6",input:_.value,inst:$,continue:!I.abort})}}}),eG=L("$ZodMAC",($,I)=>{I.pattern??(I.pattern=sz(I.delimiter)),q$.init($,I),$._zod.bag.format="mac"}),sG=L("$ZodCIDRv4",($,I)=>{I.pattern??(I.pattern=$G),q$.init($,I)}),$J=L("$ZodCIDRv6",($,I)=>{I.pattern??(I.pattern=IG),q$.init($,I),$._zod.check=(_)=>{let u=_.value.split("/");try{if(u.length!==2)throw Error();let[U,g]=u;if(!g)throw Error();let z=Number(g);if(`${z}`!==g)throw Error();if(z<0||z>128)throw Error();new URL(`http://[${U}]`)}catch{_.issues.push({code:"invalid_format",format:"cidrv6",input:_.value,inst:$,continue:!I.abort})}}});function IJ($){if($==="")return!0;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}var UJ=L("$ZodBase64",($,I)=>{I.pattern??(I.pattern=UG),q$.init($,I),$._zod.bag.contentEncoding="base64",$._zod.check=(_)=>{if(IJ(_.value))return;_.issues.push({code:"invalid_format",format:"base64",input:_.value,inst:$,continue:!I.abort})}});function v7($){if(!K_.test($))return!1;let I=$.replace(/[-_]/g,(u)=>u==="-"?"+":"/"),_=I.padEnd(Math.ceil(I.length/4)*4,"=");return IJ(_)}var _J=L("$ZodBase64URL",($,I)=>{I.pattern??(I.pattern=K_),q$.init($,I),$._zod.bag.contentEncoding="base64url",$._zod.check=(_)=>{if(v7(_.value))return;_.issues.push({code:"invalid_format",format:"base64url",input:_.value,inst:$,continue:!I.abort})}}),uJ=L("$ZodE164",($,I)=>{I.pattern??(I.pattern=_G),q$.init($,I)});function T7($,I=null){try{let _=$.split(".");if(_.length!==3)return!1;let[u]=_;if(!u)return!1;let U=JSON.parse(atob(u));if("typ"in U&&U?.typ!=="JWT")return!1;if(!U.alg)return!1;if(I&&(!("alg"in U)||U.alg!==I))return!1;return!0}catch{return!1}}var gJ=L("$ZodJWT",($,I)=>{q$.init($,I),$._zod.check=(_)=>{if(T7(_.value,I.alg))return;_.issues.push({code:"invalid_format",format:"jwt",input:_.value,inst:$,continue:!I.abort})}}),zJ=L("$ZodCustomStringFormat",($,I)=>{q$.init($,I),$._zod.check=(_)=>{if(I.fn(_.value))return;_.issues.push({code:"invalid_format",format:I.format,input:_.value,inst:$,continue:!I.abort})}}),S_=L("$ZodNumber",($,I)=>{r.init($,I),$._zod.pattern=$._zod.bag.pattern??O0,$._zod.parse=(_,u)=>{if(I.coerce)try{_.value=Number(_.value)}catch(z){}let U=_.value;if(typeof U==="number"&&!Number.isNaN(U)&&Number.isFinite(U))return _;let g=typeof U==="number"?Number.isNaN(U)?"NaN":!Number.isFinite(U)?"Infinity":void 0:void 0;return _.issues.push({expected:"number",code:"invalid_type",input:U,inst:$,...g?{received:g}:{}}),_}}),GJ=L("$ZodNumberFormat",($,I)=>{vG.init($,I),S_.init($,I)}),M0=L("$ZodBoolean",($,I)=>{r.init($,I),$._zod.pattern=qG,$._zod.parse=(_,u)=>{if(I.coerce)try{_.value=Boolean(_.value)}catch(g){}let U=_.value;if(typeof U==="boolean")return _;return _.issues.push({expected:"boolean",code:"invalid_type",input:U,inst:$}),_}}),F_=L("$ZodBigInt",($,I)=>{r.init($,I),$._zod.pattern=JG,$._zod.parse=(_,u)=>{if(I.coerce)try{_.value=BigInt(_.value)}catch(U){}if(typeof _.value==="bigint")return _;return _.issues.push({expected:"bigint",code:"invalid_type",input:_.value,inst:$}),_}}),JJ=L("$ZodBigIntFormat",($,I)=>{TG.init($,I),F_.init($,I)}),XJ=L("$ZodSymbol",($,I)=>{r.init($,I),$._zod.parse=(_,u)=>{let U=_.value;if(typeof U==="symbol")return _;return _.issues.push({expected:"symbol",code:"invalid_type",input:U,inst:$}),_}}),qJ=L("$ZodUndefined",($,I)=>{r.init($,I),$._zod.pattern=QG,$._zod.values=new Set([void 0]),$._zod.optin="optional",$._zod.optout="optional",$._zod.parse=(_,u)=>{let U=_.value;if(typeof U>"u")return _;return _.issues.push({expected:"undefined",code:"invalid_type",input:U,inst:$}),_}}),NJ=L("$ZodNull",($,I)=>{r.init($,I),$._zod.pattern=NG,$._zod.values=new Set([null]),$._zod.parse=(_,u)=>{let U=_.value;if(U===null)return _;return _.issues.push({expected:"null",code:"invalid_type",input:U,inst:$}),_}}),QJ=L("$ZodAny",($,I)=>{r.init($,I),$._zod.parse=(_)=>_}),HJ=L("$ZodUnknown",($,I)=>{r.init($,I),$._zod.parse=(_)=>_}),YJ=L("$ZodNever",($,I)=>{r.init($,I),$._zod.parse=(_,u)=>{return _.issues.push({expected:"never",code:"invalid_type",input:_.value,inst:$}),_}}),OJ=L("$ZodVoid",($,I)=>{r.init($,I),$._zod.parse=(_,u)=>{let U=_.value;if(typeof U>"u")return _;return _.issues.push({expected:"void",code:"invalid_type",input:U,inst:$}),_}}),vJ=L("$ZodDate",($,I)=>{r.init($,I),$._zod.parse=(_,u)=>{if(I.coerce)try{_.value=new Date(_.value)}catch(G){}let U=_.value,g=U instanceof Date;if(g&&!Number.isNaN(U.getTime()))return _;return _.issues.push({expected:"date",code:"invalid_type",input:U,...g?{received:"Invalid Date"}:{},inst:$}),_}});function g7($,I,_){if($.issues.length)I.issues.push(...$4(_,$.issues));I.value[_]=$.value}var TJ=L("$ZodArray",($,I)=>{r.init($,I),$._zod.parse=(_,u)=>{let U=_.value;if(!Array.isArray(U))return _.issues.push({expected:"array",code:"invalid_type",input:U,inst:$}),_;_.value=Array(U.length);let g=[];for(let z=0;z<U.length;z++){let G=U[z],J=I.element._zod.run({value:G,issues:[]},u);if(J instanceof Promise)g.push(J.then((X)=>g7(X,_,z)));else g7(J,_,z)}if(g.length)return Promise.all(g).then(()=>_);return _}});function j_($,I,_,u,U){if($.issues.length){if(U&&!(_ in u))return;I.issues.push(...$4(_,$.issues))}if($.value===void 0){if(_ in u)I.value[_]=void 0}else I.value[_]=$.value}function M7($){let I=Object.keys($.shape);for(let u of I)if(!$.shape?.[u]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${u}": expected a Zod schema`);let _=Ez($.shape);return{...$,keys:I,keySet:new Set(I),numKeys:I.length,optionalKeys:new Set(_)}}function D7($,I,_,u,U,g){let z=[],G=U.keySet,J=U.catchall._zod,X=J.def.type,N=J.optout==="optional";for(let q in I){if(G.has(q))continue;if(X==="never"){z.push(q);continue}let Q=J.run({value:I[q],issues:[]},u);if(Q instanceof Promise)$.push(Q.then((Y)=>j_(Y,_,q,I,N)));else j_(Q,_,q,I,N)}if(z.length)_.issues.push({code:"unrecognized_keys",keys:z,input:I,inst:g});if(!$.length)return _;return Promise.all($).then(()=>{return _})}var L7=L("$ZodObject",($,I)=>{if(r.init($,I),!Object.getOwnPropertyDescriptor(I,"shape")?.get){let G=I.shape;Object.defineProperty(I,"shape",{get:()=>{let J={...G};return Object.defineProperty(I,"shape",{value:J}),J}})}let u=F1(()=>M7(I));o($._zod,"propValues",()=>{let G=I.shape,J={};for(let X in G){let N=G[X]._zod;if(N.values){J[X]??(J[X]=new Set);for(let q of N.values)J[X].add(q)}}return J});let U=p6,g=I.catchall,z;$._zod.parse=(G,J)=>{z??(z=u.value);let X=G.value;if(!U(X))return G.issues.push({expected:"object",code:"invalid_type",input:X,inst:$}),G;G.value={};let N=[],q=z.shape;for(let Q of z.keys){let Y=q[Q],O=Y._zod.optout==="optional",H=Y._zod.run({value:X[Q],issues:[]},J);if(H instanceof Promise)N.push(H.then((v)=>j_(v,G,Q,X,O)));else j_(H,G,Q,X,O)}if(!g)return N.length?Promise.all(N).then(()=>G):G;return D7(N,X,G,J,u.value,$)}}),MJ=L("$ZodObjectJIT",($,I)=>{L7.init($,I);let _=$._zod.parse,u=F1(()=>M7(I)),U=(Q)=>{let Y=new V_(["shape","payload","ctx"]),O=u.value,H=(D)=>{let B=q_(D);return`shape[${B}]._zod.run({ value: input[${B}], issues: [] }, ctx)`};Y.write("const input = payload.value;");let v=Object.create(null),T=0;for(let D of O.keys)v[D]=`key_${T++}`;Y.write("const newResult = {};");for(let D of O.keys){let B=v[D],R=q_(D),M=Q[D]?._zod?.optout==="optional";if(Y.write(`const ${B} = ${H(D)};`),M)Y.write(`
|
|
276
276
|
if (${B}.issues.length) {
|
|
277
277
|
if (${R} in input) {
|
|
278
278
|
payload.issues = payload.issues.concat(${B}.issues.map(iss => ({
|
|
@@ -306,93 +306,95 @@ ${G}
|
|
|
306
306
|
newResult[${R}] = ${B}.value;
|
|
307
307
|
}
|
|
308
308
|
|
|
309
|
-
`)}Y.write("payload.value = newResult;"),Y.write("return payload;");let K=Y.compile();return(M,B)=>K(Q,M,B)},g,z=c6,G=!eI.jitless,X=G&&Vz.value,N=I.catchall,q;$._zod.parse=(Q,Y)=>{q??(q=u.value);let O=Q.value;if(!z(O))return Q.issues.push({expected:"object",code:"invalid_type",input:O,inst:$}),Q;if(G&&X&&Y?.async===!1&&Y.jitless!==!0){if(!g)g=U(I.shape);if(Q=g(Q,Y),!N)return Q;return Q7([],O,Q,Y,q,$)}return _(Q,Y)}});function sQ($,I,_,u){for(let g of $)if(g.issues.length===0)return I.value=g.value,I;let U=$.filter((g)=>!T6(g));if(U.length===1)return I.value=U[0].value,U[0];return I.issues.push({code:"invalid_union",input:I.value,inst:_,errors:$.map((g)=>g.issues.map((z)=>a$(z,u,K$())))}),I}var Q0=L("$ZodUnion",($,I)=>{r.init($,I),o($._zod,"optin",()=>I.options.some((U)=>U._zod.optin==="optional")?"optional":void 0),o($._zod,"optout",()=>I.options.some((U)=>U._zod.optout==="optional")?"optional":void 0),o($._zod,"values",()=>{if(I.options.every((U)=>U._zod.values))return new Set(I.options.flatMap((U)=>Array.from(U._zod.values)));return}),o($._zod,"pattern",()=>{if(I.options.every((U)=>U._zod.pattern)){let U=I.options.map((g)=>g._zod.pattern);return new RegExp(`^(${U.map((g)=>I0(g.source)).join("|")})$`)}return});let _=I.options.length===1,u=I.options[0]._zod.run;$._zod.parse=(U,g)=>{if(_)return u(U,g);let z=!1,G=[];for(let J of I.options){let X=J._zod.run({value:U.value,issues:[]},g);if(X instanceof Promise)G.push(X),z=!0;else{if(X.issues.length===0)return X;G.push(X)}}if(!z)return sQ(G,U,$,g);return Promise.all(G).then((J)=>{return sQ(J,U,$,g)})}});function $7($,I,_,u){let U=$.filter((g)=>g.issues.length===0);if(U.length===1)return I.value=U[0].value,I;if(U.length===0)I.issues.push({code:"invalid_union",input:I.value,inst:_,errors:$.map((g)=>g.issues.map((z)=>a$(z,u,K$())))});else I.issues.push({code:"invalid_union",input:I.value,inst:_,errors:[],inclusive:!1});return I}var NJ=L("$ZodXor",($,I)=>{Q0.init($,I),I.inclusive=!1;let _=I.options.length===1,u=I.options[0]._zod.run;$._zod.parse=(U,g)=>{if(_)return u(U,g);let z=!1,G=[];for(let J of I.options){let X=J._zod.run({value:U.value,issues:[]},g);if(X instanceof Promise)G.push(X),z=!0;else G.push(X)}if(!z)return $7(G,U,$,g);return Promise.all(G).then((J)=>{return $7(J,U,$,g)})}}),QJ=L("$ZodDiscriminatedUnion",($,I)=>{I.inclusive=!1,Q0.init($,I);let _=$._zod.parse;o($._zod,"propValues",()=>{let U={};for(let g of I.options){let z=g._zod.propValues;if(!z||Object.keys(z).length===0)throw Error(`Invalid discriminated union option at index "${I.options.indexOf(g)}"`);for(let[G,J]of Object.entries(z)){if(!U[G])U[G]=new Set;for(let X of J)U[G].add(X)}}return U});let u=P1(()=>{let U=I.options,g=new Map;for(let z of U){let G=z._zod.propValues?.[I.discriminator];if(!G||G.size===0)throw Error(`Invalid discriminated union option at index "${I.options.indexOf(z)}"`);for(let J of G){if(g.has(J))throw Error(`Duplicate discriminator value "${String(J)}"`);g.set(J,z)}}return g});$._zod.parse=(U,g)=>{let z=U.value;if(!c6(z))return U.issues.push({code:"invalid_type",expected:"object",input:z,inst:$}),U;let G=u.value.get(z?.[I.discriminator]);if(G)return G._zod.run(U,g);if(I.unionFallback)return _(U,g);return U.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:I.discriminator,input:z,path:[I.discriminator],inst:$}),U}}),HJ=L("$ZodIntersection",($,I)=>{r.init($,I),$._zod.parse=(_,u)=>{let U=_.value,g=I.left._zod.run({value:U,issues:[]},u),z=I.right._zod.run({value:U,issues:[]},u);if(g instanceof Promise||z instanceof Promise)return Promise.all([g,z]).then(([J,X])=>{return I7(_,J,X)});return I7(_,g,z)}});function AG($,I){if($===I)return{valid:!0,data:$};if($ instanceof Date&&I instanceof Date&&+$===+I)return{valid:!0,data:$};if(v6($)&&v6(I)){let _=Object.keys(I),u=Object.keys($).filter((g)=>_.indexOf(g)!==-1),U={...$,...I};for(let g of u){let z=AG($[g],I[g]);if(!z.valid)return{valid:!1,mergeErrorPath:[g,...z.mergeErrorPath]};U[g]=z.data}return{valid:!0,data:U}}if(Array.isArray($)&&Array.isArray(I)){if($.length!==I.length)return{valid:!1,mergeErrorPath:[]};let _=[];for(let u=0;u<$.length;u++){let U=$[u],g=I[u],z=AG(U,g);if(!z.valid)return{valid:!1,mergeErrorPath:[u,...z.mergeErrorPath]};_.push(z.data)}return{valid:!0,data:_}}return{valid:!1,mergeErrorPath:[]}}function I7($,I,_){let u=new Map,U;for(let G of I.issues)if(G.code==="unrecognized_keys"){U??(U=G);for(let J of G.keys){if(!u.has(J))u.set(J,{});u.get(J).l=!0}}else $.issues.push(G);for(let G of _.issues)if(G.code==="unrecognized_keys")for(let J of G.keys){if(!u.has(J))u.set(J,{});u.get(J).r=!0}else $.issues.push(G);let g=[...u].filter(([,G])=>G.l&&G.r).map(([G])=>G);if(g.length&&U)$.issues.push({...U,keys:g});if(T6($))return $;let z=AG(I.value,_.value);if(!z.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(z.mergeErrorPath)}`);return $.value=z.data,$}var W_=L("$ZodTuple",($,I)=>{r.init($,I);let _=I.items;$._zod.parse=(u,U)=>{let g=u.value;if(!Array.isArray(g))return u.issues.push({input:g,inst:$,expected:"tuple",code:"invalid_type"}),u;u.value=[];let z=[],G=[..._].reverse().findIndex((N)=>N._zod.optin!=="optional"),J=G===-1?0:_.length-G;if(!I.rest){let N=g.length>_.length,q=g.length<J-1;if(N||q)return u.issues.push({...N?{code:"too_big",maximum:_.length,inclusive:!0}:{code:"too_small",minimum:_.length},input:g,inst:$,origin:"array"}),u}let X=-1;for(let N of _){if(X++,X>=g.length){if(X>=J)continue}let q=N._zod.run({value:g[X],issues:[]},U);if(q instanceof Promise)z.push(q.then((Q)=>M_(Q,u,X)));else M_(q,u,X)}if(I.rest){let N=g.slice(_.length);for(let q of N){X++;let Q=I.rest._zod.run({value:q,issues:[]},U);if(Q instanceof Promise)z.push(Q.then((Y)=>M_(Y,u,X)));else M_(Q,u,X)}}if(z.length)return Promise.all(z).then(()=>u);return u}});function M_($,I,_){if($.issues.length)I.issues.push(...$4(_,$.issues));I.value[_]=$.value}var YJ=L("$ZodRecord",($,I)=>{r.init($,I),$._zod.parse=(_,u)=>{let U=_.value;if(!v6(U))return _.issues.push({expected:"record",code:"invalid_type",input:U,inst:$}),_;let g=[],z=I.keyType._zod.values;if(z){_.value={};let G=new Set;for(let X of z)if(typeof X==="string"||typeof X==="number"||typeof X==="symbol"){G.add(typeof X==="number"?X.toString():X);let N=I.valueType._zod.run({value:U[X],issues:[]},u);if(N instanceof Promise)g.push(N.then((q)=>{if(q.issues.length)_.issues.push(...$4(X,q.issues));_.value[X]=q.value}));else{if(N.issues.length)_.issues.push(...$4(X,N.issues));_.value[X]=N.value}}let J;for(let X in U)if(!G.has(X))J=J??[],J.push(X);if(J&&J.length>0)_.issues.push({code:"unrecognized_keys",input:U,inst:$,keys:J})}else{_.value={};for(let G of Reflect.ownKeys(U)){if(G==="__proto__")continue;let J=I.keyType._zod.run({value:G,issues:[]},u);if(J instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof G==="string"&&J0.test(G)&&J.issues.length){let q=I.keyType._zod.run({value:Number(G),issues:[]},u);if(q instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(q.issues.length===0)J=q}if(J.issues.length){if(I.mode==="loose")_.value[G]=U[G];else _.issues.push({code:"invalid_key",origin:"record",issues:J.issues.map((q)=>a$(q,u,K$())),input:G,path:[G],inst:$});continue}let N=I.valueType._zod.run({value:U[G],issues:[]},u);if(N instanceof Promise)g.push(N.then((q)=>{if(q.issues.length)_.issues.push(...$4(G,q.issues));_.value[J.value]=q.value}));else{if(N.issues.length)_.issues.push(...$4(G,N.issues));_.value[J.value]=N.value}}}if(g.length)return Promise.all(g).then(()=>_);return _}}),OJ=L("$ZodMap",($,I)=>{r.init($,I),$._zod.parse=(_,u)=>{let U=_.value;if(!(U instanceof Map))return _.issues.push({expected:"map",code:"invalid_type",input:U,inst:$}),_;let g=[];_.value=new Map;for(let[z,G]of U){let J=I.keyType._zod.run({value:z,issues:[]},u),X=I.valueType._zod.run({value:G,issues:[]},u);if(J instanceof Promise||X instanceof Promise)g.push(Promise.all([J,X]).then(([N,q])=>{U7(N,q,_,z,U,$,u)}));else U7(J,X,_,z,U,$,u)}if(g.length)return Promise.all(g).then(()=>_);return _}});function U7($,I,_,u,U,g,z){if($.issues.length)if(U0.has(typeof u))_.issues.push(...$4(u,$.issues));else _.issues.push({code:"invalid_key",origin:"map",input:U,inst:g,issues:$.issues.map((G)=>a$(G,z,K$()))});if(I.issues.length)if(U0.has(typeof u))_.issues.push(...$4(u,I.issues));else _.issues.push({origin:"map",code:"invalid_element",input:U,inst:g,key:u,issues:I.issues.map((G)=>a$(G,z,K$()))});_.value.set($.value,I.value)}var vJ=L("$ZodSet",($,I)=>{r.init($,I),$._zod.parse=(_,u)=>{let U=_.value;if(!(U instanceof Set))return _.issues.push({input:U,inst:$,expected:"set",code:"invalid_type"}),_;let g=[];_.value=new Set;for(let z of U){let G=I.valueType._zod.run({value:z,issues:[]},u);if(G instanceof Promise)g.push(G.then((J)=>_7(J,_)));else _7(G,_)}if(g.length)return Promise.all(g).then(()=>_);return _}});function _7($,I){if($.issues.length)I.issues.push(...$.issues);I.value.add($.value)}var TJ=L("$ZodEnum",($,I)=>{r.init($,I);let _=$0(I.entries),u=new Set(_);$._zod.values=u,$._zod.pattern=new RegExp(`^(${_.filter((U)=>U0.has(typeof U)).map((U)=>typeof U==="string"?q4(U):U.toString()).join("|")})$`),$._zod.parse=(U,g)=>{let z=U.value;if(u.has(z))return U;return U.issues.push({code:"invalid_value",values:_,input:z,inst:$}),U}}),MJ=L("$ZodLiteral",($,I)=>{if(r.init($,I),I.values.length===0)throw Error("Cannot create literal schema with no valid values");let _=new Set(I.values);$._zod.values=_,$._zod.pattern=new RegExp(`^(${I.values.map((u)=>typeof u==="string"?q4(u):u?q4(u.toString()):String(u)).join("|")})$`),$._zod.parse=(u,U)=>{let g=u.value;if(_.has(g))return u;return u.issues.push({code:"invalid_value",values:I.values,input:g,inst:$}),u}}),DJ=L("$ZodFile",($,I)=>{r.init($,I),$._zod.parse=(_,u)=>{let U=_.value;if(U instanceof File)return _;return _.issues.push({expected:"file",code:"invalid_type",input:U,inst:$}),_}}),LJ=L("$ZodTransform",($,I)=>{r.init($,I),$._zod.parse=(_,u)=>{if(u.direction==="backward")throw new h6($.constructor.name);let U=I.transform(_.value,_);if(u.async)return(U instanceof Promise?U:Promise.resolve(U)).then((z)=>{return _.value=z,_});if(U instanceof Promise)throw new j4;return _.value=U,_}});function u7($,I){if($.issues.length&&I===void 0)return{issues:[],value:void 0};return $}var A_=L("$ZodOptional",($,I)=>{r.init($,I),$._zod.optin="optional",$._zod.optout="optional",o($._zod,"values",()=>{return I.innerType._zod.values?new Set([...I.innerType._zod.values,void 0]):void 0}),o($._zod,"pattern",()=>{let _=I.innerType._zod.pattern;return _?new RegExp(`^(${I0(_.source)})?$`):void 0}),$._zod.parse=(_,u)=>{if(I.innerType._zod.optin==="optional"){let U=I.innerType._zod.run(_,u);if(U instanceof Promise)return U.then((g)=>u7(g,_.value));return u7(U,_.value)}if(_.value===void 0)return _;return I.innerType._zod.run(_,u)}}),BJ=L("$ZodExactOptional",($,I)=>{A_.init($,I),o($._zod,"values",()=>I.innerType._zod.values),o($._zod,"pattern",()=>I.innerType._zod.pattern),$._zod.parse=(_,u)=>{return I.innerType._zod.run(_,u)}}),KJ=L("$ZodNullable",($,I)=>{r.init($,I),o($._zod,"optin",()=>I.innerType._zod.optin),o($._zod,"optout",()=>I.innerType._zod.optout),o($._zod,"pattern",()=>{let _=I.innerType._zod.pattern;return _?new RegExp(`^(${I0(_.source)}|null)$`):void 0}),o($._zod,"values",()=>{return I.innerType._zod.values?new Set([...I.innerType._zod.values,null]):void 0}),$._zod.parse=(_,u)=>{if(_.value===null)return _;return I.innerType._zod.run(_,u)}}),VJ=L("$ZodDefault",($,I)=>{r.init($,I),$._zod.optin="optional",o($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(_,u)=>{if(u.direction==="backward")return I.innerType._zod.run(_,u);if(_.value===void 0)return _.value=I.defaultValue,_;let U=I.innerType._zod.run(_,u);if(U instanceof Promise)return U.then((g)=>g7(g,I));return g7(U,I)}});function g7($,I){if($.value===void 0)$.value=I.defaultValue;return $}var RJ=L("$ZodPrefault",($,I)=>{r.init($,I),$._zod.optin="optional",o($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(_,u)=>{if(u.direction==="backward")return I.innerType._zod.run(_,u);if(_.value===void 0)_.value=I.defaultValue;return I.innerType._zod.run(_,u)}}),WJ=L("$ZodNonOptional",($,I)=>{r.init($,I),o($._zod,"values",()=>{let _=I.innerType._zod.values;return _?new Set([..._].filter((u)=>u!==void 0)):void 0}),$._zod.parse=(_,u)=>{let U=I.innerType._zod.run(_,u);if(U instanceof Promise)return U.then((g)=>z7(g,$));return z7(U,$)}});function z7($,I){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:I});return $}var AJ=L("$ZodSuccess",($,I)=>{r.init($,I),$._zod.parse=(_,u)=>{if(u.direction==="backward")throw new h6("ZodSuccess");let U=I.innerType._zod.run(_,u);if(U instanceof Promise)return U.then((g)=>{return _.value=g.issues.length===0,_});return _.value=U.issues.length===0,_}}),ZJ=L("$ZodCatch",($,I)=>{r.init($,I),o($._zod,"optin",()=>I.innerType._zod.optin),o($._zod,"optout",()=>I.innerType._zod.optout),o($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(_,u)=>{if(u.direction==="backward")return I.innerType._zod.run(_,u);let U=I.innerType._zod.run(_,u);if(U instanceof Promise)return U.then((g)=>{if(_.value=g.value,g.issues.length)_.value=I.catchValue({..._,error:{issues:g.issues.map((z)=>a$(z,u,K$()))},input:_.value}),_.issues=[];return _});if(_.value=U.value,U.issues.length)_.value=I.catchValue({..._,error:{issues:U.issues.map((g)=>a$(g,u,K$()))},input:_.value}),_.issues=[];return _}}),bJ=L("$ZodNaN",($,I)=>{r.init($,I),$._zod.parse=(_,u)=>{if(typeof _.value!=="number"||!Number.isNaN(_.value))return _.issues.push({input:_.value,inst:$,expected:"nan",code:"invalid_type"}),_;return _}}),PJ=L("$ZodPipe",($,I)=>{r.init($,I),o($._zod,"values",()=>I.in._zod.values),o($._zod,"optin",()=>I.in._zod.optin),o($._zod,"optout",()=>I.out._zod.optout),o($._zod,"propValues",()=>I.in._zod.propValues),$._zod.parse=(_,u)=>{if(u.direction==="backward"){let g=I.out._zod.run(_,u);if(g instanceof Promise)return g.then((z)=>D_(z,I.in,u));return D_(g,I.in,u)}let U=I.in._zod.run(_,u);if(U instanceof Promise)return U.then((g)=>D_(g,I.out,u));return D_(U,I.out,u)}});function D_($,I,_){if($.issues.length)return $.aborted=!0,$;return I._zod.run({value:$.value,issues:$.issues},_)}var H0=L("$ZodCodec",($,I)=>{r.init($,I),o($._zod,"values",()=>I.in._zod.values),o($._zod,"optin",()=>I.in._zod.optin),o($._zod,"optout",()=>I.out._zod.optout),o($._zod,"propValues",()=>I.in._zod.propValues),$._zod.parse=(_,u)=>{if((u.direction||"forward")==="forward"){let g=I.in._zod.run(_,u);if(g instanceof Promise)return g.then((z)=>L_(z,I,u));return L_(g,I,u)}else{let g=I.out._zod.run(_,u);if(g instanceof Promise)return g.then((z)=>L_(z,I,u));return L_(g,I,u)}}});function L_($,I,_){if($.issues.length)return $.aborted=!0,$;if((_.direction||"forward")==="forward"){let U=I.transform($.value,$);if(U instanceof Promise)return U.then((g)=>B_($,g,I.out,_));return B_($,U,I.out,_)}else{let U=I.reverseTransform($.value,$);if(U instanceof Promise)return U.then((g)=>B_($,g,I.in,_));return B_($,U,I.in,_)}}function B_($,I,_,u){if($.issues.length)return $.aborted=!0,$;return _._zod.run({value:I,issues:$.issues},u)}var SJ=L("$ZodReadonly",($,I)=>{r.init($,I),o($._zod,"propValues",()=>I.innerType._zod.propValues),o($._zod,"values",()=>I.innerType._zod.values),o($._zod,"optin",()=>I.innerType?._zod?.optin),o($._zod,"optout",()=>I.innerType?._zod?.optout),$._zod.parse=(_,u)=>{if(u.direction==="backward")return I.innerType._zod.run(_,u);let U=I.innerType._zod.run(_,u);if(U instanceof Promise)return U.then(G7);return G7(U)}});function G7($){return $.value=Object.freeze($.value),$}var jJ=L("$ZodTemplateLiteral",($,I)=>{r.init($,I);let _=[];for(let u of I.parts)if(typeof u==="object"&&u!==null){if(!u._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...u._zod.traits].shift()}`);let U=u._zod.pattern instanceof RegExp?u._zod.pattern.source:u._zod.pattern;if(!U)throw Error(`Invalid template literal part: ${u._zod.traits}`);let g=U.startsWith("^")?1:0,z=U.endsWith("$")?U.length-1:U.length;_.push(U.slice(g,z))}else if(u===null||Wz.has(typeof u))_.push(q4(`${u}`));else throw Error(`Invalid template literal part: ${u}`);$._zod.pattern=new RegExp(`^${_.join("")}$`),$._zod.parse=(u,U)=>{if(typeof u.value!=="string")return u.issues.push({input:u.value,inst:$,expected:"string",code:"invalid_type"}),u;if($._zod.pattern.lastIndex=0,!$._zod.pattern.test(u.value))return u.issues.push({input:u.value,inst:$,code:"invalid_format",format:I.format??"template_literal",pattern:$._zod.pattern.source}),u;return u}}),FJ=L("$ZodFunction",($,I)=>{return r.init($,I),$._def=I,$._zod.def=I,$.implement=(_)=>{if(typeof _!=="function")throw Error("implement() must be called with a function");return function(...u){let U=$._def.input?u_($._def.input,u):u,g=Reflect.apply(_,this,U);if($._def.output)return u_($._def.output,g);return g}},$.implementAsync=(_)=>{if(typeof _!=="function")throw Error("implementAsync() must be called with a function");return async function(...u){let U=$._def.input?await g_($._def.input,u):u,g=await Reflect.apply(_,this,U);if($._def.output)return await g_($._def.output,g);return g}},$._zod.parse=(_,u)=>{if(typeof _.value!=="function")return _.issues.push({code:"invalid_type",expected:"function",input:_.value,inst:$}),_;if($._def.output&&$._def.output._zod.def.type==="promise")_.value=$.implementAsync(_.value);else _.value=$.implement(_.value);return _},$.input=(..._)=>{let u=$.constructor;if(Array.isArray(_[0]))return new u({type:"function",input:new W_({type:"tuple",items:_[0],rest:_[1]}),output:$._def.output});return new u({type:"function",input:_[0],output:$._def.output})},$.output=(_)=>{return new $.constructor({type:"function",input:$._def.input,output:_})},$}),wJ=L("$ZodPromise",($,I)=>{r.init($,I),$._zod.parse=(_,u)=>{return Promise.resolve(_.value).then((U)=>I.innerType._zod.run({value:U,issues:[]},u))}}),EJ=L("$ZodLazy",($,I)=>{r.init($,I),o($._zod,"innerType",()=>I.getter()),o($._zod,"pattern",()=>$._zod.innerType?._zod?.pattern),o($._zod,"propValues",()=>$._zod.innerType?._zod?.propValues),o($._zod,"optin",()=>$._zod.innerType?._zod?.optin??void 0),o($._zod,"optout",()=>$._zod.innerType?._zod?.optout??void 0),$._zod.parse=(_,u)=>{return $._zod.innerType._zod.run(_,u)}}),CJ=L("$ZodCustom",($,I)=>{Q$.init($,I),r.init($,I),$._zod.parse=(_,u)=>{return _},$._zod.check=(_)=>{let u=_.value,U=I.fn(u);if(U instanceof Promise)return U.then((g)=>J7(g,_,u,$));J7(U,_,u,$);return}});function J7($,I,_,u){if(!$){let U={code:"custom",input:_,inst:u,path:[...u._zod.def.path??[]],continue:!u._zod.def.abort};if(u._zod.def.params)U.params=u._zod.def.params;I.issues.push(S1(U))}}var M0={};b4(M0,{zhTW:()=>A8,zhCN:()=>W8,yo:()=>Z8,vi:()=>R8,uz:()=>V8,ur:()=>K8,uk:()=>T0,ua:()=>B8,tr:()=>L8,th:()=>D8,ta:()=>M8,sv:()=>T8,sl:()=>v8,ru:()=>O8,pt:()=>Y8,ps:()=>Q8,pl:()=>H8,ota:()=>N8,no:()=>q8,nl:()=>X8,ms:()=>J8,mk:()=>G8,lt:()=>z8,ko:()=>g8,km:()=>O0,kh:()=>u8,ka:()=>_8,ja:()=>U8,it:()=>I8,is:()=>$8,id:()=>sJ,hy:()=>eJ,hu:()=>aJ,he:()=>tJ,frCA:()=>pJ,fr:()=>oJ,fi:()=>dJ,fa:()=>cJ,es:()=>hJ,eo:()=>rJ,en:()=>Y0,de:()=>nJ,da:()=>mJ,cs:()=>lJ,ca:()=>yJ,bg:()=>iJ,be:()=>kJ,az:()=>xJ,ar:()=>fJ});var SP=()=>{let $={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function I(U){return $[U]??null}let _={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"},u={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`مدخلات غير مقبولة: يفترض إدخال instanceof ${U.expected}، ولكن تم إدخال ${G}`;return`مدخلات غير مقبولة: يفترض إدخال ${g}، ولكن تم إدخال ${G}`}case"invalid_value":if(U.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${b(U.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${W(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return` أكبر من اللازم: يفترض أن تكون ${U.origin??"القيمة"} ${g} ${U.maximum.toString()} ${z.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${U.origin??"القيمة"} ${g} ${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`أصغر من اللازم: يفترض لـ ${U.origin} أن يكون ${g} ${U.minimum.toString()} ${z.unit}`;return`أصغر من اللازم: يفترض لـ ${U.origin} أن يكون ${g} ${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${U.prefix}"`;if(g.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${g.suffix}"`;if(g.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${g.includes}"`;if(g.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${g.pattern}`;return`${_[g.format]??U.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${U.divisor}`;case"unrecognized_keys":return`معرف${U.keys.length>1?"ات":""} غريب${U.keys.length>1?"ة":""}: ${W(U.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${U.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${U.origin}`;default:return"مدخل غير مقبول"}}};function fJ(){return{localeError:SP()}}var jP=()=>{let $={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function I(U){return $[U]??null}let _={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},u={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Yanlış dəyər: gözlənilən instanceof ${U.expected}, daxil olan ${G}`;return`Yanlış dəyər: gözlənilən ${g}, daxil olan ${G}`}case"invalid_value":if(U.values.length===1)return`Yanlış dəyər: gözlənilən ${b(U.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${W(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`Çox böyük: gözlənilən ${U.origin??"dəyər"} ${g}${U.maximum.toString()} ${z.unit??"element"}`;return`Çox böyük: gözlənilən ${U.origin??"dəyər"} ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`Çox kiçik: gözlənilən ${U.origin} ${g}${U.minimum.toString()} ${z.unit}`;return`Çox kiçik: gözlənilən ${U.origin} ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Yanlış mətn: "${g.prefix}" ilə başlamalıdır`;if(g.format==="ends_with")return`Yanlış mətn: "${g.suffix}" ilə bitməlidir`;if(g.format==="includes")return`Yanlış mətn: "${g.includes}" daxil olmalıdır`;if(g.format==="regex")return`Yanlış mətn: ${g.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${_[g.format]??U.format}`}case"not_multiple_of":return`Yanlış ədəd: ${U.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${U.keys.length>1?"lar":""}: ${W(U.keys,", ")}`;case"invalid_key":return`${U.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${U.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function xJ(){return{localeError:jP()}}function Y7($,I,_,u){let U=Math.abs($),g=U%10,z=U%100;if(z>=11&&z<=19)return u;if(g===1)return I;if(g>=2&&g<=4)return _;return u}var FP=()=>{let $={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function I(U){return $[U]??null}let _={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"},u={nan:"NaN",number:"лік",array:"масіў"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Няправільны ўвод: чакаўся instanceof ${U.expected}, атрымана ${G}`;return`Няправільны ўвод: чакаўся ${g}, атрымана ${G}`}case"invalid_value":if(U.values.length===1)return`Няправільны ўвод: чакалася ${b(U.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${W(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z){let G=Number(U.maximum),J=Y7(G,z.unit.one,z.unit.few,z.unit.many);return`Занадта вялікі: чакалася, што ${U.origin??"значэнне"} павінна ${z.verb} ${g}${U.maximum.toString()} ${J}`}return`Занадта вялікі: чакалася, што ${U.origin??"значэнне"} павінна быць ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z){let G=Number(U.minimum),J=Y7(G,z.unit.one,z.unit.few,z.unit.many);return`Занадта малы: чакалася, што ${U.origin} павінна ${z.verb} ${g}${U.minimum.toString()} ${J}`}return`Занадта малы: чакалася, што ${U.origin} павінна быць ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Няправільны радок: павінен пачынацца з "${g.prefix}"`;if(g.format==="ends_with")return`Няправільны радок: павінен заканчвацца на "${g.suffix}"`;if(g.format==="includes")return`Няправільны радок: павінен змяшчаць "${g.includes}"`;if(g.format==="regex")return`Няправільны радок: павінен адпавядаць шаблону ${g.pattern}`;return`Няправільны ${_[g.format]??U.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${U.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${U.keys.length>1?"ключы":"ключ"}: ${W(U.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${U.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${U.origin}`;default:return"Няправільны ўвод"}}};function kJ(){return{localeError:FP()}}var wP=()=>{let $={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function I(U){return $[U]??null}let _={regex:"вход",email:"имейл адрес",url:"URL",emoji:"емоджи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO време",date:"ISO дата",time:"ISO време",duration:"ISO продължителност",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"base64-кодиран низ",base64url:"base64url-кодиран низ",json_string:"JSON низ",e164:"E.164 номер",jwt:"JWT",template_literal:"вход"},u={nan:"NaN",number:"число",array:"масив"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Невалиден вход: очакван instanceof ${U.expected}, получен ${G}`;return`Невалиден вход: очакван ${g}, получен ${G}`}case"invalid_value":if(U.values.length===1)return`Невалиден вход: очакван ${b(U.values[0])}`;return`Невалидна опция: очаквано едно от ${W(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`Твърде голямо: очаква се ${U.origin??"стойност"} да съдържа ${g}${U.maximum.toString()} ${z.unit??"елемента"}`;return`Твърде голямо: очаква се ${U.origin??"стойност"} да бъде ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`Твърде малко: очаква се ${U.origin} да съдържа ${g}${U.minimum.toString()} ${z.unit}`;return`Твърде малко: очаква се ${U.origin} да бъде ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Невалиден низ: трябва да започва с "${g.prefix}"`;if(g.format==="ends_with")return`Невалиден низ: трябва да завършва с "${g.suffix}"`;if(g.format==="includes")return`Невалиден низ: трябва да включва "${g.includes}"`;if(g.format==="regex")return`Невалиден низ: трябва да съвпада с ${g.pattern}`;let z="Невалиден";if(g.format==="emoji")z="Невалидно";if(g.format==="datetime")z="Невалидно";if(g.format==="date")z="Невалидна";if(g.format==="time")z="Невалидно";if(g.format==="duration")z="Невалидна";return`${z} ${_[g.format]??U.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${U.divisor}`;case"unrecognized_keys":return`Неразпознат${U.keys.length>1?"и":""} ключ${U.keys.length>1?"ове":""}: ${W(U.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${U.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${U.origin}`;default:return"Невалиден вход"}}};function iJ(){return{localeError:wP()}}var EP=()=>{let $={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function I(U){return $[U]??null}let _={regex:"entrada",email:"adreça electrònica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},u={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Tipus invàlid: s'esperava instanceof ${U.expected}, s'ha rebut ${G}`;return`Tipus invàlid: s'esperava ${g}, s'ha rebut ${G}`}case"invalid_value":if(U.values.length===1)return`Valor invàlid: s'esperava ${b(U.values[0])}`;return`Opció invàlida: s'esperava una de ${W(U.values," o ")}`;case"too_big":{let g=U.inclusive?"com a màxim":"menys de",z=I(U.origin);if(z)return`Massa gran: s'esperava que ${U.origin??"el valor"} contingués ${g} ${U.maximum.toString()} ${z.unit??"elements"}`;return`Massa gran: s'esperava que ${U.origin??"el valor"} fos ${g} ${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?"com a mínim":"més de",z=I(U.origin);if(z)return`Massa petit: s'esperava que ${U.origin} contingués ${g} ${U.minimum.toString()} ${z.unit}`;return`Massa petit: s'esperava que ${U.origin} fos ${g} ${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Format invàlid: ha de començar amb "${g.prefix}"`;if(g.format==="ends_with")return`Format invàlid: ha d'acabar amb "${g.suffix}"`;if(g.format==="includes")return`Format invàlid: ha d'incloure "${g.includes}"`;if(g.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${g.pattern}`;return`Format invàlid per a ${_[g.format]??U.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${U.divisor}`;case"unrecognized_keys":return`Clau${U.keys.length>1?"s":""} no reconeguda${U.keys.length>1?"s":""}: ${W(U.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${U.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${U.origin}`;default:return"Entrada invàlida"}}};function yJ(){return{localeError:EP()}}var CP=()=>{let $={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function I(U){return $[U]??null}let _={regex:"regulární výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"},u={nan:"NaN",number:"číslo",string:"řetězec",function:"funkce",array:"pole"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Neplatný vstup: očekáváno instanceof ${U.expected}, obdrženo ${G}`;return`Neplatný vstup: očekáváno ${g}, obdrženo ${G}`}case"invalid_value":if(U.values.length===1)return`Neplatný vstup: očekáváno ${b(U.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${W(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`Hodnota je příliš velká: ${U.origin??"hodnota"} musí mít ${g}${U.maximum.toString()} ${z.unit??"prvků"}`;return`Hodnota je příliš velká: ${U.origin??"hodnota"} musí být ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`Hodnota je příliš malá: ${U.origin??"hodnota"} musí mít ${g}${U.minimum.toString()} ${z.unit??"prvků"}`;return`Hodnota je příliš malá: ${U.origin??"hodnota"} musí být ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Neplatný řetězec: musí začínat na "${g.prefix}"`;if(g.format==="ends_with")return`Neplatný řetězec: musí končit na "${g.suffix}"`;if(g.format==="includes")return`Neplatný řetězec: musí obsahovat "${g.includes}"`;if(g.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${g.pattern}`;return`Neplatný formát ${_[g.format]??U.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${U.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${W(U.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${U.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${U.origin}`;default:return"Neplatný vstup"}}};function lJ(){return{localeError:CP()}}var fP=()=>{let $={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function I(U){return $[U]??null}let _={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslæt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},u={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Ugyldigt input: forventede instanceof ${U.expected}, fik ${G}`;return`Ugyldigt input: forventede ${g}, fik ${G}`}case"invalid_value":if(U.values.length===1)return`Ugyldig værdi: forventede ${b(U.values[0])}`;return`Ugyldigt valg: forventede en af følgende ${W(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin),G=u[U.origin]??U.origin;if(z)return`For stor: forventede ${G??"value"} ${z.verb} ${g} ${U.maximum.toString()} ${z.unit??"elementer"}`;return`For stor: forventede ${G??"value"} havde ${g} ${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin),G=u[U.origin]??U.origin;if(z)return`For lille: forventede ${G} ${z.verb} ${g} ${U.minimum.toString()} ${z.unit}`;return`For lille: forventede ${G} havde ${g} ${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Ugyldig streng: skal starte med "${g.prefix}"`;if(g.format==="ends_with")return`Ugyldig streng: skal ende med "${g.suffix}"`;if(g.format==="includes")return`Ugyldig streng: skal indeholde "${g.includes}"`;if(g.format==="regex")return`Ugyldig streng: skal matche mønsteret ${g.pattern}`;return`Ugyldig ${_[g.format]??U.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${U.divisor}`;case"unrecognized_keys":return`${U.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${W(U.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${U.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${U.origin}`;default:return"Ugyldigt input"}}};function mJ(){return{localeError:fP()}}var xP=()=>{let $={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function I(U){return $[U]??null}let _={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},u={nan:"NaN",number:"Zahl",array:"Array"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Ungültige Eingabe: erwartet instanceof ${U.expected}, erhalten ${G}`;return`Ungültige Eingabe: erwartet ${g}, erhalten ${G}`}case"invalid_value":if(U.values.length===1)return`Ungültige Eingabe: erwartet ${b(U.values[0])}`;return`Ungültige Option: erwartet eine von ${W(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`Zu groß: erwartet, dass ${U.origin??"Wert"} ${g}${U.maximum.toString()} ${z.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${U.origin??"Wert"} ${g}${U.maximum.toString()} ist`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`Zu klein: erwartet, dass ${U.origin} ${g}${U.minimum.toString()} ${z.unit} hat`;return`Zu klein: erwartet, dass ${U.origin} ${g}${U.minimum.toString()} ist`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Ungültiger String: muss mit "${g.prefix}" beginnen`;if(g.format==="ends_with")return`Ungültiger String: muss mit "${g.suffix}" enden`;if(g.format==="includes")return`Ungültiger String: muss "${g.includes}" enthalten`;if(g.format==="regex")return`Ungültiger String: muss dem Muster ${g.pattern} entsprechen`;return`Ungültig: ${_[g.format]??U.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${U.divisor} sein`;case"unrecognized_keys":return`${U.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${W(U.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${U.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${U.origin}`;default:return"Ungültige Eingabe"}}};function nJ(){return{localeError:xP()}}var kP=()=>{let $={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function I(U){return $[U]??null}let _={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},u={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;return`Invalid input: expected ${g}, received ${G}`}case"invalid_value":if(U.values.length===1)return`Invalid input: expected ${b(U.values[0])}`;return`Invalid option: expected one of ${W(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`Too big: expected ${U.origin??"value"} to have ${g}${U.maximum.toString()} ${z.unit??"elements"}`;return`Too big: expected ${U.origin??"value"} to be ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`Too small: expected ${U.origin} to have ${g}${U.minimum.toString()} ${z.unit}`;return`Too small: expected ${U.origin} to be ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Invalid string: must start with "${g.prefix}"`;if(g.format==="ends_with")return`Invalid string: must end with "${g.suffix}"`;if(g.format==="includes")return`Invalid string: must include "${g.includes}"`;if(g.format==="regex")return`Invalid string: must match pattern ${g.pattern}`;return`Invalid ${_[g.format]??U.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${U.divisor}`;case"unrecognized_keys":return`Unrecognized key${U.keys.length>1?"s":""}: ${W(U.keys,", ")}`;case"invalid_key":return`Invalid key in ${U.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${U.origin}`;default:return"Invalid input"}}};function Y0(){return{localeError:kP()}}var iP=()=>{let $={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function I(U){return $[U]??null}let _={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-daŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},u={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Nevalida enigo: atendiĝis instanceof ${U.expected}, riceviĝis ${G}`;return`Nevalida enigo: atendiĝis ${g}, riceviĝis ${G}`}case"invalid_value":if(U.values.length===1)return`Nevalida enigo: atendiĝis ${b(U.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${W(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`Tro granda: atendiĝis ke ${U.origin??"valoro"} havu ${g}${U.maximum.toString()} ${z.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${U.origin??"valoro"} havu ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`Tro malgranda: atendiĝis ke ${U.origin} havu ${g}${U.minimum.toString()} ${z.unit}`;return`Tro malgranda: atendiĝis ke ${U.origin} estu ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${g.prefix}"`;if(g.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${g.suffix}"`;if(g.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${g.includes}"`;if(g.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${g.pattern}`;return`Nevalida ${_[g.format]??U.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${U.divisor}`;case"unrecognized_keys":return`Nekonata${U.keys.length>1?"j":""} ŝlosilo${U.keys.length>1?"j":""}: ${W(U.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${U.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${U.origin}`;default:return"Nevalida enigo"}}};function rJ(){return{localeError:iP()}}var yP=()=>{let $={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function I(U){return $[U]??null}let _={regex:"entrada",email:"dirección de correo electrónico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},u={nan:"NaN",string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Entrada inválida: se esperaba instanceof ${U.expected}, recibido ${G}`;return`Entrada inválida: se esperaba ${g}, recibido ${G}`}case"invalid_value":if(U.values.length===1)return`Entrada inválida: se esperaba ${b(U.values[0])}`;return`Opción inválida: se esperaba una de ${W(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin),G=u[U.origin]??U.origin;if(z)return`Demasiado grande: se esperaba que ${G??"valor"} tuviera ${g}${U.maximum.toString()} ${z.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${G??"valor"} fuera ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin),G=u[U.origin]??U.origin;if(z)return`Demasiado pequeño: se esperaba que ${G} tuviera ${g}${U.minimum.toString()} ${z.unit}`;return`Demasiado pequeño: se esperaba que ${G} fuera ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Cadena inválida: debe comenzar con "${g.prefix}"`;if(g.format==="ends_with")return`Cadena inválida: debe terminar en "${g.suffix}"`;if(g.format==="includes")return`Cadena inválida: debe incluir "${g.includes}"`;if(g.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${g.pattern}`;return`Inválido ${_[g.format]??U.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${U.divisor}`;case"unrecognized_keys":return`Llave${U.keys.length>1?"s":""} desconocida${U.keys.length>1?"s":""}: ${W(U.keys,", ")}`;case"invalid_key":return`Llave inválida en ${u[U.origin]??U.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${u[U.origin]??U.origin}`;default:return"Entrada inválida"}}};function hJ(){return{localeError:yP()}}var lP=()=>{let $={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function I(U){return $[U]??null}let _={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"},u={nan:"NaN",number:"عدد",array:"آرایه"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`ورودی نامعتبر: میبایست instanceof ${U.expected} میبود، ${G} دریافت شد`;return`ورودی نامعتبر: میبایست ${g} میبود، ${G} دریافت شد`}case"invalid_value":if(U.values.length===1)return`ورودی نامعتبر: میبایست ${b(U.values[0])} میبود`;return`گزینه نامعتبر: میبایست یکی از ${W(U.values,"|")} میبود`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`خیلی بزرگ: ${U.origin??"مقدار"} باید ${g}${U.maximum.toString()} ${z.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${U.origin??"مقدار"} باید ${g}${U.maximum.toString()} باشد`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`خیلی کوچک: ${U.origin} باید ${g}${U.minimum.toString()} ${z.unit} باشد`;return`خیلی کوچک: ${U.origin} باید ${g}${U.minimum.toString()} باشد`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`رشته نامعتبر: باید با "${g.prefix}" شروع شود`;if(g.format==="ends_with")return`رشته نامعتبر: باید با "${g.suffix}" تمام شود`;if(g.format==="includes")return`رشته نامعتبر: باید شامل "${g.includes}" باشد`;if(g.format==="regex")return`رشته نامعتبر: باید با الگوی ${g.pattern} مطابقت داشته باشد`;return`${_[g.format]??U.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${U.divisor} باشد`;case"unrecognized_keys":return`کلید${U.keys.length>1?"های":""} ناشناس: ${W(U.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${U.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${U.origin}`;default:return"ورودی نامعتبر"}}};function cJ(){return{localeError:lP()}}var mP=()=>{let $={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}};function I(U){return $[U]??null}let _={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},u={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Virheellinen tyyppi: odotettiin instanceof ${U.expected}, oli ${G}`;return`Virheellinen tyyppi: odotettiin ${g}, oli ${G}`}case"invalid_value":if(U.values.length===1)return`Virheellinen syöte: täytyy olla ${b(U.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${W(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`Liian suuri: ${z.subject} täytyy olla ${g}${U.maximum.toString()} ${z.unit}`.trim();return`Liian suuri: arvon täytyy olla ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`Liian pieni: ${z.subject} täytyy olla ${g}${U.minimum.toString()} ${z.unit}`.trim();return`Liian pieni: arvon täytyy olla ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${g.prefix}"`;if(g.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${g.suffix}"`;if(g.format==="includes")return`Virheellinen syöte: täytyy sisältää "${g.includes}"`;if(g.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${g.pattern}`;return`Virheellinen ${_[g.format]??U.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${U.divisor} monikerta`;case"unrecognized_keys":return`${U.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${W(U.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}}};function dJ(){return{localeError:mP()}}var nP=()=>{let $={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function I(U){return $[U]??null}let _={regex:"entrée",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},u={nan:"NaN",number:"nombre",array:"tableau"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Entrée invalide : instanceof ${U.expected} attendu, ${G} reçu`;return`Entrée invalide : ${g} attendu, ${G} reçu`}case"invalid_value":if(U.values.length===1)return`Entrée invalide : ${b(U.values[0])} attendu`;return`Option invalide : une valeur parmi ${W(U.values,"|")} attendue`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`Trop grand : ${U.origin??"valeur"} doit ${z.verb} ${g}${U.maximum.toString()} ${z.unit??"élément(s)"}`;return`Trop grand : ${U.origin??"valeur"} doit être ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`Trop petit : ${U.origin} doit ${z.verb} ${g}${U.minimum.toString()} ${z.unit}`;return`Trop petit : ${U.origin} doit être ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Chaîne invalide : doit commencer par "${g.prefix}"`;if(g.format==="ends_with")return`Chaîne invalide : doit se terminer par "${g.suffix}"`;if(g.format==="includes")return`Chaîne invalide : doit inclure "${g.includes}"`;if(g.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${g.pattern}`;return`${_[g.format]??U.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${U.divisor}`;case"unrecognized_keys":return`Clé${U.keys.length>1?"s":""} non reconnue${U.keys.length>1?"s":""} : ${W(U.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${U.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${U.origin}`;default:return"Entrée invalide"}}};function oJ(){return{localeError:nP()}}var rP=()=>{let $={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function I(U){return $[U]??null}let _={regex:"entrée",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},u={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Entrée invalide : attendu instanceof ${U.expected}, reçu ${G}`;return`Entrée invalide : attendu ${g}, reçu ${G}`}case"invalid_value":if(U.values.length===1)return`Entrée invalide : attendu ${b(U.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${W(U.values,"|")}`;case"too_big":{let g=U.inclusive?"≤":"<",z=I(U.origin);if(z)return`Trop grand : attendu que ${U.origin??"la valeur"} ait ${g}${U.maximum.toString()} ${z.unit}`;return`Trop grand : attendu que ${U.origin??"la valeur"} soit ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?"≥":">",z=I(U.origin);if(z)return`Trop petit : attendu que ${U.origin} ait ${g}${U.minimum.toString()} ${z.unit}`;return`Trop petit : attendu que ${U.origin} soit ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Chaîne invalide : doit commencer par "${g.prefix}"`;if(g.format==="ends_with")return`Chaîne invalide : doit se terminer par "${g.suffix}"`;if(g.format==="includes")return`Chaîne invalide : doit inclure "${g.includes}"`;if(g.format==="regex")return`Chaîne invalide : doit correspondre au motif ${g.pattern}`;return`${_[g.format]??U.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${U.divisor}`;case"unrecognized_keys":return`Clé${U.keys.length>1?"s":""} non reconnue${U.keys.length>1?"s":""} : ${W(U.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${U.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${U.origin}`;default:return"Entrée invalide"}}};function pJ(){return{localeError:rP()}}var hP=()=>{let $={string:{label:"מחרוזת",gender:"f"},number:{label:"מספר",gender:"m"},boolean:{label:"ערך בוליאני",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"תאריך",gender:"m"},array:{label:"מערך",gender:"m"},object:{label:"אובייקט",gender:"m"},null:{label:"ערך ריק (null)",gender:"m"},undefined:{label:"ערך לא מוגדר (undefined)",gender:"m"},symbol:{label:"סימבול (Symbol)",gender:"m"},function:{label:"פונקציה",gender:"f"},map:{label:"מפה (Map)",gender:"f"},set:{label:"קבוצה (Set)",gender:"f"},file:{label:"קובץ",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"ערך לא ידוע",gender:"m"},value:{label:"ערך",gender:"m"}},I={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},_=(X)=>X?$[X]:void 0,u=(X)=>{let N=_(X);if(N)return N.label;return X??$.unknown.label},U=(X)=>`ה${u(X)}`,g=(X)=>{return(_(X)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות"},z=(X)=>{if(!X)return null;return I[X]??null},G={regex:{label:"קלט",gender:"m"},email:{label:"כתובת אימייל",gender:"f"},url:{label:"כתובת רשת",gender:"f"},emoji:{label:"אימוג'י",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"תאריך וזמן ISO",gender:"m"},date:{label:"תאריך ISO",gender:"m"},time:{label:"זמן ISO",gender:"m"},duration:{label:"משך זמן ISO",gender:"m"},ipv4:{label:"כתובת IPv4",gender:"f"},ipv6:{label:"כתובת IPv6",gender:"f"},cidrv4:{label:"טווח IPv4",gender:"m"},cidrv6:{label:"טווח IPv6",gender:"m"},base64:{label:"מחרוזת בבסיס 64",gender:"f"},base64url:{label:"מחרוזת בבסיס 64 לכתובות רשת",gender:"f"},json_string:{label:"מחרוזת JSON",gender:"f"},e164:{label:"מספר E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"קלט",gender:"m"},includes:{label:"קלט",gender:"m"},lowercase:{label:"קלט",gender:"m"},starts_with:{label:"קלט",gender:"m"},uppercase:{label:"קלט",gender:"m"}},J={nan:"NaN"};return(X)=>{switch(X.code){case"invalid_type":{let N=X.expected,q=J[N??""]??u(N),Q=P(X.input),Y=J[Q]??$[Q]?.label??Q;if(/^[A-Z]/.test(X.expected))return`קלט לא תקין: צריך להיות instanceof ${X.expected}, התקבל ${Y}`;return`קלט לא תקין: צריך להיות ${q}, התקבל ${Y}`}case"invalid_value":{if(X.values.length===1)return`ערך לא תקין: הערך חייב להיות ${b(X.values[0])}`;let N=X.values.map((Y)=>b(Y));if(X.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${N[0]} או ${N[1]}`;let q=N[N.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${N.slice(0,-1).join(", ")} או ${q}`}case"too_big":{let N=z(X.origin),q=U(X.origin??"value");if(X.origin==="string")return`${N?.longLabel??"ארוך"} מדי: ${q} צריכה להכיל ${X.maximum.toString()} ${N?.unit??""} ${X.inclusive?"או פחות":"לכל היותר"}`.trim();if(X.origin==="number"){let O=X.inclusive?`קטן או שווה ל-${X.maximum}`:`קטן מ-${X.maximum}`;return`גדול מדי: ${q} צריך להיות ${O}`}if(X.origin==="array"||X.origin==="set"){let O=X.origin==="set"?"צריכה":"צריך",H=X.inclusive?`${X.maximum} ${N?.unit??""} או פחות`:`פחות מ-${X.maximum} ${N?.unit??""}`;return`גדול מדי: ${q} ${O} להכיל ${H}`.trim()}let Q=X.inclusive?"<=":"<",Y=g(X.origin??"value");if(N?.unit)return`${N.longLabel} מדי: ${q} ${Y} ${Q}${X.maximum.toString()} ${N.unit}`;return`${N?.longLabel??"גדול"} מדי: ${q} ${Y} ${Q}${X.maximum.toString()}`}case"too_small":{let N=z(X.origin),q=U(X.origin??"value");if(X.origin==="string")return`${N?.shortLabel??"קצר"} מדי: ${q} צריכה להכיל ${X.minimum.toString()} ${N?.unit??""} ${X.inclusive?"או יותר":"לפחות"}`.trim();if(X.origin==="number"){let O=X.inclusive?`גדול או שווה ל-${X.minimum}`:`גדול מ-${X.minimum}`;return`קטן מדי: ${q} צריך להיות ${O}`}if(X.origin==="array"||X.origin==="set"){let O=X.origin==="set"?"צריכה":"צריך";if(X.minimum===1&&X.inclusive){let v=X.origin==="set"?"לפחות פריט אחד":"לפחות פריט אחד";return`קטן מדי: ${q} ${O} להכיל ${v}`}let H=X.inclusive?`${X.minimum} ${N?.unit??""} או יותר`:`יותר מ-${X.minimum} ${N?.unit??""}`;return`קטן מדי: ${q} ${O} להכיל ${H}`.trim()}let Q=X.inclusive?">=":">",Y=g(X.origin??"value");if(N?.unit)return`${N.shortLabel} מדי: ${q} ${Y} ${Q}${X.minimum.toString()} ${N.unit}`;return`${N?.shortLabel??"קטן"} מדי: ${q} ${Y} ${Q}${X.minimum.toString()}`}case"invalid_format":{let N=X;if(N.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${N.prefix}"`;if(N.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${N.suffix}"`;if(N.format==="includes")return`המחרוזת חייבת לכלול "${N.includes}"`;if(N.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${N.pattern}`;let q=G[N.format],Q=q?.label??N.format,O=(q?.gender??"m")==="f"?"תקינה":"תקין";return`${Q} לא ${O}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${X.divisor}`;case"unrecognized_keys":return`מפתח${X.keys.length>1?"ות":""} לא מזוה${X.keys.length>1?"ים":"ה"}: ${W(X.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${U(X.origin??"array")}`;default:return"קלט לא תקין"}}};function tJ(){return{localeError:hP()}}var cP=()=>{let $={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function I(U){return $[U]??null}let _={regex:"bemenet",email:"email cím",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"},u={nan:"NaN",number:"szám",array:"tömb"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Érvénytelen bemenet: a várt érték instanceof ${U.expected}, a kapott érték ${G}`;return`Érvénytelen bemenet: a várt érték ${g}, a kapott érték ${G}`}case"invalid_value":if(U.values.length===1)return`Érvénytelen bemenet: a várt érték ${b(U.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${W(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`Túl nagy: ${U.origin??"érték"} mérete túl nagy ${g}${U.maximum.toString()} ${z.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${U.origin??"érték"} túl nagy: ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`Túl kicsi: a bemeneti érték ${U.origin} mérete túl kicsi ${g}${U.minimum.toString()} ${z.unit}`;return`Túl kicsi: a bemeneti érték ${U.origin} túl kicsi ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Érvénytelen string: "${g.prefix}" értékkel kell kezdődnie`;if(g.format==="ends_with")return`Érvénytelen string: "${g.suffix}" értékkel kell végződnie`;if(g.format==="includes")return`Érvénytelen string: "${g.includes}" értéket kell tartalmaznia`;if(g.format==="regex")return`Érvénytelen string: ${g.pattern} mintának kell megfelelnie`;return`Érvénytelen ${_[g.format]??U.format}`}case"not_multiple_of":return`Érvénytelen szám: ${U.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${U.keys.length>1?"s":""}: ${W(U.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${U.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${U.origin}`;default:return"Érvénytelen bemenet"}}};function aJ(){return{localeError:cP()}}function O7($,I,_){return Math.abs($)===1?I:_}function f1($){if(!$)return"";let I=["ա","ե","ը","ի","ո","ու","օ"],_=$[$.length-1];return $+(I.includes(_)?"ն":"ը")}var dP=()=>{let $={string:{unit:{one:"նշան",many:"նշաններ"},verb:"ունենալ"},file:{unit:{one:"բայթ",many:"բայթեր"},verb:"ունենալ"},array:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"},set:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"}};function I(U){return $[U]??null}let _={regex:"մուտք",email:"էլ. հասցե",url:"URL",emoji:"էմոջի",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO ամսաթիվ և ժամ",date:"ISO ամսաթիվ",time:"ISO ժամ",duration:"ISO տևողություն",ipv4:"IPv4 հասցե",ipv6:"IPv6 հասցե",cidrv4:"IPv4 միջակայք",cidrv6:"IPv6 միջակայք",base64:"base64 ձևաչափով տող",base64url:"base64url ձևաչափով տող",json_string:"JSON տող",e164:"E.164 համար",jwt:"JWT",template_literal:"մուտք"},u={nan:"NaN",number:"թիվ",array:"զանգված"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Սխալ մուտքագրում․ սպասվում էր instanceof ${U.expected}, ստացվել է ${G}`;return`Սխալ մուտքագրում․ սպասվում էր ${g}, ստացվել է ${G}`}case"invalid_value":if(U.values.length===1)return`Սխալ մուտքագրում․ սպասվում էր ${b(U.values[1])}`;return`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${W(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z){let G=Number(U.maximum),J=O7(G,z.unit.one,z.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${f1(U.origin??"արժեք")} կունենա ${g}${U.maximum.toString()} ${J}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${f1(U.origin??"արժեք")} լինի ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z){let G=Number(U.minimum),J=O7(G,z.unit.one,z.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${f1(U.origin)} կունենա ${g}${U.minimum.toString()} ${J}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${f1(U.origin)} լինի ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Սխալ տող․ պետք է սկսվի "${g.prefix}"-ով`;if(g.format==="ends_with")return`Սխալ տող․ պետք է ավարտվի "${g.suffix}"-ով`;if(g.format==="includes")return`Սխալ տող․ պետք է պարունակի "${g.includes}"`;if(g.format==="regex")return`Սխալ տող․ պետք է համապատասխանի ${g.pattern} ձևաչափին`;return`Սխալ ${_[g.format]??U.format}`}case"not_multiple_of":return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${U.divisor}-ի`;case"unrecognized_keys":return`Չճանաչված բանալի${U.keys.length>1?"ներ":""}. ${W(U.keys,", ")}`;case"invalid_key":return`Սխալ բանալի ${f1(U.origin)}-ում`;case"invalid_union":return"Սխալ մուտքագրում";case"invalid_element":return`Սխալ արժեք ${f1(U.origin)}-ում`;default:return"Սխալ մուտքագրում"}}};function eJ(){return{localeError:dP()}}var oP=()=>{let $={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function I(U){return $[U]??null}let _={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},u={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Input tidak valid: diharapkan instanceof ${U.expected}, diterima ${G}`;return`Input tidak valid: diharapkan ${g}, diterima ${G}`}case"invalid_value":if(U.values.length===1)return`Input tidak valid: diharapkan ${b(U.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${W(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`Terlalu besar: diharapkan ${U.origin??"value"} memiliki ${g}${U.maximum.toString()} ${z.unit??"elemen"}`;return`Terlalu besar: diharapkan ${U.origin??"value"} menjadi ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`Terlalu kecil: diharapkan ${U.origin} memiliki ${g}${U.minimum.toString()} ${z.unit}`;return`Terlalu kecil: diharapkan ${U.origin} menjadi ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`String tidak valid: harus dimulai dengan "${g.prefix}"`;if(g.format==="ends_with")return`String tidak valid: harus berakhir dengan "${g.suffix}"`;if(g.format==="includes")return`String tidak valid: harus menyertakan "${g.includes}"`;if(g.format==="regex")return`String tidak valid: harus sesuai pola ${g.pattern}`;return`${_[g.format]??U.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${U.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${U.keys.length>1?"s":""}: ${W(U.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${U.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${U.origin}`;default:return"Input tidak valid"}}};function sJ(){return{localeError:oP()}}var pP=()=>{let $={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function I(U){return $[U]??null}let _={regex:"gildi",email:"netfang",url:"vefslóð",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og tími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",jwt:"JWT",template_literal:"gildi"},u={nan:"NaN",number:"númer",array:"fylki"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Rangt gildi: Þú slóst inn ${G} þar sem á að vera instanceof ${U.expected}`;return`Rangt gildi: Þú slóst inn ${G} þar sem á að vera ${g}`}case"invalid_value":if(U.values.length===1)return`Rangt gildi: gert ráð fyrir ${b(U.values[0])}`;return`Ógilt val: má vera eitt af eftirfarandi ${W(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`Of stórt: gert er ráð fyrir að ${U.origin??"gildi"} hafi ${g}${U.maximum.toString()} ${z.unit??"hluti"}`;return`Of stórt: gert er ráð fyrir að ${U.origin??"gildi"} sé ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`Of lítið: gert er ráð fyrir að ${U.origin} hafi ${g}${U.minimum.toString()} ${z.unit}`;return`Of lítið: gert er ráð fyrir að ${U.origin} sé ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Ógildur strengur: verður að byrja á "${g.prefix}"`;if(g.format==="ends_with")return`Ógildur strengur: verður að enda á "${g.suffix}"`;if(g.format==="includes")return`Ógildur strengur: verður að innihalda "${g.includes}"`;if(g.format==="regex")return`Ógildur strengur: verður að fylgja mynstri ${g.pattern}`;return`Rangt ${_[g.format]??U.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${U.divisor}`;case"unrecognized_keys":return`Óþekkt ${U.keys.length>1?"ir lyklar":"ur lykill"}: ${W(U.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${U.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${U.origin}`;default:return"Rangt gildi"}}};function $8(){return{localeError:pP()}}var tP=()=>{let $={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function I(U){return $[U]??null}let _={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},u={nan:"NaN",number:"numero",array:"vettore"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Input non valido: atteso instanceof ${U.expected}, ricevuto ${G}`;return`Input non valido: atteso ${g}, ricevuto ${G}`}case"invalid_value":if(U.values.length===1)return`Input non valido: atteso ${b(U.values[0])}`;return`Opzione non valida: atteso uno tra ${W(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`Troppo grande: ${U.origin??"valore"} deve avere ${g}${U.maximum.toString()} ${z.unit??"elementi"}`;return`Troppo grande: ${U.origin??"valore"} deve essere ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`Troppo piccolo: ${U.origin} deve avere ${g}${U.minimum.toString()} ${z.unit}`;return`Troppo piccolo: ${U.origin} deve essere ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Stringa non valida: deve iniziare con "${g.prefix}"`;if(g.format==="ends_with")return`Stringa non valida: deve terminare con "${g.suffix}"`;if(g.format==="includes")return`Stringa non valida: deve includere "${g.includes}"`;if(g.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${g.pattern}`;return`Invalid ${_[g.format]??U.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${U.divisor}`;case"unrecognized_keys":return`Chiav${U.keys.length>1?"i":"e"} non riconosciut${U.keys.length>1?"e":"a"}: ${W(U.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${U.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${U.origin}`;default:return"Input non valido"}}};function I8(){return{localeError:tP()}}var aP=()=>{let $={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function I(U){return $[U]??null}let _={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"},u={nan:"NaN",number:"数値",array:"配列"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`無効な入力: instanceof ${U.expected}が期待されましたが、${G}が入力されました`;return`無効な入力: ${g}が期待されましたが、${G}が入力されました`}case"invalid_value":if(U.values.length===1)return`無効な入力: ${b(U.values[0])}が期待されました`;return`無効な選択: ${W(U.values,"、")}のいずれかである必要があります`;case"too_big":{let g=U.inclusive?"以下である":"より小さい",z=I(U.origin);if(z)return`大きすぎる値: ${U.origin??"値"}は${U.maximum.toString()}${z.unit??"要素"}${g}必要があります`;return`大きすぎる値: ${U.origin??"値"}は${U.maximum.toString()}${g}必要があります`}case"too_small":{let g=U.inclusive?"以上である":"より大きい",z=I(U.origin);if(z)return`小さすぎる値: ${U.origin}は${U.minimum.toString()}${z.unit}${g}必要があります`;return`小さすぎる値: ${U.origin}は${U.minimum.toString()}${g}必要があります`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`無効な文字列: "${g.prefix}"で始まる必要があります`;if(g.format==="ends_with")return`無効な文字列: "${g.suffix}"で終わる必要があります`;if(g.format==="includes")return`無効な文字列: "${g.includes}"を含む必要があります`;if(g.format==="regex")return`無効な文字列: パターン${g.pattern}に一致する必要があります`;return`無効な${_[g.format]??U.format}`}case"not_multiple_of":return`無効な数値: ${U.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${U.keys.length>1?"群":""}: ${W(U.keys,"、")}`;case"invalid_key":return`${U.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${U.origin}内の無効な値`;default:return"無効な入力"}}};function U8(){return{localeError:aP()}}var eP=()=>{let $={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function I(U){return $[U]??null}let _={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული სტრინგი",base64url:"base64url-კოდირებული სტრინგი",json_string:"JSON სტრინგი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"},u={nan:"NaN",number:"რიცხვი",string:"სტრინგი",boolean:"ბულეანი",function:"ფუნქცია",array:"მასივი"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`არასწორი შეყვანა: მოსალოდნელი instanceof ${U.expected}, მიღებული ${G}`;return`არასწორი შეყვანა: მოსალოდნელი ${g}, მიღებული ${G}`}case"invalid_value":if(U.values.length===1)return`არასწორი შეყვანა: მოსალოდნელი ${b(U.values[0])}`;return`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${W(U.values,"|")}-დან`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`ზედმეტად დიდი: მოსალოდნელი ${U.origin??"მნიშვნელობა"} ${z.verb} ${g}${U.maximum.toString()} ${z.unit}`;return`ზედმეტად დიდი: მოსალოდნელი ${U.origin??"მნიშვნელობა"} იყოს ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`ზედმეტად პატარა: მოსალოდნელი ${U.origin} ${z.verb} ${g}${U.minimum.toString()} ${z.unit}`;return`ზედმეტად პატარა: მოსალოდნელი ${U.origin} იყოს ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`არასწორი სტრინგი: უნდა იწყებოდეს "${g.prefix}"-ით`;if(g.format==="ends_with")return`არასწორი სტრინგი: უნდა მთავრდებოდეს "${g.suffix}"-ით`;if(g.format==="includes")return`არასწორი სტრინგი: უნდა შეიცავდეს "${g.includes}"-ს`;if(g.format==="regex")return`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${g.pattern}`;return`არასწორი ${_[g.format]??U.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${U.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${U.keys.length>1?"ები":"ი"}: ${W(U.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${U.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${U.origin}-ში`;default:return"არასწორი შეყვანა"}}};function _8(){return{localeError:eP()}}var sP=()=>{let $={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function I(U){return $[U]??null}let _={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"},u={nan:"NaN",number:"លេខ",array:"អារេ (Array)",null:"គ្មានតម្លៃ (null)"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${U.expected} ប៉ុន្តែទទួលបាន ${G}`;return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${g} ប៉ុន្តែទទួលបាន ${G}`}case"invalid_value":if(U.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${b(U.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${W(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`ធំពេក៖ ត្រូវការ ${U.origin??"តម្លៃ"} ${g} ${U.maximum.toString()} ${z.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${U.origin??"តម្លៃ"} ${g} ${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`តូចពេក៖ ត្រូវការ ${U.origin} ${g} ${U.minimum.toString()} ${z.unit}`;return`តូចពេក៖ ត្រូវការ ${U.origin} ${g} ${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${g.prefix}"`;if(g.format==="ends_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${g.suffix}"`;if(g.format==="includes")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${g.includes}"`;if(g.format==="regex")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${g.pattern}`;return`មិនត្រឹមត្រូវ៖ ${_[g.format]??U.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${U.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${W(U.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${U.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${U.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function O0(){return{localeError:sP()}}function u8(){return O0()}var $S=()=>{let $={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function I(U){return $[U]??null}let _={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"},u={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`잘못된 입력: 예상 타입은 instanceof ${U.expected}, 받은 타입은 ${G}입니다`;return`잘못된 입력: 예상 타입은 ${g}, 받은 타입은 ${G}입니다`}case"invalid_value":if(U.values.length===1)return`잘못된 입력: 값은 ${b(U.values[0])} 이어야 합니다`;return`잘못된 옵션: ${W(U.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let g=U.inclusive?"이하":"미만",z=g==="미만"?"이어야 합니다":"여야 합니다",G=I(U.origin),J=G?.unit??"요소";if(G)return`${U.origin??"값"}이 너무 큽니다: ${U.maximum.toString()}${J} ${g}${z}`;return`${U.origin??"값"}이 너무 큽니다: ${U.maximum.toString()} ${g}${z}`}case"too_small":{let g=U.inclusive?"이상":"초과",z=g==="이상"?"이어야 합니다":"여야 합니다",G=I(U.origin),J=G?.unit??"요소";if(G)return`${U.origin??"값"}이 너무 작습니다: ${U.minimum.toString()}${J} ${g}${z}`;return`${U.origin??"값"}이 너무 작습니다: ${U.minimum.toString()} ${g}${z}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`잘못된 문자열: "${g.prefix}"(으)로 시작해야 합니다`;if(g.format==="ends_with")return`잘못된 문자열: "${g.suffix}"(으)로 끝나야 합니다`;if(g.format==="includes")return`잘못된 문자열: "${g.includes}"을(를) 포함해야 합니다`;if(g.format==="regex")return`잘못된 문자열: 정규식 ${g.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${_[g.format]??U.format}`}case"not_multiple_of":return`잘못된 숫자: ${U.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${W(U.keys,", ")}`;case"invalid_key":return`잘못된 키: ${U.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${U.origin}`;default:return"잘못된 입력"}}};function g8(){return{localeError:$S()}}var v0=($)=>{return $.charAt(0).toUpperCase()+$.slice(1)};function v7($){let I=Math.abs($),_=I%10,u=I%100;if(u>=11&&u<=19||_===0)return"many";if(_===1)return"one";return"few"}var IS=()=>{let $={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function I(U,g,z,G){let J=$[U]??null;if(J===null)return J;return{unit:J.unit[g],verb:J.verb[G][z?"inclusive":"notInclusive"]}}let _={regex:"įvestis",email:"el. pašto adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukmė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"},u={nan:"NaN",number:"skaičius",bigint:"sveikasis skaičius",string:"eilutė",boolean:"loginė reikšmė",undefined:"neapibrėžta reikšmė",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulinė reikšmė"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Gautas tipas ${G}, o tikėtasi - instanceof ${U.expected}`;return`Gautas tipas ${G}, o tikėtasi - ${g}`}case"invalid_value":if(U.values.length===1)return`Privalo būti ${b(U.values[0])}`;return`Privalo būti vienas iš ${W(U.values,"|")} pasirinkimų`;case"too_big":{let g=u[U.origin]??U.origin,z=I(U.origin,v7(Number(U.maximum)),U.inclusive??!1,"smaller");if(z?.verb)return`${v0(g??U.origin??"reikšmė")} ${z.verb} ${U.maximum.toString()} ${z.unit??"elementų"}`;let G=U.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${v0(g??U.origin??"reikšmė")} turi būti ${G} ${U.maximum.toString()} ${z?.unit}`}case"too_small":{let g=u[U.origin]??U.origin,z=I(U.origin,v7(Number(U.minimum)),U.inclusive??!1,"bigger");if(z?.verb)return`${v0(g??U.origin??"reikšmė")} ${z.verb} ${U.minimum.toString()} ${z.unit??"elementų"}`;let G=U.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${v0(g??U.origin??"reikšmė")} turi būti ${G} ${U.minimum.toString()} ${z?.unit}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Eilutė privalo prasidėti "${g.prefix}"`;if(g.format==="ends_with")return`Eilutė privalo pasibaigti "${g.suffix}"`;if(g.format==="includes")return`Eilutė privalo įtraukti "${g.includes}"`;if(g.format==="regex")return`Eilutė privalo atitikti ${g.pattern}`;return`Neteisingas ${_[g.format]??U.format}`}case"not_multiple_of":return`Skaičius privalo būti ${U.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${U.keys.length>1?"i":"as"} rakt${U.keys.length>1?"ai":"as"}: ${W(U.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let g=u[U.origin]??U.origin;return`${v0(g??U.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function z8(){return{localeError:IS()}}var US=()=>{let $={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function I(U){return $[U]??null}let _={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"},u={nan:"NaN",number:"број",array:"низа"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Грешен внес: се очекува instanceof ${U.expected}, примено ${G}`;return`Грешен внес: се очекува ${g}, примено ${G}`}case"invalid_value":if(U.values.length===1)return`Invalid input: expected ${b(U.values[0])}`;return`Грешана опција: се очекува една ${W(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`Премногу голем: се очекува ${U.origin??"вредноста"} да има ${g}${U.maximum.toString()} ${z.unit??"елементи"}`;return`Премногу голем: се очекува ${U.origin??"вредноста"} да биде ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`Премногу мал: се очекува ${U.origin} да има ${g}${U.minimum.toString()} ${z.unit}`;return`Премногу мал: се очекува ${U.origin} да биде ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Неважечка низа: мора да започнува со "${g.prefix}"`;if(g.format==="ends_with")return`Неважечка низа: мора да завршува со "${g.suffix}"`;if(g.format==="includes")return`Неважечка низа: мора да вклучува "${g.includes}"`;if(g.format==="regex")return`Неважечка низа: мора да одгоара на патернот ${g.pattern}`;return`Invalid ${_[g.format]??U.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${U.divisor}`;case"unrecognized_keys":return`${U.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${W(U.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${U.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${U.origin}`;default:return"Грешен внес"}}};function G8(){return{localeError:US()}}var _S=()=>{let $={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function I(U){return $[U]??null}let _={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},u={nan:"NaN",number:"nombor"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Input tidak sah: dijangka instanceof ${U.expected}, diterima ${G}`;return`Input tidak sah: dijangka ${g}, diterima ${G}`}case"invalid_value":if(U.values.length===1)return`Input tidak sah: dijangka ${b(U.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${W(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`Terlalu besar: dijangka ${U.origin??"nilai"} ${z.verb} ${g}${U.maximum.toString()} ${z.unit??"elemen"}`;return`Terlalu besar: dijangka ${U.origin??"nilai"} adalah ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`Terlalu kecil: dijangka ${U.origin} ${z.verb} ${g}${U.minimum.toString()} ${z.unit}`;return`Terlalu kecil: dijangka ${U.origin} adalah ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`String tidak sah: mesti bermula dengan "${g.prefix}"`;if(g.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${g.suffix}"`;if(g.format==="includes")return`String tidak sah: mesti mengandungi "${g.includes}"`;if(g.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${g.pattern}`;return`${_[g.format]??U.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${U.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${W(U.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${U.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${U.origin}`;default:return"Input tidak sah"}}};function J8(){return{localeError:_S()}}var uS=()=>{let $={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function I(U){return $[U]??null}let _={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},u={nan:"NaN",number:"getal"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Ongeldige invoer: verwacht instanceof ${U.expected}, ontving ${G}`;return`Ongeldige invoer: verwacht ${g}, ontving ${G}`}case"invalid_value":if(U.values.length===1)return`Ongeldige invoer: verwacht ${b(U.values[0])}`;return`Ongeldige optie: verwacht één van ${W(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin),G=U.origin==="date"?"laat":U.origin==="string"?"lang":"groot";if(z)return`Te ${G}: verwacht dat ${U.origin??"waarde"} ${g}${U.maximum.toString()} ${z.unit??"elementen"} ${z.verb}`;return`Te ${G}: verwacht dat ${U.origin??"waarde"} ${g}${U.maximum.toString()} is`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin),G=U.origin==="date"?"vroeg":U.origin==="string"?"kort":"klein";if(z)return`Te ${G}: verwacht dat ${U.origin} ${g}${U.minimum.toString()} ${z.unit} ${z.verb}`;return`Te ${G}: verwacht dat ${U.origin} ${g}${U.minimum.toString()} is`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Ongeldige tekst: moet met "${g.prefix}" beginnen`;if(g.format==="ends_with")return`Ongeldige tekst: moet op "${g.suffix}" eindigen`;if(g.format==="includes")return`Ongeldige tekst: moet "${g.includes}" bevatten`;if(g.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${g.pattern}`;return`Ongeldig: ${_[g.format]??U.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${U.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${U.keys.length>1?"s":""}: ${W(U.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${U.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${U.origin}`;default:return"Ongeldige invoer"}}};function X8(){return{localeError:uS()}}var gS=()=>{let $={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function I(U){return $[U]??null}let _={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},u={nan:"NaN",number:"tall",array:"liste"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Ugyldig input: forventet instanceof ${U.expected}, fikk ${G}`;return`Ugyldig input: forventet ${g}, fikk ${G}`}case"invalid_value":if(U.values.length===1)return`Ugyldig verdi: forventet ${b(U.values[0])}`;return`Ugyldig valg: forventet en av ${W(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`For stor(t): forventet ${U.origin??"value"} til å ha ${g}${U.maximum.toString()} ${z.unit??"elementer"}`;return`For stor(t): forventet ${U.origin??"value"} til å ha ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`For lite(n): forventet ${U.origin} til å ha ${g}${U.minimum.toString()} ${z.unit}`;return`For lite(n): forventet ${U.origin} til å ha ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Ugyldig streng: må starte med "${g.prefix}"`;if(g.format==="ends_with")return`Ugyldig streng: må ende med "${g.suffix}"`;if(g.format==="includes")return`Ugyldig streng: må inneholde "${g.includes}"`;if(g.format==="regex")return`Ugyldig streng: må matche mønsteret ${g.pattern}`;return`Ugyldig ${_[g.format]??U.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${U.divisor}`;case"unrecognized_keys":return`${U.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${W(U.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${U.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${U.origin}`;default:return"Ugyldig input"}}};function q8(){return{localeError:gS()}}var zS=()=>{let $={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function I(U){return $[U]??null}let _={regex:"giren",email:"epostagâh",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"},u={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Fâsit giren: umulan instanceof ${U.expected}, alınan ${G}`;return`Fâsit giren: umulan ${g}, alınan ${G}`}case"invalid_value":if(U.values.length===1)return`Fâsit giren: umulan ${b(U.values[0])}`;return`Fâsit tercih: mûteberler ${W(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`Fazla büyük: ${U.origin??"value"}, ${g}${U.maximum.toString()} ${z.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${U.origin??"value"}, ${g}${U.maximum.toString()} olmalıydı.`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`Fazla küçük: ${U.origin}, ${g}${U.minimum.toString()} ${z.unit} sahip olmalıydı.`;return`Fazla küçük: ${U.origin}, ${g}${U.minimum.toString()} olmalıydı.`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Fâsit metin: "${g.prefix}" ile başlamalı.`;if(g.format==="ends_with")return`Fâsit metin: "${g.suffix}" ile bitmeli.`;if(g.format==="includes")return`Fâsit metin: "${g.includes}" ihtivâ etmeli.`;if(g.format==="regex")return`Fâsit metin: ${g.pattern} nakşına uymalı.`;return`Fâsit ${_[g.format]??U.format}`}case"not_multiple_of":return`Fâsit sayı: ${U.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${U.keys.length>1?"s":""}: ${W(U.keys,", ")}`;case"invalid_key":return`${U.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${U.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function N8(){return{localeError:zS()}}var GS=()=>{let $={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function I(U){return $[U]??null}let _={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"},u={nan:"NaN",number:"عدد",array:"ارې"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`ناسم ورودي: باید instanceof ${U.expected} وای, مګر ${G} ترلاسه شو`;return`ناسم ورودي: باید ${g} وای, مګر ${G} ترلاسه شو`}case"invalid_value":if(U.values.length===1)return`ناسم ورودي: باید ${b(U.values[0])} وای`;return`ناسم انتخاب: باید یو له ${W(U.values,"|")} څخه وای`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`ډیر لوی: ${U.origin??"ارزښت"} باید ${g}${U.maximum.toString()} ${z.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${U.origin??"ارزښت"} باید ${g}${U.maximum.toString()} وي`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`ډیر کوچنی: ${U.origin} باید ${g}${U.minimum.toString()} ${z.unit} ولري`;return`ډیر کوچنی: ${U.origin} باید ${g}${U.minimum.toString()} وي`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`ناسم متن: باید د "${g.prefix}" سره پیل شي`;if(g.format==="ends_with")return`ناسم متن: باید د "${g.suffix}" سره پای ته ورسيږي`;if(g.format==="includes")return`ناسم متن: باید "${g.includes}" ولري`;if(g.format==="regex")return`ناسم متن: باید د ${g.pattern} سره مطابقت ولري`;return`${_[g.format]??U.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${U.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${U.keys.length>1?"کلیډونه":"کلیډ"}: ${W(U.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${U.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${U.origin} کې`;default:return"ناسمه ورودي"}}};function Q8(){return{localeError:GS()}}var JS=()=>{let $={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function I(U){return $[U]??null}let _={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"},u={nan:"NaN",number:"liczba",array:"tablica"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${U.expected}, otrzymano ${G}`;return`Nieprawidłowe dane wejściowe: oczekiwano ${g}, otrzymano ${G}`}case"invalid_value":if(U.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${b(U.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${W(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`Za duża wartość: oczekiwano, że ${U.origin??"wartość"} będzie mieć ${g}${U.maximum.toString()} ${z.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${U.origin??"wartość"} będzie wynosić ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`Za mała wartość: oczekiwano, że ${U.origin??"wartość"} będzie mieć ${g}${U.minimum.toString()} ${z.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${U.origin??"wartość"} będzie wynosić ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${g.prefix}"`;if(g.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${g.suffix}"`;if(g.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${g.includes}"`;if(g.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${g.pattern}`;return`Nieprawidłow(y/a/e) ${_[g.format]??U.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${U.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${U.keys.length>1?"s":""}: ${W(U.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${U.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${U.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function H8(){return{localeError:JS()}}var XS=()=>{let $={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function I(U){return $[U]??null}let _={regex:"padrão",email:"endereço de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},u={nan:"NaN",number:"número",null:"nulo"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Tipo inválido: esperado instanceof ${U.expected}, recebido ${G}`;return`Tipo inválido: esperado ${g}, recebido ${G}`}case"invalid_value":if(U.values.length===1)return`Entrada inválida: esperado ${b(U.values[0])}`;return`Opção inválida: esperada uma das ${W(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`Muito grande: esperado que ${U.origin??"valor"} tivesse ${g}${U.maximum.toString()} ${z.unit??"elementos"}`;return`Muito grande: esperado que ${U.origin??"valor"} fosse ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`Muito pequeno: esperado que ${U.origin} tivesse ${g}${U.minimum.toString()} ${z.unit}`;return`Muito pequeno: esperado que ${U.origin} fosse ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Texto inválido: deve começar com "${g.prefix}"`;if(g.format==="ends_with")return`Texto inválido: deve terminar com "${g.suffix}"`;if(g.format==="includes")return`Texto inválido: deve incluir "${g.includes}"`;if(g.format==="regex")return`Texto inválido: deve corresponder ao padrão ${g.pattern}`;return`${_[g.format]??U.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${U.divisor}`;case"unrecognized_keys":return`Chave${U.keys.length>1?"s":""} desconhecida${U.keys.length>1?"s":""}: ${W(U.keys,", ")}`;case"invalid_key":return`Chave inválida em ${U.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${U.origin}`;default:return"Campo inválido"}}};function Y8(){return{localeError:XS()}}function T7($,I,_,u){let U=Math.abs($),g=U%10,z=U%100;if(z>=11&&z<=19)return u;if(g===1)return I;if(g>=2&&g<=4)return _;return u}var qS=()=>{let $={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function I(U){return $[U]??null}let _={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"},u={nan:"NaN",number:"число",array:"массив"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Неверный ввод: ожидалось instanceof ${U.expected}, получено ${G}`;return`Неверный ввод: ожидалось ${g}, получено ${G}`}case"invalid_value":if(U.values.length===1)return`Неверный ввод: ожидалось ${b(U.values[0])}`;return`Неверный вариант: ожидалось одно из ${W(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z){let G=Number(U.maximum),J=T7(G,z.unit.one,z.unit.few,z.unit.many);return`Слишком большое значение: ожидалось, что ${U.origin??"значение"} будет иметь ${g}${U.maximum.toString()} ${J}`}return`Слишком большое значение: ожидалось, что ${U.origin??"значение"} будет ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z){let G=Number(U.minimum),J=T7(G,z.unit.one,z.unit.few,z.unit.many);return`Слишком маленькое значение: ожидалось, что ${U.origin} будет иметь ${g}${U.minimum.toString()} ${J}`}return`Слишком маленькое значение: ожидалось, что ${U.origin} будет ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Неверная строка: должна начинаться с "${g.prefix}"`;if(g.format==="ends_with")return`Неверная строка: должна заканчиваться на "${g.suffix}"`;if(g.format==="includes")return`Неверная строка: должна содержать "${g.includes}"`;if(g.format==="regex")return`Неверная строка: должна соответствовать шаблону ${g.pattern}`;return`Неверный ${_[g.format]??U.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${U.divisor}`;case"unrecognized_keys":return`Нераспознанн${U.keys.length>1?"ые":"ый"} ключ${U.keys.length>1?"и":""}: ${W(U.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${U.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${U.origin}`;default:return"Неверные входные данные"}}};function O8(){return{localeError:qS()}}var NS=()=>{let $={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function I(U){return $[U]??null}let _={regex:"vnos",email:"e-poštni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"},u={nan:"NaN",number:"število",array:"tabela"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Neveljaven vnos: pričakovano instanceof ${U.expected}, prejeto ${G}`;return`Neveljaven vnos: pričakovano ${g}, prejeto ${G}`}case"invalid_value":if(U.values.length===1)return`Neveljaven vnos: pričakovano ${b(U.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${W(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`Preveliko: pričakovano, da bo ${U.origin??"vrednost"} imelo ${g}${U.maximum.toString()} ${z.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${U.origin??"vrednost"} ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`Premajhno: pričakovano, da bo ${U.origin} imelo ${g}${U.minimum.toString()} ${z.unit}`;return`Premajhno: pričakovano, da bo ${U.origin} ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Neveljaven niz: mora se začeti z "${g.prefix}"`;if(g.format==="ends_with")return`Neveljaven niz: mora se končati z "${g.suffix}"`;if(g.format==="includes")return`Neveljaven niz: mora vsebovati "${g.includes}"`;if(g.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${g.pattern}`;return`Neveljaven ${_[g.format]??U.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${U.divisor}`;case"unrecognized_keys":return`Neprepoznan${U.keys.length>1?"i ključi":" ključ"}: ${W(U.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${U.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${U.origin}`;default:return"Neveljaven vnos"}}};function v8(){return{localeError:NS()}}var QS=()=>{let $={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function I(U){return $[U]??null}let _={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},u={nan:"NaN",number:"antal",array:"lista"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Ogiltig inmatning: förväntat instanceof ${U.expected}, fick ${G}`;return`Ogiltig inmatning: förväntat ${g}, fick ${G}`}case"invalid_value":if(U.values.length===1)return`Ogiltig inmatning: förväntat ${b(U.values[0])}`;return`Ogiltigt val: förväntade en av ${W(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`För stor(t): förväntade ${U.origin??"värdet"} att ha ${g}${U.maximum.toString()} ${z.unit??"element"}`;return`För stor(t): förväntat ${U.origin??"värdet"} att ha ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`För lite(t): förväntade ${U.origin??"värdet"} att ha ${g}${U.minimum.toString()} ${z.unit}`;return`För lite(t): förväntade ${U.origin??"värdet"} att ha ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Ogiltig sträng: måste börja med "${g.prefix}"`;if(g.format==="ends_with")return`Ogiltig sträng: måste sluta med "${g.suffix}"`;if(g.format==="includes")return`Ogiltig sträng: måste innehålla "${g.includes}"`;if(g.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${g.pattern}"`;return`Ogiltig(t) ${_[g.format]??U.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${U.divisor}`;case"unrecognized_keys":return`${U.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${W(U.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${U.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${U.origin??"värdet"}`;default:return"Ogiltig input"}}};function T8(){return{localeError:QS()}}var HS=()=>{let $={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function I(U){return $[U]??null}let _={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"},u={nan:"NaN",number:"எண்",array:"அணி",null:"வெறுமை"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${U.expected}, பெறப்பட்டது ${G}`;return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${g}, பெறப்பட்டது ${G}`}case"invalid_value":if(U.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${b(U.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${W(U.values,"|")} இல் ஒன்று`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${U.origin??"மதிப்பு"} ${g}${U.maximum.toString()} ${z.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${U.origin??"மதிப்பு"} ${g}${U.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${U.origin} ${g}${U.minimum.toString()} ${z.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${U.origin} ${g}${U.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`தவறான சரம்: "${g.prefix}" இல் தொடங்க வேண்டும்`;if(g.format==="ends_with")return`தவறான சரம்: "${g.suffix}" இல் முடிவடைய வேண்டும்`;if(g.format==="includes")return`தவறான சரம்: "${g.includes}" ஐ உள்ளடக்க வேண்டும்`;if(g.format==="regex")return`தவறான சரம்: ${g.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${_[g.format]??U.format}`}case"not_multiple_of":return`தவறான எண்: ${U.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${U.keys.length>1?"கள்":""}: ${W(U.keys,", ")}`;case"invalid_key":return`${U.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${U.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function M8(){return{localeError:HS()}}var YS=()=>{let $={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function I(U){return $[U]??null}let _={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"},u={nan:"NaN",number:"ตัวเลข",array:"อาร์เรย์ (Array)",null:"ไม่มีค่า (null)"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${U.expected} แต่ได้รับ ${G}`;return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${g} แต่ได้รับ ${G}`}case"invalid_value":if(U.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${b(U.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${W(U.values,"|")}`;case"too_big":{let g=U.inclusive?"ไม่เกิน":"น้อยกว่า",z=I(U.origin);if(z)return`เกินกำหนด: ${U.origin??"ค่า"} ควรมี${g} ${U.maximum.toString()} ${z.unit??"รายการ"}`;return`เกินกำหนด: ${U.origin??"ค่า"} ควรมี${g} ${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?"อย่างน้อย":"มากกว่า",z=I(U.origin);if(z)return`น้อยกว่ากำหนด: ${U.origin} ควรมี${g} ${U.minimum.toString()} ${z.unit}`;return`น้อยกว่ากำหนด: ${U.origin} ควรมี${g} ${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${g.prefix}"`;if(g.format==="ends_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${g.suffix}"`;if(g.format==="includes")return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${g.includes}" อยู่ในข้อความ`;if(g.format==="regex")return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${g.pattern}`;return`รูปแบบไม่ถูกต้อง: ${_[g.format]??U.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${U.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${W(U.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${U.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${U.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function D8(){return{localeError:YS()}}var OS=()=>{let $={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function I(U){return $[U]??null}let _={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"},u={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Geçersiz değer: beklenen instanceof ${U.expected}, alınan ${G}`;return`Geçersiz değer: beklenen ${g}, alınan ${G}`}case"invalid_value":if(U.values.length===1)return`Geçersiz değer: beklenen ${b(U.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${W(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`Çok büyük: beklenen ${U.origin??"değer"} ${g}${U.maximum.toString()} ${z.unit??"öğe"}`;return`Çok büyük: beklenen ${U.origin??"değer"} ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`Çok küçük: beklenen ${U.origin} ${g}${U.minimum.toString()} ${z.unit}`;return`Çok küçük: beklenen ${U.origin} ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Geçersiz metin: "${g.prefix}" ile başlamalı`;if(g.format==="ends_with")return`Geçersiz metin: "${g.suffix}" ile bitmeli`;if(g.format==="includes")return`Geçersiz metin: "${g.includes}" içermeli`;if(g.format==="regex")return`Geçersiz metin: ${g.pattern} desenine uymalı`;return`Geçersiz ${_[g.format]??U.format}`}case"not_multiple_of":return`Geçersiz sayı: ${U.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${U.keys.length>1?"lar":""}: ${W(U.keys,", ")}`;case"invalid_key":return`${U.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${U.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function L8(){return{localeError:OS()}}var vS=()=>{let $={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function I(U){return $[U]??null}let _={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"},u={nan:"NaN",number:"число",array:"масив"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Неправильні вхідні дані: очікується instanceof ${U.expected}, отримано ${G}`;return`Неправильні вхідні дані: очікується ${g}, отримано ${G}`}case"invalid_value":if(U.values.length===1)return`Неправильні вхідні дані: очікується ${b(U.values[0])}`;return`Неправильна опція: очікується одне з ${W(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`Занадто велике: очікується, що ${U.origin??"значення"} ${z.verb} ${g}${U.maximum.toString()} ${z.unit??"елементів"}`;return`Занадто велике: очікується, що ${U.origin??"значення"} буде ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`Занадто мале: очікується, що ${U.origin} ${z.verb} ${g}${U.minimum.toString()} ${z.unit}`;return`Занадто мале: очікується, що ${U.origin} буде ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Неправильний рядок: повинен починатися з "${g.prefix}"`;if(g.format==="ends_with")return`Неправильний рядок: повинен закінчуватися на "${g.suffix}"`;if(g.format==="includes")return`Неправильний рядок: повинен містити "${g.includes}"`;if(g.format==="regex")return`Неправильний рядок: повинен відповідати шаблону ${g.pattern}`;return`Неправильний ${_[g.format]??U.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${U.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${U.keys.length>1?"і":""}: ${W(U.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${U.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${U.origin}`;default:return"Неправильні вхідні дані"}}};function T0(){return{localeError:vS()}}function B8(){return T0()}var TS=()=>{let $={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function I(U){return $[U]??null}let _={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"},u={nan:"NaN",number:"نمبر",array:"آرے",null:"نل"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`غلط ان پٹ: instanceof ${U.expected} متوقع تھا، ${G} موصول ہوا`;return`غلط ان پٹ: ${g} متوقع تھا، ${G} موصول ہوا`}case"invalid_value":if(U.values.length===1)return`غلط ان پٹ: ${b(U.values[0])} متوقع تھا`;return`غلط آپشن: ${W(U.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`بہت بڑا: ${U.origin??"ویلیو"} کے ${g}${U.maximum.toString()} ${z.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${U.origin??"ویلیو"} کا ${g}${U.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`بہت چھوٹا: ${U.origin} کے ${g}${U.minimum.toString()} ${z.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${U.origin} کا ${g}${U.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`غلط سٹرنگ: "${g.prefix}" سے شروع ہونا چاہیے`;if(g.format==="ends_with")return`غلط سٹرنگ: "${g.suffix}" پر ختم ہونا چاہیے`;if(g.format==="includes")return`غلط سٹرنگ: "${g.includes}" شامل ہونا چاہیے`;if(g.format==="regex")return`غلط سٹرنگ: پیٹرن ${g.pattern} سے میچ ہونا چاہیے`;return`غلط ${_[g.format]??U.format}`}case"not_multiple_of":return`غلط نمبر: ${U.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${U.keys.length>1?"ز":""}: ${W(U.keys,"، ")}`;case"invalid_key":return`${U.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${U.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function K8(){return{localeError:TS()}}var MS=()=>{let $={string:{unit:"belgi",verb:"bo‘lishi kerak"},file:{unit:"bayt",verb:"bo‘lishi kerak"},array:{unit:"element",verb:"bo‘lishi kerak"},set:{unit:"element",verb:"bo‘lishi kerak"}};function I(U){return $[U]??null}let _={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},u={nan:"NaN",number:"raqam",array:"massiv"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Noto‘g‘ri kirish: kutilgan instanceof ${U.expected}, qabul qilingan ${G}`;return`Noto‘g‘ri kirish: kutilgan ${g}, qabul qilingan ${G}`}case"invalid_value":if(U.values.length===1)return`Noto‘g‘ri kirish: kutilgan ${b(U.values[0])}`;return`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${W(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`Juda katta: kutilgan ${U.origin??"qiymat"} ${g}${U.maximum.toString()} ${z.unit} ${z.verb}`;return`Juda katta: kutilgan ${U.origin??"qiymat"} ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`Juda kichik: kutilgan ${U.origin} ${g}${U.minimum.toString()} ${z.unit} ${z.verb}`;return`Juda kichik: kutilgan ${U.origin} ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Noto‘g‘ri satr: "${g.prefix}" bilan boshlanishi kerak`;if(g.format==="ends_with")return`Noto‘g‘ri satr: "${g.suffix}" bilan tugashi kerak`;if(g.format==="includes")return`Noto‘g‘ri satr: "${g.includes}" ni o‘z ichiga olishi kerak`;if(g.format==="regex")return`Noto‘g‘ri satr: ${g.pattern} shabloniga mos kelishi kerak`;return`Noto‘g‘ri ${_[g.format]??U.format}`}case"not_multiple_of":return`Noto‘g‘ri raqam: ${U.divisor} ning karralisi bo‘lishi kerak`;case"unrecognized_keys":return`Noma’lum kalit${U.keys.length>1?"lar":""}: ${W(U.keys,", ")}`;case"invalid_key":return`${U.origin} dagi kalit noto‘g‘ri`;case"invalid_union":return"Noto‘g‘ri kirish";case"invalid_element":return`${U.origin} da noto‘g‘ri qiymat`;default:return"Noto‘g‘ri kirish"}}};function V8(){return{localeError:MS()}}var DS=()=>{let $={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function I(U){return $[U]??null}let _={regex:"đầu vào",email:"địa chỉ email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"},u={nan:"NaN",number:"số",array:"mảng"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Đầu vào không hợp lệ: mong đợi instanceof ${U.expected}, nhận được ${G}`;return`Đầu vào không hợp lệ: mong đợi ${g}, nhận được ${G}`}case"invalid_value":if(U.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${b(U.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${W(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`Quá lớn: mong đợi ${U.origin??"giá trị"} ${z.verb} ${g}${U.maximum.toString()} ${z.unit??"phần tử"}`;return`Quá lớn: mong đợi ${U.origin??"giá trị"} ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`Quá nhỏ: mong đợi ${U.origin} ${z.verb} ${g}${U.minimum.toString()} ${z.unit}`;return`Quá nhỏ: mong đợi ${U.origin} ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${g.prefix}"`;if(g.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${g.suffix}"`;if(g.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${g.includes}"`;if(g.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${g.pattern}`;return`${_[g.format]??U.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${U.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${W(U.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${U.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${U.origin}`;default:return"Đầu vào không hợp lệ"}}};function R8(){return{localeError:DS()}}var LS=()=>{let $={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function I(U){return $[U]??null}let _={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"},u={nan:"NaN",number:"数字",array:"数组",null:"空值(null)"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`无效输入:期望 instanceof ${U.expected},实际接收 ${G}`;return`无效输入:期望 ${g},实际接收 ${G}`}case"invalid_value":if(U.values.length===1)return`无效输入:期望 ${b(U.values[0])}`;return`无效选项:期望以下之一 ${W(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`数值过大:期望 ${U.origin??"值"} ${g}${U.maximum.toString()} ${z.unit??"个元素"}`;return`数值过大:期望 ${U.origin??"值"} ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`数值过小:期望 ${U.origin} ${g}${U.minimum.toString()} ${z.unit}`;return`数值过小:期望 ${U.origin} ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`无效字符串:必须以 "${g.prefix}" 开头`;if(g.format==="ends_with")return`无效字符串:必须以 "${g.suffix}" 结尾`;if(g.format==="includes")return`无效字符串:必须包含 "${g.includes}"`;if(g.format==="regex")return`无效字符串:必须满足正则表达式 ${g.pattern}`;return`无效${_[g.format]??U.format}`}case"not_multiple_of":return`无效数字:必须是 ${U.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${W(U.keys,", ")}`;case"invalid_key":return`${U.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${U.origin} 中包含无效值(value)`;default:return"无效输入"}}};function W8(){return{localeError:LS()}}var BS=()=>{let $={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function I(U){return $[U]??null}let _={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"},u={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`無效的輸入值:預期為 instanceof ${U.expected},但收到 ${G}`;return`無效的輸入值:預期為 ${g},但收到 ${G}`}case"invalid_value":if(U.values.length===1)return`無效的輸入值:預期為 ${b(U.values[0])}`;return`無效的選項:預期為以下其中之一 ${W(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`數值過大:預期 ${U.origin??"值"} 應為 ${g}${U.maximum.toString()} ${z.unit??"個元素"}`;return`數值過大:預期 ${U.origin??"值"} 應為 ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`數值過小:預期 ${U.origin} 應為 ${g}${U.minimum.toString()} ${z.unit}`;return`數值過小:預期 ${U.origin} 應為 ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`無效的字串:必須以 "${g.prefix}" 開頭`;if(g.format==="ends_with")return`無效的字串:必須以 "${g.suffix}" 結尾`;if(g.format==="includes")return`無效的字串:必須包含 "${g.includes}"`;if(g.format==="regex")return`無效的字串:必須符合格式 ${g.pattern}`;return`無效的 ${_[g.format]??U.format}`}case"not_multiple_of":return`無效的數字:必須為 ${U.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${U.keys.length>1?"們":""}:${W(U.keys,"、")}`;case"invalid_key":return`${U.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${U.origin} 中有無效的值`;default:return"無效的輸入值"}}};function A8(){return{localeError:BS()}}var KS=()=>{let $={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function I(U){return $[U]??null}let _={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"},u={nan:"NaN",number:"nọ́mbà",array:"akopọ"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${U.expected}, àmọ̀ a rí ${G}`;return`Ìbáwọlé aṣìṣe: a ní láti fi ${g}, àmọ̀ a rí ${G}`}case"invalid_value":if(U.values.length===1)return`Ìbáwọlé aṣìṣe: a ní láti fi ${b(U.values[0])}`;return`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${W(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`Tó pọ̀ jù: a ní láti jẹ́ pé ${U.origin??"iye"} ${z.verb} ${g}${U.maximum} ${z.unit}`;return`Tó pọ̀ jù: a ní láti jẹ́ ${g}${U.maximum}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`Kéré ju: a ní láti jẹ́ pé ${U.origin} ${z.verb} ${g}${U.minimum} ${z.unit}`;return`Kéré ju: a ní láti jẹ́ ${g}${U.minimum}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${g.prefix}"`;if(g.format==="ends_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${g.suffix}"`;if(g.format==="includes")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${g.includes}"`;if(g.format==="regex")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${g.pattern}`;return`Aṣìṣe: ${_[g.format]??U.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${U.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${W(U.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${U.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${U.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function Z8(){return{localeError:KS()}}var M7,b8=Symbol("ZodOutput"),P8=Symbol("ZodInput");class S8{constructor(){this._map=new WeakMap,this._idmap=new Map}add($,...I){let _=I[0];if(this._map.set($,_),_&&typeof _==="object"&&"id"in _)this._idmap.set(_.id,$);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove($){let I=this._map.get($);if(I&&typeof I==="object"&&"id"in I)this._idmap.delete(I.id);return this._map.delete($),this}get($){let I=$._zod.parent;if(I){let _={...this.get(I)??{}};delete _.id;let u={..._,...this._map.get($)};return Object.keys(u).length?u:void 0}return this._map.get($)}has($){return this._map.has($)}}function Z_(){return new S8}(M7=globalThis).__zod_globalRegistry??(M7.__zod_globalRegistry=Z_());var j$=globalThis.__zod_globalRegistry;function j8($,I){return new $({type:"string",...F(I)})}function F8($,I){return new $({type:"string",coerce:!0,...F(I)})}function b_($,I){return new $({type:"string",format:"email",check:"string_format",abort:!1,...F(I)})}function D0($,I){return new $({type:"string",format:"guid",check:"string_format",abort:!1,...F(I)})}function P_($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,...F(I)})}function S_($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...F(I)})}function j_($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...F(I)})}function F_($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...F(I)})}function L0($,I){return new $({type:"string",format:"url",check:"string_format",abort:!1,...F(I)})}function w_($,I){return new $({type:"string",format:"emoji",check:"string_format",abort:!1,...F(I)})}function E_($,I){return new $({type:"string",format:"nanoid",check:"string_format",abort:!1,...F(I)})}function C_($,I){return new $({type:"string",format:"cuid",check:"string_format",abort:!1,...F(I)})}function f_($,I){return new $({type:"string",format:"cuid2",check:"string_format",abort:!1,...F(I)})}function x_($,I){return new $({type:"string",format:"ulid",check:"string_format",abort:!1,...F(I)})}function k_($,I){return new $({type:"string",format:"xid",check:"string_format",abort:!1,...F(I)})}function i_($,I){return new $({type:"string",format:"ksuid",check:"string_format",abort:!1,...F(I)})}function y_($,I){return new $({type:"string",format:"ipv4",check:"string_format",abort:!1,...F(I)})}function l_($,I){return new $({type:"string",format:"ipv6",check:"string_format",abort:!1,...F(I)})}function w8($,I){return new $({type:"string",format:"mac",check:"string_format",abort:!1,...F(I)})}function m_($,I){return new $({type:"string",format:"cidrv4",check:"string_format",abort:!1,...F(I)})}function n_($,I){return new $({type:"string",format:"cidrv6",check:"string_format",abort:!1,...F(I)})}function r_($,I){return new $({type:"string",format:"base64",check:"string_format",abort:!1,...F(I)})}function h_($,I){return new $({type:"string",format:"base64url",check:"string_format",abort:!1,...F(I)})}function c_($,I){return new $({type:"string",format:"e164",check:"string_format",abort:!1,...F(I)})}function d_($,I){return new $({type:"string",format:"jwt",check:"string_format",abort:!1,...F(I)})}var E8={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function C8($,I){return new $({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...F(I)})}function f8($,I){return new $({type:"string",format:"date",check:"string_format",...F(I)})}function x8($,I){return new $({type:"string",format:"time",check:"string_format",precision:null,...F(I)})}function k8($,I){return new $({type:"string",format:"duration",check:"string_format",...F(I)})}function i8($,I){return new $({type:"number",checks:[],...F(I)})}function y8($,I){return new $({type:"number",coerce:!0,checks:[],...F(I)})}function l8($,I){return new $({type:"number",check:"number_format",abort:!1,format:"safeint",...F(I)})}function m8($,I){return new $({type:"number",check:"number_format",abort:!1,format:"float32",...F(I)})}function n8($,I){return new $({type:"number",check:"number_format",abort:!1,format:"float64",...F(I)})}function r8($,I){return new $({type:"number",check:"number_format",abort:!1,format:"int32",...F(I)})}function h8($,I){return new $({type:"number",check:"number_format",abort:!1,format:"uint32",...F(I)})}function c8($,I){return new $({type:"boolean",...F(I)})}function d8($,I){return new $({type:"boolean",coerce:!0,...F(I)})}function o8($,I){return new $({type:"bigint",...F(I)})}function p8($,I){return new $({type:"bigint",coerce:!0,...F(I)})}function t8($,I){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...F(I)})}function a8($,I){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...F(I)})}function e8($,I){return new $({type:"symbol",...F(I)})}function s8($,I){return new $({type:"undefined",...F(I)})}function $3($,I){return new $({type:"null",...F(I)})}function I3($){return new $({type:"any"})}function U3($){return new $({type:"unknown"})}function _3($,I){return new $({type:"never",...F(I)})}function u3($,I){return new $({type:"void",...F(I)})}function g3($,I){return new $({type:"date",...F(I)})}function z3($,I){return new $({type:"date",coerce:!0,...F(I)})}function G3($,I){return new $({type:"nan",...F(I)})}function F4($,I){return new O_({check:"less_than",...F(I),value:$,inclusive:!1})}function I4($,I){return new O_({check:"less_than",...F(I),value:$,inclusive:!0})}function w4($,I){return new v_({check:"greater_than",...F(I),value:$,inclusive:!1})}function n$($,I){return new v_({check:"greater_than",...F(I),value:$,inclusive:!0})}function o_($){return w4(0,$)}function p_($){return F4(0,$)}function t_($){return I4(0,$)}function a_($){return n$(0,$)}function M6($,I){return new GG({check:"multiple_of",...F(I),value:$})}function D6($,I){return new qG({check:"max_size",...F(I),maximum:$})}function E4($,I){return new NG({check:"min_size",...F(I),minimum:$})}function p6($,I){return new QG({check:"size_equals",...F(I),size:$})}function t6($,I){return new HG({check:"max_length",...F(I),maximum:$})}function d4($,I){return new YG({check:"min_length",...F(I),minimum:$})}function a6($,I){return new OG({check:"length_equals",...F(I),length:$})}function x1($,I){return new vG({check:"string_format",format:"regex",...F(I),pattern:$})}function k1($){return new TG({check:"string_format",format:"lowercase",...F($)})}function i1($){return new MG({check:"string_format",format:"uppercase",...F($)})}function y1($,I){return new DG({check:"string_format",format:"includes",...F(I),includes:$})}function l1($,I){return new LG({check:"string_format",format:"starts_with",...F(I),prefix:$})}function m1($,I){return new BG({check:"string_format",format:"ends_with",...F(I),suffix:$})}function e_($,I,_){return new KG({check:"property",property:$,schema:I,...F(_)})}function n1($,I){return new VG({check:"mime_type",mime:$,...F(I)})}function D4($){return new RG({check:"overwrite",tx:$})}function r1($){return D4((I)=>I.normalize($))}function h1(){return D4(($)=>$.trim())}function c1(){return D4(($)=>$.toLowerCase())}function d1(){return D4(($)=>$.toUpperCase())}function o1(){return D4(($)=>Kz($))}function J3($,I,_){return new $({type:"array",element:I,...F(_)})}function RS($,I,_){return new $({type:"union",options:I,...F(_)})}function WS($,I,_){return new $({type:"union",options:I,inclusive:!1,...F(_)})}function AS($,I,_,u){return new $({type:"union",options:_,discriminator:I,...F(u)})}function ZS($,I,_){return new $({type:"intersection",left:I,right:_})}function bS($,I,_,u){let U=_ instanceof r;return new $({type:"tuple",items:I,rest:U?_:null,...F(U?u:_)})}function PS($,I,_,u){return new $({type:"record",keyType:I,valueType:_,...F(u)})}function SS($,I,_,u){return new $({type:"map",keyType:I,valueType:_,...F(u)})}function jS($,I,_){return new $({type:"set",valueType:I,...F(_)})}function FS($,I,_){let u=Array.isArray(I)?Object.fromEntries(I.map((U)=>[U,U])):I;return new $({type:"enum",entries:u,...F(_)})}function wS($,I,_){return new $({type:"enum",entries:I,...F(_)})}function ES($,I,_){return new $({type:"literal",values:Array.isArray(I)?I:[I],...F(_)})}function X3($,I){return new $({type:"file",...F(I)})}function CS($,I){return new $({type:"transform",transform:I})}function fS($,I){return new $({type:"optional",innerType:I})}function xS($,I){return new $({type:"nullable",innerType:I})}function kS($,I,_){return new $({type:"default",innerType:I,get defaultValue(){return typeof _==="function"?_():Rz(_)}})}function iS($,I,_){return new $({type:"nonoptional",innerType:I,...F(_)})}function yS($,I){return new $({type:"success",innerType:I})}function lS($,I,_){return new $({type:"catch",innerType:I,catchValue:typeof _==="function"?_:()=>_})}function mS($,I,_){return new $({type:"pipe",in:I,out:_})}function nS($,I){return new $({type:"readonly",innerType:I})}function rS($,I,_){return new $({type:"template_literal",parts:I,...F(_)})}function hS($,I){return new $({type:"lazy",getter:I})}function cS($,I){return new $({type:"promise",innerType:I})}function q3($,I,_){let u=F(_);return u.abort??(u.abort=!0),new $({type:"custom",check:"custom",fn:I,...u})}function N3($,I,_){return new $({type:"custom",check:"custom",fn:I,...F(_)})}function Q3($){let I=D7((_)=>{return _.addIssue=(u)=>{if(typeof u==="string")_.issues.push(S1(u,_.value,I._zod.def));else{let U=u;if(U.fatal)U.continue=!1;U.code??(U.code="custom"),U.input??(U.input=_.value),U.inst??(U.inst=I),U.continue??(U.continue=!I._zod.def.abort),_.issues.push(S1(U))}},$(_.value,_)});return I}function D7($,I){let _=new Q$({check:"custom",...F(I)});return _._zod.check=$,_}function H3($){let I=new Q$({check:"describe"});return I._zod.onattach=[(_)=>{let u=j$.get(_)??{};j$.add(_,{...u,description:$})}],I._zod.check=()=>{},I}function Y3($){let I=new Q$({check:"meta"});return I._zod.onattach=[(_)=>{let u=j$.get(_)??{};j$.add(_,{...u,...$})}],I._zod.check=()=>{},I}function O3($,I){let _=F(I),u=_.truthy??["true","1","yes","on","y","enabled"],U=_.falsy??["false","0","no","off","n","disabled"];if(_.case!=="sensitive")u=u.map((Y)=>typeof Y==="string"?Y.toLowerCase():Y),U=U.map((Y)=>typeof Y==="string"?Y.toLowerCase():Y);let g=new Set(u),z=new Set(U),G=$.Codec??H0,J=$.Boolean??N0,N=new($.String??o6)({type:"string",error:_.error}),q=new J({type:"boolean",error:_.error}),Q=new G({type:"pipe",in:N,out:q,transform:(Y,O)=>{let H=Y;if(_.case!=="sensitive")H=H.toLowerCase();if(g.has(H))return!0;else if(z.has(H))return!1;else return O.issues.push({code:"invalid_value",expected:"stringbool",values:[...g,...z],input:O.value,inst:Q,continue:!1}),{}},reverseTransform:(Y,O)=>{if(Y===!0)return u[0]||"true";else return U[0]||"false"},error:_.error});return Q}function p1($,I,_,u={}){let U=F(u),g={...F(u),check:"string_format",type:"string",format:I,fn:typeof _==="function"?_:(G)=>_.test(G),...U};if(_ instanceof RegExp)g.pattern=_;return new $(g)}function L6($){let I=$?.target??"draft-2020-12";if(I==="draft-4")I="draft-04";if(I==="draft-7")I="draft-07";return{processors:$.processors??{},metadataRegistry:$?.metadata??j$,target:I,unrepresentable:$?.unrepresentable??"throw",override:$?.override??(()=>{}),io:$?.io??"output",counter:0,seen:new Map,cycles:$?.cycles??"ref",reused:$?.reused??"inline",external:$?.external??void 0}}function u$($,I,_={path:[],schemaPath:[]}){var u;let U=$._zod.def,g=I.seen.get($);if(g){if(g.count++,_.schemaPath.includes($))g.cycle=_.path;return g.schema}let z={schema:{},count:1,cycle:void 0,path:_.path};I.seen.set($,z);let G=$._zod.toJSONSchema?.();if(G)z.schema=G;else{let N={..._,schemaPath:[..._.schemaPath,$],path:_.path};if($._zod.processJSONSchema)$._zod.processJSONSchema(I,z.schema,N);else{let Q=z.schema,Y=I.processors[U.type];if(!Y)throw Error(`[toJSONSchema]: Non-representable type encountered: ${U.type}`);Y($,I,Q,N)}let q=$._zod.parent;if(q){if(!z.ref)z.ref=q;u$(q,I,N),I.seen.get(q).isParent=!0}}let J=I.metadataRegistry.get($);if(J)Object.assign(z.schema,J);if(I.io==="input"&&r$($))delete z.schema.examples,delete z.schema.default;if(I.io==="input"&&z.schema._prefault)(u=z.schema).default??(u.default=z.schema._prefault);return delete z.schema._prefault,I.seen.get($).schema}function B6($,I){let _=$.seen.get(I);if(!_)throw Error("Unprocessed schema. This is a bug in Zod.");let u=new Map;for(let z of $.seen.entries()){let G=$.metadataRegistry.get(z[0])?.id;if(G){let J=u.get(G);if(J&&J!==z[0])throw Error(`Duplicate schema id "${G}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);u.set(G,z[0])}}let U=(z)=>{let G=$.target==="draft-2020-12"?"$defs":"definitions";if($.external){let q=$.external.registry.get(z[0])?.id,Q=$.external.uri??((O)=>O);if(q)return{ref:Q(q)};let Y=z[1].defId??z[1].schema.id??`schema${$.counter++}`;return z[1].defId=Y,{defId:Y,ref:`${Q("__shared")}#/${G}/${Y}`}}if(z[1]===_)return{ref:"#"};let X=`${"#"}/${G}/`,N=z[1].schema.id??`__schema${$.counter++}`;return{defId:N,ref:X+N}},g=(z)=>{if(z[1].schema.$ref)return;let G=z[1],{ref:J,defId:X}=U(z);if(G.def={...G.schema},X)G.defId=X;let N=G.schema;for(let q in N)delete N[q];N.$ref=J};if($.cycles==="throw")for(let z of $.seen.entries()){let G=z[1];if(G.cycle)throw Error(`Cycle detected: #/${G.cycle?.join("/")}/<root>
|
|
309
|
+
`)}Y.write("payload.value = newResult;"),Y.write("return payload;");let K=Y.compile();return(D,B)=>K(Q,D,B)},g,z=p6,G=!g0.jitless,X=G&&Sz.value,N=I.catchall,q;$._zod.parse=(Q,Y)=>{q??(q=u.value);let O=Q.value;if(!z(O))return Q.issues.push({expected:"object",code:"invalid_type",input:O,inst:$}),Q;if(G&&X&&Y?.async===!1&&Y.jitless!==!0){if(!g)g=U(I.shape);if(Q=g(Q,Y),!N)return Q;return D7([],O,Q,Y,q,$)}return _(Q,Y)}});function z7($,I,_,u){for(let g of $)if(g.issues.length===0)return I.value=g.value,I;let U=$.filter((g)=>!D6(g));if(U.length===1)return I.value=U[0].value,U[0];return I.issues.push({code:"invalid_union",input:I.value,inst:_,errors:$.map((g)=>g.issues.map((z)=>a$(z,u,K$())))}),I}var D0=L("$ZodUnion",($,I)=>{r.init($,I),o($._zod,"optin",()=>I.options.some((U)=>U._zod.optin==="optional")?"optional":void 0),o($._zod,"optout",()=>I.options.some((U)=>U._zod.optout==="optional")?"optional":void 0),o($._zod,"values",()=>{if(I.options.every((U)=>U._zod.values))return new Set(I.options.flatMap((U)=>Array.from(U._zod.values)));return}),o($._zod,"pattern",()=>{if(I.options.every((U)=>U._zod.pattern)){let U=I.options.map((g)=>g._zod.pattern);return new RegExp(`^(${U.map((g)=>J0(g.source)).join("|")})$`)}return});let _=I.options.length===1,u=I.options[0]._zod.run;$._zod.parse=(U,g)=>{if(_)return u(U,g);let z=!1,G=[];for(let J of I.options){let X=J._zod.run({value:U.value,issues:[]},g);if(X instanceof Promise)G.push(X),z=!0;else{if(X.issues.length===0)return X;G.push(X)}}if(!z)return z7(G,U,$,g);return Promise.all(G).then((J)=>{return z7(J,U,$,g)})}});function G7($,I,_,u){let U=$.filter((g)=>g.issues.length===0);if(U.length===1)return I.value=U[0].value,I;if(U.length===0)I.issues.push({code:"invalid_union",input:I.value,inst:_,errors:$.map((g)=>g.issues.map((z)=>a$(z,u,K$())))});else I.issues.push({code:"invalid_union",input:I.value,inst:_,errors:[],inclusive:!1});return I}var DJ=L("$ZodXor",($,I)=>{D0.init($,I),I.inclusive=!1;let _=I.options.length===1,u=I.options[0]._zod.run;$._zod.parse=(U,g)=>{if(_)return u(U,g);let z=!1,G=[];for(let J of I.options){let X=J._zod.run({value:U.value,issues:[]},g);if(X instanceof Promise)G.push(X),z=!0;else G.push(X)}if(!z)return G7(G,U,$,g);return Promise.all(G).then((J)=>{return G7(J,U,$,g)})}}),LJ=L("$ZodDiscriminatedUnion",($,I)=>{I.inclusive=!1,D0.init($,I);let _=$._zod.parse;o($._zod,"propValues",()=>{let U={};for(let g of I.options){let z=g._zod.propValues;if(!z||Object.keys(z).length===0)throw Error(`Invalid discriminated union option at index "${I.options.indexOf(g)}"`);for(let[G,J]of Object.entries(z)){if(!U[G])U[G]=new Set;for(let X of J)U[G].add(X)}}return U});let u=F1(()=>{let U=I.options,g=new Map;for(let z of U){let G=z._zod.propValues?.[I.discriminator];if(!G||G.size===0)throw Error(`Invalid discriminated union option at index "${I.options.indexOf(z)}"`);for(let J of G){if(g.has(J))throw Error(`Duplicate discriminator value "${String(J)}"`);g.set(J,z)}}return g});$._zod.parse=(U,g)=>{let z=U.value;if(!p6(z))return U.issues.push({code:"invalid_type",expected:"object",input:z,inst:$}),U;let G=u.value.get(z?.[I.discriminator]);if(G)return G._zod.run(U,g);if(I.unionFallback)return _(U,g);return U.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:I.discriminator,input:z,path:[I.discriminator],inst:$}),U}}),BJ=L("$ZodIntersection",($,I)=>{r.init($,I),$._zod.parse=(_,u)=>{let U=_.value,g=I.left._zod.run({value:U,issues:[]},u),z=I.right._zod.run({value:U,issues:[]},u);if(g instanceof Promise||z instanceof Promise)return Promise.all([g,z]).then(([J,X])=>{return J7(_,J,X)});return J7(_,g,z)}});function EG($,I){if($===I)return{valid:!0,data:$};if($ instanceof Date&&I instanceof Date&&+$===+I)return{valid:!0,data:$};if(M6($)&&M6(I)){let _=Object.keys(I),u=Object.keys($).filter((g)=>_.indexOf(g)!==-1),U={...$,...I};for(let g of u){let z=EG($[g],I[g]);if(!z.valid)return{valid:!1,mergeErrorPath:[g,...z.mergeErrorPath]};U[g]=z.data}return{valid:!0,data:U}}if(Array.isArray($)&&Array.isArray(I)){if($.length!==I.length)return{valid:!1,mergeErrorPath:[]};let _=[];for(let u=0;u<$.length;u++){let U=$[u],g=I[u],z=EG(U,g);if(!z.valid)return{valid:!1,mergeErrorPath:[u,...z.mergeErrorPath]};_.push(z.data)}return{valid:!0,data:_}}return{valid:!1,mergeErrorPath:[]}}function J7($,I,_){let u=new Map,U;for(let G of I.issues)if(G.code==="unrecognized_keys"){U??(U=G);for(let J of G.keys){if(!u.has(J))u.set(J,{});u.get(J).l=!0}}else $.issues.push(G);for(let G of _.issues)if(G.code==="unrecognized_keys")for(let J of G.keys){if(!u.has(J))u.set(J,{});u.get(J).r=!0}else $.issues.push(G);let g=[...u].filter(([,G])=>G.l&&G.r).map(([G])=>G);if(g.length&&U)$.issues.push({...U,keys:g});if(D6($))return $;let z=EG(I.value,_.value);if(!z.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(z.mergeErrorPath)}`);return $.value=z.data,$}var w_=L("$ZodTuple",($,I)=>{r.init($,I);let _=I.items;$._zod.parse=(u,U)=>{let g=u.value;if(!Array.isArray(g))return u.issues.push({input:g,inst:$,expected:"tuple",code:"invalid_type"}),u;u.value=[];let z=[],G=[..._].reverse().findIndex((N)=>N._zod.optin!=="optional"),J=G===-1?0:_.length-G;if(!I.rest){let N=g.length>_.length,q=g.length<J-1;if(N||q)return u.issues.push({...N?{code:"too_big",maximum:_.length,inclusive:!0}:{code:"too_small",minimum:_.length},input:g,inst:$,origin:"array"}),u}let X=-1;for(let N of _){if(X++,X>=g.length){if(X>=J)continue}let q=N._zod.run({value:g[X],issues:[]},U);if(q instanceof Promise)z.push(q.then((Q)=>Z_(Q,u,X)));else Z_(q,u,X)}if(I.rest){let N=g.slice(_.length);for(let q of N){X++;let Q=I.rest._zod.run({value:q,issues:[]},U);if(Q instanceof Promise)z.push(Q.then((Y)=>Z_(Y,u,X)));else Z_(Q,u,X)}}if(z.length)return Promise.all(z).then(()=>u);return u}});function Z_($,I,_){if($.issues.length)I.issues.push(...$4(_,$.issues));I.value[_]=$.value}var KJ=L("$ZodRecord",($,I)=>{r.init($,I),$._zod.parse=(_,u)=>{let U=_.value;if(!M6(U))return _.issues.push({expected:"record",code:"invalid_type",input:U,inst:$}),_;let g=[],z=I.keyType._zod.values;if(z){_.value={};let G=new Set;for(let X of z)if(typeof X==="string"||typeof X==="number"||typeof X==="symbol"){G.add(typeof X==="number"?X.toString():X);let N=I.valueType._zod.run({value:U[X],issues:[]},u);if(N instanceof Promise)g.push(N.then((q)=>{if(q.issues.length)_.issues.push(...$4(X,q.issues));_.value[X]=q.value}));else{if(N.issues.length)_.issues.push(...$4(X,N.issues));_.value[X]=N.value}}let J;for(let X in U)if(!G.has(X))J=J??[],J.push(X);if(J&&J.length>0)_.issues.push({code:"unrecognized_keys",input:U,inst:$,keys:J})}else{_.value={};for(let G of Reflect.ownKeys(U)){if(G==="__proto__")continue;let J=I.keyType._zod.run({value:G,issues:[]},u);if(J instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof G==="string"&&O0.test(G)&&J.issues.length){let q=I.keyType._zod.run({value:Number(G),issues:[]},u);if(q instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(q.issues.length===0)J=q}if(J.issues.length){if(I.mode==="loose")_.value[G]=U[G];else _.issues.push({code:"invalid_key",origin:"record",issues:J.issues.map((q)=>a$(q,u,K$())),input:G,path:[G],inst:$});continue}let N=I.valueType._zod.run({value:U[G],issues:[]},u);if(N instanceof Promise)g.push(N.then((q)=>{if(q.issues.length)_.issues.push(...$4(G,q.issues));_.value[J.value]=q.value}));else{if(N.issues.length)_.issues.push(...$4(G,N.issues));_.value[J.value]=N.value}}}if(g.length)return Promise.all(g).then(()=>_);return _}}),WJ=L("$ZodMap",($,I)=>{r.init($,I),$._zod.parse=(_,u)=>{let U=_.value;if(!(U instanceof Map))return _.issues.push({expected:"map",code:"invalid_type",input:U,inst:$}),_;let g=[];_.value=new Map;for(let[z,G]of U){let J=I.keyType._zod.run({value:z,issues:[]},u),X=I.valueType._zod.run({value:G,issues:[]},u);if(J instanceof Promise||X instanceof Promise)g.push(Promise.all([J,X]).then(([N,q])=>{X7(N,q,_,z,U,$,u)}));else X7(J,X,_,z,U,$,u)}if(g.length)return Promise.all(g).then(()=>_);return _}});function X7($,I,_,u,U,g,z){if($.issues.length)if(X0.has(typeof u))_.issues.push(...$4(u,$.issues));else _.issues.push({code:"invalid_key",origin:"map",input:U,inst:g,issues:$.issues.map((G)=>a$(G,z,K$()))});if(I.issues.length)if(X0.has(typeof u))_.issues.push(...$4(u,I.issues));else _.issues.push({origin:"map",code:"invalid_element",input:U,inst:g,key:u,issues:I.issues.map((G)=>a$(G,z,K$()))});_.value.set($.value,I.value)}var RJ=L("$ZodSet",($,I)=>{r.init($,I),$._zod.parse=(_,u)=>{let U=_.value;if(!(U instanceof Set))return _.issues.push({input:U,inst:$,expected:"set",code:"invalid_type"}),_;let g=[];_.value=new Set;for(let z of U){let G=I.valueType._zod.run({value:z,issues:[]},u);if(G instanceof Promise)g.push(G.then((J)=>q7(J,_)));else q7(G,_)}if(g.length)return Promise.all(g).then(()=>_);return _}});function q7($,I){if($.issues.length)I.issues.push(...$.issues);I.value.add($.value)}var VJ=L("$ZodEnum",($,I)=>{r.init($,I);let _=G0(I.entries),u=new Set(_);$._zod.values=u,$._zod.pattern=new RegExp(`^(${_.filter((U)=>X0.has(typeof U)).map((U)=>typeof U==="string"?q4(U):U.toString()).join("|")})$`),$._zod.parse=(U,g)=>{let z=U.value;if(u.has(z))return U;return U.issues.push({code:"invalid_value",values:_,input:z,inst:$}),U}}),ZJ=L("$ZodLiteral",($,I)=>{if(r.init($,I),I.values.length===0)throw Error("Cannot create literal schema with no valid values");let _=new Set(I.values);$._zod.values=_,$._zod.pattern=new RegExp(`^(${I.values.map((u)=>typeof u==="string"?q4(u):u?q4(u.toString()):String(u)).join("|")})$`),$._zod.parse=(u,U)=>{let g=u.value;if(_.has(g))return u;return u.issues.push({code:"invalid_value",values:I.values,input:g,inst:$}),u}}),AJ=L("$ZodFile",($,I)=>{r.init($,I),$._zod.parse=(_,u)=>{let U=_.value;if(U instanceof File)return _;return _.issues.push({expected:"file",code:"invalid_type",input:U,inst:$}),_}}),bJ=L("$ZodTransform",($,I)=>{r.init($,I),$._zod.parse=(_,u)=>{if(u.direction==="backward")throw new o6($.constructor.name);let U=I.transform(_.value,_);if(u.async)return(U instanceof Promise?U:Promise.resolve(U)).then((z)=>{return _.value=z,_});if(U instanceof Promise)throw new S4;return _.value=U,_}});function N7($,I){if($.issues.length&&I===void 0)return{issues:[],value:void 0};return $}var E_=L("$ZodOptional",($,I)=>{r.init($,I),$._zod.optin="optional",$._zod.optout="optional",o($._zod,"values",()=>{return I.innerType._zod.values?new Set([...I.innerType._zod.values,void 0]):void 0}),o($._zod,"pattern",()=>{let _=I.innerType._zod.pattern;return _?new RegExp(`^(${J0(_.source)})?$`):void 0}),$._zod.parse=(_,u)=>{if(I.innerType._zod.optin==="optional"){let U=I.innerType._zod.run(_,u);if(U instanceof Promise)return U.then((g)=>N7(g,_.value));return N7(U,_.value)}if(_.value===void 0)return _;return I.innerType._zod.run(_,u)}}),PJ=L("$ZodExactOptional",($,I)=>{E_.init($,I),o($._zod,"values",()=>I.innerType._zod.values),o($._zod,"pattern",()=>I.innerType._zod.pattern),$._zod.parse=(_,u)=>{return I.innerType._zod.run(_,u)}}),jJ=L("$ZodNullable",($,I)=>{r.init($,I),o($._zod,"optin",()=>I.innerType._zod.optin),o($._zod,"optout",()=>I.innerType._zod.optout),o($._zod,"pattern",()=>{let _=I.innerType._zod.pattern;return _?new RegExp(`^(${J0(_.source)}|null)$`):void 0}),o($._zod,"values",()=>{return I.innerType._zod.values?new Set([...I.innerType._zod.values,null]):void 0}),$._zod.parse=(_,u)=>{if(_.value===null)return _;return I.innerType._zod.run(_,u)}}),SJ=L("$ZodDefault",($,I)=>{r.init($,I),$._zod.optin="optional",o($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(_,u)=>{if(u.direction==="backward")return I.innerType._zod.run(_,u);if(_.value===void 0)return _.value=I.defaultValue,_;let U=I.innerType._zod.run(_,u);if(U instanceof Promise)return U.then((g)=>Q7(g,I));return Q7(U,I)}});function Q7($,I){if($.value===void 0)$.value=I.defaultValue;return $}var FJ=L("$ZodPrefault",($,I)=>{r.init($,I),$._zod.optin="optional",o($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(_,u)=>{if(u.direction==="backward")return I.innerType._zod.run(_,u);if(_.value===void 0)_.value=I.defaultValue;return I.innerType._zod.run(_,u)}}),wJ=L("$ZodNonOptional",($,I)=>{r.init($,I),o($._zod,"values",()=>{let _=I.innerType._zod.values;return _?new Set([..._].filter((u)=>u!==void 0)):void 0}),$._zod.parse=(_,u)=>{let U=I.innerType._zod.run(_,u);if(U instanceof Promise)return U.then((g)=>H7(g,$));return H7(U,$)}});function H7($,I){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:I});return $}var EJ=L("$ZodSuccess",($,I)=>{r.init($,I),$._zod.parse=(_,u)=>{if(u.direction==="backward")throw new o6("ZodSuccess");let U=I.innerType._zod.run(_,u);if(U instanceof Promise)return U.then((g)=>{return _.value=g.issues.length===0,_});return _.value=U.issues.length===0,_}}),CJ=L("$ZodCatch",($,I)=>{r.init($,I),o($._zod,"optin",()=>I.innerType._zod.optin),o($._zod,"optout",()=>I.innerType._zod.optout),o($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(_,u)=>{if(u.direction==="backward")return I.innerType._zod.run(_,u);let U=I.innerType._zod.run(_,u);if(U instanceof Promise)return U.then((g)=>{if(_.value=g.value,g.issues.length)_.value=I.catchValue({..._,error:{issues:g.issues.map((z)=>a$(z,u,K$()))},input:_.value}),_.issues=[];return _});if(_.value=U.value,U.issues.length)_.value=I.catchValue({..._,error:{issues:U.issues.map((g)=>a$(g,u,K$()))},input:_.value}),_.issues=[];return _}}),fJ=L("$ZodNaN",($,I)=>{r.init($,I),$._zod.parse=(_,u)=>{if(typeof _.value!=="number"||!Number.isNaN(_.value))return _.issues.push({input:_.value,inst:$,expected:"nan",code:"invalid_type"}),_;return _}}),xJ=L("$ZodPipe",($,I)=>{r.init($,I),o($._zod,"values",()=>I.in._zod.values),o($._zod,"optin",()=>I.in._zod.optin),o($._zod,"optout",()=>I.out._zod.optout),o($._zod,"propValues",()=>I.in._zod.propValues),$._zod.parse=(_,u)=>{if(u.direction==="backward"){let g=I.out._zod.run(_,u);if(g instanceof Promise)return g.then((z)=>A_(z,I.in,u));return A_(g,I.in,u)}let U=I.in._zod.run(_,u);if(U instanceof Promise)return U.then((g)=>A_(g,I.out,u));return A_(U,I.out,u)}});function A_($,I,_){if($.issues.length)return $.aborted=!0,$;return I._zod.run({value:$.value,issues:$.issues},_)}var L0=L("$ZodCodec",($,I)=>{r.init($,I),o($._zod,"values",()=>I.in._zod.values),o($._zod,"optin",()=>I.in._zod.optin),o($._zod,"optout",()=>I.out._zod.optout),o($._zod,"propValues",()=>I.in._zod.propValues),$._zod.parse=(_,u)=>{if((u.direction||"forward")==="forward"){let g=I.in._zod.run(_,u);if(g instanceof Promise)return g.then((z)=>b_(z,I,u));return b_(g,I,u)}else{let g=I.out._zod.run(_,u);if(g instanceof Promise)return g.then((z)=>b_(z,I,u));return b_(g,I,u)}}});function b_($,I,_){if($.issues.length)return $.aborted=!0,$;if((_.direction||"forward")==="forward"){let U=I.transform($.value,$);if(U instanceof Promise)return U.then((g)=>P_($,g,I.out,_));return P_($,U,I.out,_)}else{let U=I.reverseTransform($.value,$);if(U instanceof Promise)return U.then((g)=>P_($,g,I.in,_));return P_($,U,I.in,_)}}function P_($,I,_,u){if($.issues.length)return $.aborted=!0,$;return _._zod.run({value:I,issues:$.issues},u)}var kJ=L("$ZodReadonly",($,I)=>{r.init($,I),o($._zod,"propValues",()=>I.innerType._zod.propValues),o($._zod,"values",()=>I.innerType._zod.values),o($._zod,"optin",()=>I.innerType?._zod?.optin),o($._zod,"optout",()=>I.innerType?._zod?.optout),$._zod.parse=(_,u)=>{if(u.direction==="backward")return I.innerType._zod.run(_,u);let U=I.innerType._zod.run(_,u);if(U instanceof Promise)return U.then(Y7);return Y7(U)}});function Y7($){return $.value=Object.freeze($.value),$}var yJ=L("$ZodTemplateLiteral",($,I)=>{r.init($,I);let _=[];for(let u of I.parts)if(typeof u==="object"&&u!==null){if(!u._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...u._zod.traits].shift()}`);let U=u._zod.pattern instanceof RegExp?u._zod.pattern.source:u._zod.pattern;if(!U)throw Error(`Invalid template literal part: ${u._zod.traits}`);let g=U.startsWith("^")?1:0,z=U.endsWith("$")?U.length-1:U.length;_.push(U.slice(g,z))}else if(u===null||wz.has(typeof u))_.push(q4(`${u}`));else throw Error(`Invalid template literal part: ${u}`);$._zod.pattern=new RegExp(`^${_.join("")}$`),$._zod.parse=(u,U)=>{if(typeof u.value!=="string")return u.issues.push({input:u.value,inst:$,expected:"string",code:"invalid_type"}),u;if($._zod.pattern.lastIndex=0,!$._zod.pattern.test(u.value))return u.issues.push({input:u.value,inst:$,code:"invalid_format",format:I.format??"template_literal",pattern:$._zod.pattern.source}),u;return u}}),iJ=L("$ZodFunction",($,I)=>{return r.init($,I),$._def=I,$._zod.def=I,$.implement=(_)=>{if(typeof _!=="function")throw Error("implement() must be called with a function");return function(...u){let U=$._def.input?Q_($._def.input,u):u,g=Reflect.apply(_,this,U);if($._def.output)return Q_($._def.output,g);return g}},$.implementAsync=(_)=>{if(typeof _!=="function")throw Error("implementAsync() must be called with a function");return async function(...u){let U=$._def.input?await H_($._def.input,u):u,g=await Reflect.apply(_,this,U);if($._def.output)return await H_($._def.output,g);return g}},$._zod.parse=(_,u)=>{if(typeof _.value!=="function")return _.issues.push({code:"invalid_type",expected:"function",input:_.value,inst:$}),_;if($._def.output&&$._def.output._zod.def.type==="promise")_.value=$.implementAsync(_.value);else _.value=$.implement(_.value);return _},$.input=(..._)=>{let u=$.constructor;if(Array.isArray(_[0]))return new u({type:"function",input:new w_({type:"tuple",items:_[0],rest:_[1]}),output:$._def.output});return new u({type:"function",input:_[0],output:$._def.output})},$.output=(_)=>{return new $.constructor({type:"function",input:$._def.input,output:_})},$}),lJ=L("$ZodPromise",($,I)=>{r.init($,I),$._zod.parse=(_,u)=>{return Promise.resolve(_.value).then((U)=>I.innerType._zod.run({value:U,issues:[]},u))}}),mJ=L("$ZodLazy",($,I)=>{r.init($,I),o($._zod,"innerType",()=>I.getter()),o($._zod,"pattern",()=>$._zod.innerType?._zod?.pattern),o($._zod,"propValues",()=>$._zod.innerType?._zod?.propValues),o($._zod,"optin",()=>$._zod.innerType?._zod?.optin??void 0),o($._zod,"optout",()=>$._zod.innerType?._zod?.optout??void 0),$._zod.parse=(_,u)=>{return $._zod.innerType._zod.run(_,u)}}),nJ=L("$ZodCustom",($,I)=>{H$.init($,I),r.init($,I),$._zod.parse=(_,u)=>{return _},$._zod.check=(_)=>{let u=_.value,U=I.fn(u);if(U instanceof Promise)return U.then((g)=>O7(g,_,u,$));O7(U,_,u,$);return}});function O7($,I,_,u){if(!$){let U={code:"custom",input:_,inst:u,path:[...u._zod.def.path??[]],continue:!u._zod.def.abort};if(u._zod.def.params)U.params=u._zod.def.params;I.issues.push(w1(U))}}var V0={};b4(V0,{zhTW:()=>E8,zhCN:()=>w8,yo:()=>C8,vi:()=>F8,uz:()=>S8,ur:()=>j8,uk:()=>R0,ua:()=>P8,tr:()=>b8,th:()=>A8,ta:()=>Z8,sv:()=>V8,sl:()=>R8,ru:()=>W8,pt:()=>K8,ps:()=>L8,pl:()=>B8,ota:()=>D8,no:()=>M8,nl:()=>T8,ms:()=>v8,mk:()=>O8,lt:()=>Y8,ko:()=>H8,km:()=>K0,kh:()=>Q8,ka:()=>N8,ja:()=>q8,it:()=>X8,is:()=>J8,id:()=>G8,hy:()=>z8,hu:()=>g8,he:()=>u8,frCA:()=>_8,fr:()=>U8,fi:()=>I8,fa:()=>$8,es:()=>sJ,eo:()=>eJ,en:()=>B0,de:()=>aJ,da:()=>tJ,cs:()=>pJ,ca:()=>oJ,bg:()=>dJ,be:()=>cJ,az:()=>hJ,ar:()=>rJ});var kP=()=>{let $={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function I(U){return $[U]??null}let _={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"},u={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`مدخلات غير مقبولة: يفترض إدخال instanceof ${U.expected}، ولكن تم إدخال ${G}`;return`مدخلات غير مقبولة: يفترض إدخال ${g}، ولكن تم إدخال ${G}`}case"invalid_value":if(U.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${b(U.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${Z(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return` أكبر من اللازم: يفترض أن تكون ${U.origin??"القيمة"} ${g} ${U.maximum.toString()} ${z.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${U.origin??"القيمة"} ${g} ${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`أصغر من اللازم: يفترض لـ ${U.origin} أن يكون ${g} ${U.minimum.toString()} ${z.unit}`;return`أصغر من اللازم: يفترض لـ ${U.origin} أن يكون ${g} ${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${U.prefix}"`;if(g.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${g.suffix}"`;if(g.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${g.includes}"`;if(g.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${g.pattern}`;return`${_[g.format]??U.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${U.divisor}`;case"unrecognized_keys":return`معرف${U.keys.length>1?"ات":""} غريب${U.keys.length>1?"ة":""}: ${Z(U.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${U.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${U.origin}`;default:return"مدخل غير مقبول"}}};function rJ(){return{localeError:kP()}}var yP=()=>{let $={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function I(U){return $[U]??null}let _={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},u={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Yanlış dəyər: gözlənilən instanceof ${U.expected}, daxil olan ${G}`;return`Yanlış dəyər: gözlənilən ${g}, daxil olan ${G}`}case"invalid_value":if(U.values.length===1)return`Yanlış dəyər: gözlənilən ${b(U.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${Z(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`Çox böyük: gözlənilən ${U.origin??"dəyər"} ${g}${U.maximum.toString()} ${z.unit??"element"}`;return`Çox böyük: gözlənilən ${U.origin??"dəyər"} ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`Çox kiçik: gözlənilən ${U.origin} ${g}${U.minimum.toString()} ${z.unit}`;return`Çox kiçik: gözlənilən ${U.origin} ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Yanlış mətn: "${g.prefix}" ilə başlamalıdır`;if(g.format==="ends_with")return`Yanlış mətn: "${g.suffix}" ilə bitməlidir`;if(g.format==="includes")return`Yanlış mətn: "${g.includes}" daxil olmalıdır`;if(g.format==="regex")return`Yanlış mətn: ${g.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${_[g.format]??U.format}`}case"not_multiple_of":return`Yanlış ədəd: ${U.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${U.keys.length>1?"lar":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`${U.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${U.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function hJ(){return{localeError:yP()}}function B7($,I,_,u){let U=Math.abs($),g=U%10,z=U%100;if(z>=11&&z<=19)return u;if(g===1)return I;if(g>=2&&g<=4)return _;return u}var iP=()=>{let $={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function I(U){return $[U]??null}let _={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"},u={nan:"NaN",number:"лік",array:"масіў"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Няправільны ўвод: чакаўся instanceof ${U.expected}, атрымана ${G}`;return`Няправільны ўвод: чакаўся ${g}, атрымана ${G}`}case"invalid_value":if(U.values.length===1)return`Няправільны ўвод: чакалася ${b(U.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${Z(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z){let G=Number(U.maximum),J=B7(G,z.unit.one,z.unit.few,z.unit.many);return`Занадта вялікі: чакалася, што ${U.origin??"значэнне"} павінна ${z.verb} ${g}${U.maximum.toString()} ${J}`}return`Занадта вялікі: чакалася, што ${U.origin??"значэнне"} павінна быць ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z){let G=Number(U.minimum),J=B7(G,z.unit.one,z.unit.few,z.unit.many);return`Занадта малы: чакалася, што ${U.origin} павінна ${z.verb} ${g}${U.minimum.toString()} ${J}`}return`Занадта малы: чакалася, што ${U.origin} павінна быць ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Няправільны радок: павінен пачынацца з "${g.prefix}"`;if(g.format==="ends_with")return`Няправільны радок: павінен заканчвацца на "${g.suffix}"`;if(g.format==="includes")return`Няправільны радок: павінен змяшчаць "${g.includes}"`;if(g.format==="regex")return`Няправільны радок: павінен адпавядаць шаблону ${g.pattern}`;return`Няправільны ${_[g.format]??U.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${U.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${U.keys.length>1?"ключы":"ключ"}: ${Z(U.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${U.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${U.origin}`;default:return"Няправільны ўвод"}}};function cJ(){return{localeError:iP()}}var lP=()=>{let $={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function I(U){return $[U]??null}let _={regex:"вход",email:"имейл адрес",url:"URL",emoji:"емоджи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO време",date:"ISO дата",time:"ISO време",duration:"ISO продължителност",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"base64-кодиран низ",base64url:"base64url-кодиран низ",json_string:"JSON низ",e164:"E.164 номер",jwt:"JWT",template_literal:"вход"},u={nan:"NaN",number:"число",array:"масив"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Невалиден вход: очакван instanceof ${U.expected}, получен ${G}`;return`Невалиден вход: очакван ${g}, получен ${G}`}case"invalid_value":if(U.values.length===1)return`Невалиден вход: очакван ${b(U.values[0])}`;return`Невалидна опция: очаквано едно от ${Z(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`Твърде голямо: очаква се ${U.origin??"стойност"} да съдържа ${g}${U.maximum.toString()} ${z.unit??"елемента"}`;return`Твърде голямо: очаква се ${U.origin??"стойност"} да бъде ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`Твърде малко: очаква се ${U.origin} да съдържа ${g}${U.minimum.toString()} ${z.unit}`;return`Твърде малко: очаква се ${U.origin} да бъде ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Невалиден низ: трябва да започва с "${g.prefix}"`;if(g.format==="ends_with")return`Невалиден низ: трябва да завършва с "${g.suffix}"`;if(g.format==="includes")return`Невалиден низ: трябва да включва "${g.includes}"`;if(g.format==="regex")return`Невалиден низ: трябва да съвпада с ${g.pattern}`;let z="Невалиден";if(g.format==="emoji")z="Невалидно";if(g.format==="datetime")z="Невалидно";if(g.format==="date")z="Невалидна";if(g.format==="time")z="Невалидно";if(g.format==="duration")z="Невалидна";return`${z} ${_[g.format]??U.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${U.divisor}`;case"unrecognized_keys":return`Неразпознат${U.keys.length>1?"и":""} ключ${U.keys.length>1?"ове":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${U.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${U.origin}`;default:return"Невалиден вход"}}};function dJ(){return{localeError:lP()}}var mP=()=>{let $={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function I(U){return $[U]??null}let _={regex:"entrada",email:"adreça electrònica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},u={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Tipus invàlid: s'esperava instanceof ${U.expected}, s'ha rebut ${G}`;return`Tipus invàlid: s'esperava ${g}, s'ha rebut ${G}`}case"invalid_value":if(U.values.length===1)return`Valor invàlid: s'esperava ${b(U.values[0])}`;return`Opció invàlida: s'esperava una de ${Z(U.values," o ")}`;case"too_big":{let g=U.inclusive?"com a màxim":"menys de",z=I(U.origin);if(z)return`Massa gran: s'esperava que ${U.origin??"el valor"} contingués ${g} ${U.maximum.toString()} ${z.unit??"elements"}`;return`Massa gran: s'esperava que ${U.origin??"el valor"} fos ${g} ${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?"com a mínim":"més de",z=I(U.origin);if(z)return`Massa petit: s'esperava que ${U.origin} contingués ${g} ${U.minimum.toString()} ${z.unit}`;return`Massa petit: s'esperava que ${U.origin} fos ${g} ${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Format invàlid: ha de començar amb "${g.prefix}"`;if(g.format==="ends_with")return`Format invàlid: ha d'acabar amb "${g.suffix}"`;if(g.format==="includes")return`Format invàlid: ha d'incloure "${g.includes}"`;if(g.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${g.pattern}`;return`Format invàlid per a ${_[g.format]??U.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${U.divisor}`;case"unrecognized_keys":return`Clau${U.keys.length>1?"s":""} no reconeguda${U.keys.length>1?"s":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${U.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${U.origin}`;default:return"Entrada invàlida"}}};function oJ(){return{localeError:mP()}}var nP=()=>{let $={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function I(U){return $[U]??null}let _={regex:"regulární výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"},u={nan:"NaN",number:"číslo",string:"řetězec",function:"funkce",array:"pole"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Neplatný vstup: očekáváno instanceof ${U.expected}, obdrženo ${G}`;return`Neplatný vstup: očekáváno ${g}, obdrženo ${G}`}case"invalid_value":if(U.values.length===1)return`Neplatný vstup: očekáváno ${b(U.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${Z(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`Hodnota je příliš velká: ${U.origin??"hodnota"} musí mít ${g}${U.maximum.toString()} ${z.unit??"prvků"}`;return`Hodnota je příliš velká: ${U.origin??"hodnota"} musí být ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`Hodnota je příliš malá: ${U.origin??"hodnota"} musí mít ${g}${U.minimum.toString()} ${z.unit??"prvků"}`;return`Hodnota je příliš malá: ${U.origin??"hodnota"} musí být ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Neplatný řetězec: musí začínat na "${g.prefix}"`;if(g.format==="ends_with")return`Neplatný řetězec: musí končit na "${g.suffix}"`;if(g.format==="includes")return`Neplatný řetězec: musí obsahovat "${g.includes}"`;if(g.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${g.pattern}`;return`Neplatný formát ${_[g.format]??U.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${U.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${Z(U.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${U.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${U.origin}`;default:return"Neplatný vstup"}}};function pJ(){return{localeError:nP()}}var rP=()=>{let $={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function I(U){return $[U]??null}let _={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslæt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},u={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Ugyldigt input: forventede instanceof ${U.expected}, fik ${G}`;return`Ugyldigt input: forventede ${g}, fik ${G}`}case"invalid_value":if(U.values.length===1)return`Ugyldig værdi: forventede ${b(U.values[0])}`;return`Ugyldigt valg: forventede en af følgende ${Z(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin),G=u[U.origin]??U.origin;if(z)return`For stor: forventede ${G??"value"} ${z.verb} ${g} ${U.maximum.toString()} ${z.unit??"elementer"}`;return`For stor: forventede ${G??"value"} havde ${g} ${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin),G=u[U.origin]??U.origin;if(z)return`For lille: forventede ${G} ${z.verb} ${g} ${U.minimum.toString()} ${z.unit}`;return`For lille: forventede ${G} havde ${g} ${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Ugyldig streng: skal starte med "${g.prefix}"`;if(g.format==="ends_with")return`Ugyldig streng: skal ende med "${g.suffix}"`;if(g.format==="includes")return`Ugyldig streng: skal indeholde "${g.includes}"`;if(g.format==="regex")return`Ugyldig streng: skal matche mønsteret ${g.pattern}`;return`Ugyldig ${_[g.format]??U.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${U.divisor}`;case"unrecognized_keys":return`${U.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${Z(U.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${U.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${U.origin}`;default:return"Ugyldigt input"}}};function tJ(){return{localeError:rP()}}var hP=()=>{let $={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function I(U){return $[U]??null}let _={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},u={nan:"NaN",number:"Zahl",array:"Array"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Ungültige Eingabe: erwartet instanceof ${U.expected}, erhalten ${G}`;return`Ungültige Eingabe: erwartet ${g}, erhalten ${G}`}case"invalid_value":if(U.values.length===1)return`Ungültige Eingabe: erwartet ${b(U.values[0])}`;return`Ungültige Option: erwartet eine von ${Z(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`Zu groß: erwartet, dass ${U.origin??"Wert"} ${g}${U.maximum.toString()} ${z.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${U.origin??"Wert"} ${g}${U.maximum.toString()} ist`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`Zu klein: erwartet, dass ${U.origin} ${g}${U.minimum.toString()} ${z.unit} hat`;return`Zu klein: erwartet, dass ${U.origin} ${g}${U.minimum.toString()} ist`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Ungültiger String: muss mit "${g.prefix}" beginnen`;if(g.format==="ends_with")return`Ungültiger String: muss mit "${g.suffix}" enden`;if(g.format==="includes")return`Ungültiger String: muss "${g.includes}" enthalten`;if(g.format==="regex")return`Ungültiger String: muss dem Muster ${g.pattern} entsprechen`;return`Ungültig: ${_[g.format]??U.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${U.divisor} sein`;case"unrecognized_keys":return`${U.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${Z(U.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${U.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${U.origin}`;default:return"Ungültige Eingabe"}}};function aJ(){return{localeError:hP()}}var cP=()=>{let $={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function I(U){return $[U]??null}let _={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},u={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;return`Invalid input: expected ${g}, received ${G}`}case"invalid_value":if(U.values.length===1)return`Invalid input: expected ${b(U.values[0])}`;return`Invalid option: expected one of ${Z(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`Too big: expected ${U.origin??"value"} to have ${g}${U.maximum.toString()} ${z.unit??"elements"}`;return`Too big: expected ${U.origin??"value"} to be ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`Too small: expected ${U.origin} to have ${g}${U.minimum.toString()} ${z.unit}`;return`Too small: expected ${U.origin} to be ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Invalid string: must start with "${g.prefix}"`;if(g.format==="ends_with")return`Invalid string: must end with "${g.suffix}"`;if(g.format==="includes")return`Invalid string: must include "${g.includes}"`;if(g.format==="regex")return`Invalid string: must match pattern ${g.pattern}`;return`Invalid ${_[g.format]??U.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${U.divisor}`;case"unrecognized_keys":return`Unrecognized key${U.keys.length>1?"s":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`Invalid key in ${U.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${U.origin}`;default:return"Invalid input"}}};function B0(){return{localeError:cP()}}var dP=()=>{let $={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function I(U){return $[U]??null}let _={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-daŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},u={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Nevalida enigo: atendiĝis instanceof ${U.expected}, riceviĝis ${G}`;return`Nevalida enigo: atendiĝis ${g}, riceviĝis ${G}`}case"invalid_value":if(U.values.length===1)return`Nevalida enigo: atendiĝis ${b(U.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${Z(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`Tro granda: atendiĝis ke ${U.origin??"valoro"} havu ${g}${U.maximum.toString()} ${z.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${U.origin??"valoro"} havu ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`Tro malgranda: atendiĝis ke ${U.origin} havu ${g}${U.minimum.toString()} ${z.unit}`;return`Tro malgranda: atendiĝis ke ${U.origin} estu ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${g.prefix}"`;if(g.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${g.suffix}"`;if(g.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${g.includes}"`;if(g.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${g.pattern}`;return`Nevalida ${_[g.format]??U.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${U.divisor}`;case"unrecognized_keys":return`Nekonata${U.keys.length>1?"j":""} ŝlosilo${U.keys.length>1?"j":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${U.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${U.origin}`;default:return"Nevalida enigo"}}};function eJ(){return{localeError:dP()}}var oP=()=>{let $={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function I(U){return $[U]??null}let _={regex:"entrada",email:"dirección de correo electrónico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},u={nan:"NaN",string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Entrada inválida: se esperaba instanceof ${U.expected}, recibido ${G}`;return`Entrada inválida: se esperaba ${g}, recibido ${G}`}case"invalid_value":if(U.values.length===1)return`Entrada inválida: se esperaba ${b(U.values[0])}`;return`Opción inválida: se esperaba una de ${Z(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin),G=u[U.origin]??U.origin;if(z)return`Demasiado grande: se esperaba que ${G??"valor"} tuviera ${g}${U.maximum.toString()} ${z.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${G??"valor"} fuera ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin),G=u[U.origin]??U.origin;if(z)return`Demasiado pequeño: se esperaba que ${G} tuviera ${g}${U.minimum.toString()} ${z.unit}`;return`Demasiado pequeño: se esperaba que ${G} fuera ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Cadena inválida: debe comenzar con "${g.prefix}"`;if(g.format==="ends_with")return`Cadena inválida: debe terminar en "${g.suffix}"`;if(g.format==="includes")return`Cadena inválida: debe incluir "${g.includes}"`;if(g.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${g.pattern}`;return`Inválido ${_[g.format]??U.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${U.divisor}`;case"unrecognized_keys":return`Llave${U.keys.length>1?"s":""} desconocida${U.keys.length>1?"s":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`Llave inválida en ${u[U.origin]??U.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${u[U.origin]??U.origin}`;default:return"Entrada inválida"}}};function sJ(){return{localeError:oP()}}var pP=()=>{let $={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function I(U){return $[U]??null}let _={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"},u={nan:"NaN",number:"عدد",array:"آرایه"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`ورودی نامعتبر: میبایست instanceof ${U.expected} میبود، ${G} دریافت شد`;return`ورودی نامعتبر: میبایست ${g} میبود، ${G} دریافت شد`}case"invalid_value":if(U.values.length===1)return`ورودی نامعتبر: میبایست ${b(U.values[0])} میبود`;return`گزینه نامعتبر: میبایست یکی از ${Z(U.values,"|")} میبود`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`خیلی بزرگ: ${U.origin??"مقدار"} باید ${g}${U.maximum.toString()} ${z.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${U.origin??"مقدار"} باید ${g}${U.maximum.toString()} باشد`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`خیلی کوچک: ${U.origin} باید ${g}${U.minimum.toString()} ${z.unit} باشد`;return`خیلی کوچک: ${U.origin} باید ${g}${U.minimum.toString()} باشد`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`رشته نامعتبر: باید با "${g.prefix}" شروع شود`;if(g.format==="ends_with")return`رشته نامعتبر: باید با "${g.suffix}" تمام شود`;if(g.format==="includes")return`رشته نامعتبر: باید شامل "${g.includes}" باشد`;if(g.format==="regex")return`رشته نامعتبر: باید با الگوی ${g.pattern} مطابقت داشته باشد`;return`${_[g.format]??U.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${U.divisor} باشد`;case"unrecognized_keys":return`کلید${U.keys.length>1?"های":""} ناشناس: ${Z(U.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${U.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${U.origin}`;default:return"ورودی نامعتبر"}}};function $8(){return{localeError:pP()}}var tP=()=>{let $={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}};function I(U){return $[U]??null}let _={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},u={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Virheellinen tyyppi: odotettiin instanceof ${U.expected}, oli ${G}`;return`Virheellinen tyyppi: odotettiin ${g}, oli ${G}`}case"invalid_value":if(U.values.length===1)return`Virheellinen syöte: täytyy olla ${b(U.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${Z(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`Liian suuri: ${z.subject} täytyy olla ${g}${U.maximum.toString()} ${z.unit}`.trim();return`Liian suuri: arvon täytyy olla ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`Liian pieni: ${z.subject} täytyy olla ${g}${U.minimum.toString()} ${z.unit}`.trim();return`Liian pieni: arvon täytyy olla ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${g.prefix}"`;if(g.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${g.suffix}"`;if(g.format==="includes")return`Virheellinen syöte: täytyy sisältää "${g.includes}"`;if(g.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${g.pattern}`;return`Virheellinen ${_[g.format]??U.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${U.divisor} monikerta`;case"unrecognized_keys":return`${U.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${Z(U.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}}};function I8(){return{localeError:tP()}}var aP=()=>{let $={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function I(U){return $[U]??null}let _={regex:"entrée",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},u={nan:"NaN",number:"nombre",array:"tableau"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Entrée invalide : instanceof ${U.expected} attendu, ${G} reçu`;return`Entrée invalide : ${g} attendu, ${G} reçu`}case"invalid_value":if(U.values.length===1)return`Entrée invalide : ${b(U.values[0])} attendu`;return`Option invalide : une valeur parmi ${Z(U.values,"|")} attendue`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`Trop grand : ${U.origin??"valeur"} doit ${z.verb} ${g}${U.maximum.toString()} ${z.unit??"élément(s)"}`;return`Trop grand : ${U.origin??"valeur"} doit être ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`Trop petit : ${U.origin} doit ${z.verb} ${g}${U.minimum.toString()} ${z.unit}`;return`Trop petit : ${U.origin} doit être ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Chaîne invalide : doit commencer par "${g.prefix}"`;if(g.format==="ends_with")return`Chaîne invalide : doit se terminer par "${g.suffix}"`;if(g.format==="includes")return`Chaîne invalide : doit inclure "${g.includes}"`;if(g.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${g.pattern}`;return`${_[g.format]??U.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${U.divisor}`;case"unrecognized_keys":return`Clé${U.keys.length>1?"s":""} non reconnue${U.keys.length>1?"s":""} : ${Z(U.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${U.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${U.origin}`;default:return"Entrée invalide"}}};function U8(){return{localeError:aP()}}var eP=()=>{let $={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function I(U){return $[U]??null}let _={regex:"entrée",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},u={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Entrée invalide : attendu instanceof ${U.expected}, reçu ${G}`;return`Entrée invalide : attendu ${g}, reçu ${G}`}case"invalid_value":if(U.values.length===1)return`Entrée invalide : attendu ${b(U.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${Z(U.values,"|")}`;case"too_big":{let g=U.inclusive?"≤":"<",z=I(U.origin);if(z)return`Trop grand : attendu que ${U.origin??"la valeur"} ait ${g}${U.maximum.toString()} ${z.unit}`;return`Trop grand : attendu que ${U.origin??"la valeur"} soit ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?"≥":">",z=I(U.origin);if(z)return`Trop petit : attendu que ${U.origin} ait ${g}${U.minimum.toString()} ${z.unit}`;return`Trop petit : attendu que ${U.origin} soit ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Chaîne invalide : doit commencer par "${g.prefix}"`;if(g.format==="ends_with")return`Chaîne invalide : doit se terminer par "${g.suffix}"`;if(g.format==="includes")return`Chaîne invalide : doit inclure "${g.includes}"`;if(g.format==="regex")return`Chaîne invalide : doit correspondre au motif ${g.pattern}`;return`${_[g.format]??U.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${U.divisor}`;case"unrecognized_keys":return`Clé${U.keys.length>1?"s":""} non reconnue${U.keys.length>1?"s":""} : ${Z(U.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${U.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${U.origin}`;default:return"Entrée invalide"}}};function _8(){return{localeError:eP()}}var sP=()=>{let $={string:{label:"מחרוזת",gender:"f"},number:{label:"מספר",gender:"m"},boolean:{label:"ערך בוליאני",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"תאריך",gender:"m"},array:{label:"מערך",gender:"m"},object:{label:"אובייקט",gender:"m"},null:{label:"ערך ריק (null)",gender:"m"},undefined:{label:"ערך לא מוגדר (undefined)",gender:"m"},symbol:{label:"סימבול (Symbol)",gender:"m"},function:{label:"פונקציה",gender:"f"},map:{label:"מפה (Map)",gender:"f"},set:{label:"קבוצה (Set)",gender:"f"},file:{label:"קובץ",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"ערך לא ידוע",gender:"m"},value:{label:"ערך",gender:"m"}},I={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},_=(X)=>X?$[X]:void 0,u=(X)=>{let N=_(X);if(N)return N.label;return X??$.unknown.label},U=(X)=>`ה${u(X)}`,g=(X)=>{return(_(X)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות"},z=(X)=>{if(!X)return null;return I[X]??null},G={regex:{label:"קלט",gender:"m"},email:{label:"כתובת אימייל",gender:"f"},url:{label:"כתובת רשת",gender:"f"},emoji:{label:"אימוג'י",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"תאריך וזמן ISO",gender:"m"},date:{label:"תאריך ISO",gender:"m"},time:{label:"זמן ISO",gender:"m"},duration:{label:"משך זמן ISO",gender:"m"},ipv4:{label:"כתובת IPv4",gender:"f"},ipv6:{label:"כתובת IPv6",gender:"f"},cidrv4:{label:"טווח IPv4",gender:"m"},cidrv6:{label:"טווח IPv6",gender:"m"},base64:{label:"מחרוזת בבסיס 64",gender:"f"},base64url:{label:"מחרוזת בבסיס 64 לכתובות רשת",gender:"f"},json_string:{label:"מחרוזת JSON",gender:"f"},e164:{label:"מספר E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"קלט",gender:"m"},includes:{label:"קלט",gender:"m"},lowercase:{label:"קלט",gender:"m"},starts_with:{label:"קלט",gender:"m"},uppercase:{label:"קלט",gender:"m"}},J={nan:"NaN"};return(X)=>{switch(X.code){case"invalid_type":{let N=X.expected,q=J[N??""]??u(N),Q=P(X.input),Y=J[Q]??$[Q]?.label??Q;if(/^[A-Z]/.test(X.expected))return`קלט לא תקין: צריך להיות instanceof ${X.expected}, התקבל ${Y}`;return`קלט לא תקין: צריך להיות ${q}, התקבל ${Y}`}case"invalid_value":{if(X.values.length===1)return`ערך לא תקין: הערך חייב להיות ${b(X.values[0])}`;let N=X.values.map((Y)=>b(Y));if(X.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${N[0]} או ${N[1]}`;let q=N[N.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${N.slice(0,-1).join(", ")} או ${q}`}case"too_big":{let N=z(X.origin),q=U(X.origin??"value");if(X.origin==="string")return`${N?.longLabel??"ארוך"} מדי: ${q} צריכה להכיל ${X.maximum.toString()} ${N?.unit??""} ${X.inclusive?"או פחות":"לכל היותר"}`.trim();if(X.origin==="number"){let O=X.inclusive?`קטן או שווה ל-${X.maximum}`:`קטן מ-${X.maximum}`;return`גדול מדי: ${q} צריך להיות ${O}`}if(X.origin==="array"||X.origin==="set"){let O=X.origin==="set"?"צריכה":"צריך",H=X.inclusive?`${X.maximum} ${N?.unit??""} או פחות`:`פחות מ-${X.maximum} ${N?.unit??""}`;return`גדול מדי: ${q} ${O} להכיל ${H}`.trim()}let Q=X.inclusive?"<=":"<",Y=g(X.origin??"value");if(N?.unit)return`${N.longLabel} מדי: ${q} ${Y} ${Q}${X.maximum.toString()} ${N.unit}`;return`${N?.longLabel??"גדול"} מדי: ${q} ${Y} ${Q}${X.maximum.toString()}`}case"too_small":{let N=z(X.origin),q=U(X.origin??"value");if(X.origin==="string")return`${N?.shortLabel??"קצר"} מדי: ${q} צריכה להכיל ${X.minimum.toString()} ${N?.unit??""} ${X.inclusive?"או יותר":"לפחות"}`.trim();if(X.origin==="number"){let O=X.inclusive?`גדול או שווה ל-${X.minimum}`:`גדול מ-${X.minimum}`;return`קטן מדי: ${q} צריך להיות ${O}`}if(X.origin==="array"||X.origin==="set"){let O=X.origin==="set"?"צריכה":"צריך";if(X.minimum===1&&X.inclusive){let v=X.origin==="set"?"לפחות פריט אחד":"לפחות פריט אחד";return`קטן מדי: ${q} ${O} להכיל ${v}`}let H=X.inclusive?`${X.minimum} ${N?.unit??""} או יותר`:`יותר מ-${X.minimum} ${N?.unit??""}`;return`קטן מדי: ${q} ${O} להכיל ${H}`.trim()}let Q=X.inclusive?">=":">",Y=g(X.origin??"value");if(N?.unit)return`${N.shortLabel} מדי: ${q} ${Y} ${Q}${X.minimum.toString()} ${N.unit}`;return`${N?.shortLabel??"קטן"} מדי: ${q} ${Y} ${Q}${X.minimum.toString()}`}case"invalid_format":{let N=X;if(N.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${N.prefix}"`;if(N.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${N.suffix}"`;if(N.format==="includes")return`המחרוזת חייבת לכלול "${N.includes}"`;if(N.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${N.pattern}`;let q=G[N.format],Q=q?.label??N.format,O=(q?.gender??"m")==="f"?"תקינה":"תקין";return`${Q} לא ${O}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${X.divisor}`;case"unrecognized_keys":return`מפתח${X.keys.length>1?"ות":""} לא מזוה${X.keys.length>1?"ים":"ה"}: ${Z(X.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${U(X.origin??"array")}`;default:return"קלט לא תקין"}}};function u8(){return{localeError:sP()}}var $j=()=>{let $={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function I(U){return $[U]??null}let _={regex:"bemenet",email:"email cím",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"},u={nan:"NaN",number:"szám",array:"tömb"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Érvénytelen bemenet: a várt érték instanceof ${U.expected}, a kapott érték ${G}`;return`Érvénytelen bemenet: a várt érték ${g}, a kapott érték ${G}`}case"invalid_value":if(U.values.length===1)return`Érvénytelen bemenet: a várt érték ${b(U.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${Z(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`Túl nagy: ${U.origin??"érték"} mérete túl nagy ${g}${U.maximum.toString()} ${z.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${U.origin??"érték"} túl nagy: ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`Túl kicsi: a bemeneti érték ${U.origin} mérete túl kicsi ${g}${U.minimum.toString()} ${z.unit}`;return`Túl kicsi: a bemeneti érték ${U.origin} túl kicsi ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Érvénytelen string: "${g.prefix}" értékkel kell kezdődnie`;if(g.format==="ends_with")return`Érvénytelen string: "${g.suffix}" értékkel kell végződnie`;if(g.format==="includes")return`Érvénytelen string: "${g.includes}" értéket kell tartalmaznia`;if(g.format==="regex")return`Érvénytelen string: ${g.pattern} mintának kell megfelelnie`;return`Érvénytelen ${_[g.format]??U.format}`}case"not_multiple_of":return`Érvénytelen szám: ${U.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${U.keys.length>1?"s":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${U.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${U.origin}`;default:return"Érvénytelen bemenet"}}};function g8(){return{localeError:$j()}}function K7($,I,_){return Math.abs($)===1?I:_}function y1($){if(!$)return"";let I=["ա","ե","ը","ի","ո","ու","օ"],_=$[$.length-1];return $+(I.includes(_)?"ն":"ը")}var Ij=()=>{let $={string:{unit:{one:"նշան",many:"նշաններ"},verb:"ունենալ"},file:{unit:{one:"բայթ",many:"բայթեր"},verb:"ունենալ"},array:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"},set:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"}};function I(U){return $[U]??null}let _={regex:"մուտք",email:"էլ. հասցե",url:"URL",emoji:"էմոջի",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO ամսաթիվ և ժամ",date:"ISO ամսաթիվ",time:"ISO ժամ",duration:"ISO տևողություն",ipv4:"IPv4 հասցե",ipv6:"IPv6 հասցե",cidrv4:"IPv4 միջակայք",cidrv6:"IPv6 միջակայք",base64:"base64 ձևաչափով տող",base64url:"base64url ձևաչափով տող",json_string:"JSON տող",e164:"E.164 համար",jwt:"JWT",template_literal:"մուտք"},u={nan:"NaN",number:"թիվ",array:"զանգված"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Սխալ մուտքագրում․ սպասվում էր instanceof ${U.expected}, ստացվել է ${G}`;return`Սխալ մուտքագրում․ սպասվում էր ${g}, ստացվել է ${G}`}case"invalid_value":if(U.values.length===1)return`Սխալ մուտքագրում․ սպասվում էր ${b(U.values[1])}`;return`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${Z(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z){let G=Number(U.maximum),J=K7(G,z.unit.one,z.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${y1(U.origin??"արժեք")} կունենա ${g}${U.maximum.toString()} ${J}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${y1(U.origin??"արժեք")} լինի ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z){let G=Number(U.minimum),J=K7(G,z.unit.one,z.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${y1(U.origin)} կունենա ${g}${U.minimum.toString()} ${J}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${y1(U.origin)} լինի ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Սխալ տող․ պետք է սկսվի "${g.prefix}"-ով`;if(g.format==="ends_with")return`Սխալ տող․ պետք է ավարտվի "${g.suffix}"-ով`;if(g.format==="includes")return`Սխալ տող․ պետք է պարունակի "${g.includes}"`;if(g.format==="regex")return`Սխալ տող․ պետք է համապատասխանի ${g.pattern} ձևաչափին`;return`Սխալ ${_[g.format]??U.format}`}case"not_multiple_of":return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${U.divisor}-ի`;case"unrecognized_keys":return`Չճանաչված բանալի${U.keys.length>1?"ներ":""}. ${Z(U.keys,", ")}`;case"invalid_key":return`Սխալ բանալի ${y1(U.origin)}-ում`;case"invalid_union":return"Սխալ մուտքագրում";case"invalid_element":return`Սխալ արժեք ${y1(U.origin)}-ում`;default:return"Սխալ մուտքագրում"}}};function z8(){return{localeError:Ij()}}var Uj=()=>{let $={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function I(U){return $[U]??null}let _={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},u={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Input tidak valid: diharapkan instanceof ${U.expected}, diterima ${G}`;return`Input tidak valid: diharapkan ${g}, diterima ${G}`}case"invalid_value":if(U.values.length===1)return`Input tidak valid: diharapkan ${b(U.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${Z(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`Terlalu besar: diharapkan ${U.origin??"value"} memiliki ${g}${U.maximum.toString()} ${z.unit??"elemen"}`;return`Terlalu besar: diharapkan ${U.origin??"value"} menjadi ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`Terlalu kecil: diharapkan ${U.origin} memiliki ${g}${U.minimum.toString()} ${z.unit}`;return`Terlalu kecil: diharapkan ${U.origin} menjadi ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`String tidak valid: harus dimulai dengan "${g.prefix}"`;if(g.format==="ends_with")return`String tidak valid: harus berakhir dengan "${g.suffix}"`;if(g.format==="includes")return`String tidak valid: harus menyertakan "${g.includes}"`;if(g.format==="regex")return`String tidak valid: harus sesuai pola ${g.pattern}`;return`${_[g.format]??U.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${U.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${U.keys.length>1?"s":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${U.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${U.origin}`;default:return"Input tidak valid"}}};function G8(){return{localeError:Uj()}}var _j=()=>{let $={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function I(U){return $[U]??null}let _={regex:"gildi",email:"netfang",url:"vefslóð",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og tími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",jwt:"JWT",template_literal:"gildi"},u={nan:"NaN",number:"númer",array:"fylki"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Rangt gildi: Þú slóst inn ${G} þar sem á að vera instanceof ${U.expected}`;return`Rangt gildi: Þú slóst inn ${G} þar sem á að vera ${g}`}case"invalid_value":if(U.values.length===1)return`Rangt gildi: gert ráð fyrir ${b(U.values[0])}`;return`Ógilt val: má vera eitt af eftirfarandi ${Z(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`Of stórt: gert er ráð fyrir að ${U.origin??"gildi"} hafi ${g}${U.maximum.toString()} ${z.unit??"hluti"}`;return`Of stórt: gert er ráð fyrir að ${U.origin??"gildi"} sé ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`Of lítið: gert er ráð fyrir að ${U.origin} hafi ${g}${U.minimum.toString()} ${z.unit}`;return`Of lítið: gert er ráð fyrir að ${U.origin} sé ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Ógildur strengur: verður að byrja á "${g.prefix}"`;if(g.format==="ends_with")return`Ógildur strengur: verður að enda á "${g.suffix}"`;if(g.format==="includes")return`Ógildur strengur: verður að innihalda "${g.includes}"`;if(g.format==="regex")return`Ógildur strengur: verður að fylgja mynstri ${g.pattern}`;return`Rangt ${_[g.format]??U.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${U.divisor}`;case"unrecognized_keys":return`Óþekkt ${U.keys.length>1?"ir lyklar":"ur lykill"}: ${Z(U.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${U.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${U.origin}`;default:return"Rangt gildi"}}};function J8(){return{localeError:_j()}}var uj=()=>{let $={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function I(U){return $[U]??null}let _={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},u={nan:"NaN",number:"numero",array:"vettore"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Input non valido: atteso instanceof ${U.expected}, ricevuto ${G}`;return`Input non valido: atteso ${g}, ricevuto ${G}`}case"invalid_value":if(U.values.length===1)return`Input non valido: atteso ${b(U.values[0])}`;return`Opzione non valida: atteso uno tra ${Z(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`Troppo grande: ${U.origin??"valore"} deve avere ${g}${U.maximum.toString()} ${z.unit??"elementi"}`;return`Troppo grande: ${U.origin??"valore"} deve essere ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`Troppo piccolo: ${U.origin} deve avere ${g}${U.minimum.toString()} ${z.unit}`;return`Troppo piccolo: ${U.origin} deve essere ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Stringa non valida: deve iniziare con "${g.prefix}"`;if(g.format==="ends_with")return`Stringa non valida: deve terminare con "${g.suffix}"`;if(g.format==="includes")return`Stringa non valida: deve includere "${g.includes}"`;if(g.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${g.pattern}`;return`Invalid ${_[g.format]??U.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${U.divisor}`;case"unrecognized_keys":return`Chiav${U.keys.length>1?"i":"e"} non riconosciut${U.keys.length>1?"e":"a"}: ${Z(U.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${U.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${U.origin}`;default:return"Input non valido"}}};function X8(){return{localeError:uj()}}var gj=()=>{let $={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function I(U){return $[U]??null}let _={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"},u={nan:"NaN",number:"数値",array:"配列"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`無効な入力: instanceof ${U.expected}が期待されましたが、${G}が入力されました`;return`無効な入力: ${g}が期待されましたが、${G}が入力されました`}case"invalid_value":if(U.values.length===1)return`無効な入力: ${b(U.values[0])}が期待されました`;return`無効な選択: ${Z(U.values,"、")}のいずれかである必要があります`;case"too_big":{let g=U.inclusive?"以下である":"より小さい",z=I(U.origin);if(z)return`大きすぎる値: ${U.origin??"値"}は${U.maximum.toString()}${z.unit??"要素"}${g}必要があります`;return`大きすぎる値: ${U.origin??"値"}は${U.maximum.toString()}${g}必要があります`}case"too_small":{let g=U.inclusive?"以上である":"より大きい",z=I(U.origin);if(z)return`小さすぎる値: ${U.origin}は${U.minimum.toString()}${z.unit}${g}必要があります`;return`小さすぎる値: ${U.origin}は${U.minimum.toString()}${g}必要があります`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`無効な文字列: "${g.prefix}"で始まる必要があります`;if(g.format==="ends_with")return`無効な文字列: "${g.suffix}"で終わる必要があります`;if(g.format==="includes")return`無効な文字列: "${g.includes}"を含む必要があります`;if(g.format==="regex")return`無効な文字列: パターン${g.pattern}に一致する必要があります`;return`無効な${_[g.format]??U.format}`}case"not_multiple_of":return`無効な数値: ${U.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${U.keys.length>1?"群":""}: ${Z(U.keys,"、")}`;case"invalid_key":return`${U.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${U.origin}内の無効な値`;default:return"無効な入力"}}};function q8(){return{localeError:gj()}}var zj=()=>{let $={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function I(U){return $[U]??null}let _={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული სტრინგი",base64url:"base64url-კოდირებული სტრინგი",json_string:"JSON სტრინგი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"},u={nan:"NaN",number:"რიცხვი",string:"სტრინგი",boolean:"ბულეანი",function:"ფუნქცია",array:"მასივი"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`არასწორი შეყვანა: მოსალოდნელი instanceof ${U.expected}, მიღებული ${G}`;return`არასწორი შეყვანა: მოსალოდნელი ${g}, მიღებული ${G}`}case"invalid_value":if(U.values.length===1)return`არასწორი შეყვანა: მოსალოდნელი ${b(U.values[0])}`;return`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${Z(U.values,"|")}-დან`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`ზედმეტად დიდი: მოსალოდნელი ${U.origin??"მნიშვნელობა"} ${z.verb} ${g}${U.maximum.toString()} ${z.unit}`;return`ზედმეტად დიდი: მოსალოდნელი ${U.origin??"მნიშვნელობა"} იყოს ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`ზედმეტად პატარა: მოსალოდნელი ${U.origin} ${z.verb} ${g}${U.minimum.toString()} ${z.unit}`;return`ზედმეტად პატარა: მოსალოდნელი ${U.origin} იყოს ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`არასწორი სტრინგი: უნდა იწყებოდეს "${g.prefix}"-ით`;if(g.format==="ends_with")return`არასწორი სტრინგი: უნდა მთავრდებოდეს "${g.suffix}"-ით`;if(g.format==="includes")return`არასწორი სტრინგი: უნდა შეიცავდეს "${g.includes}"-ს`;if(g.format==="regex")return`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${g.pattern}`;return`არასწორი ${_[g.format]??U.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${U.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${U.keys.length>1?"ები":"ი"}: ${Z(U.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${U.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${U.origin}-ში`;default:return"არასწორი შეყვანა"}}};function N8(){return{localeError:zj()}}var Gj=()=>{let $={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function I(U){return $[U]??null}let _={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"},u={nan:"NaN",number:"លេខ",array:"អារេ (Array)",null:"គ្មានតម្លៃ (null)"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${U.expected} ប៉ុន្តែទទួលបាន ${G}`;return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${g} ប៉ុន្តែទទួលបាន ${G}`}case"invalid_value":if(U.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${b(U.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${Z(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`ធំពេក៖ ត្រូវការ ${U.origin??"តម្លៃ"} ${g} ${U.maximum.toString()} ${z.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${U.origin??"តម្លៃ"} ${g} ${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`តូចពេក៖ ត្រូវការ ${U.origin} ${g} ${U.minimum.toString()} ${z.unit}`;return`តូចពេក៖ ត្រូវការ ${U.origin} ${g} ${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${g.prefix}"`;if(g.format==="ends_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${g.suffix}"`;if(g.format==="includes")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${g.includes}"`;if(g.format==="regex")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${g.pattern}`;return`មិនត្រឹមត្រូវ៖ ${_[g.format]??U.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${U.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${Z(U.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${U.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${U.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function K0(){return{localeError:Gj()}}function Q8(){return K0()}var Jj=()=>{let $={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function I(U){return $[U]??null}let _={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"},u={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`잘못된 입력: 예상 타입은 instanceof ${U.expected}, 받은 타입은 ${G}입니다`;return`잘못된 입력: 예상 타입은 ${g}, 받은 타입은 ${G}입니다`}case"invalid_value":if(U.values.length===1)return`잘못된 입력: 값은 ${b(U.values[0])} 이어야 합니다`;return`잘못된 옵션: ${Z(U.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let g=U.inclusive?"이하":"미만",z=g==="미만"?"이어야 합니다":"여야 합니다",G=I(U.origin),J=G?.unit??"요소";if(G)return`${U.origin??"값"}이 너무 큽니다: ${U.maximum.toString()}${J} ${g}${z}`;return`${U.origin??"값"}이 너무 큽니다: ${U.maximum.toString()} ${g}${z}`}case"too_small":{let g=U.inclusive?"이상":"초과",z=g==="이상"?"이어야 합니다":"여야 합니다",G=I(U.origin),J=G?.unit??"요소";if(G)return`${U.origin??"값"}이 너무 작습니다: ${U.minimum.toString()}${J} ${g}${z}`;return`${U.origin??"값"}이 너무 작습니다: ${U.minimum.toString()} ${g}${z}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`잘못된 문자열: "${g.prefix}"(으)로 시작해야 합니다`;if(g.format==="ends_with")return`잘못된 문자열: "${g.suffix}"(으)로 끝나야 합니다`;if(g.format==="includes")return`잘못된 문자열: "${g.includes}"을(를) 포함해야 합니다`;if(g.format==="regex")return`잘못된 문자열: 정규식 ${g.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${_[g.format]??U.format}`}case"not_multiple_of":return`잘못된 숫자: ${U.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${Z(U.keys,", ")}`;case"invalid_key":return`잘못된 키: ${U.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${U.origin}`;default:return"잘못된 입력"}}};function H8(){return{localeError:Jj()}}var W0=($)=>{return $.charAt(0).toUpperCase()+$.slice(1)};function W7($){let I=Math.abs($),_=I%10,u=I%100;if(u>=11&&u<=19||_===0)return"many";if(_===1)return"one";return"few"}var Xj=()=>{let $={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function I(U,g,z,G){let J=$[U]??null;if(J===null)return J;return{unit:J.unit[g],verb:J.verb[G][z?"inclusive":"notInclusive"]}}let _={regex:"įvestis",email:"el. pašto adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukmė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"},u={nan:"NaN",number:"skaičius",bigint:"sveikasis skaičius",string:"eilutė",boolean:"loginė reikšmė",undefined:"neapibrėžta reikšmė",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulinė reikšmė"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Gautas tipas ${G}, o tikėtasi - instanceof ${U.expected}`;return`Gautas tipas ${G}, o tikėtasi - ${g}`}case"invalid_value":if(U.values.length===1)return`Privalo būti ${b(U.values[0])}`;return`Privalo būti vienas iš ${Z(U.values,"|")} pasirinkimų`;case"too_big":{let g=u[U.origin]??U.origin,z=I(U.origin,W7(Number(U.maximum)),U.inclusive??!1,"smaller");if(z?.verb)return`${W0(g??U.origin??"reikšmė")} ${z.verb} ${U.maximum.toString()} ${z.unit??"elementų"}`;let G=U.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${W0(g??U.origin??"reikšmė")} turi būti ${G} ${U.maximum.toString()} ${z?.unit}`}case"too_small":{let g=u[U.origin]??U.origin,z=I(U.origin,W7(Number(U.minimum)),U.inclusive??!1,"bigger");if(z?.verb)return`${W0(g??U.origin??"reikšmė")} ${z.verb} ${U.minimum.toString()} ${z.unit??"elementų"}`;let G=U.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${W0(g??U.origin??"reikšmė")} turi būti ${G} ${U.minimum.toString()} ${z?.unit}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Eilutė privalo prasidėti "${g.prefix}"`;if(g.format==="ends_with")return`Eilutė privalo pasibaigti "${g.suffix}"`;if(g.format==="includes")return`Eilutė privalo įtraukti "${g.includes}"`;if(g.format==="regex")return`Eilutė privalo atitikti ${g.pattern}`;return`Neteisingas ${_[g.format]??U.format}`}case"not_multiple_of":return`Skaičius privalo būti ${U.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${U.keys.length>1?"i":"as"} rakt${U.keys.length>1?"ai":"as"}: ${Z(U.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let g=u[U.origin]??U.origin;return`${W0(g??U.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function Y8(){return{localeError:Xj()}}var qj=()=>{let $={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function I(U){return $[U]??null}let _={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"},u={nan:"NaN",number:"број",array:"низа"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Грешен внес: се очекува instanceof ${U.expected}, примено ${G}`;return`Грешен внес: се очекува ${g}, примено ${G}`}case"invalid_value":if(U.values.length===1)return`Invalid input: expected ${b(U.values[0])}`;return`Грешана опција: се очекува една ${Z(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`Премногу голем: се очекува ${U.origin??"вредноста"} да има ${g}${U.maximum.toString()} ${z.unit??"елементи"}`;return`Премногу голем: се очекува ${U.origin??"вредноста"} да биде ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`Премногу мал: се очекува ${U.origin} да има ${g}${U.minimum.toString()} ${z.unit}`;return`Премногу мал: се очекува ${U.origin} да биде ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Неважечка низа: мора да започнува со "${g.prefix}"`;if(g.format==="ends_with")return`Неважечка низа: мора да завршува со "${g.suffix}"`;if(g.format==="includes")return`Неважечка низа: мора да вклучува "${g.includes}"`;if(g.format==="regex")return`Неважечка низа: мора да одгоара на патернот ${g.pattern}`;return`Invalid ${_[g.format]??U.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${U.divisor}`;case"unrecognized_keys":return`${U.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${Z(U.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${U.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${U.origin}`;default:return"Грешен внес"}}};function O8(){return{localeError:qj()}}var Nj=()=>{let $={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function I(U){return $[U]??null}let _={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},u={nan:"NaN",number:"nombor"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Input tidak sah: dijangka instanceof ${U.expected}, diterima ${G}`;return`Input tidak sah: dijangka ${g}, diterima ${G}`}case"invalid_value":if(U.values.length===1)return`Input tidak sah: dijangka ${b(U.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${Z(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`Terlalu besar: dijangka ${U.origin??"nilai"} ${z.verb} ${g}${U.maximum.toString()} ${z.unit??"elemen"}`;return`Terlalu besar: dijangka ${U.origin??"nilai"} adalah ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`Terlalu kecil: dijangka ${U.origin} ${z.verb} ${g}${U.minimum.toString()} ${z.unit}`;return`Terlalu kecil: dijangka ${U.origin} adalah ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`String tidak sah: mesti bermula dengan "${g.prefix}"`;if(g.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${g.suffix}"`;if(g.format==="includes")return`String tidak sah: mesti mengandungi "${g.includes}"`;if(g.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${g.pattern}`;return`${_[g.format]??U.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${U.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${Z(U.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${U.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${U.origin}`;default:return"Input tidak sah"}}};function v8(){return{localeError:Nj()}}var Qj=()=>{let $={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function I(U){return $[U]??null}let _={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},u={nan:"NaN",number:"getal"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Ongeldige invoer: verwacht instanceof ${U.expected}, ontving ${G}`;return`Ongeldige invoer: verwacht ${g}, ontving ${G}`}case"invalid_value":if(U.values.length===1)return`Ongeldige invoer: verwacht ${b(U.values[0])}`;return`Ongeldige optie: verwacht één van ${Z(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin),G=U.origin==="date"?"laat":U.origin==="string"?"lang":"groot";if(z)return`Te ${G}: verwacht dat ${U.origin??"waarde"} ${g}${U.maximum.toString()} ${z.unit??"elementen"} ${z.verb}`;return`Te ${G}: verwacht dat ${U.origin??"waarde"} ${g}${U.maximum.toString()} is`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin),G=U.origin==="date"?"vroeg":U.origin==="string"?"kort":"klein";if(z)return`Te ${G}: verwacht dat ${U.origin} ${g}${U.minimum.toString()} ${z.unit} ${z.verb}`;return`Te ${G}: verwacht dat ${U.origin} ${g}${U.minimum.toString()} is`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Ongeldige tekst: moet met "${g.prefix}" beginnen`;if(g.format==="ends_with")return`Ongeldige tekst: moet op "${g.suffix}" eindigen`;if(g.format==="includes")return`Ongeldige tekst: moet "${g.includes}" bevatten`;if(g.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${g.pattern}`;return`Ongeldig: ${_[g.format]??U.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${U.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${U.keys.length>1?"s":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${U.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${U.origin}`;default:return"Ongeldige invoer"}}};function T8(){return{localeError:Qj()}}var Hj=()=>{let $={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function I(U){return $[U]??null}let _={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},u={nan:"NaN",number:"tall",array:"liste"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Ugyldig input: forventet instanceof ${U.expected}, fikk ${G}`;return`Ugyldig input: forventet ${g}, fikk ${G}`}case"invalid_value":if(U.values.length===1)return`Ugyldig verdi: forventet ${b(U.values[0])}`;return`Ugyldig valg: forventet en av ${Z(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`For stor(t): forventet ${U.origin??"value"} til å ha ${g}${U.maximum.toString()} ${z.unit??"elementer"}`;return`For stor(t): forventet ${U.origin??"value"} til å ha ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`For lite(n): forventet ${U.origin} til å ha ${g}${U.minimum.toString()} ${z.unit}`;return`For lite(n): forventet ${U.origin} til å ha ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Ugyldig streng: må starte med "${g.prefix}"`;if(g.format==="ends_with")return`Ugyldig streng: må ende med "${g.suffix}"`;if(g.format==="includes")return`Ugyldig streng: må inneholde "${g.includes}"`;if(g.format==="regex")return`Ugyldig streng: må matche mønsteret ${g.pattern}`;return`Ugyldig ${_[g.format]??U.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${U.divisor}`;case"unrecognized_keys":return`${U.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${Z(U.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${U.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${U.origin}`;default:return"Ugyldig input"}}};function M8(){return{localeError:Hj()}}var Yj=()=>{let $={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function I(U){return $[U]??null}let _={regex:"giren",email:"epostagâh",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"},u={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Fâsit giren: umulan instanceof ${U.expected}, alınan ${G}`;return`Fâsit giren: umulan ${g}, alınan ${G}`}case"invalid_value":if(U.values.length===1)return`Fâsit giren: umulan ${b(U.values[0])}`;return`Fâsit tercih: mûteberler ${Z(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`Fazla büyük: ${U.origin??"value"}, ${g}${U.maximum.toString()} ${z.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${U.origin??"value"}, ${g}${U.maximum.toString()} olmalıydı.`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`Fazla küçük: ${U.origin}, ${g}${U.minimum.toString()} ${z.unit} sahip olmalıydı.`;return`Fazla küçük: ${U.origin}, ${g}${U.minimum.toString()} olmalıydı.`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Fâsit metin: "${g.prefix}" ile başlamalı.`;if(g.format==="ends_with")return`Fâsit metin: "${g.suffix}" ile bitmeli.`;if(g.format==="includes")return`Fâsit metin: "${g.includes}" ihtivâ etmeli.`;if(g.format==="regex")return`Fâsit metin: ${g.pattern} nakşına uymalı.`;return`Fâsit ${_[g.format]??U.format}`}case"not_multiple_of":return`Fâsit sayı: ${U.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${U.keys.length>1?"s":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`${U.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${U.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function D8(){return{localeError:Yj()}}var Oj=()=>{let $={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function I(U){return $[U]??null}let _={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"},u={nan:"NaN",number:"عدد",array:"ارې"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`ناسم ورودي: باید instanceof ${U.expected} وای, مګر ${G} ترلاسه شو`;return`ناسم ورودي: باید ${g} وای, مګر ${G} ترلاسه شو`}case"invalid_value":if(U.values.length===1)return`ناسم ورودي: باید ${b(U.values[0])} وای`;return`ناسم انتخاب: باید یو له ${Z(U.values,"|")} څخه وای`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`ډیر لوی: ${U.origin??"ارزښت"} باید ${g}${U.maximum.toString()} ${z.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${U.origin??"ارزښت"} باید ${g}${U.maximum.toString()} وي`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`ډیر کوچنی: ${U.origin} باید ${g}${U.minimum.toString()} ${z.unit} ولري`;return`ډیر کوچنی: ${U.origin} باید ${g}${U.minimum.toString()} وي`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`ناسم متن: باید د "${g.prefix}" سره پیل شي`;if(g.format==="ends_with")return`ناسم متن: باید د "${g.suffix}" سره پای ته ورسيږي`;if(g.format==="includes")return`ناسم متن: باید "${g.includes}" ولري`;if(g.format==="regex")return`ناسم متن: باید د ${g.pattern} سره مطابقت ولري`;return`${_[g.format]??U.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${U.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${U.keys.length>1?"کلیډونه":"کلیډ"}: ${Z(U.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${U.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${U.origin} کې`;default:return"ناسمه ورودي"}}};function L8(){return{localeError:Oj()}}var vj=()=>{let $={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function I(U){return $[U]??null}let _={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"},u={nan:"NaN",number:"liczba",array:"tablica"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${U.expected}, otrzymano ${G}`;return`Nieprawidłowe dane wejściowe: oczekiwano ${g}, otrzymano ${G}`}case"invalid_value":if(U.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${b(U.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${Z(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`Za duża wartość: oczekiwano, że ${U.origin??"wartość"} będzie mieć ${g}${U.maximum.toString()} ${z.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${U.origin??"wartość"} będzie wynosić ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`Za mała wartość: oczekiwano, że ${U.origin??"wartość"} będzie mieć ${g}${U.minimum.toString()} ${z.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${U.origin??"wartość"} będzie wynosić ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${g.prefix}"`;if(g.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${g.suffix}"`;if(g.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${g.includes}"`;if(g.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${g.pattern}`;return`Nieprawidłow(y/a/e) ${_[g.format]??U.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${U.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${U.keys.length>1?"s":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${U.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${U.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function B8(){return{localeError:vj()}}var Tj=()=>{let $={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function I(U){return $[U]??null}let _={regex:"padrão",email:"endereço de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},u={nan:"NaN",number:"número",null:"nulo"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Tipo inválido: esperado instanceof ${U.expected}, recebido ${G}`;return`Tipo inválido: esperado ${g}, recebido ${G}`}case"invalid_value":if(U.values.length===1)return`Entrada inválida: esperado ${b(U.values[0])}`;return`Opção inválida: esperada uma das ${Z(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`Muito grande: esperado que ${U.origin??"valor"} tivesse ${g}${U.maximum.toString()} ${z.unit??"elementos"}`;return`Muito grande: esperado que ${U.origin??"valor"} fosse ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`Muito pequeno: esperado que ${U.origin} tivesse ${g}${U.minimum.toString()} ${z.unit}`;return`Muito pequeno: esperado que ${U.origin} fosse ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Texto inválido: deve começar com "${g.prefix}"`;if(g.format==="ends_with")return`Texto inválido: deve terminar com "${g.suffix}"`;if(g.format==="includes")return`Texto inválido: deve incluir "${g.includes}"`;if(g.format==="regex")return`Texto inválido: deve corresponder ao padrão ${g.pattern}`;return`${_[g.format]??U.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${U.divisor}`;case"unrecognized_keys":return`Chave${U.keys.length>1?"s":""} desconhecida${U.keys.length>1?"s":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`Chave inválida em ${U.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${U.origin}`;default:return"Campo inválido"}}};function K8(){return{localeError:Tj()}}function R7($,I,_,u){let U=Math.abs($),g=U%10,z=U%100;if(z>=11&&z<=19)return u;if(g===1)return I;if(g>=2&&g<=4)return _;return u}var Mj=()=>{let $={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function I(U){return $[U]??null}let _={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"},u={nan:"NaN",number:"число",array:"массив"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Неверный ввод: ожидалось instanceof ${U.expected}, получено ${G}`;return`Неверный ввод: ожидалось ${g}, получено ${G}`}case"invalid_value":if(U.values.length===1)return`Неверный ввод: ожидалось ${b(U.values[0])}`;return`Неверный вариант: ожидалось одно из ${Z(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z){let G=Number(U.maximum),J=R7(G,z.unit.one,z.unit.few,z.unit.many);return`Слишком большое значение: ожидалось, что ${U.origin??"значение"} будет иметь ${g}${U.maximum.toString()} ${J}`}return`Слишком большое значение: ожидалось, что ${U.origin??"значение"} будет ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z){let G=Number(U.minimum),J=R7(G,z.unit.one,z.unit.few,z.unit.many);return`Слишком маленькое значение: ожидалось, что ${U.origin} будет иметь ${g}${U.minimum.toString()} ${J}`}return`Слишком маленькое значение: ожидалось, что ${U.origin} будет ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Неверная строка: должна начинаться с "${g.prefix}"`;if(g.format==="ends_with")return`Неверная строка: должна заканчиваться на "${g.suffix}"`;if(g.format==="includes")return`Неверная строка: должна содержать "${g.includes}"`;if(g.format==="regex")return`Неверная строка: должна соответствовать шаблону ${g.pattern}`;return`Неверный ${_[g.format]??U.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${U.divisor}`;case"unrecognized_keys":return`Нераспознанн${U.keys.length>1?"ые":"ый"} ключ${U.keys.length>1?"и":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${U.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${U.origin}`;default:return"Неверные входные данные"}}};function W8(){return{localeError:Mj()}}var Dj=()=>{let $={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function I(U){return $[U]??null}let _={regex:"vnos",email:"e-poštni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"},u={nan:"NaN",number:"število",array:"tabela"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Neveljaven vnos: pričakovano instanceof ${U.expected}, prejeto ${G}`;return`Neveljaven vnos: pričakovano ${g}, prejeto ${G}`}case"invalid_value":if(U.values.length===1)return`Neveljaven vnos: pričakovano ${b(U.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${Z(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`Preveliko: pričakovano, da bo ${U.origin??"vrednost"} imelo ${g}${U.maximum.toString()} ${z.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${U.origin??"vrednost"} ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`Premajhno: pričakovano, da bo ${U.origin} imelo ${g}${U.minimum.toString()} ${z.unit}`;return`Premajhno: pričakovano, da bo ${U.origin} ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Neveljaven niz: mora se začeti z "${g.prefix}"`;if(g.format==="ends_with")return`Neveljaven niz: mora se končati z "${g.suffix}"`;if(g.format==="includes")return`Neveljaven niz: mora vsebovati "${g.includes}"`;if(g.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${g.pattern}`;return`Neveljaven ${_[g.format]??U.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${U.divisor}`;case"unrecognized_keys":return`Neprepoznan${U.keys.length>1?"i ključi":" ključ"}: ${Z(U.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${U.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${U.origin}`;default:return"Neveljaven vnos"}}};function R8(){return{localeError:Dj()}}var Lj=()=>{let $={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function I(U){return $[U]??null}let _={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},u={nan:"NaN",number:"antal",array:"lista"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Ogiltig inmatning: förväntat instanceof ${U.expected}, fick ${G}`;return`Ogiltig inmatning: förväntat ${g}, fick ${G}`}case"invalid_value":if(U.values.length===1)return`Ogiltig inmatning: förväntat ${b(U.values[0])}`;return`Ogiltigt val: förväntade en av ${Z(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`För stor(t): förväntade ${U.origin??"värdet"} att ha ${g}${U.maximum.toString()} ${z.unit??"element"}`;return`För stor(t): förväntat ${U.origin??"värdet"} att ha ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`För lite(t): förväntade ${U.origin??"värdet"} att ha ${g}${U.minimum.toString()} ${z.unit}`;return`För lite(t): förväntade ${U.origin??"värdet"} att ha ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Ogiltig sträng: måste börja med "${g.prefix}"`;if(g.format==="ends_with")return`Ogiltig sträng: måste sluta med "${g.suffix}"`;if(g.format==="includes")return`Ogiltig sträng: måste innehålla "${g.includes}"`;if(g.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${g.pattern}"`;return`Ogiltig(t) ${_[g.format]??U.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${U.divisor}`;case"unrecognized_keys":return`${U.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${Z(U.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${U.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${U.origin??"värdet"}`;default:return"Ogiltig input"}}};function V8(){return{localeError:Lj()}}var Bj=()=>{let $={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function I(U){return $[U]??null}let _={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"},u={nan:"NaN",number:"எண்",array:"அணி",null:"வெறுமை"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${U.expected}, பெறப்பட்டது ${G}`;return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${g}, பெறப்பட்டது ${G}`}case"invalid_value":if(U.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${b(U.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${Z(U.values,"|")} இல் ஒன்று`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${U.origin??"மதிப்பு"} ${g}${U.maximum.toString()} ${z.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${U.origin??"மதிப்பு"} ${g}${U.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${U.origin} ${g}${U.minimum.toString()} ${z.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${U.origin} ${g}${U.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`தவறான சரம்: "${g.prefix}" இல் தொடங்க வேண்டும்`;if(g.format==="ends_with")return`தவறான சரம்: "${g.suffix}" இல் முடிவடைய வேண்டும்`;if(g.format==="includes")return`தவறான சரம்: "${g.includes}" ஐ உள்ளடக்க வேண்டும்`;if(g.format==="regex")return`தவறான சரம்: ${g.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${_[g.format]??U.format}`}case"not_multiple_of":return`தவறான எண்: ${U.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${U.keys.length>1?"கள்":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`${U.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${U.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function Z8(){return{localeError:Bj()}}var Kj=()=>{let $={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function I(U){return $[U]??null}let _={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"},u={nan:"NaN",number:"ตัวเลข",array:"อาร์เรย์ (Array)",null:"ไม่มีค่า (null)"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${U.expected} แต่ได้รับ ${G}`;return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${g} แต่ได้รับ ${G}`}case"invalid_value":if(U.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${b(U.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${Z(U.values,"|")}`;case"too_big":{let g=U.inclusive?"ไม่เกิน":"น้อยกว่า",z=I(U.origin);if(z)return`เกินกำหนด: ${U.origin??"ค่า"} ควรมี${g} ${U.maximum.toString()} ${z.unit??"รายการ"}`;return`เกินกำหนด: ${U.origin??"ค่า"} ควรมี${g} ${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?"อย่างน้อย":"มากกว่า",z=I(U.origin);if(z)return`น้อยกว่ากำหนด: ${U.origin} ควรมี${g} ${U.minimum.toString()} ${z.unit}`;return`น้อยกว่ากำหนด: ${U.origin} ควรมี${g} ${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${g.prefix}"`;if(g.format==="ends_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${g.suffix}"`;if(g.format==="includes")return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${g.includes}" อยู่ในข้อความ`;if(g.format==="regex")return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${g.pattern}`;return`รูปแบบไม่ถูกต้อง: ${_[g.format]??U.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${U.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${Z(U.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${U.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${U.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function A8(){return{localeError:Kj()}}var Wj=()=>{let $={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function I(U){return $[U]??null}let _={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"},u={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Geçersiz değer: beklenen instanceof ${U.expected}, alınan ${G}`;return`Geçersiz değer: beklenen ${g}, alınan ${G}`}case"invalid_value":if(U.values.length===1)return`Geçersiz değer: beklenen ${b(U.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${Z(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`Çok büyük: beklenen ${U.origin??"değer"} ${g}${U.maximum.toString()} ${z.unit??"öğe"}`;return`Çok büyük: beklenen ${U.origin??"değer"} ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`Çok küçük: beklenen ${U.origin} ${g}${U.minimum.toString()} ${z.unit}`;return`Çok küçük: beklenen ${U.origin} ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Geçersiz metin: "${g.prefix}" ile başlamalı`;if(g.format==="ends_with")return`Geçersiz metin: "${g.suffix}" ile bitmeli`;if(g.format==="includes")return`Geçersiz metin: "${g.includes}" içermeli`;if(g.format==="regex")return`Geçersiz metin: ${g.pattern} desenine uymalı`;return`Geçersiz ${_[g.format]??U.format}`}case"not_multiple_of":return`Geçersiz sayı: ${U.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${U.keys.length>1?"lar":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`${U.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${U.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function b8(){return{localeError:Wj()}}var Rj=()=>{let $={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function I(U){return $[U]??null}let _={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"},u={nan:"NaN",number:"число",array:"масив"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Неправильні вхідні дані: очікується instanceof ${U.expected}, отримано ${G}`;return`Неправильні вхідні дані: очікується ${g}, отримано ${G}`}case"invalid_value":if(U.values.length===1)return`Неправильні вхідні дані: очікується ${b(U.values[0])}`;return`Неправильна опція: очікується одне з ${Z(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`Занадто велике: очікується, що ${U.origin??"значення"} ${z.verb} ${g}${U.maximum.toString()} ${z.unit??"елементів"}`;return`Занадто велике: очікується, що ${U.origin??"значення"} буде ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`Занадто мале: очікується, що ${U.origin} ${z.verb} ${g}${U.minimum.toString()} ${z.unit}`;return`Занадто мале: очікується, що ${U.origin} буде ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Неправильний рядок: повинен починатися з "${g.prefix}"`;if(g.format==="ends_with")return`Неправильний рядок: повинен закінчуватися на "${g.suffix}"`;if(g.format==="includes")return`Неправильний рядок: повинен містити "${g.includes}"`;if(g.format==="regex")return`Неправильний рядок: повинен відповідати шаблону ${g.pattern}`;return`Неправильний ${_[g.format]??U.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${U.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${U.keys.length>1?"і":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${U.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${U.origin}`;default:return"Неправильні вхідні дані"}}};function R0(){return{localeError:Rj()}}function P8(){return R0()}var Vj=()=>{let $={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function I(U){return $[U]??null}let _={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"},u={nan:"NaN",number:"نمبر",array:"آرے",null:"نل"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`غلط ان پٹ: instanceof ${U.expected} متوقع تھا، ${G} موصول ہوا`;return`غلط ان پٹ: ${g} متوقع تھا، ${G} موصول ہوا`}case"invalid_value":if(U.values.length===1)return`غلط ان پٹ: ${b(U.values[0])} متوقع تھا`;return`غلط آپشن: ${Z(U.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`بہت بڑا: ${U.origin??"ویلیو"} کے ${g}${U.maximum.toString()} ${z.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${U.origin??"ویلیو"} کا ${g}${U.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`بہت چھوٹا: ${U.origin} کے ${g}${U.minimum.toString()} ${z.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${U.origin} کا ${g}${U.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`غلط سٹرنگ: "${g.prefix}" سے شروع ہونا چاہیے`;if(g.format==="ends_with")return`غلط سٹرنگ: "${g.suffix}" پر ختم ہونا چاہیے`;if(g.format==="includes")return`غلط سٹرنگ: "${g.includes}" شامل ہونا چاہیے`;if(g.format==="regex")return`غلط سٹرنگ: پیٹرن ${g.pattern} سے میچ ہونا چاہیے`;return`غلط ${_[g.format]??U.format}`}case"not_multiple_of":return`غلط نمبر: ${U.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${U.keys.length>1?"ز":""}: ${Z(U.keys,"، ")}`;case"invalid_key":return`${U.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${U.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function j8(){return{localeError:Vj()}}var Zj=()=>{let $={string:{unit:"belgi",verb:"bo‘lishi kerak"},file:{unit:"bayt",verb:"bo‘lishi kerak"},array:{unit:"element",verb:"bo‘lishi kerak"},set:{unit:"element",verb:"bo‘lishi kerak"}};function I(U){return $[U]??null}let _={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},u={nan:"NaN",number:"raqam",array:"massiv"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Noto‘g‘ri kirish: kutilgan instanceof ${U.expected}, qabul qilingan ${G}`;return`Noto‘g‘ri kirish: kutilgan ${g}, qabul qilingan ${G}`}case"invalid_value":if(U.values.length===1)return`Noto‘g‘ri kirish: kutilgan ${b(U.values[0])}`;return`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${Z(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`Juda katta: kutilgan ${U.origin??"qiymat"} ${g}${U.maximum.toString()} ${z.unit} ${z.verb}`;return`Juda katta: kutilgan ${U.origin??"qiymat"} ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`Juda kichik: kutilgan ${U.origin} ${g}${U.minimum.toString()} ${z.unit} ${z.verb}`;return`Juda kichik: kutilgan ${U.origin} ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Noto‘g‘ri satr: "${g.prefix}" bilan boshlanishi kerak`;if(g.format==="ends_with")return`Noto‘g‘ri satr: "${g.suffix}" bilan tugashi kerak`;if(g.format==="includes")return`Noto‘g‘ri satr: "${g.includes}" ni o‘z ichiga olishi kerak`;if(g.format==="regex")return`Noto‘g‘ri satr: ${g.pattern} shabloniga mos kelishi kerak`;return`Noto‘g‘ri ${_[g.format]??U.format}`}case"not_multiple_of":return`Noto‘g‘ri raqam: ${U.divisor} ning karralisi bo‘lishi kerak`;case"unrecognized_keys":return`Noma’lum kalit${U.keys.length>1?"lar":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`${U.origin} dagi kalit noto‘g‘ri`;case"invalid_union":return"Noto‘g‘ri kirish";case"invalid_element":return`${U.origin} da noto‘g‘ri qiymat`;default:return"Noto‘g‘ri kirish"}}};function S8(){return{localeError:Zj()}}var Aj=()=>{let $={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function I(U){return $[U]??null}let _={regex:"đầu vào",email:"địa chỉ email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"},u={nan:"NaN",number:"số",array:"mảng"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Đầu vào không hợp lệ: mong đợi instanceof ${U.expected}, nhận được ${G}`;return`Đầu vào không hợp lệ: mong đợi ${g}, nhận được ${G}`}case"invalid_value":if(U.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${b(U.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${Z(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`Quá lớn: mong đợi ${U.origin??"giá trị"} ${z.verb} ${g}${U.maximum.toString()} ${z.unit??"phần tử"}`;return`Quá lớn: mong đợi ${U.origin??"giá trị"} ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`Quá nhỏ: mong đợi ${U.origin} ${z.verb} ${g}${U.minimum.toString()} ${z.unit}`;return`Quá nhỏ: mong đợi ${U.origin} ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${g.prefix}"`;if(g.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${g.suffix}"`;if(g.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${g.includes}"`;if(g.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${g.pattern}`;return`${_[g.format]??U.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${U.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${Z(U.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${U.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${U.origin}`;default:return"Đầu vào không hợp lệ"}}};function F8(){return{localeError:Aj()}}var bj=()=>{let $={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function I(U){return $[U]??null}let _={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"},u={nan:"NaN",number:"数字",array:"数组",null:"空值(null)"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`无效输入:期望 instanceof ${U.expected},实际接收 ${G}`;return`无效输入:期望 ${g},实际接收 ${G}`}case"invalid_value":if(U.values.length===1)return`无效输入:期望 ${b(U.values[0])}`;return`无效选项:期望以下之一 ${Z(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`数值过大:期望 ${U.origin??"值"} ${g}${U.maximum.toString()} ${z.unit??"个元素"}`;return`数值过大:期望 ${U.origin??"值"} ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`数值过小:期望 ${U.origin} ${g}${U.minimum.toString()} ${z.unit}`;return`数值过小:期望 ${U.origin} ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`无效字符串:必须以 "${g.prefix}" 开头`;if(g.format==="ends_with")return`无效字符串:必须以 "${g.suffix}" 结尾`;if(g.format==="includes")return`无效字符串:必须包含 "${g.includes}"`;if(g.format==="regex")return`无效字符串:必须满足正则表达式 ${g.pattern}`;return`无效${_[g.format]??U.format}`}case"not_multiple_of":return`无效数字:必须是 ${U.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${Z(U.keys,", ")}`;case"invalid_key":return`${U.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${U.origin} 中包含无效值(value)`;default:return"无效输入"}}};function w8(){return{localeError:bj()}}var Pj=()=>{let $={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function I(U){return $[U]??null}let _={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"},u={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`無效的輸入值:預期為 instanceof ${U.expected},但收到 ${G}`;return`無效的輸入值:預期為 ${g},但收到 ${G}`}case"invalid_value":if(U.values.length===1)return`無效的輸入值:預期為 ${b(U.values[0])}`;return`無效的選項:預期為以下其中之一 ${Z(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`數值過大:預期 ${U.origin??"值"} 應為 ${g}${U.maximum.toString()} ${z.unit??"個元素"}`;return`數值過大:預期 ${U.origin??"值"} 應為 ${g}${U.maximum.toString()}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`數值過小:預期 ${U.origin} 應為 ${g}${U.minimum.toString()} ${z.unit}`;return`數值過小:預期 ${U.origin} 應為 ${g}${U.minimum.toString()}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`無效的字串:必須以 "${g.prefix}" 開頭`;if(g.format==="ends_with")return`無效的字串:必須以 "${g.suffix}" 結尾`;if(g.format==="includes")return`無效的字串:必須包含 "${g.includes}"`;if(g.format==="regex")return`無效的字串:必須符合格式 ${g.pattern}`;return`無效的 ${_[g.format]??U.format}`}case"not_multiple_of":return`無效的數字:必須為 ${U.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${U.keys.length>1?"們":""}:${Z(U.keys,"、")}`;case"invalid_key":return`${U.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${U.origin} 中有無效的值`;default:return"無效的輸入值"}}};function E8(){return{localeError:Pj()}}var jj=()=>{let $={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function I(U){return $[U]??null}let _={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"},u={nan:"NaN",number:"nọ́mbà",array:"akopọ"};return(U)=>{switch(U.code){case"invalid_type":{let g=u[U.expected]??U.expected,z=P(U.input),G=u[z]??z;if(/^[A-Z]/.test(U.expected))return`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${U.expected}, àmọ̀ a rí ${G}`;return`Ìbáwọlé aṣìṣe: a ní láti fi ${g}, àmọ̀ a rí ${G}`}case"invalid_value":if(U.values.length===1)return`Ìbáwọlé aṣìṣe: a ní láti fi ${b(U.values[0])}`;return`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${Z(U.values,"|")}`;case"too_big":{let g=U.inclusive?"<=":"<",z=I(U.origin);if(z)return`Tó pọ̀ jù: a ní láti jẹ́ pé ${U.origin??"iye"} ${z.verb} ${g}${U.maximum} ${z.unit}`;return`Tó pọ̀ jù: a ní láti jẹ́ ${g}${U.maximum}`}case"too_small":{let g=U.inclusive?">=":">",z=I(U.origin);if(z)return`Kéré ju: a ní láti jẹ́ pé ${U.origin} ${z.verb} ${g}${U.minimum} ${z.unit}`;return`Kéré ju: a ní láti jẹ́ ${g}${U.minimum}`}case"invalid_format":{let g=U;if(g.format==="starts_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${g.prefix}"`;if(g.format==="ends_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${g.suffix}"`;if(g.format==="includes")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${g.includes}"`;if(g.format==="regex")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${g.pattern}`;return`Aṣìṣe: ${_[g.format]??U.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${U.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${Z(U.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${U.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${U.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function C8(){return{localeError:jj()}}var V7,f8=Symbol("ZodOutput"),x8=Symbol("ZodInput");class k8{constructor(){this._map=new WeakMap,this._idmap=new Map}add($,...I){let _=I[0];if(this._map.set($,_),_&&typeof _==="object"&&"id"in _)this._idmap.set(_.id,$);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove($){let I=this._map.get($);if(I&&typeof I==="object"&&"id"in I)this._idmap.delete(I.id);return this._map.delete($),this}get($){let I=$._zod.parent;if(I){let _={...this.get(I)??{}};delete _.id;let u={..._,...this._map.get($)};return Object.keys(u).length?u:void 0}return this._map.get($)}has($){return this._map.has($)}}function C_(){return new k8}(V7=globalThis).__zod_globalRegistry??(V7.__zod_globalRegistry=C_());var S$=globalThis.__zod_globalRegistry;function y8($,I){return new $({type:"string",...F(I)})}function i8($,I){return new $({type:"string",coerce:!0,...F(I)})}function f_($,I){return new $({type:"string",format:"email",check:"string_format",abort:!1,...F(I)})}function Z0($,I){return new $({type:"string",format:"guid",check:"string_format",abort:!1,...F(I)})}function x_($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,...F(I)})}function k_($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...F(I)})}function y_($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...F(I)})}function i_($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...F(I)})}function A0($,I){return new $({type:"string",format:"url",check:"string_format",abort:!1,...F(I)})}function l_($,I){return new $({type:"string",format:"emoji",check:"string_format",abort:!1,...F(I)})}function m_($,I){return new $({type:"string",format:"nanoid",check:"string_format",abort:!1,...F(I)})}function n_($,I){return new $({type:"string",format:"cuid",check:"string_format",abort:!1,...F(I)})}function r_($,I){return new $({type:"string",format:"cuid2",check:"string_format",abort:!1,...F(I)})}function h_($,I){return new $({type:"string",format:"ulid",check:"string_format",abort:!1,...F(I)})}function c_($,I){return new $({type:"string",format:"xid",check:"string_format",abort:!1,...F(I)})}function d_($,I){return new $({type:"string",format:"ksuid",check:"string_format",abort:!1,...F(I)})}function o_($,I){return new $({type:"string",format:"ipv4",check:"string_format",abort:!1,...F(I)})}function p_($,I){return new $({type:"string",format:"ipv6",check:"string_format",abort:!1,...F(I)})}function l8($,I){return new $({type:"string",format:"mac",check:"string_format",abort:!1,...F(I)})}function t_($,I){return new $({type:"string",format:"cidrv4",check:"string_format",abort:!1,...F(I)})}function a_($,I){return new $({type:"string",format:"cidrv6",check:"string_format",abort:!1,...F(I)})}function e_($,I){return new $({type:"string",format:"base64",check:"string_format",abort:!1,...F(I)})}function s_($,I){return new $({type:"string",format:"base64url",check:"string_format",abort:!1,...F(I)})}function $u($,I){return new $({type:"string",format:"e164",check:"string_format",abort:!1,...F(I)})}function Iu($,I){return new $({type:"string",format:"jwt",check:"string_format",abort:!1,...F(I)})}var m8={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function n8($,I){return new $({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...F(I)})}function r8($,I){return new $({type:"string",format:"date",check:"string_format",...F(I)})}function h8($,I){return new $({type:"string",format:"time",check:"string_format",precision:null,...F(I)})}function c8($,I){return new $({type:"string",format:"duration",check:"string_format",...F(I)})}function d8($,I){return new $({type:"number",checks:[],...F(I)})}function o8($,I){return new $({type:"number",coerce:!0,checks:[],...F(I)})}function p8($,I){return new $({type:"number",check:"number_format",abort:!1,format:"safeint",...F(I)})}function t8($,I){return new $({type:"number",check:"number_format",abort:!1,format:"float32",...F(I)})}function a8($,I){return new $({type:"number",check:"number_format",abort:!1,format:"float64",...F(I)})}function e8($,I){return new $({type:"number",check:"number_format",abort:!1,format:"int32",...F(I)})}function s8($,I){return new $({type:"number",check:"number_format",abort:!1,format:"uint32",...F(I)})}function $3($,I){return new $({type:"boolean",...F(I)})}function I3($,I){return new $({type:"boolean",coerce:!0,...F(I)})}function U3($,I){return new $({type:"bigint",...F(I)})}function _3($,I){return new $({type:"bigint",coerce:!0,...F(I)})}function u3($,I){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...F(I)})}function g3($,I){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...F(I)})}function z3($,I){return new $({type:"symbol",...F(I)})}function G3($,I){return new $({type:"undefined",...F(I)})}function J3($,I){return new $({type:"null",...F(I)})}function X3($){return new $({type:"any"})}function q3($){return new $({type:"unknown"})}function N3($,I){return new $({type:"never",...F(I)})}function Q3($,I){return new $({type:"void",...F(I)})}function H3($,I){return new $({type:"date",...F(I)})}function Y3($,I){return new $({type:"date",coerce:!0,...F(I)})}function O3($,I){return new $({type:"nan",...F(I)})}function F4($,I){return new W_({check:"less_than",...F(I),value:$,inclusive:!1})}function I4($,I){return new W_({check:"less_than",...F(I),value:$,inclusive:!0})}function w4($,I){return new R_({check:"greater_than",...F(I),value:$,inclusive:!1})}function r$($,I){return new R_({check:"greater_than",...F(I),value:$,inclusive:!0})}function Uu($){return w4(0,$)}function _u($){return F4(0,$)}function uu($){return I4(0,$)}function gu($){return r$(0,$)}function L6($,I){return new OG({check:"multiple_of",...F(I),value:$})}function B6($,I){return new MG({check:"max_size",...F(I),maximum:$})}function E4($,I){return new DG({check:"min_size",...F(I),minimum:$})}function e6($,I){return new LG({check:"size_equals",...F(I),size:$})}function s6($,I){return new BG({check:"max_length",...F(I),maximum:$})}function d4($,I){return new KG({check:"min_length",...F(I),minimum:$})}function $1($,I){return new WG({check:"length_equals",...F(I),length:$})}function i1($,I){return new RG({check:"string_format",format:"regex",...F(I),pattern:$})}function l1($){return new VG({check:"string_format",format:"lowercase",...F($)})}function m1($){return new ZG({check:"string_format",format:"uppercase",...F($)})}function n1($,I){return new AG({check:"string_format",format:"includes",...F(I),includes:$})}function r1($,I){return new bG({check:"string_format",format:"starts_with",...F(I),prefix:$})}function h1($,I){return new PG({check:"string_format",format:"ends_with",...F(I),suffix:$})}function zu($,I,_){return new jG({check:"property",property:$,schema:I,...F(_)})}function c1($,I){return new SG({check:"mime_type",mime:$,...F(I)})}function D4($){return new FG({check:"overwrite",tx:$})}function d1($){return D4((I)=>I.normalize($))}function o1(){return D4(($)=>$.trim())}function p1(){return D4(($)=>$.toLowerCase())}function t1(){return D4(($)=>$.toUpperCase())}function a1(){return D4(($)=>jz($))}function v3($,I,_){return new $({type:"array",element:I,...F(_)})}function Fj($,I,_){return new $({type:"union",options:I,...F(_)})}function wj($,I,_){return new $({type:"union",options:I,inclusive:!1,...F(_)})}function Ej($,I,_,u){return new $({type:"union",options:_,discriminator:I,...F(u)})}function Cj($,I,_){return new $({type:"intersection",left:I,right:_})}function fj($,I,_,u){let U=_ instanceof r;return new $({type:"tuple",items:I,rest:U?_:null,...F(U?u:_)})}function xj($,I,_,u){return new $({type:"record",keyType:I,valueType:_,...F(u)})}function kj($,I,_,u){return new $({type:"map",keyType:I,valueType:_,...F(u)})}function yj($,I,_){return new $({type:"set",valueType:I,...F(_)})}function ij($,I,_){let u=Array.isArray(I)?Object.fromEntries(I.map((U)=>[U,U])):I;return new $({type:"enum",entries:u,...F(_)})}function lj($,I,_){return new $({type:"enum",entries:I,...F(_)})}function mj($,I,_){return new $({type:"literal",values:Array.isArray(I)?I:[I],...F(_)})}function T3($,I){return new $({type:"file",...F(I)})}function nj($,I){return new $({type:"transform",transform:I})}function rj($,I){return new $({type:"optional",innerType:I})}function hj($,I){return new $({type:"nullable",innerType:I})}function cj($,I,_){return new $({type:"default",innerType:I,get defaultValue(){return typeof _==="function"?_():Fz(_)}})}function dj($,I,_){return new $({type:"nonoptional",innerType:I,...F(_)})}function oj($,I){return new $({type:"success",innerType:I})}function pj($,I,_){return new $({type:"catch",innerType:I,catchValue:typeof _==="function"?_:()=>_})}function tj($,I,_){return new $({type:"pipe",in:I,out:_})}function aj($,I){return new $({type:"readonly",innerType:I})}function ej($,I,_){return new $({type:"template_literal",parts:I,...F(_)})}function sj($,I){return new $({type:"lazy",getter:I})}function $S($,I){return new $({type:"promise",innerType:I})}function M3($,I,_){let u=F(_);return u.abort??(u.abort=!0),new $({type:"custom",check:"custom",fn:I,...u})}function D3($,I,_){return new $({type:"custom",check:"custom",fn:I,...F(_)})}function L3($){let I=Z7((_)=>{return _.addIssue=(u)=>{if(typeof u==="string")_.issues.push(w1(u,_.value,I._zod.def));else{let U=u;if(U.fatal)U.continue=!1;U.code??(U.code="custom"),U.input??(U.input=_.value),U.inst??(U.inst=I),U.continue??(U.continue=!I._zod.def.abort),_.issues.push(w1(U))}},$(_.value,_)});return I}function Z7($,I){let _=new H$({check:"custom",...F(I)});return _._zod.check=$,_}function B3($){let I=new H$({check:"describe"});return I._zod.onattach=[(_)=>{let u=S$.get(_)??{};S$.add(_,{...u,description:$})}],I._zod.check=()=>{},I}function K3($){let I=new H$({check:"meta"});return I._zod.onattach=[(_)=>{let u=S$.get(_)??{};S$.add(_,{...u,...$})}],I._zod.check=()=>{},I}function W3($,I){let _=F(I),u=_.truthy??["true","1","yes","on","y","enabled"],U=_.falsy??["false","0","no","off","n","disabled"];if(_.case!=="sensitive")u=u.map((Y)=>typeof Y==="string"?Y.toLowerCase():Y),U=U.map((Y)=>typeof Y==="string"?Y.toLowerCase():Y);let g=new Set(u),z=new Set(U),G=$.Codec??L0,J=$.Boolean??M0,N=new($.String??a6)({type:"string",error:_.error}),q=new J({type:"boolean",error:_.error}),Q=new G({type:"pipe",in:N,out:q,transform:(Y,O)=>{let H=Y;if(_.case!=="sensitive")H=H.toLowerCase();if(g.has(H))return!0;else if(z.has(H))return!1;else return O.issues.push({code:"invalid_value",expected:"stringbool",values:[...g,...z],input:O.value,inst:Q,continue:!1}),{}},reverseTransform:(Y,O)=>{if(Y===!0)return u[0]||"true";else return U[0]||"false"},error:_.error});return Q}function e1($,I,_,u={}){let U=F(u),g={...F(u),check:"string_format",type:"string",format:I,fn:typeof _==="function"?_:(G)=>_.test(G),...U};if(_ instanceof RegExp)g.pattern=_;return new $(g)}function K6($){let I=$?.target??"draft-2020-12";if(I==="draft-4")I="draft-04";if(I==="draft-7")I="draft-07";return{processors:$.processors??{},metadataRegistry:$?.metadata??S$,target:I,unrepresentable:$?.unrepresentable??"throw",override:$?.override??(()=>{}),io:$?.io??"output",counter:0,seen:new Map,cycles:$?.cycles??"ref",reused:$?.reused??"inline",external:$?.external??void 0}}function g$($,I,_={path:[],schemaPath:[]}){var u;let U=$._zod.def,g=I.seen.get($);if(g){if(g.count++,_.schemaPath.includes($))g.cycle=_.path;return g.schema}let z={schema:{},count:1,cycle:void 0,path:_.path};I.seen.set($,z);let G=$._zod.toJSONSchema?.();if(G)z.schema=G;else{let N={..._,schemaPath:[..._.schemaPath,$],path:_.path};if($._zod.processJSONSchema)$._zod.processJSONSchema(I,z.schema,N);else{let Q=z.schema,Y=I.processors[U.type];if(!Y)throw Error(`[toJSONSchema]: Non-representable type encountered: ${U.type}`);Y($,I,Q,N)}let q=$._zod.parent;if(q){if(!z.ref)z.ref=q;g$(q,I,N),I.seen.get(q).isParent=!0}}let J=I.metadataRegistry.get($);if(J)Object.assign(z.schema,J);if(I.io==="input"&&h$($))delete z.schema.examples,delete z.schema.default;if(I.io==="input"&&z.schema._prefault)(u=z.schema).default??(u.default=z.schema._prefault);return delete z.schema._prefault,I.seen.get($).schema}function W6($,I){let _=$.seen.get(I);if(!_)throw Error("Unprocessed schema. This is a bug in Zod.");let u=new Map;for(let z of $.seen.entries()){let G=$.metadataRegistry.get(z[0])?.id;if(G){let J=u.get(G);if(J&&J!==z[0])throw Error(`Duplicate schema id "${G}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);u.set(G,z[0])}}let U=(z)=>{let G=$.target==="draft-2020-12"?"$defs":"definitions";if($.external){let q=$.external.registry.get(z[0])?.id,Q=$.external.uri??((O)=>O);if(q)return{ref:Q(q)};let Y=z[1].defId??z[1].schema.id??`schema${$.counter++}`;return z[1].defId=Y,{defId:Y,ref:`${Q("__shared")}#/${G}/${Y}`}}if(z[1]===_)return{ref:"#"};let X=`${"#"}/${G}/`,N=z[1].schema.id??`__schema${$.counter++}`;return{defId:N,ref:X+N}},g=(z)=>{if(z[1].schema.$ref)return;let G=z[1],{ref:J,defId:X}=U(z);if(G.def={...G.schema},X)G.defId=X;let N=G.schema;for(let q in N)delete N[q];N.$ref=J};if($.cycles==="throw")for(let z of $.seen.entries()){let G=z[1];if(G.cycle)throw Error(`Cycle detected: #/${G.cycle?.join("/")}/<root>
|
|
310
310
|
|
|
311
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let z of $.seen.entries()){let G=z[1];if(I===z[0]){g(z);continue}if($.external){let X=$.external.registry.get(z[0])?.id;if(I!==z[0]&&X){g(z);continue}}if($.metadataRegistry.get(z[0])?.id){g(z);continue}if(G.cycle){g(z);continue}if(G.count>1){if($.reused==="ref"){g(z);continue}}}}function K6($,I){let _=$.seen.get(I);if(!_)throw Error("Unprocessed schema. This is a bug in Zod.");let u=(z)=>{let G=$.seen.get(z);if(G.ref===null)return;let J=G.def??G.schema,X={...J},N=G.ref;if(G.ref=null,N){u(N);let Q=$.seen.get(N),Y=Q.schema;if(Y.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))J.allOf=J.allOf??[],J.allOf.push(Y);else Object.assign(J,Y);if(Object.assign(J,X),z._zod.parent===N)for(let H in J){if(H==="$ref"||H==="allOf")continue;if(!(H in X))delete J[H]}if(Y.$ref&&Q.def)for(let H in J){if(H==="$ref"||H==="allOf")continue;if(H in Q.def&&JSON.stringify(J[H])===JSON.stringify(Q.def[H]))delete J[H]}}let q=z._zod.parent;if(q&&q!==N){u(q);let Q=$.seen.get(q);if(Q?.schema.$ref){if(J.$ref=Q.schema.$ref,Q.def)for(let Y in J){if(Y==="$ref"||Y==="allOf")continue;if(Y in Q.def&&JSON.stringify(J[Y])===JSON.stringify(Q.def[Y]))delete J[Y]}}}$.override({zodSchema:z,jsonSchema:J,path:G.path??[]})};for(let z of[...$.seen.entries()].reverse())u(z[0]);let U={};if($.target==="draft-2020-12")U.$schema="https://json-schema.org/draft/2020-12/schema";else if($.target==="draft-07")U.$schema="http://json-schema.org/draft-07/schema#";else if($.target==="draft-04")U.$schema="http://json-schema.org/draft-04/schema#";else if($.target==="openapi-3.0");if($.external?.uri){let z=$.external.registry.get(I)?.id;if(!z)throw Error("Schema is missing an `id` property");U.$id=$.external.uri(z)}Object.assign(U,_.def??_.schema);let g=$.external?.defs??{};for(let z of $.seen.entries()){let G=z[1];if(G.def&&G.defId)g[G.defId]=G.def}if($.external);else if(Object.keys(g).length>0)if($.target==="draft-2020-12")U.$defs=g;else U.definitions=g;try{let z=JSON.parse(JSON.stringify(U));return Object.defineProperty(z,"~standard",{value:{...I["~standard"],jsonSchema:{input:t1(I,"input",$.processors),output:t1(I,"output",$.processors)}},enumerable:!1,writable:!1}),z}catch(z){throw Error("Error converting schema to JSON.")}}function r$($,I){let _=I??{seen:new Set};if(_.seen.has($))return!1;_.seen.add($);let u=$._zod.def;if(u.type==="transform")return!0;if(u.type==="array")return r$(u.element,_);if(u.type==="set")return r$(u.valueType,_);if(u.type==="lazy")return r$(u.getter(),_);if(u.type==="promise"||u.type==="optional"||u.type==="nonoptional"||u.type==="nullable"||u.type==="readonly"||u.type==="default"||u.type==="prefault")return r$(u.innerType,_);if(u.type==="intersection")return r$(u.left,_)||r$(u.right,_);if(u.type==="record"||u.type==="map")return r$(u.keyType,_)||r$(u.valueType,_);if(u.type==="pipe")return r$(u.in,_)||r$(u.out,_);if(u.type==="object"){for(let U in u.shape)if(r$(u.shape[U],_))return!0;return!1}if(u.type==="union"){for(let U of u.options)if(r$(U,_))return!0;return!1}if(u.type==="tuple"){for(let U of u.items)if(r$(U,_))return!0;if(u.rest&&r$(u.rest,_))return!0;return!1}return!1}var v3=($,I={})=>(_)=>{let u=L6({..._,processors:I});return u$($,u),B6(u,$),K6(u,$)},t1=($,I,_={})=>(u)=>{let{libraryOptions:U,target:g}=u??{},z=L6({...U??{},target:g,io:I,processors:_});return u$($,z),B6(z,$),K6(z,$)};var dS={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},T3=($,I,_,u)=>{let U=_;U.type="string";let{minimum:g,maximum:z,format:G,patterns:J,contentEncoding:X}=$._zod.bag;if(typeof g==="number")U.minLength=g;if(typeof z==="number")U.maxLength=z;if(G){if(U.format=dS[G]??G,U.format==="")delete U.format;if(G==="time")delete U.format}if(X)U.contentEncoding=X;if(J&&J.size>0){let N=[...J];if(N.length===1)U.pattern=N[0].source;else if(N.length>1)U.allOf=[...N.map((q)=>({...I.target==="draft-07"||I.target==="draft-04"||I.target==="openapi-3.0"?{type:"string"}:{},pattern:q.source}))]}},M3=($,I,_,u)=>{let U=_,{minimum:g,maximum:z,format:G,multipleOf:J,exclusiveMaximum:X,exclusiveMinimum:N}=$._zod.bag;if(typeof G==="string"&&G.includes("int"))U.type="integer";else U.type="number";if(typeof N==="number")if(I.target==="draft-04"||I.target==="openapi-3.0")U.minimum=N,U.exclusiveMinimum=!0;else U.exclusiveMinimum=N;if(typeof g==="number"){if(U.minimum=g,typeof N==="number"&&I.target!=="draft-04")if(N>=g)delete U.minimum;else delete U.exclusiveMinimum}if(typeof X==="number")if(I.target==="draft-04"||I.target==="openapi-3.0")U.maximum=X,U.exclusiveMaximum=!0;else U.exclusiveMaximum=X;if(typeof z==="number"){if(U.maximum=z,typeof X==="number"&&I.target!=="draft-04")if(X<=z)delete U.maximum;else delete U.exclusiveMaximum}if(typeof J==="number")U.multipleOf=J},D3=($,I,_,u)=>{_.type="boolean"},L3=($,I,_,u)=>{if(I.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},B3=($,I,_,u)=>{if(I.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},K3=($,I,_,u)=>{if(I.target==="openapi-3.0")_.type="string",_.nullable=!0,_.enum=[null];else _.type="null"},V3=($,I,_,u)=>{if(I.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},R3=($,I,_,u)=>{if(I.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},W3=($,I,_,u)=>{_.not={}},A3=($,I,_,u)=>{},Z3=($,I,_,u)=>{},b3=($,I,_,u)=>{if(I.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},P3=($,I,_,u)=>{let U=$._zod.def,g=$0(U.entries);if(g.every((z)=>typeof z==="number"))_.type="number";if(g.every((z)=>typeof z==="string"))_.type="string";_.enum=g},S3=($,I,_,u)=>{let U=$._zod.def,g=[];for(let z of U.values)if(z===void 0){if(I.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof z==="bigint")if(I.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else g.push(Number(z));else g.push(z);if(g.length===0);else if(g.length===1){let z=g[0];if(_.type=z===null?"null":typeof z,I.target==="draft-04"||I.target==="openapi-3.0")_.enum=[z];else _.const=z}else{if(g.every((z)=>typeof z==="number"))_.type="number";if(g.every((z)=>typeof z==="string"))_.type="string";if(g.every((z)=>typeof z==="boolean"))_.type="boolean";if(g.every((z)=>z===null))_.type="null";_.enum=g}},j3=($,I,_,u)=>{if(I.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},F3=($,I,_,u)=>{let U=_,g=$._zod.pattern;if(!g)throw Error("Pattern not found in template literal");U.type="string",U.pattern=g.source},w3=($,I,_,u)=>{let U=_,g={type:"string",format:"binary",contentEncoding:"binary"},{minimum:z,maximum:G,mime:J}=$._zod.bag;if(z!==void 0)g.minLength=z;if(G!==void 0)g.maxLength=G;if(J)if(J.length===1)g.contentMediaType=J[0],Object.assign(U,g);else Object.assign(U,g),U.anyOf=J.map((X)=>({contentMediaType:X}));else Object.assign(U,g)},E3=($,I,_,u)=>{_.type="boolean"},C3=($,I,_,u)=>{if(I.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},f3=($,I,_,u)=>{if(I.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},x3=($,I,_,u)=>{if(I.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},k3=($,I,_,u)=>{if(I.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},i3=($,I,_,u)=>{if(I.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},y3=($,I,_,u)=>{let U=_,g=$._zod.def,{minimum:z,maximum:G}=$._zod.bag;if(typeof z==="number")U.minItems=z;if(typeof G==="number")U.maxItems=G;U.type="array",U.items=u$(g.element,I,{...u,path:[...u.path,"items"]})},l3=($,I,_,u)=>{let U=_,g=$._zod.def;U.type="object",U.properties={};let z=g.shape;for(let X in z)U.properties[X]=u$(z[X],I,{...u,path:[...u.path,"properties",X]});let G=new Set(Object.keys(z)),J=new Set([...G].filter((X)=>{let N=g.shape[X]._zod;if(I.io==="input")return N.optin===void 0;else return N.optout===void 0}));if(J.size>0)U.required=Array.from(J);if(g.catchall?._zod.def.type==="never")U.additionalProperties=!1;else if(!g.catchall){if(I.io==="output")U.additionalProperties=!1}else if(g.catchall)U.additionalProperties=u$(g.catchall,I,{...u,path:[...u.path,"additionalProperties"]})},$u=($,I,_,u)=>{let U=$._zod.def,g=U.inclusive===!1,z=U.options.map((G,J)=>u$(G,I,{...u,path:[...u.path,g?"oneOf":"anyOf",J]}));if(g)_.oneOf=z;else _.anyOf=z},m3=($,I,_,u)=>{let U=$._zod.def,g=u$(U.left,I,{...u,path:[...u.path,"allOf",0]}),z=u$(U.right,I,{...u,path:[...u.path,"allOf",1]}),G=(X)=>("allOf"in X)&&Object.keys(X).length===1,J=[...G(g)?g.allOf:[g],...G(z)?z.allOf:[z]];_.allOf=J},n3=($,I,_,u)=>{let U=_,g=$._zod.def;U.type="array";let z=I.target==="draft-2020-12"?"prefixItems":"items",G=I.target==="draft-2020-12"?"items":I.target==="openapi-3.0"?"items":"additionalItems",J=g.items.map((Q,Y)=>u$(Q,I,{...u,path:[...u.path,z,Y]})),X=g.rest?u$(g.rest,I,{...u,path:[...u.path,G,...I.target==="openapi-3.0"?[g.items.length]:[]]}):null;if(I.target==="draft-2020-12"){if(U.prefixItems=J,X)U.items=X}else if(I.target==="openapi-3.0"){if(U.items={anyOf:J},X)U.items.anyOf.push(X);if(U.minItems=J.length,!X)U.maxItems=J.length}else if(U.items=J,X)U.additionalItems=X;let{minimum:N,maximum:q}=$._zod.bag;if(typeof N==="number")U.minItems=N;if(typeof q==="number")U.maxItems=q},r3=($,I,_,u)=>{let U=_,g=$._zod.def;U.type="object";let z=g.keyType,J=z._zod.bag?.patterns;if(g.mode==="loose"&&J&&J.size>0){let N=u$(g.valueType,I,{...u,path:[...u.path,"patternProperties","*"]});U.patternProperties={};for(let q of J)U.patternProperties[q.source]=N}else{if(I.target==="draft-07"||I.target==="draft-2020-12")U.propertyNames=u$(g.keyType,I,{...u,path:[...u.path,"propertyNames"]});U.additionalProperties=u$(g.valueType,I,{...u,path:[...u.path,"additionalProperties"]})}let X=z._zod.values;if(X){let N=[...X].filter((q)=>typeof q==="string"||typeof q==="number");if(N.length>0)U.required=N}},h3=($,I,_,u)=>{let U=$._zod.def,g=u$(U.innerType,I,u),z=I.seen.get($);if(I.target==="openapi-3.0")z.ref=U.innerType,_.nullable=!0;else _.anyOf=[g,{type:"null"}]},c3=($,I,_,u)=>{let U=$._zod.def;u$(U.innerType,I,u);let g=I.seen.get($);g.ref=U.innerType},d3=($,I,_,u)=>{let U=$._zod.def;u$(U.innerType,I,u);let g=I.seen.get($);g.ref=U.innerType,_.default=JSON.parse(JSON.stringify(U.defaultValue))},o3=($,I,_,u)=>{let U=$._zod.def;u$(U.innerType,I,u);let g=I.seen.get($);if(g.ref=U.innerType,I.io==="input")_._prefault=JSON.parse(JSON.stringify(U.defaultValue))},p3=($,I,_,u)=>{let U=$._zod.def;u$(U.innerType,I,u);let g=I.seen.get($);g.ref=U.innerType;let z;try{z=U.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}_.default=z},t3=($,I,_,u)=>{let U=$._zod.def,g=I.io==="input"?U.in._zod.def.type==="transform"?U.out:U.in:U.out;u$(g,I,u);let z=I.seen.get($);z.ref=g},a3=($,I,_,u)=>{let U=$._zod.def;u$(U.innerType,I,u);let g=I.seen.get($);g.ref=U.innerType,_.readOnly=!0},e3=($,I,_,u)=>{let U=$._zod.def;u$(U.innerType,I,u);let g=I.seen.get($);g.ref=U.innerType},Iu=($,I,_,u)=>{let U=$._zod.def;u$(U.innerType,I,u);let g=I.seen.get($);g.ref=U.innerType},s3=($,I,_,u)=>{let U=$._zod.innerType;u$(U,I,u);let g=I.seen.get($);g.ref=U},s_={string:T3,number:M3,boolean:D3,bigint:L3,symbol:B3,null:K3,undefined:V3,void:R3,never:W3,any:A3,unknown:Z3,date:b3,enum:P3,literal:S3,nan:j3,template_literal:F3,file:w3,success:E3,custom:C3,function:f3,transform:x3,map:k3,set:i3,array:y3,object:l3,union:$u,intersection:m3,tuple:n3,record:r3,nullable:h3,nonoptional:c3,default:d3,prefault:o3,catch:p3,pipe:t3,readonly:a3,promise:e3,optional:Iu,lazy:s3};function Uu($,I){if("_idmap"in $){let u=$,U=L6({...I,processors:s_}),g={};for(let J of u._idmap.entries()){let[X,N]=J;u$(N,U)}let z={},G={registry:u,uri:I?.uri,defs:g};U.external=G;for(let J of u._idmap.entries()){let[X,N]=J;B6(U,N),z[X]=K6(U,N)}if(Object.keys(g).length>0){let J=U.target==="draft-2020-12"?"$defs":"definitions";z.__shared={[J]:g}}return{schemas:z}}let _=L6({...I,processors:s_});return u$($,_),B6(_,$),K6(_,$)}class $9{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter($){this.ctx.counter=$}get seen(){return this.ctx.seen}constructor($){let I=$?.target??"draft-2020-12";if(I==="draft-4")I="draft-04";if(I==="draft-7")I="draft-07";this.ctx=L6({processors:s_,target:I,...$?.metadata&&{metadata:$.metadata},...$?.unrepresentable&&{unrepresentable:$.unrepresentable},...$?.override&&{override:$.override},...$?.io&&{io:$.io}})}process($,I={path:[],schemaPath:[]}){return u$($,this.ctx,I)}emit($,I){if(I){if(I.cycles)this.ctx.cycles=I.cycles;if(I.reused)this.ctx.reused=I.reused;if(I.external)this.ctx.external=I.external}B6(this.ctx,$);let _=K6(this.ctx,$),{"~standard":u,...U}=_;return U}}var L7={};var B0={};b4(B0,{xor:()=>QH,xid:()=>C7,void:()=>zH,uuidv7:()=>Z7,uuidv6:()=>A7,uuidv4:()=>W7,uuid:()=>R7,url:()=>b7,unknown:()=>e6,union:()=>Pu,undefined:()=>uH,ulid:()=>E7,uint64:()=>UH,uint32:()=>s7,tuple:()=>E9,transform:()=>ju,templateLiteral:()=>WH,symbol:()=>_H,superRefine:()=>GX,success:()=>KH,stringbool:()=>wH,stringFormat:()=>c7,string:()=>Ju,strictObject:()=>qH,set:()=>TH,refine:()=>zX,record:()=>C9,readonly:()=>$X,promise:()=>AH,preprocess:()=>CH,prefault:()=>d9,pipe:()=>W0,partialRecord:()=>YH,optional:()=>V0,object:()=>XH,number:()=>M9,nullish:()=>BH,nullable:()=>R0,null:()=>V9,nonoptional:()=>o9,never:()=>bu,nativeEnum:()=>MH,nanoid:()=>j7,nan:()=>VH,meta:()=>jH,map:()=>vH,mac:()=>k7,looseRecord:()=>OH,looseObject:()=>NH,literal:()=>DH,lazy:()=>_X,ksuid:()=>f7,keyof:()=>JH,jwt:()=>h7,json:()=>EH,ipv6:()=>i7,ipv4:()=>x7,intersection:()=>F9,int64:()=>IH,int32:()=>e7,int:()=>Xu,instanceof:()=>FH,httpUrl:()=>P7,hostname:()=>d7,hex:()=>o7,hash:()=>p7,guid:()=>V7,function:()=>ZH,float64:()=>a7,float32:()=>t7,file:()=>LH,exactOptional:()=>m9,enum:()=>Su,emoji:()=>S7,email:()=>K7,e164:()=>r7,discriminatedUnion:()=>HH,describe:()=>SH,date:()=>GH,custom:()=>PH,cuid2:()=>w7,cuid:()=>F7,codec:()=>RH,cidrv6:()=>l7,cidrv4:()=>y7,check:()=>bH,catch:()=>a9,boolean:()=>D9,bigint:()=>$H,base64url:()=>n7,base64:()=>m7,array:()=>b0,any:()=>gH,_function:()=>ZH,_default:()=>h9,_ZodString:()=>qu,ZodXor:()=>P9,ZodXID:()=>Tu,ZodVoid:()=>Z9,ZodUnknown:()=>W9,ZodUnion:()=>S0,ZodUndefined:()=>B9,ZodUUID:()=>C4,ZodURL:()=>A0,ZodULID:()=>vu,ZodType:()=>c,ZodTuple:()=>w9,ZodTransform:()=>y9,ZodTemplateLiteral:()=>IX,ZodSymbol:()=>L9,ZodSuccess:()=>p9,ZodStringFormat:()=>q$,ZodString:()=>s1,ZodSet:()=>x9,ZodRecord:()=>j0,ZodReadonly:()=>s9,ZodPromise:()=>uX,ZodPrefault:()=>c9,ZodPipe:()=>Eu,ZodOptional:()=>Fu,ZodObject:()=>P0,ZodNumberFormat:()=>s6,ZodNumber:()=>II,ZodNullable:()=>n9,ZodNull:()=>K9,ZodNonOptional:()=>wu,ZodNever:()=>A9,ZodNanoID:()=>Hu,ZodNaN:()=>e9,ZodMap:()=>f9,ZodMAC:()=>T9,ZodLiteral:()=>k9,ZodLazy:()=>UX,ZodKSUID:()=>Mu,ZodJWT:()=>Au,ZodIntersection:()=>j9,ZodIPv6:()=>Lu,ZodIPv4:()=>Du,ZodGUID:()=>K0,ZodFunction:()=>gX,ZodFile:()=>i9,ZodExactOptional:()=>l9,ZodEnum:()=>e1,ZodEmoji:()=>Qu,ZodEmail:()=>Nu,ZodE164:()=>Wu,ZodDiscriminatedUnion:()=>S9,ZodDefault:()=>r9,ZodDate:()=>Z0,ZodCustomStringFormat:()=>$I,ZodCustom:()=>F0,ZodCodec:()=>Cu,ZodCatch:()=>t9,ZodCUID2:()=>Ou,ZodCUID:()=>Yu,ZodCIDRv6:()=>Ku,ZodCIDRv4:()=>Bu,ZodBoolean:()=>UI,ZodBigIntFormat:()=>Zu,ZodBigInt:()=>_I,ZodBase64URL:()=>Ru,ZodBase64:()=>Vu,ZodArray:()=>b9,ZodAny:()=>R9});var _u={};b4(_u,{uppercase:()=>i1,trim:()=>h1,toUpperCase:()=>d1,toLowerCase:()=>c1,startsWith:()=>l1,slugify:()=>o1,size:()=>p6,regex:()=>x1,property:()=>e_,positive:()=>o_,overwrite:()=>D4,normalize:()=>r1,nonpositive:()=>t_,nonnegative:()=>a_,negative:()=>p_,multipleOf:()=>M6,minSize:()=>E4,minLength:()=>d4,mime:()=>n1,maxSize:()=>D6,maxLength:()=>t6,lte:()=>I4,lt:()=>F4,lowercase:()=>k1,length:()=>a6,includes:()=>y1,gte:()=>n$,gt:()=>w4,endsWith:()=>m1});var a1={};b4(a1,{time:()=>_9,duration:()=>u9,datetime:()=>I9,date:()=>U9,ZodISOTime:()=>zu,ZodISODuration:()=>Gu,ZodISODateTime:()=>uu,ZodISODate:()=>gu});var uu=L("ZodISODateTime",($,I)=>{kG.init($,I),q$.init($,I)});function I9($){return C8(uu,$)}var gu=L("ZodISODate",($,I)=>{iG.init($,I),q$.init($,I)});function U9($){return f8(gu,$)}var zu=L("ZodISOTime",($,I)=>{yG.init($,I),q$.init($,I)});function _9($){return x8(zu,$)}var Gu=L("ZodISODuration",($,I)=>{lG.init($,I),q$.init($,I)});function u9($){return k8(Gu,$)}var B7=($,I)=>{g0.init($,I),$.name="ZodError",Object.defineProperties($,{format:{value:(_)=>G0($,_)},flatten:{value:(_)=>z0($,_)},addIssue:{value:(_)=>{$.issues.push(_),$.message=JSON.stringify($.issues,b1,2)}},addIssues:{value:(_)=>{$.issues.push(..._),$.message=JSON.stringify($.issues,b1,2)}},isEmpty:{get(){return $.issues.length===0}}})},pS=L("ZodError",B7),s$=L("ZodError",B7,{Parent:Error});var g9=j1(s$),z9=F1(s$),G9=w1(s$),J9=E1(s$),X9=z_(s$),q9=G_(s$),N9=J_(s$),Q9=X_(s$),H9=q_(s$),Y9=N_(s$),O9=Q_(s$),v9=H_(s$);var c=L("ZodType",($,I)=>{return r.init($,I),Object.assign($["~standard"],{jsonSchema:{input:t1($,"input"),output:t1($,"output")}}),$.toJSONSchema=v3($,{}),$.def=I,$.type=I.type,Object.defineProperty($,"_def",{value:I}),$.check=(..._)=>{return $.clone(S.mergeDefs(I,{checks:[...I.checks??[],..._.map((u)=>typeof u==="function"?{_zod:{check:u,def:{check:"custom"},onattach:[]}}:u)]}),{parent:!0})},$.with=$.check,$.clone=(_,u)=>m$($,_,u),$.brand=()=>$,$.register=(_,u)=>{return _.add($,u),$},$.parse=(_,u)=>g9($,_,u,{callee:$.parse}),$.safeParse=(_,u)=>G9($,_,u),$.parseAsync=async(_,u)=>z9($,_,u,{callee:$.parseAsync}),$.safeParseAsync=async(_,u)=>J9($,_,u),$.spa=$.safeParseAsync,$.encode=(_,u)=>X9($,_,u),$.decode=(_,u)=>q9($,_,u),$.encodeAsync=async(_,u)=>N9($,_,u),$.decodeAsync=async(_,u)=>Q9($,_,u),$.safeEncode=(_,u)=>H9($,_,u),$.safeDecode=(_,u)=>Y9($,_,u),$.safeEncodeAsync=async(_,u)=>O9($,_,u),$.safeDecodeAsync=async(_,u)=>v9($,_,u),$.refine=(_,u)=>$.check(zX(_,u)),$.superRefine=(_)=>$.check(GX(_)),$.overwrite=(_)=>$.check(D4(_)),$.optional=()=>V0($),$.exactOptional=()=>m9($),$.nullable=()=>R0($),$.nullish=()=>V0(R0($)),$.nonoptional=(_)=>o9($,_),$.array=()=>b0($),$.or=(_)=>Pu([$,_]),$.and=(_)=>F9($,_),$.transform=(_)=>W0($,ju(_)),$.default=(_)=>h9($,_),$.prefault=(_)=>d9($,_),$.catch=(_)=>a9($,_),$.pipe=(_)=>W0($,_),$.readonly=()=>$X($),$.describe=(_)=>{let u=$.clone();return j$.add(u,{description:_}),u},Object.defineProperty($,"description",{get(){return j$.get($)?.description},configurable:!0}),$.meta=(..._)=>{if(_.length===0)return j$.get($);let u=$.clone();return j$.add(u,_[0]),u},$.isOptional=()=>$.safeParse(void 0).success,$.isNullable=()=>$.safeParse(null).success,$.apply=(_)=>_($),$}),qu=L("_ZodString",($,I)=>{o6.init($,I),c.init($,I),$._zod.processJSONSchema=(u,U,g)=>T3($,u,U,g);let _=$._zod.bag;$.format=_.format??null,$.minLength=_.minimum??null,$.maxLength=_.maximum??null,$.regex=(...u)=>$.check(x1(...u)),$.includes=(...u)=>$.check(y1(...u)),$.startsWith=(...u)=>$.check(l1(...u)),$.endsWith=(...u)=>$.check(m1(...u)),$.min=(...u)=>$.check(d4(...u)),$.max=(...u)=>$.check(t6(...u)),$.length=(...u)=>$.check(a6(...u)),$.nonempty=(...u)=>$.check(d4(1,...u)),$.lowercase=(u)=>$.check(k1(u)),$.uppercase=(u)=>$.check(i1(u)),$.trim=()=>$.check(h1()),$.normalize=(...u)=>$.check(r1(...u)),$.toLowerCase=()=>$.check(c1()),$.toUpperCase=()=>$.check(d1()),$.slugify=()=>$.check(o1())}),s1=L("ZodString",($,I)=>{o6.init($,I),qu.init($,I),$.email=(_)=>$.check(b_(Nu,_)),$.url=(_)=>$.check(L0(A0,_)),$.jwt=(_)=>$.check(d_(Au,_)),$.emoji=(_)=>$.check(w_(Qu,_)),$.guid=(_)=>$.check(D0(K0,_)),$.uuid=(_)=>$.check(P_(C4,_)),$.uuidv4=(_)=>$.check(S_(C4,_)),$.uuidv6=(_)=>$.check(j_(C4,_)),$.uuidv7=(_)=>$.check(F_(C4,_)),$.nanoid=(_)=>$.check(E_(Hu,_)),$.guid=(_)=>$.check(D0(K0,_)),$.cuid=(_)=>$.check(C_(Yu,_)),$.cuid2=(_)=>$.check(f_(Ou,_)),$.ulid=(_)=>$.check(x_(vu,_)),$.base64=(_)=>$.check(r_(Vu,_)),$.base64url=(_)=>$.check(h_(Ru,_)),$.xid=(_)=>$.check(k_(Tu,_)),$.ksuid=(_)=>$.check(i_(Mu,_)),$.ipv4=(_)=>$.check(y_(Du,_)),$.ipv6=(_)=>$.check(l_(Lu,_)),$.cidrv4=(_)=>$.check(m_(Bu,_)),$.cidrv6=(_)=>$.check(n_(Ku,_)),$.e164=(_)=>$.check(c_(Wu,_)),$.datetime=(_)=>$.check(I9(_)),$.date=(_)=>$.check(U9(_)),$.time=(_)=>$.check(_9(_)),$.duration=(_)=>$.check(u9(_))});function Ju($){return j8(s1,$)}var q$=L("ZodStringFormat",($,I)=>{X$.init($,I),qu.init($,I)}),Nu=L("ZodEmail",($,I)=>{PG.init($,I),q$.init($,I)});function K7($){return b_(Nu,$)}var K0=L("ZodGUID",($,I)=>{ZG.init($,I),q$.init($,I)});function V7($){return D0(K0,$)}var C4=L("ZodUUID",($,I)=>{bG.init($,I),q$.init($,I)});function R7($){return P_(C4,$)}function W7($){return S_(C4,$)}function A7($){return j_(C4,$)}function Z7($){return F_(C4,$)}var A0=L("ZodURL",($,I)=>{SG.init($,I),q$.init($,I)});function b7($){return L0(A0,$)}function P7($){return L0(A0,{protocol:/^https?$/,hostname:N4.domain,...S.normalizeParams($)})}var Qu=L("ZodEmoji",($,I)=>{jG.init($,I),q$.init($,I)});function S7($){return w_(Qu,$)}var Hu=L("ZodNanoID",($,I)=>{FG.init($,I),q$.init($,I)});function j7($){return E_(Hu,$)}var Yu=L("ZodCUID",($,I)=>{wG.init($,I),q$.init($,I)});function F7($){return C_(Yu,$)}var Ou=L("ZodCUID2",($,I)=>{EG.init($,I),q$.init($,I)});function w7($){return f_(Ou,$)}var vu=L("ZodULID",($,I)=>{CG.init($,I),q$.init($,I)});function E7($){return x_(vu,$)}var Tu=L("ZodXID",($,I)=>{fG.init($,I),q$.init($,I)});function C7($){return k_(Tu,$)}var Mu=L("ZodKSUID",($,I)=>{xG.init($,I),q$.init($,I)});function f7($){return i_(Mu,$)}var Du=L("ZodIPv4",($,I)=>{mG.init($,I),q$.init($,I)});function x7($){return y_(Du,$)}var T9=L("ZodMAC",($,I)=>{rG.init($,I),q$.init($,I)});function k7($){return w8(T9,$)}var Lu=L("ZodIPv6",($,I)=>{nG.init($,I),q$.init($,I)});function i7($){return l_(Lu,$)}var Bu=L("ZodCIDRv4",($,I)=>{hG.init($,I),q$.init($,I)});function y7($){return m_(Bu,$)}var Ku=L("ZodCIDRv6",($,I)=>{cG.init($,I),q$.init($,I)});function l7($){return n_(Ku,$)}var Vu=L("ZodBase64",($,I)=>{oG.init($,I),q$.init($,I)});function m7($){return r_(Vu,$)}var Ru=L("ZodBase64URL",($,I)=>{pG.init($,I),q$.init($,I)});function n7($){return h_(Ru,$)}var Wu=L("ZodE164",($,I)=>{tG.init($,I),q$.init($,I)});function r7($){return c_(Wu,$)}var Au=L("ZodJWT",($,I)=>{aG.init($,I),q$.init($,I)});function h7($){return d_(Au,$)}var $I=L("ZodCustomStringFormat",($,I)=>{eG.init($,I),q$.init($,I)});function c7($,I,_={}){return p1($I,$,I,_)}function d7($){return p1($I,"hostname",N4.hostname,$)}function o7($){return p1($I,"hex",N4.hex,$)}function p7($,I){let _=I?.enc??"hex",u=`${$}_${_}`,U=N4[u];if(!U)throw Error(`Unrecognized hash format: ${u}`);return p1($I,u,U,I)}var II=L("ZodNumber",($,I)=>{V_.init($,I),c.init($,I),$._zod.processJSONSchema=(u,U,g)=>M3($,u,U,g),$.gt=(u,U)=>$.check(w4(u,U)),$.gte=(u,U)=>$.check(n$(u,U)),$.min=(u,U)=>$.check(n$(u,U)),$.lt=(u,U)=>$.check(F4(u,U)),$.lte=(u,U)=>$.check(I4(u,U)),$.max=(u,U)=>$.check(I4(u,U)),$.int=(u)=>$.check(Xu(u)),$.safe=(u)=>$.check(Xu(u)),$.positive=(u)=>$.check(w4(0,u)),$.nonnegative=(u)=>$.check(n$(0,u)),$.negative=(u)=>$.check(F4(0,u)),$.nonpositive=(u)=>$.check(I4(0,u)),$.multipleOf=(u,U)=>$.check(M6(u,U)),$.step=(u,U)=>$.check(M6(u,U)),$.finite=()=>$;let _=$._zod.bag;$.minValue=Math.max(_.minimum??Number.NEGATIVE_INFINITY,_.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,$.maxValue=Math.min(_.maximum??Number.POSITIVE_INFINITY,_.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,$.isInt=(_.format??"").includes("int")||Number.isSafeInteger(_.multipleOf??0.5),$.isFinite=!0,$.format=_.format??null});function M9($){return i8(II,$)}var s6=L("ZodNumberFormat",($,I)=>{sG.init($,I),II.init($,I)});function Xu($){return l8(s6,$)}function t7($){return m8(s6,$)}function a7($){return n8(s6,$)}function e7($){return r8(s6,$)}function s7($){return h8(s6,$)}var UI=L("ZodBoolean",($,I)=>{N0.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>D3($,_,u,U)});function D9($){return c8(UI,$)}var _I=L("ZodBigInt",($,I)=>{R_.init($,I),c.init($,I),$._zod.processJSONSchema=(u,U,g)=>L3($,u,U,g),$.gte=(u,U)=>$.check(n$(u,U)),$.min=(u,U)=>$.check(n$(u,U)),$.gt=(u,U)=>$.check(w4(u,U)),$.gte=(u,U)=>$.check(n$(u,U)),$.min=(u,U)=>$.check(n$(u,U)),$.lt=(u,U)=>$.check(F4(u,U)),$.lte=(u,U)=>$.check(I4(u,U)),$.max=(u,U)=>$.check(I4(u,U)),$.positive=(u)=>$.check(w4(BigInt(0),u)),$.negative=(u)=>$.check(F4(BigInt(0),u)),$.nonpositive=(u)=>$.check(I4(BigInt(0),u)),$.nonnegative=(u)=>$.check(n$(BigInt(0),u)),$.multipleOf=(u,U)=>$.check(M6(u,U));let _=$._zod.bag;$.minValue=_.minimum??null,$.maxValue=_.maximum??null,$.format=_.format??null});function $H($){return o8(_I,$)}var Zu=L("ZodBigIntFormat",($,I)=>{$J.init($,I),_I.init($,I)});function IH($){return t8(Zu,$)}function UH($){return a8(Zu,$)}var L9=L("ZodSymbol",($,I)=>{IJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>B3($,_,u,U)});function _H($){return e8(L9,$)}var B9=L("ZodUndefined",($,I)=>{UJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>V3($,_,u,U)});function uH($){return s8(B9,$)}var K9=L("ZodNull",($,I)=>{_J.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>K3($,_,u,U)});function V9($){return $3(K9,$)}var R9=L("ZodAny",($,I)=>{uJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>A3($,_,u,U)});function gH(){return I3(R9)}var W9=L("ZodUnknown",($,I)=>{gJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>Z3($,_,u,U)});function e6(){return U3(W9)}var A9=L("ZodNever",($,I)=>{zJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>W3($,_,u,U)});function bu($){return _3(A9,$)}var Z9=L("ZodVoid",($,I)=>{GJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>R3($,_,u,U)});function zH($){return u3(Z9,$)}var Z0=L("ZodDate",($,I)=>{JJ.init($,I),c.init($,I),$._zod.processJSONSchema=(u,U,g)=>b3($,u,U,g),$.min=(u,U)=>$.check(n$(u,U)),$.max=(u,U)=>$.check(I4(u,U));let _=$._zod.bag;$.minDate=_.minimum?new Date(_.minimum):null,$.maxDate=_.maximum?new Date(_.maximum):null});function GH($){return g3(Z0,$)}var b9=L("ZodArray",($,I)=>{XJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>y3($,_,u,U),$.element=I.element,$.min=(_,u)=>$.check(d4(_,u)),$.nonempty=(_)=>$.check(d4(1,_)),$.max=(_,u)=>$.check(t6(_,u)),$.length=(_,u)=>$.check(a6(_,u)),$.unwrap=()=>$.element});function b0($,I){return J3(b9,$,I)}function JH($){let I=$._zod.def.shape;return Su(Object.keys(I))}var P0=L("ZodObject",($,I)=>{qJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>l3($,_,u,U),S.defineLazy($,"shape",()=>{return I.shape}),$.keyof=()=>Su(Object.keys($._zod.def.shape)),$.catchall=(_)=>$.clone({...$._zod.def,catchall:_}),$.passthrough=()=>$.clone({...$._zod.def,catchall:e6()}),$.loose=()=>$.clone({...$._zod.def,catchall:e6()}),$.strict=()=>$.clone({...$._zod.def,catchall:bu()}),$.strip=()=>$.clone({...$._zod.def,catchall:void 0}),$.extend=(_)=>{return S.extend($,_)},$.safeExtend=(_)=>{return S.safeExtend($,_)},$.merge=(_)=>S.merge($,_),$.pick=(_)=>S.pick($,_),$.omit=(_)=>S.omit($,_),$.partial=(..._)=>S.partial(Fu,$,_[0]),$.required=(..._)=>S.required(wu,$,_[0])});function XH($,I){let _={type:"object",shape:$??{},...S.normalizeParams(I)};return new P0(_)}function qH($,I){return new P0({type:"object",shape:$,catchall:bu(),...S.normalizeParams(I)})}function NH($,I){return new P0({type:"object",shape:$,catchall:e6(),...S.normalizeParams(I)})}var S0=L("ZodUnion",($,I)=>{Q0.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>$u($,_,u,U),$.options=I.options});function Pu($,I){return new S0({type:"union",options:$,...S.normalizeParams(I)})}var P9=L("ZodXor",($,I)=>{S0.init($,I),NJ.init($,I),$._zod.processJSONSchema=(_,u,U)=>$u($,_,u,U),$.options=I.options});function QH($,I){return new P9({type:"union",options:$,inclusive:!1,...S.normalizeParams(I)})}var S9=L("ZodDiscriminatedUnion",($,I)=>{S0.init($,I),QJ.init($,I)});function HH($,I,_){return new S9({type:"union",options:I,discriminator:$,...S.normalizeParams(_)})}var j9=L("ZodIntersection",($,I)=>{HJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>m3($,_,u,U)});function F9($,I){return new j9({type:"intersection",left:$,right:I})}var w9=L("ZodTuple",($,I)=>{W_.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>n3($,_,u,U),$.rest=(_)=>$.clone({...$._zod.def,rest:_})});function E9($,I,_){let u=I instanceof r,U=u?_:I;return new w9({type:"tuple",items:$,rest:u?I:null,...S.normalizeParams(U)})}var j0=L("ZodRecord",($,I)=>{YJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>r3($,_,u,U),$.keyType=I.keyType,$.valueType=I.valueType});function C9($,I,_){return new j0({type:"record",keyType:$,valueType:I,...S.normalizeParams(_)})}function YH($,I,_){let u=m$($);return u._zod.values=void 0,new j0({type:"record",keyType:u,valueType:I,...S.normalizeParams(_)})}function OH($,I,_){return new j0({type:"record",keyType:$,valueType:I,mode:"loose",...S.normalizeParams(_)})}var f9=L("ZodMap",($,I)=>{OJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>k3($,_,u,U),$.keyType=I.keyType,$.valueType=I.valueType,$.min=(..._)=>$.check(E4(..._)),$.nonempty=(_)=>$.check(E4(1,_)),$.max=(..._)=>$.check(D6(..._)),$.size=(..._)=>$.check(p6(..._))});function vH($,I,_){return new f9({type:"map",keyType:$,valueType:I,...S.normalizeParams(_)})}var x9=L("ZodSet",($,I)=>{vJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>i3($,_,u,U),$.min=(..._)=>$.check(E4(..._)),$.nonempty=(_)=>$.check(E4(1,_)),$.max=(..._)=>$.check(D6(..._)),$.size=(..._)=>$.check(p6(..._))});function TH($,I){return new x9({type:"set",valueType:$,...S.normalizeParams(I)})}var e1=L("ZodEnum",($,I)=>{TJ.init($,I),c.init($,I),$._zod.processJSONSchema=(u,U,g)=>P3($,u,U,g),$.enum=I.entries,$.options=Object.values(I.entries);let _=new Set(Object.keys(I.entries));$.extract=(u,U)=>{let g={};for(let z of u)if(_.has(z))g[z]=I.entries[z];else throw Error(`Key ${z} not found in enum`);return new e1({...I,checks:[],...S.normalizeParams(U),entries:g})},$.exclude=(u,U)=>{let g={...I.entries};for(let z of u)if(_.has(z))delete g[z];else throw Error(`Key ${z} not found in enum`);return new e1({...I,checks:[],...S.normalizeParams(U),entries:g})}});function Su($,I){let _=Array.isArray($)?Object.fromEntries($.map((u)=>[u,u])):$;return new e1({type:"enum",entries:_,...S.normalizeParams(I)})}function MH($,I){return new e1({type:"enum",entries:$,...S.normalizeParams(I)})}var k9=L("ZodLiteral",($,I)=>{MJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>S3($,_,u,U),$.values=new Set(I.values),Object.defineProperty($,"value",{get(){if(I.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return I.values[0]}})});function DH($,I){return new k9({type:"literal",values:Array.isArray($)?$:[$],...S.normalizeParams(I)})}var i9=L("ZodFile",($,I)=>{DJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>w3($,_,u,U),$.min=(_,u)=>$.check(E4(_,u)),$.max=(_,u)=>$.check(D6(_,u)),$.mime=(_,u)=>$.check(n1(Array.isArray(_)?_:[_],u))});function LH($){return X3(i9,$)}var y9=L("ZodTransform",($,I)=>{LJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>x3($,_,u,U),$._zod.parse=(_,u)=>{if(u.direction==="backward")throw new h6($.constructor.name);_.addIssue=(g)=>{if(typeof g==="string")_.issues.push(S.issue(g,_.value,I));else{let z=g;if(z.fatal)z.continue=!1;z.code??(z.code="custom"),z.input??(z.input=_.value),z.inst??(z.inst=$),_.issues.push(S.issue(z))}};let U=I.transform(_.value,_);if(U instanceof Promise)return U.then((g)=>{return _.value=g,_});return _.value=U,_}});function ju($){return new y9({type:"transform",transform:$})}var Fu=L("ZodOptional",($,I)=>{A_.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>Iu($,_,u,U),$.unwrap=()=>$._zod.def.innerType});function V0($){return new Fu({type:"optional",innerType:$})}var l9=L("ZodExactOptional",($,I)=>{BJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>Iu($,_,u,U),$.unwrap=()=>$._zod.def.innerType});function m9($){return new l9({type:"optional",innerType:$})}var n9=L("ZodNullable",($,I)=>{KJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>h3($,_,u,U),$.unwrap=()=>$._zod.def.innerType});function R0($){return new n9({type:"nullable",innerType:$})}function BH($){return V0(R0($))}var r9=L("ZodDefault",($,I)=>{VJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>d3($,_,u,U),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});function h9($,I){return new r9({type:"default",innerType:$,get defaultValue(){return typeof I==="function"?I():S.shallowClone(I)}})}var c9=L("ZodPrefault",($,I)=>{RJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>o3($,_,u,U),$.unwrap=()=>$._zod.def.innerType});function d9($,I){return new c9({type:"prefault",innerType:$,get defaultValue(){return typeof I==="function"?I():S.shallowClone(I)}})}var wu=L("ZodNonOptional",($,I)=>{WJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>c3($,_,u,U),$.unwrap=()=>$._zod.def.innerType});function o9($,I){return new wu({type:"nonoptional",innerType:$,...S.normalizeParams(I)})}var p9=L("ZodSuccess",($,I)=>{AJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>E3($,_,u,U),$.unwrap=()=>$._zod.def.innerType});function KH($){return new p9({type:"success",innerType:$})}var t9=L("ZodCatch",($,I)=>{ZJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>p3($,_,u,U),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});function a9($,I){return new t9({type:"catch",innerType:$,catchValue:typeof I==="function"?I:()=>I})}var e9=L("ZodNaN",($,I)=>{bJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>j3($,_,u,U)});function VH($){return G3(e9,$)}var Eu=L("ZodPipe",($,I)=>{PJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>t3($,_,u,U),$.in=I.in,$.out=I.out});function W0($,I){return new Eu({type:"pipe",in:$,out:I})}var Cu=L("ZodCodec",($,I)=>{Eu.init($,I),H0.init($,I)});function RH($,I,_){return new Cu({type:"pipe",in:$,out:I,transform:_.decode,reverseTransform:_.encode})}var s9=L("ZodReadonly",($,I)=>{SJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>a3($,_,u,U),$.unwrap=()=>$._zod.def.innerType});function $X($){return new s9({type:"readonly",innerType:$})}var IX=L("ZodTemplateLiteral",($,I)=>{jJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>F3($,_,u,U)});function WH($,I){return new IX({type:"template_literal",parts:$,...S.normalizeParams(I)})}var UX=L("ZodLazy",($,I)=>{EJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>s3($,_,u,U),$.unwrap=()=>$._zod.def.getter()});function _X($){return new UX({type:"lazy",getter:$})}var uX=L("ZodPromise",($,I)=>{wJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>e3($,_,u,U),$.unwrap=()=>$._zod.def.innerType});function AH($){return new uX({type:"promise",innerType:$})}var gX=L("ZodFunction",($,I)=>{FJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>f3($,_,u,U)});function ZH($){return new gX({type:"function",input:Array.isArray($?.input)?E9($?.input):$?.input??b0(e6()),output:$?.output??e6()})}var F0=L("ZodCustom",($,I)=>{CJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>C3($,_,u,U)});function bH($){let I=new Q$({check:"custom"});return I._zod.check=$,I}function PH($,I){return q3(F0,$??(()=>!0),I)}function zX($,I={}){return N3(F0,$,I)}function GX($){return Q3($)}var SH=H3,jH=Y3;function FH($,I={}){let _=new F0({type:"custom",check:"custom",fn:(u)=>u instanceof $,abort:!0,...S.normalizeParams(I)});return _._zod.bag.Class=$,_._zod.check=(u)=>{if(!(u.value instanceof $))u.issues.push({code:"invalid_type",expected:$.name,input:u.value,inst:_,path:[..._._zod.def.path??[]]})},_}var wH=(...$)=>O3({Codec:Cu,Boolean:UI,String:s1},...$);function EH($){let I=_X(()=>{return Pu([Ju($),M9(),D9(),V9(),b0(I),C9(Ju(),I)])});return I}function CH($,I){return W0(ju($),I)}var aS={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function eS($){K$({customError:$})}function sS(){return K$().customError}var JX;(function($){})(JX||(JX={}));var f={...B0,..._u,iso:a1},$j=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function Ij($,I){let _=$.$schema;if(_==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(_==="http://json-schema.org/draft-07/schema#")return"draft-7";if(_==="http://json-schema.org/draft-04/schema#")return"draft-4";return I??"draft-2020-12"}function Uj($,I){if(!$.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let _=$.slice(1).split("/").filter(Boolean);if(_.length===0)return I.rootSchema;let u=I.version==="draft-2020-12"?"$defs":"definitions";if(_[0]===u){let U=_[1];if(!U||!I.defs[U])throw Error(`Reference not found: ${$}`);return I.defs[U]}throw Error(`Reference not found: ${$}`)}function fH($,I){if($.not!==void 0){if(typeof $.not==="object"&&Object.keys($.not).length===0)return f.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if($.unevaluatedItems!==void 0)throw Error("unevaluatedItems is not supported");if($.unevaluatedProperties!==void 0)throw Error("unevaluatedProperties is not supported");if($.if!==void 0||$.then!==void 0||$.else!==void 0)throw Error("Conditional schemas (if/then/else) are not supported");if($.dependentSchemas!==void 0||$.dependentRequired!==void 0)throw Error("dependentSchemas and dependentRequired are not supported");if($.$ref){let U=$.$ref;if(I.refs.has(U))return I.refs.get(U);if(I.processing.has(U))return f.lazy(()=>{if(!I.refs.has(U))throw Error(`Circular reference not resolved: ${U}`);return I.refs.get(U)});I.processing.add(U);let g=Uj(U,I),z=E$(g,I);return I.refs.set(U,z),I.processing.delete(U),z}if($.enum!==void 0){let U=$.enum;if(I.version==="openapi-3.0"&&$.nullable===!0&&U.length===1&&U[0]===null)return f.null();if(U.length===0)return f.never();if(U.length===1)return f.literal(U[0]);if(U.every((z)=>typeof z==="string"))return f.enum(U);let g=U.map((z)=>f.literal(z));if(g.length<2)return g[0];return f.union([g[0],g[1],...g.slice(2)])}if($.const!==void 0)return f.literal($.const);let _=$.type;if(Array.isArray(_)){let U=_.map((g)=>{let z={...$,type:g};return fH(z,I)});if(U.length===0)return f.never();if(U.length===1)return U[0];return f.union(U)}if(!_)return f.any();let u;switch(_){case"string":{let U=f.string();if($.format){let g=$.format;if(g==="email")U=U.check(f.email());else if(g==="uri"||g==="uri-reference")U=U.check(f.url());else if(g==="uuid"||g==="guid")U=U.check(f.uuid());else if(g==="date-time")U=U.check(f.iso.datetime());else if(g==="date")U=U.check(f.iso.date());else if(g==="time")U=U.check(f.iso.time());else if(g==="duration")U=U.check(f.iso.duration());else if(g==="ipv4")U=U.check(f.ipv4());else if(g==="ipv6")U=U.check(f.ipv6());else if(g==="mac")U=U.check(f.mac());else if(g==="cidr")U=U.check(f.cidrv4());else if(g==="cidr-v6")U=U.check(f.cidrv6());else if(g==="base64")U=U.check(f.base64());else if(g==="base64url")U=U.check(f.base64url());else if(g==="e164")U=U.check(f.e164());else if(g==="jwt")U=U.check(f.jwt());else if(g==="emoji")U=U.check(f.emoji());else if(g==="nanoid")U=U.check(f.nanoid());else if(g==="cuid")U=U.check(f.cuid());else if(g==="cuid2")U=U.check(f.cuid2());else if(g==="ulid")U=U.check(f.ulid());else if(g==="xid")U=U.check(f.xid());else if(g==="ksuid")U=U.check(f.ksuid())}if(typeof $.minLength==="number")U=U.min($.minLength);if(typeof $.maxLength==="number")U=U.max($.maxLength);if($.pattern)U=U.regex(new RegExp($.pattern));u=U;break}case"number":case"integer":{let U=_==="integer"?f.number().int():f.number();if(typeof $.minimum==="number")U=U.min($.minimum);if(typeof $.maximum==="number")U=U.max($.maximum);if(typeof $.exclusiveMinimum==="number")U=U.gt($.exclusiveMinimum);else if($.exclusiveMinimum===!0&&typeof $.minimum==="number")U=U.gt($.minimum);if(typeof $.exclusiveMaximum==="number")U=U.lt($.exclusiveMaximum);else if($.exclusiveMaximum===!0&&typeof $.maximum==="number")U=U.lt($.maximum);if(typeof $.multipleOf==="number")U=U.multipleOf($.multipleOf);u=U;break}case"boolean":{u=f.boolean();break}case"null":{u=f.null();break}case"object":{let U={},g=$.properties||{},z=new Set($.required||[]);for(let[J,X]of Object.entries(g)){let N=E$(X,I);U[J]=z.has(J)?N:N.optional()}if($.propertyNames){let J=E$($.propertyNames,I),X=$.additionalProperties&&typeof $.additionalProperties==="object"?E$($.additionalProperties,I):f.any();if(Object.keys(U).length===0){u=f.record(J,X);break}let N=f.object(U).passthrough(),q=f.looseRecord(J,X);u=f.intersection(N,q);break}if($.patternProperties){let J=$.patternProperties,X=Object.keys(J),N=[];for(let Q of X){let Y=E$(J[Q],I),O=f.string().regex(new RegExp(Q));N.push(f.looseRecord(O,Y))}let q=[];if(Object.keys(U).length>0)q.push(f.object(U).passthrough());if(q.push(...N),q.length===0)u=f.object({}).passthrough();else if(q.length===1)u=q[0];else{let Q=f.intersection(q[0],q[1]);for(let Y=2;Y<q.length;Y++)Q=f.intersection(Q,q[Y]);u=Q}break}let G=f.object(U);if($.additionalProperties===!1)u=G.strict();else if(typeof $.additionalProperties==="object")u=G.catchall(E$($.additionalProperties,I));else u=G.passthrough();break}case"array":{let{prefixItems:U,items:g}=$;if(U&&Array.isArray(U)){let z=U.map((J)=>E$(J,I)),G=g&&typeof g==="object"&&!Array.isArray(g)?E$(g,I):void 0;if(G)u=f.tuple(z).rest(G);else u=f.tuple(z);if(typeof $.minItems==="number")u=u.check(f.minLength($.minItems));if(typeof $.maxItems==="number")u=u.check(f.maxLength($.maxItems))}else if(Array.isArray(g)){let z=g.map((J)=>E$(J,I)),G=$.additionalItems&&typeof $.additionalItems==="object"?E$($.additionalItems,I):void 0;if(G)u=f.tuple(z).rest(G);else u=f.tuple(z);if(typeof $.minItems==="number")u=u.check(f.minLength($.minItems));if(typeof $.maxItems==="number")u=u.check(f.maxLength($.maxItems))}else if(g!==void 0){let z=E$(g,I),G=f.array(z);if(typeof $.minItems==="number")G=G.min($.minItems);if(typeof $.maxItems==="number")G=G.max($.maxItems);u=G}else u=f.array(f.any());break}default:throw Error(`Unsupported type: ${_}`)}if($.description)u=u.describe($.description);if($.default!==void 0)u=u.default($.default);return u}function E$($,I){if(typeof $==="boolean")return $?f.any():f.never();let _=fH($,I),u=$.type||$.enum!==void 0||$.const!==void 0;if($.anyOf&&Array.isArray($.anyOf)){let G=$.anyOf.map((X)=>E$(X,I)),J=f.union(G);_=u?f.intersection(_,J):J}if($.oneOf&&Array.isArray($.oneOf)){let G=$.oneOf.map((X)=>E$(X,I)),J=f.xor(G);_=u?f.intersection(_,J):J}if($.allOf&&Array.isArray($.allOf))if($.allOf.length===0)_=u?_:f.any();else{let G=u?_:E$($.allOf[0],I),J=u?0:1;for(let X=J;X<$.allOf.length;X++)G=f.intersection(G,E$($.allOf[X],I));_=G}if($.nullable===!0&&I.version==="openapi-3.0")_=f.nullable(_);if($.readOnly===!0)_=f.readonly(_);let U={},g=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let G of g)if(G in $)U[G]=$[G];let z=["contentEncoding","contentMediaType","contentSchema"];for(let G of z)if(G in $)U[G]=$[G];for(let G of Object.keys($))if(!$j.has(G))U[G]=$[G];if(Object.keys(U).length>0)I.registry.add(_,U);return _}function xH($,I){if(typeof $==="boolean")return $?f.any():f.never();let _=Ij($,I?.defaultTarget),u=$.$defs||$.definitions||{},U={version:_,defs:u,refs:new Map,processing:new Set,rootSchema:$,registry:I?.registry??j$};return E$($,U)}var XX={};b4(XX,{string:()=>_j,number:()=>uj,date:()=>Gj,boolean:()=>gj,bigint:()=>zj});function _j($){return F8(s1,$)}function uj($){return y8(II,$)}function gj($){return d8(UI,$)}function zj($){return p8(_I,$)}function Gj($){return z3(Z0,$)}K$(Y0());w0();function Yj($,I,_){let u=e.join($,".serena","memories"),U=e.join(u,`result-${I}-${_}.md`);if(x.existsSync(U))return U;let g=e.join(u,`result-${I}.md`);if(x.existsSync(g))return g;return null}function E0($){try{return process.kill($,0),!0}catch(I){return!1}}function hH($){let I=[],_=/[^\s"']+|"([^"]*)"|'([^']*)'/g,u=_.exec($);while(u!==null){if(u[1]!==void 0)I.push(u[1]);else if(u[2]!==void 0)I.push(u[2]);else if(u[0])I.push(u[0]);u=_.exec($)}return I}var Oj=z$.object({default_cli:z$.string().optional(),agent_cli_mapping:z$.record(z$.string(),z$.string()).optional()}).passthrough().transform(($)=>({default_cli:$.default_cli,agent_cli_mapping:$.agent_cli_mapping??{}})),vj=z$.object({command:z$.string().optional(),subcommand:z$.string().optional(),prompt_flag:z$.string().optional().transform(($)=>{if($===void 0)return;let I=$.trim().toLowerCase();if(I===""||I==="none"||I==="null")return null;return $}),auto_approve_flag:z$.string().optional(),output_format_flag:z$.string().optional(),output_format:z$.string().optional(),model_flag:z$.string().optional(),default_model:z$.string().optional(),isolation_env:z$.string().optional(),isolation_flags:z$.string().optional()}).passthrough().transform(($)=>({...$,prompt_flag:$.prompt_flag??void 0})),Tj=z$.object({active_vendor:z$.string().optional(),vendors:z$.record(z$.string(),vj).optional()}).passthrough().transform(($)=>({active_vendor:$.active_vendor,vendors:$.vendors??{}}));function cH($){try{return r6($)}catch{return null}}function Mj($){let I=cH($),_=Oj.safeParse(I);if(!_.success)return{};return _.data}function Dj($){let I=cH($),_=Tj.safeParse(I);if(!_.success)return{vendors:{}};return{active_vendor:_.data.active_vendor,vendors:_.data.vendors}}function YX($,I){let _=e.resolve($),u=e.parse(_).root;while(_!==u){let U=e.join(_,I);if(x.existsSync(U))return U;_=e.dirname(_)}return null}function Lj($){let I=YX($,e.join(".agents","oma-config.yaml"));if(!I)return null;try{let _=x.readFileSync(I,"utf-8");return Mj(_)}catch{return null}}function Bj($){let I=YX($,e.join(".agents","skills","oma-orchestrator","config","cli-config.yaml"));if(!I)return null;try{let _=x.readFileSync(I,"utf-8");return Dj(_)}catch{return null}}function OX($,I){let _=process.cwd(),u=Lj(_),U=Bj(_),g=$.replace(/-agent$/i,""),z=u?.agent_cli_mapping?.[$]||u?.agent_cli_mapping?.[g],G=I||z||u?.default_cli||U?.active_vendor||"gemini";if(!I&&!z&&!u?.default_cli&&!U?.active_vendor)console.error(l.default.yellow(`[oma] No vendor configured for agent "${$}". Falling back to "gemini".
|
|
312
|
-
Set default_cli in .agents/oma-config.yaml or use --vendor flag.`));return{vendor:G.toLowerCase(),config:U}}function
|
|
311
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let z of $.seen.entries()){let G=z[1];if(I===z[0]){g(z);continue}if($.external){let X=$.external.registry.get(z[0])?.id;if(I!==z[0]&&X){g(z);continue}}if($.metadataRegistry.get(z[0])?.id){g(z);continue}if(G.cycle){g(z);continue}if(G.count>1){if($.reused==="ref"){g(z);continue}}}}function R6($,I){let _=$.seen.get(I);if(!_)throw Error("Unprocessed schema. This is a bug in Zod.");let u=(z)=>{let G=$.seen.get(z);if(G.ref===null)return;let J=G.def??G.schema,X={...J},N=G.ref;if(G.ref=null,N){u(N);let Q=$.seen.get(N),Y=Q.schema;if(Y.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))J.allOf=J.allOf??[],J.allOf.push(Y);else Object.assign(J,Y);if(Object.assign(J,X),z._zod.parent===N)for(let H in J){if(H==="$ref"||H==="allOf")continue;if(!(H in X))delete J[H]}if(Y.$ref&&Q.def)for(let H in J){if(H==="$ref"||H==="allOf")continue;if(H in Q.def&&JSON.stringify(J[H])===JSON.stringify(Q.def[H]))delete J[H]}}let q=z._zod.parent;if(q&&q!==N){u(q);let Q=$.seen.get(q);if(Q?.schema.$ref){if(J.$ref=Q.schema.$ref,Q.def)for(let Y in J){if(Y==="$ref"||Y==="allOf")continue;if(Y in Q.def&&JSON.stringify(J[Y])===JSON.stringify(Q.def[Y]))delete J[Y]}}}$.override({zodSchema:z,jsonSchema:J,path:G.path??[]})};for(let z of[...$.seen.entries()].reverse())u(z[0]);let U={};if($.target==="draft-2020-12")U.$schema="https://json-schema.org/draft/2020-12/schema";else if($.target==="draft-07")U.$schema="http://json-schema.org/draft-07/schema#";else if($.target==="draft-04")U.$schema="http://json-schema.org/draft-04/schema#";else if($.target==="openapi-3.0");if($.external?.uri){let z=$.external.registry.get(I)?.id;if(!z)throw Error("Schema is missing an `id` property");U.$id=$.external.uri(z)}Object.assign(U,_.def??_.schema);let g=$.external?.defs??{};for(let z of $.seen.entries()){let G=z[1];if(G.def&&G.defId)g[G.defId]=G.def}if($.external);else if(Object.keys(g).length>0)if($.target==="draft-2020-12")U.$defs=g;else U.definitions=g;try{let z=JSON.parse(JSON.stringify(U));return Object.defineProperty(z,"~standard",{value:{...I["~standard"],jsonSchema:{input:s1(I,"input",$.processors),output:s1(I,"output",$.processors)}},enumerable:!1,writable:!1}),z}catch(z){throw Error("Error converting schema to JSON.")}}function h$($,I){let _=I??{seen:new Set};if(_.seen.has($))return!1;_.seen.add($);let u=$._zod.def;if(u.type==="transform")return!0;if(u.type==="array")return h$(u.element,_);if(u.type==="set")return h$(u.valueType,_);if(u.type==="lazy")return h$(u.getter(),_);if(u.type==="promise"||u.type==="optional"||u.type==="nonoptional"||u.type==="nullable"||u.type==="readonly"||u.type==="default"||u.type==="prefault")return h$(u.innerType,_);if(u.type==="intersection")return h$(u.left,_)||h$(u.right,_);if(u.type==="record"||u.type==="map")return h$(u.keyType,_)||h$(u.valueType,_);if(u.type==="pipe")return h$(u.in,_)||h$(u.out,_);if(u.type==="object"){for(let U in u.shape)if(h$(u.shape[U],_))return!0;return!1}if(u.type==="union"){for(let U of u.options)if(h$(U,_))return!0;return!1}if(u.type==="tuple"){for(let U of u.items)if(h$(U,_))return!0;if(u.rest&&h$(u.rest,_))return!0;return!1}return!1}var R3=($,I={})=>(_)=>{let u=K6({..._,processors:I});return g$($,u),W6(u,$),R6(u,$)},s1=($,I,_={})=>(u)=>{let{libraryOptions:U,target:g}=u??{},z=K6({...U??{},target:g,io:I,processors:_});return g$($,z),W6(z,$),R6(z,$)};var IS={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},V3=($,I,_,u)=>{let U=_;U.type="string";let{minimum:g,maximum:z,format:G,patterns:J,contentEncoding:X}=$._zod.bag;if(typeof g==="number")U.minLength=g;if(typeof z==="number")U.maxLength=z;if(G){if(U.format=IS[G]??G,U.format==="")delete U.format;if(G==="time")delete U.format}if(X)U.contentEncoding=X;if(J&&J.size>0){let N=[...J];if(N.length===1)U.pattern=N[0].source;else if(N.length>1)U.allOf=[...N.map((q)=>({...I.target==="draft-07"||I.target==="draft-04"||I.target==="openapi-3.0"?{type:"string"}:{},pattern:q.source}))]}},Z3=($,I,_,u)=>{let U=_,{minimum:g,maximum:z,format:G,multipleOf:J,exclusiveMaximum:X,exclusiveMinimum:N}=$._zod.bag;if(typeof G==="string"&&G.includes("int"))U.type="integer";else U.type="number";if(typeof N==="number")if(I.target==="draft-04"||I.target==="openapi-3.0")U.minimum=N,U.exclusiveMinimum=!0;else U.exclusiveMinimum=N;if(typeof g==="number"){if(U.minimum=g,typeof N==="number"&&I.target!=="draft-04")if(N>=g)delete U.minimum;else delete U.exclusiveMinimum}if(typeof X==="number")if(I.target==="draft-04"||I.target==="openapi-3.0")U.maximum=X,U.exclusiveMaximum=!0;else U.exclusiveMaximum=X;if(typeof z==="number"){if(U.maximum=z,typeof X==="number"&&I.target!=="draft-04")if(X<=z)delete U.maximum;else delete U.exclusiveMaximum}if(typeof J==="number")U.multipleOf=J},A3=($,I,_,u)=>{_.type="boolean"},b3=($,I,_,u)=>{if(I.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},P3=($,I,_,u)=>{if(I.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},j3=($,I,_,u)=>{if(I.target==="openapi-3.0")_.type="string",_.nullable=!0,_.enum=[null];else _.type="null"},S3=($,I,_,u)=>{if(I.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},F3=($,I,_,u)=>{if(I.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},w3=($,I,_,u)=>{_.not={}},E3=($,I,_,u)=>{},C3=($,I,_,u)=>{},f3=($,I,_,u)=>{if(I.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},x3=($,I,_,u)=>{let U=$._zod.def,g=G0(U.entries);if(g.every((z)=>typeof z==="number"))_.type="number";if(g.every((z)=>typeof z==="string"))_.type="string";_.enum=g},k3=($,I,_,u)=>{let U=$._zod.def,g=[];for(let z of U.values)if(z===void 0){if(I.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof z==="bigint")if(I.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else g.push(Number(z));else g.push(z);if(g.length===0);else if(g.length===1){let z=g[0];if(_.type=z===null?"null":typeof z,I.target==="draft-04"||I.target==="openapi-3.0")_.enum=[z];else _.const=z}else{if(g.every((z)=>typeof z==="number"))_.type="number";if(g.every((z)=>typeof z==="string"))_.type="string";if(g.every((z)=>typeof z==="boolean"))_.type="boolean";if(g.every((z)=>z===null))_.type="null";_.enum=g}},y3=($,I,_,u)=>{if(I.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},i3=($,I,_,u)=>{let U=_,g=$._zod.pattern;if(!g)throw Error("Pattern not found in template literal");U.type="string",U.pattern=g.source},l3=($,I,_,u)=>{let U=_,g={type:"string",format:"binary",contentEncoding:"binary"},{minimum:z,maximum:G,mime:J}=$._zod.bag;if(z!==void 0)g.minLength=z;if(G!==void 0)g.maxLength=G;if(J)if(J.length===1)g.contentMediaType=J[0],Object.assign(U,g);else Object.assign(U,g),U.anyOf=J.map((X)=>({contentMediaType:X}));else Object.assign(U,g)},m3=($,I,_,u)=>{_.type="boolean"},n3=($,I,_,u)=>{if(I.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},r3=($,I,_,u)=>{if(I.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},h3=($,I,_,u)=>{if(I.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},c3=($,I,_,u)=>{if(I.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},d3=($,I,_,u)=>{if(I.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},o3=($,I,_,u)=>{let U=_,g=$._zod.def,{minimum:z,maximum:G}=$._zod.bag;if(typeof z==="number")U.minItems=z;if(typeof G==="number")U.maxItems=G;U.type="array",U.items=g$(g.element,I,{...u,path:[...u.path,"items"]})},p3=($,I,_,u)=>{let U=_,g=$._zod.def;U.type="object",U.properties={};let z=g.shape;for(let X in z)U.properties[X]=g$(z[X],I,{...u,path:[...u.path,"properties",X]});let G=new Set(Object.keys(z)),J=new Set([...G].filter((X)=>{let N=g.shape[X]._zod;if(I.io==="input")return N.optin===void 0;else return N.optout===void 0}));if(J.size>0)U.required=Array.from(J);if(g.catchall?._zod.def.type==="never")U.additionalProperties=!1;else if(!g.catchall){if(I.io==="output")U.additionalProperties=!1}else if(g.catchall)U.additionalProperties=g$(g.catchall,I,{...u,path:[...u.path,"additionalProperties"]})},Ju=($,I,_,u)=>{let U=$._zod.def,g=U.inclusive===!1,z=U.options.map((G,J)=>g$(G,I,{...u,path:[...u.path,g?"oneOf":"anyOf",J]}));if(g)_.oneOf=z;else _.anyOf=z},t3=($,I,_,u)=>{let U=$._zod.def,g=g$(U.left,I,{...u,path:[...u.path,"allOf",0]}),z=g$(U.right,I,{...u,path:[...u.path,"allOf",1]}),G=(X)=>("allOf"in X)&&Object.keys(X).length===1,J=[...G(g)?g.allOf:[g],...G(z)?z.allOf:[z]];_.allOf=J},a3=($,I,_,u)=>{let U=_,g=$._zod.def;U.type="array";let z=I.target==="draft-2020-12"?"prefixItems":"items",G=I.target==="draft-2020-12"?"items":I.target==="openapi-3.0"?"items":"additionalItems",J=g.items.map((Q,Y)=>g$(Q,I,{...u,path:[...u.path,z,Y]})),X=g.rest?g$(g.rest,I,{...u,path:[...u.path,G,...I.target==="openapi-3.0"?[g.items.length]:[]]}):null;if(I.target==="draft-2020-12"){if(U.prefixItems=J,X)U.items=X}else if(I.target==="openapi-3.0"){if(U.items={anyOf:J},X)U.items.anyOf.push(X);if(U.minItems=J.length,!X)U.maxItems=J.length}else if(U.items=J,X)U.additionalItems=X;let{minimum:N,maximum:q}=$._zod.bag;if(typeof N==="number")U.minItems=N;if(typeof q==="number")U.maxItems=q},e3=($,I,_,u)=>{let U=_,g=$._zod.def;U.type="object";let z=g.keyType,J=z._zod.bag?.patterns;if(g.mode==="loose"&&J&&J.size>0){let N=g$(g.valueType,I,{...u,path:[...u.path,"patternProperties","*"]});U.patternProperties={};for(let q of J)U.patternProperties[q.source]=N}else{if(I.target==="draft-07"||I.target==="draft-2020-12")U.propertyNames=g$(g.keyType,I,{...u,path:[...u.path,"propertyNames"]});U.additionalProperties=g$(g.valueType,I,{...u,path:[...u.path,"additionalProperties"]})}let X=z._zod.values;if(X){let N=[...X].filter((q)=>typeof q==="string"||typeof q==="number");if(N.length>0)U.required=N}},s3=($,I,_,u)=>{let U=$._zod.def,g=g$(U.innerType,I,u),z=I.seen.get($);if(I.target==="openapi-3.0")z.ref=U.innerType,_.nullable=!0;else _.anyOf=[g,{type:"null"}]},$9=($,I,_,u)=>{let U=$._zod.def;g$(U.innerType,I,u);let g=I.seen.get($);g.ref=U.innerType},I9=($,I,_,u)=>{let U=$._zod.def;g$(U.innerType,I,u);let g=I.seen.get($);g.ref=U.innerType,_.default=JSON.parse(JSON.stringify(U.defaultValue))},U9=($,I,_,u)=>{let U=$._zod.def;g$(U.innerType,I,u);let g=I.seen.get($);if(g.ref=U.innerType,I.io==="input")_._prefault=JSON.parse(JSON.stringify(U.defaultValue))},_9=($,I,_,u)=>{let U=$._zod.def;g$(U.innerType,I,u);let g=I.seen.get($);g.ref=U.innerType;let z;try{z=U.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}_.default=z},u9=($,I,_,u)=>{let U=$._zod.def,g=I.io==="input"?U.in._zod.def.type==="transform"?U.out:U.in:U.out;g$(g,I,u);let z=I.seen.get($);z.ref=g},g9=($,I,_,u)=>{let U=$._zod.def;g$(U.innerType,I,u);let g=I.seen.get($);g.ref=U.innerType,_.readOnly=!0},z9=($,I,_,u)=>{let U=$._zod.def;g$(U.innerType,I,u);let g=I.seen.get($);g.ref=U.innerType},Xu=($,I,_,u)=>{let U=$._zod.def;g$(U.innerType,I,u);let g=I.seen.get($);g.ref=U.innerType},G9=($,I,_,u)=>{let U=$._zod.innerType;g$(U,I,u);let g=I.seen.get($);g.ref=U},Gu={string:V3,number:Z3,boolean:A3,bigint:b3,symbol:P3,null:j3,undefined:S3,void:F3,never:w3,any:E3,unknown:C3,date:f3,enum:x3,literal:k3,nan:y3,template_literal:i3,file:l3,success:m3,custom:n3,function:r3,transform:h3,map:c3,set:d3,array:o3,object:p3,union:Ju,intersection:t3,tuple:a3,record:e3,nullable:s3,nonoptional:$9,default:I9,prefault:U9,catch:_9,pipe:u9,readonly:g9,promise:z9,optional:Xu,lazy:G9};function qu($,I){if("_idmap"in $){let u=$,U=K6({...I,processors:Gu}),g={};for(let J of u._idmap.entries()){let[X,N]=J;g$(N,U)}let z={},G={registry:u,uri:I?.uri,defs:g};U.external=G;for(let J of u._idmap.entries()){let[X,N]=J;W6(U,N),z[X]=R6(U,N)}if(Object.keys(g).length>0){let J=U.target==="draft-2020-12"?"$defs":"definitions";z.__shared={[J]:g}}return{schemas:z}}let _=K6({...I,processors:Gu});return g$($,_),W6(_,$),R6(_,$)}class J9{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter($){this.ctx.counter=$}get seen(){return this.ctx.seen}constructor($){let I=$?.target??"draft-2020-12";if(I==="draft-4")I="draft-04";if(I==="draft-7")I="draft-07";this.ctx=K6({processors:Gu,target:I,...$?.metadata&&{metadata:$.metadata},...$?.unrepresentable&&{unrepresentable:$.unrepresentable},...$?.override&&{override:$.override},...$?.io&&{io:$.io}})}process($,I={path:[],schemaPath:[]}){return g$($,this.ctx,I)}emit($,I){if(I){if(I.cycles)this.ctx.cycles=I.cycles;if(I.reused)this.ctx.reused=I.reused;if(I.external)this.ctx.external=I.external}W6(this.ctx,$);let _=R6(this.ctx,$),{"~standard":u,...U}=_;return U}}var A7={};var b0={};b4(b0,{xor:()=>DH,xid:()=>m7,void:()=>HH,uuidv7:()=>E7,uuidv6:()=>w7,uuidv4:()=>F7,uuid:()=>S7,url:()=>C7,unknown:()=>I1,union:()=>xu,undefined:()=>NH,ulid:()=>l7,uint64:()=>XH,uint32:()=>zH,tuple:()=>m9,transform:()=>yu,templateLiteral:()=>FH,symbol:()=>qH,superRefine:()=>OX,success:()=>PH,stringbool:()=>iH,stringFormat:()=>s7,string:()=>vu,strictObject:()=>TH,set:()=>RH,refine:()=>YX,record:()=>n9,readonly:()=>JX,promise:()=>wH,preprocess:()=>mH,prefault:()=>IX,pipe:()=>F0,partialRecord:()=>BH,optional:()=>j0,object:()=>vH,number:()=>Z9,nullish:()=>bH,nullable:()=>S0,null:()=>S9,nonoptional:()=>UX,never:()=>fu,nativeEnum:()=>VH,nanoid:()=>k7,nan:()=>jH,meta:()=>kH,map:()=>WH,mac:()=>h7,looseRecord:()=>KH,looseObject:()=>MH,literal:()=>ZH,lazy:()=>NX,ksuid:()=>n7,keyof:()=>OH,jwt:()=>e7,json:()=>lH,ipv6:()=>c7,ipv4:()=>r7,intersection:()=>i9,int64:()=>JH,int32:()=>gH,int:()=>Tu,instanceof:()=>yH,httpUrl:()=>f7,hostname:()=>$H,hex:()=>IH,hash:()=>UH,guid:()=>j7,function:()=>EH,float64:()=>uH,float32:()=>_H,file:()=>AH,exactOptional:()=>t9,enum:()=>ku,emoji:()=>x7,email:()=>P7,e164:()=>a7,discriminatedUnion:()=>LH,describe:()=>xH,date:()=>YH,custom:()=>fH,cuid2:()=>i7,cuid:()=>y7,codec:()=>SH,cidrv6:()=>o7,cidrv4:()=>d7,check:()=>CH,catch:()=>gX,boolean:()=>A9,bigint:()=>GH,base64url:()=>t7,base64:()=>p7,array:()=>C0,any:()=>QH,_function:()=>EH,_default:()=>s9,_ZodString:()=>Mu,ZodXor:()=>x9,ZodXID:()=>Vu,ZodVoid:()=>C9,ZodUnknown:()=>w9,ZodUnion:()=>x0,ZodUndefined:()=>P9,ZodUUID:()=>C4,ZodURL:()=>w0,ZodULID:()=>Ru,ZodType:()=>c,ZodTuple:()=>l9,ZodTransform:()=>o9,ZodTemplateLiteral:()=>XX,ZodSymbol:()=>b9,ZodSuccess:()=>_X,ZodStringFormat:()=>N$,ZodString:()=>UI,ZodSet:()=>h9,ZodRecord:()=>k0,ZodReadonly:()=>GX,ZodPromise:()=>QX,ZodPrefault:()=>$X,ZodPipe:()=>mu,ZodOptional:()=>iu,ZodObject:()=>f0,ZodNumberFormat:()=>U1,ZodNumber:()=>uI,ZodNullable:()=>a9,ZodNull:()=>j9,ZodNonOptional:()=>lu,ZodNever:()=>E9,ZodNanoID:()=>Bu,ZodNaN:()=>zX,ZodMap:()=>r9,ZodMAC:()=>V9,ZodLiteral:()=>c9,ZodLazy:()=>qX,ZodKSUID:()=>Zu,ZodJWT:()=>Eu,ZodIntersection:()=>y9,ZodIPv6:()=>bu,ZodIPv4:()=>Au,ZodGUID:()=>P0,ZodFunction:()=>HX,ZodFile:()=>d9,ZodExactOptional:()=>p9,ZodEnum:()=>II,ZodEmoji:()=>Lu,ZodEmail:()=>Du,ZodE164:()=>wu,ZodDiscriminatedUnion:()=>k9,ZodDefault:()=>e9,ZodDate:()=>E0,ZodCustomStringFormat:()=>_I,ZodCustom:()=>y0,ZodCodec:()=>nu,ZodCatch:()=>uX,ZodCUID2:()=>Wu,ZodCUID:()=>Ku,ZodCIDRv6:()=>ju,ZodCIDRv4:()=>Pu,ZodBoolean:()=>gI,ZodBigIntFormat:()=>Cu,ZodBigInt:()=>zI,ZodBase64URL:()=>Fu,ZodBase64:()=>Su,ZodArray:()=>f9,ZodAny:()=>F9});var Nu={};b4(Nu,{uppercase:()=>m1,trim:()=>o1,toUpperCase:()=>t1,toLowerCase:()=>p1,startsWith:()=>r1,slugify:()=>a1,size:()=>e6,regex:()=>i1,property:()=>zu,positive:()=>Uu,overwrite:()=>D4,normalize:()=>d1,nonpositive:()=>uu,nonnegative:()=>gu,negative:()=>_u,multipleOf:()=>L6,minSize:()=>E4,minLength:()=>d4,mime:()=>c1,maxSize:()=>B6,maxLength:()=>s6,lte:()=>I4,lt:()=>F4,lowercase:()=>l1,length:()=>$1,includes:()=>n1,gte:()=>r$,gt:()=>w4,endsWith:()=>h1});var $I={};b4($I,{time:()=>N9,duration:()=>Q9,datetime:()=>X9,date:()=>q9,ZodISOTime:()=>Yu,ZodISODuration:()=>Ou,ZodISODateTime:()=>Qu,ZodISODate:()=>Hu});var Qu=L("ZodISODateTime",($,I)=>{cG.init($,I),N$.init($,I)});function X9($){return n8(Qu,$)}var Hu=L("ZodISODate",($,I)=>{dG.init($,I),N$.init($,I)});function q9($){return r8(Hu,$)}var Yu=L("ZodISOTime",($,I)=>{oG.init($,I),N$.init($,I)});function N9($){return h8(Yu,$)}var Ou=L("ZodISODuration",($,I)=>{pG.init($,I),N$.init($,I)});function Q9($){return c8(Ou,$)}var b7=($,I)=>{Q0.init($,I),$.name="ZodError",Object.defineProperties($,{format:{value:(_)=>Y0($,_)},flatten:{value:(_)=>H0($,_)},addIssue:{value:(_)=>{$.issues.push(_),$.message=JSON.stringify($.issues,S1,2)}},addIssues:{value:(_)=>{$.issues.push(..._),$.message=JSON.stringify($.issues,S1,2)}},isEmpty:{get(){return $.issues.length===0}}})},_S=L("ZodError",b7),s$=L("ZodError",b7,{Parent:Error});var H9=E1(s$),Y9=C1(s$),O9=f1(s$),v9=x1(s$),T9=Y_(s$),M9=O_(s$),D9=v_(s$),L9=T_(s$),B9=M_(s$),K9=D_(s$),W9=L_(s$),R9=B_(s$);var c=L("ZodType",($,I)=>{return r.init($,I),Object.assign($["~standard"],{jsonSchema:{input:s1($,"input"),output:s1($,"output")}}),$.toJSONSchema=R3($,{}),$.def=I,$.type=I.type,Object.defineProperty($,"_def",{value:I}),$.check=(..._)=>{return $.clone(j.mergeDefs(I,{checks:[...I.checks??[],..._.map((u)=>typeof u==="function"?{_zod:{check:u,def:{check:"custom"},onattach:[]}}:u)]}),{parent:!0})},$.with=$.check,$.clone=(_,u)=>n$($,_,u),$.brand=()=>$,$.register=(_,u)=>{return _.add($,u),$},$.parse=(_,u)=>H9($,_,u,{callee:$.parse}),$.safeParse=(_,u)=>O9($,_,u),$.parseAsync=async(_,u)=>Y9($,_,u,{callee:$.parseAsync}),$.safeParseAsync=async(_,u)=>v9($,_,u),$.spa=$.safeParseAsync,$.encode=(_,u)=>T9($,_,u),$.decode=(_,u)=>M9($,_,u),$.encodeAsync=async(_,u)=>D9($,_,u),$.decodeAsync=async(_,u)=>L9($,_,u),$.safeEncode=(_,u)=>B9($,_,u),$.safeDecode=(_,u)=>K9($,_,u),$.safeEncodeAsync=async(_,u)=>W9($,_,u),$.safeDecodeAsync=async(_,u)=>R9($,_,u),$.refine=(_,u)=>$.check(YX(_,u)),$.superRefine=(_)=>$.check(OX(_)),$.overwrite=(_)=>$.check(D4(_)),$.optional=()=>j0($),$.exactOptional=()=>t9($),$.nullable=()=>S0($),$.nullish=()=>j0(S0($)),$.nonoptional=(_)=>UX($,_),$.array=()=>C0($),$.or=(_)=>xu([$,_]),$.and=(_)=>i9($,_),$.transform=(_)=>F0($,yu(_)),$.default=(_)=>s9($,_),$.prefault=(_)=>IX($,_),$.catch=(_)=>gX($,_),$.pipe=(_)=>F0($,_),$.readonly=()=>JX($),$.describe=(_)=>{let u=$.clone();return S$.add(u,{description:_}),u},Object.defineProperty($,"description",{get(){return S$.get($)?.description},configurable:!0}),$.meta=(..._)=>{if(_.length===0)return S$.get($);let u=$.clone();return S$.add(u,_[0]),u},$.isOptional=()=>$.safeParse(void 0).success,$.isNullable=()=>$.safeParse(null).success,$.apply=(_)=>_($),$}),Mu=L("_ZodString",($,I)=>{a6.init($,I),c.init($,I),$._zod.processJSONSchema=(u,U,g)=>V3($,u,U,g);let _=$._zod.bag;$.format=_.format??null,$.minLength=_.minimum??null,$.maxLength=_.maximum??null,$.regex=(...u)=>$.check(i1(...u)),$.includes=(...u)=>$.check(n1(...u)),$.startsWith=(...u)=>$.check(r1(...u)),$.endsWith=(...u)=>$.check(h1(...u)),$.min=(...u)=>$.check(d4(...u)),$.max=(...u)=>$.check(s6(...u)),$.length=(...u)=>$.check($1(...u)),$.nonempty=(...u)=>$.check(d4(1,...u)),$.lowercase=(u)=>$.check(l1(u)),$.uppercase=(u)=>$.check(m1(u)),$.trim=()=>$.check(o1()),$.normalize=(...u)=>$.check(d1(...u)),$.toLowerCase=()=>$.check(p1()),$.toUpperCase=()=>$.check(t1()),$.slugify=()=>$.check(a1())}),UI=L("ZodString",($,I)=>{a6.init($,I),Mu.init($,I),$.email=(_)=>$.check(f_(Du,_)),$.url=(_)=>$.check(A0(w0,_)),$.jwt=(_)=>$.check(Iu(Eu,_)),$.emoji=(_)=>$.check(l_(Lu,_)),$.guid=(_)=>$.check(Z0(P0,_)),$.uuid=(_)=>$.check(x_(C4,_)),$.uuidv4=(_)=>$.check(k_(C4,_)),$.uuidv6=(_)=>$.check(y_(C4,_)),$.uuidv7=(_)=>$.check(i_(C4,_)),$.nanoid=(_)=>$.check(m_(Bu,_)),$.guid=(_)=>$.check(Z0(P0,_)),$.cuid=(_)=>$.check(n_(Ku,_)),$.cuid2=(_)=>$.check(r_(Wu,_)),$.ulid=(_)=>$.check(h_(Ru,_)),$.base64=(_)=>$.check(e_(Su,_)),$.base64url=(_)=>$.check(s_(Fu,_)),$.xid=(_)=>$.check(c_(Vu,_)),$.ksuid=(_)=>$.check(d_(Zu,_)),$.ipv4=(_)=>$.check(o_(Au,_)),$.ipv6=(_)=>$.check(p_(bu,_)),$.cidrv4=(_)=>$.check(t_(Pu,_)),$.cidrv6=(_)=>$.check(a_(ju,_)),$.e164=(_)=>$.check($u(wu,_)),$.datetime=(_)=>$.check(X9(_)),$.date=(_)=>$.check(q9(_)),$.time=(_)=>$.check(N9(_)),$.duration=(_)=>$.check(Q9(_))});function vu($){return y8(UI,$)}var N$=L("ZodStringFormat",($,I)=>{q$.init($,I),Mu.init($,I)}),Du=L("ZodEmail",($,I)=>{xG.init($,I),N$.init($,I)});function P7($){return f_(Du,$)}var P0=L("ZodGUID",($,I)=>{CG.init($,I),N$.init($,I)});function j7($){return Z0(P0,$)}var C4=L("ZodUUID",($,I)=>{fG.init($,I),N$.init($,I)});function S7($){return x_(C4,$)}function F7($){return k_(C4,$)}function w7($){return y_(C4,$)}function E7($){return i_(C4,$)}var w0=L("ZodURL",($,I)=>{kG.init($,I),N$.init($,I)});function C7($){return A0(w0,$)}function f7($){return A0(w0,{protocol:/^https?$/,hostname:N4.domain,...j.normalizeParams($)})}var Lu=L("ZodEmoji",($,I)=>{yG.init($,I),N$.init($,I)});function x7($){return l_(Lu,$)}var Bu=L("ZodNanoID",($,I)=>{iG.init($,I),N$.init($,I)});function k7($){return m_(Bu,$)}var Ku=L("ZodCUID",($,I)=>{lG.init($,I),N$.init($,I)});function y7($){return n_(Ku,$)}var Wu=L("ZodCUID2",($,I)=>{mG.init($,I),N$.init($,I)});function i7($){return r_(Wu,$)}var Ru=L("ZodULID",($,I)=>{nG.init($,I),N$.init($,I)});function l7($){return h_(Ru,$)}var Vu=L("ZodXID",($,I)=>{rG.init($,I),N$.init($,I)});function m7($){return c_(Vu,$)}var Zu=L("ZodKSUID",($,I)=>{hG.init($,I),N$.init($,I)});function n7($){return d_(Zu,$)}var Au=L("ZodIPv4",($,I)=>{tG.init($,I),N$.init($,I)});function r7($){return o_(Au,$)}var V9=L("ZodMAC",($,I)=>{eG.init($,I),N$.init($,I)});function h7($){return l8(V9,$)}var bu=L("ZodIPv6",($,I)=>{aG.init($,I),N$.init($,I)});function c7($){return p_(bu,$)}var Pu=L("ZodCIDRv4",($,I)=>{sG.init($,I),N$.init($,I)});function d7($){return t_(Pu,$)}var ju=L("ZodCIDRv6",($,I)=>{$J.init($,I),N$.init($,I)});function o7($){return a_(ju,$)}var Su=L("ZodBase64",($,I)=>{UJ.init($,I),N$.init($,I)});function p7($){return e_(Su,$)}var Fu=L("ZodBase64URL",($,I)=>{_J.init($,I),N$.init($,I)});function t7($){return s_(Fu,$)}var wu=L("ZodE164",($,I)=>{uJ.init($,I),N$.init($,I)});function a7($){return $u(wu,$)}var Eu=L("ZodJWT",($,I)=>{gJ.init($,I),N$.init($,I)});function e7($){return Iu(Eu,$)}var _I=L("ZodCustomStringFormat",($,I)=>{zJ.init($,I),N$.init($,I)});function s7($,I,_={}){return e1(_I,$,I,_)}function $H($){return e1(_I,"hostname",N4.hostname,$)}function IH($){return e1(_I,"hex",N4.hex,$)}function UH($,I){let _=I?.enc??"hex",u=`${$}_${_}`,U=N4[u];if(!U)throw Error(`Unrecognized hash format: ${u}`);return e1(_I,u,U,I)}var uI=L("ZodNumber",($,I)=>{S_.init($,I),c.init($,I),$._zod.processJSONSchema=(u,U,g)=>Z3($,u,U,g),$.gt=(u,U)=>$.check(w4(u,U)),$.gte=(u,U)=>$.check(r$(u,U)),$.min=(u,U)=>$.check(r$(u,U)),$.lt=(u,U)=>$.check(F4(u,U)),$.lte=(u,U)=>$.check(I4(u,U)),$.max=(u,U)=>$.check(I4(u,U)),$.int=(u)=>$.check(Tu(u)),$.safe=(u)=>$.check(Tu(u)),$.positive=(u)=>$.check(w4(0,u)),$.nonnegative=(u)=>$.check(r$(0,u)),$.negative=(u)=>$.check(F4(0,u)),$.nonpositive=(u)=>$.check(I4(0,u)),$.multipleOf=(u,U)=>$.check(L6(u,U)),$.step=(u,U)=>$.check(L6(u,U)),$.finite=()=>$;let _=$._zod.bag;$.minValue=Math.max(_.minimum??Number.NEGATIVE_INFINITY,_.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,$.maxValue=Math.min(_.maximum??Number.POSITIVE_INFINITY,_.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,$.isInt=(_.format??"").includes("int")||Number.isSafeInteger(_.multipleOf??0.5),$.isFinite=!0,$.format=_.format??null});function Z9($){return d8(uI,$)}var U1=L("ZodNumberFormat",($,I)=>{GJ.init($,I),uI.init($,I)});function Tu($){return p8(U1,$)}function _H($){return t8(U1,$)}function uH($){return a8(U1,$)}function gH($){return e8(U1,$)}function zH($){return s8(U1,$)}var gI=L("ZodBoolean",($,I)=>{M0.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>A3($,_,u,U)});function A9($){return $3(gI,$)}var zI=L("ZodBigInt",($,I)=>{F_.init($,I),c.init($,I),$._zod.processJSONSchema=(u,U,g)=>b3($,u,U,g),$.gte=(u,U)=>$.check(r$(u,U)),$.min=(u,U)=>$.check(r$(u,U)),$.gt=(u,U)=>$.check(w4(u,U)),$.gte=(u,U)=>$.check(r$(u,U)),$.min=(u,U)=>$.check(r$(u,U)),$.lt=(u,U)=>$.check(F4(u,U)),$.lte=(u,U)=>$.check(I4(u,U)),$.max=(u,U)=>$.check(I4(u,U)),$.positive=(u)=>$.check(w4(BigInt(0),u)),$.negative=(u)=>$.check(F4(BigInt(0),u)),$.nonpositive=(u)=>$.check(I4(BigInt(0),u)),$.nonnegative=(u)=>$.check(r$(BigInt(0),u)),$.multipleOf=(u,U)=>$.check(L6(u,U));let _=$._zod.bag;$.minValue=_.minimum??null,$.maxValue=_.maximum??null,$.format=_.format??null});function GH($){return U3(zI,$)}var Cu=L("ZodBigIntFormat",($,I)=>{JJ.init($,I),zI.init($,I)});function JH($){return u3(Cu,$)}function XH($){return g3(Cu,$)}var b9=L("ZodSymbol",($,I)=>{XJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>P3($,_,u,U)});function qH($){return z3(b9,$)}var P9=L("ZodUndefined",($,I)=>{qJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>S3($,_,u,U)});function NH($){return G3(P9,$)}var j9=L("ZodNull",($,I)=>{NJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>j3($,_,u,U)});function S9($){return J3(j9,$)}var F9=L("ZodAny",($,I)=>{QJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>E3($,_,u,U)});function QH(){return X3(F9)}var w9=L("ZodUnknown",($,I)=>{HJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>C3($,_,u,U)});function I1(){return q3(w9)}var E9=L("ZodNever",($,I)=>{YJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>w3($,_,u,U)});function fu($){return N3(E9,$)}var C9=L("ZodVoid",($,I)=>{OJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>F3($,_,u,U)});function HH($){return Q3(C9,$)}var E0=L("ZodDate",($,I)=>{vJ.init($,I),c.init($,I),$._zod.processJSONSchema=(u,U,g)=>f3($,u,U,g),$.min=(u,U)=>$.check(r$(u,U)),$.max=(u,U)=>$.check(I4(u,U));let _=$._zod.bag;$.minDate=_.minimum?new Date(_.minimum):null,$.maxDate=_.maximum?new Date(_.maximum):null});function YH($){return H3(E0,$)}var f9=L("ZodArray",($,I)=>{TJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>o3($,_,u,U),$.element=I.element,$.min=(_,u)=>$.check(d4(_,u)),$.nonempty=(_)=>$.check(d4(1,_)),$.max=(_,u)=>$.check(s6(_,u)),$.length=(_,u)=>$.check($1(_,u)),$.unwrap=()=>$.element});function C0($,I){return v3(f9,$,I)}function OH($){let I=$._zod.def.shape;return ku(Object.keys(I))}var f0=L("ZodObject",($,I)=>{MJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>p3($,_,u,U),j.defineLazy($,"shape",()=>{return I.shape}),$.keyof=()=>ku(Object.keys($._zod.def.shape)),$.catchall=(_)=>$.clone({...$._zod.def,catchall:_}),$.passthrough=()=>$.clone({...$._zod.def,catchall:I1()}),$.loose=()=>$.clone({...$._zod.def,catchall:I1()}),$.strict=()=>$.clone({...$._zod.def,catchall:fu()}),$.strip=()=>$.clone({...$._zod.def,catchall:void 0}),$.extend=(_)=>{return j.extend($,_)},$.safeExtend=(_)=>{return j.safeExtend($,_)},$.merge=(_)=>j.merge($,_),$.pick=(_)=>j.pick($,_),$.omit=(_)=>j.omit($,_),$.partial=(..._)=>j.partial(iu,$,_[0]),$.required=(..._)=>j.required(lu,$,_[0])});function vH($,I){let _={type:"object",shape:$??{},...j.normalizeParams(I)};return new f0(_)}function TH($,I){return new f0({type:"object",shape:$,catchall:fu(),...j.normalizeParams(I)})}function MH($,I){return new f0({type:"object",shape:$,catchall:I1(),...j.normalizeParams(I)})}var x0=L("ZodUnion",($,I)=>{D0.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>Ju($,_,u,U),$.options=I.options});function xu($,I){return new x0({type:"union",options:$,...j.normalizeParams(I)})}var x9=L("ZodXor",($,I)=>{x0.init($,I),DJ.init($,I),$._zod.processJSONSchema=(_,u,U)=>Ju($,_,u,U),$.options=I.options});function DH($,I){return new x9({type:"union",options:$,inclusive:!1,...j.normalizeParams(I)})}var k9=L("ZodDiscriminatedUnion",($,I)=>{x0.init($,I),LJ.init($,I)});function LH($,I,_){return new k9({type:"union",options:I,discriminator:$,...j.normalizeParams(_)})}var y9=L("ZodIntersection",($,I)=>{BJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>t3($,_,u,U)});function i9($,I){return new y9({type:"intersection",left:$,right:I})}var l9=L("ZodTuple",($,I)=>{w_.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>a3($,_,u,U),$.rest=(_)=>$.clone({...$._zod.def,rest:_})});function m9($,I,_){let u=I instanceof r,U=u?_:I;return new l9({type:"tuple",items:$,rest:u?I:null,...j.normalizeParams(U)})}var k0=L("ZodRecord",($,I)=>{KJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>e3($,_,u,U),$.keyType=I.keyType,$.valueType=I.valueType});function n9($,I,_){return new k0({type:"record",keyType:$,valueType:I,...j.normalizeParams(_)})}function BH($,I,_){let u=n$($);return u._zod.values=void 0,new k0({type:"record",keyType:u,valueType:I,...j.normalizeParams(_)})}function KH($,I,_){return new k0({type:"record",keyType:$,valueType:I,mode:"loose",...j.normalizeParams(_)})}var r9=L("ZodMap",($,I)=>{WJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>c3($,_,u,U),$.keyType=I.keyType,$.valueType=I.valueType,$.min=(..._)=>$.check(E4(..._)),$.nonempty=(_)=>$.check(E4(1,_)),$.max=(..._)=>$.check(B6(..._)),$.size=(..._)=>$.check(e6(..._))});function WH($,I,_){return new r9({type:"map",keyType:$,valueType:I,...j.normalizeParams(_)})}var h9=L("ZodSet",($,I)=>{RJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>d3($,_,u,U),$.min=(..._)=>$.check(E4(..._)),$.nonempty=(_)=>$.check(E4(1,_)),$.max=(..._)=>$.check(B6(..._)),$.size=(..._)=>$.check(e6(..._))});function RH($,I){return new h9({type:"set",valueType:$,...j.normalizeParams(I)})}var II=L("ZodEnum",($,I)=>{VJ.init($,I),c.init($,I),$._zod.processJSONSchema=(u,U,g)=>x3($,u,U,g),$.enum=I.entries,$.options=Object.values(I.entries);let _=new Set(Object.keys(I.entries));$.extract=(u,U)=>{let g={};for(let z of u)if(_.has(z))g[z]=I.entries[z];else throw Error(`Key ${z} not found in enum`);return new II({...I,checks:[],...j.normalizeParams(U),entries:g})},$.exclude=(u,U)=>{let g={...I.entries};for(let z of u)if(_.has(z))delete g[z];else throw Error(`Key ${z} not found in enum`);return new II({...I,checks:[],...j.normalizeParams(U),entries:g})}});function ku($,I){let _=Array.isArray($)?Object.fromEntries($.map((u)=>[u,u])):$;return new II({type:"enum",entries:_,...j.normalizeParams(I)})}function VH($,I){return new II({type:"enum",entries:$,...j.normalizeParams(I)})}var c9=L("ZodLiteral",($,I)=>{ZJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>k3($,_,u,U),$.values=new Set(I.values),Object.defineProperty($,"value",{get(){if(I.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return I.values[0]}})});function ZH($,I){return new c9({type:"literal",values:Array.isArray($)?$:[$],...j.normalizeParams(I)})}var d9=L("ZodFile",($,I)=>{AJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>l3($,_,u,U),$.min=(_,u)=>$.check(E4(_,u)),$.max=(_,u)=>$.check(B6(_,u)),$.mime=(_,u)=>$.check(c1(Array.isArray(_)?_:[_],u))});function AH($){return T3(d9,$)}var o9=L("ZodTransform",($,I)=>{bJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>h3($,_,u,U),$._zod.parse=(_,u)=>{if(u.direction==="backward")throw new o6($.constructor.name);_.addIssue=(g)=>{if(typeof g==="string")_.issues.push(j.issue(g,_.value,I));else{let z=g;if(z.fatal)z.continue=!1;z.code??(z.code="custom"),z.input??(z.input=_.value),z.inst??(z.inst=$),_.issues.push(j.issue(z))}};let U=I.transform(_.value,_);if(U instanceof Promise)return U.then((g)=>{return _.value=g,_});return _.value=U,_}});function yu($){return new o9({type:"transform",transform:$})}var iu=L("ZodOptional",($,I)=>{E_.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>Xu($,_,u,U),$.unwrap=()=>$._zod.def.innerType});function j0($){return new iu({type:"optional",innerType:$})}var p9=L("ZodExactOptional",($,I)=>{PJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>Xu($,_,u,U),$.unwrap=()=>$._zod.def.innerType});function t9($){return new p9({type:"optional",innerType:$})}var a9=L("ZodNullable",($,I)=>{jJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>s3($,_,u,U),$.unwrap=()=>$._zod.def.innerType});function S0($){return new a9({type:"nullable",innerType:$})}function bH($){return j0(S0($))}var e9=L("ZodDefault",($,I)=>{SJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>I9($,_,u,U),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});function s9($,I){return new e9({type:"default",innerType:$,get defaultValue(){return typeof I==="function"?I():j.shallowClone(I)}})}var $X=L("ZodPrefault",($,I)=>{FJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>U9($,_,u,U),$.unwrap=()=>$._zod.def.innerType});function IX($,I){return new $X({type:"prefault",innerType:$,get defaultValue(){return typeof I==="function"?I():j.shallowClone(I)}})}var lu=L("ZodNonOptional",($,I)=>{wJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>$9($,_,u,U),$.unwrap=()=>$._zod.def.innerType});function UX($,I){return new lu({type:"nonoptional",innerType:$,...j.normalizeParams(I)})}var _X=L("ZodSuccess",($,I)=>{EJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>m3($,_,u,U),$.unwrap=()=>$._zod.def.innerType});function PH($){return new _X({type:"success",innerType:$})}var uX=L("ZodCatch",($,I)=>{CJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>_9($,_,u,U),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});function gX($,I){return new uX({type:"catch",innerType:$,catchValue:typeof I==="function"?I:()=>I})}var zX=L("ZodNaN",($,I)=>{fJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>y3($,_,u,U)});function jH($){return O3(zX,$)}var mu=L("ZodPipe",($,I)=>{xJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>u9($,_,u,U),$.in=I.in,$.out=I.out});function F0($,I){return new mu({type:"pipe",in:$,out:I})}var nu=L("ZodCodec",($,I)=>{mu.init($,I),L0.init($,I)});function SH($,I,_){return new nu({type:"pipe",in:$,out:I,transform:_.decode,reverseTransform:_.encode})}var GX=L("ZodReadonly",($,I)=>{kJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>g9($,_,u,U),$.unwrap=()=>$._zod.def.innerType});function JX($){return new GX({type:"readonly",innerType:$})}var XX=L("ZodTemplateLiteral",($,I)=>{yJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>i3($,_,u,U)});function FH($,I){return new XX({type:"template_literal",parts:$,...j.normalizeParams(I)})}var qX=L("ZodLazy",($,I)=>{mJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>G9($,_,u,U),$.unwrap=()=>$._zod.def.getter()});function NX($){return new qX({type:"lazy",getter:$})}var QX=L("ZodPromise",($,I)=>{lJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>z9($,_,u,U),$.unwrap=()=>$._zod.def.innerType});function wH($){return new QX({type:"promise",innerType:$})}var HX=L("ZodFunction",($,I)=>{iJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>r3($,_,u,U)});function EH($){return new HX({type:"function",input:Array.isArray($?.input)?m9($?.input):$?.input??C0(I1()),output:$?.output??I1()})}var y0=L("ZodCustom",($,I)=>{nJ.init($,I),c.init($,I),$._zod.processJSONSchema=(_,u,U)=>n3($,_,u,U)});function CH($){let I=new H$({check:"custom"});return I._zod.check=$,I}function fH($,I){return M3(y0,$??(()=>!0),I)}function YX($,I={}){return D3(y0,$,I)}function OX($){return L3($)}var xH=B3,kH=K3;function yH($,I={}){let _=new y0({type:"custom",check:"custom",fn:(u)=>u instanceof $,abort:!0,...j.normalizeParams(I)});return _._zod.bag.Class=$,_._zod.check=(u)=>{if(!(u.value instanceof $))u.issues.push({code:"invalid_type",expected:$.name,input:u.value,inst:_,path:[..._._zod.def.path??[]]})},_}var iH=(...$)=>W3({Codec:nu,Boolean:gI,String:UI},...$);function lH($){let I=NX(()=>{return xu([vu($),Z9(),A9(),S9(),C0(I),n9(vu(),I)])});return I}function mH($,I){return F0(yu($),I)}var gS={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function zS($){K$({customError:$})}function GS(){return K$().customError}var vX;(function($){})(vX||(vX={}));var f={...b0,...Nu,iso:$I},JS=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function XS($,I){let _=$.$schema;if(_==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(_==="http://json-schema.org/draft-07/schema#")return"draft-7";if(_==="http://json-schema.org/draft-04/schema#")return"draft-4";return I??"draft-2020-12"}function qS($,I){if(!$.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let _=$.slice(1).split("/").filter(Boolean);if(_.length===0)return I.rootSchema;let u=I.version==="draft-2020-12"?"$defs":"definitions";if(_[0]===u){let U=_[1];if(!U||!I.defs[U])throw Error(`Reference not found: ${$}`);return I.defs[U]}throw Error(`Reference not found: ${$}`)}function nH($,I){if($.not!==void 0){if(typeof $.not==="object"&&Object.keys($.not).length===0)return f.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if($.unevaluatedItems!==void 0)throw Error("unevaluatedItems is not supported");if($.unevaluatedProperties!==void 0)throw Error("unevaluatedProperties is not supported");if($.if!==void 0||$.then!==void 0||$.else!==void 0)throw Error("Conditional schemas (if/then/else) are not supported");if($.dependentSchemas!==void 0||$.dependentRequired!==void 0)throw Error("dependentSchemas and dependentRequired are not supported");if($.$ref){let U=$.$ref;if(I.refs.has(U))return I.refs.get(U);if(I.processing.has(U))return f.lazy(()=>{if(!I.refs.has(U))throw Error(`Circular reference not resolved: ${U}`);return I.refs.get(U)});I.processing.add(U);let g=qS(U,I),z=E$(g,I);return I.refs.set(U,z),I.processing.delete(U),z}if($.enum!==void 0){let U=$.enum;if(I.version==="openapi-3.0"&&$.nullable===!0&&U.length===1&&U[0]===null)return f.null();if(U.length===0)return f.never();if(U.length===1)return f.literal(U[0]);if(U.every((z)=>typeof z==="string"))return f.enum(U);let g=U.map((z)=>f.literal(z));if(g.length<2)return g[0];return f.union([g[0],g[1],...g.slice(2)])}if($.const!==void 0)return f.literal($.const);let _=$.type;if(Array.isArray(_)){let U=_.map((g)=>{let z={...$,type:g};return nH(z,I)});if(U.length===0)return f.never();if(U.length===1)return U[0];return f.union(U)}if(!_)return f.any();let u;switch(_){case"string":{let U=f.string();if($.format){let g=$.format;if(g==="email")U=U.check(f.email());else if(g==="uri"||g==="uri-reference")U=U.check(f.url());else if(g==="uuid"||g==="guid")U=U.check(f.uuid());else if(g==="date-time")U=U.check(f.iso.datetime());else if(g==="date")U=U.check(f.iso.date());else if(g==="time")U=U.check(f.iso.time());else if(g==="duration")U=U.check(f.iso.duration());else if(g==="ipv4")U=U.check(f.ipv4());else if(g==="ipv6")U=U.check(f.ipv6());else if(g==="mac")U=U.check(f.mac());else if(g==="cidr")U=U.check(f.cidrv4());else if(g==="cidr-v6")U=U.check(f.cidrv6());else if(g==="base64")U=U.check(f.base64());else if(g==="base64url")U=U.check(f.base64url());else if(g==="e164")U=U.check(f.e164());else if(g==="jwt")U=U.check(f.jwt());else if(g==="emoji")U=U.check(f.emoji());else if(g==="nanoid")U=U.check(f.nanoid());else if(g==="cuid")U=U.check(f.cuid());else if(g==="cuid2")U=U.check(f.cuid2());else if(g==="ulid")U=U.check(f.ulid());else if(g==="xid")U=U.check(f.xid());else if(g==="ksuid")U=U.check(f.ksuid())}if(typeof $.minLength==="number")U=U.min($.minLength);if(typeof $.maxLength==="number")U=U.max($.maxLength);if($.pattern)U=U.regex(new RegExp($.pattern));u=U;break}case"number":case"integer":{let U=_==="integer"?f.number().int():f.number();if(typeof $.minimum==="number")U=U.min($.minimum);if(typeof $.maximum==="number")U=U.max($.maximum);if(typeof $.exclusiveMinimum==="number")U=U.gt($.exclusiveMinimum);else if($.exclusiveMinimum===!0&&typeof $.minimum==="number")U=U.gt($.minimum);if(typeof $.exclusiveMaximum==="number")U=U.lt($.exclusiveMaximum);else if($.exclusiveMaximum===!0&&typeof $.maximum==="number")U=U.lt($.maximum);if(typeof $.multipleOf==="number")U=U.multipleOf($.multipleOf);u=U;break}case"boolean":{u=f.boolean();break}case"null":{u=f.null();break}case"object":{let U={},g=$.properties||{},z=new Set($.required||[]);for(let[J,X]of Object.entries(g)){let N=E$(X,I);U[J]=z.has(J)?N:N.optional()}if($.propertyNames){let J=E$($.propertyNames,I),X=$.additionalProperties&&typeof $.additionalProperties==="object"?E$($.additionalProperties,I):f.any();if(Object.keys(U).length===0){u=f.record(J,X);break}let N=f.object(U).passthrough(),q=f.looseRecord(J,X);u=f.intersection(N,q);break}if($.patternProperties){let J=$.patternProperties,X=Object.keys(J),N=[];for(let Q of X){let Y=E$(J[Q],I),O=f.string().regex(new RegExp(Q));N.push(f.looseRecord(O,Y))}let q=[];if(Object.keys(U).length>0)q.push(f.object(U).passthrough());if(q.push(...N),q.length===0)u=f.object({}).passthrough();else if(q.length===1)u=q[0];else{let Q=f.intersection(q[0],q[1]);for(let Y=2;Y<q.length;Y++)Q=f.intersection(Q,q[Y]);u=Q}break}let G=f.object(U);if($.additionalProperties===!1)u=G.strict();else if(typeof $.additionalProperties==="object")u=G.catchall(E$($.additionalProperties,I));else u=G.passthrough();break}case"array":{let{prefixItems:U,items:g}=$;if(U&&Array.isArray(U)){let z=U.map((J)=>E$(J,I)),G=g&&typeof g==="object"&&!Array.isArray(g)?E$(g,I):void 0;if(G)u=f.tuple(z).rest(G);else u=f.tuple(z);if(typeof $.minItems==="number")u=u.check(f.minLength($.minItems));if(typeof $.maxItems==="number")u=u.check(f.maxLength($.maxItems))}else if(Array.isArray(g)){let z=g.map((J)=>E$(J,I)),G=$.additionalItems&&typeof $.additionalItems==="object"?E$($.additionalItems,I):void 0;if(G)u=f.tuple(z).rest(G);else u=f.tuple(z);if(typeof $.minItems==="number")u=u.check(f.minLength($.minItems));if(typeof $.maxItems==="number")u=u.check(f.maxLength($.maxItems))}else if(g!==void 0){let z=E$(g,I),G=f.array(z);if(typeof $.minItems==="number")G=G.min($.minItems);if(typeof $.maxItems==="number")G=G.max($.maxItems);u=G}else u=f.array(f.any());break}default:throw Error(`Unsupported type: ${_}`)}if($.description)u=u.describe($.description);if($.default!==void 0)u=u.default($.default);return u}function E$($,I){if(typeof $==="boolean")return $?f.any():f.never();let _=nH($,I),u=$.type||$.enum!==void 0||$.const!==void 0;if($.anyOf&&Array.isArray($.anyOf)){let G=$.anyOf.map((X)=>E$(X,I)),J=f.union(G);_=u?f.intersection(_,J):J}if($.oneOf&&Array.isArray($.oneOf)){let G=$.oneOf.map((X)=>E$(X,I)),J=f.xor(G);_=u?f.intersection(_,J):J}if($.allOf&&Array.isArray($.allOf))if($.allOf.length===0)_=u?_:f.any();else{let G=u?_:E$($.allOf[0],I),J=u?0:1;for(let X=J;X<$.allOf.length;X++)G=f.intersection(G,E$($.allOf[X],I));_=G}if($.nullable===!0&&I.version==="openapi-3.0")_=f.nullable(_);if($.readOnly===!0)_=f.readonly(_);let U={},g=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let G of g)if(G in $)U[G]=$[G];let z=["contentEncoding","contentMediaType","contentSchema"];for(let G of z)if(G in $)U[G]=$[G];for(let G of Object.keys($))if(!JS.has(G))U[G]=$[G];if(Object.keys(U).length>0)I.registry.add(_,U);return _}function rH($,I){if(typeof $==="boolean")return $?f.any():f.never();let _=XS($,I?.defaultTarget),u=$.$defs||$.definitions||{},U={version:_,defs:u,refs:new Map,processing:new Set,rootSchema:$,registry:I?.registry??S$};return E$($,U)}var TX={};b4(TX,{string:()=>NS,number:()=>QS,date:()=>OS,boolean:()=>HS,bigint:()=>YS});function NS($){return i8(UI,$)}function QS($){return o8(uI,$)}function HS($){return I3(gI,$)}function YS($){return _3(zI,$)}function OS($){return Y3(E0,$)}K$(B0());i0();function KS($,I,_){let u=e.join($,".serena","memories"),U=e.join(u,`result-${I}-${_}.md`);if(x.existsSync(U))return U;let g=e.join(u,`result-${I}.md`);if(x.existsSync(g))return g;return null}function l0($){try{return process.kill($,0),!0}catch(I){return!1}}function eH($){let I=[],_=/[^\s"']+|"([^"]*)"|'([^']*)'/g,u=_.exec($);while(u!==null){if(u[1]!==void 0)I.push(u[1]);else if(u[2]!==void 0)I.push(u[2]);else if(u[0])I.push(u[0]);u=_.exec($)}return I}var WS=G$.object({default_cli:G$.string().optional(),agent_cli_mapping:G$.record(G$.string(),G$.string()).optional()}).passthrough().transform(($)=>({default_cli:$.default_cli,agent_cli_mapping:$.agent_cli_mapping??{}})),RS=G$.object({command:G$.string().optional(),subcommand:G$.string().optional(),prompt_flag:G$.string().optional().transform(($)=>{if($===void 0)return;let I=$.trim().toLowerCase();if(I===""||I==="none"||I==="null")return null;return $}),auto_approve_flag:G$.string().optional(),output_format_flag:G$.string().optional(),output_format:G$.string().optional(),model_flag:G$.string().optional(),default_model:G$.string().optional(),isolation_env:G$.string().optional(),isolation_flags:G$.string().optional()}).passthrough().transform(($)=>({...$,prompt_flag:$.prompt_flag??void 0})),VS=G$.object({active_vendor:G$.string().optional(),vendors:G$.record(G$.string(),RS).optional()}).passthrough().transform(($)=>({active_vendor:$.active_vendor,vendors:$.vendors??{}}));function sH($){try{return d6($)}catch{return null}}function ZS($){let I=sH($),_=WS.safeParse(I);if(!_.success)return{};return _.data}function AS($){let I=sH($),_=VS.safeParse(I);if(!_.success)return{vendors:{}};return{active_vendor:_.data.active_vendor,vendors:_.data.vendors}}function KX($,I){let _=e.resolve($),u=e.parse(_).root;while(_!==u){let U=e.join(_,I);if(x.existsSync(U))return U;_=e.dirname(_)}return null}function bS($){let I=KX($,e.join(".agents","oma-config.yaml"));if(!I)return null;try{let _=x.readFileSync(I,"utf-8");return ZS(_)}catch{return null}}function PS($){let I=KX($,e.join(".agents","skills","oma-orchestrator","config","cli-config.yaml"));if(!I)return null;try{let _=x.readFileSync(I,"utf-8");return AS(_)}catch{return null}}function WX($,I){let _=process.cwd(),u=bS(_),U=PS(_),g=$.replace(/-agent$/i,""),z=u?.agent_cli_mapping?.[$]||u?.agent_cli_mapping?.[g],G=I||z||u?.default_cli||U?.active_vendor||"gemini";if(!I&&!z&&!u?.default_cli&&!U?.active_vendor)console.error(m.default.yellow(`[oma] No vendor configured for agent "${$}". Falling back to "gemini".
|
|
312
|
+
Set default_cli in .agents/oma-config.yaml or use --vendor flag.`));return{vendor:G.toLowerCase(),config:U}}function $Y($,I){if(I!==void 0)return I;return{gemini:"-p",claude:"-p",qwen:"-p",codex:null}[$]??"-p"}var jS={frontend:["web","frontend","client","ui","app","dashboard","admin","portal"],backend:["api","backend","server","service","gateway","core"],mobile:["mobile","ios","android","native","rn","expo"]},SS={frontend:["apps/web","apps/frontend","apps/client","packages/web","packages/frontend","frontend","web","client"],backend:["apps/api","apps/backend","apps/server","packages/api","packages/backend","backend","api","server"],mobile:["apps/mobile","apps/app","packages/mobile","mobile","app"]};function IY($,I){if($.startsWith("!"))return[];let _=$.replace(/\/\*\*?$/,"").replace(/\/$/,"");if(!$.includes("*")){let U=e.join(I,_);if(x.existsSync(U)&&x.statSync(U).isDirectory())return[_];return[]}let u=e.join(I,_);if(!x.existsSync(u)||!x.statSync(u).isDirectory())return[];try{return x.readdirSync(u,{withFileTypes:!0}).filter((g)=>g.isDirectory()&&!g.name.startsWith(".")).map((g)=>e.join(_,g.name))}catch{return[]}}function FS($){let I=e.join($,"pnpm-workspace.yaml");if(!x.existsSync(I))return[];try{let _=x.readFileSync(I,"utf-8");return d6(_)?.packages??[]}catch{return[]}}function UY($){let I=e.join($,"package.json");if(!x.existsSync(I))return[];try{let _=x.readFileSync(I,"utf-8"),u=JSON.parse(_);if(Array.isArray(u?.workspaces))return u.workspaces;if(u?.workspaces&&typeof u.workspaces==="object")return u.workspaces.packages??[];return[]}catch{return[]}}function wS($){let I=e.join($,"lerna.json");if(!x.existsSync(I))return[];try{let _=x.readFileSync(I,"utf-8");return JSON.parse(_)?.packages??[]}catch{return[]}}function ES($){let I=e.join($,"nx.json");if(!x.existsSync(I))return[];return["apps/*","libs/*","packages/*"].flatMap((u)=>IY(u,$))}function CS($){let I=e.join($,"turbo.json");if(!x.existsSync(I))return[];return UY($)}function fS($){let I=e.join($,"mise.toml");if(!x.existsSync(I))return[];try{let _=x.readFileSync(I,"utf-8"),u=[],U=_.match(/workspaces\s*=\s*\[([^\]]+)\]/);if(U?.[1]){let g=U[1].match(/"([^"]+)"|'([^']+)'/g);if(g)u.push(...g.map((z)=>z.replace(/["']/g,"")))}return u}catch{return[]}}function xS($){let I=new Set,_=[FS($),UY($),wS($),ES($),CS($),fS($)];for(let U of _)for(let g of U)I.add(g);let u=new Set;for(let U of I)for(let g of IY(U,$))u.add(g);return[...u]}function kS($,I){let _=jS[I];if(!_)return 0;let u=e.basename($).toLowerCase(),U=$.toLowerCase();for(let g=0;g<_.length;g++){let z=_[g];if(!z)continue;if(u===z)return 100-g;if(u.includes(z))return 50-g;if(U.includes(z))return 25-g}return 0}function _Y($){let I=process.cwd(),_=xS(I);if(_.length>0){let U=_.map((g)=>({workspace:g,score:kS(g,$)})).filter((g)=>g.score>0).sort((g,z)=>z.score-g.score);if(U.length>0&&U[0])return U[0].workspace}let u=SS[$];if(u)for(let U of u){let g=e.resolve(U);if(x.existsSync(g)&&x.statSync(g).isDirectory())return U}return"."}function uY($){let I=e.resolve($);if(x.existsSync(I)&&x.statSync(I).isFile())return x.readFileSync(I,"utf-8");return $}function gY($,I){let _=KX(I,e.join(".agents","skills","_shared","runtime","execution-protocols",`${$}.md`));if(!_)return"";try{return x.readFileSync(_,"utf-8")}catch{return""}}async function zY($,I,_,u,U){let g=u==="."?_Y($):u,z=e.resolve(g);if(!x.existsSync(z))x.mkdirSync(z,{recursive:!0}),console.log(m.default.dim(`[${$}] Created workspace: ${z}`));else if(g!==u)console.log(m.default.blue(`[${$}] Auto-detected workspace: ${g}`));let G=cu(),J=e.join(G,`subagent-${_}-${$}.log`),X=e.join(G,`subagent-${_}-${$}.pid`),N=uY(I),{vendor:q,config:Q}=WX($,U),Y=gY(q,process.cwd()),O=Y?`${N}
|
|
313
313
|
|
|
314
|
-
${Y}`:N,H=Q?.vendors?.[q]||{},v=H.command||q,T=H.subcommand,K=x.openSync(J,"w");console.log(
|
|
314
|
+
${Y}`:N,H=Q?.vendors?.[q]||{},v=H.command||q,T=H.subcommand,K=x.openSync(J,"w");console.log(m.default.blue(`[${$}] Spawning subagent...`)),console.log(m.default.dim(` Vendor: ${q}`)),console.log(m.default.dim(` Workspace: ${z}`)),console.log(m.default.dim(` Log: ${J}`));let D=[],B=$Y(q,H.prompt_flag);if(H.output_format_flag&&H.output_format)D.push(H.output_format_flag,H.output_format);else if(H.output_format_flag)D.push(H.output_format_flag);if(H.model_flag&&H.default_model)D.push(H.model_flag,H.default_model);if(H.isolation_flags)D.push(...eH(H.isolation_flags));if(H.auto_approve_flag)D.push(H.auto_approve_flag);else{let k={gemini:"--approval-mode=yolo",codex:"--full-auto",qwen:"--yolo"}[q];if(k)D.push(k)}if(B)D.push(B,O);let R=[];if(T)R.push(T);if(R.push(...D),!B)R.push(O);let V={...process.env};if(H.isolation_env){let[C,...k]=H.isolation_env.split("="),w=k.join("=");if(C&&w){let X$=w.replace("$$",String(process.pid));if(V[C]=X$,X$.startsWith("/")&&!x.existsSync(X$))x.mkdirSync(X$,{recursive:!0})}}let M=BX(v,R,{cwd:z,stdio:["ignore",K,K],detached:!1,env:V});if(!M.pid)console.error(m.default.red(`[${$}] Failed to spawn process`)),process.exit(1);x.writeFileSync(X,M.pid.toString()),console.log(m.default.green(`[${$}] Started with PID ${M.pid}`));let W=()=>{try{if(x.existsSync(X))x.unlinkSync(X);if(x.existsSync(J))x.unlinkSync(J)}catch(C){}},E=()=>{if(M.pid&&l0(M.pid))process.kill(M.pid);W(),process.exit()};process.on("SIGINT",E),process.on("SIGTERM",E),M.on("exit",(C)=>{if(console.log(m.default.blue(`[${$}] Exited with code ${C}`)),C!==0&&x.existsSync(J)){let k=x.readFileSync(J,"utf-8").trim();if(k)console.log(m.default.red(`[${$}] Log output:`)),console.log(k)}W(),process.exit(C??0)})}async function GY($,I,_=process.cwd()){let u={};for(let U of I){let g=KS(_,U,$),z=e.join(cu(),`subagent-${$}-${U}.pid`);if(g&&x.existsSync(g)){let J=x.readFileSync(g,"utf-8").match(/^## Status:\s*(\S+)/m);if(J?.[1])u[U]=J[1];else{let X=x.existsSync(z)?x.readFileSync(z,"utf-8").trim():"",N=parseInt(X,10);if(!Number.isNaN(N)&&l0(N))u[U]="running";else u[U]="completed"}}else if(x.existsSync(z)){let G=x.readFileSync(z,"utf-8").trim(),J=parseInt(G,10);if(!Number.isNaN(J)&&l0(J))u[U]="running";else u[U]="crashed"}else u[U]="crashed"}for(let[U,g]of Object.entries(u))console.log(`${U}:${g}`)}var yS=G$.object({agent:G$.string(),task:G$.string(),workspace:G$.string().optional()}),iS=G$.object({tasks:G$.array(yS)});function lS($){if(!x.existsSync($))throw Error(`Tasks file not found: ${$}`);let I=x.readFileSync($,"utf-8"),_=d6(I),u=iS.safeParse(_);if(!u.success)throw Error(`Invalid tasks file format: ${u.error.message}`);return u.data.tasks}function mS($){return $.map((I)=>{let _=I.split(":");if(_.length<2||!_[0])throw Error(`Invalid task format: "${I}". Expected "agent:task" or "agent:task:workspace"`);let u=_[0],U=_.slice(1),g,z;if(U.length>=2){let G=U[U.length-1]??"";if(G.startsWith("./")||G.startsWith("/")||G===".")z=G,g=U.slice(0,-1).join(":");else g=U.join(":")}else g=U.join(":");return{agent:u,task:g,workspace:z}})}async function JY($,I={}){let _=process.cwd(),u=e.join(_,".agents","results"),U=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19),g=e.join(u,`parallel-${U}`);x.mkdirSync(g,{recursive:!0});let z=e.join(g,"pids.txt"),G;try{if(I.inline){if($.length===0)console.error(m.default.red("Error: No tasks specified")),console.log('Usage: oh-my-agent agent:parallel --inline "agent:task" "agent:task" ...'),process.exit(1);G=mS($)}else{if($.length===0)console.error(m.default.red("Error: No tasks file specified")),console.log("Usage: oh-my-agent agent:parallel <tasks-file.yaml>"),process.exit(1);let Y=$[0];if(!Y)console.error(m.default.red("Error: No tasks file specified")),process.exit(1);G=lS(Y)}}catch(Y){console.error(m.default.red(`Error: ${Y.message}`)),process.exit(1)}console.log(m.default.cyan("======================================")),console.log(m.default.cyan(" Parallel SubAgent Execution")),console.log(m.default.cyan("======================================")),console.log(""),console.log(m.default.blue("Starting parallel execution...")),console.log("");let J=[];for(let Y=0;Y<G.length;Y++){let O=G[Y];if(!O)continue;let{agent:H,task:v,workspace:T="."}=O,K=T==="."?_Y(H):T,D=e.resolve(K),B=e.join(g,`${H}-${Y}.log`);if(console.log(`${m.default.blue(`[${Y}]`)} Spawning ${m.default.yellow(H)} agent...`),console.log(` Task: ${v.slice(0,60)}${v.length>60?"...":""}`),console.log(` Workspace: ${K}`),!x.existsSync(D))x.mkdirSync(D,{recursive:!0});let{vendor:R,config:V}=WX(H,I.vendor),M=V?.vendors?.[R]||{},W=M.command||R,E=M.subcommand,C=[],k=$Y(R,M.prompt_flag),w=uY(v),X$=gY(R,_),t=X$?`${w}
|
|
315
315
|
|
|
316
|
-
${
|
|
317
|
-
`);let
|
|
316
|
+
${X$}`:w;if(M.output_format_flag&&M.output_format)C.push(M.output_format_flag,M.output_format);else if(M.output_format_flag)C.push(M.output_format_flag);if(M.model_flag&&M.default_model)C.push(M.model_flag,M.default_model);if(M.isolation_flags)C.push(...eH(M.isolation_flags));if(M.auto_approve_flag)C.push(M.auto_approve_flag);else{let D1={gemini:"--approval-mode=yolo",codex:"--full-auto",qwen:"--yolo"}[R];if(D1)C.push(D1)}if(k)C.push(k,t);let l=[];if(E)l.push(E);if(l.push(...C),!k)l.push(t);let u$={...process.env};if(M.isolation_env){let[z6,...D1]=M.isolation_env.split("="),D5=D1.join("=");if(z6&&D5){let MU=D5.replace("$$",String(process.pid));if(u$[z6]=MU,MU.startsWith("/")&&!x.existsSync(MU))x.mkdirSync(MU,{recursive:!0})}}let w$=x.openSync(B,"w"),A4=BX(W,l,{cwd:D,stdio:["ignore",w$,w$],detached:!0,env:u$});if(!A4.pid){console.error(m.default.red(`[${Y}] Failed to spawn ${H} process`));continue}x.appendFileSync(z,`${A4.pid}:${H}
|
|
317
|
+
`);let Ug=new Promise((z6)=>{A4.on("exit",(D1)=>{x.closeSync(w$),z6(D1)}),A4.on("error",()=>{x.closeSync(w$),z6(null)})});J.push({pid:A4.pid,agent:H,idx:Y,promise:Ug})}if(console.log(""),console.log(m.default.blue("[Parallel]")+` Started ${m.default.yellow(String(J.length))} agents`),I.noWait){console.log(`${m.default.blue("[Parallel]")} Running in background mode`),console.log(`${m.default.blue("[Parallel]")} Results will be in: ${g}`),console.log(`${m.default.blue("[Parallel]")} PID list: ${z}`);return}console.log(`${m.default.blue("[Parallel]")} Waiting for completion...`),console.log("");let X=()=>{console.log(""),console.log(`${m.default.yellow("[Parallel]")} Cleaning up child processes...`);for(let{pid:Y,agent:O}of J)if(l0(Y)){try{process.kill(-Y,"SIGTERM")}catch{try{process.kill(Y,"SIGTERM")}catch{}}console.log(`${m.default.yellow("[Parallel]")} Killed PID ${Y} (${O})`)}try{if(x.existsSync(z))x.unlinkSync(z)}catch{}};process.on("SIGINT",()=>{X(),process.exit(130)}),process.on("SIGTERM",()=>{X(),process.exit(143)});let N=0,q=0;for(let{agent:Y,idx:O,promise:H}of J){let v=await H;if(v===0)console.log(`${m.default.green("[DONE]")} ${Y} agent (${O}) completed`),N++;else console.log(m.default.red("[FAIL]")+` ${Y} agent (${O}) failed (exit code: ${v})`),q++}try{if(x.existsSync(z))x.unlinkSync(z)}catch{}console.log(""),console.log(m.default.cyan("======================================")),console.log(m.default.cyan(" Execution Summary")),console.log(m.default.cyan("======================================")),console.log(`Total: ${J.length}`),console.log(`Completed: ${m.default.green(String(N))}`),console.log(`Failed: ${m.default.red(String(q))}`),console.log(`Results: ${g}`),console.log(m.default.cyan("======================================")),console.log(""),console.log(m.default.blue("Result files:"));let Q=x.readdirSync(g).filter((Y)=>Y.endsWith(".log"));for(let Y of Q)console.log(` - ${e.join(g,Y)}`);if(q>0)process.exit(1)}function nS(){let $=hu(process.cwd());if($.id&&$.status!=="completed"&&$.status!=="failed")return $.id;return DX(new Date)}var rS="codex",hS=["codex","claude","gemini","qwen"];function cS($,I,_){if(I)return`Review the uncommitted changes (git diff) in this repository. ${$}`;try{let u=BS("git diff HEAD~1",{cwd:_,encoding:"utf-8"}).trim();if(!u)return`No committed changes found. ${$}`;return`Review the following committed diff:
|
|
318
318
|
|
|
319
319
|
\`\`\`diff
|
|
320
320
|
${u}
|
|
321
321
|
\`\`\`
|
|
322
322
|
|
|
323
|
-
${$}`}catch{return`Review the latest committed changes. ${$}`}}function
|
|
324
|
-
---`,3);if(_===-1)return{frontmatter:{},body:$};let u=I.slice(3,_).trim(),U=I.slice(_+4);try{let g=
|
|
323
|
+
${$}`}catch{return`Review the latest committed changes. ${$}`}}function dS($,I,_,u,U){let g=I.command||$;if($==="codex")return u?[g,"review","--uncommitted"]:[g,"review"];let z=cS(_,u,U),G=I.prompt_flag||"-p",J=[g,G,z];if(I.model_flag&&I.default_model)J.push(I.model_flag,I.default_model);if(I.auto_approve_flag)J.push(I.auto_approve_flag);else{let N={gemini:"--approval-mode=yolo",qwen:"--yolo"}[$];if(N)J.push(N)}if($==="claude")J.push("--output-format","text");return J}async function XY($){let I=nS(),_=$.prompt||"Review for bugs, security vulnerabilities, performance issues, and code quality. Report findings with severity levels.",u="review",U=$.workspace||".",g=e.resolve(U),{vendor:z,config:G}=WX("review",$.model),J=hS.includes(z)?z:rS;if(J!==z)console.log(m.default.yellow(`[review] "${z}" has no review mode, falling back to ${J}`));let X=G?.vendors?.[J]||{},N=$.uncommitted??!0,q=dS(J,X,_,N,g),[Q,...Y]=q;if(!Q)console.error(m.default.red("[review] No command provided for review")),process.exit(1);let O=e.join(cu(),`review-${I}.log`),H=e.join(cu(),`review-${I}.pid`);console.log(m.default.dim(` Session: ${I}`)),console.log(m.default.blue("[review] Starting review...")),console.log(m.default.dim(` Vendor: ${J}`)),console.log(m.default.dim(` Command: ${Q} ${Y.slice(0,2).join(" ")}...`));let v=x.openSync(O,"w"),T=BX(Q,Y,{cwd:g,stdio:["ignore",v,v],detached:!1});if(!T||!T.pid)console.error(m.default.red("[review] Failed to spawn process")),process.exit(1);let K=T.pid;x.writeFileSync(H,K.toString()),console.log(m.default.green(`[review] Started with PID ${K}`));let D=()=>{try{if(x.existsSync(H))x.unlinkSync(H);if(x.existsSync(O))x.unlinkSync(O)}catch(R){}},B=()=>{if(K&&l0(K))process.kill(K);D(),process.exit()};process.on("SIGINT",B),process.on("SIGTERM",B),T.on("exit",(R)=>{if(x.existsSync(O)){let V=x.readFileSync(O,"utf-8").trim();if(V)console.log(""),console.log(V)}console.log(R===0?m.default.green("[review] Done"):m.default.red(`[review] Exited with code ${R}`)),D(),process.exit(R??0)})}U4();var q1=O$(Z$(),1);import{execSync as Rw}from"node:child_process";import{existsSync as Iq,readFileSync as Uq}from"node:fs";import{homedir as _q}from"node:os";import{join as uq}from"node:path";import{execSync as $q}from"node:child_process";import*as y from"node:fs";import{dirname as aY,join as _$,relative as eY,resolve as a0}from"node:path";var _4={domain:[{name:"oma-architecture",desc:"Architecture specialist - module boundaries, tradeoffs, ADRs"},{name:"oma-frontend",desc:"React/Next.js UI specialist"},{name:"oma-backend",desc:"Backend API specialist (multi-language)"},{name:"oma-db",desc:"SQL/NoSQL data modeling, normalization, integrity, and capacity specialist"},{name:"oma-mobile",desc:"Flutter/Dart mobile specialist"}],design:[{name:"oma-design",desc:"Design system, DESIGN.md, accessibility, anti-pattern enforcement"}],coordination:[{name:"oma-brainstorm",desc:"Design-first ideation before planning"},{name:"oma-pm",desc:"Product manager - task decomposition"},{name:"oma-qa",desc:"QA - OWASP, Lighthouse, WCAG"},{name:"oma-coordination",desc:"Manual multi-agent orchestration"},{name:"oma-orchestrator",desc:"Automated parallel CLI execution"}],utility:[{name:"oma-debug",desc:"Bug fixing specialist"},{name:"oma-scm",desc:"SCM — branching, merges, worktrees, baselines, audit; Conventional Commits"},{name:"oma-translator",desc:"Context-aware multilingual translation"},{name:"oma-pdf",desc:"PDF to Markdown conversion via opendataloader-pdf"}],infrastructure:[{name:"oma-tf-infra",desc:"Multi-cloud infrastructure with Terraform - AWS, GCP, Azure, OCI support"},{name:"oma-dev-workflow",desc:"Monorepo developer workflows - mise tasks, git hooks, CI/CD, release automation"}]},xY={fullstack:["oma-architecture","oma-brainstorm","oma-design","oma-frontend","oma-backend","oma-db","oma-pm","oma-qa","oma-debug","oma-scm","oma-tf-infra","oma-dev-workflow"],frontend:["oma-architecture","oma-brainstorm","oma-design","oma-frontend","oma-pm","oma-qa","oma-debug","oma-scm"],backend:["oma-architecture","oma-brainstorm","oma-backend","oma-db","oma-pm","oma-qa","oma-debug","oma-scm","oma-dev-workflow"],mobile:["oma-architecture","oma-brainstorm","oma-mobile","oma-pm","oma-qa","oma-debug","oma-scm"],devops:["oma-architecture","oma-brainstorm","oma-tf-infra","oma-dev-workflow","oma-pm","oma-qa","oma-debug","oma-scm"],all:[..._4.domain,..._4.design,..._4.coordination,..._4.utility,..._4.infrastructure].map(($)=>$.name)};var W$="first-fluke/oh-my-agent",d$=".agents/skills",G2=["claude","codex","copilot","cursor","gemini","qwen"],pX={claude:".claude/skills",copilot:".github/skills"};import*as JI from"node:fs";function t4($){try{if(!JI.lstatSync($).isDirectory())JI.unlinkSync($)}catch{}}import{existsSync as kY,mkdirSync as hF,readdirSync as cF,readFileSync as yY,writeFileSync as dF}from"node:fs";import{join as o0}from"node:path";function rF($){return typeof $==="object"&&$!==null&&!Array.isArray($)}function tX($){if($===void 0||$===null)return;if(Array.isArray($))return $.map((I)=>tX(I)).filter((I)=>I!==void 0);if(rF($))return Object.fromEntries(Object.entries($).map(([I,_])=>[I,tX(_)]).filter(([,I])=>I!==void 0));return $}function XI($){let I=$.trimStart();if(!I.startsWith("---"))return{frontmatter:{},body:$};let _=I.indexOf(`
|
|
324
|
+
---`,3);if(_===-1)return{frontmatter:{},body:$};let u=I.slice(3,_).trim(),U=I.slice(_+4);try{let g=d6(u);return{frontmatter:g&&typeof g==="object"?g:{},body:U}}catch{return{frontmatter:{},body:U}}}function qI($,I){let _=Object.fromEntries(Object.entries($).map(([U,g])=>[U,tX(g)]).filter(([,U])=>U!==void 0));if(Object.keys(_).length===0)return`---
|
|
325
325
|
---
|
|
326
326
|
|
|
327
327
|
${I}`;return`---
|
|
328
|
-
${
|
|
328
|
+
${Vz(_).trimEnd()}
|
|
329
329
|
---
|
|
330
330
|
|
|
331
|
-
${I}`}var
|
|
332
|
-
`)}function
|
|
333
|
-
${R}${B}`,
|
|
334
|
-
`)}function
|
|
335
|
-
`)
|
|
331
|
+
${I}`}var oF={gemini:{read:"read_file",write:"write_file",edit:"replace",bash:"run_shell_command",grep:"grep_search",glob:"glob",ask:"ask_user",memory:"save_memory"},claude:{read:"Read",write:"Write",edit:"Edit",bash:"Bash",grep:"Grep",glob:"Glob"},cursor:{read:"read_file",write:"write_file",edit:"replace",bash:"run_shell_command",grep:"grep_search",glob:"glob"}};function pF($){return $==="gemini"?"max_turns":"maxTurns"}function tF($){return $==="gemini"?"timeout_mins":"timeoutMins"}function aF($){return $!=="gemini"}function eF($){if(!Array.isArray($)||$.length===0)return"";let I=$.map((_)=>String(_).trim()).filter(Boolean).map((_)=>`- \`.agents/skills/${_}/SKILL.md\``);if(I.length===0)return"";return["","## Skill References","","When relevant, use these project resources as the authoritative implementation guide:",...I,""].join(`
|
|
332
|
+
`)}function sF($,I){if($!=="gemini")return I;let _=new Set(["name","description","kind","tools","mcpServers","model","temperature","max_turns","timeout_mins"]);return Object.fromEntries(Object.entries(I).filter(([u])=>_.has(u)))}function iY($,I,_){let u=o0($,".agents","agents"),U=o0(u,"variants",`${_}.json`);if(!kY(u)||!kY(U))return;let g=JSON.parse(yY(U,"utf-8"));if(!g||!g.destDir)return;let z=o0(I,g.destDir);hF(z,{recursive:!0});let G=oF[_]||{};for(let J of cF(u,{withFileTypes:!0})){if(!J.isFile()||!J.name.endsWith(".md"))continue;let X=J.name,N=X.replace(".md",""),q=yY(o0(u,X),"utf-8"),{frontmatter:Q,body:Y}=XI(q),O=g.agents[N]||{},H=O.tools||Q.tools||g.toolsDefault,T=(Array.isArray(H)?H:String(H||"").split(",").map((W)=>W.trim())).map((W)=>G[W.toLowerCase()]||W),K=Array.isArray(g.toolsDefault)?T:T.join(", "),D={name:Q.name||N,description:O.description||Q.description,tools:K,model:O.model||Q.model||g.modelDefault};if(g.maxTurnsDefault||O.maxTurns||Q.maxTurns)D[pF(_)]=O.maxTurns||Q.maxTurns||g.maxTurnsDefault;if(O.effort)D.effort=O.effort;if(O.kind)D.kind=O.kind;if(O.temperature!==void 0)D.temperature=O.temperature;if(O.timeoutMins!==void 0)D[tF(_)]=O.timeoutMins;if(O.mcpServers)D.mcpServers=O.mcpServers;if(Q.skills&&aF(_))D.skills=Q.skills;if(O.extra)Object.assign(D,O.extra);let B=Y.replace("Follow the vendor-specific execution protocol:",`Follow \`${g.protocolPath}\`:`),R=_==="gemini"?eF(Q.skills):"",V=`<!-- Generated by oh-my-agent CLI. Source: .agents/agents/${X} -->
|
|
333
|
+
${R}${B}`,M=sF(_,D);dF(o0(z,X),qI(M,V))}}import{execFileSync as $w}from"node:child_process";import{cpSync as Iw,existsSync as aX,mkdirSync as mY,readdirSync as Uw,readFileSync as nY,writeFileSync as J2}from"node:fs";import{dirname as _w,join as p0}from"node:path";function uw($){return`"${$.replaceAll('"',"\\\"")}"`}function gw($){if($==="bun")try{let I=$w("which",[$],{encoding:"utf-8"}).trim();if(I)return uw(I)}catch{}return $}function lY($,I){let _=gw($.runtime);if($.projectDirEnv)return`${_} "$${$.projectDirEnv}/${$.hookDir}/${I}"`;return`${_} ${$.hookDir}/${I}`}function zw($){return $.replace(/\.[^.]+$/,"")}function Gw($,I){let _=p0($,".agents","hooks","core");if(!aX(_))return;mY(I,{recursive:!0});for(let u of Uw(I,{withFileTypes:!0}))t4(p0(I,u.name));Iw(_,I,{recursive:!0,force:!0,dereference:!0})}function Jw($,I,_){let u={};if(aX($))try{u=JSON.parse(nY($,"utf-8"))}catch{}if(u.hooks={...u.hooks||{},...I},_)Object.assign(u,_);J2($,`${JSON.stringify(u,null,2)}
|
|
334
|
+
`)}function Xw($,I,_){mY(_w($),{recursive:!0});let u="";if(aX($))u=nY($,"utf-8");for(let[U,g]of Object.entries(_)){if(new RegExp(`${U}\\s*=\\s*${g}`,"i").test(u))continue;let G=new RegExp(`${U}\\s*=\\s*${!g}`,"i");if(G.test(u)){u=u.replace(G,`${U} = ${g}`),J2($,u);continue}if(new RegExp(`\\[${I}\\]`,"i").test(u))u=u.replace(new RegExp(`(\\[${I}\\][^[]*)`,"i"),`$1${U} = ${g}
|
|
335
|
+
`),J2($,u);else u=`${u.trimEnd()}
|
|
336
336
|
|
|
337
337
|
[${I}]
|
|
338
338
|
${U} = ${g}
|
|
339
|
-
|
|
340
|
-
`);
|
|
339
|
+
`,J2($,u)}}function rY($,I,_){Gw($,p0(I,_.hookDir));let u={};for(let[g,z]of Object.entries(_.events)){let G={hooks:[{name:zw(z.hook),type:"command",command:lY(_,z.hook),timeout:z.timeout}]};if(z.matcher)G.matcher=z.matcher;u[g]=[G]}let U={};if(_.statusLine)U.statusLine={type:"command",command:lY(_,_.statusLine.hook)};if(_.extra)Object.assign(U,_.extra);if(Jw(p0(I,_.settingsFile),u,Object.keys(U).length>0?U:void 0),_.featureFlags)Xw(p0(I,_.featureFlags.file),_.featureFlags.section,_.featureFlags.flags)}import{existsSync as pY,mkdirSync as Lw,readdirSync as Bw,readFileSync as tY,writeFileSync as Kw}from"node:fs";import{join as QI}from"node:path";import{cpSync as Gr,existsSync as hY,mkdirSync as cY,readdirSync as qw,readFileSync as dY,writeFileSync as t0}from"node:fs";import{join as G1}from"node:path";var X2=".agents/rules",Nw=".cursor/rules",Qw=".claude/rules";function sX($){let I=G1($,X2);if(!hY(I))return[];return qw(I).filter((_)=>_.endsWith(".md")).map((_)=>{let u=dY(G1(I,_),"utf-8"),{frontmatter:U,body:g}=XI(u);return{name:_.replace(".md",""),description:U.description||_.replace(".md",""),globs:U.globs||"",alwaysApply:U.alwaysApply||!1,body:g.trim()}})}function b6($){let I=sX($);if(I.length===0)return[];let _=G1($,Nw);cY(_,{recursive:!0});let u=[];for(let U of I){let g=`<!-- Generated by oh-my-agent. Source: ${X2}/${U.name}.md -->`,z=["---",`description: ${JSON.stringify(U.description)}`,`globs: ${U.globs?JSON.stringify(U.globs):""}`,`alwaysApply: ${U.alwaysApply}`,"---","",g,"",U.body,""].join(`
|
|
340
|
+
`);t0(G1(_,`${U.name}.mdc`),z),u.push(U.name)}return u}function oY($){let I=sX($);if(I.length===0)return[];let _=G1($,Qw);cY(_,{recursive:!0});let u=[];for(let U of I){let g={description:U.description};if(!U.alwaysApply&&U.globs)g.paths=U.globs;let z=qI(g,`
|
|
341
341
|
${U.body}
|
|
342
|
-
`);
|
|
343
|
-
`)}var
|
|
342
|
+
`);t0(G1(_,`${U.name}.md`),z),u.push(U.name)}return u}var Hw="<!-- OMA:START — managed by oh-my-agent. Do not edit this block manually. -->",eX="<!-- OMA:END -->",Yw={claude:"CLAUDE.md",gemini:"GEMINI.md",codex:"AGENTS.md",cursor:"AGENTS.md",qwen:"AGENTS.md"},Ow={claude:"`@agent-name` (defined in `.claude/agents/`)",gemini:"`@agent-name` (defined in `.gemini/agents/`) or `oma agent:spawn {agent} {prompt} {sessionId}`",cursor:"`@agent-name` (defined in `.cursor/agents/`)",codex:"`oma agent:spawn {agent} {prompt} {sessionId}`",qwen:"`oma agent:spawn {agent} {prompt} {sessionId}`"},vw={claude:"Hooks: `UserPromptSubmit` (keyword detection), `PreToolUse`, `Stop` (persistent mode)",gemini:"Hooks: `BeforeAgent` (keyword detection), `BeforeTool`, `AfterAgent` (persistent mode)",codex:"Hooks: `UserPromptSubmit` (keyword detection), `PreToolUse`, `Stop` (persistent mode)",cursor:"Hooks: `UserPromptSubmit` / `beforeSubmitPrompt` (keyword detection)",qwen:"Hooks: `UserPromptSubmit` (keyword detection), `PreToolUse`, `Stop` (persistent mode)"};function Tw($,I){let _=[Hw,"","# oh-my-agent","","## Architecture","","- **SSOT**: `.agents/` directory (do not modify directly)","- **Response language**: Follows `language` in `.agents/oma-config.yaml`","- **Skills**: `.agents/skills/` (domain specialists)","- **Workflows**: `.agents/workflows/` (multi-step orchestration)",`- **Subagents**: ${Ow[$]||"`oma agent:spawn`"}`,"","## Workflows","","Execute by naming the workflow in your prompt. Keywords are auto-detected via hooks.","","| Workflow | File | Description |","|----------|------|-------------|","| orchestrate | `orchestrate.md` | Parallel subagents + Review Loop |","| work | `work.md` | Step-by-step with remediation loop |","| ultrawork | `ultrawork.md` | 5-Phase Gate Loop (11 reviews) |","| plan | `plan.md` | PM task breakdown |","| brainstorm | `brainstorm.md` | Design-first ideation |","| review | `review.md` | QA audit |","| debug | `debug.md` | Root cause + minimal fix |","| scm | `scm.md` | SCM + Git operations + Conventional Commits |","","To execute: read and follow `.agents/workflows/{name}.md` step by step.","","## Auto-Detection","",vw[$]||"","Keywords defined in `.agents/hooks/core/triggers.json` (multi-language).","Persistent workflows (orchestrate, ultrawork, work) block termination until complete.",'Deactivate: say "workflow done".',"","## Rules","","1. **Do not modify `.agents/` files** — SSOT protection","2. Workflows execute via keyword detection or explicit naming — never self-initiated","3. Response language follows `.agents/oma-config.yaml`",""];if(I.length>0){_.push("## Project Rules","",`Read the relevant file from \`${X2}/\` when working on matching code.`,"","| Rule | File | Scope |","|------|------|-------|");for(let u of I){let U=u.globs||(u.alwaysApply?"always":"on request");_.push(`| ${u.name} | \`${X2}/${u.name}.md\` | ${U} |`)}_.push("")}return _.push(eX),_.join(`
|
|
343
|
+
`)}var Mw="<!-- OMA:START";function Dw($,I){if(hY($)){let _=dY($,"utf-8"),u=_.indexOf(Mw),U=_.indexOf(eX);if(u!==-1&&U!==-1){let g=_.slice(0,u),z=_.slice(U+eX.length);t0($,`${g}${I}${z}`)}else t0($,`${_.trimEnd()}
|
|
344
344
|
|
|
345
345
|
${I}
|
|
346
|
-
`)}else
|
|
347
|
-
`)}function
|
|
346
|
+
`)}else t0($,`${I}
|
|
347
|
+
`)}function NI($,I){let _=Yw[I];if(!_)return!1;let u=sX($),U=Tw(I,u);return Dw(G1($,_),U),!0}function Ww($,I){if(!pY($))return;for(let _ of Bw($,{withFileTypes:!0})){if(!_.isFile()||!_.name.endsWith(".md")||_.name.startsWith("_"))continue;let u=_.name,U=tY(QI($,u),"utf-8"),{frontmatter:g}=XI(U),z=u.replace(".md",""),G=g.description||z,J=QI(I,".claude","skills",z);t4(J);let X=qI({name:z,description:G,"disable-model-invocation":!0},`# /${z}
|
|
348
348
|
|
|
349
349
|
Read and follow \`.agents/workflows/${u}\` step by step.
|
|
350
|
-
`);
|
|
350
|
+
`);Lw(J,{recursive:!0}),Kw(QI(J,"SKILL.md"),X)}}function HI($,I,_){let u=QI($,".agents","workflows"),U=QI($,".agents","hooks","variants");for(let g of _){iY($,I,g);let z=QI(U,`${g}.json`);if(pY(z)){let G=JSON.parse(tY(z,"utf-8"));rY($,I,G)}if(g==="claude")Ww(u,I),oY(I)}}function q2($){let I=_$($,".agents","oma-config.yaml");if(!y.existsSync(I))return[...G2];let u=y.readFileSync(I,"utf-8").match(/^vendors:\s*\n((?:\s+-\s+\S+\n?)*)/m);if(!u||!u[1])return[...G2];let U=[...u[1].matchAll(/-\s+(\S+)/g)].map((g)=>g[1]);return U.length>0?U:[...G2]}function sY($,I){let _=_$($,".agents","oma-config.yaml");if(!y.existsSync(_))return;let u=y.readFileSync(_,"utf-8"),U=`vendors:
|
|
351
351
|
${I.map((g)=>` - ${g}`).join(`
|
|
352
352
|
`)}`;if(/^vendors:/m.test(u))u=u.replace(/^vendors:\s*\n(?:\s+-\s+\S+\n?)*/m,`${U}
|
|
353
353
|
`);else u=`${u.trimEnd()}
|
|
354
354
|
${U}
|
|
355
|
-
`;
|
|
355
|
+
`;y.writeFileSync(_,u)}function N2($,I,_,u){let U=_$($,".agents","skills",I);if(!y.existsSync(U))return!1;let g=_$(_,d$,I);t4(g),y.mkdirSync(g,{recursive:!0}),y.cpSync(U,g,{recursive:!0,force:!0});let z=_$(U,"variants"),G=_$(g,"stack");if(u&&y.existsSync(_$(z,u)))y.mkdirSync(G,{recursive:!0}),y.cpSync(_$(z,u),G,{recursive:!0,force:!0}),y.writeFileSync(_$(G,"stack.yaml"),`language: ${u}
|
|
356
356
|
source: preset
|
|
357
|
-
`);let J=_$(g,"variants");if(
|
|
358
|
-
`),"Authentication Status"),p(`Use ${
|
|
357
|
+
`);let J=_$(g,"variants");if(y.existsSync(J))y.rmSync(J,{recursive:!0,force:!0});return!0}function Q2($,I){let _=_$($,".agents","skills","_shared");if(!y.existsSync(_))return;let u=_$(I,d$,"_shared");t4(u),y.mkdirSync(u,{recursive:!0}),y.cpSync(_,u,{recursive:!0,force:!0})}function $O($,I){let _=_$($,".agents","workflows");if(!y.existsSync(_))return;let u=_$(I,".agents","workflows");t4(u),y.mkdirSync(u,{recursive:!0}),y.cpSync(_,u,{recursive:!0,force:!0})}function IO($,I){let _=_$($,".agents","rules");if(!y.existsSync(_))return;let u=_$(I,".agents","rules");t4(u),y.mkdirSync(u,{recursive:!0}),y.cpSync(_,u,{recursive:!0,force:!0})}function UO($,I,_=!1){let u=_$($,".agents","config");if(y.existsSync(u)){let g=_$(I,".agents","config");if(y.mkdirSync(g,{recursive:!0}),_)y.cpSync(u,g,{recursive:!0,force:!0});else for(let z of y.readdirSync(u,{withFileTypes:!0})){let G=_$(g,z.name);if(!y.existsSync(G))y.cpSync(_$(u,z.name),G,z.isDirectory()?{recursive:!0}:{})}}let U=_$($,".agents","mcp.json");if(y.existsSync(U)){let g=_$(I,".agents");y.mkdirSync(g,{recursive:!0});let z=_$(g,"mcp.json");if(_||!y.existsSync(z))y.cpSync(U,z)}}function YI(){return[..._4.domain,..._4.design,..._4.coordination,..._4.utility,..._4.infrastructure]}function OI($){let I=_$($,".agents","mcp.json");if(!y.existsSync(I))return;let _=_$($,".cursor"),u=_$(_,"mcp.json"),U=eY(_,I);try{if(y.lstatSync(u).isSymbolicLink()){if(a0(aY(u),y.readlinkSync(u))===a0(I))return;y.unlinkSync(u)}else return}catch{}y.mkdirSync(_,{recursive:!0}),y.symlinkSync(U,u,"file")}function vI($,I,_){let u=[],U=[],g=a0($,d$);for(let z of I){let G=pX[z],J=_$($,G);if(!y.existsSync(J))y.mkdirSync(J,{recursive:!0});for(let X of _){let N=_$(g,X),q=_$(J,X);if(!y.existsSync(N)){U.push(`${G}/${X} (source missing)`);continue}try{if(y.lstatSync(q).isSymbolicLink()){if(a0(aY(q),y.readlinkSync(q))===a0(N)){U.push(`${G}/${X} (already linked)`);continue}y.unlinkSync(q)}else{U.push(`${G}/${X} (real dir exists)`);continue}}catch(Y){}let Q=eY(J,N);y.symlinkSync(Q,q,"dir"),u.push(`${G}/${X}`)}}return{created:u,skipped:U}}function H2($){let I=_$($,d$);if(!y.existsSync(I))return[];return y.readdirSync(I,{withFileTypes:!0}).filter((_)=>_.isDirectory()&&!_.name.startsWith("_")).map((_)=>_.name)}function Y2($){let I=[];for(let[_,u]of Object.entries(pX))if(y.existsSync(_$($,u)))I.push(_);return I}function J1(){try{return $q("gh --version",{stdio:"ignore"}),!0}catch{return!1}}function x4(){try{return $q("gh auth status",{stdio:"ignore"}),!0}catch{return!1}}function X1(){try{return $q(`gh api user/starred/${W$}`,{stdio:"ignore"}),!0}catch{return!1}}function _O(){return J1()&&x4()&&X1()}function gq(){try{let $=Rw("claude auth status",{stdio:["pipe","pipe","ignore"],encoding:"utf-8"});return JSON.parse($).loggedIn===!0}catch{return!1}}function zq(){let $=uq(_q(),".gemini","oauth_creds.json");if(!Iq($))return!1;try{let I=JSON.parse(Uq($,"utf-8"));return!!(I.access_token&&I.refresh_token)}catch{return!1}}function Gq(){let $=uq(_q(),".codex","auth.json");if(!Iq($))return!1;try{return!!JSON.parse(Uq($,"utf-8")).tokens?.access_token}catch{return!1}}function Jq(){let $=uq(_q(),".qwen","settings.json");if(!Iq($))return!1;try{return!!JSON.parse(Uq($,"utf-8")).security?.auth?.selectedType}catch{return!1}}async function uO($=!1){let I=x4(),_=zq(),u=gq(),U=Gq(),g=Jq(),z={github:I,gemini:_,claude:u,codex:U,qwen:g};if($){console.log(JSON.stringify(z,null,2));return}L$(q1.default.bgMagenta(q1.default.white(" \uD83D\uDD10 oh-my-agent auth status ")));let G=(N)=>N?"✅":"❌",J=(N)=>N?q1.default.green("Authenticated"):q1.default.red("Not Authenticated");i([["GitHub",I],["Gemini CLI",_],["Claude CLI",u],["Codex CLI",U],["Qwen CLI",g]].map(([N,q])=>`${G(q)} ${N.padEnd(12)} ${J(q)}`).join(`
|
|
358
|
+
`),"Authentication Status"),p(`Use ${q1.default.cyan("gemini auth")}, ${q1.default.cyan("claude auth")}, etc. to login.`)}import{spawn as Vw}from"node:child_process";import{existsSync as gO,readFileSync as zO,writeFileSync as Zw}from"node:fs";import Aw from"node:http";import bw from"node:https";import{homedir as Pw}from"node:os";import{join as GO}from"node:path";var jw="http://localhost:12341/mcp",JO=1000,Sw=Number.parseInt(process.env.OH_MY_AG_BRIDGE_PROBE_TIMEOUT_MS??"2000",10),Fw=Number.parseInt(process.env.OH_MY_AG_BRIDGE_STARTUP_TIMEOUT_MS??"120000",10),P6={};function XO(){if(P6.stdinData)process.stdin.off("data",P6.stdinData);if(P6.sigint)process.off("SIGINT",P6.sigint);if(P6.sigterm)process.off("SIGTERM",P6.sigterm);P6={}}function ww(){let $=GO(Pw(),".serena","serena_config.yml");if(!gO($))return;try{let _=zO($,"utf8").match(/^projects:\s*\n((?:\s*-\s*.+\n?)*)/m);if(!_)return;let U=((_[1]??"").match(/^\s*-\s*(.+)$/gm)||[]).map((g)=>g.replace(/^\s*-\s*/,"").trim());for(let g of U){let z=GO(g,".serena","project.yml");if(!gO(z))continue;let G=zO(z,"utf8");if(!/^languages:/m.test(G)){console.error(`[Bridge] Missing 'languages' key in ${z}, adding default...`);let J=G.search(/\n(?=\w)/);if(J!==-1){let X=`${G.slice(0,J)}
|
|
359
359
|
|
|
360
360
|
languages:
|
|
361
361
|
- python
|
|
362
362
|
- typescript
|
|
363
363
|
- dart
|
|
364
|
-
- terraform${G.slice(J)}`;
|
|
364
|
+
- terraform${G.slice(J)}`;Zw(z,X),console.error(`[Bridge] Fixed ${z}`)}}}}catch(I){console.error(`[Bridge] Warning: Failed to validate Serena configs: ${I instanceof Error?I.message:I}`)}}async function qO($){XO();let I=$||jw,_=new URL(I),U=_.protocol==="https:"?bw:Aw,g=null,z=!1,G=null,J=!1;async function X(){let M=_.hostname==="localhost"?[I,I.replace("localhost","127.0.0.1")]:[I];for(let W of M)if(await new Promise((C)=>{let k=U.get(W,(w)=>{C(!0),k.destroy()});k.setTimeout(Sw,()=>{k.destroy(),C(!1)}),k.on("error",()=>{C(!1)}),k.end()}))return!0;return!1}async function N(){let M=_.port||"12341",W=_.hostname||"0.0.0.0";console.error(`Starting Serena server on ${W}:${M}...`),g=Vw("uvx",["--from","git+https://github.com/oraios/serena","serena","start-mcp-server","--transport","streamable-http","--host",W,"--port",M,"--context","ide","--open-web-dashboard","false"],{stdio:"pipe",detached:!1});let C=g;if(g.stderr)g.stderr.on("data",(w)=>{process.stderr.write(`[Serena] ${w}`)});if(g.stdout)g.stdout.on("data",()=>{});C.on("error",(w)=>{console.error("Failed to start Serena server:",w),process.exit(1)}),C.on("exit",(w,X$)=>{if(console.error(`Serena server exited with code ${String(w)} signal ${String(X$)}`),!z)process.exit(typeof w==="number"?w:1)}),console.error("Waiting for Serena to be ready...");let k=Math.max(1,Math.ceil(Fw/JO));for(let w=0;w<k;w++){if(await X()){console.error("Serena server is ready!");return}await new Promise((X$)=>setTimeout(X$,JO))}console.error("Timed out waiting for Serena server to start."),process.exit(1)}function q(M,W){let E=new URL(I),C={"Content-Type":"application/json",Accept:"application/json, text/event-stream","Content-Length":String(Buffer.byteLength(M))};if(G)C["Mcp-Session-Id"]=G;let k={hostname:E.hostname,port:E.port,path:E.pathname,method:"POST",headers:C},w=U.request(k,W);w.on("error",(X$)=>{console.error("POST error:",X$.message)}),w.write(M),w.end()}function Q(M,W){let E="";M.on("data",(C)=>{E+=C.toString(),E=E.replace(/\r\n/g,`
|
|
365
365
|
`);let k=E.split(`
|
|
366
366
|
|
|
367
|
-
`);E=k.pop()||"";for(let w of k){let
|
|
368
|
-
`),t="";for(let
|
|
369
|
-
`)}),C.on("end",()=>{if(J=!1,!z)console.error("Server stream closed, reconnecting..."),setTimeout(Y,1000)}),C.on("error",(k)=>{if(J=!1,console.error("Server stream error:",k.message),!z)setTimeout(Y,1000)})});E.on("error",(C)=>{if(J=!1,console.error("Server stream connection error:",C.message),!z)setTimeout(Y,1000)}),E.end()}if(
|
|
370
|
-
`);H=
|
|
371
|
-
`)}),k.on("end",()=>{if(E){if(v=!1,G)Y();B()}});else{let t="";k.on("data",(
|
|
372
|
-
`);if(E){if(v=!1,G)Y();B()}})}})}catch(
|
|
367
|
+
`);E=k.pop()||"";for(let w of k){let X$=w.split(`
|
|
368
|
+
`),t="";for(let l of X$)if(l.startsWith("data:"))t+=l.slice(5).trim();if(t)W(t)}})}function Y(){if(!G||J)return;J=!0;let M=new URL(I),W={hostname:M.hostname,port:M.port,path:M.pathname,method:"GET",headers:{Accept:"application/json, text/event-stream","Cache-Control":"no-cache","Mcp-Session-Id":G}},E=U.request(W,(C)=>{if(C.statusCode===405){C.resume(),J=!1;return}if(C.statusCode===409){console.error("GET stream already open for this session (409)"),C.resume();return}if(C.statusCode!==200){if(console.error(`Server stream connection failed: ${C.statusCode}`),C.resume(),J=!1,!z)setTimeout(Y,1000);return}Q(C,(k)=>{process.stdout.write(`${k}
|
|
369
|
+
`)}),C.on("end",()=>{if(J=!1,!z)console.error("Server stream closed, reconnecting..."),setTimeout(Y,1000)}),C.on("error",(k)=>{if(J=!1,console.error("Server stream error:",k.message),!z)setTimeout(Y,1000)})});E.on("error",(C)=>{if(J=!1,console.error("Server stream connection error:",C.message),!z)setTimeout(Y,1000)}),E.end()}if(ww(),!await X())await N();else console.error(`Connected to existing Serena server at ${I}`);let H="",v=!1,T=[];process.stdin.setEncoding("utf8");let K=(M)=>{H+=M.toString();let W=H.split(`
|
|
370
|
+
`);H=W.pop()||"";for(let E of W)if(E.trim())D(E.trim())};process.stdin.on("data",K);function D(M){if(v){T.push(M);return}R(M)}function B(){while(T.length>0){let M=T.shift();if(M)R(M)}}function R(M){try{let W=JSON.parse(M),E=W.method==="initialize";if(E)v=!0;let C=JSON.stringify(W);q(C,(k)=>{let w=k.headers["mcp-session-id"];if(w)G=w;if(k.statusCode===202){if(k.resume(),E)v=!1,B();return}if((k.headers["content-type"]||"").includes("text/event-stream"))Q(k,(t)=>{process.stdout.write(`${t}
|
|
371
|
+
`)}),k.on("end",()=>{if(E){if(v=!1,G)Y();B()}});else{let t="";k.on("data",(l)=>{t+=l.toString()}),k.on("end",()=>{if(t.trim())process.stdout.write(`${t}
|
|
372
|
+
`);if(E){if(v=!1,G)Y();B()}})}})}catch(W){let E=W instanceof Error?W.message:String(W);console.error("Failed to parse IDE message:",E)}}process.stdin.resume();let V=()=>{if(z=!0,XO(),g)console.error("Stopping Serena server..."),g.kill("SIGTERM");process.exit(0)};P6={stdinData:K,sigint:V,sigterm:V},process.on("SIGINT",V),process.on("SIGTERM",V)}U4();var u4=O$(Z$(),1);import{existsSync as a4,readdirSync as TI,readFileSync as Xq,rmSync as NO}from"node:fs";import{tmpdir as Ew}from"node:os";import{join as x$}from"node:path";async function Cw($,I,_){let u=x$($,".gemini","antigravity"),U=x$(u,"brain"),g=x$(u,"implicit"),z=x$(u,"knowledge"),G=a4(U),J=a4(g),X=a4(z);if(!G&&!J&&!X)return{shouldCleanupBrain:!1,shouldCleanupImplicit:!1,shouldCleanupKnowledge:!1};if(I)return{shouldCleanupBrain:G,shouldCleanupImplicit:J,shouldCleanupKnowledge:X};let N=[G&&" - brain",J&&" - implicit",X&&" - knowledge"].filter(Boolean).join(`
|
|
373
373
|
`),q=_?!0:await f$({message:`Clean up IDE garbage?
|
|
374
|
-
${N}`,initialValue:!0});if(
|
|
375
|
-
`).filter((B)=>B.trim()),
|
|
376
|
-
`);
|
|
377
|
-
`);if(
|
|
378
|
-
`),"CLI Status"),Q.length>0)
|
|
379
|
-
`),"Install missing CLIs");if(U.length>0){let
|
|
380
|
-
`);
|
|
381
|
-
`);
|
|
382
|
-
`),"Installed Skills")}catch(
|
|
383
|
-
${d.default.dim(`${q} memory files found`)}`,"Serena Memory");else
|
|
384
|
-
${d.default.dim("Dashboard will show 'No agents detected'")}`,"Serena Memory");if(z)if(G)
|
|
385
|
-
${d.default.dim("Run 'oh-my-agent' to install or reinstall")}`,"CLAUDE.md");if(O===0)p(d.default.green("✅ All checks passed! Ready to use."));else p(d.default.yellow(`⚠️ Found ${O} issue(s). See details above.`));if(
|
|
386
|
-
${d.default.dim("https://github.com/sponsors/first-fluke")}`,"Support");else
|
|
374
|
+
${N}`,initialValue:!0});if(J$(q)||!q)return{shouldCleanupBrain:!1,shouldCleanupImplicit:!1,shouldCleanupKnowledge:!1};return{shouldCleanupBrain:G,shouldCleanupImplicit:J,shouldCleanupKnowledge:X}}async function QO($=!1,I=!1,_=!1){let u=process.cwd(),U=x$(u,".agents","results"),g=Ew(),z={cleaned:0,skipped:0,details:[]},G=await Cw(u,I,_),J=(O)=>{z.details.push($?`[DRY-RUN] ${O}`:`[CLEAN] ${O}`),z.cleaned++},X=(O)=>{z.details.push(`[SKIP] ${O}`),z.skipped++},N=(O)=>{if($)return;try{NO(O,{force:!0})}catch{}},q=(O)=>{try{return process.kill(O,0),!0}catch{return!1}},Q=async(O)=>{if($)return;try{process.kill(O)}catch{}await new Promise((H)=>setTimeout(H,1000));try{if(q(O))process.kill(O,"SIGKILL")}catch{}};try{let O=TI(g).filter((H)=>H.startsWith("subagent-")&&H.endsWith(".pid"));for(let H of O){let v=x$(g,H),T=Xq(v,"utf-8").trim();if(!T){J(`Removing empty PID file: ${v}`),N(v);continue}let K=parseInt(T,10);if(Number.isNaN(K)){J(`Removing invalid PID file: ${v}`),N(v);continue}if(q(K))J(`Killing orphaned process PID=${K} (from ${v})`),await Q(K),N(v);else J(`Removing stale PID file (process gone): ${v}`),N(v)}}catch{}try{let O=TI(g).filter((H)=>H.startsWith("subagent-")&&H.endsWith(".log"));for(let H of O){let v=x$(g,H),T=H.replace(".log",".pid"),K=x$(g,T);if(a4(K))try{let D=Xq(K,"utf-8").trim(),B=parseInt(D,10);if(!Number.isNaN(B)){if(q(B)){X(`Log file has active process: ${v}`);continue}}}catch{}J(`Removing stale log file: ${v}`),N(v)}}catch{}if(a4(U))try{let O=TI(U).filter((H)=>H.startsWith("parallel-"));for(let H of O){let v=x$(U,H,"pids.txt");if(!a4(v))continue;let K=Xq(v,"utf-8").split(`
|
|
375
|
+
`).filter((B)=>B.trim()),D=!1;for(let B of K){let[R,V]=B.split(":"),M=parseInt(R?.trim()||"",10);if(Number.isNaN(M))continue;if(q(M))D=!0,J(`Killing orphaned parallel agent PID=${M} (${V?.trim()||"unknown"})`),await Q(M),N(v)}if(!D)J(`Removing stale PID list: ${v}`),N(v);else if(!$){await new Promise((B)=>setTimeout(B,1000));try{NO(v,{force:!0})}catch{}}}}catch{}else X(`No results directory found: ${U}`);if(G.shouldCleanupBrain||G.shouldCleanupImplicit||G.shouldCleanupKnowledge){let O=x$(u,".gemini","antigravity");if(G.shouldCleanupBrain){let H=x$(O,"brain");try{if(a4(H)){let v=TI(H);for(let T of v){let K=x$(H,T);J(`Removing brain file: ${K}`),N(K)}}}catch{}}if(G.shouldCleanupImplicit){let H=x$(O,"implicit");try{if(a4(H)){let v=TI(H);for(let T of v){let K=x$(H,T);J(`Removing implicit file: ${K}`),N(K)}}}catch{}}if(G.shouldCleanupKnowledge){let H=x$(O,"knowledge");try{if(a4(H)){let v=TI(H);for(let T of v){let K=x$(H,T);J(`Removing knowledge file: ${K}`),N(K)}}}catch{}}}if(I){console.log(JSON.stringify(z,null,2));return}if(console.clear(),L$(u4.default.bgMagenta(u4.default.white(" \uD83E\uDDF9 oh-my-agent cleanup "))),$)i(u4.default.yellow("Dry-run mode — no changes will be made"),"Mode");if(z.details.length>0){let O=[u4.default.bold("Cleanup Details"),...z.details.map((H)=>{if(H.startsWith("[DRY-RUN]"))return u4.default.yellow(H);if(H.startsWith("[CLEAN]"))return u4.default.green(H);return u4.default.cyan(H)})].join(`
|
|
376
|
+
`);i(O,"Details")}let Y=[u4.default.bold("Summary"),"┌─────────┬────────┐",`│ ${u4.default.bold("Action")} │ ${u4.default.bold("Count")} │`,"├─────────┼────────┤",`│ Cleaned │ ${String(z.cleaned).padEnd(6)} │`,`│ Skipped │ ${String(z.skipped).padEnd(6)} │`,"└─────────┴────────┘"].join(`
|
|
377
|
+
`);if(i(Y,"Results"),$)p(u4.default.yellow("Run without --dry-run to apply changes"));else p(u4.default.green("Cleanup complete!"))}U4();var d=O$(Z$(),1);import{execSync as fw}from"node:child_process";import{existsSync as MI,readdirSync as xw,readFileSync as HO}from"node:fs";import{join as e0}from"node:path";async function O2($,I,_){try{let u=fw(`${I} --version`,{encoding:"utf-8",stdio:["pipe","pipe","ignore"]}).trim();return{name:$,installed:!0,version:u,installCmd:_}}catch{return{name:$,installed:!1,installCmd:_}}}async function kw($){let I=process.env.HOME||process.env.USERPROFILE||"",u={gemini:{path:`${I}/.gemini/settings.json`,type:"json"},claude:{path:`${I}/.claude.json`,type:"json"},codex:{path:`${I}/.codex/config.toml`,type:"toml"}}[$];if(!u)return{configured:!1};if(MI(u.path))try{let U=HO(u.path,"utf-8");if(u.type==="json"){let g=JSON.parse(U);return{configured:!!(g.mcpServers||g.mcp),path:u.path}}return{configured:!0,path:u.path}}catch{return{configured:!1}}return{configured:!1}}async function yw(){let $=e0(process.cwd(),d$);if(!MI($))return[];let I=YI(),_=[];for(let u of I){let U=e0($,u.name),g=e0(U,"SKILL.md");_.push({name:u.name,installed:MI(U),hasSkillMd:MI(g)})}return _}async function YO($=!1){let I=process.cwd(),_=await Promise.all([O2("gemini","gemini","bun install --global @google/gemini-cli"),O2("claude","claude","bun install --global @anthropic-ai/claude-code"),O2("codex","codex","bun install --global @openai/codex"),O2("qwen","qwen","bun install --global @qwen-code/qwen-code")]),u={gemini:zq,claude:gq,codex:Gq,qwen:Jq},U=await Promise.all(_.filter((v)=>v.installed).map(async(v)=>{let T=await kw(v.name);return{...v,mcp:T}})),g=await yw(),z=_.some((v)=>v.name==="claude"&&v.installed),G=!1,J=e0(I,"CLAUDE.md");try{if(MI(J))G=HO(J,"utf-8").includes("<!-- OMA:START")}catch{}let X=e0(I,".serena","memories"),N=MI(X),q=0;if(N)try{q=xw(X).length}catch{}let Q=_.filter((v)=>!v.installed),Y=g.length>0?g.filter((v)=>!v.installed||!v.hasSkillMd):YI().map((v)=>({name:v.name,installed:!1,hasSkillMd:!1})),O=Q.length+Y.length+(z&&!G?1:0);if($){let v={ok:O===0,issues:O,clis:_.map((T)=>({name:T.name,installed:T.installed,version:T.version||null,authenticated:T.installed?u[T.name]?.()??!1:!1})),mcp:U.map((T)=>({name:T.name,configured:T.mcp.configured,path:T.mcp.path||null})),skills:g.length>0?g.map((T)=>({name:T.name,installed:T.installed,complete:T.hasSkillMd})):[],missingSkills:Y.map((T)=>T.name),serena:{exists:N,fileCount:q},claudeMd:{hasOmaBlock:G}};console.log(JSON.stringify(v,null,2)),process.exit(O===0?0:1)}console.clear(),L$(d.default.bgMagenta(d.default.white(" \uD83E\uDE7A oh-my-agent doctor ")));let H=H4();try{let v=_.map((D)=>{let B=D.installed?d.default.green("✅"):d.default.red("❌"),R=D.version||"-",V=D.installed?u[D.name]?.()?d.default.green("✅"):d.default.red("❌"):d.default.dim("-");return`${B} ${D.name.padEnd(8)} ${R.padEnd(12)} ${V}`});if(i([`${"CLI".padEnd(11)} ${"Version".padEnd(12)} Auth`,...v].join(`
|
|
378
|
+
`),"CLI Status"),Q.length>0)i(Q.map((D)=>`${d.default.yellow("→")} ${D.name}: ${d.default.dim(D.installCmd)}`).join(`
|
|
379
|
+
`),"Install missing CLIs");if(U.length>0){let D=[d.default.bold("\uD83D\uDD17 MCP Connection Status"),"┌─────────┬──────────┬─────────────────────┐",`│ ${d.default.bold("CLI")} │ ${d.default.bold("MCP Config")} │ ${d.default.bold("Path")} │`,"├─────────┼──────────┼─────────────────────┤",...U.map((B)=>{let R=B.mcp.configured?d.default.green("✅ Configured"):d.default.yellow("⚠️ Not configured"),V=B.mcp.path?B.mcp.path.split("/").pop()||"":"-";return`│ ${B.name.padEnd(7)} │ ${R.padEnd(8)} │ ${V.padEnd(19)} │`}),"└─────────┴──────────┴─────────────────────┘"].join(`
|
|
380
|
+
`);i(D,"MCP Status")}let T=g.filter((D)=>D.installed).length,K=g.filter((D)=>D.hasSkillMd).length;if(g.length>0){let D=[d.default.bold(`\uD83D\uDCE6 Skills (${T}/${g.length} installed, ${K} complete)`),"┌────────────────────┬──────────┬─────────────┐",`│ ${d.default.bold("Skill")} │ ${d.default.bold("Installed")} │ ${d.default.bold("SKILL.md")} │`,"├────────────────────┼──────────┼─────────────┤",...g.map((B)=>{let R=B.installed?d.default.green("✅"):d.default.red("❌"),V=B.hasSkillMd?d.default.green("✅"):d.default.red("❌");return`│ ${B.name.padEnd(18)} │ ${R.padEnd(8)} │ ${V.padEnd(11)} │`}),"└────────────────────┴──────────┴─────────────┘"].join(`
|
|
381
|
+
`);i(D,"Skills Status")}else i(d.default.yellow("No skills installed."),"Skills Status");if(Y.length>0){let D=await f$({message:`Found ${Y.length} missing/incomplete skill(s). Install them?`,initialValue:!0});if(J$(D))c$("Cancelled."),process.exit(0);if(D){let B=Y.map((M)=>M.name),R=await A6({message:"Which skills to install?",options:[{value:"all",label:`✨ All (${B.length} skills)`,hint:"Recommended"},{value:"select",label:"\uD83D\uDD27 Select individually"}]});if(J$(R))c$("Cancelled."),process.exit(0);let V;if(R==="select"){let M=YI(),W=await d0({message:"Select skills to install:",options:Y.map((E)=>{let C=M.find((k)=>k.name===E.name);return{value:E.name,label:E.name,hint:C?.desc||""}}),required:!0});if(J$(W))c$("Cancelled."),process.exit(0);V=W}else V=B;H.start("Installing skills...");try{Q2(I,I);for(let M of V)H.message(`Installing ${d.default.cyan(M)}...`),N2(I,M,I);H.stop(`Installed ${V.length} skill(s)!`),i(V.map((M)=>`${d.default.green("✓")} ${M}`).join(`
|
|
382
|
+
`),"Installed Skills")}catch(M){H.stop("Installation failed"),U$.error(M instanceof Error?M.message:String(M))}}}if(N)i(`${d.default.green("✅")} Serena memory directory exists
|
|
383
|
+
${d.default.dim(`${q} memory files found`)}`,"Serena Memory");else i(`${d.default.yellow("⚠️")} Serena memory directory not found
|
|
384
|
+
${d.default.dim("Dashboard will show 'No agents detected'")}`,"Serena Memory");if(z)if(G)i(`${d.default.green("✅")} OMA block found in ./CLAUDE.md`,"CLAUDE.md");else i(`${d.default.yellow("⚠️")} OMA block missing in ./CLAUDE.md
|
|
385
|
+
${d.default.dim("Run 'oh-my-agent' to install or reinstall")}`,"CLAUDE.md");if(O===0)p(d.default.green("✅ All checks passed! Ready to use."));else p(d.default.yellow(`⚠️ Found ${O} issue(s). See details above.`));if(_O())i(`${d.default.green("⭐")} Thank you for starring oh-my-agent!
|
|
386
|
+
${d.default.dim("https://github.com/sponsors/first-fluke")}`,"Support");else i(`${d.default.yellow("❤️")} Enjoying oh-my-agent? Give it a star or sponsor!
|
|
387
387
|
${d.default.dim("gh api --method PUT /user/starred/first-fluke/oh-my-agent")}
|
|
388
|
-
${d.default.dim("https://github.com/sponsors/first-fluke")}`,"Support")}catch(v){if(H)H.stop("Check failed");U$.error(v instanceof Error?v.message:String(v)),process.exit(1)}}var
|
|
389
|
-
${
|
|
390
|
-
`);for(let U of u)console.log(` ${
|
|
391
|
-
${
|
|
392
|
-
`)}U4();var B$=
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
388
|
+
${d.default.dim("https://github.com/sponsors/first-fluke")}`,"Support")}catch(v){if(H)H.stop("Check failed");U$.error(v instanceof Error?v.message:String(v)),process.exit(1)}}var DI=O$(Z$(),1);var OO=["cursor"];async function vO($,I,_=!1){if(!OO.includes($))throw Error(`Unsupported format: ${$}. Supported: ${OO.join(", ")}`);let u=b6(I);if(u.length===0)throw Error("No rules found. Run `oma install` first.");if(_){console.log(JSON.stringify({format:$,exported:u,dir:".cursor/rules"},null,2));return}console.log(`
|
|
389
|
+
${DI.default.green("✓")} Exported ${DI.default.bold(String(u.length))} rules to ${DI.default.cyan(".cursor/rules")}/
|
|
390
|
+
`);for(let U of u)console.log(` ${DI.default.green("✓")} ${U}.mdc`);console.log(`
|
|
391
|
+
${DI.default.dim("Tip: Rules with globs auto-activate on matching files. Others are available via @rule-name in Cursor chat.")}
|
|
392
|
+
`)}U4();var B$=O$(Z$(),1);import{execSync as ZE}from"node:child_process";import{existsSync as IU,readdirSync as AE,readFileSync as j2,writeFileSync as Bq}from"node:fs";import{join as WI}from"node:path";var TO={cleanupPeriodDays:180,CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS:1e5,CLAUDE_AUTOCOMPACT_PCT_OVERRIDE:80,DISABLE_TELEMETRY:"1",DISABLE_ERROR_REPORTING:"1",CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY:"1",CLAUDE_CODE_DISABLE_AUTO_MEMORY:"1"},MO=["DISABLE_PROMPT_CACHING"],iw={commit:`Generated with oh-my-agent
|
|
393
|
+
|
|
394
|
+
Co-Authored-By: First Fluke <our.first.fluke@gmail.com>`,pr:"Generated with [oh-my-agent](https://github.com/first-fluke/oh-my-agent)"};function v2($){let I=$?.env;if(!I)return!0;for(let _ of MO)if(_ in I)return!0;for(let[_,u]of Object.entries(TO)){let U=I[_];if(typeof u==="number"){if((U??0)<u)return!0}else if(U!==u)return!0}if(!$.attribution?.commit||!$.attribution?.pr)return!0;return!1}function T2($){let I={...$.env||{},...TO};for(let _ of MO)delete I[_];return $.env=I,$.attribution={...iw},$}U4();var M2=O$(Z$(),1);import{execSync as DO}from"node:child_process";import{existsSync as o$,readFileSync as LI,rmSync as j6,writeFileSync as qq}from"node:fs";import{join as p$}from"node:path";function lw($){for(let I of[".omc",".omx"]){let _=p$($,I);if(o$(_))j6(_,{recursive:!0,force:!0})}}function mw($){let I=process.env.HOME||process.env.USERPROFILE||"",_=[],u=p$(I,".claude","CLAUDE.md"),U=!1;if(o$(u))try{U=LI(u,"utf-8").includes("OMC:START")}catch{}if(U)_.push({name:"omc",displayName:"oh-my-claudecode",uninstall:()=>{let G=p$(I,".claude");for(let q of["architect","document-specialist","explore","designer","writer","vision","critic","analyst","executor","planner"]){let Q=p$(G,"agents",`${q}.md`);if(o$(Q))j6(Q,{force:!0})}for(let q of["coordinator","omc","ultrawork","deepsearch","analyze","plan","review","planner","orchestrator","update"]){let Q=p$(G,"commands",`${q}.md`);if(o$(Q))j6(Q,{force:!0})}for(let q of["ultrawork","git-master","frontend-ui-ux"]){let Q=p$(G,"skills",q);if(!o$(Q))continue;let Y=p$(Q,"SKILL.md");if(o$(Y))try{if(LI(Y,"utf-8").includes(".agents/workflows/"))continue}catch{continue}j6(Q,{recursive:!0,force:!0})}for(let q of["keyword-detector.sh","silent-auto-update.sh","stop-continuation.sh"]){let Q=p$(G,"hooks",q);if(o$(Q))j6(Q,{force:!0})}for(let q of[".omc-version.json",".omc-silent-update.json",".omc-update.log",".omc-config.json"]){let Q=p$(G,q);if(o$(Q))j6(Q,{force:!0})}let J=p$($,".omc");if(o$(J))j6(J,{recursive:!0,force:!0});let X=p$(G,"settings.json");if(o$(X))try{let q=JSON.parse(LI(X,"utf-8"));if(q.hooks){for(let Q of Object.keys(q.hooks)){if(!Array.isArray(q.hooks[Q]))continue;if(q.hooks[Q]=q.hooks[Q].map((Y)=>{if(Array.isArray(Y.hooks))Y.hooks=Y.hooks.filter((O)=>!O.command||!(O.command.includes("keyword-detector.sh")||O.command.includes("silent-auto-update.sh")||O.command.includes("stop-continuation.sh")));return Y}).filter((Y)=>!Y.hooks||Y.hooks.length>0),q.hooks[Q].length===0)delete q.hooks[Q]}if(Object.keys(q.hooks).length===0)delete q.hooks;qq(X,`${JSON.stringify(q,null,2)}
|
|
395
|
+
`)}}catch{}let N=p$(G,"CLAUDE.md");if(o$(N))try{let q=LI(N,"utf-8");if(q.includes("OMC:START")){let Q=q.replace(/<!-- OMC:START[\s\S]*?OMC:END -->\n?/g,"");qq(N,Q)}}catch{}}});for(let G of["opencode.json","opencode.jsonc"]){let J=p$(I,".config","opencode",G);if(!o$(J))continue;try{let N=LI(J,"utf-8").replace(/\/\/.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"").replace(/,\s*([\]}])/g,"$1"),q=JSON.parse(N);if(Array.isArray(q.plugin)&&q.plugin.includes("oh-my-opencode")){_.push({name:"omo",displayName:"oh-my-opencode",uninstall:()=>{let Y=LI(J,"utf-8").replace(/\/\/.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"").replace(/,\s*([\]}])/g,"$1"),O=JSON.parse(Y);O.plugin=O.plugin.filter((H)=>H!=="oh-my-opencode"),qq(J,JSON.stringify(O,null,2))}});break}}catch{}}let g=p$(I,".agents","skills","superpowers"),z=p$(I,".codex","superpowers");if(o$(g)||o$(z))_.push({name:"superpowers",displayName:"superpowers",uninstall:()=>{for(let G of[g,z])if(o$(G))j6(G,{recursive:!0,force:!0})}});try{DO("npm ls -g oh-my-codex",{stdio:"pipe",timeout:1e4}),_.push({name:"omx",displayName:"oh-my-codex",uninstall:()=>{DO("npx -y oh-my-codex@latest uninstall --yes",{stdio:"pipe",timeout:60000})}})}catch{}return _}async function D2($){lw($);let I=mw($);if(I.length===0)return[];let _=I.map((z)=>z.name),u=await f$({message:`${M2.default.yellow(_.join(", "))} detected. Remove all?`,initialValue:!0});if(J$(u)||!u)return[];let U=[],g=H4();g.start("Removing competing tools...");for(let z of I)try{z.uninstall(),U.push(`${z.displayName} removed`)}catch(G){let J=G instanceof Error?G.message:String(G);U.push(`${z.displayName} removal failed: ${J}`)}return g.stop(U.map((z)=>z.includes("failed")?`${M2.default.red("✗")} ${z}`:`${M2.default.green("✓")} ${z}`).join(`
|
|
396
|
+
`)),U}var LO={enableNotifications:!0},BO={enableAgents:!0},nw={serena:{url:"http://localhost:12341/mcp"}};function L2($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var rw=new Set(["command","args","env","cwd","url","httpUrl","headers","tcp","type","timeout","trust","description","includeTools","excludeTools","extension","oauth","authProviderType","targetAudience","targetServiceAccount"]);function hw($){let I={};for(let[u,U]of Object.entries($)){if(U===void 0||U===null)continue;if(!rw.has(u))continue;I[u]=U}let _=$.available_tools;if(Array.isArray(_)&&I.includeTools===void 0)I.includeTools=_.map((u)=>String(u).trim()).filter(Boolean);return I}function KO($){if(!$)return!1;return typeof $.command==="string"||typeof $.url==="string"||typeof $.httpUrl==="string"||typeof $.tcp==="string"}function B2($){let I=WO($);if(I.mcpServers)I.mcpServers=Object.fromEntries(Object.entries(I.mcpServers).map(([_,u])=>[_,hw(u)]));return I}function WO($){if(!L2($))return{};let I=L2($.general)?$.general:void 0,_=L2($.experimental)?$.experimental:void 0,u=L2($.mcpServers)?$.mcpServers:void 0;return{...$,general:I,experimental:_,mcpServers:u}}function BI($){let I=WO($),_=B2($);if(JSON.stringify(I)!==JSON.stringify(_))return!0;let u=_.general;if(!u)return!0;for(let[z,G]of Object.entries(LO))if(u[z]!==G)return!0;let U=_.experimental;if(!U)return!0;for(let[z,G]of Object.entries(BO))if(U[z]!==G)return!0;let g=_.mcpServers?.serena;if(!KO(g))return!0;return!1}function S6($){let I=B2($),_=I.mcpServers?.serena,u=KO(_)?_:{..._||{},...nw.serena};return I.general={...I.general||{},...LO},I.experimental={...I.experimental||{},...BO},I.mcpServers={...I.mcpServers||{},serena:u},I}import{existsSync as KI,mkdirSync as cw,readFileSync as Nq,writeFileSync as RO}from"node:fs";import{dirname as dw,join as F6}from"node:path";async function K2($){let I=F6($,d$,"_version.json");if(!KI(I))return null;try{let _=Nq(I,"utf-8");return JSON.parse(_).version||null}catch{return null}}function Qq($){let I=F6($,d$,"_version.json");if(!KI(I))return!1;try{let _=Nq(I,"utf-8");return JSON.parse(_).needsReconcile===!0}catch{return!1}}function Hq($,I){let _=F6($,d$,"_version.json");if(!KI(_))return;try{let u=Nq(_,"utf-8"),U=JSON.parse(u);if(I)U.needsReconcile=!0;else delete U.needsReconcile;RO(_,JSON.stringify(U,null,2),"utf-8")}catch{}}function VO($){let I=F6($,d$);if(!KI(I))return!1;return[F6($,".agents","oma-config.yaml"),F6($,".agents","mcp.json"),F6($,".agents","workflows")].some((u)=>KI(u))}async function W2($,I){let _=F6($,d$,"_version.json"),u=dw(_);if(!KI(u))cw(u,{recursive:!0});RO(_,JSON.stringify({version:I},null,2),"utf-8")}async function ZO(){let $=`https://raw.githubusercontent.com/${W$}/main/prompt-manifest.json`,I=await fetch($);if(!I.ok)throw Error("Failed to fetch remote manifest");return await I.json()}import{existsSync as N1,mkdirSync as AO,readFileSync as PO,writeFileSync as R2}from"node:fs";import{homedir as ow}from"node:os";import{join as k4,resolve as bO}from"node:path";var Yq=k4(ow(),".serena","serena_config.yml"),jO={"oma-frontend":["typescript"],"oma-mobile":["dart"],"oma-tf-infra":["terraform"]},Oq={python:"python",node:"typescript",rust:"rust"};function SO($,I){let _=new Set;for(let u of $){let U=jO[u];if(U)for(let g of U)_.add(g)}if($.includes("oma-backend")&&I&&Oq[I])_.add(Oq[I]);if(_.size===0)_.add("typescript");return[..._]}function FO($){let I=new Set,_=k4($,".agents","skills");for(let[U,g]of Object.entries(jO))if(N1(k4(_,U)))for(let z of g)I.add(z);let u=k4(_,"oma-backend","stack","stack.yaml");if(N1(u))try{let g=PO(u,"utf-8").match(/^language:\s*(.+)$/m);if(g?.[1]){let z=g[1].trim(),G=Oq[z];if(G)I.add(G)}}catch{}else if(N1(k4(_,"oma-backend")))I.add("typescript");if(I.size===0)I.add("typescript");return[...I]}function pw($){let I=bO($);if(!N1(Yq))return!1;try{let _=PO(Yq,"utf-8"),u=_.match(/^(projects:\s*\n)((?:\s*-\s*.+\n?)*)/m);if(!u)return!1;if(((u[2]??"").match(/^\s*-\s*(.+)$/gm)||[]).map((X)=>bO(X.replace(/^\s*-\s*/,"").trim())).includes(I))return!1;let z=(u.index??0)+u[0].length,G=`- ${I}
|
|
397
|
+
`,J=_.slice(0,z)+G+_.slice(z);return R2(Yq,J),!0}catch{return!1}}var tw=($,I)=>`languages:
|
|
396
398
|
${$.map((_)=>`- ${_}`).join(`
|
|
397
399
|
`)}
|
|
398
400
|
|
|
@@ -413,52 +415,57 @@ read_only_memory_patterns: []
|
|
|
413
415
|
line_ending:
|
|
414
416
|
ignored_memory_patterns: []
|
|
415
417
|
ls_specific_settings: {}
|
|
416
|
-
`;function
|
|
417
|
-
`);let z=k4(_,"memories");
|
|
418
|
-
`),I.push("~/.claude/CLAUDE.md: OMA block removed (migrated to local ./CLAUDE.md)");return I}};import{existsSync as
|
|
419
|
-
`),J)I.push(".gemini/settings.json (Gemini CLI compatibility updated)");if(g)I.push(".gemini/settings.json hooks (Gemini matcher/timeout normalized)");return I}};var
|
|
420
|
-
`),"Migration");await
|
|
421
|
-
`)}
|
|
422
|
-
`)
|
|
423
|
-
`),"
|
|
424
|
-
`):"
|
|
425
|
-
`)
|
|
418
|
+
`;function aw($,I){let _=k4($,".serena"),u=k4(_,"project.yml");if(N1(u))return!1;let U=$.split("/").pop()||$.split("\\").pop()||"project";AO(_,{recursive:!0}),R2(u,tw(I,U));let g=k4(_,".gitignore");if(!N1(g))R2(g,`/cache
|
|
419
|
+
`);let z=k4(_,"memories");AO(z,{recursive:!0});let G=k4(z,".gitkeep");if(!N1(G))R2(G,"");return!0}function V2($,I){let _=aw($,I),u=pw($);return{configured:_,registered:u}}import{execSync as ew}from"node:child_process";import{mkdtempSync as sw,rmSync as vq,writeFileSync as $E}from"node:fs";import{tmpdir as IE}from"node:os";import{join as wO}from"node:path";async function Z2(){let $=sw(wO(IE(),"oh-my-agent-"));try{let I=`https://api.github.com/repos/${W$}/tarball/main`,_=await fetch(I,{headers:{"User-Agent":"oh-my-agent-cli"}});if(!_.ok)throw Error(`HTTP ${_.status}`);let u=wO($,"repo.tar.gz");$E(u,Buffer.from(await _.arrayBuffer())),ew(`tar -xzf "${u}" -C "${$}" --strip-components=1`,{stdio:"pipe",timeout:30000}),vq(u)}catch(I){throw vq($,{recursive:!0,force:!0}),Error(`Failed to download repository archive: ${I instanceof Error?I.message:I}`)}return{dir:$,cleanup:()=>vq($,{recursive:!0,force:!0})}}import{existsSync as k$,lstatSync as EO,readdirSync as Tq,renameSync as A2,rmSync as b2,unlinkSync as CO}from"node:fs";import{join as O4}from"node:path";var UE={"backend-agent":"oma-backend","db-agent":"oma-db","debug-agent":"oma-debug","frontend-agent":"oma-frontend","mobile-agent":"oma-mobile","pm-agent":"oma-pm","qa-agent":"oma-qa","tf-infra-agent":"oma-tf-infra",brainstorm:"oma-brainstorm",commit:"oma-commit",orchestrator:"oma-orchestrator","dev-workflow":"oma-dev-workflow",translator:"oma-translator","workflow-guide":"oma-coordination"},_E={"backend-impl.md":"backend-engineer.md","db-impl.md":"db-engineer.md","frontend-impl.md":"frontend-engineer.md","mobile-impl.md":"mobile-engineer.md"},fO={name:"001-agents-dir",up($){let I=[],_=O4($,".agent"),u=O4($,".agents");if(k$(_)&&!k$(u))A2(_,u),I.push(".agent/ → .agents/ (renamed)");else if(k$(_)&&k$(u))try{let z=Tq(_);for(let G of z){let J=O4(_,G),X=O4(u,G);if(!k$(X))A2(J,X),I.push(`.agent/${G} → .agents/${G} (merged)`)}b2(_,{recursive:!0,force:!0}),I.push(".agent/ (removed after merge)")}catch{}for(let z of[".cursor/skills"]){let G=O4($,z);if(!k$(G))continue;try{if(EO(G).isSymbolicLink())CO(G),I.push(`${z} (removed symlink)`);else{let X=Tq(G),N=0;for(let Q of X){let Y=O4(G,Q);if(EO(Y).isSymbolicLink())CO(Y),N++}if(Tq(G).length===0)b2(G,{recursive:!0}),I.push(`${z} (removed ${N} symlinks, cleaned dir)`);else if(N>0)I.push(`${z} (removed ${N} symlinks)`)}}catch{}}let U=O4($,".agents","skills");if(k$(U))for(let[z,G]of Object.entries(UE)){let J=O4(U,z),X=O4(U,G);if(k$(J)&&!k$(X))A2(J,X),I.push(`skills/${z} → skills/${G}`);else if(k$(J)&&k$(X))b2(J,{recursive:!0}),I.push(`skills/${z} (removed, replaced by ${G})`)}let g=O4($,".claude","agents");if(k$(g))for(let[z,G]of Object.entries(_E)){let J=O4(g,z),X=O4(g,G);if(k$(J)&&!k$(X))A2(J,X),I.push(`agents/${z} → agents/${G}`);else if(k$(J)&&k$(X))b2(J),I.push(`agents/${z} (removed, replaced by ${G})`)}return I}};import{existsSync as Mq,mkdirSync as xO,readdirSync as uE,readFileSync as kO,renameSync as gE,rmSync as yO,writeFileSync as zE}from"node:fs";import{dirname as iO,join as s0}from"node:path";var GE=[{from:".agents/skills/_shared/api-contracts/README.md",to:".agents/skills/_shared/core/api-contracts/README.md"},{from:".agents/skills/_shared/api-contracts/template.md",to:".agents/skills/_shared/core/api-contracts/template.md"},{from:".agents/skills/_shared/clarification-protocol.md",to:".agents/skills/_shared/core/clarification-protocol.md"},{from:".agents/skills/_shared/common-checklist.md",to:".agents/skills/_shared/core/common-checklist.md"},{from:".agents/skills/_shared/context-budget.md",to:".agents/skills/_shared/core/context-budget.md"},{from:".agents/skills/_shared/context-loading.md",to:".agents/skills/_shared/core/context-loading.md"},{from:".agents/skills/_shared/difficulty-guide.md",to:".agents/skills/_shared/core/difficulty-guide.md"},{from:".agents/skills/_shared/lessons-learned.md",to:".agents/skills/_shared/core/lessons-learned.md"},{from:".agents/skills/_shared/prompt-structure.md",to:".agents/skills/_shared/core/prompt-structure.md"},{from:".agents/skills/_shared/quality-principles.md",to:".agents/skills/_shared/core/quality-principles.md"},{from:".agents/skills/_shared/reasoning-templates.md",to:".agents/skills/_shared/core/reasoning-templates.md"},{from:".agents/skills/_shared/session-metrics.md",to:".agents/skills/_shared/core/session-metrics.md"},{from:".agents/skills/_shared/skill-routing.md",to:".agents/skills/_shared/core/skill-routing.md"},{from:".agents/skills/_shared/experiment-ledger.md",to:".agents/skills/_shared/conditional/experiment-ledger.md"},{from:".agents/skills/_shared/exploration-loop.md",to:".agents/skills/_shared/conditional/exploration-loop.md"},{from:".agents/skills/_shared/quality-score.md",to:".agents/skills/_shared/conditional/quality-score.md"},{from:".agents/skills/_shared/memory-protocol.md",to:".agents/skills/_shared/runtime/memory-protocol.md"},{from:".agents/skills/_shared/execution-protocols/claude.md",to:".agents/skills/_shared/runtime/execution-protocols/claude.md"},{from:".agents/skills/_shared/execution-protocols/codex.md",to:".agents/skills/_shared/runtime/execution-protocols/codex.md"},{from:".agents/skills/_shared/execution-protocols/gemini.md",to:".agents/skills/_shared/runtime/execution-protocols/gemini.md"},{from:".agents/skills/_shared/execution-protocols/qwen.md",to:".agents/skills/_shared/runtime/execution-protocols/qwen.md"},{from:".agents/skills/_shared/multi-review-protocol.md",to:".agents/workflows/ultrawork/resources/multi-review-protocol.md"},{from:".agents/skills/_shared/phase-gates.md",to:".agents/workflows/ultrawork/resources/phase-gates.md"}],JE=[".agents/skills/_shared/api-contracts",".agents/skills/_shared/execution-protocols"];function XE($,I){let _=I.replace(/^\.agents\//,"");return s0($,".agents",".migration-backup","shared-layout-v2",_)}function qE($){return s0(".agents",".migration-backup","shared-layout-v2",$.replace(/^\.agents\//,""))}var lO={name:"002-shared-layout",up($){let I=[];for(let _ of GE){let u=s0($,_.from),U=s0($,_.to);if(!Mq(u))continue;if(!Mq(U)){xO(iO(U),{recursive:!0}),gE(u,U),I.push(`${_.from} → ${_.to}`);continue}let g=kO(u,"utf-8"),z=kO(U,"utf-8");if(g!==z){let G=XE($,_.from),J=qE(_.from);xO(iO(G),{recursive:!0}),zE(G,g,"utf-8"),I.push(`${_.from} → ${J} (backup)`)}yO(u,{force:!0}),I.push(`${_.from} (removed legacy path)`)}for(let _ of JE){let u=s0($,_);if(!Mq(u))continue;try{if(uE(u).length===0)yO(u,{recursive:!0,force:!0}),I.push(`${_} (removed empty dir)`)}catch{}}return I}};import{cpSync as NE,existsSync as mO,readdirSync as QE,rmSync as nO}from"node:fs";import{join as Dq}from"node:path";var rO={name:"003-oma-config",up($){let I=[],_=Dq($,".agents","config","user-preferences.yaml"),u=Dq($,".agents","oma-config.yaml");if(mO(_)){NE(_,u,{force:!0}),nO(_),I.push(".agents/config/user-preferences.yaml → .agents/oma-config.yaml");let U=Dq($,".agents","config");if(mO(U)&&QE(U).length===0)nO(U,{recursive:!0}),I.push(".agents/config/ (removed empty dir)")}return I}};import{existsSync as HE,readFileSync as YE,rmSync as OE,writeFileSync as vE}from"node:fs";import{join as TE}from"node:path";var ME="<!-- OMA:START",hO="<!-- OMA:END -->",cO={name:"004-claude-md-local",up($){let I=[],_=process.env.HOME||process.env.USERPROFILE||"";if(!_)return I;let u=TE(_,".claude","CLAUDE.md");if(!HE(u))return I;let U=YE(u,"utf-8"),g=U.indexOf(ME),z=U.indexOf(hO);if(g===-1||z===-1)return I;let G=U.slice(0,g),J=U.slice(z+hO.length),X=`${G}${J}`.trim();if(X.length===0)OE(u),I.push("~/.claude/CLAUDE.md removed (OMA block was only content)");else vE(u,`${X}
|
|
420
|
+
`),I.push("~/.claude/CLAUDE.md: OMA block removed (migrated to local ./CLAUDE.md)");return I}};import{existsSync as Lq,renameSync as DE,rmSync as dO}from"node:fs";import{join as P2}from"node:path";var oO={name:"005-rename-oma-scm",up($){let I=[],_=P2($,".agents","skills"),u=P2(_,"oma-commit"),U=P2(_,"oma-scm"),g=P2($,".agents","workflows","commit.md");if(Lq(g))dO(g,{force:!0}),I.push("workflows/commit.md (removed legacy workflow)");if(!Lq(u))return I;if(!Lq(U))return DE(u,U),I.push("skills/oma-commit → skills/oma-scm"),I;return dO(u,{recursive:!0,force:!0}),I.push("skills/oma-commit (removed, replaced by oma-scm)"),I}};import{existsSync as LE,readFileSync as BE,writeFileSync as KE}from"node:fs";import{join as WE}from"node:path";function $U($){return typeof $==="object"&&$!==null&&!Array.isArray($)}function RE($){let I=!1,_=$.hooks;if(!$U(_))return!1;let u=_.BeforeTool;if(!Array.isArray(u))return!1;for(let U of u){if(!$U(U))continue;if(U.matcher==="Bash")U.matcher="run_shell_command",I=!0;let g=U.hooks;if(!Array.isArray(g))continue;for(let z of g){if(!$U(z))continue;if(z.name===void 0&&typeof z.command==="string"){if(z.command.includes("test-filter.ts"))z.name="test-filter",I=!0}if(typeof z.timeout==="number"&&z.timeout>0&&z.timeout<1000)z.timeout=z.timeout*1000,I=!0}}for(let U of["BeforeAgent","AfterAgent"]){let g=_[U];if(!Array.isArray(g))continue;for(let z of g){if(!$U(z))continue;let G=z.hooks;if(!Array.isArray(G))continue;for(let J of G){if(!$U(J))continue;if(J.name===void 0&&typeof J.command==="string"){if(J.command.includes("keyword-detector.ts"))J.name="keyword-detector",I=!0;if(J.command.includes("persistent-mode.ts"))J.name="persistent-mode",I=!0}if(typeof J.timeout==="number"&&J.timeout>0&&J.timeout<1000)J.timeout=J.timeout*1000,I=!0}}}return I}var pO={name:"006-gemini-cli-compat",up($){let I=[],_=WE($,".gemini","settings.json");if(!LE(_))return I;let u;try{u=JSON.parse(BE(_,"utf-8"))}catch{return I}let U=B2(u),g=RE(U),z=JSON.stringify(U),G=S6(U),J=z!==JSON.stringify(G);if(!J&&!g)return I;if(KE(_,`${JSON.stringify(G,null,2)}
|
|
421
|
+
`),J)I.push(".gemini/settings.json (Gemini CLI compatibility updated)");if(g)I.push(".gemini/settings.json hooks (Gemini matcher/timeout normalized)");return I}};var VE=[fO,lO,rO,cO,oO,pO];function Q1($){let I=[];for(let _ of VE)I.push(..._.up($));return I}var bE={en:"English",ko:"한국어",ja:"日本語",zh:"中文",vi:"Tiếng Việt",de:"Deutsch",es:"Español",fr:"Français",nl:"Nederlands",pl:"Polski",pt:"Português",ru:"Русский"};function PE($){let I=WI($,"docs"),_=["en"];if(IU(I))for(let u of AE(I)){let U=u.match(/^README\.(.+)\.md$/);if(U?.[1])_.push(U[1])}return _.map((u)=>({value:u,label:bE[u]??u}))}function jE($){let I=WI($,".agents","oma-config.yaml");if(!IU(I))return null;try{return j2(I,"utf-8").match(/^language:\s*([A-Za-z-]+)/m)?.[1]??null}catch{return null}}async function Kq(){console.clear(),L$(B$.default.bgMagenta(B$.default.white(" \uD83D\uDEF8 oh-my-agent ")));let $=Q1(process.cwd());if($.length>0)i($.map((T)=>`${B$.default.green("✓")} ${T}`).join(`
|
|
422
|
+
`),"Migration");await D2(process.cwd());let I=H4();I.start("Downloading...");let _,u;try{let T=await Z2();_=T.dir,u=T.cleanup}catch(T){I.stop("Download failed"),U$.error(T instanceof Error?T.message:String(T)),process.exit(1)}I.stop("Downloaded!");let U=PE(_),g=jE(process.cwd()),z=U.some((T)=>T.value===g)?g:"en",G=await A6({message:"Response language?",options:U,initialValue:z});if(J$(G))u(),c$("Cancelled."),process.exit(0);let J=await A6({message:"What type of project?",options:[{value:"all",label:"✨ All",hint:"Install everything"},{value:"fullstack",label:"\uD83C\uDF10 Fullstack",hint:"Frontend + Backend + PM + QA"},{value:"frontend",label:"\uD83C\uDFA8 Frontend",hint:"React/Next.js"},{value:"backend",label:"⚙️ Backend",hint:"Python, Node.js, Rust, ..."},{value:"mobile",label:"\uD83D\uDCF1 Mobile",hint:"Flutter/Dart"},{value:"devops",label:"\uD83D\uDE80 DevOps",hint:"Terraform + CI/CD + Workflows"},{value:"custom",label:"\uD83D\uDD27 Custom",hint:"Choose skills"}]});if(J$(J))c$("Cancelled."),process.exit(0);let X;if(J==="custom"){let T=YI(),K=await d0({message:"Select skills:",options:T.map((D)=>({value:D.name,label:D.name,hint:D.desc})),required:!0});if(J$(K))c$("Cancelled."),process.exit(0);X=K}else X=xY[J]??[];let N=process.cwd(),q={};if(X.includes("oma-backend")){let T=await A6({message:"Backend language?",options:[{value:"python",label:"\uD83D\uDC0D Python",hint:"FastAPI/SQLAlchemy (default)"},{value:"node",label:"\uD83D\uDFE2 Node.js",hint:"NestJS/Hono + Prisma/Drizzle"},{value:"rust",label:"\uD83E\uDD80 Rust",hint:"Axum/Actix-web"},{value:"other",label:"\uD83D\uDD27 Other / Auto-detect",hint:"Configure later with /stack-set"}],initialValue:"python"});if(J$(T))c$("Cancelled."),process.exit(0);if(T!=="other")q["oma-backend"]=T}let Q=[{value:"claude",label:"Claude Code",hint:"hooks + settings + CLAUDE.md"},{value:"codex",label:"Codex CLI",hint:"hooks + plugin"},{value:"copilot",label:"GitHub Copilot",hint:"skill symlinks"},{value:"cursor",label:"Cursor",hint:".cursor/rules/ export + prompt hooks"},{value:"gemini",label:"Gemini CLI",hint:"hooks + Serena MCP"},{value:"qwen",label:"Qwen Code",hint:"hooks + settings"}],Y=await d0({message:"CLI tools to configure:",options:Q,initialValues:Q.map((T)=>T.value),required:!0});if(J$(Y))c$("Cancelled."),process.exit(0);let O=Y,H=O.filter((T)=>T!=="copilot"),v=[];if(O.includes("claude"))v.push("claude");if(O.includes("copilot"))v.push("copilot");I.start("Installing skills...");try{try{Q2(_,N),$O(_,N),IO(_,N),UO(_,N);for(let V of X)I.message(`Installing ${B$.default.cyan(V)}...`),N2(_,V,N,q[V]);if(I.stop("Skills installed!"),I.start("Installing vendor adaptations..."),HI(_,N,H),O.includes("claude")){let V=WI(N,".claude","settings.json"),M={};if(IU(V))try{M=JSON.parse(j2(V,"utf-8"))}catch{M={}}if(v2(M))T2(M),Bq(V,`${JSON.stringify(M,null,2)}
|
|
423
|
+
`)}if(O.includes("gemini")){let V=WI(N,".gemini","settings.json"),M={};if(IU(V))try{M=JSON.parse(j2(V,"utf-8"))}catch{M={}}if(BI(M))S6(M),Bq(V,`${JSON.stringify(M,null,2)}
|
|
424
|
+
`)}I.stop("Vendor adaptations installed!");let D=WI(N,".agents","oma-config.yaml");if(IU(D)){let V=j2(D,"utf-8");Bq(D,V.replace(/^language:\s*.+$/m,`language: ${G}`)),sY(N,O)}let B=await K2(_);if(B)await W2(N,B);let R=Q1(N);if(R.length>0)i(R.map((V)=>`${B$.default.green("✓")} ${V}`).join(`
|
|
425
|
+
`),"Migration")}finally{u()}let T=vI(N,v,X);if(i([...X.map((D)=>`${B$.default.green("✓")} ${D}`),"",B$.default.dim(`Location: ${WI(N,d$)}`),...T.created.length>0?["",B$.default.cyan("Symlinks:"),...T.created.map((D)=>`${B$.default.green("→")} ${D}`)]:[],...T.skipped.length>0?["",B$.default.dim("Skipped:"),...T.skipped.map((D)=>B$.default.dim(` ${D}`))]:[]].join(`
|
|
426
|
+
`),"Installed"),O.includes("cursor")){OI(N);let D=b6(N);if(D.length>0)U$.success(B$.default.green(`Cursor rules exported (${D.length} rules → .cursor/rules/)`))}let K=new Set;for(let D of["claude","gemini","codex","cursor","qwen"]){if(!O.includes(D))continue;let B=D==="claude"?"CLAUDE.md":D==="gemini"?"GEMINI.md":"AGENTS.md";if(K.has(B))continue;if(NI(N,D))K.add(B),U$.success(B$.default.green(`oma guide merged into ${B}`))}{let D=SO(X,q["oma-backend"]),{configured:B,registered:R}=V2(N,D);if(B)U$.success(B$.default.green(`Serena project configured (${D.join(", ")})`));if(R)U$.success(B$.default.green("Project registered in Serena"))}if(U$.info(B$.default.dim("Skipped global HOME-level configuration updates.")),p(B$.default.green("Done! Open your project in your IDE to use the skills.")),J1()&&x4()&&!X1()){let D=await f$({message:`${B$.default.yellow("⭐")} Star ${B$.default.cyan(W$)} on GitHub? It helps a lot!`});if(!J$(D)&&D)try{ZE(`gh api -X PUT /user/starred/${W$}`,{stdio:"ignore"}),U$.success(`Starred ${B$.default.cyan(W$)}! Thank you! \uD83C\uDF1F`)}catch{U$.warn(`Could not star automatically. Try: ${B$.default.dim(`gh api --method PUT /user/starred/${W$}`)}`)}}}catch(T){I.stop("Installation failed"),U$.error(T instanceof Error?T.message:String(T)),process.exit(1)}}var e4=O$(Z$(),1);import{existsSync as tO,readFileSync as SE,writeFileSync as FE}from"node:fs";import{join as aO}from"node:path";function eO($){let I=process.cwd();if(!tO(aO(I,".agents"))){console.error(`${e4.default.red("✗")} No .agents/ directory found. Run ${e4.default.cyan("oma install")} first.`),process.exitCode=1;return}let _;if($&&$.length>0)_=$;else _=q2(I);let u=_.filter((G)=>G!=="copilot");if(u.length===0){console.log(`${e4.default.yellow("⚠")} No vendors to link.`);return}if(console.log(`${e4.default.blue("●")} Linking vendors: ${u.map((G)=>e4.default.cyan(G)).join(", ")}`),HI(I,I,u),_.includes("gemini")){let G=aO(I,".gemini","settings.json"),J={};if(tO(G))try{J=JSON.parse(SE(G,"utf-8"))}catch{J={}}if(BI(J))S6(J),FE(G,`${JSON.stringify(J,null,2)}
|
|
427
|
+
`)}if(_.includes("cursor"))OI(I),b6(I);let U=new Set;for(let G of["claude","gemini","codex","cursor","qwen"]){if(!_.includes(G))continue;let J=G==="claude"?"CLAUDE.md":G==="gemini"?"GEMINI.md":"AGENTS.md";if(U.has(J))continue;if(NI(I,G))U.add(J)}let g=Y2(I);if(g.length>0){let G=H2(I);vI(I,g,G)}let z=[];for(let G of u)z.push(`${e4.default.green("✓")} ${G}`);if(U.size>0)z.push(`${e4.default.green("✓")} docs: ${[...U].join(", ")}`);console.log(z.join(`
|
|
428
|
+
`)),console.log(`
|
|
429
|
+
${e4.default.green("✓")} Linked ${u.length} vendor(s).`)}U4();i0();var s4=O$(Z$(),1);async function sO($=!1,I=!1){let _=process.cwd(),u=aH(_,{force:I});if($){console.log(JSON.stringify(u,null,2));return}console.clear(),L$(s4.default.bgMagenta(s4.default.white(" \uD83E\uDDE0 oh-my-agent memory:init ")));let U=[`Memories dir: ${s4.default.cyan(u.memoriesDir)}`,`Session ID: ${s4.default.cyan(u.sessionId)}`,"",s4.default.bold("Created:"),u.created.length>0?u.created.map((g)=>` + ${g}`).join(`
|
|
430
|
+
`):" (none)","",s4.default.bold("Updated:"),u.updated.length>0?u.updated.map((g)=>` ~ ${g}`).join(`
|
|
431
|
+
`):" (none)","",s4.default.bold("Skipped:"),u.skipped.length>0?u.skipped.map((g)=>` - ${g}`).join(`
|
|
426
432
|
`):" (none)"].join(`
|
|
427
|
-
`);
|
|
428
|
-
`))if(G.startsWith("COMMIT:")){if(z?.hash)g.push({hash:z.hash,author:z.author||"",email:z.email||"",timestamp:z.timestamp||0,subject:z.subject||"",insertions:z.insertions||0,deletions:z.deletions||0});let J=G.slice(7).split("|");z={hash:J[0],author:J[1],email:J[2],timestamp:parseInt(J[3]||"0",10),subject:J.slice(4).join("|"),insertions:0,deletions:0}}else if(z&&G.trim()){let J=G.match(/(\d+) insertions?\(\+\)/),X=G.match(/(\d+) deletions?\(-\)/);if(J)z.insertions=parseInt(J[1]||"0",10);if(X)z.deletions=parseInt(X[1]||"0",10)}if(z?.hash)g.push({hash:z.hash,author:z.author||"",email:z.email||"",timestamp:z.timestamp||0,subject:z.subject||"",insertions:z.insertions||0,deletions:z.deletions||0});return g}function
|
|
429
|
-
`))if(G.startsWith("COMMIT:"))z=G.slice(7).split("|")[1]||"";else if(G.trim()&&z){let J=G.split("\t");if(J.length>=3){let X=parseInt(J[0]||"0",10),N=parseInt(J[1]||"0",10);if(!Number.isNaN(X)&&!Number.isNaN(N)&&J[2])g.push({file:J[2],insertions:X,deletions:N,author:z})}}return g}function
|
|
430
|
-
`).filter(Boolean).map((z)=>{let G=z.trim().match(/^\s*(\d+)\s+(.+)$/);if(!G)return null;return{count:parseInt(G[1]||"0",10),file:G[2]||""}}).filter((z)=>z!==null)}function
|
|
431
|
-
`).filter(Boolean).sort().reverse(),z=new Date;z.setHours(0,0,0,0);let G=0,J=new Date(z);for(let X of g){let[N=0,q=0,Q=0]=X.split("-").map(Number),Y=new Date(N,q-1,Q);Y.setHours(0,0,0,0);let O=Math.round((J.getTime()-Y.getTime())/86400000);if(O===0)G++,J.setDate(J.getDate()-1);else if(O===1&&G===0)G++,J.setTime(Y.getTime()),J.setDate(J.getDate()-1);else break}return G}function
|
|
432
|
-
`):" (no commits)"}function
|
|
433
|
-
`)}function
|
|
434
|
-
`)}function
|
|
435
|
-
`)}function
|
|
436
|
-
`)}function
|
|
437
|
-
`)}function
|
|
438
|
-
`)}function
|
|
433
|
+
`);i(U,"Memory Schema"),p(s4.default.green("Memory schema ready!"))}U4();var V$=O$(Z$(),1);import{execSync as wE}from"node:child_process";import{existsSync as $v,mkdirSync as EE,readdirSync as Iv,readFileSync as CE,writeFileSync as fE}from"node:fs";import{join as Wq}from"node:path";function Rq($){if(!$)return{since:"7 days ago",label:"7d",days:7};let I=$.match(/^(\d+)(h|d|w)$/);if(!I)throw Error(`Invalid window: ${$}. Use: 24h, 7d, 14d, 30d, 2w`);let _=parseInt(I[1]||"0",10),u=I[2]||"";switch(u){case"h":return{since:`${_} hours ago`,label:`${_}h`,days:_/24};case"d":return{since:`${_} days ago`,label:`${_}d`,days:_};case"w":return{since:`${_*7} days ago`,label:`${_}w`,days:_*7};default:throw Error(`Invalid unit: ${u}`)}}function Uv($){let I=Rq($);return{current:I,previous:{since:`${I.days*2} days ago`,until:`${I.days} days ago`,label:I.label,days:I.days}}}function w6($,I){try{return wE(I,{cwd:$,encoding:"utf-8",stdio:["pipe","pipe","ignore"],maxBuffer:10485760}).trim()}catch{return""}}function _v($){w6($,"git fetch origin --quiet 2>/dev/null || true")}function uv($){return w6($,"git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's|refs/remotes/origin/||'")||"main"}function gv($){return w6($,"git config user.name")||"Unknown"}function zv($,I,_){let u=I.until?` --until="${I.until}"`:"",U=w6($,`git log ${_} --since="${I.since}"${u} --format="COMMIT:%H|%aN|%ae|%at|%s" --shortstat`);if(!U)return[];let g=[],z=null;for(let G of U.split(`
|
|
434
|
+
`))if(G.startsWith("COMMIT:")){if(z?.hash)g.push({hash:z.hash,author:z.author||"",email:z.email||"",timestamp:z.timestamp||0,subject:z.subject||"",insertions:z.insertions||0,deletions:z.deletions||0});let J=G.slice(7).split("|");z={hash:J[0],author:J[1],email:J[2],timestamp:parseInt(J[3]||"0",10),subject:J.slice(4).join("|"),insertions:0,deletions:0}}else if(z&&G.trim()){let J=G.match(/(\d+) insertions?\(\+\)/),X=G.match(/(\d+) deletions?\(-\)/);if(J)z.insertions=parseInt(J[1]||"0",10);if(X)z.deletions=parseInt(X[1]||"0",10)}if(z?.hash)g.push({hash:z.hash,author:z.author||"",email:z.email||"",timestamp:z.timestamp||0,subject:z.subject||"",insertions:z.insertions||0,deletions:z.deletions||0});return g}function xE($,I,_){let u=I.until?` --until="${I.until}"`:"",U=w6($,`git log ${_} --since="${I.since}"${u} --format="COMMIT:%H|%aN" --numstat`);if(!U)return[];let g=[],z="";for(let G of U.split(`
|
|
435
|
+
`))if(G.startsWith("COMMIT:"))z=G.slice(7).split("|")[1]||"";else if(G.trim()&&z){let J=G.split("\t");if(J.length>=3){let X=parseInt(J[0]||"0",10),N=parseInt(J[1]||"0",10);if(!Number.isNaN(X)&&!Number.isNaN(N)&&J[2])g.push({file:J[2],insertions:X,deletions:N,author:z})}}return g}function kE($,I,_,u=10){let U=I.until?` --until="${I.until}"`:"",g=w6($,`git log ${_} --since="${I.since}"${U} --format="" --name-only | grep -v '^$' | sort | uniq -c | sort -rn | head -${u}`);if(!g)return[];return g.split(`
|
|
436
|
+
`).filter(Boolean).map((z)=>{let G=z.trim().match(/^\s*(\d+)\s+(.+)$/);if(!G)return null;return{count:parseInt(G[1]||"0",10),file:G[2]||""}}).filter((z)=>z!==null)}function yE($,I,_){let u=_?` --author="${_}"`:"",U=w6($,`git log ${I}${u} --format="%ad" --date=format:"%Y-%m-%d" | sort -u`);if(!U)return 0;let g=U.split(`
|
|
437
|
+
`).filter(Boolean).sort().reverse(),z=new Date;z.setHours(0,0,0,0);let G=0,J=new Date(z);for(let X of g){let[N=0,q=0,Q=0]=X.split("-").map(Number),Y=new Date(N,q-1,Q);Y.setHours(0,0,0,0);let O=Math.round((J.getTime()-Y.getTime())/86400000);if(O===0)G++,J.setDate(J.getDate()-1);else if(O===1&&G===0)G++,J.setTime(Y.getTime()),J.setDate(J.getDate()-1);else break}return G}function iE($,I,_){let u=I.until?` --until="${I.until}"`:"",U=w6($,`git log ${_} --since="${I.since}"${u} --format="%b" | grep -ci "co-authored-by.*noreply@anthropic\\.com\\|co-authored-by.*copilot\\|co-authored-by.*openai" 2>/dev/null || echo 0`);return parseInt(U||"0",10)}var lE=/(?:test|spec|__tests__|\.test\.|\.spec\.)/i;function Vq($){return lE.test($)}function Gv($,I=45){if($.length===0)return[];let _=[...$].sort((J,X)=>J.timestamp-X.timestamp),u=[],U=_[0]?.timestamp??0,g=_[0]?.timestamp??0,z=1,G=()=>{let J=Math.max(Math.round((g-U)/60),1),X=J>=50?"deep":J>=20?"medium":"micro";u.push({startTime:U,endTime:g,commits:z,type:X,durationMinutes:J})};for(let J=1;J<_.length;J++){let X=_[J]?.timestamp??0;if((X-g)/60>I)G(),U=X,g=X,z=1;else g=X,z++}return G(),u}function Jv($){let I=Array(24).fill(0);for(let _ of $){let u=new Date(_.timestamp*1000).getHours();I[u]=(I[u]||0)+1}return I}function mE($){let I={},_=/^(feat|fix|docs|style|refactor|test|chore|build|ci|perf)(\(.+\))?!?:/;for(let u of $){let U=u.subject.match(_),g=U?U[1]||"other":"other";I[g]=(I[g]||0)+1}return I}function nE($){let I={};for(let g of $){let z=g.file.split("/")[0]||g.file;I[z]=(I[z]||0)+1}let _=$.length;if(_===0)return{score:0,area:"-"};let U=Object.entries(I).sort(([,g],[,z])=>z-g)[0];if(!U)return{score:0,area:"-"};return{score:Math.round(U[1]/_*100),area:U[0]}}function rE($,I){let _={};for(let g of $){if(!_[g.author])_[g.author]={commits:0,insertions:0,deletions:0,testInsertions:0,topAreas:[],commitTypes:{},peakHour:0};let z=_[g.author];if(!z)continue;z.commits++,z.insertions+=g.insertions,z.deletions+=g.deletions;let G=g.subject.match(/^(feat|fix|docs|style|refactor|test|chore|build|ci|perf)(\(.+\))?!?:/),J=G?G[1]||"other":"other";z.commitTypes[J]=(z.commitTypes[J]||0)+1}let u={},U={};for(let g of I){if(!u[g.author])u[g.author]={};let z=g.file.split("/")[0]||g.file,G=u[g.author];if(G)G[z]=(G[z]||0)+1;let J=_[g.author];if(J&&Vq(g.file))J.testInsertions+=g.insertions}for(let g of $){if(!U[g.author])U[g.author]=Array(24).fill(0);let z=new Date(g.timestamp*1000).getHours(),G=U[g.author];if(G)G[z]=(G[z]||0)+1}for(let[g,z]of Object.entries(_)){let G=u[g]||{};z.topAreas=Object.entries(G).sort(([,N],[,q])=>q-N).slice(0,3).map(([N])=>N);let J=U[g]||[],X=Math.max(...J,0);z.peakHour=X>0?J.indexOf(X):0}return _}function Xv($){return Wq($,".serena","retrospectives")}function Zq($,I){let _=Xv($);if(!$v(_))EE(_,{recursive:!0});let u=I.date.split("T")[0]||I.date,U=Iv(_).filter((G)=>G.startsWith(u)).length,g=`${u}-${U+1}.json`,z=Wq(_,g);return fE(z,JSON.stringify(I,null,2),"utf-8"),z}function qv($){let I=Xv($);if(!$v(I))return null;try{let _=Iv(I).filter((g)=>g.endsWith(".json")).sort().reverse();if(_.length===0)return null;let u=CE(Wq(I,_[0]||""),"utf-8"),U=JSON.parse(u);if(U.metrics)return U;return null}catch{return null}}function Nv($,I,_=30){if(I===0)return"";let u=Math.round($/I*_);return"█".repeat(u)}function hE($,I,_,u=25){let U=_>0?Math.round(I/_*100):0,g=Nv(I,_,u);return` ${$.padEnd(12)} ${String(I).padStart(4)} (${String(U).padStart(2)}%) ${g}`}function Qv($){let I=Math.max(...$,1),_=[];for(let u=0;u<24;u++){let U=$[u]||0;if(U===0)continue;_.push(` ${String(u).padStart(2)}:00 ${String(U).padStart(3)} ${Nv(U,I,20)}`)}return _.length>0?_.join(`
|
|
438
|
+
`):" (no commits)"}function Hv($){return[["Commits",String($.commits)],["Contributors",String($.contributors)],["Insertions",`+${$.insertions}`],["Deletions",`-${$.deletions}`],["Net LOC",String($.netLoc)],["Test LOC (ins)",String($.testLoc)],["Test ratio",`${$.testRatio}%`],["Active days",String($.activeDays)],["Sessions",String($.sessions)],["Deep sessions",String($.deepSessions)],["Avg session",`${$.avgSessionMinutes} min`],["LOC/session-hour",String($.locPerSessionHour)],["Peak hour",`${$.peakHour}:00`],["Focus score",`${$.focusScore}% (${$.focusArea})`],["Streak",`${$.streakDays} days`],["AI-assisted",String($.aiAssistedCommits)]].map(([_,u])=>` ${_?.padEnd(20)} ${u}`).join(`
|
|
439
|
+
`)}function Yv($,I){let _=Object.entries($).sort(([,G],[,J])=>J.commits-G.commits),u=_.findIndex(([G])=>G===I);if(u>0){let[G]=_.splice(u,1);if(G)_.unshift(G)}let U=` ${"Contributor".padEnd(24)} ${"Commits".padStart(7)} ${"+/-".padStart(14)} Top area`,g=` ${"-".repeat(24)} ${"-".repeat(7)} ${"-".repeat(14)} ${"-".repeat(15)}`,z=_.map(([G,J])=>{let X=G===I?`You (${G})`:G,N=`+${J.insertions}/-${J.deletions}`;return` ${X.padEnd(24)} ${String(J.commits).padStart(7)} ${N.padStart(14)} ${J.topArea}`});return[U,g,...z].join(`
|
|
440
|
+
`)}function Aq($,I){let _=$.metrics,u=I.metrics;function U(z,G,J=""){let X=z-G,N=X>0?"↑":X<0?"↓":"→",q=X>0?"+":"";return`${G}${J} → ${z}${J} ${N}${q}${X}${J}`}return[` ${"Metric".padEnd(20)} Change`,` ${"-".repeat(20)} ${"-".repeat(35)}`,` ${"Commits".padEnd(20)} ${U(_.commits,u.commits)}`,` ${"Test ratio".padEnd(20)} ${U(_.testRatio,u.testRatio,"%")}`,` ${"Sessions".padEnd(20)} ${U(_.sessions,u.sessions)}`,` ${"Deep sessions".padEnd(20)} ${U(_.deepSessions,u.deepSessions)}`,` ${"LOC/session-hour".padEnd(20)} ${U(_.locPerSessionHour,u.locPerSessionHour)}`,` ${"Focus score".padEnd(20)} ${U(_.focusScore,u.focusScore,"%")}`,` ${"Streak".padEnd(20)} ${U(_.streakDays,u.streakDays,"d")}`].join(`
|
|
441
|
+
`)}function Ov($){let I=$.filter((z)=>z.type==="deep").length,_=$.filter((z)=>z.type==="medium").length,u=$.filter((z)=>z.type==="micro").length,U=$.reduce((z,G)=>z+G.durationMinutes,0),g=$.length>0?Math.round(U/$.length):0;return[` Total sessions: ${$.length}`,` Deep (50+ min): ${I}`,` Medium (20-50): ${_}`,` Micro (<20 min): ${u}`,` Total active time: ${Math.floor(U/60)}h ${U%60}m`,` Avg session: ${g} min`].join(`
|
|
442
|
+
`)}function vv($){if($.length===0)return" (no file changes)";return $.map((I,_)=>{let u=I.count>=5?" [churn]":"",U=Vq(I.file)?" [test]":"";return` ${String(_+1).padStart(2)}. ${I.file} (${I.count}x)${U}${u}`}).join(`
|
|
443
|
+
`)}function Tv($,I){if(I===0)return" (no commits)";return Object.entries($).sort(([,_],[,u])=>u-_).map(([_,u])=>hE(_,u,I)).join(`
|
|
444
|
+
`)}function Mv($){let I=$.metrics;return`${$.date.split("T")[0]||""} (${$.window}): ${I.commits} commits (${I.contributors} contrib), ${I.netLoc>0?"+":""}${I.netLoc} LOC, ${I.testRatio}% tests, peak: ${I.peakHour}:00 | Streak: ${I.streakDays}d`}function S2($,I){let _=`origin/${uv($)}`,u=zv($,I,_),U=xE($,I,_),g=kE($,I,_),z=rE(u,U),G=Gv(u),J=Jv(u),X=mE(u),N=nE(U),q=yE($,_),Q=iE($,I,_),Y=0;for(let V of U)if(Vq(V.file))Y+=V.insertions;let O=u.reduce((V,M)=>V+M.insertions,0),H=u.reduce((V,M)=>V+M.deletions,0),v=new Set(u.map((V)=>new Date(V.timestamp*1000).toISOString().split("T")[0])).size,T=G.reduce((V,M)=>V+M.durationMinutes,0),K=T/60,D=K>0?Math.round((O+H)/K/50)*50:0,B=J.indexOf(Math.max(...J)),R={};for(let[V,M]of Object.entries(z)){let W=M.insertions>0?Math.round(M.testInsertions/M.insertions*100):0;R[V]={commits:M.commits,insertions:M.insertions,deletions:M.deletions,testRatio:W,topArea:M.topAreas[0]||"-"}}return{date:new Date().toISOString(),window:I.label,metrics:{commits:u.length,contributors:Object.keys(z).length,insertions:O,deletions:H,netLoc:O-H,testLoc:Y,testRatio:O>0?Math.round(Y/O*100):0,activeDays:v,sessions:G.length,deepSessions:G.filter((V)=>V.type==="deep").length,avgSessionMinutes:G.length>0?Math.round(T/G.length):0,locPerSessionHour:D,peakHour:B,focusScore:N.score,focusArea:N.area,streakDays:q,aiAssistedCommits:Q},authors:R,commitTypes:X,hotspots:g}}function bq($,I){let _=`origin/${uv($)}`,u=zv($,I,_);return{sessions:Gv(u),hourly:Jv(u)}}function bv($,I,_,u,U){if(console.log(V$.default.bold(V$.default.cyan(Mv($)))),console.log(),i(Hv($.metrics),"Summary"),U)i(Aq($,U),"Trends vs Last Retro");if($.metrics.contributors>0)i(Yv($.authors,u),"Contributors");if(i(Qv(_),"Commit Time Distribution"),I.length>0)i(Ov(I),"Work Sessions");if(i(Tv($.commitTypes,$.metrics.commits),"Commit Types"),$.hotspots.length>0){let J=$.metrics.commits>0?Math.round(($.commitTypes.fix||0)/$.metrics.commits*100):0,X=vv($.hotspots);if(J>50)X+=`
|
|
439
445
|
|
|
440
|
-
${
|
|
446
|
+
${V$.default.yellow(`Fix ratio ${J}% — ship-fast-fix-fast pattern detected`)}`;i(X,"File Hotspots (Top 10)")}let{focusScore:g,focusArea:z}=$.metrics,G=g>=60?V$.default.green:g>=40?V$.default.yellow:V$.default.red;if(i(` ${G(`${g}%`)} — primary area: ${V$.default.bold(z)}`,"Focus Score"),i(` ${V$.default.bold(String($.metrics.streakDays))} consecutive days with commits`,"Shipping Streak"),$.metrics.aiAssistedCommits>0){let J=$.metrics.commits>0?Math.round($.metrics.aiAssistedCommits/$.metrics.commits*100):0;i(` ${$.metrics.aiAssistedCommits} commits (${J}%) AI-assisted`,"AI Collaboration")}}async function Pv($,I={}){let _=process.cwd();if(I.interactive){let{retro:N}=await Promise.resolve().then(() => (Av(),Zv));await N();return}console.clear(),L$(V$.default.bgMagenta(V$.default.white(" retro ")));let u=H4();u.start("Fetching origin..."),_v(_),u.stop("Origin fetched");let U=gv(_);if(I.compare){let{current:N,previous:q}=Uv($);u.start(`Analyzing current window (${N.label})...`);let Q=S2(_,N),Y=bq(_,N);u.stop("Current window analyzed"),u.start(`Analyzing previous window (${q.label})...`);let O=S2(_,q);if(u.stop("Previous window analyzed"),Q.metrics.commits===0&&O.metrics.commits===0){i(V$.default.yellow("No commits found in either window."),"Empty"),p(V$.default.dim("Try a wider window: oma retro compare 30d"));return}if(I.json){console.log(JSON.stringify({current:Q,previous:O},null,2));return}console.log(V$.default.bold(`
|
|
441
447
|
Comparing: ${N.label} (current) vs ${q.label} (prior)
|
|
442
|
-
`)),
|
|
448
|
+
`)),i(Aq(Q,O),"Period Comparison"),console.log(V$.default.bold(`
|
|
443
449
|
--- Current Period ---
|
|
444
|
-
`)),
|
|
445
|
-
`),"Usage"),p(
|
|
446
|
-
`);
|
|
447
|
-
`);
|
|
448
|
-
`),"Migration");let J=G.length>0||
|
|
450
|
+
`)),bv(Q,Y.sessions,Y.hourly,U,null);let H=Zq(_,Q);p(V$.default.dim(`Snapshot saved: ${H}`));return}let g;try{g=Rq($)}catch(N){i(["Usage: oma retro [window]",""," oma retro last 7 days (default)"," oma retro 24h last 24 hours"," oma retro 14d last 14 days"," oma retro 30d last 30 days"," oma retro 2w last 2 weeks"," oma retro --compare compare current vs prior period"," oma retro --compare 14d"].join(`
|
|
451
|
+
`),"Usage"),p(V$.default.dim(N.message));return}u.start(`Analyzing ${g.label} window...`);let z=S2(_,g),G=bq(_,g);if(u.stop(`Analysis complete (${z.metrics.commits} commits)`),z.metrics.commits===0){i(V$.default.yellow("No commits found in this window."),"Empty"),p(V$.default.dim("Try a wider window: oma retro 30d"));return}if(I.json){console.log(JSON.stringify(z,null,2));return}let J=qv(_);bv(z,G.sessions,G.hourly,U,J);let X=Zq(_,z);p(V$.default.dim(`Snapshot saved: ${X}`))}U4();var E6=O$(Z$(),1);import{execSync as sE,spawnSync as jv}from"node:child_process";import{platform as $C}from"node:os";function IC(){let $=$C();if($==="darwin")return"brew install gh";if($==="win32")return"winget install GitHub.cli";return"sudo apt install gh"}async function Sv(){if(console.clear(),L$(E6.default.bgMagenta(E6.default.white(" ⭐ oh-my-agent star "))),!J1()){let I=IC(),_=await f$({message:`GitHub CLI (gh) is not installed. Install with ${E6.default.cyan(I)}?`});if(J$(_)||!_){p("Install gh manually and try again.");return}let u=H4();u.start("Installing GitHub CLI...");let U=jv(I,{shell:!0,stdio:"pipe"});if(U.status!==0){u.stop("Installation failed"),U$.error(U.stderr?.toString()||"Unknown error"),p("Please install gh manually.");return}u.stop("GitHub CLI installed!")}if(!x4()){U$.warn("GitHub CLI is not authenticated.");let I=await f$({message:`Run ${E6.default.cyan("gh auth login")} now?`});if(J$(I)||!I){p("Authenticate and try again.");return}if(jv("gh",["auth","login"],{stdio:"inherit"}),!x4()){p("Authentication was not completed. Try again.");return}U$.success("Authenticated!")}if(X1()){p(`Already starred ${E6.default.cyan(W$)}! Thank you! \uD83D\uDE4F`);return}let $=await f$({message:`Star ${E6.default.cyan(W$)} on GitHub?`});if(J$($)||!$){p("Maybe next time!");return}try{sE(`gh api -X PUT /user/starred/${W$}`,{stdio:"ignore"}),p(`Starred ${E6.default.cyan(W$)}! Thank you! \uD83C\uDF1F`)}catch{U$.error("Failed to star the repository."),p("Please try again later.")}}U4();jq();i0();var B4=O$(Z$(),1);import{existsSync as w2,mkdirSync as UC,readdirSync as _C,readFileSync as uC,writeFileSync as Fv}from"node:fs";import{dirname as gC,join as wv}from"node:path";function Eq($){return wv($,".serena","metrics.json")}function wq(){return{sessions:0,skillsUsed:{},tasksCompleted:0,totalSessionTime:0,filesChanged:0,linesAdded:0,linesRemoved:0,lastUpdated:new Date().toISOString(),startDate:new Date().toISOString()}}function zC($){let I=Eq($);if(w2(I))try{return JSON.parse(uC(I,"utf-8"))}catch{return wq()}return wq()}function GC($,I){let _=Eq($),u=gC(_);if(!w2(u))UC(u,{recursive:!0});I.lastUpdated=new Date().toISOString(),Fv(_,JSON.stringify(I,null,2),"utf-8")}function JC($){let I=wv($,".serena","memories"),_={};if(!w2(I))return _;try{let u=_C(I);for(let U of u){let g=U.match(/(?:progress|result)-(\w+)/);if(g?.[1]){let z=g[1];_[z]=(_[z]||0)+1}}}catch{}return _}async function Ev($=!1,I=!1){let _=process.cwd(),u=Eq(_);if(I){if(w2(u))Fv(u,JSON.stringify(wq(),null,2),"utf-8");if($)console.log(JSON.stringify({reset:!0}));else console.log(B4.default.green("✅ Metrics reset successfully."));return}let U=zC(_),g=F2(_),z=JC(_),G=oH(_),J=hu(_),X=J.startedAt?new Date(J.startedAt):null,N=X&&!Number.isNaN(X.getTime())?Math.max(0,Math.floor((Date.now()-X.getTime())/1000)):0;for(let[H,v]of Object.entries(z))U.skillsUsed[H]=(U.skillsUsed[H]||0)+v;if(G>U.tasksCompleted)U.tasksCompleted=G;if(J.id){if(["completed","failed","aborted"].includes(J.status||"")&&(U.lastSessionId!==J.id||U.lastSessionStatus!==J.status)&&N>0)U.totalSessionTime+=N;U.lastSessionId=J.id,U.lastSessionStatus=J.status,U.lastSessionStarted=J.startedAt,U.lastSessionDuration=N}U.filesChanged+=g.filesChanged,U.linesAdded+=g.linesAdded,U.linesRemoved+=g.linesRemoved,U.sessions+=1,GC(_,U);let q=Math.max(1,Math.ceil((Date.now()-new Date(U.startDate).getTime())/86400000)),Q=U.sessions>0?Math.round(U.totalSessionTime/U.sessions):0;if($){console.log(JSON.stringify({...U,gitStats:g,daysSinceStart:q,avgSessionTime:Q},null,2));return}console.clear(),L$(B4.default.bgMagenta(B4.default.white(" \uD83D\uDCCA oh-my-agent stats ")));let Y=[B4.default.bold(`\uD83D\uDCC8 Productivity Metrics (${q} days)`),"┌─────────────────────┬──────────────┐",`│ ${B4.default.bold("Metric")} │ ${B4.default.bold("Value")} │`,"├─────────────────────┼──────────────┤",`│ Sessions │ ${String(U.sessions).padEnd(12)} │`,`│ Tasks Completed │ ${String(U.tasksCompleted).padEnd(12)} │`,`│ Files Changed │ ${String(U.filesChanged).padEnd(12)} │`,`│ Lines Added │ ${B4.default.green(`+${U.linesAdded}`).padEnd(12)} │`,`│ Lines Removed │ ${B4.default.red(`-${U.linesRemoved}`).padEnd(12)} │`,"└─────────────────────┴──────────────┘"].join(`
|
|
452
|
+
`);i(Y,"Overview");let O=Object.entries(U.skillsUsed).sort(([,H],[,v])=>v-H).slice(0,5);if(O.length>0){let H=[B4.default.bold("\uD83C\uDFC6 Top Skills Used"),...O.map(([v,T],K)=>` ${K+1}. ${v} (${T})`)].join(`
|
|
453
|
+
`);i(H,"Skills")}p(B4.default.dim(`Data stored in: ${u}`))}U4();var i$=O$(Z$(),1);import{execSync as XC}from"node:child_process";import{cpSync as E2,existsSync as $6,mkdirSync as Cq,readFileSync as C2,rmSync as fq,writeFileSync as UU}from"node:fs";import{tmpdir as qC}from"node:os";import{join as y$}from"node:path";function NC($){if(!$)return{intro:(_)=>L$(_),outro:(_)=>p(_),note:(_,u)=>i(_,u),logError:(_)=>U$.error(_),spinnerStart:(_)=>{let u=H4();return u.start(_),u}};let I={start(_){},stop(_){if(_)console.log(_)},message(_){console.log(_)}};return{intro:(_)=>console.log(_),outro:(_)=>console.log(_),note:(_,u)=>console.log(_),logError:(_)=>console.error(_),spinnerStart:(_)=>{return console.log(_),I}}}function QC($,I){if($!==null)return"ready";return I?"legacy":"missing"}async function Cv($=!1,I=!1){if(!I&&process.stdout.isTTY)console.clear();let _=NC(I);_.intro(i$.default.bgMagenta(i$.default.white(" \uD83D\uDEF8 oh-my-agent update ")));let u=process.cwd(),U=await K2(u),g=VO(u),z=QC(U,g);if(z==="missing"){if(_.logError("oh-my-agent is not installed in this project. Run `oma install` first."),I)throw Error("oh-my-agent is not installed in this project. Run `oma install` first.");process.exit(1)}let G=Q1(u);if(G.length>0)_.note(G.map((N)=>`${i$.default.green("✓")} ${N}`).join(`
|
|
454
|
+
`),"Migration");let J=G.length>0||Qq(u);if(G.length>0&&!Qq(u))Hq(u,!0);if(!I)await D2(u);if(z==="legacy")_.note("Existing .agents installation detected without _version.json. Updating in place and restoring version metadata.","Legacy install");let X;try{X=_.spinnerStart("Checking for updates...");let N=await ZO();if(U===N.version&&!J){X.stop(i$.default.green("Already up to date!")),_.outro(`Current version: ${i$.default.cyan(U)}`);return}let q=U===N.version;X.message(`Downloading ${i$.default.cyan(N.version)}...`);let{dir:Q,cleanup:Y}=await Z2();try{X.message("Copying files..."),Q1(u);let O=y$(u,".agents","oma-config.yaml"),H=y$(u,".agents","mcp.json"),v=!$&&$6(O)?C2(O):null,T=!$&&$6(H)?C2(H):null,K=y$(qC(),`oma-stack-backup-${Date.now()}`),D=y$(u,".agents","skills","oma-backend","stack"),B=!$&&$6(D);if(B)Cq(K,{recursive:!0}),E2(D,y$(K,"oma-backend"),{recursive:!0});let R=["snippets.md","tech-stack.md","api-template.py"],V=y$(u,".agents","skills","oma-backend","resources"),M=!$&&!B&&R.some((l)=>$6(y$(V,l)));if(E2(y$(Q,".agents"),y$(u,".agents"),{recursive:!0,force:!0}),v)UU(O,v);if(T)UU(H,T);if(B)try{Cq(D,{recursive:!0}),E2(y$(K,"oma-backend"),D,{recursive:!0,force:!0})}finally{fq(K,{recursive:!0,force:!0})}if(M){let l=y$(Q,".agents","skills","oma-backend","variants","python");if($6(l))Cq(D,{recursive:!0}),E2(l,D,{recursive:!0,force:!0}),UU(y$(D,"stack.yaml"),`language: python
|
|
449
455
|
framework: fastapi
|
|
450
456
|
orm: sqlalchemy
|
|
451
457
|
source: migrated
|
|
452
|
-
`)}let
|
|
453
|
-
`),"Migration");await
|
|
454
|
-
`)}if(C.includes("
|
|
455
|
-
`)
|
|
456
|
-
`)
|
|
457
|
-
`)
|
|
458
|
-
`);
|
|
459
|
-
`)}async function iv($){let I=xv(process.cwd());if($.json){console.log(JSON.stringify(I,null,2));return}console.log(kv(I))}import{existsSync as kx,mkdirSync as ix,readdirSync as gU,readFileSync as yx,statSync as G5}from"node:fs";import{createServer as lx}from"node:http";import{basename as QM,join as W4}from"node:path";import{EventEmitter as eC}from"node:events";import{stat as sC,Stats as $d}from"node:fs";import{readdir as $f,stat as If}from"node:fs/promises";import*as a from"node:path";import{lstat as yv,readdir as VC,realpath as RC,stat as WC}from"node:fs/promises";import{join as AC,relative as ZC,resolve as lv,sep as bC}from"node:path";import{Readable as PC}from"node:stream";var z4={FILE_TYPE:"files",DIR_TYPE:"directories",FILE_DIR_TYPE:"files_directories",EVERYTHING_TYPE:"all"},wq={root:".",fileFilter:($)=>!0,directoryFilter:($)=>!0,type:z4.FILE_TYPE,lstat:!1,depth:2147483648,alwaysStat:!1,highWaterMark:4096};Object.freeze(wq);var hv="READDIRP_RECURSIVE_ERROR",SC=new Set(["ENOENT","EPERM","EACCES","ELOOP",hv]),mv=[z4.DIR_TYPE,z4.EVERYTHING_TYPE,z4.FILE_DIR_TYPE,z4.FILE_TYPE],jC=new Set([z4.DIR_TYPE,z4.EVERYTHING_TYPE,z4.FILE_DIR_TYPE]),FC=new Set([z4.EVERYTHING_TYPE,z4.FILE_DIR_TYPE,z4.FILE_TYPE]),wC=($)=>SC.has($.code),EC=process.platform==="win32",nv=($)=>!0,rv=($)=>{if($===void 0)return nv;if(typeof $==="function")return $;if(typeof $==="string"){let I=$.trim();return(_)=>_.basename===I}if(Array.isArray($)){let I=$.map((_)=>_.trim());return(_)=>I.some((u)=>_.basename===u)}return nv};class Eq extends PC{parents;reading;parent;_stat;_maxDepth;_wantsDir;_wantsFile;_wantsEverything;_root;_isDirent;_statsProp;_rdOptions;_fileFilter;_directoryFilter;constructor($={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:$.highWaterMark});let I={...wq,...$},{root:_,type:u}=I;this._fileFilter=rv(I.fileFilter),this._directoryFilter=rv(I.directoryFilter);let U=I.lstat?yv:WC;if(EC)this._stat=(g)=>U(g,{bigint:!0});else this._stat=U;this._maxDepth=I.depth!=null&&Number.isSafeInteger(I.depth)?I.depth:wq.depth,this._wantsDir=u?jC.has(u):!1,this._wantsFile=u?FC.has(u):!1,this._wantsEverything=u===z4.EVERYTHING_TYPE,this._root=lv(_),this._isDirent=!I.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(_,1)],this.reading=!1,this.parent=void 0}async _read($){if(this.reading)return;this.reading=!0;try{while(!this.destroyed&&$>0){let I=this.parent,_=I&&I.files;if(_&&_.length>0){let{path:u,depth:U}=I,g=_.splice(0,$).map((G)=>this._formatEntry(G,u)),z=await Promise.all(g);for(let G of z){if(!G)continue;if(this.destroyed)return;let J=await this._getEntryType(G);if(J==="directory"&&this._directoryFilter(G)){if(U<=this._maxDepth)this.parents.push(this._exploreDir(G.fullPath,U+1));if(this._wantsDir)this.push(G),$--}else if((J==="file"||this._includeAsFile(G))&&this._fileFilter(G)){if(this._wantsFile)this.push(G),$--}}}else{let u=this.parents.pop();if(!u){this.push(null);break}if(this.parent=await u,this.destroyed)return}}}catch(I){this.destroy(I)}finally{this.reading=!1}}async _exploreDir($,I){let _;try{_=await VC($,this._rdOptions)}catch(u){this._onError(u)}return{files:_,depth:I,path:$}}async _formatEntry($,I){let _,u=this._isDirent?$.name:$;try{let U=lv(AC(I,u));_={path:ZC(this._root,U),fullPath:U,basename:u},_[this._statsProp]=this._isDirent?$:await this._stat(U)}catch(U){this._onError(U);return}return _}_onError($){if(wC($)&&!this.destroyed)this.emit("warn",$);else this.destroy($)}async _getEntryType($){if(!$&&this._statsProp in $)return"";let I=$[this._statsProp];if(I.isFile())return"file";if(I.isDirectory())return"directory";if(I&&I.isSymbolicLink()){let _=$.fullPath;try{let u=await RC(_),U=await yv(u);if(U.isFile())return"file";if(U.isDirectory()){let g=u.length;if(_.startsWith(u)&&_.substr(g,1)===bC){let z=Error(`Circular symlink detected: "${_}" points to "${u}"`);return z.code=hv,this._onError(z)}return"directory"}}catch(u){return this._onError(u),""}}}_includeAsFile($){let I=$&&$[this._statsProp];return I&&this._wantsEverything&&!I.isDirectory()}}function cv($,I={}){let _=I.entryType||I.type;if(_==="both")_=z4.FILE_DIR_TYPE;if(_)I.type=_;if(!$)throw Error("readdirp: root argument is required. Usage: readdirp(root, options)");else if(typeof $!=="string")throw TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");else if(_&&!mv.includes(_))throw Error(`readdirp: Invalid type passed. Use one of ${mv.join(", ")}`);return I.root=$,new Eq(I)}import{watch as CC,unwatchFile as dv,watchFile as fC}from"node:fs";import{realpath as Cq,lstat as xC,open as kC,stat as pv}from"node:fs/promises";import{type as iC}from"node:os";import*as M$ from"node:path";var yC="data",kq="end",tv="close",F2=()=>{};var w2=process.platform,iq=w2==="win32",lC=w2==="darwin",mC=w2==="linux",nC=w2==="freebsd",av=iC()==="OS400",v$={ALL:"all",READY:"ready",ADD:"add",CHANGE:"change",ADD_DIR:"addDir",UNLINK:"unlink",UNLINK_DIR:"unlinkDir",RAW:"raw",ERROR:"error"},V4=v$,rC="watch",hC={lstat:xC,stat:pv},N1="listeners",P2="errHandlers",TI="rawEmitters",cC=[N1,P2,TI],dC=new Set(["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),oC=($)=>dC.has(M$.extname($).slice(1).toLowerCase()),xq=($,I)=>{if($ instanceof Set)$.forEach(I);else I($)},p0=($,I,_)=>{let u=$[I];if(!(u instanceof Set))$[I]=u=new Set([u]);u.add(_)},pC=($)=>(I)=>{let _=$[I];if(_ instanceof Set)_.clear();else delete $[I]},t0=($,I,_)=>{let u=$[I];if(u instanceof Set)u.delete(_);else if(u===_)delete $[I]},ev=($)=>$ instanceof Set?$.size===0:!$,S2=new Map;function ov($,I,_,u,U){let g=(z,G)=>{if(_($),U(z,G,{watchedPath:$}),G&&$!==G)j2(M$.resolve($,G),N1,M$.join($,G))};try{return CC($,{persistent:I.persistent},g)}catch(z){u(z);return}}var j2=($,I,_,u,U)=>{let g=S2.get($);if(!g)return;xq(g[I],(z)=>{z(_,u,U)})},tC=($,I,_,u)=>{let{listener:U,errHandler:g,rawEmitter:z}=u,G=S2.get(I),J;if(!_.persistent){if(J=ov($,_,U,g,z),!J)return;return J.close.bind(J)}if(G)p0(G,N1,U),p0(G,P2,g),p0(G,TI,z);else{if(J=ov($,_,j2.bind(null,I,N1),g,j2.bind(null,I,TI)),!J)return;J.on(V4.ERROR,async(X)=>{let N=j2.bind(null,I,P2);if(G)G.watcherUnusable=!0;if(iq&&X.code==="EPERM")try{await(await kC($,"r")).close(),N(X)}catch(q){}else N(X)}),G={listeners:U,errHandlers:g,rawEmitters:z,watcher:J},S2.set(I,G)}return()=>{if(t0(G,N1,U),t0(G,P2,g),t0(G,TI,z),ev(G.listeners))G.watcher.close(),S2.delete(I),cC.forEach(pC(G)),G.watcher=void 0,Object.freeze(G)}},fq=new Map,aC=($,I,_,u)=>{let{listener:U,rawEmitter:g}=u,z=fq.get(I),G=z&&z.options;if(G&&(G.persistent<_.persistent||G.interval>_.interval))dv(I),z=void 0;if(z)p0(z,N1,U),p0(z,TI,g);else z={listeners:U,rawEmitters:g,options:_,watcher:fC(I,_,(J,X)=>{xq(z.rawEmitters,(q)=>{q(V4.CHANGE,I,{curr:J,prev:X})});let N=J.mtimeMs;if(J.size!==X.size||N>X.mtimeMs||N===0)xq(z.listeners,(q)=>q($,J))})},fq.set(I,z);return()=>{if(t0(z,N1,U),t0(z,TI,g),ev(z.listeners))fq.delete(I),dv(I),z.options=z.watcher=void 0,Object.freeze(z)}};class yq{fsw;_boundHandleError;constructor($){this.fsw=$,this._boundHandleError=(I)=>$._handleError(I)}_watchWithNodeFs($,I){let _=this.fsw.options,u=M$.dirname($),U=M$.basename($);this.fsw._getWatchedDir(u).add(U);let z=M$.resolve($),G={persistent:_.persistent};if(!I)I=F2;let J;if(_.usePolling){let X=_.interval!==_.binaryInterval;G.interval=X&&oC(U)?_.binaryInterval:_.interval,J=aC($,z,G,{listener:I,rawEmitter:this.fsw._emitRaw})}else J=tC($,z,G,{listener:I,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw});return J}_handleFile($,I,_){if(this.fsw.closed)return;let u=M$.dirname($),U=M$.basename($),g=this.fsw._getWatchedDir(u),z=I;if(g.has(U))return;let G=async(X,N)=>{if(!this.fsw._throttle(rC,$,5))return;if(!N||N.mtimeMs===0)try{let q=await pv($);if(this.fsw.closed)return;let{atimeMs:Q,mtimeMs:Y}=q;if(!Q||Q<=Y||Y!==z.mtimeMs)this.fsw._emit(V4.CHANGE,$,q);if((lC||mC||nC)&&z.ino!==q.ino){this.fsw._closeFile(X),z=q;let O=this._watchWithNodeFs($,G);if(O)this.fsw._addPathCloser(X,O)}else z=q}catch(q){this.fsw._remove(u,U)}else if(g.has(U)){let{atimeMs:q,mtimeMs:Q}=N;if(!q||q<=Q||Q!==z.mtimeMs)this.fsw._emit(V4.CHANGE,$,N);z=N}},J=this._watchWithNodeFs($,G);if(!(_&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored($)){if(!this.fsw._throttle(V4.ADD,$,0))return;this.fsw._emit(V4.ADD,$,I)}return J}async _handleSymlink($,I,_,u){if(this.fsw.closed)return;let U=$.fullPath,g=this.fsw._getWatchedDir(I);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let z;try{z=await Cq(_)}catch(G){return this.fsw._emitReady(),!0}if(this.fsw.closed)return;if(g.has(u)){if(this.fsw._symlinkPaths.get(U)!==z)this.fsw._symlinkPaths.set(U,z),this.fsw._emit(V4.CHANGE,_,$.stats)}else g.add(u),this.fsw._symlinkPaths.set(U,z),this.fsw._emit(V4.ADD,_,$.stats);return this.fsw._emitReady(),!0}if(this.fsw._symlinkPaths.has(U))return!0;this.fsw._symlinkPaths.set(U,!0)}_handleRead($,I,_,u,U,g,z){$=M$.join($,"");let G=u?`${$}:${u}`:$;if(z=this.fsw._throttle("readdir",G,1000),!z)return;let J=this.fsw._getWatchedDir(_.path),X=new Set,N=this.fsw._readdirp($,{fileFilter:(q)=>_.filterPath(q),directoryFilter:(q)=>_.filterDir(q)});if(!N)return;return N.on(yC,async(q)=>{if(this.fsw.closed){N=void 0;return}let Q=q.path,Y=M$.join($,Q);if(X.add(Q),q.stats.isSymbolicLink()&&await this._handleSymlink(q,$,Y,Q))return;if(this.fsw.closed){N=void 0;return}if(Q===u||!u&&!J.has(Q))this.fsw._incrReadyCount(),Y=M$.join(U,M$.relative(U,Y)),this._addToNodeFs(Y,I,_,g+1)}).on(V4.ERROR,this._boundHandleError),new Promise((q,Q)=>{if(!N)return Q();N.once(kq,()=>{if(this.fsw.closed){N=void 0;return}let Y=z?z.clear():!1;if(q(void 0),J.getChildren().filter((O)=>{return O!==$&&!X.has(O)}).forEach((O)=>{this.fsw._remove($,O)}),N=void 0,Y)this._handleRead($,!1,_,u,U,g,z)})})}async _handleDir($,I,_,u,U,g,z){let G=this.fsw._getWatchedDir(M$.dirname($)),J=G.has(M$.basename($));if(!(_&&this.fsw.options.ignoreInitial)&&!U&&!J)this.fsw._emit(V4.ADD_DIR,$,I);G.add(M$.basename($)),this.fsw._getWatchedDir($);let X,N,q=this.fsw.options.depth;if((q==null||u<=q)&&!this.fsw._symlinkPaths.has(z)){if(!U){if(await this._handleRead($,_,g,U,$,u,X),this.fsw.closed)return}N=this._watchWithNodeFs($,(Q,Y)=>{if(Y&&Y.mtimeMs===0)return;this._handleRead(Q,!1,g,U,$,u,X)})}return N}async _addToNodeFs($,I,_,u,U){let g=this.fsw._emitReady;if(this.fsw._isIgnored($)||this.fsw.closed)return g(),!1;let z=this.fsw._getWatchHelpers($);if(_)z.filterPath=(G)=>_.filterPath(G),z.filterDir=(G)=>_.filterDir(G);try{let G=await hC[z.statMethod](z.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(z.watchPath,G))return g(),!1;let J=this.fsw.options.followSymlinks,X;if(G.isDirectory()){let N=M$.resolve($),q=J?await Cq($):$;if(this.fsw.closed)return;if(X=await this._handleDir(z.watchPath,G,I,u,U,z,q),this.fsw.closed)return;if(N!==q&&q!==void 0)this.fsw._symlinkPaths.set(N,q)}else if(G.isSymbolicLink()){let N=J?await Cq($):$;if(this.fsw.closed)return;let q=M$.dirname(z.watchPath);if(this.fsw._getWatchedDir(q).add(z.watchPath),this.fsw._emit(V4.ADD,z.watchPath,G),X=await this._handleDir(q,G,I,u,$,z,N),this.fsw.closed)return;if(N!==void 0)this.fsw._symlinkPaths.set(M$.resolve($),N)}else X=this._handleFile(z.watchPath,G,I);if(g(),X)this.fsw._addPathCloser($,X);return!1}catch(G){if(this.fsw._handleError(G))return g(),$}}}/*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) */var lq="/",Uf="//",_T=".",_f="..",uf="string",gf=/\\/g,uT=/\/\//g,zf=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,Gf=/^\.[/\\]/;function E2($){return Array.isArray($)?$:[$]}var mq=($)=>typeof $==="object"&&$!==null&&!($ instanceof RegExp);function Jf($){if(typeof $==="function")return $;if(typeof $==="string")return(I)=>$===I;if($ instanceof RegExp)return(I)=>$.test(I);if(typeof $==="object"&&$!==null)return(I)=>{if($.path===I)return!0;if($.recursive){let _=a.relative($.path,I);if(!_)return!1;return!_.startsWith("..")&&!a.isAbsolute(_)}return!1};return()=>!1}function Xf($){if(typeof $!=="string")throw Error("string expected");$=a.normalize($),$=$.replace(/\\/g,"/");let I=!1;if($.startsWith("//"))I=!0;if($=$.replace(uT,"/"),I)$="/"+$;return $}function sv($,I,_){let u=Xf(I);for(let U=0;U<$.length;U++){let g=$[U];if(g(u,_))return!0}return!1}function qf($,I){if($==null)throw TypeError("anymatch: specify first argument");let u=E2($).map((U)=>Jf(U));if(I==null)return(U,g)=>{return sv(u,U,g)};return sv(u,I)}var $T=($)=>{let I=E2($).flat();if(!I.every((_)=>typeof _===uf))throw TypeError(`Non-string provided as watch path: ${I}`);return I.map(gT)},IT=($)=>{let I=$.replace(gf,lq),_=!1;if(I.startsWith(Uf))_=!0;if(I=I.replace(uT,lq),_)I=lq+I;return I},gT=($)=>IT(a.normalize(IT($))),UT=($="")=>(I)=>{if(typeof I==="string")return gT(a.isAbsolute(I)?I:a.join($,I));else return I},Nf=($,I)=>{if(a.isAbsolute($))return $;return a.join(I,$)},Qf=Object.freeze(new Set);class zT{path;_removeWatcher;items;constructor($,I){this.path=$,this._removeWatcher=I,this.items=new Set}add($){let{items:I}=this;if(!I)return;if($!==_T&&$!==_f)I.add($)}async remove($){let{items:I}=this;if(!I)return;if(I.delete($),I.size>0)return;let _=this.path;try{await $f(_)}catch(u){if(this._removeWatcher)this._removeWatcher(a.dirname(_),a.basename(_))}}has($){let{items:I}=this;if(!I)return;return I.has($)}getChildren(){let{items:$}=this;if(!$)return[];return[...$.values()]}dispose(){this.items.clear(),this.path="",this._removeWatcher=F2,this.items=Qf,Object.freeze(this)}}var Hf="stat",Yf="lstat";class GT{fsw;path;watchPath;fullWatchPath;dirParts;followSymlinks;statMethod;constructor($,I,_){this.fsw=_;let u=$;this.path=$=$.replace(Gf,""),this.watchPath=u,this.fullWatchPath=a.resolve(u),this.dirParts=[],this.dirParts.forEach((U)=>{if(U.length>1)U.pop()}),this.followSymlinks=I,this.statMethod=I?Hf:Yf}entryPath($){return a.join(this.watchPath,a.relative(this.watchPath,$.fullPath))}filterPath($){let{stats:I}=$;if(I&&I.isSymbolicLink())return this.filterDir($);let _=this.entryPath($);return this.fsw._isntIgnored(_,I)&&this.fsw._hasReadPermissions(I)}filterDir($){return this.fsw._isntIgnored(this.entryPath($),$.stats)}}class JT extends eC{closed;options;_closers;_ignoredPaths;_throttled;_streams;_symlinkPaths;_watched;_pendingWrites;_pendingUnlinks;_readyCount;_emitReady;_closePromise;_userIgnored;_readyEmitted;_emitRaw;_boundRemove;_nodeFsHandler;constructor($={}){super();this.closed=!1,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._streams=new Set,this._symlinkPaths=new Map,this._watched=new Map,this._pendingWrites=new Map,this._pendingUnlinks=new Map,this._readyCount=0,this._readyEmitted=!1;let I=$.awaitWriteFinish,_={stabilityThreshold:2000,pollInterval:100},u={persistent:!0,ignoreInitial:!1,ignorePermissionErrors:!1,interval:100,binaryInterval:300,followSymlinks:!0,usePolling:!1,atomic:!0,...$,ignored:$.ignored?E2($.ignored):E2([]),awaitWriteFinish:I===!0?_:typeof I==="object"?{..._,...I}:!1};if(av)u.usePolling=!0;if(u.atomic===void 0)u.atomic=!u.usePolling;let U=process.env.CHOKIDAR_USEPOLLING;if(U!==void 0){let G=U.toLowerCase();if(G==="false"||G==="0")u.usePolling=!1;else if(G==="true"||G==="1")u.usePolling=!0;else u.usePolling=!!G}let g=process.env.CHOKIDAR_INTERVAL;if(g)u.interval=Number.parseInt(g,10);let z=0;this._emitReady=()=>{if(z++,z>=this._readyCount)this._emitReady=F2,this._readyEmitted=!0,process.nextTick(()=>this.emit(v$.READY))},this._emitRaw=(...G)=>this.emit(v$.RAW,...G),this._boundRemove=this._remove.bind(this),this.options=u,this._nodeFsHandler=new yq(this),Object.freeze(u)}_addIgnoredPath($){if(mq($)){for(let I of this._ignoredPaths)if(mq(I)&&I.path===$.path&&I.recursive===$.recursive)return}this._ignoredPaths.add($)}_removeIgnoredPath($){if(this._ignoredPaths.delete($),typeof $==="string"){for(let I of this._ignoredPaths)if(mq(I)&&I.path===$)this._ignoredPaths.delete(I)}}add($,I,_){let{cwd:u}=this.options;this.closed=!1,this._closePromise=void 0;let U=$T($);if(u)U=U.map((g)=>{return Nf(g,u)});if(U.forEach((g)=>{this._removeIgnoredPath(g)}),this._userIgnored=void 0,!this._readyCount)this._readyCount=0;return this._readyCount+=U.length,Promise.all(U.map(async(g)=>{let z=await this._nodeFsHandler._addToNodeFs(g,!_,void 0,0,I);if(z)this._emitReady();return z})).then((g)=>{if(this.closed)return;g.forEach((z)=>{if(z)this.add(a.dirname(z),a.basename(I||z))})}),this}unwatch($){if(this.closed)return this;let I=$T($),{cwd:_}=this.options;return I.forEach((u)=>{if(!a.isAbsolute(u)&&!this._closers.has(u)){if(_)u=a.join(_,u);u=a.resolve(u)}if(this._closePath(u),this._addIgnoredPath(u),this._watched.has(u))this._addIgnoredPath({path:u,recursive:!0});this._userIgnored=void 0}),this}close(){if(this._closePromise)return this._closePromise;this.closed=!0,this.removeAllListeners();let $=[];return this._closers.forEach((I)=>I.forEach((_)=>{let u=_();if(u instanceof Promise)$.push(u)})),this._streams.forEach((I)=>I.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach((I)=>I.dispose()),this._closers.clear(),this._watched.clear(),this._streams.clear(),this._symlinkPaths.clear(),this._throttled.clear(),this._closePromise=$.length?Promise.all($).then(()=>{return}):Promise.resolve(),this._closePromise}getWatched(){let $={};return this._watched.forEach((I,_)=>{let U=(this.options.cwd?a.relative(this.options.cwd,_):_)||_T;$[U]=I.getChildren().sort()}),$}emitWithAll($,I){if(this.emit($,...I),$!==v$.ERROR)this.emit(v$.ALL,$,...I)}async _emit($,I,_){if(this.closed)return;let u=this.options;if(iq)I=a.normalize(I);if(u.cwd)I=a.relative(u.cwd,I);let U=[I];if(_!=null)U.push(_);let g=u.awaitWriteFinish,z;if(g&&(z=this._pendingWrites.get(I)))return z.lastChange=new Date,this;if(u.atomic){if($===v$.UNLINK)return this._pendingUnlinks.set(I,[$,...U]),setTimeout(()=>{this._pendingUnlinks.forEach((G,J)=>{this.emit(...G),this.emit(v$.ALL,...G),this._pendingUnlinks.delete(J)})},typeof u.atomic==="number"?u.atomic:100),this;if($===v$.ADD&&this._pendingUnlinks.has(I))$=v$.CHANGE,this._pendingUnlinks.delete(I)}if(g&&($===v$.ADD||$===v$.CHANGE)&&this._readyEmitted){let G=(J,X)=>{if(J)$=v$.ERROR,U[0]=J,this.emitWithAll($,U);else if(X){if(U.length>1)U[1]=X;else U.push(X);this.emitWithAll($,U)}};return this._awaitWriteFinish(I,g.stabilityThreshold,$,G),this}if($===v$.CHANGE){if(!this._throttle(v$.CHANGE,I,50))return this}if(u.alwaysStat&&_===void 0&&($===v$.ADD||$===v$.ADD_DIR||$===v$.CHANGE)){let G=u.cwd?a.join(u.cwd,I):I,J;try{J=await If(G)}catch(X){}if(!J||this.closed)return;U.push(J)}return this.emitWithAll($,U),this}_handleError($){let I=$&&$.code;if($&&I!=="ENOENT"&&I!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||I!=="EPERM"&&I!=="EACCES"))this.emit(v$.ERROR,$);return $||this.closed}_throttle($,I,_){if(!this._throttled.has($))this._throttled.set($,new Map);let u=this._throttled.get($);if(!u)throw Error("invalid throttle");let U=u.get(I);if(U)return U.count++,!1;let g,z=()=>{let J=u.get(I),X=J?J.count:0;if(u.delete(I),clearTimeout(g),J)clearTimeout(J.timeoutObject);return X};g=setTimeout(z,_);let G={timeoutObject:g,clear:z,count:0};return u.set(I,G),G}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish($,I,_,u){let U=this.options.awaitWriteFinish;if(typeof U!=="object")return;let g=U.pollInterval,z,G=$;if(this.options.cwd&&!a.isAbsolute($))G=a.join(this.options.cwd,$);let J=new Date,X=this._pendingWrites;function N(q){sC(G,(Q,Y)=>{if(Q||!X.has($)){if(Q&&Q.code!=="ENOENT")u(Q);return}let O=Number(new Date);if(q&&Y.size!==q.size)X.get($).lastChange=O;let H=X.get($);if(O-H.lastChange>=I)X.delete($),u(void 0,Y);else z=setTimeout(N,g,Y)})}if(!X.has($))X.set($,{lastChange:J,cancelWait:()=>{return X.delete($),clearTimeout(z),_}}),z=setTimeout(N,g)}_isIgnored($,I){if(this.options.atomic&&zf.test($))return!0;if(!this._userIgnored){let{cwd:_}=this.options,U=(this.options.ignored||[]).map(UT(_)),z=[...[...this._ignoredPaths].map(UT(_)),...U];this._userIgnored=qf(z,void 0)}return this._userIgnored($,I)}_isntIgnored($,I){return!this._isIgnored($,I)}_getWatchHelpers($){return new GT($,this.options.followSymlinks,this)}_getWatchedDir($){let I=a.resolve($);if(!this._watched.has(I))this._watched.set(I,new zT(I,this._boundRemove));return this._watched.get(I)}_hasReadPermissions($){if(this.options.ignorePermissionErrors)return!0;return Boolean(Number($.mode)&256)}_remove($,I,_){let u=a.join($,I),U=a.resolve(u);if(_=_!=null?_:this._watched.has(u)||this._watched.has(U),!this._throttle("remove",u,100))return;if(!_&&this._watched.size===1)this.add($,I,!0);this._getWatchedDir(u).getChildren().forEach((q)=>this._remove(u,q));let G=this._getWatchedDir($),J=G.has(I);if(G.remove(I),this._symlinkPaths.has(U))this._symlinkPaths.delete(U);let X=u;if(this.options.cwd)X=a.relative(this.options.cwd,u);if(this.options.awaitWriteFinish&&this._pendingWrites.has(X)){if(this._pendingWrites.get(X).cancelWait()===v$.ADD)return}this._watched.delete(u),this._watched.delete(U);let N=_?v$.UNLINK_DIR:v$.UNLINK;if(J&&!this._isIgnored(u))this._emit(N,u);this._closePath(u)}_closePath($){this._closeFile($);let I=a.dirname($);this._getWatchedDir(I).remove(a.basename($))}_closeFile($){let I=this._closers.get($);if(!I)return;I.forEach((_)=>_()),this._closers.delete($)}_addPathCloser($,I){if(!I)return;let _=this._closers.get($);if(!_)_=[],this._closers.set($,_);_.push(I)}_readdirp($,I){if(this.closed)return;let _={type:v$.ALL,alwaysStat:!0,lstat:!0,...I,depth:0},u=cv($,_);return this._streams.add(u),u.once(tv,()=>{u=void 0}),u.once(kq,()=>{if(u)this._streams.delete(u),u=void 0}),u}}function C2($,I={}){let _=new JT(I);return _.add($),_}var WI=Y$(Z$(),1);var Cx=Y$(_M(),1),fx=Y$(oq(),1),xx=Y$(tq(),1),_5=Y$(c2(),1),u5=Y$(qM(),1);var NM=process.env.DASHBOARD_PORT?parseInt(process.env.DASHBOARD_PORT||"9847",10):9847;function mx(){if(process.env.MEMORIES_DIR)return process.env.MEMORIES_DIR;let $=process.argv[3];if($)return W4($,".serena","memories");return W4(process.cwd(),".serena","memories")}function zU($){try{return yx($,"utf-8")}catch{return""}}function nx($){try{let I=gU($);if(I.includes("orchestrator-session.md"))return W4($,"orchestrator-session.md");let _=I.filter((u)=>/^session-.*\.md$/.test(u)).map((u)=>({name:u,mtime:G5(W4($,u)).mtimeMs})).sort((u,U)=>U.mtime-u.mtime);if(_.length>0&&_[0])return W4($,_[0].name)}catch{}return null}function rx($){let I=nx($);if(!I)return{id:"N/A",status:"UNKNOWN"};let _=zU(I);if(!_)return{id:"N/A",status:"UNKNOWN"};let u=(_.match(/session-id:\s*(.+)/i)||[])[1]||(_.match(/# Session:\s*(.+)/i)||[])[1]||_.match(/(session-\d{8}-\d{6})/)?.[1]||QM(I,".md")||"N/A",U="UNKNOWN";if(/IN PROGRESS|RUNNING|## Active|\[IN PROGRESS\]/i.test(_))U="RUNNING";else if(/COMPLETED|DONE|## Completed|\[COMPLETED\]/i.test(_))U="COMPLETED";else if(/FAILED|ERROR|## Failed|\[FAILED\]/i.test(_))U="FAILED";else if(/Step \d+:.*\[/i.test(_))U="RUNNING";return{id:u.trim(),status:U}}function hx($){let I=zU(W4($,"task-board.md"));if(!I)return[];let _=[],u=I.split(`
|
|
460
|
-
`);for(let U of u){if(!U.startsWith("|")||/^\|\s*-+/.test(U))continue;let g=U.split("|").map((G)=>G.trim()).filter(Boolean),z=g[0];if(g.length<2||!z||/^agent$/i.test(z))continue;_.push({agent:g[0]||"",status:g[1]||"pending",task:g[2]||""})}return _}function z5($,I){try{let _=gU($).filter((g)=>g.startsWith(`progress-${I}`)&&g.endsWith(".md")).sort().reverse();if(_.length===0)return null;let U=(_[0]?zU(W4($,_[0])):"").match(/turn[:\s]*(\d+)/i);return U?.[1]?parseInt(U[1],10):null}catch{return null}}function cx($){try{return gU($).filter((_)=>_.endsWith(".md")&&_!==".gitkeep").map((_)=>({name:_,mtime:G5(W4($,_)).mtimeMs})).sort((_,u)=>u.mtime-_.mtime).slice(0,5).map((_)=>{let u=_.name.replace(/^(progress|result|session|debug|task)-?/,"").replace(/[-_]agent/,"").replace(/[-_]completion/,"").replace(/\.md$/,"").replace(/[-_]/g," ").trim()||_.name.replace(/\.md$/,""),g=zU(W4($,_.name)).split(`
|
|
461
|
-
`)
|
|
458
|
+
`)}let W=y$(u,".agents","skills","oma-backend","variants");if($6(W))fq(W,{recursive:!0,force:!0});let E=Q1(u);if(E.length>0)_.note(E.map((l)=>`${i$.default.green("✓")} ${l}`).join(`
|
|
459
|
+
`),"Migration");await W2(u,N.version);let C=q2(u),k=C.filter((l)=>l!=="copilot");if(HI(Q,u,k),C.includes("claude")){let l=y$(u,".claude","settings.json"),u$={};if($6(l))try{u$=JSON.parse(C2(l,"utf-8"))}catch{u$={}}if(v2(u$))T2(u$),UU(l,`${JSON.stringify(u$,null,2)}
|
|
460
|
+
`)}if(C.includes("gemini")){let l=y$(u,".gemini","settings.json"),u$={};if($6(l))try{u$=JSON.parse(C2(l,"utf-8"))}catch{u$={}}if(BI(u$))S6(u$),UU(l,`${JSON.stringify(u$,null,2)}
|
|
461
|
+
`)}if(C.includes("cursor"))OI(u),b6(u);let w=new Set;for(let l of["claude","gemini","codex","cursor","qwen"]){if(!C.includes(l))continue;let u$=l==="claude"?"CLAUDE.md":l==="gemini"?"GEMINI.md":"AGENTS.md";if(w.has(u$))continue;if(NI(u,l))w.add(u$)}if(J)Hq(u,!1);let X$=y$(u,".agents",".migration-backup");if($6(X$))fq(X$,{recursive:!0,force:!0});{let l=FO(u);V2(u,l)}_.note("Skipped global HOME-level configuration updates during project update.","Notice");let t=Y2(u);if(X.stop(q?i$.default.green("Reconciled after migrations!"):`Updated to version ${i$.default.cyan(N.version)}!`),t.length>0){let l=H2(u);if(l.length>0){let{created:u$}=vI(u,t,l);if(u$.length>0)_.note(u$.map((w$)=>`${i$.default.green("→")} ${w$}`).join(`
|
|
462
|
+
`),"Symlinks updated")}}if(_.outro(q?`Reconciled to version ${i$.default.cyan(N.version)}`:`${N.metadata?.totalFiles??0} files updated successfully`),!I&&J1()&&x4()&&!X1()){let l=await f$({message:`${i$.default.yellow("⭐")} Star ${i$.default.cyan(W$)} on GitHub? It helps a lot!`});if(!J$(l)&&l)try{XC(`gh api -X PUT /user/starred/${W$}`,{stdio:"ignore"}),U$.success(`Starred ${i$.default.cyan(W$)}! Thank you! \uD83C\uDF1F`)}catch{U$.warn(`Could not star automatically. Try: ${i$.default.dim(`gh api --method PUT /user/starred/${W$}`)}`)}}}finally{Y()}}catch(N){if(X?.stop("Update failed"),_.logError(N instanceof Error?N.message:String(N)),I)throw N;process.exit(1)}}U4();var l$=O$(Z$(),1);import{execSync as HC}from"node:child_process";import{existsSync as I6,readdirSync as yv,readFileSync as xq}from"node:fs";import{join as y4}from"node:path";var fv=["backend","frontend","mobile","qa","debug","pm"];function YC($,I){let _=y4($,".serena","memories");if(!I6(_))return null;let u=new RegExp(`^result-${I}(?:-[\\w-]+)?\\.md$`),U=yv(_).filter((g)=>u.test(g)).sort().reverse();if(U.length===0)return null;if(!U[0])throw Error(`No retrospective memory found for agent ${I}`);return y4(_,U[0])}function n($,I,_){return{name:$,status:I,message:_}}function P$($,I){try{return HC($,{encoding:"utf-8",cwd:I,stdio:["pipe","pipe","pipe"]}).trim()}catch{return null}}function OC($,I){let _=iv($);if(!_)return n("Scope Check","skip","No plan file found");let u;try{u=JSON.parse(xq(_,"utf-8"))}catch{return n("Scope Check","skip","Invalid plan file")}let U=u.tasks?.filter((X)=>X.agent?.toLowerCase()===I);if(!U||U.length===0)return n("Scope Check","skip","No tasks for this agent");let g=U.flatMap((X)=>X.scope??[]);if(g.length===0)return n("Scope Check","skip","No scope defined in plan");let z=P$("git diff --name-only HEAD 2>/dev/null || git diff --name-only --cached 2>/dev/null",$);if(!z)return n("Scope Check","pass","No files changed");let G=z.split(`
|
|
463
|
+
`).filter(Boolean),J=[];for(let X of G)if(!g.some((q)=>X.startsWith(q)))J.push(X);if(J.length>0)return n("Scope Check","fail",`${J.length} out-of-scope: ${J[0]}${J.length>1?` +${J.length-1}`:""}`);return n("Scope Check","pass",`All ${G.length} files in scope`)}function vC($,I){let _=YC($,I);if(!_)return n("Charter Preflight","skip","Result file not found");let u=xq(_,"utf-8");if(!u.includes("CHARTER_CHECK:"))return n("Charter Preflight","warn","Block missing from result");if(/\{[^}]+\}/.test(u.split("CHARTER_CHECK:")[1]?.split("```")[0]||""))return n("Charter Preflight","warn","Contains unfilled placeholders");return n("Charter Preflight","pass","Properly filled")}function TC($){let I=["*.py","*.ts","*.tsx","*.js","*.dart"],_=`(password|secret|api_key|token)\\s*=\\s*['"][^'"]{8,}`;for(let u of I){let U=P$(`grep -rn --include="${u}" -E "(password|secret|api_key|token)\\s*=\\s*['"][^'"]{8,}" . 2>/dev/null | grep -v test | grep -v example | grep -v node_modules | head -1`,$);if(U)return n("Hardcoded Secrets","fail",`Found in: ${U.split(":")[0]}`)}return n("Hardcoded Secrets","pass","None detected")}function MC($){let I=P$('grep -rn --include="*.py" --include="*.ts" --include="*.tsx" --include="*.js" --include="*.dart" -E "TODO|FIXME|HACK|XXX" . 2>/dev/null | grep -v node_modules | grep -v ".agents/" | wc -l',$),_=Number.parseInt(I||"0",10);if(_>0)return n("TODO/FIXME Comments","warn",`${_} found`);return n("TODO/FIXME Comments","pass","None found")}function DC($){if(!P$("which uv",$))return n("Python Syntax","skip","uv not available");let _=P$('find . -name "*.py" -not -path "*/node_modules/*" -not -path "*/.venv/*" -exec uv run python -m py_compile {} \\; 2>&1 | head -5',$);if(_&&_.length>0)return n("Python Syntax","fail","Syntax errors found");return n("Python Syntax","pass","Valid")}function LC($){if(P$(`grep -rn --include="*.py" -E "f['"].*SELECT|f['"].*INSERT|f['"].*UPDATE|f['"].*DELETE" . 2>/dev/null | grep -v test | grep -v node_modules | head -1`,$))return n("SQL Injection","fail","f-string with SQL keywords detected");return n("SQL Injection","pass","None detected")}function xv($){let I=P$("which uv",$),_=I6(y4($,"pyproject.toml"));if(!I||!_)return n("Python Tests","skip",!I?"uv not available":"pyproject.toml not found");let u=P$("uv run pytest -q --tb=no 2>&1",$);if(u?.includes("passed")||u?.includes("no tests ran"))return n("Python Tests","pass","Tests pass");return n("Python Tests","fail","Tests failing")}function BC($){if(!I6(y4($,"tsconfig.json")))return n("TypeScript","skip","Not configured");let I=P$("npx tsc --noEmit 2>&1",$);if(I===null||I==="")return n("TypeScript","pass","Compilation clean");if(I.includes("error"))return n("TypeScript","fail","Type errors found");return n("TypeScript","pass","Compilation clean")}function KC($){let I=P$(`grep -rn --include="*.tsx" --include="*.jsx" 'style={{' . 2>/dev/null | grep -v node_modules | wc -l`,$),_=Number.parseInt(I||"0",10);if(_>0)return n("Inline Styles","warn",`${_} found (prefer Tailwind)`);return n("Inline Styles","pass","None found")}function WC($){let I=P$(`grep -rn --include="*.ts" --include="*.tsx" ': any' . 2>/dev/null | grep -v node_modules | grep -v ".d.ts" | wc -l`,$),_=Number.parseInt(I||"0",10);if(_>3)return n("Any Types","fail",`${_} found (limit: 3)`);if(_>0)return n("Any Types","warn",`${_} found`);return n("Any Types","pass","None found")}function kv($){if(!I6(y4($,"package.json")))return n("Frontend Tests","skip","No package.json");let I=P$("npx vitest run --reporter=verbose 2>&1",$);if(I?.includes("passed")||I?.includes("✓"))return n("Frontend Tests","pass","Tests pass");return n("Frontend Tests","warn","Tests failed or vitest not configured")}function RC($){if(!P$("which flutter",$)){if(!P$("which dart",$))return n("Flutter/Dart Analysis","skip","Not available");if(P$("dart analyze 2>&1",$)?.includes("No issues found"))return n("Dart Analysis","pass","Clean");return n("Dart Analysis","fail","Issues found")}if(P$("flutter analyze 2>&1",$)?.includes("No issues found"))return n("Flutter Analysis","pass","Clean");return n("Flutter Analysis","fail","Issues found")}function VC($){if(!P$("which flutter",$))return n("Flutter Tests","skip","Flutter not available");if(P$("flutter test 2>&1",$)?.includes("All tests passed"))return n("Flutter Tests","pass","All tests pass");return n("Flutter Tests","fail","Tests failed")}function iv($){let I=y4($,".agents","results");if(I6(I))try{let u=yv(I).filter((U)=>U.startsWith("plan-")&&U.endsWith(".json")).sort().reverse();if(u.length>0&&u[0])return y4(I,u[0])}catch{}let _=y4($,".agents","plan.json");return I6(_)?_:null}function ZC($){let I=iv($);if(!I)return n("PM Plan","warn","No plan file found");try{return JSON.parse(xq(I,"utf-8")),n("PM Plan","pass","Valid JSON")}catch{return n("PM Plan","fail","Invalid JSON")}}function AC($,I){let _=[];switch($){case"backend":_.push(DC(I)),_.push(LC(I)),_.push(xv(I));break;case"frontend":_.push(BC(I)),_.push(KC(I)),_.push(WC(I)),_.push(kv(I));break;case"mobile":_.push(RC(I)),_.push(VC(I));break;case"qa":_.push(n("QA Report","pass","Verified by self-check.md"));break;case"debug":if(I6(y4(I,"pyproject.toml")))_.push(xv(I));else if(I6(y4(I,"package.json")))_.push(kv(I));else _.push(n("Debug Tests","skip","No test runner detected"));break;case"pm":_.push(ZC(I));break}return _}async function lv($,I,_=!1){let u=$.toLowerCase();if(!fv.includes(u)){let Q=`Invalid agent type: ${$}. Valid types: ${fv.join(", ")}`;if(_)console.log(JSON.stringify({ok:!1,error:Q}));else U$.error(Q);process.exit(2)}let U=I||process.cwd();if(!I6(U)){let Q=`Workspace not found: ${U}`;if(_)console.log(JSON.stringify({ok:!1,error:Q}));else U$.error(Q);process.exit(2)}let g=[];g.push(OC(U,u)),g.push(vC(U,u)),g.push(TC(U)),g.push(MC(U)),g.push(...AC(u,U));let z=g.filter((Q)=>Q.status==="pass").length,G=g.filter((Q)=>Q.status==="fail").length,J=g.filter((Q)=>Q.status==="warn").length,X={ok:G===0,agent:u,workspace:U,checks:g,summary:{passed:z,failed:G,warned:J}};if(_)console.log(JSON.stringify(X,null,2)),process.exit(G>0?1:0);console.clear(),L$(l$.default.bgCyan(l$.default.white(` \uD83D\uDD0D Verify: ${u} agent `))),i(l$.default.dim(U),"Workspace");let N=["┌────────────────────────────┬────────┬─────────────────────────────┐",`│ ${l$.default.bold("Check")} │ ${l$.default.bold("Status")} │ ${l$.default.bold("Details")} │`,"├────────────────────────────┼────────┼─────────────────────────────┤",...g.map((Q)=>{let Y;switch(Q.status){case"pass":Y=l$.default.green("PASS");break;case"fail":Y=l$.default.red("FAIL");break;case"warn":Y=l$.default.yellow("WARN");break;default:Y=l$.default.dim("SKIP")}let O=Q.name.padEnd(26),H=Y.padEnd(6),v=(Q.message||"-").slice(0,27).padEnd(27);return`│ ${O} │ ${H} │ ${v} │`}),"└────────────────────────────┴────────┴─────────────────────────────┘"].join(`
|
|
464
|
+
`);console.log(N),console.log();let q=`${l$.default.green(`${z} passed`)}, ${l$.default.red(`${G} failed`)}, ${l$.default.yellow(`${J} warnings`)}`;if(G>0)p(l$.default.red(`❌ Verification failed: ${q}`)),process.exit(1);p(l$.default.green(`✅ Verification passed: ${q}`)),process.exit(0)}var v$=O$(Z$(),1);import{existsSync as bC,readdirSync as mv,readFileSync as PC}from"node:fs";import{join as K4}from"node:path";var nv=Object.fromEntries(Object.entries(_4).map(([$,I])=>[$,I.map((_)=>_.name)])),jC={"backend-engineer":"oma-backend","frontend-engineer":"oma-frontend","db-engineer":"oma-db","mobile-engineer":"oma-mobile","pm-planner":"oma-pm","qa-reviewer":"oma-qa","debug-investigator":"oma-debug"};function kq($){let I=new Set;for(let _ of $.matchAll(/_shared\/((?:[a-z][a-z0-9_-]*\/)*[a-z][a-z0-9_-]*)(?:\.md)?(?=[`)\s/}]|$)/gi))if(_[1])I.add(_[1]);return[...I]}function f2($){try{return PC($,"utf-8")}catch{return""}}function yq($){try{return mv($).filter((I)=>!I.startsWith("."))}catch{return[]}}function SC($){try{return mv($,{withFileTypes:!0}).filter((I)=>!I.name.startsWith("."))}catch{return[]}}function rv($,I=""){let _=[];for(let u of SC($)){let U=I?`${I}/${u.name}`:u.name;if(u.isDirectory()){_.push({path:U,isDirectory:!0}),_.push(...rv(K4($,u.name),U));continue}if(!u.name.endsWith(".md"))continue;_.push({path:U.replace(/\.md$/,""),isDirectory:!1})}return _}function hv($){let I=[{id:"root",label:"oh-my-agent",category:"root"}],_=new Set,u=[];function U(q,Q,Y){let O=`${q}|${Q}`;if(_.has(O))return;_.add(O),u.push({from:q,to:Q,type:Y})}let g=K4($,".agents","skills");for(let[q,Q]of Object.entries(nv))for(let Y of Q){let O=K4(g,Y);if(!bC(O))continue;let H=`skill:${Y}`;I.push({id:H,label:Y,category:"skill",group:"Skills",subgroup:q});let v=[f2(K4(O,"SKILL.md")),f2(K4(O,"resources","execution-protocol.md"))].join(`
|
|
465
|
+
`);for(let T of kq(v))U(H,`shared:${T}`,"references")}let z=K4($,".agents","workflows");for(let q of yq(z).filter((Q)=>Q.endsWith(".md"))){let Q=q.replace(".md",""),Y=`workflow:${Q}`;I.push({id:Y,label:Q,category:"workflow",group:"Workflows"});for(let O of kq(f2(K4(z,q))))U(Y,`shared:${O}`,"references")}let G=K4(g,"_shared");for(let q of rv(G)){let Q=`shared:${q.path}`;if(I.push({id:Q,label:q.path,category:"shared",group:"Shared"}),!q.isDirectory){for(let Y of kq(f2(K4(G,`${q.path}.md`))))if(Y!==q.path)U(Q,`shared:${Y}`,"references")}}let J=K4($,".claude","agents");for(let q of yq(J).filter((Q)=>Q.endsWith(".md"))){let Q=q.replace(".md",""),Y=`agent:${Q}`;I.push({id:Y,label:Q,category:"agent",group:"Claude Agents"});let O=jC[Q];if(O)U(Y,`skill:${O}`,"implements")}let X=K4($,".serena","memories");for(let q of yq(X).filter((Q)=>Q.endsWith(".md")))I.push({id:`memory:${q.replace(".md","")}`,label:q.replace(".md",""),category:"memory",group:"Serena Memories"});let N=new Set(I.map((q)=>q.id));return{nodes:I,edges:u.filter((q)=>N.has(q.from)&&N.has(q.to))}}var FC={root:($)=>v$.default.bold(v$.default.white($)),skill:v$.default.green,workflow:v$.default.blue,shared:v$.default.yellow,agent:v$.default.magenta,memory:v$.default.cyan};function g4($,I){return(FC[I]??v$.default.white)($)}function i4(...$){let I=$.sort((U,g)=>U[0]-g[0]),_="",u=0;for(let[U,g,z]of I){if(U>u)_+=" ".repeat(U-u);_+=g,u=U+z}return _}function wC($){let I=[],_=$.nodes.filter((w)=>w.category==="skill").length,u=$.nodes.filter((w)=>w.category==="workflow").length,U=$.nodes.filter((w)=>w.category==="shared").length,g=$.nodes.filter((w)=>w.category==="agent").length,z=$.nodes.filter((w)=>w.category==="memory").length,G=$.edges.filter((w)=>w.from.startsWith("skill:")&&w.to.startsWith("shared:")).length,J=$.edges.filter((w)=>w.from.startsWith("workflow:")&&w.to.startsWith("shared:")).length,X=$.edges.filter((w)=>w.type==="implements").length,N=$.edges.filter((w)=>w.from.startsWith("shared:")&&w.to.startsWith("shared:")).length,q=`Skills (${_})`,Q=`Workflows (${u})`,Y=`Shared (${U})`,O=`Agents (${g})`,H=`Memories (${z})`,v=10,T=29,K=48,D=19;I.push(i4([24,g4("oh-my-agent","root"),11])),I.push(i4([29,"│",1]));let B=Array(49).fill(" ");B[10]="┌",B[29]="┼",B[48]="┐";for(let w=11;w<48;w++)if(w!==29)B[w]="─";I.push(B.join("")),I.push(i4([10,"▼",1],[29,"▼",1],[48,"▼",1])),I.push(i4([10-(q.length>>1),g4(q,"skill"),q.length],[29-(Q.length>>1),g4(Q,"workflow"),Q.length],[48-(H.length>>1),g4(H,"memory"),H.length])),I.push(i4([10,"│",1],[29,"│",1]));let R=`${G} refs`,V=`${J} refs`;I.push(i4([10-(R.length>>1),v$.default.dim(R),R.length],[29-(V.length>>1),v$.default.dim(V),V.length])),I.push(i4([10,"│",1],[29,"│",1]));let M=Array(30).fill(" ");M[10]="└",M[19]="┬",M[29]="┘";for(let w=11;w<29;w++)if(w!==19)M[w]="─";I.push(M.join("")),I.push(i4([19,"▼",1]));let W=19-(Y.length>>1),E=i4([W,g4(Y,"shared"),Y.length]);if(N>0)E+=` ${v$.default.dim(`◂── ${N} internal`)}`;I.push(E),I.push("");let C=10-(O.length>>1),k=`──[${X} implements]──▸`;return I.push(i4([C,g4(O,"agent"),O.length])+` ${v$.default.dim(k)} ${g4("Skills","skill")}`),I}function cv($){let I=[];I.push(...wC($)),I.push(""),I.push(v$.default.dim("─".repeat(56))),I.push("");let _=new Map,u=new Map;for(let q of $.edges){if(!_.has(q.from))_.set(q.from,[]);if(_.get(q.from)?.push(q),q.to.startsWith("shared:"))u.set(q.to,(u.get(q.to)??0)+1)}function U(q){let Q=_.get(q);if(!Q?.length)return"";let Y=Q.map((H)=>$.nodes.find((v)=>v.id===H.to)?.label.replace(/\.md$/,"")??H.to.split(":")[1]),O=Y.length>4?`${Y.slice(0,3).join(", ")} +${Y.length-3}`:Y.join(", ");return` ${v$.default.dim("──▸")} ${v$.default.dim(O)}`}let g=$.nodes.filter((q)=>q.category==="skill"),z=Object.keys(nv);I.push(v$.default.bold(`Skills (${g.length})`));for(let q=0;q<z.length;q++){let Q=z[q],Y=g.filter((v)=>v.subgroup===Q);if(!Y.length)continue;let O=q===z.length-1;I.push(`${O?"└─":"├─"} ${v$.default.dim(Q)}`);let H=O?" ":"│ ";for(let v of Y){let T=v===Y.at(-1)?"└─":"├─";I.push(`${H}${T} ${g4(v.label,"skill")}${U(v.id)}`)}}I.push("");let G=$.nodes.filter((q)=>q.category==="workflow");I.push(v$.default.bold(`Workflows (${G.length})`));for(let q of G){let Q=q===G.at(-1)?"└─":"├─";I.push(`${Q} ${g4(q.label,"workflow")}${U(q.id)}`)}I.push("");let J=[...$.nodes.filter((q)=>q.category==="shared")].sort((q,Q)=>(u.get(Q.id)??0)-(u.get(q.id)??0));I.push(v$.default.bold(`Shared (${J.length})`));for(let q of J){let Q=q===J.at(-1)?"└─":"├─",Y=u.get(q.id)??0,O=Y>0?v$.default.dim(` (${Y} refs)`):"";I.push(`${Q} ${g4(q.label,"shared")}${O}${U(q.id)}`)}I.push("");let X=$.nodes.filter((q)=>q.category==="agent");I.push(v$.default.bold(`Claude Agents (${X.length})`));for(let q of X){let Q=q===X.at(-1)?"└─":"├─",Y=$.edges.find((H)=>H.from===q.id&&H.type==="implements"),O=Y?` ${v$.default.dim("──▸")} ${g4(Y.to.split(":")[1]??"","skill")}`:"";I.push(`${Q} ${g4(q.label,"agent")}${O}`)}I.push("");let N=$.nodes.filter((q)=>q.category==="memory");if(I.push(v$.default.bold(`Serena Memories (${N.length})`)),!N.length)I.push(`└─ ${v$.default.dim("(none)")}`);else for(let q of N){let Q=q===N.at(-1)?"└─":"├─";I.push(`${Q} ${g4(q.label,"memory")}`)}return I.join(`
|
|
466
|
+
`)}async function dv($){let I=hv(process.cwd());if($.json){console.log(JSON.stringify(I,null,2));return}console.log(cv(I))}import{existsSync as px,mkdirSync as tx,readdirSync as HU,readFileSync as ax,statSync as Y5}from"node:fs";import{createServer as ex}from"node:http";import{basename as LM,join as V4}from"node:path";import{EventEmitter as Xf}from"node:events";import{stat as qf,Stats as Ld}from"node:fs";import{readdir as Nf,stat as Qf}from"node:fs/promises";import*as a from"node:path";import{lstat as ov,readdir as EC,realpath as CC,stat as fC}from"node:fs/promises";import{join as xC,relative as kC,resolve as pv,sep as yC}from"node:path";import{Readable as iC}from"node:stream";var z4={FILE_TYPE:"files",DIR_TYPE:"directories",FILE_DIR_TYPE:"files_directories",EVERYTHING_TYPE:"all"},iq={root:".",fileFilter:($)=>!0,directoryFilter:($)=>!0,type:z4.FILE_TYPE,lstat:!1,depth:2147483648,alwaysStat:!1,highWaterMark:4096};Object.freeze(iq);var sv="READDIRP_RECURSIVE_ERROR",lC=new Set(["ENOENT","EPERM","EACCES","ELOOP",sv]),tv=[z4.DIR_TYPE,z4.EVERYTHING_TYPE,z4.FILE_DIR_TYPE,z4.FILE_TYPE],mC=new Set([z4.DIR_TYPE,z4.EVERYTHING_TYPE,z4.FILE_DIR_TYPE]),nC=new Set([z4.EVERYTHING_TYPE,z4.FILE_DIR_TYPE,z4.FILE_TYPE]),rC=($)=>lC.has($.code),hC=process.platform==="win32",av=($)=>!0,ev=($)=>{if($===void 0)return av;if(typeof $==="function")return $;if(typeof $==="string"){let I=$.trim();return(_)=>_.basename===I}if(Array.isArray($)){let I=$.map((_)=>_.trim());return(_)=>I.some((u)=>_.basename===u)}return av};class lq extends iC{parents;reading;parent;_stat;_maxDepth;_wantsDir;_wantsFile;_wantsEverything;_root;_isDirent;_statsProp;_rdOptions;_fileFilter;_directoryFilter;constructor($={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:$.highWaterMark});let I={...iq,...$},{root:_,type:u}=I;this._fileFilter=ev(I.fileFilter),this._directoryFilter=ev(I.directoryFilter);let U=I.lstat?ov:fC;if(hC)this._stat=(g)=>U(g,{bigint:!0});else this._stat=U;this._maxDepth=I.depth!=null&&Number.isSafeInteger(I.depth)?I.depth:iq.depth,this._wantsDir=u?mC.has(u):!1,this._wantsFile=u?nC.has(u):!1,this._wantsEverything=u===z4.EVERYTHING_TYPE,this._root=pv(_),this._isDirent=!I.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(_,1)],this.reading=!1,this.parent=void 0}async _read($){if(this.reading)return;this.reading=!0;try{while(!this.destroyed&&$>0){let I=this.parent,_=I&&I.files;if(_&&_.length>0){let{path:u,depth:U}=I,g=_.splice(0,$).map((G)=>this._formatEntry(G,u)),z=await Promise.all(g);for(let G of z){if(!G)continue;if(this.destroyed)return;let J=await this._getEntryType(G);if(J==="directory"&&this._directoryFilter(G)){if(U<=this._maxDepth)this.parents.push(this._exploreDir(G.fullPath,U+1));if(this._wantsDir)this.push(G),$--}else if((J==="file"||this._includeAsFile(G))&&this._fileFilter(G)){if(this._wantsFile)this.push(G),$--}}}else{let u=this.parents.pop();if(!u){this.push(null);break}if(this.parent=await u,this.destroyed)return}}}catch(I){this.destroy(I)}finally{this.reading=!1}}async _exploreDir($,I){let _;try{_=await EC($,this._rdOptions)}catch(u){this._onError(u)}return{files:_,depth:I,path:$}}async _formatEntry($,I){let _,u=this._isDirent?$.name:$;try{let U=pv(xC(I,u));_={path:kC(this._root,U),fullPath:U,basename:u},_[this._statsProp]=this._isDirent?$:await this._stat(U)}catch(U){this._onError(U);return}return _}_onError($){if(rC($)&&!this.destroyed)this.emit("warn",$);else this.destroy($)}async _getEntryType($){if(!$&&this._statsProp in $)return"";let I=$[this._statsProp];if(I.isFile())return"file";if(I.isDirectory())return"directory";if(I&&I.isSymbolicLink()){let _=$.fullPath;try{let u=await CC(_),U=await ov(u);if(U.isFile())return"file";if(U.isDirectory()){let g=u.length;if(_.startsWith(u)&&_.substr(g,1)===yC){let z=Error(`Circular symlink detected: "${_}" points to "${u}"`);return z.code=sv,this._onError(z)}return"directory"}}catch(u){return this._onError(u),""}}}_includeAsFile($){let I=$&&$[this._statsProp];return I&&this._wantsEverything&&!I.isDirectory()}}function $T($,I={}){let _=I.entryType||I.type;if(_==="both")_=z4.FILE_DIR_TYPE;if(_)I.type=_;if(!$)throw Error("readdirp: root argument is required. Usage: readdirp(root, options)");else if(typeof $!=="string")throw TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");else if(_&&!tv.includes(_))throw Error(`readdirp: Invalid type passed. Use one of ${tv.join(", ")}`);return I.root=$,new lq(I)}import{watch as cC,unwatchFile as IT,watchFile as dC}from"node:fs";import{realpath as mq,lstat as oC,open as pC,stat as _T}from"node:fs/promises";import{type as tC}from"node:os";import*as M$ from"node:path";var aC="data",hq="end",uT="close",i2=()=>{};var l2=process.platform,cq=l2==="win32",eC=l2==="darwin",sC=l2==="linux",$f=l2==="freebsd",gT=tC()==="OS400",T$={ALL:"all",READY:"ready",ADD:"add",CHANGE:"change",ADD_DIR:"addDir",UNLINK:"unlink",UNLINK_DIR:"unlinkDir",RAW:"raw",ERROR:"error"},W4=T$,If="watch",Uf={lstat:oC,stat:_T},Y1="listeners",x2="errHandlers",RI="rawEmitters",_f=[Y1,x2,RI],uf=new Set(["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),gf=($)=>uf.has(M$.extname($).slice(1).toLowerCase()),rq=($,I)=>{if($ instanceof Set)$.forEach(I);else I($)},_U=($,I,_)=>{let u=$[I];if(!(u instanceof Set))$[I]=u=new Set([u]);u.add(_)},zf=($)=>(I)=>{let _=$[I];if(_ instanceof Set)_.clear();else delete $[I]},uU=($,I,_)=>{let u=$[I];if(u instanceof Set)u.delete(_);else if(u===_)delete $[I]},zT=($)=>$ instanceof Set?$.size===0:!$,k2=new Map;function UT($,I,_,u,U){let g=(z,G)=>{if(_($),U(z,G,{watchedPath:$}),G&&$!==G)y2(M$.resolve($,G),Y1,M$.join($,G))};try{return cC($,{persistent:I.persistent},g)}catch(z){u(z);return}}var y2=($,I,_,u,U)=>{let g=k2.get($);if(!g)return;rq(g[I],(z)=>{z(_,u,U)})},Gf=($,I,_,u)=>{let{listener:U,errHandler:g,rawEmitter:z}=u,G=k2.get(I),J;if(!_.persistent){if(J=UT($,_,U,g,z),!J)return;return J.close.bind(J)}if(G)_U(G,Y1,U),_U(G,x2,g),_U(G,RI,z);else{if(J=UT($,_,y2.bind(null,I,Y1),g,y2.bind(null,I,RI)),!J)return;J.on(W4.ERROR,async(X)=>{let N=y2.bind(null,I,x2);if(G)G.watcherUnusable=!0;if(cq&&X.code==="EPERM")try{await(await pC($,"r")).close(),N(X)}catch(q){}else N(X)}),G={listeners:U,errHandlers:g,rawEmitters:z,watcher:J},k2.set(I,G)}return()=>{if(uU(G,Y1,U),uU(G,x2,g),uU(G,RI,z),zT(G.listeners))G.watcher.close(),k2.delete(I),_f.forEach(zf(G)),G.watcher=void 0,Object.freeze(G)}},nq=new Map,Jf=($,I,_,u)=>{let{listener:U,rawEmitter:g}=u,z=nq.get(I),G=z&&z.options;if(G&&(G.persistent<_.persistent||G.interval>_.interval))IT(I),z=void 0;if(z)_U(z,Y1,U),_U(z,RI,g);else z={listeners:U,rawEmitters:g,options:_,watcher:dC(I,_,(J,X)=>{rq(z.rawEmitters,(q)=>{q(W4.CHANGE,I,{curr:J,prev:X})});let N=J.mtimeMs;if(J.size!==X.size||N>X.mtimeMs||N===0)rq(z.listeners,(q)=>q($,J))})},nq.set(I,z);return()=>{if(uU(z,Y1,U),uU(z,RI,g),zT(z.listeners))nq.delete(I),IT(I),z.options=z.watcher=void 0,Object.freeze(z)}};class dq{fsw;_boundHandleError;constructor($){this.fsw=$,this._boundHandleError=(I)=>$._handleError(I)}_watchWithNodeFs($,I){let _=this.fsw.options,u=M$.dirname($),U=M$.basename($);this.fsw._getWatchedDir(u).add(U);let z=M$.resolve($),G={persistent:_.persistent};if(!I)I=i2;let J;if(_.usePolling){let X=_.interval!==_.binaryInterval;G.interval=X&&gf(U)?_.binaryInterval:_.interval,J=Jf($,z,G,{listener:I,rawEmitter:this.fsw._emitRaw})}else J=Gf($,z,G,{listener:I,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw});return J}_handleFile($,I,_){if(this.fsw.closed)return;let u=M$.dirname($),U=M$.basename($),g=this.fsw._getWatchedDir(u),z=I;if(g.has(U))return;let G=async(X,N)=>{if(!this.fsw._throttle(If,$,5))return;if(!N||N.mtimeMs===0)try{let q=await _T($);if(this.fsw.closed)return;let{atimeMs:Q,mtimeMs:Y}=q;if(!Q||Q<=Y||Y!==z.mtimeMs)this.fsw._emit(W4.CHANGE,$,q);if((eC||sC||$f)&&z.ino!==q.ino){this.fsw._closeFile(X),z=q;let O=this._watchWithNodeFs($,G);if(O)this.fsw._addPathCloser(X,O)}else z=q}catch(q){this.fsw._remove(u,U)}else if(g.has(U)){let{atimeMs:q,mtimeMs:Q}=N;if(!q||q<=Q||Q!==z.mtimeMs)this.fsw._emit(W4.CHANGE,$,N);z=N}},J=this._watchWithNodeFs($,G);if(!(_&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored($)){if(!this.fsw._throttle(W4.ADD,$,0))return;this.fsw._emit(W4.ADD,$,I)}return J}async _handleSymlink($,I,_,u){if(this.fsw.closed)return;let U=$.fullPath,g=this.fsw._getWatchedDir(I);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let z;try{z=await mq(_)}catch(G){return this.fsw._emitReady(),!0}if(this.fsw.closed)return;if(g.has(u)){if(this.fsw._symlinkPaths.get(U)!==z)this.fsw._symlinkPaths.set(U,z),this.fsw._emit(W4.CHANGE,_,$.stats)}else g.add(u),this.fsw._symlinkPaths.set(U,z),this.fsw._emit(W4.ADD,_,$.stats);return this.fsw._emitReady(),!0}if(this.fsw._symlinkPaths.has(U))return!0;this.fsw._symlinkPaths.set(U,!0)}_handleRead($,I,_,u,U,g,z){$=M$.join($,"");let G=u?`${$}:${u}`:$;if(z=this.fsw._throttle("readdir",G,1000),!z)return;let J=this.fsw._getWatchedDir(_.path),X=new Set,N=this.fsw._readdirp($,{fileFilter:(q)=>_.filterPath(q),directoryFilter:(q)=>_.filterDir(q)});if(!N)return;return N.on(aC,async(q)=>{if(this.fsw.closed){N=void 0;return}let Q=q.path,Y=M$.join($,Q);if(X.add(Q),q.stats.isSymbolicLink()&&await this._handleSymlink(q,$,Y,Q))return;if(this.fsw.closed){N=void 0;return}if(Q===u||!u&&!J.has(Q))this.fsw._incrReadyCount(),Y=M$.join(U,M$.relative(U,Y)),this._addToNodeFs(Y,I,_,g+1)}).on(W4.ERROR,this._boundHandleError),new Promise((q,Q)=>{if(!N)return Q();N.once(hq,()=>{if(this.fsw.closed){N=void 0;return}let Y=z?z.clear():!1;if(q(void 0),J.getChildren().filter((O)=>{return O!==$&&!X.has(O)}).forEach((O)=>{this.fsw._remove($,O)}),N=void 0,Y)this._handleRead($,!1,_,u,U,g,z)})})}async _handleDir($,I,_,u,U,g,z){let G=this.fsw._getWatchedDir(M$.dirname($)),J=G.has(M$.basename($));if(!(_&&this.fsw.options.ignoreInitial)&&!U&&!J)this.fsw._emit(W4.ADD_DIR,$,I);G.add(M$.basename($)),this.fsw._getWatchedDir($);let X,N,q=this.fsw.options.depth;if((q==null||u<=q)&&!this.fsw._symlinkPaths.has(z)){if(!U){if(await this._handleRead($,_,g,U,$,u,X),this.fsw.closed)return}N=this._watchWithNodeFs($,(Q,Y)=>{if(Y&&Y.mtimeMs===0)return;this._handleRead(Q,!1,g,U,$,u,X)})}return N}async _addToNodeFs($,I,_,u,U){let g=this.fsw._emitReady;if(this.fsw._isIgnored($)||this.fsw.closed)return g(),!1;let z=this.fsw._getWatchHelpers($);if(_)z.filterPath=(G)=>_.filterPath(G),z.filterDir=(G)=>_.filterDir(G);try{let G=await Uf[z.statMethod](z.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(z.watchPath,G))return g(),!1;let J=this.fsw.options.followSymlinks,X;if(G.isDirectory()){let N=M$.resolve($),q=J?await mq($):$;if(this.fsw.closed)return;if(X=await this._handleDir(z.watchPath,G,I,u,U,z,q),this.fsw.closed)return;if(N!==q&&q!==void 0)this.fsw._symlinkPaths.set(N,q)}else if(G.isSymbolicLink()){let N=J?await mq($):$;if(this.fsw.closed)return;let q=M$.dirname(z.watchPath);if(this.fsw._getWatchedDir(q).add(z.watchPath),this.fsw._emit(W4.ADD,z.watchPath,G),X=await this._handleDir(q,G,I,u,$,z,N),this.fsw.closed)return;if(N!==void 0)this.fsw._symlinkPaths.set(M$.resolve($),N)}else X=this._handleFile(z.watchPath,G,I);if(g(),X)this.fsw._addPathCloser($,X);return!1}catch(G){if(this.fsw._handleError(G))return g(),$}}}/*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) */var oq="/",Hf="//",NT=".",Yf="..",Of="string",vf=/\\/g,QT=/\/\//g,Tf=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,Mf=/^\.[/\\]/;function m2($){return Array.isArray($)?$:[$]}var pq=($)=>typeof $==="object"&&$!==null&&!($ instanceof RegExp);function Df($){if(typeof $==="function")return $;if(typeof $==="string")return(I)=>$===I;if($ instanceof RegExp)return(I)=>$.test(I);if(typeof $==="object"&&$!==null)return(I)=>{if($.path===I)return!0;if($.recursive){let _=a.relative($.path,I);if(!_)return!1;return!_.startsWith("..")&&!a.isAbsolute(_)}return!1};return()=>!1}function Lf($){if(typeof $!=="string")throw Error("string expected");$=a.normalize($),$=$.replace(/\\/g,"/");let I=!1;if($.startsWith("//"))I=!0;if($=$.replace(QT,"/"),I)$="/"+$;return $}function GT($,I,_){let u=Lf(I);for(let U=0;U<$.length;U++){let g=$[U];if(g(u,_))return!0}return!1}function Bf($,I){if($==null)throw TypeError("anymatch: specify first argument");let u=m2($).map((U)=>Df(U));if(I==null)return(U,g)=>{return GT(u,U,g)};return GT(u,I)}var JT=($)=>{let I=m2($).flat();if(!I.every((_)=>typeof _===Of))throw TypeError(`Non-string provided as watch path: ${I}`);return I.map(HT)},XT=($)=>{let I=$.replace(vf,oq),_=!1;if(I.startsWith(Hf))_=!0;if(I=I.replace(QT,oq),_)I=oq+I;return I},HT=($)=>XT(a.normalize(XT($))),qT=($="")=>(I)=>{if(typeof I==="string")return HT(a.isAbsolute(I)?I:a.join($,I));else return I},Kf=($,I)=>{if(a.isAbsolute($))return $;return a.join(I,$)},Wf=Object.freeze(new Set);class YT{path;_removeWatcher;items;constructor($,I){this.path=$,this._removeWatcher=I,this.items=new Set}add($){let{items:I}=this;if(!I)return;if($!==NT&&$!==Yf)I.add($)}async remove($){let{items:I}=this;if(!I)return;if(I.delete($),I.size>0)return;let _=this.path;try{await Nf(_)}catch(u){if(this._removeWatcher)this._removeWatcher(a.dirname(_),a.basename(_))}}has($){let{items:I}=this;if(!I)return;return I.has($)}getChildren(){let{items:$}=this;if(!$)return[];return[...$.values()]}dispose(){this.items.clear(),this.path="",this._removeWatcher=i2,this.items=Wf,Object.freeze(this)}}var Rf="stat",Vf="lstat";class OT{fsw;path;watchPath;fullWatchPath;dirParts;followSymlinks;statMethod;constructor($,I,_){this.fsw=_;let u=$;this.path=$=$.replace(Mf,""),this.watchPath=u,this.fullWatchPath=a.resolve(u),this.dirParts=[],this.dirParts.forEach((U)=>{if(U.length>1)U.pop()}),this.followSymlinks=I,this.statMethod=I?Rf:Vf}entryPath($){return a.join(this.watchPath,a.relative(this.watchPath,$.fullPath))}filterPath($){let{stats:I}=$;if(I&&I.isSymbolicLink())return this.filterDir($);let _=this.entryPath($);return this.fsw._isntIgnored(_,I)&&this.fsw._hasReadPermissions(I)}filterDir($){return this.fsw._isntIgnored(this.entryPath($),$.stats)}}class vT extends Xf{closed;options;_closers;_ignoredPaths;_throttled;_streams;_symlinkPaths;_watched;_pendingWrites;_pendingUnlinks;_readyCount;_emitReady;_closePromise;_userIgnored;_readyEmitted;_emitRaw;_boundRemove;_nodeFsHandler;constructor($={}){super();this.closed=!1,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._streams=new Set,this._symlinkPaths=new Map,this._watched=new Map,this._pendingWrites=new Map,this._pendingUnlinks=new Map,this._readyCount=0,this._readyEmitted=!1;let I=$.awaitWriteFinish,_={stabilityThreshold:2000,pollInterval:100},u={persistent:!0,ignoreInitial:!1,ignorePermissionErrors:!1,interval:100,binaryInterval:300,followSymlinks:!0,usePolling:!1,atomic:!0,...$,ignored:$.ignored?m2($.ignored):m2([]),awaitWriteFinish:I===!0?_:typeof I==="object"?{..._,...I}:!1};if(gT)u.usePolling=!0;if(u.atomic===void 0)u.atomic=!u.usePolling;let U=process.env.CHOKIDAR_USEPOLLING;if(U!==void 0){let G=U.toLowerCase();if(G==="false"||G==="0")u.usePolling=!1;else if(G==="true"||G==="1")u.usePolling=!0;else u.usePolling=!!G}let g=process.env.CHOKIDAR_INTERVAL;if(g)u.interval=Number.parseInt(g,10);let z=0;this._emitReady=()=>{if(z++,z>=this._readyCount)this._emitReady=i2,this._readyEmitted=!0,process.nextTick(()=>this.emit(T$.READY))},this._emitRaw=(...G)=>this.emit(T$.RAW,...G),this._boundRemove=this._remove.bind(this),this.options=u,this._nodeFsHandler=new dq(this),Object.freeze(u)}_addIgnoredPath($){if(pq($)){for(let I of this._ignoredPaths)if(pq(I)&&I.path===$.path&&I.recursive===$.recursive)return}this._ignoredPaths.add($)}_removeIgnoredPath($){if(this._ignoredPaths.delete($),typeof $==="string"){for(let I of this._ignoredPaths)if(pq(I)&&I.path===$)this._ignoredPaths.delete(I)}}add($,I,_){let{cwd:u}=this.options;this.closed=!1,this._closePromise=void 0;let U=JT($);if(u)U=U.map((g)=>{return Kf(g,u)});if(U.forEach((g)=>{this._removeIgnoredPath(g)}),this._userIgnored=void 0,!this._readyCount)this._readyCount=0;return this._readyCount+=U.length,Promise.all(U.map(async(g)=>{let z=await this._nodeFsHandler._addToNodeFs(g,!_,void 0,0,I);if(z)this._emitReady();return z})).then((g)=>{if(this.closed)return;g.forEach((z)=>{if(z)this.add(a.dirname(z),a.basename(I||z))})}),this}unwatch($){if(this.closed)return this;let I=JT($),{cwd:_}=this.options;return I.forEach((u)=>{if(!a.isAbsolute(u)&&!this._closers.has(u)){if(_)u=a.join(_,u);u=a.resolve(u)}if(this._closePath(u),this._addIgnoredPath(u),this._watched.has(u))this._addIgnoredPath({path:u,recursive:!0});this._userIgnored=void 0}),this}close(){if(this._closePromise)return this._closePromise;this.closed=!0,this.removeAllListeners();let $=[];return this._closers.forEach((I)=>I.forEach((_)=>{let u=_();if(u instanceof Promise)$.push(u)})),this._streams.forEach((I)=>I.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach((I)=>I.dispose()),this._closers.clear(),this._watched.clear(),this._streams.clear(),this._symlinkPaths.clear(),this._throttled.clear(),this._closePromise=$.length?Promise.all($).then(()=>{return}):Promise.resolve(),this._closePromise}getWatched(){let $={};return this._watched.forEach((I,_)=>{let U=(this.options.cwd?a.relative(this.options.cwd,_):_)||NT;$[U]=I.getChildren().sort()}),$}emitWithAll($,I){if(this.emit($,...I),$!==T$.ERROR)this.emit(T$.ALL,$,...I)}async _emit($,I,_){if(this.closed)return;let u=this.options;if(cq)I=a.normalize(I);if(u.cwd)I=a.relative(u.cwd,I);let U=[I];if(_!=null)U.push(_);let g=u.awaitWriteFinish,z;if(g&&(z=this._pendingWrites.get(I)))return z.lastChange=new Date,this;if(u.atomic){if($===T$.UNLINK)return this._pendingUnlinks.set(I,[$,...U]),setTimeout(()=>{this._pendingUnlinks.forEach((G,J)=>{this.emit(...G),this.emit(T$.ALL,...G),this._pendingUnlinks.delete(J)})},typeof u.atomic==="number"?u.atomic:100),this;if($===T$.ADD&&this._pendingUnlinks.has(I))$=T$.CHANGE,this._pendingUnlinks.delete(I)}if(g&&($===T$.ADD||$===T$.CHANGE)&&this._readyEmitted){let G=(J,X)=>{if(J)$=T$.ERROR,U[0]=J,this.emitWithAll($,U);else if(X){if(U.length>1)U[1]=X;else U.push(X);this.emitWithAll($,U)}};return this._awaitWriteFinish(I,g.stabilityThreshold,$,G),this}if($===T$.CHANGE){if(!this._throttle(T$.CHANGE,I,50))return this}if(u.alwaysStat&&_===void 0&&($===T$.ADD||$===T$.ADD_DIR||$===T$.CHANGE)){let G=u.cwd?a.join(u.cwd,I):I,J;try{J=await Qf(G)}catch(X){}if(!J||this.closed)return;U.push(J)}return this.emitWithAll($,U),this}_handleError($){let I=$&&$.code;if($&&I!=="ENOENT"&&I!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||I!=="EPERM"&&I!=="EACCES"))this.emit(T$.ERROR,$);return $||this.closed}_throttle($,I,_){if(!this._throttled.has($))this._throttled.set($,new Map);let u=this._throttled.get($);if(!u)throw Error("invalid throttle");let U=u.get(I);if(U)return U.count++,!1;let g,z=()=>{let J=u.get(I),X=J?J.count:0;if(u.delete(I),clearTimeout(g),J)clearTimeout(J.timeoutObject);return X};g=setTimeout(z,_);let G={timeoutObject:g,clear:z,count:0};return u.set(I,G),G}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish($,I,_,u){let U=this.options.awaitWriteFinish;if(typeof U!=="object")return;let g=U.pollInterval,z,G=$;if(this.options.cwd&&!a.isAbsolute($))G=a.join(this.options.cwd,$);let J=new Date,X=this._pendingWrites;function N(q){qf(G,(Q,Y)=>{if(Q||!X.has($)){if(Q&&Q.code!=="ENOENT")u(Q);return}let O=Number(new Date);if(q&&Y.size!==q.size)X.get($).lastChange=O;let H=X.get($);if(O-H.lastChange>=I)X.delete($),u(void 0,Y);else z=setTimeout(N,g,Y)})}if(!X.has($))X.set($,{lastChange:J,cancelWait:()=>{return X.delete($),clearTimeout(z),_}}),z=setTimeout(N,g)}_isIgnored($,I){if(this.options.atomic&&Tf.test($))return!0;if(!this._userIgnored){let{cwd:_}=this.options,U=(this.options.ignored||[]).map(qT(_)),z=[...[...this._ignoredPaths].map(qT(_)),...U];this._userIgnored=Bf(z,void 0)}return this._userIgnored($,I)}_isntIgnored($,I){return!this._isIgnored($,I)}_getWatchHelpers($){return new OT($,this.options.followSymlinks,this)}_getWatchedDir($){let I=a.resolve($);if(!this._watched.has(I))this._watched.set(I,new YT(I,this._boundRemove));return this._watched.get(I)}_hasReadPermissions($){if(this.options.ignorePermissionErrors)return!0;return Boolean(Number($.mode)&256)}_remove($,I,_){let u=a.join($,I),U=a.resolve(u);if(_=_!=null?_:this._watched.has(u)||this._watched.has(U),!this._throttle("remove",u,100))return;if(!_&&this._watched.size===1)this.add($,I,!0);this._getWatchedDir(u).getChildren().forEach((q)=>this._remove(u,q));let G=this._getWatchedDir($),J=G.has(I);if(G.remove(I),this._symlinkPaths.has(U))this._symlinkPaths.delete(U);let X=u;if(this.options.cwd)X=a.relative(this.options.cwd,u);if(this.options.awaitWriteFinish&&this._pendingWrites.has(X)){if(this._pendingWrites.get(X).cancelWait()===T$.ADD)return}this._watched.delete(u),this._watched.delete(U);let N=_?T$.UNLINK_DIR:T$.UNLINK;if(J&&!this._isIgnored(u))this._emit(N,u);this._closePath(u)}_closePath($){this._closeFile($);let I=a.dirname($);this._getWatchedDir(I).remove(a.basename($))}_closeFile($){let I=this._closers.get($);if(!I)return;I.forEach((_)=>_()),this._closers.delete($)}_addPathCloser($,I){if(!I)return;let _=this._closers.get($);if(!_)_=[],this._closers.set($,_);_.push(I)}_readdirp($,I){if(this.closed)return;let _={type:T$.ALL,alwaysStat:!0,lstat:!0,...I,depth:0},u=$T($,_);return this._streams.add(u),u.once(uT,()=>{u=void 0}),u.once(hq,()=>{if(u)this._streams.delete(u),u=void 0}),u}}function n2($,I={}){let _=new vT(I);return _.add($),_}var FI=O$(Z$(),1);var cx=O$(NM(),1),dx=O$(I5(),1),ox=O$(_5(),1),q5=O$($g(),1),N5=O$(MM(),1);var DM=process.env.DASHBOARD_PORT?parseInt(process.env.DASHBOARD_PORT||"9847",10):9847;function sx(){if(process.env.MEMORIES_DIR)return process.env.MEMORIES_DIR;let $=process.argv[3];if($)return V4($,".serena","memories");return V4(process.cwd(),".serena","memories")}function YU($){try{return ax($,"utf-8")}catch{return""}}function $k($){try{let I=HU($);if(I.includes("orchestrator-session.md"))return V4($,"orchestrator-session.md");let _=I.filter((u)=>/^session-.*\.md$/.test(u)).map((u)=>({name:u,mtime:Y5(V4($,u)).mtimeMs})).sort((u,U)=>U.mtime-u.mtime);if(_.length>0&&_[0])return V4($,_[0].name)}catch{}return null}function Ik($){let I=$k($);if(!I)return{id:"N/A",status:"UNKNOWN"};let _=YU(I);if(!_)return{id:"N/A",status:"UNKNOWN"};let u=(_.match(/session-id:\s*(.+)/i)||[])[1]||(_.match(/# Session:\s*(.+)/i)||[])[1]||_.match(/(session-\d{8}-\d{6})/)?.[1]||LM(I,".md")||"N/A",U="UNKNOWN";if(/IN PROGRESS|RUNNING|## Active|\[IN PROGRESS\]/i.test(_))U="RUNNING";else if(/COMPLETED|DONE|## Completed|\[COMPLETED\]/i.test(_))U="COMPLETED";else if(/FAILED|ERROR|## Failed|\[FAILED\]/i.test(_))U="FAILED";else if(/Step \d+:.*\[/i.test(_))U="RUNNING";return{id:u.trim(),status:U}}function Uk($){let I=YU(V4($,"task-board.md"));if(!I)return[];let _=[],u=I.split(`
|
|
467
|
+
`);for(let U of u){if(!U.startsWith("|")||/^\|\s*-+/.test(U))continue;let g=U.split("|").map((G)=>G.trim()).filter(Boolean),z=g[0];if(g.length<2||!z||/^agent$/i.test(z))continue;_.push({agent:g[0]||"",status:g[1]||"pending",task:g[2]||""})}return _}function H5($,I){try{let _=HU($).filter((g)=>g.startsWith(`progress-${I}`)&&g.endsWith(".md")).sort().reverse();if(_.length===0)return null;let U=(_[0]?YU(V4($,_[0])):"").match(/turn[:\s]*(\d+)/i);return U?.[1]?parseInt(U[1],10):null}catch{return null}}function _k($){try{return HU($).filter((_)=>_.endsWith(".md")&&_!==".gitkeep").map((_)=>({name:_,mtime:Y5(V4($,_)).mtimeMs})).sort((_,u)=>u.mtime-_.mtime).slice(0,5).map((_)=>{let u=_.name.replace(/^(progress|result|session|debug|task)-?/,"").replace(/[-_]agent/,"").replace(/[-_]completion/,"").replace(/\.md$/,"").replace(/[-_]/g," ").trim()||_.name.replace(/\.md$/,""),g=YU(V4($,_.name)).split(`
|
|
468
|
+
`).map((G)=>G.trim()).filter((G)=>G&&!G.startsWith("---")&&G.length>3),z="";for(let G=g.length-1;G>=0;G--){let J=g[G];if(!J)continue;if(/^\*\*|^#+|^-|^\d+\.|Status|Result|Action|Step/i.test(J)){if(z=J.replace(/^[#*\-\d.]+\s*/,"").replace(/\*\*/g,"").trim(),z.length>5)break}}if(z.length>80)z=`${z.substring(0,77)}...`;return{agent:u,message:z,file:_.name}}).filter((_)=>_.message)}catch{return[]}}function uk($){let I=[],_=new Set;try{let u=HU($).filter((U)=>U.endsWith(".md")&&U!==".gitkeep").map((U)=>({name:U,mtime:Y5(V4($,U)).mtimeMs})).sort((U,g)=>g.mtime-U.mtime);for(let U of u){let g=YU(V4($,U.name)),z=g.match(/\*\*Agent\*\*:\s*(.+)/i)||g.match(/Agent:\s*(.+)/i)||g.match(/^#+\s*(.+?)\s*Agent/im),G=null;if(z?.[1])G=z[1].trim();else if(/_agent|agent_|-agent/i.test(U.name))G=U.name.replace(/\.md$/,"").replace(/[-_]completion|[-_]progress|[-_]result/gi,"").replace(/[-_]/g," ").trim();if(G&&!_.has(G.toLowerCase())){_.add(G.toLowerCase());let J="unknown";if(/\[COMPLETED\]|## Completed|## Results/i.test(g))J="completed";else if(/\[IN PROGRESS\]|## Progress|IN PROGRESS/i.test(g))J="running";else if(/\[FAILED\]|## Failed|ERROR/i.test(g))J="failed";let X=g.match(/## Task\s*\n+(.+)/i)||g.match(/\*\*Task\*\*:\s*(.+)/i),N=X?.[1]?X[1].trim().substring(0,60):"";I.push({agent:G,status:J,task:N,turn:H5($,G)})}}}catch{}return I}function Q5($){let I=Ik($),u=Uk($).map((U)=>({...U,turn:H5($,U.agent)}));if(u.length===0)u=uk($);if(u.length===0)try{let U=HU($).filter((g)=>g.startsWith("progress-")&&g.endsWith(".md"));for(let g of U){let z=g.replace(/^progress-/,"").replace(/\.md$/,"");u.push({agent:z,status:"running",task:"",turn:H5($,z)})}}catch{}return{session:I,agents:u,activity:_k($),memoriesDir:$,updatedAt:new Date().toISOString()}}var gk=`<!DOCTYPE html>
|
|
462
469
|
<html lang="en">
|
|
463
470
|
<head>
|
|
464
471
|
<meta charset="UTF-8">
|
|
@@ -515,15 +522,15 @@ source: migrated
|
|
|
515
522
|
fetch('/api/state').then(r=>r.json()).then(renderState).catch(()=>{});connect();
|
|
516
523
|
</script>
|
|
517
524
|
</body>
|
|
518
|
-
</html>`;function
|
|
519
|
-
Shutting down...`),g.close(),_.clients.forEach((z)=>{z.terminate()}),_.close(()=>I.close(()=>process.exit(0))),setTimeout(()=>process.exit(1),3000).unref()}),process.on("SIGTERM",()=>process.emit("SIGINT")),I.listen(
|
|
520
|
-
\uD83D\uDEF8 Serena Memory Dashboard`)),console.log(
|
|
521
|
-
`))})}var
|
|
522
|
-
`);for(let U of u){if(!U.startsWith("|")||/^\|\s*-+/.test(U))continue;let g=U.split("|").map((X)=>X.trim()).filter(Boolean),z=g[0];if(g.length<2||!z||/^agent$/i.test(z))continue;let G=g[1],J=g[2];_.push({agent:z,status:G||"pending",task:J||""})}return _}function
|
|
523
|
-
`).map((J)=>J.trim()).filter((J)=>J&&!J.startsWith("---")&&J.length>3),G="";for(let J=z.length-1;J>=0;J--){let X=z[J];if(!X)continue;if(/^\*\*|^#+|^-|^\d+\.|Status|Result|Action|Step/i.test(X)){if(G=X.replace(/^[#*\-\d.]+\s*/,"").replace(/\*\*/g,"").trim(),G.length>5)break}}if(G.length>52)G=`${G.substring(0,49)}...`;if(G)_.push({agent:U,message:G})}return _}catch{return[]}}function
|
|
524
|
-
\uD83D\uDEF8 Serena Terminal Dashboard`)),console.log(
|
|
525
|
-
`)),
|
|
526
|
-
`),I.close(),_(),process.exit(0)}),process.on("SIGTERM",()=>process.emit("SIGINT"))})}var
|
|
525
|
+
</html>`;function BM(){let $=sx();if(!px($))tx($,{recursive:!0});let I=ex((z,G)=>{if(z.url==="/api/state")G.writeHead(200,{"Content-Type":"application/json"}),G.end(JSON.stringify(Q5($)));else G.writeHead(200,{"Content-Type":"text/html"}),G.end(gk)}),_=new N5.default({server:I}),u=null;function U(z,G){if(u)clearTimeout(u);u=setTimeout(()=>{let J=JSON.stringify({type:"update",event:z,file:G,data:Q5($)});_.clients.forEach((X)=>{if(X.readyState===q5.default.OPEN)X.send(J)})},100)}let g=n2($,{persistent:!0,ignoreInitial:!0,awaitWriteFinish:{stabilityThreshold:200,pollInterval:50}});g.on("all",(z,G)=>U(z,LM(G))),_.on("connection",(z)=>{z.send(JSON.stringify({type:"full",data:Q5($)})),z.on("error",()=>z.terminate())}),process.on("SIGINT",()=>{console.log(`
|
|
526
|
+
Shutting down...`),g.close(),_.clients.forEach((z)=>{z.terminate()}),_.close(()=>I.close(()=>process.exit(0))),setTimeout(()=>process.exit(1),3000).unref()}),process.on("SIGTERM",()=>process.emit("SIGINT")),I.listen(DM,()=>{console.log(FI.magenta(`
|
|
527
|
+
\uD83D\uDEF8 Serena Memory Dashboard`)),console.log(FI.white(` http://localhost:${DM}`)),console.log(FI.dim(` Watching: ${$}
|
|
528
|
+
`))})}var KM={name:"oh-my-agent",version:"5.1.0",description:"Portable multi-agent harness for .agents-based skills and workflows across Antigravity, Claude Code, Codex, OpenCode, and more",type:"module",bin:{"oh-my-agent":"./bin/cli.js",oma:"./bin/cli.js"},files:["bin"],keywords:["oh-my-agent","antigravity",".agents","agent","skills","agent-skills","multi-agent","orchestrator","claude","claude-code","codex","opencode","copilot","cursor","chatgpt","pm","frontend","backend","mobile","qa","debug","terraform","database","workflow","bug-fixing","gemini"],author:"our.first.fluke <our.first.fluke@gmail.com>",contributors:["gracefullight <gracefullight.dev@gmail.com>","gahyun-git <go4it.gh@gmail.com>"],license:"MIT",funding:[{type:"github",url:"https://github.com/sponsors/first-fluke"},{type:"buymeacoffee",url:"https://buymeacoffee.com/firstfluke"}],scripts:{"sync:readme":"node ./scripts/sync-readme.mjs",build:"bun run sync:readme && bun build cli.ts --outfile bin/cli.js --target node --minify",dev:"bun run cli.ts",lint:"biome check --write --unsafe .",test:"vitest run",prepublishOnly:"bun run build"},dependencies:{"@clack/prompts":"^1.1.0",chokidar:"^5.0.0",commander:"^14.0.3","p-map":"^7.0.4",picocolors:"^1.1.1",ws:"^8.18.0",yaml:"^2.8.2",zod:"^4.3.6"},devDependencies:{"@biomejs/biome":"2.4.5","@types/bun":"^1.3.10","@types/ws":"^8.18.1",vitest:"^4.0.18"},peerDependencies:{typescript:"^6"},repository:{type:"git",url:"https://github.com/first-fluke/oh-my-agent"},antigravity:{skillsPath:".agents/skills",skills:["oma-architecture","oma-brainstorm","oma-coordination","oma-pm","oma-frontend","oma-backend","oma-db","oma-mobile","oma-qa","oma-debug","oma-orchestrator","oma-dev-workflow","oma-tf-infra","oma-scm","oma-pdf"]}};import{existsSync as Gk,mkdirSync as Jk,readdirSync as OU,readFileSync as Xk,statSync as v5}from"node:fs";import{basename as qk,join as Z4}from"node:path";var m$=O$(Z$(),1),Nk="●",Qk="✓",Hk="✗",Yk="○",Ok="◌";function vk(){if(process.env.MEMORIES_DIR)return process.env.MEMORIES_DIR;let $=process.argv[3];if($)return Z4($,".serena","memories");return Z4(process.cwd(),".serena","memories")}function vU($){try{return Xk($,"utf-8")}catch{return""}}function Tk($){try{let I=OU($);if(I.includes("orchestrator-session.md"))return Z4($,"orchestrator-session.md");let _=I.filter((u)=>/^session-.*\.md$/.test(u)).map((u)=>({name:u,mtime:v5(Z4($,u)).mtimeMs})).sort((u,U)=>U.mtime-u.mtime);if(_.length>0&&_[0])return Z4($,_[0].name)}catch{}return null}function Mk($){let I=Tk($);if(!I)return{id:"N/A",status:"UNKNOWN"};let _=vU(I);if(!_)return{id:"N/A",status:"UNKNOWN"};let u=(_.match(/session-id:\s*(.+)/i)||[])[1]||(_.match(/# Session:\s*(.+)/i)||[])[1]||_.match(/(session-\d{8}-\d{6})/)?.[1]||qk(I,".md"),U="UNKNOWN";if(/IN PROGRESS|RUNNING|## Active|\[IN PROGRESS\]/i.test(_))U="RUNNING";else if(/COMPLETED|DONE|## Completed|\[COMPLETED\]/i.test(_))U="COMPLETED";else if(/FAILED|ERROR|## Failed|\[FAILED\]/i.test(_))U="FAILED";else if(/Step \d+:.*\[/i.test(_))U="RUNNING";return{id:(u||"N/A").trim(),status:U}}function Dk($){let I=vU(Z4($,"task-board.md"));if(!I)return[];let _=[],u=I.split(`
|
|
529
|
+
`);for(let U of u){if(!U.startsWith("|")||/^\|\s*-+/.test(U))continue;let g=U.split("|").map((X)=>X.trim()).filter(Boolean),z=g[0];if(g.length<2||!z||/^agent$/i.test(z))continue;let G=g[1],J=g[2];_.push({agent:z,status:G||"pending",task:J||""})}return _}function O5($,I){try{let _=OU($).filter((g)=>g.startsWith(`progress-${I}`)&&g.endsWith(".md")).sort().reverse();if(_.length===0||!_[0])return null;let U=vU(Z4($,_[0])).match(/turn[:\s]*(\d+)/i);return U?.[1]?parseInt(U[1],10):null}catch{return null}}function Lk($){try{let I=OU($).filter((u)=>u.endsWith(".md")&&u!==".gitkeep").map((u)=>({name:u,mtime:v5(Z4($,u)).mtimeMs})).sort((u,U)=>U.mtime-u.mtime).slice(0,5),_=[];for(let u of I){let U=u.name.replace(/^(progress|result|session|debug|task)-?/,"").replace(/[-_]agent/,"").replace(/[-_]completion/,"").replace(/\.md$/,"").replace(/[-_]/g," ").trim()||u.name.replace(/\.md$/,""),z=vU(Z4($,u.name)).split(`
|
|
530
|
+
`).map((J)=>J.trim()).filter((J)=>J&&!J.startsWith("---")&&J.length>3),G="";for(let J=z.length-1;J>=0;J--){let X=z[J];if(!X)continue;if(/^\*\*|^#+|^-|^\d+\.|Status|Result|Action|Step/i.test(X)){if(G=X.replace(/^[#*\-\d.]+\s*/,"").replace(/\*\*/g,"").trim(),G.length>5)break}}if(G.length>52)G=`${G.substring(0,49)}...`;if(G)_.push({agent:U,message:G})}return _}catch{return[]}}function Bk($){let I=[],_=new Set;try{let u=OU($).filter((U)=>U.endsWith(".md")&&U!==".gitkeep").map((U)=>({name:U,mtime:v5(Z4($,U)).mtimeMs})).sort((U,g)=>g.mtime-U.mtime);for(let U of u){let g=vU(Z4($,U.name)),z=g.match(/\*\*Agent\*\*:\s*(.+)/i)||g.match(/Agent:\s*(.+)/i)||g.match(/^#+\s*(.+?)\s*Agent/im),G=null;if(z?.[1])G=z[1].trim();else if(/_agent|agent_|-agent/i.test(U.name))G=U.name.replace(/\.md$/,"").replace(/[-_]completion|[-_]progress|[-_]result/gi,"").replace(/[-_]/g," ").trim();if(G&&!_.has(G.toLowerCase())){_.add(G.toLowerCase());let J="unknown";if(/\[COMPLETED\]|## Completed|## Results/i.test(g))J="completed";else if(/\[IN PROGRESS\]|## Progress|IN PROGRESS/i.test(g))J="running";else if(/\[FAILED\]|## Failed|ERROR/i.test(g))J="failed";let X=g.match(/## Task\s*\n+(.+)/i)||g.match(/\*\*Task\*\*:\s*(.+)/i),N=X?.[1]?X[1].trim().substring(0,20):"";I.push({agent:G,status:J,task:N,turn:O5($,G)})}}}catch{}return I}function Kk($){let I=$.toLowerCase();if(["running","active","in_progress","in-progress"].includes(I))return`${m$.default.green(Nk)} running`;else if(["completed","done","finished"].includes(I))return`${m$.default.cyan(Qk)} completed`;else if(["failed","error"].includes(I))return`${m$.default.red(Hk)} failed`;else if(["blocked","waiting"].includes(I))return`${m$.default.yellow(Yk)} blocked`;return`${m$.default.dim(Ok)} pending`}function WM($){console.clear();let I=Mk($),u=Dk($).map((H)=>({...H,turn:O5($,H.agent)}));if(u.length===0)u=Bk($);if(u.length===0)try{let H=OU($).filter((v)=>v.startsWith("progress-")&&v.endsWith(".md"));for(let v of H){let T=v.replace(/^progress-/,"").replace(/\.md$/,"");u.push({agent:T,status:"running",task:"",turn:O5($,T)})}}catch{}let U=56,g="═".repeat(U),z=(H)=>" ".repeat(Math.max(0,H)),G=(H)=>m$.default.magenta(H),J=(H)=>m$.default.bold(H),X=(H)=>m$.default.dim(H),N=m$.default.yellow;if(I.status==="RUNNING")N=m$.default.green;else if(I.status==="COMPLETED")N=m$.default.cyan;else if(I.status==="FAILED")N=m$.default.red;console.log(`${G(`╔${g}╗`)}`),console.log(`${G("║")} ${J(G("Serena Memory Dashboard"))}${z(U-25)}${G("║")}`);let q=`Session: ${J(I.id.padEnd(20))} [${N(I.status)}]`;if(console.log(`${G("║")} ${q}${z(U-4-q.length-9)}${G("║")}`),console.log(`${G(`╠${g}╣`)}`),console.log(`${G("║")} ${J(`${"Agent".padEnd(12)} ${"Status".padEnd(12)} ${"Turn".padEnd(6)} ${"Task".padEnd(20)}`)} ${G("║")}`),console.log(`${G("║")} ${X(`${"──────────".padEnd(12)} ${"──────────".padEnd(12)} ${"────".padEnd(6)} ${"──────────────────".padEnd(20)}`)} ${G("║")}`),u.length===0)console.log(`${G("║")} ${X(`No agents detected yet${z(32)}`)}${G("║")}`);else for(let H of u){let v=Kk(H.status),T=H.turn!=null?String(H.turn):"-",K=H.task.substring(0,20);console.log(`${G("║")} ${H.agent.padEnd(12)} ${v.padEnd(22)} ${T.padEnd(6)} ${K.padEnd(20)}${G("║")}`)}console.log(`${G(`╠${g}╣`)}`),console.log(`${G("║")} ${J("Latest Activity:")}${z(U-18)}${G("║")}`);let Q=Lk($);if(Q.length===0)console.log(`${G("║")} ${X(`No activity yet${z(38)}`)}${G("║")}`);else for(let H of Q){let v=`[${H.agent}] ${H.message}`;console.log(`${G("║")} ${X(v.substring(0,52).padEnd(52))}${G("║")}`)}console.log(`${G(`╠${g}╣`)}`);let O=`Updated: ${new Date().toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})} | Ctrl+C to exit`;console.log(`${G("║")} ${X(O)}${z(U-4-O.length)}${G("║")}`),console.log(`${G(`╚${g}╝`)}`)}async function RM(){let $=vk();if(!Gk($))Jk($,{recursive:!0}),console.log(m$.default.yellow(`Created ${$} — waiting for memory files...`));console.log(m$.default.magenta(`
|
|
531
|
+
\uD83D\uDEF8 Serena Terminal Dashboard`)),console.log(m$.default.dim(` Watching: ${$}
|
|
532
|
+
`)),WM($);let I=n2($,{persistent:!0,ignoreInitial:!0,awaitWriteFinish:{stabilityThreshold:200,pollInterval:50}});return I.on("all",()=>WM($)),new Promise((_)=>{process.on("SIGINT",()=>{console.log(`
|
|
533
|
+
`),I.close(),_(),process.exit(0)}),process.on("SIGTERM",()=>process.emit("SIGINT"))})}var bM=KM.version,PM="OH_MY_AG_OUTPUT_FORMAT",TU=["text","json"],VM=["gemini","claude","codex","qwen"],ZM=["backend","frontend","mobile","qa","debug","pm"];function g6($,I="Output as JSON"){return $.option("--json",I).option("--output <format>","Output format (text/json)",(_)=>{let u=_.trim().toLowerCase();if(!TU.includes(u))throw Error(`Invalid output format: ${_}. Expected one of ${TU.join(", ")}`);return u})}function Wk($){if($?.json)return"json";let I=$?.output?.trim().toLowerCase();if(I&&TU.includes(I))return I;if(process.env[PM]?.trim().toLowerCase()==="json")return"json";return"text"}function m4($){return Wk($)==="json"}function jM($){let I=$.at(-1);return I instanceof Qg?I:null}function Rk($){let I=jM($);if(I)return I.opts();let _=$.at(-1);return _&&typeof _==="object"?_:{}}function Vk($){if($ instanceof Error)return $.message;return String($)}function y6($){throw Error($)}function M5($,I){for(let _ of $){let u=_.charCodeAt(0);if(u>=0&&u<=31||u===127)y6(`${I} must not contain control characters`)}}function Zk($,I){if(M5($,I),/[?#%]/.test($))y6(`${I} must not contain ?, #, or %`);if($.includes(".."))y6(`${I} must not contain '..'`)}function Ak($,I){M5($,I);try{new URL($)}catch{y6(`${I} must be a valid absolute URL`)}}function T5($,I,_="text"){if(typeof $==="string"){if(_==="identifier"){Zk($,I);return}if(_==="url"){Ak($,I);return}M5($,I);return}if(Array.isArray($))for(let[u,U]of $.entries())T5(U,`${I}[${u}]`,_)}function AM($){let I=$.toLowerCase();if(I==="url"||I.endsWith("url"))return"url";if(I.includes("id")||I.includes("type")||I.includes("vendor")||I.includes("session"))return"identifier";return"text"}function bk($){let I=$.vendor;if(typeof I==="string"&&!VM.includes(I))y6(`vendor must be one of ${VM.join(", ")}`);let _=$.output;if(typeof _==="string"&&!TU.includes(_))y6(`output must be one of ${TU.join(", ")}`)}function Pk($){let I=$.processedArgs??$.args??[];($.registeredArguments??[]).forEach((U,g)=>{let z=U.name?.()||String(g),G=I[g];if(T5(G,z,AM(z)),z==="agent-type"&&typeof G==="string"&&!ZM.includes(G))y6(`agent-type must be one of ${ZM.join(", ")}`)});let u=$.opts();bk(u);for(let[U,g]of Object.entries(u))T5(g,U,AM(U))}function jk($){return($.registeredArguments??[]).map((I)=>({name:I.name?.()||"",required:!!I.required,variadic:!!I.variadic}))}function Sk($){return $.options.map((I)=>({flags:I.flags,long:I.long||void 0,short:I.short||void 0,description:I.description||"",required:!!I.required||!!I.mandatory,optional:!!I.optional,defaultValue:I.defaultValue}))}function SM($){let I=[],_=$;while(_?.parent)I.unshift(_.name()),_=_.parent;return I.join(" ")}function Fk($){return $.options.some((I)=>I.long==="--json"||I.long==="--output")}function wk($){return $.options.some((I)=>I.long==="--dry-run")}function FM($){return{name:$.name(),path:SM($),summary:$.summary()||void 0,description:$.description(),arguments:jk($),options:Sk($),supportsJsonOutput:Fk($),supportsDryRun:wk($),subcommands:$.commands.map((I)=>FM(I))}}function Ek($,I){if(!I)return $;let _=I.trim();if(!_)return $;let u=[...$.commands];while(u.length>0){let U=u.shift();if(!U)continue;if(U.name()===_||SM(U)===_)return U;u.push(...U.commands)}return null}function Ck($,I){let _=Ek($,I);if(!_)y6(`Unknown command: ${I}`);let u={name:$.name(),version:$.version(),description:$.description(),env:{[PM]:"Set to json to force machine-readable output on commands that support it."},command:FM(_)};console.log(JSON.stringify(u,null,2))}function D$($,I={}){return async(..._)=>{let u=jM(_),U=Rk(_);try{if(u)Pk(u);await $(..._)}catch(g){let z=Vk(g);if(I.supportsJsonOutput&&m4(U))console.log(JSON.stringify({error:z},null,2));else console.error(z);process.exitCode=1}}}var Y$=new Qg;Y$.name("oh-my-agent").description("Multi-Agent Orchestrator for AI IDEs").version(bM).showSuggestionAfterError().showHelpAfterError().addHelpText("after",`
|
|
527
534
|
Aliases:
|
|
528
535
|
oma Alias for oh-my-agent after global installation.
|
|
529
|
-
`).action(D$(async()=>{await
|
|
536
|
+
`).action(D$(async()=>{await Kq()}));Y$.command("install").description("Install oh-my-agent skills and configurations").action(D$(async()=>{await Kq()}));Y$.command("describe [command-path]").description("Describe CLI commands as JSON for runtime introspection").action(D$(($)=>{Ck(Y$,$)},{supportsJsonOutput:!0}));Y$.command("dashboard").description("Start terminal dashboard (real-time agent monitoring)").action(D$(async()=>{await RM()}));Y$.command("dashboard:web").description("Start web dashboard on http://localhost:9847").action(D$(()=>{BM()}));g6(Y$.command("auth:status").description("Check authentication status of all supported CLIs")).action(D$(async($)=>{await uO(m4($))},{supportsJsonOutput:!0}));Y$.command("update").description("Update skills to latest version from registry").option("-f, --force","Overwrite user-customized config files").option("--ci","Run in non-interactive CI mode (skip prompts)").action(D$(async($)=>{await Cv($.force??!1,$.ci??!1)}));Y$.command("link [vendors...]").description("Regenerate vendor files (.claude/, .cursor/, etc.) from .agents/ SSOT").action(D$(($)=>{eO($.length>0?$:void 0)}));g6(Y$.command("doctor").description("Check CLI installations, MCP configs, and skill status"),"Output as JSON for CI/CD").action(D$(async($)=>{await YO(m4($))},{supportsJsonOutput:!0}));g6(Y$.command("stats").description("View productivity metrics").option("--reset","Reset metrics data")).action(D$(async($)=>{await Ev(m4($),$.reset)},{supportsJsonOutput:!0}));g6(Y$.command("retro [window]").description("Engineering retrospective with metrics & trends").option("--interactive","Interactive mode (manual entry)").option("--compare","Compare current window vs prior same-length window")).action(D$(async($,I)=>{await Pv($,{json:m4(I),compare:I.compare,interactive:I.interactive})},{supportsJsonOutput:!0}));g6(Y$.command("cleanup").description("Clean up orphaned subagent processes and temp files").option("--dry-run","Show what would be cleaned without making changes").option("-y, --yes","Skip confirmation prompts and clean everything")).action(D$(async($)=>{await QO($.dryRun,m4($),$.yes)},{supportsJsonOutput:!0}));Y$.command("bridge [url]").description("Bridge MCP stdio to Streamable HTTP (for Serena)").action(D$(async($)=>{await qO($)}));Y$.command("agent:spawn <agent-id> <prompt> <session-id>").description("Spawn a subagent (prompt can be inline text or a file path)").option("-m, --model <vendor>","CLI vendor override (gemini/claude/codex/qwen)").option("-w, --workspace <path>","Working directory for the agent (auto-detected if omitted)").action(D$(async($,I,_,u)=>{await zY($,I,_,u.workspace||".",u.model)}));Y$.command("agent:status <session-id> [agent-ids...]").description("Check status of subagents").option("-r, --root <path>","Root path for memory checks",process.cwd()).action(D$(async($,I,_)=>{await GY($,I,_.root)}));Y$.command("agent:parallel [tasks...]").description("Run multiple sub-agents in parallel").option("-m, --model <vendor>","CLI vendor override (gemini/claude/codex/qwen)").option("-i, --inline","Inline mode: specify tasks as agent:task arguments").option("--no-wait","Don't wait for completion (background mode)").action(D$(async($,I)=>{await JY($,{vendor:I.model,inline:I.inline,noWait:!I.wait})}));Y$.command("agent:review").description("Run code review using external CLI (codex/claude/gemini)").option("-m, --model <vendor>","CLI vendor (codex/claude/gemini)").option("-p, --prompt <prompt>","Custom review prompt").option("-w, --workspace <path>","Working directory (default: current)").option("--no-uncommitted","Review committed changes only").action(D$(async($)=>{await XY({prompt:$.prompt,model:$.model,workspace:$.workspace,uncommitted:$.uncommitted})}));g6(Y$.command("memory:init").description("Initialize Serena memory schema in .serena/memories").option("--force","Overwrite empty or existing schema files")).action(D$(async($)=>{await sO(m4($),$.force)},{supportsJsonOutput:!0}));g6(Y$.command("verify <agent-type>").description("Verify subagent output (backend/frontend/mobile/qa/debug/pm)").option("-w, --workspace <path>","Workspace path",process.cwd())).action(D$(async($,I)=>{await lv($,I.workspace,m4(I))},{supportsJsonOutput:!0}));Y$.command("star").description("Star oh-my-agent on GitHub").action(D$(async()=>{await Sv()}));g6(Y$.command("export <format>").description("Export skills for external IDEs (cursor)").option("-d, --dir <path>","Target directory",process.cwd())).action(D$(async($,I)=>{await vO($,I.dir,m4(I))},{supportsJsonOutput:!0}));g6(Y$.command("visualize").alias("viz").description("Visualize project structure as a dependency graph")).action(D$(async($)=>{await dv({json:m4($)})},{supportsJsonOutput:!0}));Y$.command("help").description("Show help information").action(D$(()=>{Y$.help()}));Y$.command("version").description("Show version number").action(D$(()=>{console.log(bM)}));Y$.parse();
|