@miketromba/ploof 0.1.4 → 0.2.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/README.md +94 -5
- package/SPEC.md +107 -3
- package/dist/ploof.js +222 -222
- package/package.json +2 -2
- package/skills/asset-generation/SKILL.md +1 -1
package/dist/ploof.js
CHANGED
|
@@ -1,182 +1,182 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// @bun
|
|
3
|
-
import{createRequire as
|
|
4
|
-
`)}displayWidth($){return
|
|
5
|
-
`+" ".repeat(
|
|
6
|
-
${
|
|
7
|
-
`)}}function
|
|
3
|
+
import{createRequire as m7}from"node:module";var S7=Object.create;var{getPrototypeOf:A7,defineProperty:I2,getOwnPropertyNames:R7}=Object;var k7=Object.prototype.hasOwnProperty;function C7($){return this[$]}var j7,x7,r7=($,w,U)=>{var v=$!=null&&typeof $==="object";if(v){var J=w?j7??=new WeakMap:x7??=new WeakMap,z=J.get($);if(z)return z}U=$!=null?S7(A7($)):{};let g=w||!$||!$.__esModule?I2(U,"default",{value:$,enumerable:!0}):U;for(let V of R7($))if(!k7.call(g,V))I2(g,V,{get:C7.bind($,V),enumerable:!0});if(v)J.set($,g);return g};var E=($,w)=>()=>(w||$((w={exports:{}}).exports,w),w.exports);var y7=($)=>$;function d7($,w){this[$]=y7.bind(null,w)}var Y4=($,w)=>{for(var U in w)I2($,U,{get:w[U],enumerable:!0,configurable:!0,set:d7.bind(w,U)})};var Q4=m7(import.meta.url);var QU=E((n7)=>{class N2 extends Error{constructor($,w,U){super(U);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=w,this.exitCode=$,this.nestedError=void 0}}class A8 extends N2{constructor($){super(1,"commander.invalidArgument",$);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}n7.CommanderError=N2;n7.InvalidArgumentError=A8});var sJ=E((o7)=>{var{InvalidArgumentError:l7}=QU();class R8{constructor($,w){switch(this.description=w||"",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.length>3&&this._name.slice(-3)==="...")this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_concatValue($,w){if(w===this.defaultValue||!Array.isArray(w))return[$];return w.concat($)}default($,w){return this.defaultValue=$,this.defaultValueDescription=w,this}argParser($){return this.parseArg=$,this}choices($){return this.argChoices=$.slice(),this.parseArg=(w,U)=>{if(!this.argChoices.includes(w))throw new l7(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._concatValue(w,U);return w},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function t7($){let w=$.name()+($.variadic===!0?"...":"");return $.required?"<"+w+">":"["+w+"]"}o7.Argument=R8;o7.humanReadableArgName=t7});var W2=E((s7)=>{var{humanReadableArgName:e7}=sJ();class k8{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 w=$.commands.filter((v)=>!v._hidden),U=$._getHelpCommand();if(U&&!U._hidden)w.push(U);if(this.sortSubcommands)w.sort((v,J)=>{return v.name().localeCompare(J.name())});return w}compareOptions($,w){let U=(v)=>{return v.short?v.short.replace(/^-/,""):v.long.replace(/^--/,"")};return U($).localeCompare(U(w))}visibleOptions($){let w=$.options.filter((v)=>!v.hidden),U=$._getHelpOption();if(U&&!U.hidden){let v=U.short&&$._findOption(U.short),J=U.long&&$._findOption(U.long);if(!v&&!J)w.push(U);else if(U.long&&!J)w.push($.createOption(U.long,U.description));else if(U.short&&!v)w.push($.createOption(U.short,U.description))}if(this.sortOptions)w.sort(this.compareOptions);return w}visibleGlobalOptions($){if(!this.showGlobalOptions)return[];let w=[];for(let U=$.parent;U;U=U.parent){let v=U.options.filter((J)=>!J.hidden);w.push(...v)}if(this.sortOptions)w.sort(this.compareOptions);return w}visibleArguments($){if($._argsDescription)$.registeredArguments.forEach((w)=>{w.description=w.description||$._argsDescription[w.name()]||""});if($.registeredArguments.find((w)=>w.description))return $.registeredArguments;return[]}subcommandTerm($){let w=$.registeredArguments.map((U)=>e7(U)).join(" ");return $._name+($._aliases[0]?"|"+$._aliases[0]:"")+($.options.length?" [options]":"")+(w?" "+w:"")}optionTerm($){return $.flags}argumentTerm($){return $.name()}longestSubcommandTermLength($,w){return w.visibleCommands($).reduce((U,v)=>{return Math.max(U,this.displayWidth(w.styleSubcommandTerm(w.subcommandTerm(v))))},0)}longestOptionTermLength($,w){return w.visibleOptions($).reduce((U,v)=>{return Math.max(U,this.displayWidth(w.styleOptionTerm(w.optionTerm(v))))},0)}longestGlobalOptionTermLength($,w){return w.visibleGlobalOptions($).reduce((U,v)=>{return Math.max(U,this.displayWidth(w.styleOptionTerm(w.optionTerm(v))))},0)}longestArgumentTermLength($,w){return w.visibleArguments($).reduce((U,v)=>{return Math.max(U,this.displayWidth(w.styleArgumentTerm(w.argumentTerm(v))))},0)}commandUsage($){let w=$._name;if($._aliases[0])w=w+"|"+$._aliases[0];let U="";for(let v=$.parent;v;v=v.parent)U=v.name()+" "+U;return U+w+" "+$.usage()}commandDescription($){return $.description()}subcommandDescription($){return $.summary()||$.description()}optionDescription($){let w=[];if($.argChoices)w.push(`choices: ${$.argChoices.map((U)=>JSON.stringify(U)).join(", ")}`);if($.defaultValue!==void 0){if($.required||$.optional||$.isBoolean()&&typeof $.defaultValue==="boolean")w.push(`default: ${$.defaultValueDescription||JSON.stringify($.defaultValue)}`)}if($.presetArg!==void 0&&$.optional)w.push(`preset: ${JSON.stringify($.presetArg)}`);if($.envVar!==void 0)w.push(`env: ${$.envVar}`);if(w.length>0)return`${$.description} (${w.join(", ")})`;return $.description}argumentDescription($){let w=[];if($.argChoices)w.push(`choices: ${$.argChoices.map((U)=>JSON.stringify(U)).join(", ")}`);if($.defaultValue!==void 0)w.push(`default: ${$.defaultValueDescription||JSON.stringify($.defaultValue)}`);if(w.length>0){let U=`(${w.join(", ")})`;if($.description)return`${$.description} ${U}`;return U}return $.description}formatHelp($,w){let U=w.padWidth($,w),v=w.helpWidth??80;function J(X,I){return w.formatItem(X,U,I,w)}let z=[`${w.styleTitle("Usage:")} ${w.styleUsage(w.commandUsage($))}`,""],g=w.commandDescription($);if(g.length>0)z=z.concat([w.boxWrap(w.styleCommandDescription(g),v),""]);let V=w.visibleArguments($).map((X)=>{return J(w.styleArgumentTerm(w.argumentTerm(X)),w.styleArgumentDescription(w.argumentDescription(X)))});if(V.length>0)z=z.concat([w.styleTitle("Arguments:"),...V,""]);let _=w.visibleOptions($).map((X)=>{return J(w.styleOptionTerm(w.optionTerm(X)),w.styleOptionDescription(w.optionDescription(X)))});if(_.length>0)z=z.concat([w.styleTitle("Options:"),..._,""]);if(w.showGlobalOptions){let X=w.visibleGlobalOptions($).map((I)=>{return J(w.styleOptionTerm(w.optionTerm(I)),w.styleOptionDescription(w.optionDescription(I)))});if(X.length>0)z=z.concat([w.styleTitle("Global Options:"),...X,""])}let G=w.visibleCommands($).map((X)=>{return J(w.styleSubcommandTerm(w.subcommandTerm(X)),w.styleSubcommandDescription(w.subcommandDescription(X)))});if(G.length>0)z=z.concat([w.styleTitle("Commands:"),...G,""]);return z.join(`
|
|
4
|
+
`)}displayWidth($){return C8($).length}styleTitle($){return $}styleUsage($){return $.split(" ").map((w)=>{if(w==="[options]")return this.styleOptionText(w);if(w==="[command]")return this.styleSubcommandText(w);if(w[0]==="["||w[0]==="<")return this.styleArgumentText(w);return this.styleCommandText(w)}).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((w)=>{if(w==="[options]")return this.styleOptionText(w);if(w[0]==="["||w[0]==="<")return this.styleArgumentText(w);return this.styleSubcommandText(w)}).join(" ")}styleArgumentTerm($){return this.styleArgumentText($)}styleOptionText($){return $}styleArgumentText($){return $}styleSubcommandText($){return $}styleCommandText($){return $}padWidth($,w){return Math.max(w.longestOptionTermLength($,w),w.longestGlobalOptionTermLength($,w),w.longestSubcommandTermLength($,w),w.longestArgumentTermLength($,w))}preformatted($){return/\n[^\S\r\n]/.test($)}formatItem($,w,U,v){let z=" ".repeat(2);if(!U)return z+$;let g=$.padEnd(w+$.length-v.displayWidth($)),V=2,G=(this.helpWidth??80)-w-V-2,X;if(G<this.minWidthToWrap||v.preformatted(U))X=U;else X=v.boxWrap(U,G).replace(/\n/g,`
|
|
5
|
+
`+" ".repeat(w+V));return z+g+" ".repeat(V)+X.replace(/\n/g,`
|
|
6
|
+
${z}`)}boxWrap($,w){if(w<this.minWidthToWrap)return $;let U=$.split(/\r\n|\n/),v=/[\s]*[^\s]+/g,J=[];return U.forEach((z)=>{let g=z.match(v);if(g===null){J.push("");return}let V=[g.shift()],_=this.displayWidth(V[0]);g.forEach((G)=>{let X=this.displayWidth(G);if(_+X<=w){V.push(G),_+=X;return}J.push(V.join(""));let I=G.trimStart();V=[I],_=this.displayWidth(I)}),J.push(V.join(""))}),J.join(`
|
|
7
|
+
`)}}function C8($){let w=/\x1b\[\d*(;\d*)*m/g;return $.replace(w,"")}s7.Help=k8;s7.stripColor=C8});var Y2=E((vP)=>{var{InvalidArgumentError:UP}=QU();class x8{constructor($,w){this.flags=$,this.description=w||"",this.required=$.includes("<"),this.optional=$.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test($),this.mandatory=!1;let U=JP($);if(this.short=U.shortFlag,this.long=U.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}default($,w){return this.defaultValue=$,this.defaultValueDescription=w,this}preset($){return this.presetArg=$,this}conflicts($){return this.conflictsWith=this.conflictsWith.concat($),this}implies($){let w=$;if(typeof $==="string")w={[$]:!0};return this.implied=Object.assign(this.implied||{},w),this}env($){return this.envVar=$,this}argParser($){return this.parseArg=$,this}makeOptionMandatory($=!0){return this.mandatory=!!$,this}hideHelp($=!0){return this.hidden=!!$,this}_concatValue($,w){if(w===this.defaultValue||!Array.isArray(w))return[$];return w.concat($)}choices($){return this.argChoices=$.slice(),this.parseArg=(w,U)=>{if(!this.argChoices.includes(w))throw new UP(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._concatValue(w,U);return w},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return j8(this.name().replace(/^no-/,""));return j8(this.name())}is($){return this.short===$||this.long===$}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class r8{constructor($){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,$.forEach((w)=>{if(w.negate)this.negativeOptions.set(w.attributeName(),w);else this.positiveOptions.set(w.attributeName(),w)}),this.negativeOptions.forEach((w,U)=>{if(this.positiveOptions.has(U))this.dualOptions.add(U)})}valueFromOption($,w){let U=w.attributeName();if(!this.dualOptions.has(U))return!0;let v=this.negativeOptions.get(U).presetArg,J=v!==void 0?v:!1;return w.negate===(J===$)}}function j8($){return $.split("-").reduce((w,U)=>{return w+U[0].toUpperCase()+U.slice(1)})}function JP($){let w,U,v=/^-[^-]$/,J=/^--[^-]/,z=$.split(/[ |,]+/).concat("guard");if(v.test(z[0]))w=z.shift();if(J.test(z[0]))U=z.shift();if(!w&&v.test(z[0]))w=z.shift();if(!w&&J.test(z[0]))w=U,U=z.shift();if(z[0].startsWith("-")){let g=z[0],V=`option creation failed due to '${g}' in option flags '${$}'`;if(/^-[^-][^-]/.test(g))throw Error(`${V}
|
|
8
8
|
- a short flag is a single dash and a single character
|
|
9
9
|
- either use a single dash and a single character (for a short flag)
|
|
10
|
-
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(
|
|
11
|
-
- too many short flags`);if(
|
|
12
|
-
- too many long flags`);throw Error(`${
|
|
13
|
-
- unrecognised flag format`)}if(
|
|
14
|
-
(Did you mean one of ${
|
|
15
|
-
(Did you mean ${
|
|
16
|
-
- specify the name in Command constructor or using .name()`);if(
|
|
17
|
-
Expecting one of '${
|
|
18
|
-
- already used by option '${
|
|
19
|
-
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable($,U
|
|
20
|
-
- if '${
|
|
10
|
+
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(v.test(g))throw Error(`${V}
|
|
11
|
+
- too many short flags`);if(J.test(g))throw Error(`${V}
|
|
12
|
+
- too many long flags`);throw Error(`${V}
|
|
13
|
+
- unrecognised flag format`)}if(w===void 0&&U===void 0)throw Error(`option creation failed due to no flags found in '${$}'.`);return{shortFlag:w,longFlag:U}}vP.Option=x8;vP.DualOptions=r8});var y8=E((_P)=>{function VP($,w){if(Math.abs($.length-w.length)>3)return Math.max($.length,w.length);let U=[];for(let v=0;v<=$.length;v++)U[v]=[v];for(let v=0;v<=w.length;v++)U[0][v]=v;for(let v=1;v<=w.length;v++)for(let J=1;J<=$.length;J++){let z=1;if($[J-1]===w[v-1])z=0;else z=1;if(U[J][v]=Math.min(U[J-1][v]+1,U[J][v-1]+1,U[J-1][v-1]+z),J>1&&v>1&&$[J-1]===w[v-2]&&$[J-2]===w[v-1])U[J][v]=Math.min(U[J][v],U[J-2][v-2]+1)}return U[$.length][w.length]}function GP($,w){if(!w||w.length===0)return"";w=Array.from(new Set(w));let U=$.startsWith("--");if(U)$=$.slice(2),w=w.map((g)=>g.slice(2));let v=[],J=3,z=0.4;if(w.forEach((g)=>{if(g.length<=1)return;let V=VP($,g),_=Math.max($.length,g.length);if((_-V)/_>z){if(V<J)J=V,v=[g];else if(V===J)v.push(g)}}),v.sort((g,V)=>g.localeCompare(V)),U)v=v.map((g)=>`--${g}`);if(v.length>1)return`
|
|
14
|
+
(Did you mean one of ${v.join(", ")}?)`;if(v.length===1)return`
|
|
15
|
+
(Did you mean ${v[0]}?)`;return""}_P.suggestSimilar=GP});var h8=E((OP)=>{var IP=Q4("node:events").EventEmitter,Q2=Q4("node:child_process"),P4=Q4("node:path"),$0=Q4("node:fs"),o=Q4("node:process"),{Argument:NP,humanReadableArgName:WP}=sJ(),{CommanderError:P2}=QU(),{Help:YP,stripColor:QP}=W2(),{Option:d8,DualOptions:PP}=Y2(),{suggestSimilar:m8}=y8();class B2 extends IP{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:(w)=>o.stdout.write(w),writeErr:(w)=>o.stderr.write(w),outputError:(w,U)=>U(w),getOutHelpWidth:()=>o.stdout.isTTY?o.stdout.columns:void 0,getErrHelpWidth:()=>o.stderr.isTTY?o.stderr.columns:void 0,getOutHasColors:()=>O2()??(o.stdout.isTTY&&o.stdout.hasColors?.()),getErrHasColors:()=>O2()??(o.stderr.isTTY&&o.stderr.hasColors?.()),stripColor:(w)=>QP(w)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}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 w=this;w;w=w.parent)$.push(w);return $}command($,w,U){let v=w,J=U;if(typeof v==="object"&&v!==null)J=v,v=null;J=J||{};let[,z,g]=$.match(/([^ ]+) *(.*)/),V=this.createCommand(z);if(v)V.description(v),V._executableHandler=!0;if(J.isDefault)this._defaultCommandName=V._name;if(V._hidden=!!(J.noHelp||J.hidden),V._executableFile=J.executableFile||null,g)V.arguments(g);if(this._registerCommand(V),V.parent=this,V.copyInheritedSettings(this),v)return this;return V}createCommand($){return new B2($)}createHelp(){return Object.assign(new YP,this.configureHelp())}configureHelp($){if($===void 0)return this._helpConfiguration;return this._helpConfiguration=$,this}configureOutput($){if($===void 0)return this._outputConfiguration;return Object.assign(this._outputConfiguration,$),this}showHelpAfterError($=!0){if(typeof $!=="string")$=!!$;return this._showHelpAfterError=$,this}showSuggestionAfterError($=!0){return this._showSuggestionAfterError=!!$,this}addCommand($,w){if(!$._name)throw Error(`Command passed to .addCommand() must have a name
|
|
16
|
+
- specify the name in Command constructor or using .name()`);if(w=w||{},w.isDefault)this._defaultCommandName=$._name;if(w.noHelp||w.hidden)$._hidden=!0;return this._registerCommand($),$.parent=this,$._checkForBrokenPassThrough(),this}createArgument($,w){return new NP($,w)}argument($,w,U,v){let J=this.createArgument($,w);if(typeof U==="function")J.default(v).argParser(U);else J.default(U);return this.addArgument(J),this}arguments($){return $.trim().split(/ +/).forEach((w)=>{this.argument(w)}),this}addArgument($){let w=this.registeredArguments.slice(-1)[0];if(w&&w.variadic)throw Error(`only the last argument can be variadic '${w.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($,w){if(typeof $==="boolean")return this._addImplicitHelpCommand=$,this;$=$??"help [command]";let[,U,v]=$.match(/([^ ]+) *(.*)/),J=w??"display help for command",z=this.createCommand(U);if(z.helpOption(!1),v)z.arguments(v);if(J)z.description(J);return this._addImplicitHelpCommand=!0,this._helpCommand=z,this}addHelpCommand($,w){if(typeof $!=="object")return this.helpCommand($,w),this;return this._addImplicitHelpCommand=!0,this._helpCommand=$,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($,w){let U=["preSubcommand","preAction","postAction"];if(!U.includes($))throw Error(`Unexpected value for event passed to hook : '${$}'.
|
|
17
|
+
Expecting one of '${U.join("', '")}'`);if(this._lifeCycleHooks[$])this._lifeCycleHooks[$].push(w);else this._lifeCycleHooks[$]=[w];return this}exitOverride($){if($)this._exitCallback=$;else this._exitCallback=(w)=>{if(w.code!=="commander.executeSubCommandAsync")throw w};return this}_exit($,w,U){if(this._exitCallback)this._exitCallback(new P2($,w,U));o.exit($)}action($){let w=(U)=>{let v=this.registeredArguments.length,J=U.slice(0,v);if(this._storeOptionsAsProperties)J[v]=this;else J[v]=this.opts();return J.push(this),$.apply(this,J)};return this._actionHandler=w,this}createOption($,w){return new d8($,w)}_callParseArg($,w,U,v){try{return $.parseArg(w,U)}catch(J){if(J.code==="commander.invalidArgument"){let z=`${v} ${J.message}`;this.error(z,{exitCode:J.exitCode,code:J.code})}throw J}}_registerOption($){let w=$.short&&this._findOption($.short)||$.long&&this._findOption($.long);if(w){let U=$.long&&this._findOption($.long)?$.long:$.short;throw Error(`Cannot add option '${$.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${U}'
|
|
18
|
+
- already used by option '${w.flags}'`)}this.options.push($)}_registerCommand($){let w=(v)=>{return[v.name()].concat(v.aliases())},U=w($).find((v)=>this._findCommand(v));if(U){let v=w(this._findCommand(U)).join("|"),J=w($).join("|");throw Error(`cannot add command '${J}' as already have command '${v}'`)}this.commands.push($)}addOption($){this._registerOption($);let w=$.name(),U=$.attributeName();if($.negate){let J=$.long.replace(/^--no-/,"--");if(!this._findOption(J))this.setOptionValueWithSource(U,$.defaultValue===void 0?!0:$.defaultValue,"default")}else if($.defaultValue!==void 0)this.setOptionValueWithSource(U,$.defaultValue,"default");let v=(J,z,g)=>{if(J==null&&$.presetArg!==void 0)J=$.presetArg;let V=this.getOptionValue(U);if(J!==null&&$.parseArg)J=this._callParseArg($,J,V,z);else if(J!==null&&$.variadic)J=$._concatValue(J,V);if(J==null)if($.negate)J=!1;else if($.isBoolean()||$.optional)J=!0;else J="";this.setOptionValueWithSource(U,J,g)};if(this.on("option:"+w,(J)=>{let z=`error: option '${$.flags}' argument '${J}' is invalid.`;v(J,z,"cli")}),$.envVar)this.on("optionEnv:"+w,(J)=>{let z=`error: option '${$.flags}' value '${J}' from env '${$.envVar}' is invalid.`;v(J,z,"env")});return this}_optionEx($,w,U,v,J){if(typeof w==="object"&&w instanceof d8)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let z=this.createOption(w,U);if(z.makeOptionMandatory(!!$.mandatory),typeof v==="function")z.default(J).argParser(v);else if(v instanceof RegExp){let g=v;v=(V,_)=>{let G=g.exec(V);return G?G[0]:_},z.default(J).argParser(v)}else z.default(v);return this.addOption(z)}option($,w,U,v){return this._optionEx({},$,w,U,v)}requiredOption($,w,U,v){return this._optionEx({mandatory:!0},$,w,U,v)}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($,w){return this.setOptionValueWithSource($,w,void 0)}setOptionValueWithSource($,w,U){if(this._storeOptionsAsProperties)this[$]=w;else this._optionValues[$]=w;return this._optionValueSources[$]=U,this}getOptionValueSource($){return this._optionValueSources[$]}getOptionValueSourceWithGlobals($){let w;return this._getCommandAndAncestors().forEach((U)=>{if(U.getOptionValueSource($)!==void 0)w=U.getOptionValueSource($)}),w}_prepareUserArgs($,w){if($!==void 0&&!Array.isArray($))throw Error("first parameter to parse must be array or undefined");if(w=w||{},$===void 0&&w.from===void 0){if(o.versions?.electron)w.from="electron";let v=o.execArgv??[];if(v.includes("-e")||v.includes("--eval")||v.includes("-p")||v.includes("--print"))w.from="eval"}if($===void 0)$=o.argv;this.rawArgs=$.slice();let U;switch(w.from){case void 0:case"node":this._scriptPath=$[1],U=$.slice(2);break;case"electron":if(o.defaultApp)this._scriptPath=$[1],U=$.slice(2);else U=$.slice(1);break;case"user":U=$.slice(0);break;case"eval":U=$.slice(1);break;default:throw Error(`unexpected parse option { from: '${w.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",U}parse($,w){this._prepareForParse();let U=this._prepareUserArgs($,w);return this._parseCommand([],U),this}async parseAsync($,w){this._prepareForParse();let U=this._prepareUserArgs($,w);return await this._parseCommand([],U),this}_prepareForParse(){if(this._savedState===null)this.saveStateBeforeParse();else this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw Error(`Can not call parse again when storeOptionsAsProperties is true.
|
|
19
|
+
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable($,w,U){if($0.existsSync($))return;let v=w?`searched for local subcommand relative to directory '${w}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",J=`'${$}' does not exist
|
|
20
|
+
- if '${U}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
21
21
|
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
22
|
-
- ${
|
|
22
|
+
- ${v}`;throw Error(J)}_executeSubCommand($,w){w=w.slice();let U=!1,v=[".js",".ts",".tsx",".mjs",".cjs"];function J(G,X){let I=P4.resolve(G,X);if($0.existsSync(I))return I;if(v.includes(P4.extname(X)))return;let N=v.find((W)=>$0.existsSync(`${I}${W}`));if(N)return`${I}${N}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let z=$._executableFile||`${this._name}-${$._name}`,g=this._executableDir||"";if(this._scriptPath){let G;try{G=$0.realpathSync(this._scriptPath)}catch{G=this._scriptPath}g=P4.resolve(P4.dirname(G),g)}if(g){let G=J(g,z);if(!G&&!$._executableFile&&this._scriptPath){let X=P4.basename(this._scriptPath,P4.extname(this._scriptPath));if(X!==this._name)G=J(g,`${X}-${$._name}`)}z=G||z}U=v.includes(P4.extname(z));let V;if(o.platform!=="win32")if(U)w.unshift(z),w=n8(o.execArgv).concat(w),V=Q2.spawn(o.argv[0],w,{stdio:"inherit"});else V=Q2.spawn(z,w,{stdio:"inherit"});else this._checkForMissingExecutable(z,g,$._name),w.unshift(z),w=n8(o.execArgv).concat(w),V=Q2.spawn(o.execPath,w,{stdio:"inherit"});if(!V.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((X)=>{o.on(X,()=>{if(V.killed===!1&&V.exitCode===null)V.kill(X)})});let _=this._exitCallback;V.on("close",(G)=>{if(G=G??1,!_)o.exit(G);else _(new P2(G,"commander.executeSubCommandAsync","(close)"))}),V.on("error",(G)=>{if(G.code==="ENOENT")this._checkForMissingExecutable(z,g,$._name);else if(G.code==="EACCES")throw Error(`'${z}' not executable`);if(!_)o.exit(1);else{let X=new P2(1,"commander.executeSubCommandAsync","(error)");X.nestedError=G,_(X)}}),this.runningCommand=V}_dispatchSubcommand($,w,U){let v=this._findCommand($);if(!v)this.help({error:!0});v._prepareForParse();let J;return J=this._chainOrCallSubCommandHook(J,v,"preSubcommand"),J=this._chainOrCall(J,()=>{if(v._executableHandler)this._executeSubCommand(v,w.concat(U));else return v._parseCommand(w,U)}),J}_dispatchHelpCommand($){if(!$)this.help();let w=this._findCommand($);if(w&&!w._executableHandler)w.help();return this._dispatchSubcommand($,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach(($,w)=>{if($.required&&this.args[w]==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,v,J)=>{let z=v;if(v!==null&&U.parseArg){let g=`error: command-argument value '${v}' is invalid for argument '${U.name()}'.`;z=this._callParseArg(U,v,J,g)}return z};this._checkNumberOfArguments();let w=[];this.registeredArguments.forEach((U,v)=>{let J=U.defaultValue;if(U.variadic){if(v<this.args.length){if(J=this.args.slice(v),U.parseArg)J=J.reduce((z,g)=>{return $(U,g,z)},U.defaultValue)}else if(J===void 0)J=[]}else if(v<this.args.length){if(J=this.args[v],U.parseArg)J=$(U,J,U.defaultValue)}w[v]=J}),this.processedArgs=w}_chainOrCall($,w){if($&&$.then&&typeof $.then==="function")return $.then(()=>w());return w()}_chainOrCallHooks($,w){let U=$,v=[];if(this._getCommandAndAncestors().reverse().filter((J)=>J._lifeCycleHooks[w]!==void 0).forEach((J)=>{J._lifeCycleHooks[w].forEach((z)=>{v.push({hookedCommand:J,callback:z})})}),w==="postAction")v.reverse();return v.forEach((J)=>{U=this._chainOrCall(U,()=>{return J.callback(J.hookedCommand,this)})}),U}_chainOrCallSubCommandHook($,w,U){let v=$;if(this._lifeCycleHooks[U]!==void 0)this._lifeCycleHooks[U].forEach((J)=>{v=this._chainOrCall(v,()=>{return J(this,w)})});return v}_parseCommand($,w){let U=this.parseOptions(w);if(this._parseOptionsEnv(),this._parseOptionsImplied(),$=$.concat(U.operands),w=U.unknown,this.args=$.concat(w),$&&this._findCommand($[0]))return this._dispatchSubcommand($[0],$.slice(1),w);if(this._getHelpCommand()&&$[0]===this._getHelpCommand().name())return this._dispatchHelpCommand($[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(w),this._dispatchSubcommand(this._defaultCommandName,$,w);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(U.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let v=()=>{if(U.unknown.length>0)this.unknownOption(U.unknown[0])},J=`command:${this.name()}`;if(this._actionHandler){v(),this._processArguments();let z;if(z=this._chainOrCallHooks(z,"preAction"),z=this._chainOrCall(z,()=>this._actionHandler(this.processedArgs)),this.parent)z=this._chainOrCall(z,()=>{this.parent.emit(J,$,w)});return z=this._chainOrCallHooks(z,"postAction"),z}if(this.parent&&this.parent.listenerCount(J))v(),this._processArguments(),this.parent.emit(J,$,w);else if($.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",$,w);if(this.listenerCount("command:*"))this.emit("command:*",$,w);else if(this.commands.length)this.unknownCommand();else v(),this._processArguments()}else if(this.commands.length)v(),this.help({error:!0});else v(),this._processArguments()}_findCommand($){if(!$)return;return this.commands.find((w)=>w._name===$||w._aliases.includes($))}_findOption($){return this.options.find((w)=>w.is($))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(($)=>{$.options.forEach((w)=>{if(w.mandatory&&$.getOptionValue(w.attributeName())===void 0)$.missingMandatoryOptionValue(w)})})}_checkForConflictingLocalOptions(){let $=this.options.filter((U)=>{let v=U.attributeName();if(this.getOptionValue(v)===void 0)return!1;return this.getOptionValueSource(v)!=="default"});$.filter((U)=>U.conflictsWith.length>0).forEach((U)=>{let v=$.find((J)=>U.conflictsWith.includes(J.attributeName()));if(v)this._conflictingOption(U,v)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(($)=>{$._checkForConflictingLocalOptions()})}parseOptions($){let w=[],U=[],v=w,J=$.slice();function z(V){return V.length>1&&V[0]==="-"}let g=null;while(J.length){let V=J.shift();if(V==="--"){if(v===U)v.push(V);v.push(...J);break}if(g&&!z(V)){this.emit(`option:${g.name()}`,V);continue}if(g=null,z(V)){let _=this._findOption(V);if(_){if(_.required){let G=J.shift();if(G===void 0)this.optionMissingArgument(_);this.emit(`option:${_.name()}`,G)}else if(_.optional){let G=null;if(J.length>0&&!z(J[0]))G=J.shift();this.emit(`option:${_.name()}`,G)}else this.emit(`option:${_.name()}`);g=_.variadic?_:null;continue}}if(V.length>2&&V[0]==="-"&&V[1]!=="-"){let _=this._findOption(`-${V[1]}`);if(_){if(_.required||_.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${_.name()}`,V.slice(2));else this.emit(`option:${_.name()}`),J.unshift(`-${V.slice(2)}`);continue}}if(/^--[^=]+=/.test(V)){let _=V.indexOf("="),G=this._findOption(V.slice(0,_));if(G&&(G.required||G.optional)){this.emit(`option:${G.name()}`,V.slice(_+1));continue}}if(z(V))v=U;if((this._enablePositionalOptions||this._passThroughOptions)&&w.length===0&&U.length===0){if(this._findCommand(V)){if(w.push(V),J.length>0)U.push(...J);break}else if(this._getHelpCommand()&&V===this._getHelpCommand().name()){if(w.push(V),J.length>0)w.push(...J);break}else if(this._defaultCommandName){if(U.push(V),J.length>0)U.push(...J);break}}if(this._passThroughOptions){if(v.push(V),J.length>0)v.push(...J);break}v.push(V)}return{operands:w,unknown:U}}opts(){if(this._storeOptionsAsProperties){let $={},w=this.options.length;for(let U=0;U<w;U++){let v=this.options[U].attributeName();$[v]=v===this._versionOptionName?this._version:this[v]}return $}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce(($,w)=>Object.assign($,w.opts()),{})}error($,w){if(this._outputConfiguration.outputError(`${$}
|
|
23
23
|
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==="string")this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
24
24
|
`);else if(this._showHelpAfterError)this._outputConfiguration.writeErr(`
|
|
25
|
-
`),this.outputHelp({error:!0});let w
|
|
26
|
-
`),this._exit(0,"commander.version",$)}),this}description($,
|
|
27
|
-
Expecting one of '${
|
|
28
|
-
`)}),this}_outputHelpIfRequested($){let
|
|
29
|
-
`)}}
|
|
30
|
-
`)?
|
|
25
|
+
`),this.outputHelp({error:!0});let U=w||{},v=U.exitCode||1,J=U.code||"commander.error";this._exit(v,J,$)}_parseOptionsEnv(){this.options.forEach(($)=>{if($.envVar&&$.envVar in o.env){let w=$.attributeName();if(this.getOptionValue(w)===void 0||["default","config","env"].includes(this.getOptionValueSource(w)))if($.required||$.optional)this.emit(`optionEnv:${$.name()}`,o.env[$.envVar]);else this.emit(`optionEnv:${$.name()}`)}})}_parseOptionsImplied(){let $=new PP(this.options),w=(U)=>{return this.getOptionValue(U)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(U))};this.options.filter((U)=>U.implied!==void 0&&w(U.attributeName())&&$.valueFromOption(this.getOptionValue(U.attributeName()),U)).forEach((U)=>{Object.keys(U.implied).filter((v)=>!w(v)).forEach((v)=>{this.setOptionValueWithSource(v,U.implied[v],"implied")})})}missingArgument($){let w=`error: missing required argument '${$}'`;this.error(w,{code:"commander.missingArgument"})}optionMissingArgument($){let w=`error: option '${$.flags}' argument missing`;this.error(w,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue($){let w=`error: required option '${$.flags}' not specified`;this.error(w,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption($,w){let U=(z)=>{let g=z.attributeName(),V=this.getOptionValue(g),_=this.options.find((X)=>X.negate&&g===X.attributeName()),G=this.options.find((X)=>!X.negate&&g===X.attributeName());if(_&&(_.presetArg===void 0&&V===!1||_.presetArg!==void 0&&V===_.presetArg))return _;return G||z},v=(z)=>{let g=U(z),V=g.attributeName();if(this.getOptionValueSource(V)==="env")return`environment variable '${g.envVar}'`;return`option '${g.flags}'`},J=`error: ${v($)} cannot be used with ${v(w)}`;this.error(J,{code:"commander.conflictingOption"})}unknownOption($){if(this._allowUnknownOption)return;let w="";if($.startsWith("--")&&this._showSuggestionAfterError){let v=[],J=this;do{let z=J.createHelp().visibleOptions(J).filter((g)=>g.long).map((g)=>g.long);v=v.concat(z),J=J.parent}while(J&&!J._enablePositionalOptions);w=m8($,v)}let U=`error: unknown option '${$}'${w}`;this.error(U,{code:"commander.unknownOption"})}_excessArguments($){if(this._allowExcessArguments)return;let w=this.registeredArguments.length,U=w===1?"":"s",J=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${w} argument${U} but got ${$.length}.`;this.error(J,{code:"commander.excessArguments"})}unknownCommand(){let $=this.args[0],w="";if(this._showSuggestionAfterError){let v=[];this.createHelp().visibleCommands(this).forEach((J)=>{if(v.push(J.name()),J.alias())v.push(J.alias())}),w=m8($,v)}let U=`error: unknown command '${$}'${w}`;this.error(U,{code:"commander.unknownCommand"})}version($,w,U){if($===void 0)return this._version;this._version=$,w=w||"-V, --version",U=U||"output the version number";let v=this.createOption(w,U);return this._versionOptionName=v.attributeName(),this._registerOption(v),this.on("option:"+v.name(),()=>{this._outputConfiguration.writeOut(`${$}
|
|
26
|
+
`),this._exit(0,"commander.version",$)}),this}description($,w){if($===void 0&&w===void 0)return this._description;if(this._description=$,w)this._argsDescription=w;return this}summary($){if($===void 0)return this._summary;return this._summary=$,this}alias($){if($===void 0)return this._aliases[0];let w=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)w=this.commands[this.commands.length-1];if($===w._name)throw Error("Command alias can't be the same as its name");let U=this.parent?._findCommand($);if(U){let v=[U.name()].concat(U.aliases()).join("|");throw Error(`cannot add alias '${$}' to command '${this.name()}' as already have command '${v}'`)}return w._aliases.push($),this}aliases($){if($===void 0)return this._aliases;return $.forEach((w)=>this.alias(w)),this}usage($){if($===void 0){if(this._usage)return this._usage;let w=this.registeredArguments.map((U)=>{return WP(U)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?w:[]).join(" ")}return this._usage=$,this}name($){if($===void 0)return this._name;return this._name=$,this}nameFromFilename($){return this._name=P4.basename($,P4.extname($)),this}executableDir($){if($===void 0)return this._executableDir;return this._executableDir=$,this}helpInformation($){let w=this.createHelp(),U=this._getOutputContext($);w.prepareContext({error:U.error,helpWidth:U.helpWidth,outputHasColors:U.hasColors});let v=w.formatHelp(this,w);if(U.hasColors)return v;return this._outputConfiguration.stripColor(v)}_getOutputContext($){$=$||{};let w=!!$.error,U,v,J;if(w)U=(g)=>this._outputConfiguration.writeErr(g),v=this._outputConfiguration.getErrHasColors(),J=this._outputConfiguration.getErrHelpWidth();else U=(g)=>this._outputConfiguration.writeOut(g),v=this._outputConfiguration.getOutHasColors(),J=this._outputConfiguration.getOutHelpWidth();return{error:w,write:(g)=>{if(!v)g=this._outputConfiguration.stripColor(g);return U(g)},hasColors:v,helpWidth:J}}outputHelp($){let w;if(typeof $==="function")w=$,$=void 0;let U=this._getOutputContext($),v={error:U.error,write:U.write,command:this};this._getCommandAndAncestors().reverse().forEach((z)=>z.emit("beforeAllHelp",v)),this.emit("beforeHelp",v);let J=this.helpInformation({error:U.error});if(w){if(J=w(J),typeof J!=="string"&&!Buffer.isBuffer(J))throw Error("outputHelp callback must return a string or a Buffer")}if(U.write(J),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",v),this._getCommandAndAncestors().forEach((z)=>z.emit("afterAllHelp",v))}helpOption($,w){if(typeof $==="boolean"){if($)this._helpOption=this._helpOption??void 0;else this._helpOption=null;return this}return $=$??"-h, --help",w=w??"display help for command",this._helpOption=this.createOption($,w),this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption($){return this._helpOption=$,this}help($){this.outputHelp($);let w=Number(o.exitCode??0);if(w===0&&$&&typeof $!=="function"&&$.error)w=1;this._exit(w,"commander.help","(outputHelp)")}addHelpText($,w){let U=["beforeAll","before","after","afterAll"];if(!U.includes($))throw Error(`Unexpected value for position to addHelpText.
|
|
27
|
+
Expecting one of '${U.join("', '")}'`);let v=`${$}Help`;return this.on(v,(J)=>{let z;if(typeof w==="function")z=w({error:J.error,command:J.command});else z=w;if(z)J.write(`${z}
|
|
28
|
+
`)}),this}_outputHelpIfRequested($){let w=this._getHelpOption();if(w&&$.find((v)=>w.is(v)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function n8($){return $.map((w)=>{if(!w.startsWith("--inspect"))return w;let U,v="127.0.0.1",J="9229",z;if((z=w.match(/^(--inspect(-brk)?)$/))!==null)U=z[1];else if((z=w.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(U=z[1],/^\d+$/.test(z[3]))J=z[3];else v=z[3];else if((z=w.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)U=z[1],v=z[3],J=z[4];if(U&&J!=="0")return`${U}=${v}:${parseInt(J)+1}`;return w})}function O2(){if(o.env.NO_COLOR||o.env.FORCE_COLOR==="0"||o.env.FORCE_COLOR==="false")return!1;if(o.env.FORCE_COLOR||o.env.CLICOLOR_FORCE!==void 0)return!0;return}OP.Command=B2;OP.useColor=O2});var o8=E((uP)=>{var{Argument:c8}=sJ(),{Command:q2}=h8(),{CommanderError:LP,InvalidArgumentError:l8}=QU(),{Help:HP}=W2(),{Option:t8}=Y2();uP.program=new q2;uP.createCommand=($)=>new q2($);uP.createOption=($,w)=>new t8($,w);uP.createArgument=($,w)=>new c8($,w);uP.Command=q2;uP.Option=t8;uP.Argument=c8;uP.Help=HP;uP.CommanderError=LP;uP.InvalidArgumentError=l8;uP.InvalidOptionArgumentError=l8});var t=E((Ku)=>{var gN=Symbol.for("yaml.alias"),mY=Symbol.for("yaml.document"),Qz=Symbol.for("yaml.map"),nY=Symbol.for("yaml.pair"),VN=Symbol.for("yaml.scalar"),Pz=Symbol.for("yaml.seq"),b4=Symbol.for("yaml.node.type"),Pu=($)=>!!$&&typeof $==="object"&&$[b4]===gN,Ou=($)=>!!$&&typeof $==="object"&&$[b4]===mY,Bu=($)=>!!$&&typeof $==="object"&&$[b4]===Qz,qu=($)=>!!$&&typeof $==="object"&&$[b4]===nY,hY=($)=>!!$&&typeof $==="object"&&$[b4]===VN,Lu=($)=>!!$&&typeof $==="object"&&$[b4]===Pz;function cY($){if($&&typeof $==="object")switch($[b4]){case Qz:case Pz:return!0}return!1}function Hu($){if($&&typeof $==="object")switch($[b4]){case gN:case Qz:case VN:case Pz:return!0}return!1}var uu=($)=>(hY($)||cY($))&&!!$.anchor;Ku.ALIAS=gN;Ku.DOC=mY;Ku.MAP=Qz;Ku.NODE_TYPE=b4;Ku.PAIR=nY;Ku.SCALAR=VN;Ku.SEQ=Pz;Ku.hasAnchor=uu;Ku.isAlias=Pu;Ku.isCollection=cY;Ku.isDocument=Ou;Ku.isMap=Bu;Ku.isNode=Hu;Ku.isPair=qu;Ku.isScalar=hY;Ku.isSeq=Lu});var ZJ=E((ru)=>{var W$=t(),S$=Symbol("break visit"),lY=Symbol("skip children"),N4=Symbol("remove node");function Oz($,w){let U=tY(w);if(W$.isDocument($)){if(vU(null,$.contents,U,Object.freeze([$]))===N4)$.contents=null}else vU(null,$,U,Object.freeze([]))}Oz.BREAK=S$;Oz.SKIP=lY;Oz.REMOVE=N4;function vU($,w,U,v){let J=oY($,w,U,v);if(W$.isNode(J)||W$.isPair(J))return pY($,v,J),vU($,J,U,v);if(typeof J!=="symbol"){if(W$.isCollection(w)){v=Object.freeze(v.concat(w));for(let z=0;z<w.items.length;++z){let g=vU(z,w.items[z],U,v);if(typeof g==="number")z=g-1;else if(g===S$)return S$;else if(g===N4)w.items.splice(z,1),z-=1}}else if(W$.isPair(w)){v=Object.freeze(v.concat(w));let z=vU("key",w.key,U,v);if(z===S$)return S$;else if(z===N4)w.key=null;let g=vU("value",w.value,U,v);if(g===S$)return S$;else if(g===N4)w.value=null}}return J}async function Bz($,w){let U=tY(w);if(W$.isDocument($)){if(await zU(null,$.contents,U,Object.freeze([$]))===N4)$.contents=null}else await zU(null,$,U,Object.freeze([]))}Bz.BREAK=S$;Bz.SKIP=lY;Bz.REMOVE=N4;async function zU($,w,U,v){let J=await oY($,w,U,v);if(W$.isNode(J)||W$.isPair(J))return pY($,v,J),zU($,J,U,v);if(typeof J!=="symbol"){if(W$.isCollection(w)){v=Object.freeze(v.concat(w));for(let z=0;z<w.items.length;++z){let g=await zU(z,w.items[z],U,v);if(typeof g==="number")z=g-1;else if(g===S$)return S$;else if(g===N4)w.items.splice(z,1),z-=1}}else if(W$.isPair(w)){v=Object.freeze(v.concat(w));let z=await zU("key",w.key,U,v);if(z===S$)return S$;else if(z===N4)w.key=null;let g=await zU("value",w.value,U,v);if(g===S$)return S$;else if(g===N4)w.value=null}}return J}function tY($){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 oY($,w,U,v){if(typeof U==="function")return U($,w,v);if(W$.isMap(w))return U.Map?.($,w,v);if(W$.isSeq(w))return U.Seq?.($,w,v);if(W$.isPair(w))return U.Pair?.($,w,v);if(W$.isScalar(w))return U.Scalar?.($,w,v);if(W$.isAlias(w))return U.Alias?.($,w,v);return}function pY($,w,U){let v=w[w.length-1];if(W$.isCollection(v))v.items[$]=U;else if(W$.isPair(v))if($==="key")v.key=U;else v.value=U;else if(W$.isDocument(v))v.contents=U;else{let J=W$.isAlias(v)?"alias":"scalar";throw Error(`Cannot replace node with ${J} parent`)}}ru.visit=Oz;ru.visitAsync=Bz});var GN=E((cu)=>{var aY=t(),mu=ZJ(),nu={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},hu=($)=>$.replace(/[!,[\]{}]/g,(w)=>nu[w]);class c${constructor($,w){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},c$.defaultYaml,$),this.tags=Object.assign({},c$.defaultTags,w)}clone(){let $=new c$(this.yaml,this.tags);return $.docStart=this.docStart,$}atDocument(){let $=new c$(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:c$.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},c$.defaultTags);break}return $}add($,w){if(this.atNextDocument)this.yaml={explicit:c$.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},c$.defaultTags),this.atNextDocument=!1;let U=$.trim().split(/[ \t]+/),v=U.shift();switch(v){case"%TAG":{if(U.length!==2){if(w(0,"%TAG directive should contain exactly two parts"),U.length<2)return!1}let[J,z]=U;return this.tags[J]=z,!0}case"%YAML":{if(this.yaml.explicit=!0,U.length!==1)return w(0,"%YAML directive should contain exactly one part"),!1;let[J]=U;if(J==="1.1"||J==="1.2")return this.yaml.version=J,!0;else{let z=/^\d+\.\d+$/.test(J);return w(6,`Unsupported YAML version ${J}`,z),!1}}default:return w(0,`Unknown directive ${v}`,!0),!1}}tagName($,w){if($==="!")return"!";if($[0]!=="!")return w(`Not a valid tag: ${$}`),null;if($[1]==="<"){let z=$.slice(2,-1);if(z==="!"||z==="!!")return w(`Verbatim tags aren't resolved, so ${$} is invalid.`),null;if($[$.length-1]!==">")w("Verbatim tags must end with a >");return z}let[,U,v]=$.match(/^(.*!)([^!]*)$/s);if(!v)w(`The ${$} tag has no suffix`);let J=this.tags[U];if(J)try{return J+decodeURIComponent(v)}catch(z){return w(String(z)),null}if(U==="!")return $;return w(`Could not resolve tag: ${$}`),null}tagString($){for(let[w,U]of Object.entries(this.tags))if($.startsWith(U))return w+hu($.substring(U.length));return $[0]==="!"?$:`!<${$}>`}toString($){let w=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],U=Object.entries(this.tags),v;if($&&U.length>0&&aY.isNode($.contents)){let J={};mu.visit($.contents,(z,g)=>{if(aY.isNode(g)&&g.tag)J[g.tag]=!0}),v=Object.keys(J)}else v=[];for(let[J,z]of U){if(J==="!!"&&z==="tag:yaml.org,2002:")continue;if(!$||v.some((g)=>g.startsWith(z)))w.push(`%TAG ${J} ${z}`)}return w.join(`
|
|
29
|
+
`)}}c$.defaultYaml={explicit:!1,version:"1.2"};c$.defaultTags={"!!":"tag:yaml.org,2002:"};cu.Directives=c$});var qz=E((au)=>{var eY=t(),tu=ZJ();function ou($){if(/[\x00-\x19\s,[\]{}]/.test($)){let U=`Anchor must not contain whitespace or control characters: ${JSON.stringify($)}`;throw Error(U)}return!0}function sY($){let w=new Set;return tu.visit($,{Value(U,v){if(v.anchor)w.add(v.anchor)}}),w}function $Q($,w){for(let U=1;;++U){let v=`${$}${U}`;if(!w.has(v))return v}}function pu($,w){let U=[],v=new Map,J=null;return{onAnchor:(z)=>{U.push(z),J??(J=sY($));let g=$Q(w,J);return J.add(g),g},setAnchors:()=>{for(let z of U){let g=v.get(z);if(typeof g==="object"&&g.anchor&&(eY.isScalar(g.node)||eY.isCollection(g.node)))g.node.anchor=g.anchor;else{let V=Error("Failed to resolve repeated object (this should not happen)");throw V.source=z,V}}},sourceObjects:v}}au.anchorIsValid=ou;au.anchorNames=sY;au.createNodeAnchors=pu;au.findNewAnchor=$Q});var _N=E((UK)=>{function bJ($,w,U,v){if(v&&typeof v==="object")if(Array.isArray(v))for(let J=0,z=v.length;J<z;++J){let g=v[J],V=bJ($,v,String(J),g);if(V===void 0)delete v[J];else if(V!==g)v[J]=V}else if(v instanceof Map)for(let J of Array.from(v.keys())){let z=v.get(J),g=bJ($,v,J,z);if(g===void 0)v.delete(J);else if(g!==z)v.set(J,g)}else if(v instanceof Set)for(let J of Array.from(v)){let z=bJ($,v,J,J);if(z===void 0)v.delete(J);else if(z!==J)v.delete(J),v.add(z)}else for(let[J,z]of Object.entries(v)){let g=bJ($,v,J,z);if(g===void 0)delete v[J];else if(g!==z)v[J]=g}return $.call(w,U,v)}UK.applyReviver=bJ});var p4=E((zK)=>{var vK=t();function wQ($,w,U){if(Array.isArray($))return $.map((v,J)=>wQ(v,String(J),U));if($&&typeof $.toJSON==="function"){if(!U||!vK.hasAnchor($))return $.toJSON(w,U);let v={aliasCount:0,count:1,res:void 0};U.anchors.set($,v),U.onCreate=(z)=>{v.res=z,delete U.onCreate};let J=$.toJSON(w,U);if(U.onCreate)U.onCreate(J);return J}if(typeof $==="bigint"&&!U?.keep)return Number($);return $}zK.toJS=wQ});var Lz=E((_K)=>{var VK=_N(),UQ=t(),GK=p4();class JQ{constructor($){Object.defineProperty(this,UQ.NODE_TYPE,{value:$})}clone(){let $=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)$.range=this.range.slice();return $}toJS($,{mapAsMap:w,maxAliasCount:U,onAnchor:v,reviver:J}={}){if(!UQ.isDocument($))throw TypeError("A document argument is required");let z={anchors:new Map,doc:$,keep:!0,mapAsMap:w===!0,mapKeyWarned:!1,maxAliasCount:typeof U==="number"?U:100},g=GK.toJS(this,"",z);if(typeof v==="function")for(let{count:V,res:_}of z.anchors.values())v(_,V);return typeof J==="function"?VK.applyReviver(J,{"":g},"",g):g}}_K.NodeBase=JQ});var FJ=E((QK)=>{var IK=qz(),NK=ZJ(),gU=t(),WK=Lz(),YK=p4();class vQ extends WK.NodeBase{constructor($){super(gU.ALIAS);this.source=$,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve($,w){if(w?.maxAliasCount===0)throw ReferenceError("Alias resolution is disabled");let U;if(w?.aliasResolveCache)U=w.aliasResolveCache;else if(U=[],NK.visit($,{Node:(J,z)=>{if(gU.isAlias(z)||gU.hasAnchor(z))U.push(z)}}),w)w.aliasResolveCache=U;let v=void 0;for(let J of U){if(J===this)break;if(J.anchor===this.source)v=J}return v}toJSON($,w){if(!w)return{source:this.source};let{anchors:U,doc:v,maxAliasCount:J}=w,z=this.resolve(v,w);if(!z){let V=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(V)}let g=U.get(z);if(!g)YK.toJS(z,null,w),g=U.get(z);if(g?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(J>=0){if(g.count+=1,g.aliasCount===0)g.aliasCount=Hz(v,z,U);if(g.count*g.aliasCount>J)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return g.res}toString($,w,U){let v=`*${this.source}`;if($){if(IK.anchorIsValid(this.source),$.options.verifyAliasOrder&&!$.anchors.has(this.source)){let J=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(J)}if($.implicitKey)return`${v} `}return v}}function Hz($,w,U){if(gU.isAlias(w)){let v=w.resolve($),J=U&&v&&U.get(v);return J?J.count*J.aliasCount:0}else if(gU.isCollection(w)){let v=0;for(let J of w.items){let z=Hz($,J,U);if(z>v)v=z}return v}else if(gU.isPair(w)){let v=Hz($,w.key,U),J=Hz($,w.value,U);return Math.max(v,J)}return 1}QK.Alias=vQ});var G$=E((HK)=>{var OK=t(),BK=Lz(),qK=p4(),LK=($)=>!$||typeof $!=="function"&&typeof $!=="object";class C6 extends BK.NodeBase{constructor($){super(OK.SCALAR);this.value=$}toJSON($,w){return w?.keep?this.value:qK.toJS(this.value,$,w)}toString(){return String(this.value)}}C6.BLOCK_FOLDED="BLOCK_FOLDED";C6.BLOCK_LITERAL="BLOCK_LITERAL";C6.PLAIN="PLAIN";C6.QUOTE_DOUBLE="QUOTE_DOUBLE";C6.QUOTE_SINGLE="QUOTE_SINGLE";HK.Scalar=C6;HK.isScalarValue=LK});var MJ=E((bK)=>{var DK=FJ(),j6=t(),zQ=G$(),fK="tag:yaml.org,2002:";function TK($,w,U){if(w){let v=U.filter((z)=>z.tag===w),J=v.find((z)=>!z.format)??v[0];if(!J)throw Error(`Tag ${w} not found`);return J}return U.find((v)=>v.identify?.($)&&!v.format)}function ZK($,w,U){if(j6.isDocument($))$=$.contents;if(j6.isNode($))return $;if(j6.isPair($)){let I=U.schema[j6.MAP].createNode?.(U.schema,null,U);return I.items.push($),I}if($ instanceof String||$ instanceof Number||$ instanceof Boolean||typeof BigInt<"u"&&$ instanceof BigInt)$=$.valueOf();let{aliasDuplicateObjects:v,onAnchor:J,onTagObj:z,schema:g,sourceObjects:V}=U,_=void 0;if(v&&$&&typeof $==="object")if(_=V.get($),_)return _.anchor??(_.anchor=J($)),new DK.Alias(_.anchor);else _={anchor:null,node:null},V.set($,_);if(w?.startsWith("!!"))w=fK+w.slice(2);let G=TK($,w,g.tags);if(!G){if($&&typeof $.toJSON==="function")$=$.toJSON();if(!$||typeof $!=="object"){let I=new zQ.Scalar($);if(_)_.node=I;return I}G=$ instanceof Map?g[j6.MAP]:(Symbol.iterator in Object($))?g[j6.SEQ]:g[j6.MAP]}if(z)z(G),delete U.onTagObj;let X=G?.createNode?G.createNode(U.schema,$,U):typeof G?.nodeClass?.from==="function"?G.nodeClass.from(U.schema,$,U):new zQ.Scalar($);if(w)X.tag=w;else if(!G.default)X.tag=G.tag;if(_)_.node=X;return X}bK.createNode=ZK});var uz=E((EK)=>{var MK=MJ(),W4=t(),iK=Lz();function XN($,w,U){let v=U;for(let J=w.length-1;J>=0;--J){let z=w[J];if(typeof z==="number"&&Number.isInteger(z)&&z>=0){let g=[];g[z]=v,v=g}else v=new Map([[z,v]])}return MK.createNode(v,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:$,sourceObjects:new Map})}var gQ=($)=>$==null||typeof $==="object"&&!!$[Symbol.iterator]().next().done;class VQ extends iK.NodeBase{constructor($,w){super($);Object.defineProperty(this,"schema",{value:w,configurable:!0,enumerable:!1,writable:!0})}clone($){let w=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if($)w.schema=$;if(w.items=w.items.map((U)=>W4.isNode(U)||W4.isPair(U)?U.clone($):U),this.range)w.range=this.range.slice();return w}addIn($,w){if(gQ($))this.add(w);else{let[U,...v]=$,J=this.get(U,!0);if(W4.isCollection(J))J.addIn(v,w);else if(J===void 0&&this.schema)this.set(U,XN(this.schema,v,w));else throw Error(`Expected YAML collection at ${U}. Remaining path: ${v}`)}}deleteIn($){let[w,...U]=$;if(U.length===0)return this.delete(w);let v=this.get(w,!0);if(W4.isCollection(v))return v.deleteIn(U);else throw Error(`Expected YAML collection at ${w}. Remaining path: ${U}`)}getIn($,w){let[U,...v]=$,J=this.get(U,!0);if(v.length===0)return!w&&W4.isScalar(J)?J.value:J;else return W4.isCollection(J)?J.getIn(v,w):void 0}hasAllNullValues($){return this.items.every((w)=>{if(!W4.isPair(w))return!1;let U=w.value;return U==null||$&&W4.isScalar(U)&&U.value==null&&!U.commentBefore&&!U.comment&&!U.tag})}hasIn($){let[w,...U]=$;if(U.length===0)return this.has(w);let v=this.get(w,!0);return W4.isCollection(v)?v.hasIn(U):!1}setIn($,w){let[U,...v]=$;if(v.length===0)this.set(U,w);else{let J=this.get(U,!0);if(W4.isCollection(J))J.setIn(v,w);else if(J===void 0&&this.schema)this.set(U,XN(this.schema,v,w));else throw Error(`Expected YAML collection at ${U}. Remaining path: ${v}`)}}}EK.Collection=VQ;EK.collectionFromPath=XN;EK.isEmptyPath=gQ});var iJ=E((jK)=>{var kK=($)=>$.replace(/^(?!$)(?: $)?/gm,"#");function IN($,w){if(/^\n+$/.test($))return $.substring(1);return w?$.replace(/^(?! *$)/gm,w):$}var CK=($,w,U)=>$.endsWith(`
|
|
30
|
+
`)?IN(U,w):U.includes(`
|
|
31
31
|
`)?`
|
|
32
|
-
`+
|
|
33
|
-
`){if(
|
|
34
|
-
`&&
|
|
35
|
-
`&&
|
|
36
|
-
${
|
|
37
|
-
${
|
|
38
|
-
`);
|
|
39
|
-
`){if(
|
|
32
|
+
`+IN(U,w):($.endsWith(" ")?"":" ")+U;jK.indentComment=IN;jK.lineComment=CK;jK.stringifyComment=kK});var _Q=E((mK)=>{function dK($,w,U="flow",{indentAtStart:v,lineWidth:J=80,minContentWidth:z=20,onFold:g,onOverflow:V}={}){if(!J||J<0)return $;if(J<z)z=0;let _=Math.max(1+z,1+J-w.length);if($.length<=_)return $;let G=[],X={},I=J-w.length;if(typeof v==="number")if(v>J-Math.max(2,z))G.push(0);else I=J-v;let N=void 0,W=void 0,P=!1,Q=-1,H=-1,Z=-1;if(U==="block"){if(Q=GQ($,Q,w.length),Q!==-1)I=Q+_}for(let b;b=$[Q+=1];){if(U==="quoted"&&b==="\\"){switch(H=Q,$[Q+1]){case"x":Q+=3;break;case"u":Q+=5;break;case"U":Q+=9;break;default:Q+=1}Z=Q}if(b===`
|
|
33
|
+
`){if(U==="block")Q=GQ($,Q,w.length);I=Q+w.length+_,N=void 0}else{if(b===" "&&W&&W!==" "&&W!==`
|
|
34
|
+
`&&W!=="\t"){let M=$[Q+1];if(M&&M!==" "&&M!==`
|
|
35
|
+
`&&M!=="\t")N=Q}if(Q>=I)if(N)G.push(N),I=N+_,N=void 0;else if(U==="quoted"){while(W===" "||W==="\t")W=b,b=$[Q+=1],P=!0;let M=Q>Z+1?Q-2:H-1;if(X[M])return $;G.push(M),X[M]=!0,I=M+_,N=void 0}else P=!0}W=b}if(P&&V)V();if(G.length===0)return $;if(g)g();let u=$.slice(0,G[0]);for(let b=0;b<G.length;++b){let M=G[b],S=G[b+1]||$.length;if(M===0)u=`
|
|
36
|
+
${w}${$.slice(0,S)}`;else{if(U==="quoted"&&X[M])u+=`${$[M]}\\`;u+=`
|
|
37
|
+
${w}${$.slice(M+1,S)}`}}return u}function GQ($,w,U){let v=w,J=w+1,z=$[J];while(z===" "||z==="\t")if(w<J+U)z=$[++w];else{do z=$[++w];while(z&&z!==`
|
|
38
|
+
`);v=w,J=w+1,z=$[J]}return v}mK.FOLD_BLOCK="block";mK.FOLD_FLOW="flow";mK.FOLD_QUOTED="quoted";mK.foldFlowLines=dK});var SJ=E((aK)=>{var $4=G$(),a4=_Q(),Dz=($,w)=>({indentAtStart:w?$.indent.length:$.indentAtStart,lineWidth:$.options.lineWidth,minContentWidth:$.options.minContentWidth}),fz=($)=>/^(%|---|\.\.\.)/m.test($);function tK($,w,U){if(!w||w<0)return!1;let v=w-U,J=$.length;if(J<=v)return!1;for(let z=0,g=0;z<J;++z)if($[z]===`
|
|
39
|
+
`){if(z-g>v)return!0;if(g=z+1,J-g<=v)return!1}return!0}function EJ($,w){let U=JSON.stringify($);if(w.options.doubleQuotedAsJSON)return U;let{implicitKey:v}=w,J=w.options.doubleQuotedMinMultiLineLength,z=w.indent||(fz($)?" ":""),g="",V=0;for(let _=0,G=U[_];G;G=U[++_]){if(G===" "&&U[_+1]==="\\"&&U[_+2]==="n")g+=U.slice(V,_)+"\\ ",_+=1,V=_,G="\\";if(G==="\\")switch(U[_+1]){case"u":{g+=U.slice(V,_);let X=U.substr(_+2,4);switch(X){case"0000":g+="\\0";break;case"0007":g+="\\a";break;case"000b":g+="\\v";break;case"001b":g+="\\e";break;case"0085":g+="\\N";break;case"00a0":g+="\\_";break;case"2028":g+="\\L";break;case"2029":g+="\\P";break;default:if(X.substr(0,2)==="00")g+="\\x"+X.substr(2);else g+=U.substr(_,6)}_+=5,V=_+1}break;case"n":if(v||U[_+2]==='"'||U.length<J)_+=1;else{g+=U.slice(V,_)+`
|
|
40
40
|
|
|
41
|
-
`;while(
|
|
42
|
-
`,
|
|
43
|
-
`)||/[ \t]\n|\n[ \t]/.test($))return
|
|
44
|
-
${
|
|
41
|
+
`;while(U[_+2]==="\\"&&U[_+3]==="n"&&U[_+4]!=='"')g+=`
|
|
42
|
+
`,_+=2;if(g+=z,U[_+2]===" ")g+="\\";_+=1,V=_+1}break;default:_+=1}}return g=V?g+U.slice(V):U,v?g:a4.foldFlowLines(g,z,a4.FOLD_QUOTED,Dz(w,!1))}function NN($,w){if(w.options.singleQuote===!1||w.implicitKey&&$.includes(`
|
|
43
|
+
`)||/[ \t]\n|\n[ \t]/.test($))return EJ($,w);let U=w.indent||(fz($)?" ":""),v="'"+$.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
44
|
+
${U}`)+"'";return w.implicitKey?v:a4.foldFlowLines(v,U,a4.FOLD_FLOW,Dz(w,!1))}function VU($,w){let{singleQuote:U}=w.options,v;if(U===!1)v=EJ;else{let J=$.includes('"'),z=$.includes("'");if(J&&!z)v=NN;else if(z&&!J)v=EJ;else v=U?NN:EJ}return v($,w)}var WN;try{WN=new RegExp(`(^|(?<!
|
|
45
45
|
))
|
|
46
46
|
+(?!
|
|
47
|
-
|$)`,"g")}catch{
|
|
47
|
+
|$)`,"g")}catch{WN=/\n+(?!\n|$)/g}function Kz({comment:$,type:w,value:U},v,J,z){let{blockQuote:g,commentString:V,lineWidth:_}=v.options;if(!g||/\n[\t ]+$/.test(U))return VU(U,v);let G=v.indent||(v.forceBlockIndent||fz(U)?" ":""),X=g==="literal"?!0:g==="folded"||w===$4.Scalar.BLOCK_FOLDED?!1:w===$4.Scalar.BLOCK_LITERAL?!0:!tK(U,_,G.length);if(!U)return X?`|
|
|
48
48
|
`:`>
|
|
49
|
-
`;let
|
|
50
|
-
`&&
|
|
51
|
-
`);if(
|
|
52
|
-
`)
|
|
53
|
-
`)
|
|
54
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${
|
|
55
|
-
${
|
|
56
|
-
${
|
|
57
|
-
`)||
|
|
58
|
-
`)?
|
|
59
|
-
`))return
|
|
60
|
-
${
|
|
61
|
-
${
|
|
62
|
-
${
|
|
63
|
-
`:"",
|
|
64
|
-
${
|
|
65
|
-
`&&
|
|
49
|
+
`;let I,N;for(N=U.length;N>0;--N){let S=U[N-1];if(S!==`
|
|
50
|
+
`&&S!=="\t"&&S!==" ")break}let W=U.substring(N),P=W.indexOf(`
|
|
51
|
+
`);if(P===-1)I="-";else if(U===W||P!==W.length-1){if(I="+",z)z()}else I="";if(W){if(U=U.slice(0,-W.length),W[W.length-1]===`
|
|
52
|
+
`)W=W.slice(0,-1);W=W.replace(WN,`$&${G}`)}let Q=!1,H,Z=-1;for(H=0;H<U.length;++H){let S=U[H];if(S===" ")Q=!0;else if(S===`
|
|
53
|
+
`)Z=H;else break}let u=U.substring(0,Z<H?Z+1:H);if(u)U=U.substring(u.length),u=u.replace(/\n+/g,`$&${G}`);let M=(Q?G?"2":"1":"")+I;if($){if(M+=" "+V($.replace(/ ?[\r\n]+/g," ")),J)J()}if(!X){let S=U.replace(/\n+/g,`
|
|
54
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${G}`),k=!1,x=Dz(v,!0);if(g!=="folded"&&w!==$4.Scalar.BLOCK_FOLDED)x.onOverflow=()=>{k=!0};let A=a4.foldFlowLines(`${u}${S}${W}`,G,a4.FOLD_BLOCK,x);if(!k)return`>${M}
|
|
55
|
+
${G}${A}`}return U=U.replace(/\n+/g,`$&${G}`),`|${M}
|
|
56
|
+
${G}${u}${U}${W}`}function oK($,w,U,v){let{type:J,value:z}=$,{actualString:g,implicitKey:V,indent:_,indentStep:G,inFlow:X}=w;if(V&&z.includes(`
|
|
57
|
+
`)||X&&/[[\]{},]/.test(z))return VU(z,w);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(z))return V||X||!z.includes(`
|
|
58
|
+
`)?VU(z,w):Kz($,w,U,v);if(!V&&!X&&J!==$4.Scalar.PLAIN&&z.includes(`
|
|
59
|
+
`))return Kz($,w,U,v);if(fz(z)){if(_==="")return w.forceBlockIndent=!0,Kz($,w,U,v);else if(V&&_===G)return VU(z,w)}let I=z.replace(/\n+/g,`$&
|
|
60
|
+
${_}`);if(g){let N=(Q)=>Q.default&&Q.tag!=="tag:yaml.org,2002:str"&&Q.test?.test(I),{compat:W,tags:P}=w.doc.schema;if(P.some(N)||W?.some(N))return VU(z,w)}return V?I:a4.foldFlowLines(I,_,a4.FOLD_FLOW,Dz(w,!1))}function pK($,w,U,v){let{implicitKey:J,inFlow:z}=w,g=typeof $.value==="string"?$:Object.assign({},$,{value:String($.value)}),{type:V}=$;if(V!==$4.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(g.value))V=$4.Scalar.QUOTE_DOUBLE}let _=(X)=>{switch(X){case $4.Scalar.BLOCK_FOLDED:case $4.Scalar.BLOCK_LITERAL:return J||z?VU(g.value,w):Kz(g,w,U,v);case $4.Scalar.QUOTE_DOUBLE:return EJ(g.value,w);case $4.Scalar.QUOTE_SINGLE:return NN(g.value,w);case $4.Scalar.PLAIN:return oK(g,w,U,v);default:return null}},G=_(V);if(G===null){let{defaultKeyType:X,defaultStringType:I}=w.options,N=J&&X||I;if(G=_(N),G===null)throw Error(`Unsupported default string type ${N}`)}return G}aK.stringifyString=pK});var AJ=E((gD)=>{var sK=qz(),e4=t(),$D=iJ(),wD=SJ();function UD($,w){let U=Object.assign({blockQuote:!0,commentString:$D.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,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},$.schema.toStringOptions,w),v;switch(U.collectionStyle){case"block":v=!1;break;case"flow":v=!0;break;default:v=null}return{anchors:new Set,doc:$,flowCollectionPadding:U.flowCollectionPadding?" ":"",indent:"",indentStep:typeof U.indent==="number"?" ".repeat(U.indent):" ",inFlow:v,options:U}}function JD($,w){if(w.tag){let J=$.filter((z)=>z.tag===w.tag);if(J.length>0)return J.find((z)=>z.format===w.format)??J[0]}let U=void 0,v;if(e4.isScalar(w)){v=w.value;let J=$.filter((z)=>z.identify?.(v));if(J.length>1){let z=J.filter((g)=>g.test);if(z.length>0)J=z}U=J.find((z)=>z.format===w.format)??J.find((z)=>!z.format)}else v=w,U=$.find((J)=>J.nodeClass&&v instanceof J.nodeClass);if(!U){let J=v?.constructor?.name??(v===null?"null":typeof v);throw Error(`Tag not resolved for ${J} value`)}return U}function vD($,w,{anchors:U,doc:v}){if(!v.directives)return"";let J=[],z=(e4.isScalar($)||e4.isCollection($))&&$.anchor;if(z&&sK.anchorIsValid(z))U.add(z),J.push(`&${z}`);let g=$.tag??(w.default?null:w.tag);if(g)J.push(v.directives.tagString(g));return J.join(" ")}function zD($,w,U,v){if(e4.isPair($))return $.toString(w,U,v);if(e4.isAlias($)){if(w.doc.directives)return $.toString(w);if(w.resolvedAliases?.has($))throw TypeError("Cannot stringify circular structure without alias nodes");else{if(w.resolvedAliases)w.resolvedAliases.add($);else w.resolvedAliases=new Set([$]);$=$.resolve(w.doc)}}let J=void 0,z=e4.isNode($)?$:w.doc.createNode($,{onTagObj:(_)=>J=_});J??(J=JD(w.doc.schema.tags,z));let g=vD(z,J,w);if(g.length>0)w.indentAtStart=(w.indentAtStart??0)+g.length+1;let V=typeof J.stringify==="function"?J.stringify(z,w,U,v):e4.isScalar(z)?wD.stringifyString(z,w,U,v):z.toString(w,U,v);if(!g)return V;return e4.isScalar(z)||V[0]==="{"||V[0]==="["?`${g} ${V}`:`${g}
|
|
61
|
+
${w.indent}${V}`}gD.createStringifyContext=UD;gD.stringify=zD});var NQ=E((XD)=>{var F4=t(),XQ=G$(),IQ=AJ(),RJ=iJ();function _D({key:$,value:w},U,v,J){let{allNullValues:z,doc:g,indent:V,indentStep:_,options:{commentString:G,indentSeq:X,simpleKeys:I}}=U,N=F4.isNode($)&&$.comment||null;if(I){if(N)throw Error("With simple keys, key nodes cannot have comments");if(F4.isCollection($)||!F4.isNode($)&&typeof $==="object")throw Error("With simple keys, collection cannot be used as a key value")}let W=!I&&(!$||N&&w==null&&!U.inFlow||F4.isCollection($)||(F4.isScalar($)?$.type===XQ.Scalar.BLOCK_FOLDED||$.type===XQ.Scalar.BLOCK_LITERAL:typeof $==="object"));U=Object.assign({},U,{allNullValues:!1,implicitKey:!W&&(I||!z),indent:V+_});let P=!1,Q=!1,H=IQ.stringify($,U,()=>P=!0,()=>Q=!0);if(!W&&!U.inFlow&&H.length>1024){if(I)throw Error("With simple keys, single line scalar must not span more than 1024 characters");W=!0}if(U.inFlow){if(z||w==null){if(P&&v)v();return H===""?"?":W?`? ${H}`:H}}else if(z&&!I||w==null&&W){if(H=`? ${H}`,N&&!P)H+=RJ.lineComment(H,U.indent,G(N));else if(Q&&J)J();return H}if(P)N=null;if(W){if(N)H+=RJ.lineComment(H,U.indent,G(N));H=`? ${H}
|
|
62
|
+
${V}:`}else if(H=`${H}:`,N)H+=RJ.lineComment(H,U.indent,G(N));let Z,u,b;if(F4.isNode(w))Z=!!w.spaceBefore,u=w.commentBefore,b=w.comment;else if(Z=!1,u=null,b=null,w&&typeof w==="object")w=g.createNode(w);if(U.implicitKey=!1,!W&&!N&&F4.isScalar(w))U.indentAtStart=H.length+1;if(Q=!1,!X&&_.length>=2&&!U.inFlow&&!W&&F4.isSeq(w)&&!w.flow&&!w.tag&&!w.anchor)U.indent=U.indent.substring(2);let M=!1,S=IQ.stringify(w,U,()=>M=!0,()=>Q=!0),k=" ";if(N||Z||u){if(k=Z?`
|
|
63
|
+
`:"",u){let x=G(u);k+=`
|
|
64
|
+
${RJ.indentComment(x,U.indent)}`}if(S===""&&!U.inFlow){if(k===`
|
|
65
|
+
`&&b)k=`
|
|
66
66
|
|
|
67
|
-
`}else
|
|
68
|
-
${
|
|
69
|
-
`),
|
|
70
|
-
${
|
|
71
|
-
`)
|
|
72
|
-
${
|
|
73
|
-
`}}if($){if(
|
|
74
|
-
`+
|
|
75
|
-
`)),
|
|
76
|
-
${
|
|
77
|
-
`;return`${
|
|
78
|
-
${
|
|
79
|
-
`:" ")}return
|
|
80
|
-
${
|
|
81
|
-
${G.comment}`:J.comment}J=z}$.items[w]=bJ.isPair(J)?J:new gW.Pair(J)}else U("Expected a sequence for this tag");return $}function Ig($,U,w){let{replacer:J}=w,z=new TF.YAMLSeq($);z.tag="tag:yaml.org,2002:pairs";let G=0;if(U&&Symbol.iterator in Object(U))for(let X of U){if(typeof J==="function")X=J.call(U,String(G++),X);let _,N;if(Array.isArray(X))if(X.length===2)_=X[0],N=X[1];else throw TypeError(`Expected [key, value] tuple: ${X}`);else if(X&&X instanceof Object){let W=Object.keys(X);if(W.length===1)_=W[0],N=X[_];else throw TypeError(`Expected tuple with one key, not ${W.length} keys`)}else _=X;z.items.push(gW.createPair(_,N,w))}return z}var ZF={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Hg,createNode:Ig};DF.createPairs=Ig;DF.pairs=ZF;DF.resolvePairs=Hg});var qW=f((EF)=>{var Kg=p(),BW=r4(),b0=t4(),SF=a4(),Lg=EJ();class f6 extends SF.YAMLSeq{constructor(){super();this.add=b0.YAMLMap.prototype.add.bind(this),this.delete=b0.YAMLMap.prototype.delete.bind(this),this.get=b0.YAMLMap.prototype.get.bind(this),this.has=b0.YAMLMap.prototype.has.bind(this),this.set=b0.YAMLMap.prototype.set.bind(this),this.tag=f6.tag}toJSON($,U){if(!U)return super.toJSON($);let w=new Map;if(U?.onCreate)U.onCreate(w);for(let J of this.items){let z,G;if(Kg.isPair(J))z=BW.toJS(J.key,"",U),G=BW.toJS(J.value,z,U);else z=BW.toJS(J,"",U);if(w.has(z))throw Error("Ordered maps must not include duplicate keys");w.set(z,G)}return w}static from($,U,w){let J=Lg.createPairs($,U,w),z=new this;return z.items=J.items,z}}f6.tag="tag:yaml.org,2002:omap";var bF={collection:"seq",identify:($)=>$ instanceof Map,nodeClass:f6,default:!1,tag:"tag:yaml.org,2002:omap",resolve($,U){let w=Lg.resolvePairs($,U),J=[];for(let{key:z}of w.items)if(Kg.isScalar(z))if(J.includes(z.value))U(`Ordered maps must not include duplicate keys: ${z.value}`);else J.push(z.value);return Object.assign(new f6,w)},createNode:($,U,w)=>f6.from($,U,w)};EF.YAMLOMap=f6;EF.omap=bF});var Dg=f((RF)=>{var Pg=_$();function Og({value:$,source:U},w){if(U&&($?Tg:Zg).test.test(U))return U;return $?w.options.trueStr:w.options.falseStr}var Tg={identify:($)=>$===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Pg.Scalar(!0),stringify:Og},Zg={identify:($)=>$===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Pg.Scalar(!1),stringify:Og};RF.falseTag=Zg;RF.trueTag=Tg});var Fg=f((iF)=>{var uF=_$(),HW=$w(),CF={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:HW.stringifyNumber},xF={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 U=Number($.value);return isFinite(U)?U.toExponential():HW.stringifyNumber($)}},yF={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve($){let U=new uF.Scalar(parseFloat($.replace(/_/g,""))),w=$.indexOf(".");if(w!==-1){let J=$.substring(w+1).replace(/_/g,"");if(J[J.length-1]==="0")U.minFractionDigits=J.length}return U},stringify:HW.stringifyNumber};iF.float=yF;iF.floatExp=xF;iF.floatNaN=CF});var Mg=f((pF)=>{var vg=$w(),E0=($)=>typeof $==="bigint"||Number.isInteger($);function AJ($,U,w,{intAsBigInt:J}){let z=$[0];if(z==="-"||z==="+")U+=1;if($=$.substring(U).replace(/_/g,""),J){switch(w){case 2:$=`0b${$}`;break;case 8:$=`0o${$}`;break;case 16:$=`0x${$}`;break}let X=BigInt($);return z==="-"?BigInt(-1)*X:X}let G=parseInt($,w);return z==="-"?-1*G:G}function IW($,U,w){let{value:J}=$;if(E0(J)){let z=J.toString(U);return J<0?"-"+w+z.substr(1):w+z}return vg.stringifyNumber($)}var rF={identify:E0,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:($,U,w)=>AJ($,2,2,w),stringify:($)=>IW($,2,"0b")},lF={identify:E0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:($,U,w)=>AJ($,1,8,w),stringify:($)=>IW($,8,"0")},dF={identify:E0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:($,U,w)=>AJ($,0,10,w),stringify:vg.stringifyNumber},nF={identify:E0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:($,U,w)=>AJ($,2,16,w),stringify:($)=>IW($,16,"0x")};pF.int=dF;pF.intBin=rF;pF.intHex=nF;pF.intOct=lF});var KW=f(($v)=>{var kJ=p(),fJ=n4(),RJ=t4();class R6 extends RJ.YAMLMap{constructor($){super($);this.tag=R6.tag}add($){let U;if(kJ.isPair($))U=$;else if($&&typeof $==="object"&&"key"in $&&"value"in $&&$.value===null)U=new fJ.Pair($.key,null);else U=new fJ.Pair($,null);if(!RJ.findPair(this.items,U.key))this.items.push(U)}get($,U){let w=RJ.findPair(this.items,$);return!U&&kJ.isPair(w)?kJ.isScalar(w.key)?w.key.value:w.key:w}set($,U){if(typeof U!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof U}`);let w=RJ.findPair(this.items,$);if(w&&!U)this.items.splice(this.items.indexOf(w),1);else if(!w&&U)this.items.push(new fJ.Pair($))}toJSON($,U){return super.toJSON($,U,Set)}toString($,U,w){if(!$)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},$,{allNullValues:!0}),U,w);else throw Error("Set items must all have null values")}static from($,U,w){let{replacer:J}=w,z=new this($);if(U&&Symbol.iterator in Object(U))for(let G of U){if(typeof J==="function")G=J.call(U,G,G);z.items.push(fJ.createPair(G,null,w))}return z}}R6.tag="tag:yaml.org,2002:set";var sF={collection:"map",identify:($)=>$ instanceof Set,nodeClass:R6,default:!1,tag:"tag:yaml.org,2002:set",createNode:($,U,w)=>R6.from($,U,w),resolve($,U){if(kJ.isMap($))if($.hasAllNullValues(!0))return Object.assign(new R6,$);else U("Set items must all have null values");else U("Expected a mapping for this tag");return $}};$v.YAMLSet=R6;$v.set=sF});var PW=f((Xv)=>{var zv=$w();function LW($,U){let w=$[0],J=w==="-"||w==="+"?$.substring(1):$,z=(X)=>U?BigInt(X):Number(X),G=J.replace(/_/g,"").split(":").reduce((X,_)=>X*z(60)+z(_),z(0));return w==="-"?z(-1)*G:G}function Sg($){let{value:U}=$,w=(X)=>X;if(typeof U==="bigint")w=(X)=>BigInt(X);else if(isNaN(U)||!isFinite(U))return zv.stringifyNumber($);let J="";if(U<0)J="-",U*=w(-1);let z=w(60),G=[U%z];if(U<60)G.unshift(0);else if(U=(U-G[0])/z,G.unshift(U%z),U>=60)U=(U-G[0])/z,G.unshift(U);return J+G.map((X)=>String(X).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var Jv={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:($,U,{intAsBigInt:w})=>LW($,w),stringify:Sg},Gv={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:($)=>LW($,!1),stringify:Sg},bg={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 U=$.match(bg.test);if(!U)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,w,J,z,G,X,_]=U.map(Number),N=U[7]?Number((U[7]+"00").substr(1,3)):0,W=Date.UTC(w,J-1,z,G||0,X||0,_||0,N),Y=U[8];if(Y&&Y!=="Z"){let Q=LW(Y,!1);if(Math.abs(Q)<30)Q*=60;W-=60000*Q}return new Date(W)},stringify:({value:$})=>$?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Xv.floatTime=Gv;Xv.intTime=Jv;Xv.timestamp=bg});var Ag=f((Pv)=>{var Yv=eU(),Qv=vJ(),Vv=sU(),gv=M0(),Bv=VW(),Eg=Dg(),OW=Fg(),jJ=Mg(),qv=KJ(),Hv=qW(),Iv=EJ(),Kv=KW(),TW=PW(),Lv=[Yv.map,Vv.seq,gv.string,Qv.nullTag,Eg.trueTag,Eg.falseTag,jJ.intBin,jJ.intOct,jJ.int,jJ.intHex,OW.floatNaN,OW.floatExp,OW.float,Bv.binary,qv.merge,Hv.omap,Iv.pairs,Kv.set,TW.intTime,TW.floatTime,TW.timestamp];Pv.schema=Lv});var hg=f((bv)=>{var jg=eU(),Tv=vJ(),ug=sU(),Zv=M0(),Dv=JW(),ZW=XW(),DW=NW(),Fv=gg(),vv=qg(),Cg=VW(),A0=KJ(),xg=qW(),yg=EJ(),fg=Ag(),ig=KW(),uJ=PW(),Rg=new Map([["core",Fv.schema],["failsafe",[jg.map,ug.seq,Zv.string]],["json",vv.schema],["yaml11",fg.schema],["yaml-1.1",fg.schema]]),kg={binary:Cg.binary,bool:Dv.boolTag,float:ZW.float,floatExp:ZW.floatExp,floatNaN:ZW.floatNaN,floatTime:uJ.floatTime,int:DW.int,intHex:DW.intHex,intOct:DW.intOct,intTime:uJ.intTime,map:jg.map,merge:A0.merge,null:Tv.nullTag,omap:xg.omap,pairs:yg.pairs,seq:ug.seq,set:ig.set,timestamp:uJ.timestamp},Mv={"tag:yaml.org,2002:binary":Cg.binary,"tag:yaml.org,2002:merge":A0.merge,"tag:yaml.org,2002:omap":xg.omap,"tag:yaml.org,2002:pairs":yg.pairs,"tag:yaml.org,2002:set":ig.set,"tag:yaml.org,2002:timestamp":uJ.timestamp};function Sv($,U,w){let J=Rg.get(U);if(J&&!$)return w&&!J.includes(A0.merge)?J.concat(A0.merge):J.slice();let z=J;if(!z)if(Array.isArray($))z=[];else{let G=Array.from(Rg.keys()).filter((X)=>X!=="yaml11").map((X)=>JSON.stringify(X)).join(", ");throw Error(`Unknown schema "${U}"; use one of ${G} or define customTags array`)}if(Array.isArray($))for(let G of $)z=z.concat(G);else if(typeof $==="function")z=$(z.slice());if(w)z=z.concat(A0.merge);return z.reduce((G,X)=>{let _=typeof X==="string"?kg[X]:X;if(!_){let N=JSON.stringify(X),W=Object.keys(kg).map((Y)=>JSON.stringify(Y)).join(", ");throw Error(`Unknown custom tag ${N}; use one of ${W}`)}if(!G.includes(_))G.push(_);return G},[])}bv.coreKnownTags=Mv;bv.getTags=Sv});var MW=f((uv)=>{var FW=p(),fv=eU(),Rv=sU(),kv=M0(),CJ=hg(),jv=($,U)=>$.key<U.key?-1:$.key>U.key?1:0;class vW{constructor({compat:$,customTags:U,merge:w,resolveKnownTags:J,schema:z,sortMapEntries:G,toStringDefaults:X}){this.compat=Array.isArray($)?CJ.getTags($,"compat"):$?CJ.getTags(null,$):null,this.name=typeof z==="string"&&z||"core",this.knownTags=J?CJ.coreKnownTags:{},this.tags=CJ.getTags(U,this.name,w),this.toStringOptions=X??null,Object.defineProperty(this,FW.MAP,{value:fv.map}),Object.defineProperty(this,FW.SCALAR,{value:kv.string}),Object.defineProperty(this,FW.SEQ,{value:Rv.seq}),this.sortMapEntries=typeof G==="function"?G:G===!0?jv:null}clone(){let $=Object.create(vW.prototype,Object.getOwnPropertyDescriptors(this));return $.tags=this.tags.slice(),$}}uv.Schema=vW});var mg=f((iv)=>{var xv=p(),SW=D0(),f0=O0();function yv($,U){let w=[],J=U.directives===!0;if(U.directives!==!1&&$.directives){let N=$.directives.toString($);if(N)w.push(N),J=!0;else if($.directives.docStart)J=!0}if(J)w.push("---");let z=SW.createStringifyContext($,U),{commentString:G}=z.options;if($.commentBefore){if(w.length!==1)w.unshift("");let N=G($.commentBefore);w.unshift(f0.indentComment(N,""))}let X=!1,_=null;if($.contents){if(xv.isNode($.contents)){if($.contents.spaceBefore&&J)w.push("");if($.contents.commentBefore){let Y=G($.contents.commentBefore);w.push(f0.indentComment(Y,""))}z.forceBlockIndent=!!$.comment,_=$.contents.comment}let N=_?void 0:()=>X=!0,W=SW.stringify($.contents,z,()=>_=null,N);if(_)W+=f0.lineComment(W,"",G(_));if((W[0]==="|"||W[0]===">")&&w[w.length-1]==="---")w[w.length-1]=`--- ${W}`;else w.push(W)}else w.push(SW.stringify($.contents,z));if($.directives?.docEnd)if($.comment){let N=G($.comment);if(N.includes(`
|
|
82
|
-
`))
|
|
67
|
+
`}else k+=`
|
|
68
|
+
${U.indent}`}else if(!W&&F4.isCollection(w)){let x=S[0],A=S.indexOf(`
|
|
69
|
+
`),a=A!==-1,h=U.inFlow??w.flow??w.items.length===0;if(a||!h){let K$=!1;if(a&&(x==="&"||x==="!")){let z$=S.indexOf(" ");if(x==="&"&&z$!==-1&&z$<A&&S[z$+1]==="!")z$=S.indexOf(" ",z$+1);if(z$===-1||A<z$)K$=!0}if(!K$)k=`
|
|
70
|
+
${U.indent}`}}else if(S===""||S[0]===`
|
|
71
|
+
`)k="";if(H+=k+S,U.inFlow){if(M&&v)v()}else if(b&&!M)H+=RJ.lineComment(H,U.indent,G(b));else if(Q&&J)J();return H}XD.stringifyPair=_D});var YN=E((YD)=>{var WQ=Q4("process");function ND($,...w){if($==="debug")console.log(...w)}function WD($,w){if($==="debug"||$==="warn")if(typeof WQ.emitWarning==="function")WQ.emitWarning(w);else console.warn(w)}YD.debug=ND;YD.warn=WD});var Fz=E((BD)=>{var bz=t(),YQ=G$(),Tz="<<",Zz={identify:($)=>$===Tz||typeof $==="symbol"&&$.description===Tz,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new YQ.Scalar(Symbol(Tz)),{addToJSMap:QQ}),stringify:()=>Tz},OD=($,w)=>(Zz.identify(w)||bz.isScalar(w)&&(!w.type||w.type===YQ.Scalar.PLAIN)&&Zz.identify(w.value))&&$?.doc.schema.tags.some((U)=>U.tag===Zz.tag&&U.default);function QQ($,w,U){let v=PQ($,U);if(bz.isSeq(v))for(let J of v.items)QN($,w,J);else if(Array.isArray(v))for(let J of v)QN($,w,J);else QN($,w,v)}function QN($,w,U){let v=PQ($,U);if(!bz.isMap(v))throw Error("Merge sources must be maps or map aliases");let J=v.toJSON(null,$,Map);for(let[z,g]of J)if(w instanceof Map){if(!w.has(z))w.set(z,g)}else if(w instanceof Set)w.add(z);else if(!Object.prototype.hasOwnProperty.call(w,z))Object.defineProperty(w,z,{value:g,writable:!0,enumerable:!0,configurable:!0});return w}function PQ($,w){return $&&bz.isAlias(w)?w.resolve($.doc,$):w}BD.addMergeToJSMap=QQ;BD.isMergeKey=OD;BD.merge=Zz});var ON=E((TD)=>{var uD=YN(),OQ=Fz(),KD=AJ(),BQ=t(),PN=p4();function DD($,w,{key:U,value:v}){if(BQ.isNode(U)&&U.addToJSMap)U.addToJSMap($,w,v);else if(OQ.isMergeKey($,U))OQ.addMergeToJSMap($,w,v);else{let J=PN.toJS(U,"",$);if(w instanceof Map)w.set(J,PN.toJS(v,J,$));else if(w instanceof Set)w.add(J);else{let z=fD(U,J,$),g=PN.toJS(v,z,$);if(z in w)Object.defineProperty(w,z,{value:g,writable:!0,enumerable:!0,configurable:!0});else w[z]=g}}return w}function fD($,w,U){if(w===null)return"";if(typeof w!=="object")return String(w);if(BQ.isNode($)&&U?.doc){let v=KD.createStringifyContext(U.doc,{});v.anchors=new Set;for(let z of U.anchors.keys())v.anchors.add(z.anchor);v.inFlow=!0,v.inStringifyKey=!0;let J=$.toString(v);if(!U.mapKeyWarned){let z=JSON.stringify(J);if(z.length>40)z=z.substring(0,36)+'..."';uD.warn(U.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${z}. Set mapAsMap: true to use object keys.`),U.mapKeyWarned=!0}return J}return JSON.stringify(w)}TD.addPairToJSMap=DD});var s4=E((iD)=>{var qQ=MJ(),bD=NQ(),FD=ON(),Mz=t();function MD($,w,U){let v=qQ.createNode($,void 0,U),J=qQ.createNode(w,void 0,U);return new iz(v,J)}class iz{constructor($,w=null){Object.defineProperty(this,Mz.NODE_TYPE,{value:Mz.PAIR}),this.key=$,this.value=w}clone($){let{key:w,value:U}=this;if(Mz.isNode(w))w=w.clone($);if(Mz.isNode(U))U=U.clone($);return new iz(w,U)}toJSON($,w){let U=w?.mapAsMap?new Map:{};return FD.addPairToJSMap(w,U,this)}toString($,w,U){return $?.doc?bD.stringifyPair(this,$,w,U):JSON.stringify(this)}}iD.Pair=iz;iD.createPair=MD});var BN=E((CD)=>{var x6=t(),LQ=AJ(),Ez=iJ();function AD($,w,U){return(w.inFlow??$.flow?kD:RD)($,w,U)}function RD({comment:$,items:w},U,{blockItemPrefix:v,flowChars:J,itemIndent:z,onChompKeep:g,onComment:V}){let{indent:_,options:{commentString:G}}=U,X=Object.assign({},U,{indent:z,type:null}),I=!1,N=[];for(let P=0;P<w.length;++P){let Q=w[P],H=null;if(x6.isNode(Q)){if(!I&&Q.spaceBefore)N.push("");if(Sz(U,N,Q.commentBefore,I),Q.comment)H=Q.comment}else if(x6.isPair(Q)){let u=x6.isNode(Q.key)?Q.key:null;if(u){if(!I&&u.spaceBefore)N.push("");Sz(U,N,u.commentBefore,I)}}I=!1;let Z=LQ.stringify(Q,X,()=>H=null,()=>I=!0);if(H)Z+=Ez.lineComment(Z,z,G(H));if(I&&H)I=!1;N.push(v+Z)}let W;if(N.length===0)W=J.start+J.end;else{W=N[0];for(let P=1;P<N.length;++P){let Q=N[P];W+=Q?`
|
|
72
|
+
${_}${Q}`:`
|
|
73
|
+
`}}if($){if(W+=`
|
|
74
|
+
`+Ez.indentComment(G($),_),V)V()}else if(I&&g)g();return W}function kD({items:$},w,{flowChars:U,itemIndent:v}){let{indent:J,indentStep:z,flowCollectionPadding:g,options:{commentString:V}}=w;v+=z;let _=Object.assign({},w,{indent:v,inFlow:!0,type:null}),G=!1,X=0,I=[];for(let P=0;P<$.length;++P){let Q=$[P],H=null;if(x6.isNode(Q)){if(Q.spaceBefore)I.push("");if(Sz(w,I,Q.commentBefore,!1),Q.comment)H=Q.comment}else if(x6.isPair(Q)){let u=x6.isNode(Q.key)?Q.key:null;if(u){if(u.spaceBefore)I.push("");if(Sz(w,I,u.commentBefore,!1),u.comment)G=!0}let b=x6.isNode(Q.value)?Q.value:null;if(b){if(b.comment)H=b.comment;if(b.commentBefore)G=!0}else if(Q.value==null&&u?.comment)H=u.comment}if(H)G=!0;let Z=LQ.stringify(Q,_,()=>H=null);if(G||(G=I.length>X||Z.includes(`
|
|
75
|
+
`)),P<$.length-1)Z+=",";else if(w.options.trailingComma){if(w.options.lineWidth>0)G||(G=I.reduce((u,b)=>u+b.length+2,2)+(Z.length+2)>w.options.lineWidth);if(G)Z+=","}if(H)Z+=Ez.lineComment(Z,v,V(H));I.push(Z),X=I.length}let{start:N,end:W}=U;if(I.length===0)return N+W;else{if(!G){let P=I.reduce((Q,H)=>Q+H.length+2,2);G=w.options.lineWidth>0&&P>w.options.lineWidth}if(G){let P=N;for(let Q of I)P+=Q?`
|
|
76
|
+
${z}${J}${Q}`:`
|
|
77
|
+
`;return`${P}
|
|
78
|
+
${J}${W}`}else return`${N}${g}${I.join(" ")}${g}${W}`}}function Sz({indent:$,options:{commentString:w}},U,v,J){if(v&&J)v=v.replace(/^\n+/,"");if(v){let z=Ez.indentComment(w(v),$);U.push(z.trimStart())}}CD.stringifyCollection=AD});var w6=E((mD)=>{var xD=BN(),rD=ON(),yD=uz(),$6=t(),Az=s4(),dD=G$();function kJ($,w){let U=$6.isScalar(w)?w.value:w;for(let v of $)if($6.isPair(v)){if(v.key===w||v.key===U)return v;if($6.isScalar(v.key)&&v.key.value===U)return v}return}class HQ extends yD.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor($){super($6.MAP,$);this.items=[]}static from($,w,U){let{keepUndefined:v,replacer:J}=U,z=new this($),g=(V,_)=>{if(typeof J==="function")_=J.call(w,V,_);else if(Array.isArray(J)&&!J.includes(V))return;if(_!==void 0||v)z.items.push(Az.createPair(V,_,U))};if(w instanceof Map)for(let[V,_]of w)g(V,_);else if(w&&typeof w==="object")for(let V of Object.keys(w))g(V,w[V]);if(typeof $.sortMapEntries==="function")z.items.sort($.sortMapEntries);return z}add($,w){let U;if($6.isPair($))U=$;else if(!$||typeof $!=="object"||!("key"in $))U=new Az.Pair($,$?.value);else U=new Az.Pair($.key,$.value);let v=kJ(this.items,U.key),J=this.schema?.sortMapEntries;if(v){if(!w)throw Error(`Key ${U.key} already set`);if($6.isScalar(v.value)&&dD.isScalarValue(U.value))v.value.value=U.value;else v.value=U.value}else if(J){let z=this.items.findIndex((g)=>J(U,g)<0);if(z===-1)this.items.push(U);else this.items.splice(z,0,U)}else this.items.push(U)}delete($){let w=kJ(this.items,$);if(!w)return!1;return this.items.splice(this.items.indexOf(w),1).length>0}get($,w){let v=kJ(this.items,$)?.value;return(!w&&$6.isScalar(v)?v.value:v)??void 0}has($){return!!kJ(this.items,$)}set($,w){this.add(new Az.Pair($,w),!0)}toJSON($,w,U){let v=U?new U:w?.mapAsMap?new Map:{};if(w?.onCreate)w.onCreate(v);for(let J of this.items)rD.addPairToJSMap(w,v,J);return v}toString($,w,U){if(!$)return JSON.stringify(this);for(let v of this.items)if(!$6.isPair(v))throw Error(`Map items must all be pairs; found ${JSON.stringify(v)} instead`);if(!$.allNullValues&&this.hasAllNullValues(!1))$=Object.assign({},$,{allNullValues:!0});return xD.stringifyCollection(this,$,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:$.indent||"",onChompKeep:U,onComment:w})}}mD.YAMLMap=HQ;mD.findPair=kJ});var GU=E((tD)=>{var cD=t(),uQ=w6(),lD={collection:"map",default:!0,nodeClass:uQ.YAMLMap,tag:"tag:yaml.org,2002:map",resolve($,w){if(!cD.isMap($))w("Expected a mapping for this tag");return $},createNode:($,w,U)=>uQ.YAMLMap.from($,w,U)};tD.map=lD});var U6=E((wf)=>{var pD=MJ(),aD=BN(),eD=uz(),kz=t(),sD=G$(),$f=p4();class KQ extends eD.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor($){super(kz.SEQ,$);this.items=[]}add($){this.items.push($)}delete($){let w=Rz($);if(typeof w!=="number")return!1;return this.items.splice(w,1).length>0}get($,w){let U=Rz($);if(typeof U!=="number")return;let v=this.items[U];return!w&&kz.isScalar(v)?v.value:v}has($){let w=Rz($);return typeof w==="number"&&w<this.items.length}set($,w){let U=Rz($);if(typeof U!=="number")throw Error(`Expected a valid index, not ${$}.`);let v=this.items[U];if(kz.isScalar(v)&&sD.isScalarValue(w))v.value=w;else this.items[U]=w}toJSON($,w){let U=[];if(w?.onCreate)w.onCreate(U);let v=0;for(let J of this.items)U.push($f.toJS(J,String(v++),w));return U}toString($,w,U){if(!$)return JSON.stringify(this);return aD.stringifyCollection(this,$,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:($.indent||"")+" ",onChompKeep:U,onComment:w})}static from($,w,U){let{replacer:v}=U,J=new this($);if(w&&Symbol.iterator in Object(w)){let z=0;for(let g of w){if(typeof v==="function"){let V=w instanceof Set?g:String(z++);g=v.call(w,V,g)}J.items.push(pD.createNode(g,void 0,U))}}return J}}function Rz($){let w=kz.isScalar($)?$.value:$;if(w&&typeof w==="string")w=Number(w);return typeof w==="number"&&Number.isInteger(w)&&w>=0?w:null}wf.YAMLSeq=KQ});var _U=E((zf)=>{var Jf=t(),DQ=U6(),vf={collection:"seq",default:!0,nodeClass:DQ.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve($,w){if(!Jf.isSeq($))w("Expected a sequence for this tag");return $},createNode:($,w,U)=>DQ.YAMLSeq.from($,w,U)};zf.seq=vf});var CJ=E((_f)=>{var Vf=SJ(),Gf={identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify($,w,U,v){return w=Object.assign({actualString:!0},w),Vf.stringifyString($,w,U,v)}};_f.string=Gf});var Cz=E((If)=>{var fQ=G$(),TQ={identify:($)=>$==null,createNode:()=>new fQ.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new fQ.Scalar(null),stringify:({source:$},w)=>typeof $==="string"&&TQ.test.test($)?$:w.options.nullStr};If.nullTag=TQ});var qN=E((Yf)=>{var Wf=G$(),ZQ={identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:($)=>new Wf.Scalar($[0]==="t"||$[0]==="T"),stringify({source:$,value:w},U){if($&&ZQ.test.test($)){let v=$[0]==="t"||$[0]==="T";if(w===v)return $}return w?U.options.trueStr:U.options.falseStr}};Yf.boolTag=ZQ});var XU=E((Of)=>{function Pf({format:$,minFractionDigits:w,tag:U,value:v}){if(typeof v==="bigint")return String(v);let J=typeof v==="number"?v:Number(v);if(!isFinite(J))return isNaN(J)?".nan":J<0?"-.inf":".inf";let z=Object.is(v,-0)?"-0":JSON.stringify(v);if(!$&&w&&(!U||U==="tag:yaml.org,2002:float")&&/^-?\d/.test(z)&&!z.includes("e")){let g=z.indexOf(".");if(g<0)g=z.length,z+=".";let V=w-(z.length-g-1);while(V-- >0)z+="0"}return z}Of.stringifyNumber=Pf});var HN=E((Kf)=>{var qf=G$(),LN=XU(),Lf={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:LN.stringifyNumber},Hf={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 w=Number($.value);return isFinite(w)?w.toExponential():LN.stringifyNumber($)}},uf={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve($){let w=new qf.Scalar(parseFloat($)),U=$.indexOf(".");if(U!==-1&&$[$.length-1]==="0")w.minFractionDigits=$.length-U-1;return w},stringify:LN.stringifyNumber};Kf.float=uf;Kf.floatExp=Hf;Kf.floatNaN=Lf});var KN=E((Mf)=>{var bQ=XU(),jz=($)=>typeof $==="bigint"||Number.isInteger($),uN=($,w,U,{intAsBigInt:v})=>v?BigInt($):parseInt($.substring(w),U);function FQ($,w,U){let{value:v}=$;if(jz(v)&&v>=0)return U+v.toString(w);return bQ.stringifyNumber($)}var Zf={identify:($)=>jz($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:($,w,U)=>uN($,2,8,U),stringify:($)=>FQ($,8,"0o")},bf={identify:jz,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:($,w,U)=>uN($,0,10,U),stringify:bQ.stringifyNumber},Ff={identify:($)=>jz($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:($,w,U)=>uN($,2,16,U),stringify:($)=>FQ($,16,"0x")};Mf.int=bf;Mf.intHex=Ff;Mf.intOct=Zf});var MQ=E((yf)=>{var Rf=GU(),kf=Cz(),Cf=_U(),jf=CJ(),xf=qN(),DN=HN(),fN=KN(),rf=[Rf.map,Cf.seq,jf.string,kf.nullTag,xf.boolTag,fN.intOct,fN.int,fN.intHex,DN.floatNaN,DN.floatExp,DN.float];yf.schema=rf});var EQ=E((of)=>{var mf=G$(),nf=GU(),hf=_U();function iQ($){return typeof $==="bigint"||Number.isInteger($)}var xz=({value:$})=>JSON.stringify($),cf=[{identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify:xz},{identify:($)=>$==null,createNode:()=>new mf.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:xz},{identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:($)=>$==="true",stringify:xz},{identify:iQ,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:($,w,{intAsBigInt:U})=>U?BigInt($):parseInt($,10),stringify:({value:$})=>iQ($)?$.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:xz}],lf={default:!0,tag:"",test:/^/,resolve($,w){return w(`Unresolved plain scalar ${JSON.stringify($)}`),$}},tf=[nf.map,hf.seq].concat(cf,lf);of.schema=tf});var ZN=E((sf)=>{var jJ=Q4("buffer"),TN=G$(),af=SJ(),ef={identify:($)=>$ instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve($,w){if(typeof jJ.Buffer==="function")return jJ.Buffer.from($,"base64");else if(typeof atob==="function"){let U=atob($.replace(/[\n\r]/g,"")),v=new Uint8Array(U.length);for(let J=0;J<U.length;++J)v[J]=U.charCodeAt(J);return v}else return w("This environment does not support reading binary tags; either Buffer or atob is required"),$},stringify({comment:$,type:w,value:U},v,J,z){if(!U)return"";let g=U,V;if(typeof jJ.Buffer==="function")V=g instanceof jJ.Buffer?g.toString("base64"):jJ.Buffer.from(g.buffer).toString("base64");else if(typeof btoa==="function"){let _="";for(let G=0;G<g.length;++G)_+=String.fromCharCode(g[G]);V=btoa(_)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(w??(w=TN.Scalar.BLOCK_LITERAL),w!==TN.Scalar.QUOTE_DOUBLE){let _=Math.max(v.options.lineWidth-v.indent.length,v.options.minContentWidth),G=Math.ceil(V.length/_),X=Array(G);for(let I=0,N=0;I<G;++I,N+=_)X[I]=V.substr(N,_);V=X.join(w===TN.Scalar.BLOCK_LITERAL?`
|
|
79
|
+
`:" ")}return af.stringifyString({comment:$,type:w,value:V},v,J,z)}};sf.binary=ef});var yz=E((vT)=>{var rz=t(),bN=s4(),wT=G$(),UT=U6();function SQ($,w){if(rz.isSeq($))for(let U=0;U<$.items.length;++U){let v=$.items[U];if(rz.isPair(v))continue;else if(rz.isMap(v)){if(v.items.length>1)w("Each pair must have its own sequence indicator");let J=v.items[0]||new bN.Pair(new wT.Scalar(null));if(v.commentBefore)J.key.commentBefore=J.key.commentBefore?`${v.commentBefore}
|
|
80
|
+
${J.key.commentBefore}`:v.commentBefore;if(v.comment){let z=J.value??J.key;z.comment=z.comment?`${v.comment}
|
|
81
|
+
${z.comment}`:v.comment}v=J}$.items[U]=rz.isPair(v)?v:new bN.Pair(v)}else w("Expected a sequence for this tag");return $}function AQ($,w,U){let{replacer:v}=U,J=new UT.YAMLSeq($);J.tag="tag:yaml.org,2002:pairs";let z=0;if(w&&Symbol.iterator in Object(w))for(let g of w){if(typeof v==="function")g=v.call(w,String(z++),g);let V,_;if(Array.isArray(g))if(g.length===2)V=g[0],_=g[1];else throw TypeError(`Expected [key, value] tuple: ${g}`);else if(g&&g instanceof Object){let G=Object.keys(g);if(G.length===1)V=G[0],_=g[V];else throw TypeError(`Expected tuple with one key, not ${G.length} keys`)}else V=g;J.items.push(bN.createPair(V,_,U))}return J}var JT={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:SQ,createNode:AQ};vT.createPairs=AQ;vT.pairs=JT;vT.resolvePairs=SQ});var MN=E((XT)=>{var RQ=t(),FN=p4(),xJ=w6(),GT=U6(),kQ=yz();class r6 extends GT.YAMLSeq{constructor(){super();this.add=xJ.YAMLMap.prototype.add.bind(this),this.delete=xJ.YAMLMap.prototype.delete.bind(this),this.get=xJ.YAMLMap.prototype.get.bind(this),this.has=xJ.YAMLMap.prototype.has.bind(this),this.set=xJ.YAMLMap.prototype.set.bind(this),this.tag=r6.tag}toJSON($,w){if(!w)return super.toJSON($);let U=new Map;if(w?.onCreate)w.onCreate(U);for(let v of this.items){let J,z;if(RQ.isPair(v))J=FN.toJS(v.key,"",w),z=FN.toJS(v.value,J,w);else J=FN.toJS(v,"",w);if(U.has(J))throw Error("Ordered maps must not include duplicate keys");U.set(J,z)}return U}static from($,w,U){let v=kQ.createPairs($,w,U),J=new this;return J.items=v.items,J}}r6.tag="tag:yaml.org,2002:omap";var _T={collection:"seq",identify:($)=>$ instanceof Map,nodeClass:r6,default:!1,tag:"tag:yaml.org,2002:omap",resolve($,w){let U=kQ.resolvePairs($,w),v=[];for(let{key:J}of U.items)if(RQ.isScalar(J))if(v.includes(J.value))w(`Ordered maps must not include duplicate keys: ${J.value}`);else v.push(J.value);return Object.assign(new r6,U)},createNode:($,w,U)=>r6.from($,w,U)};XT.YAMLOMap=r6;XT.omap=_T});var yQ=E((WT)=>{var CQ=G$();function jQ({value:$,source:w},U){if(w&&($?xQ:rQ).test.test(w))return w;return $?U.options.trueStr:U.options.falseStr}var xQ={identify:($)=>$===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new CQ.Scalar(!0),stringify:jQ},rQ={identify:($)=>$===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new CQ.Scalar(!1),stringify:jQ};WT.falseTag=rQ;WT.trueTag=xQ});var dQ=E((LT)=>{var PT=G$(),iN=XU(),OT={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:iN.stringifyNumber},BT={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 w=Number($.value);return isFinite(w)?w.toExponential():iN.stringifyNumber($)}},qT={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve($){let w=new PT.Scalar(parseFloat($.replace(/_/g,""))),U=$.indexOf(".");if(U!==-1){let v=$.substring(U+1).replace(/_/g,"");if(v[v.length-1]==="0")w.minFractionDigits=v.length}return w},stringify:iN.stringifyNumber};LT.float=qT;LT.floatExp=BT;LT.floatNaN=OT});var nQ=E((bT)=>{var mQ=XU(),rJ=($)=>typeof $==="bigint"||Number.isInteger($);function dz($,w,U,{intAsBigInt:v}){let J=$[0];if(J==="-"||J==="+")w+=1;if($=$.substring(w).replace(/_/g,""),v){switch(U){case 2:$=`0b${$}`;break;case 8:$=`0o${$}`;break;case 16:$=`0x${$}`;break}let g=BigInt($);return J==="-"?BigInt(-1)*g:g}let z=parseInt($,U);return J==="-"?-1*z:z}function EN($,w,U){let{value:v}=$;if(rJ(v)){let J=v.toString(w);return v<0?"-"+U+J.substr(1):U+J}return mQ.stringifyNumber($)}var DT={identify:rJ,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:($,w,U)=>dz($,2,2,U),stringify:($)=>EN($,2,"0b")},fT={identify:rJ,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:($,w,U)=>dz($,1,8,U),stringify:($)=>EN($,8,"0")},TT={identify:rJ,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:($,w,U)=>dz($,0,10,U),stringify:mQ.stringifyNumber},ZT={identify:rJ,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:($,w,U)=>dz($,2,16,U),stringify:($)=>EN($,16,"0x")};bT.int=TT;bT.intBin=DT;bT.intHex=ZT;bT.intOct=fT});var SN=E((AT)=>{var hz=t(),mz=s4(),nz=w6();class y6 extends nz.YAMLMap{constructor($){super($);this.tag=y6.tag}add($){let w;if(hz.isPair($))w=$;else if($&&typeof $==="object"&&"key"in $&&"value"in $&&$.value===null)w=new mz.Pair($.key,null);else w=new mz.Pair($,null);if(!nz.findPair(this.items,w.key))this.items.push(w)}get($,w){let U=nz.findPair(this.items,$);return!w&&hz.isPair(U)?hz.isScalar(U.key)?U.key.value:U.key:U}set($,w){if(typeof w!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof w}`);let U=nz.findPair(this.items,$);if(U&&!w)this.items.splice(this.items.indexOf(U),1);else if(!U&&w)this.items.push(new mz.Pair($))}toJSON($,w){return super.toJSON($,w,Set)}toString($,w,U){if(!$)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},$,{allNullValues:!0}),w,U);else throw Error("Set items must all have null values")}static from($,w,U){let{replacer:v}=U,J=new this($);if(w&&Symbol.iterator in Object(w))for(let z of w){if(typeof v==="function")z=v.call(w,z,z);J.items.push(mz.createPair(z,null,U))}return J}}y6.tag="tag:yaml.org,2002:set";var ST={collection:"map",identify:($)=>$ instanceof Set,nodeClass:y6,default:!1,tag:"tag:yaml.org,2002:set",createNode:($,w,U)=>y6.from($,w,U),resolve($,w){if(hz.isMap($))if($.hasAllNullValues(!0))return Object.assign(new y6,$);else w("Set items must all have null values");else w("Expected a mapping for this tag");return $}};AT.YAMLSet=y6;AT.set=ST});var RN=E((rT)=>{var CT=XU();function AN($,w){let U=$[0],v=U==="-"||U==="+"?$.substring(1):$,J=(g)=>w?BigInt(g):Number(g),z=v.replace(/_/g,"").split(":").reduce((g,V)=>g*J(60)+J(V),J(0));return U==="-"?J(-1)*z:z}function hQ($){let{value:w}=$,U=(g)=>g;if(typeof w==="bigint")U=(g)=>BigInt(g);else if(isNaN(w)||!isFinite(w))return CT.stringifyNumber($);let v="";if(w<0)v="-",w*=U(-1);let J=U(60),z=[w%J];if(w<60)z.unshift(0);else if(w=(w-z[0])/J,z.unshift(w%J),w>=60)w=(w-z[0])/J,z.unshift(w);return v+z.map((g)=>String(g).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var jT={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:($,w,{intAsBigInt:U})=>AN($,U),stringify:hQ},xT={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:($)=>AN($,!1),stringify:hQ},cQ={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 w=$.match(cQ.test);if(!w)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,U,v,J,z,g,V]=w.map(Number),_=w[7]?Number((w[7]+"00").substr(1,3)):0,G=Date.UTC(U,v-1,J,z||0,g||0,V||0,_),X=w[8];if(X&&X!=="Z"){let I=AN(X,!1);if(Math.abs(I)<30)I*=60;G-=60000*I}return new Date(G)},stringify:({value:$})=>$?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};rT.floatTime=xT;rT.intTime=jT;rT.timestamp=cQ});var tQ=E(($Z)=>{var nT=GU(),hT=Cz(),cT=_U(),lT=CJ(),tT=ZN(),lQ=yQ(),kN=dQ(),cz=nQ(),oT=Fz(),pT=MN(),aT=yz(),eT=SN(),CN=RN(),sT=[nT.map,cT.seq,lT.string,hT.nullTag,lQ.trueTag,lQ.falseTag,cz.intBin,cz.intOct,cz.int,cz.intHex,kN.floatNaN,kN.floatExp,kN.float,tT.binary,oT.merge,pT.omap,aT.pairs,eT.set,CN.intTime,CN.floatTime,CN.timestamp];$Z.schema=sT});var v5=E((_Z)=>{var eQ=GU(),UZ=Cz(),sQ=_U(),JZ=CJ(),vZ=qN(),jN=HN(),xN=KN(),zZ=MQ(),gZ=EQ(),$5=ZN(),yJ=Fz(),w5=MN(),U5=yz(),oQ=tQ(),J5=SN(),lz=RN(),pQ=new Map([["core",zZ.schema],["failsafe",[eQ.map,sQ.seq,JZ.string]],["json",gZ.schema],["yaml11",oQ.schema],["yaml-1.1",oQ.schema]]),aQ={binary:$5.binary,bool:vZ.boolTag,float:jN.float,floatExp:jN.floatExp,floatNaN:jN.floatNaN,floatTime:lz.floatTime,int:xN.int,intHex:xN.intHex,intOct:xN.intOct,intTime:lz.intTime,map:eQ.map,merge:yJ.merge,null:UZ.nullTag,omap:w5.omap,pairs:U5.pairs,seq:sQ.seq,set:J5.set,timestamp:lz.timestamp},VZ={"tag:yaml.org,2002:binary":$5.binary,"tag:yaml.org,2002:merge":yJ.merge,"tag:yaml.org,2002:omap":w5.omap,"tag:yaml.org,2002:pairs":U5.pairs,"tag:yaml.org,2002:set":J5.set,"tag:yaml.org,2002:timestamp":lz.timestamp};function GZ($,w,U){let v=pQ.get(w);if(v&&!$)return U&&!v.includes(yJ.merge)?v.concat(yJ.merge):v.slice();let J=v;if(!J)if(Array.isArray($))J=[];else{let z=Array.from(pQ.keys()).filter((g)=>g!=="yaml11").map((g)=>JSON.stringify(g)).join(", ");throw Error(`Unknown schema "${w}"; use one of ${z} or define customTags array`)}if(Array.isArray($))for(let z of $)J=J.concat(z);else if(typeof $==="function")J=$(J.slice());if(U)J=J.concat(yJ.merge);return J.reduce((z,g)=>{let V=typeof g==="string"?aQ[g]:g;if(!V){let _=JSON.stringify(g),G=Object.keys(aQ).map((X)=>JSON.stringify(X)).join(", ");throw Error(`Unknown custom tag ${_}; use one of ${G}`)}if(!z.includes(V))z.push(V);return z},[])}_Z.coreKnownTags=VZ;_Z.getTags=GZ});var dN=E((PZ)=>{var rN=t(),NZ=GU(),WZ=_U(),YZ=CJ(),tz=v5(),QZ=($,w)=>$.key<w.key?-1:$.key>w.key?1:0;class yN{constructor({compat:$,customTags:w,merge:U,resolveKnownTags:v,schema:J,sortMapEntries:z,toStringDefaults:g}){this.compat=Array.isArray($)?tz.getTags($,"compat"):$?tz.getTags(null,$):null,this.name=typeof J==="string"&&J||"core",this.knownTags=v?tz.coreKnownTags:{},this.tags=tz.getTags(w,this.name,U),this.toStringOptions=g??null,Object.defineProperty(this,rN.MAP,{value:NZ.map}),Object.defineProperty(this,rN.SCALAR,{value:YZ.string}),Object.defineProperty(this,rN.SEQ,{value:WZ.seq}),this.sortMapEntries=typeof z==="function"?z:z===!0?QZ:null}clone(){let $=Object.create(yN.prototype,Object.getOwnPropertyDescriptors(this));return $.tags=this.tags.slice(),$}}PZ.Schema=yN});var z5=E((LZ)=>{var BZ=t(),mN=AJ(),dJ=iJ();function qZ($,w){let U=[],v=w.directives===!0;if(w.directives!==!1&&$.directives){let _=$.directives.toString($);if(_)U.push(_),v=!0;else if($.directives.docStart)v=!0}if(v)U.push("---");let J=mN.createStringifyContext($,w),{commentString:z}=J.options;if($.commentBefore){if(U.length!==1)U.unshift("");let _=z($.commentBefore);U.unshift(dJ.indentComment(_,""))}let g=!1,V=null;if($.contents){if(BZ.isNode($.contents)){if($.contents.spaceBefore&&v)U.push("");if($.contents.commentBefore){let X=z($.contents.commentBefore);U.push(dJ.indentComment(X,""))}J.forceBlockIndent=!!$.comment,V=$.contents.comment}let _=V?void 0:()=>g=!0,G=mN.stringify($.contents,J,()=>V=null,_);if(V)G+=dJ.lineComment(G,"",z(V));if((G[0]==="|"||G[0]===">")&&U[U.length-1]==="---")U[U.length-1]=`--- ${G}`;else U.push(G)}else U.push(mN.stringify($.contents,J));if($.directives?.docEnd)if($.comment){let _=z($.comment);if(_.includes(`
|
|
82
|
+
`))U.push("..."),U.push(dJ.indentComment(_,""));else U.push(`... ${_}`)}else U.push("...");else{let _=$.comment;if(_&&g)_=_.replace(/^\n+/,"");if(_){if((!g||V)&&U[U.length-1]!=="")U.push("");U.push(dJ.indentComment(z(_),""))}}return U.join(`
|
|
83
83
|
`)+`
|
|
84
|
-
`}
|
|
85
|
-
`;
|
|
84
|
+
`}LZ.stringifyDocument=qZ});var mJ=E((FZ)=>{var uZ=FJ(),IU=uz(),l$=t(),KZ=s4(),DZ=p4(),fZ=dN(),TZ=z5(),nN=qz(),ZZ=_N(),bZ=MJ(),hN=GN();class cN{constructor($,w,U){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,l$.NODE_TYPE,{value:l$.DOC});let v=null;if(typeof w==="function"||Array.isArray(w))v=w;else if(U===void 0&&w)U=w,w=void 0;let J=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},U);this.options=J;let{version:z}=J;if(U?._directives){if(this.directives=U._directives.atDocument(),this.directives.yaml.explicit)z=this.directives.yaml.version}else this.directives=new hN.Directives({version:z});this.setSchema(z,U),this.contents=$===void 0?null:this.createNode($,v,U)}clone(){let $=Object.create(cN.prototype,{[l$.NODE_TYPE]:{value:l$.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=l$.isNode(this.contents)?this.contents.clone($.schema):this.contents,this.range)$.range=this.range.slice();return $}add($){if(NU(this.contents))this.contents.add($)}addIn($,w){if(NU(this.contents))this.contents.addIn($,w)}createAlias($,w){if(!$.anchor){let U=nN.anchorNames(this);$.anchor=!w||U.has(w)?nN.findNewAnchor(w||"a",U):w}return new uZ.Alias($.anchor)}createNode($,w,U){let v=void 0;if(typeof w==="function")$=w.call({"":$},"",$),v=w;else if(Array.isArray(w)){let Q=(Z)=>typeof Z==="number"||Z instanceof String||Z instanceof Number,H=w.filter(Q).map(String);if(H.length>0)w=w.concat(H);v=w}else if(U===void 0&&w)U=w,w=void 0;let{aliasDuplicateObjects:J,anchorPrefix:z,flow:g,keepUndefined:V,onTagObj:_,tag:G}=U??{},{onAnchor:X,setAnchors:I,sourceObjects:N}=nN.createNodeAnchors(this,z||"a"),W={aliasDuplicateObjects:J??!0,keepUndefined:V??!1,onAnchor:X,onTagObj:_,replacer:v,schema:this.schema,sourceObjects:N},P=bZ.createNode($,G,W);if(g&&l$.isCollection(P))P.flow=!0;return I(),P}createPair($,w,U={}){let v=this.createNode($,null,U),J=this.createNode(w,null,U);return new KZ.Pair(v,J)}delete($){return NU(this.contents)?this.contents.delete($):!1}deleteIn($){if(IU.isEmptyPath($)){if(this.contents==null)return!1;return this.contents=null,!0}return NU(this.contents)?this.contents.deleteIn($):!1}get($,w){return l$.isCollection(this.contents)?this.contents.get($,w):void 0}getIn($,w){if(IU.isEmptyPath($))return!w&&l$.isScalar(this.contents)?this.contents.value:this.contents;return l$.isCollection(this.contents)?this.contents.getIn($,w):void 0}has($){return l$.isCollection(this.contents)?this.contents.has($):!1}hasIn($){if(IU.isEmptyPath($))return this.contents!==void 0;return l$.isCollection(this.contents)?this.contents.hasIn($):!1}set($,w){if(this.contents==null)this.contents=IU.collectionFromPath(this.schema,[$],w);else if(NU(this.contents))this.contents.set($,w)}setIn($,w){if(IU.isEmptyPath($))this.contents=w;else if(this.contents==null)this.contents=IU.collectionFromPath(this.schema,Array.from($),w);else if(NU(this.contents))this.contents.setIn($,w)}setSchema($,w={}){if(typeof $==="number")$=String($);let U;switch($){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new hN.Directives({version:"1.1"});U={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=$;else this.directives=new hN.Directives({version:$});U={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;U=null;break;default:{let v=JSON.stringify($);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${v}`)}}if(w.schema instanceof Object)this.schema=w.schema;else if(U)this.schema=new fZ.Schema(Object.assign(U,w));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:$,jsonArg:w,mapAsMap:U,maxAliasCount:v,onAnchor:J,reviver:z}={}){let g={anchors:new Map,doc:this,keep:!$,mapAsMap:U===!0,mapKeyWarned:!1,maxAliasCount:typeof v==="number"?v:100},V=DZ.toJS(this.contents,w??"",g);if(typeof J==="function")for(let{count:_,res:G}of g.anchors.values())J(G,_);return typeof z==="function"?ZZ.applyReviver(z,{"":V},"",V):V}toJSON($,w){return this.toJS({json:!0,jsonArg:$,mapAsMap:!1,onAnchor:w})}toString($={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in $&&(!Number.isInteger($.indent)||Number($.indent)<=0)){let w=JSON.stringify($.indent);throw Error(`"indent" option must be a positive integer, not ${w}`)}return TZ.stringifyDocument(this,$)}}function NU($){if(l$.isCollection($))return!0;throw Error("Expected a YAML collection as document contents")}FZ.Document=cN});var nJ=E((EZ)=>{class oz extends Error{constructor($,w,U,v){super();this.name=$,this.code=U,this.message=v,this.pos=w}}class g5 extends oz{constructor($,w,U){super("YAMLParseError",$,w,U)}}class V5 extends oz{constructor($,w,U){super("YAMLWarning",$,w,U)}}var iZ=($,w)=>(U)=>{if(U.pos[0]===-1)return;U.linePos=U.pos.map((V)=>w.linePos(V));let{line:v,col:J}=U.linePos[0];U.message+=` at line ${v}, column ${J}`;let z=J-1,g=$.substring(w.lineStarts[v-1],w.lineStarts[v]).replace(/[\n\r]+$/,"");if(z>=60&&g.length>80){let V=Math.min(z-39,g.length-79);g="…"+g.substring(V),z-=V-1}if(g.length>80)g=g.substring(0,79)+"…";if(v>1&&/^ *$/.test(g.substring(0,z))){let V=$.substring(w.lineStarts[v-2],w.lineStarts[v-1]);if(V.length>80)V=V.substring(0,79)+`…
|
|
85
|
+
`;g=V+g}if(/[^ ]/.test(g)){let V=1,_=U.linePos[1];if(_?.line===v&&_.col>J)V=Math.max(1,Math.min(_.col-J,80-z));let G=" ".repeat(z)+"^".repeat(V);U.message+=`:
|
|
86
86
|
|
|
87
|
-
${
|
|
88
|
-
${
|
|
89
|
-
`}};
|
|
90
|
-
`))return!0;if($.end){for(let
|
|
91
|
-
`+
|
|
92
|
-
`+
|
|
93
|
-
`+
|
|
94
|
-
`+x;else
|
|
95
|
-
`+
|
|
96
|
-
`+
|
|
97
|
-
`.repeat(Math.max(1,
|
|
98
|
-
`;for(let
|
|
99
|
-
`;else if(
|
|
100
|
-
`;else if(!
|
|
101
|
-
`)
|
|
87
|
+
${g}
|
|
88
|
+
${G}
|
|
89
|
+
`}};EZ.YAMLError=oz;EZ.YAMLParseError=g5;EZ.YAMLWarning=V5;EZ.prettifyError=iZ});var hJ=E((jZ)=>{function CZ($,{flow:w,indicator:U,next:v,offset:J,onError:z,parentIndent:g,startOnNewline:V}){let _=!1,G=V,X=V,I="",N="",W=!1,P=!1,Q=null,H=null,Z=null,u=null,b=null,M=null,S=null;for(let A of $){if(P){if(A.type!=="space"&&A.type!=="newline"&&A.type!=="comma")z(A.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");P=!1}if(Q){if(G&&A.type!=="comment"&&A.type!=="newline")z(Q,"TAB_AS_INDENT","Tabs are not allowed as indentation");Q=null}switch(A.type){case"space":if(!w&&(U!=="doc-start"||v?.type!=="flow-collection")&&A.source.includes("\t"))Q=A;X=!0;break;case"comment":{if(!X)z(A,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let a=A.source.substring(1)||" ";if(!I)I=a;else I+=N+a;N="",G=!1;break}case"newline":if(G){if(I)I+=A.source;else if(!M||U!=="seq-item-ind")_=!0}else N+=A.source;if(G=!0,W=!0,H||Z)u=A;X=!0;break;case"anchor":if(H)z(A,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(A.source.endsWith(":"))z(A.offset+A.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);H=A,S??(S=A.offset),G=!1,X=!1,P=!0;break;case"tag":{if(Z)z(A,"MULTIPLE_TAGS","A node can have at most one tag");Z=A,S??(S=A.offset),G=!1,X=!1,P=!0;break}case U:if(H||Z)z(A,"BAD_PROP_ORDER",`Anchors and tags must be after the ${A.source} indicator`);if(M)z(A,"UNEXPECTED_TOKEN",`Unexpected ${A.source} in ${w??"collection"}`);M=A,G=U==="seq-item-ind"||U==="explicit-key-ind",X=!1;break;case"comma":if(w){if(b)z(A,"UNEXPECTED_TOKEN",`Unexpected , in ${w}`);b=A,G=!1,X=!1;break}default:z(A,"UNEXPECTED_TOKEN",`Unexpected ${A.type} token`),G=!1,X=!1}}let k=$[$.length-1],x=k?k.offset+k.source.length:J;if(P&&v&&v.type!=="space"&&v.type!=="newline"&&v.type!=="comma"&&(v.type!=="scalar"||v.source!==""))z(v.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(Q&&(G&&Q.indent<=g||v?.type==="block-map"||v?.type==="block-seq"))z(Q,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:b,found:M,spaceBefore:_,comment:I,hasNewline:W,anchor:H,tag:Z,newlineAfterProp:u,end:x,start:S??x}}jZ.resolveProps=CZ});var pz=E((rZ)=>{function lN($){if(!$)return null;switch($.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if($.source.includes(`
|
|
90
|
+
`))return!0;if($.end){for(let w of $.end)if(w.type==="newline")return!0}return!1;case"flow-collection":for(let w of $.items){for(let U of w.start)if(U.type==="newline")return!0;if(w.sep){for(let U of w.sep)if(U.type==="newline")return!0}if(lN(w.key)||lN(w.value))return!0}return!1;default:return!0}}rZ.containsNewline=lN});var tN=E((nZ)=>{var dZ=pz();function mZ($,w,U){if(w?.type==="flow-collection"){let v=w.end[0];if(v.indent===$&&(v.source==="]"||v.source==="}")&&dZ.containsNewline(w))U(v,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}nZ.flowIndentCheck=mZ});var oN=E((lZ)=>{var G5=t();function cZ($,w,U){let{uniqueKeys:v}=$.options;if(v===!1)return!1;let J=typeof v==="function"?v:(z,g)=>z===g||G5.isScalar(z)&&G5.isScalar(g)&&z.value===g.value;return w.some((z)=>J(z.key,U))}lZ.mapIncludes=cZ});var W5=E((sZ)=>{var _5=s4(),oZ=w6(),X5=hJ(),pZ=pz(),I5=tN(),aZ=oN(),N5="All mapping items must start at the same column";function eZ({composeNode:$,composeEmptyNode:w},U,v,J,z){let V=new(z?.nodeClass??oZ.YAMLMap)(U.schema);if(U.atRoot)U.atRoot=!1;let _=v.offset,G=null;for(let X of v.items){let{start:I,key:N,sep:W,value:P}=X,Q=X5.resolveProps(I,{indicator:"explicit-key-ind",next:N??W?.[0],offset:_,onError:J,parentIndent:v.indent,startOnNewline:!0}),H=!Q.found;if(H){if(N){if(N.type==="block-seq")J(_,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in N&&N.indent!==v.indent)J(_,"BAD_INDENT",N5)}if(!Q.anchor&&!Q.tag&&!W){if(G=Q.end,Q.comment)if(V.comment)V.comment+=`
|
|
91
|
+
`+Q.comment;else V.comment=Q.comment;continue}if(Q.newlineAfterProp||pZ.containsNewline(N))J(N??I[I.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(Q.found?.indent!==v.indent)J(_,"BAD_INDENT",N5);U.atKey=!0;let Z=Q.end,u=N?$(U,N,Q,J):w(U,Z,I,null,Q,J);if(U.schema.compat)I5.flowIndentCheck(v.indent,N,J);if(U.atKey=!1,aZ.mapIncludes(U,V.items,u))J(Z,"DUPLICATE_KEY","Map keys must be unique");let b=X5.resolveProps(W??[],{indicator:"map-value-ind",next:P,offset:u.range[2],onError:J,parentIndent:v.indent,startOnNewline:!N||N.type==="block-scalar"});if(_=b.end,b.found){if(H){if(P?.type==="block-map"&&!b.hasNewline)J(_,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(U.options.strict&&Q.start<b.found.offset-1024)J(u.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let M=P?$(U,P,b,J):w(U,_,W,null,b,J);if(U.schema.compat)I5.flowIndentCheck(v.indent,P,J);_=M.range[2];let S=new _5.Pair(u,M);if(U.options.keepSourceTokens)S.srcToken=X;V.items.push(S)}else{if(H)J(u.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(b.comment)if(u.comment)u.comment+=`
|
|
92
|
+
`+b.comment;else u.comment=b.comment;let M=new _5.Pair(u);if(U.options.keepSourceTokens)M.srcToken=X;V.items.push(M)}}if(G&&G<_)J(G,"IMPOSSIBLE","Map comment with trailing content");return V.range=[v.offset,_,G??_],V}sZ.resolveBlockMap=eZ});var Y5=E((zb)=>{var wb=U6(),Ub=hJ(),Jb=tN();function vb({composeNode:$,composeEmptyNode:w},U,v,J,z){let V=new(z?.nodeClass??wb.YAMLSeq)(U.schema);if(U.atRoot)U.atRoot=!1;if(U.atKey)U.atKey=!1;let _=v.offset,G=null;for(let{start:X,value:I}of v.items){let N=Ub.resolveProps(X,{indicator:"seq-item-ind",next:I,offset:_,onError:J,parentIndent:v.indent,startOnNewline:!0});if(!N.found)if(N.anchor||N.tag||I)if(I?.type==="block-seq")J(N.end,"BAD_INDENT","All sequence items must start at the same column");else J(_,"MISSING_CHAR","Sequence item without - indicator");else{if(G=N.end,N.comment)V.comment=N.comment;continue}let W=I?$(U,I,N,J):w(U,N.end,X,null,N,J);if(U.schema.compat)Jb.flowIndentCheck(v.indent,I,J);_=W.range[2],V.items.push(W)}return V.range=[v.offset,_,G??_],V}zb.resolveBlockSeq=vb});var WU=E((Gb)=>{function Vb($,w,U,v){let J="";if($){let z=!1,g="";for(let V of $){let{source:_,type:G}=V;switch(G){case"space":z=!0;break;case"comment":{if(U&&!z)v(V,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let X=_.substring(1)||" ";if(!J)J=X;else J+=g+X;g="";break}case"newline":if(J)g+=_;z=!0;break;default:v(V,"UNEXPECTED_TOKEN",`Unexpected ${G} at node end`)}w+=_.length}}return{comment:J,offset:w}}Gb.resolveEnd=Vb});var O5=E((Ob)=>{var Xb=t(),Ib=s4(),Q5=w6(),Nb=U6(),Wb=WU(),P5=hJ(),Yb=pz(),Qb=oN(),pN="Block collections are not allowed within flow collections",aN=($)=>$&&($.type==="block-map"||$.type==="block-seq");function Pb({composeNode:$,composeEmptyNode:w},U,v,J,z){let g=v.start.source==="{",V=g?"flow map":"flow sequence",G=new(z?.nodeClass??(g?Q5.YAMLMap:Nb.YAMLSeq))(U.schema);G.flow=!0;let X=U.atRoot;if(X)U.atRoot=!1;if(U.atKey)U.atKey=!1;let I=v.offset+v.start.source.length;for(let H=0;H<v.items.length;++H){let Z=v.items[H],{start:u,key:b,sep:M,value:S}=Z,k=P5.resolveProps(u,{flow:V,indicator:"explicit-key-ind",next:b??M?.[0],offset:I,onError:J,parentIndent:v.indent,startOnNewline:!1});if(!k.found){if(!k.anchor&&!k.tag&&!M&&!S){if(H===0&&k.comma)J(k.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${V}`);else if(H<v.items.length-1)J(k.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${V}`);if(k.comment)if(G.comment)G.comment+=`
|
|
93
|
+
`+k.comment;else G.comment=k.comment;I=k.end;continue}if(!g&&U.options.strict&&Yb.containsNewline(b))J(b,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(H===0){if(k.comma)J(k.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${V}`)}else{if(!k.comma)J(k.start,"MISSING_CHAR",`Missing , between ${V} items`);if(k.comment){let x="";$:for(let A of u)switch(A.type){case"comma":case"space":break;case"comment":x=A.source.substring(1);break $;default:break $}if(x){let A=G.items[G.items.length-1];if(Xb.isPair(A))A=A.value??A.key;if(A.comment)A.comment+=`
|
|
94
|
+
`+x;else A.comment=x;k.comment=k.comment.substring(x.length+1)}}}if(!g&&!M&&!k.found){let x=S?$(U,S,k,J):w(U,k.end,M,null,k,J);if(G.items.push(x),I=x.range[2],aN(S))J(x.range,"BLOCK_IN_FLOW",pN)}else{U.atKey=!0;let x=k.end,A=b?$(U,b,k,J):w(U,x,u,null,k,J);if(aN(b))J(A.range,"BLOCK_IN_FLOW",pN);U.atKey=!1;let a=P5.resolveProps(M??[],{flow:V,indicator:"map-value-ind",next:S,offset:A.range[2],onError:J,parentIndent:v.indent,startOnNewline:!1});if(a.found){if(!g&&!k.found&&U.options.strict){if(M)for(let z$ of M){if(z$===a.found)break;if(z$.type==="newline"){J(z$,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(k.start<a.found.offset-1024)J(a.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(S)if("source"in S&&S.source?.[0]===":")J(S,"MISSING_CHAR",`Missing space after : in ${V}`);else J(a.start,"MISSING_CHAR",`Missing , or : between ${V} items`);let h=S?$(U,S,a,J):a.found?w(U,a.end,M,null,a,J):null;if(h){if(aN(S))J(h.range,"BLOCK_IN_FLOW",pN)}else if(a.comment)if(A.comment)A.comment+=`
|
|
95
|
+
`+a.comment;else A.comment=a.comment;let K$=new Ib.Pair(A,h);if(U.options.keepSourceTokens)K$.srcToken=Z;if(g){let z$=G;if(Qb.mapIncludes(U,z$.items,A))J(x,"DUPLICATE_KEY","Map keys must be unique");z$.items.push(K$)}else{let z$=new Q5.YAMLMap(U.schema);z$.flow=!0,z$.items.push(K$);let c6=(h??A).range;z$.range=[A.range[0],c6[1],c6[2]],G.items.push(z$)}I=h?h.range[2]:a.end}}let N=g?"}":"]",[W,...P]=v.end,Q=I;if(W?.source===N)Q=W.offset+W.source.length;else{let H=V[0].toUpperCase()+V.substring(1),Z=X?`${H} must end with a ${N}`:`${H} in block collection must be sufficiently indented and end with a ${N}`;if(J(I,X?"MISSING_CHAR":"BAD_INDENT",Z),W&&W.source.length!==1)P.unshift(W)}if(P.length>0){let H=Wb.resolveEnd(P,Q,U.options.strict,J);if(H.comment)if(G.comment)G.comment+=`
|
|
96
|
+
`+H.comment;else G.comment=H.comment;G.range=[v.offset,Q,H.offset]}else G.range=[v.offset,Q,Q];return G}Ob.resolveFlowCollection=Pb});var B5=E((Zb)=>{var qb=t(),Lb=G$(),Hb=w6(),ub=U6(),Kb=W5(),Db=Y5(),fb=O5();function eN($,w,U,v,J,z){let g=U.type==="block-map"?Kb.resolveBlockMap($,w,U,v,z):U.type==="block-seq"?Db.resolveBlockSeq($,w,U,v,z):fb.resolveFlowCollection($,w,U,v,z),V=g.constructor;if(J==="!"||J===V.tagName)return g.tag=V.tagName,g;if(J)g.tag=J;return g}function Tb($,w,U,v,J){let z=v.tag,g=!z?null:w.directives.tagName(z.source,(N)=>J(z,"TAG_RESOLVE_FAILED",N));if(U.type==="block-seq"){let{anchor:N,newlineAfterProp:W}=v,P=N&&z?N.offset>z.offset?N:z:N??z;if(P&&(!W||W.offset<P.offset))J(P,"MISSING_CHAR","Missing newline after block sequence props")}let V=U.type==="block-map"?"map":U.type==="block-seq"?"seq":U.start.source==="{"?"map":"seq";if(!z||!g||g==="!"||g===Hb.YAMLMap.tagName&&V==="map"||g===ub.YAMLSeq.tagName&&V==="seq")return eN($,w,U,J,g);let _=w.schema.tags.find((N)=>N.tag===g&&N.collection===V);if(!_){let N=w.schema.knownTags[g];if(N?.collection===V)w.schema.tags.push(Object.assign({},N,{default:!1})),_=N;else{if(N)J(z,"BAD_COLLECTION_TYPE",`${N.tag} used for ${V} collection, but expects ${N.collection??"scalar"}`,!0);else J(z,"TAG_RESOLVE_FAILED",`Unresolved tag: ${g}`,!0);return eN($,w,U,J,g)}}let G=eN($,w,U,J,g,_),X=_.resolve?.(G,(N)=>J(z,"TAG_RESOLVE_FAILED",N),w.options)??G,I=qb.isNode(X)?X:new Lb.Scalar(X);if(I.range=G.range,I.tag=g,_?.format)I.format=_.format;return I}Zb.composeCollection=Tb});var $8=E((Eb)=>{var sN=G$();function Fb($,w,U){let v=w.offset,J=Mb(w,$.options.strict,U);if(!J)return{value:"",type:null,comment:"",range:[v,v,v]};let z=J.mode===">"?sN.Scalar.BLOCK_FOLDED:sN.Scalar.BLOCK_LITERAL,g=w.source?ib(w.source):[],V=g.length;for(let Q=g.length-1;Q>=0;--Q){let H=g[Q][1];if(H===""||H==="\r")V=Q;else break}if(V===0){let Q=J.chomp==="+"&&g.length>0?`
|
|
97
|
+
`.repeat(Math.max(1,g.length-1)):"",H=v+J.length;if(w.source)H+=w.source.length;return{value:Q,type:z,comment:J.comment,range:[v,H,H]}}let _=w.indent+J.indent,G=w.offset+J.length,X=0;for(let Q=0;Q<V;++Q){let[H,Z]=g[Q];if(Z===""||Z==="\r"){if(J.indent===0&&H.length>_)_=H.length}else{if(H.length<_)U(G+H.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(J.indent===0)_=H.length;if(X=Q,_===0&&!$.atRoot)U(G,"BAD_INDENT","Block scalar values in collections must be indented");break}G+=H.length+Z.length+1}for(let Q=g.length-1;Q>=V;--Q)if(g[Q][0].length>_)V=Q+1;let I="",N="",W=!1;for(let Q=0;Q<X;++Q)I+=g[Q][0].slice(_)+`
|
|
98
|
+
`;for(let Q=X;Q<V;++Q){let[H,Z]=g[Q];G+=H.length+Z.length+1;let u=Z[Z.length-1]==="\r";if(u)Z=Z.slice(0,-1);if(Z&&H.length<_){let M=`Block scalar lines must not be less indented than their ${J.indent?"explicit indentation indicator":"first line"}`;U(G-Z.length-(u?2:1),"BAD_INDENT",M),H=""}if(z===sN.Scalar.BLOCK_LITERAL)I+=N+H.slice(_)+Z,N=`
|
|
99
|
+
`;else if(H.length>_||Z[0]==="\t"){if(N===" ")N=`
|
|
100
|
+
`;else if(!W&&N===`
|
|
101
|
+
`)N=`
|
|
102
102
|
|
|
103
|
-
`;
|
|
104
|
-
`,
|
|
105
|
-
`)
|
|
106
|
-
`;else
|
|
107
|
-
`;else
|
|
108
|
-
`+
|
|
109
|
-
`)
|
|
110
|
-
`;break;default:
|
|
111
|
-
`}let
|
|
112
|
-
`,"sy"),
|
|
113
|
-
`,"sy")}catch{
|
|
114
|
-
`)z
|
|
115
|
-
`;else z
|
|
116
|
-
`)continue;if(
|
|
117
|
-
`){let{fold:
|
|
118
|
-
`){
|
|
119
|
-
`){
|
|
120
|
-
`&&!(
|
|
121
|
-
`))
|
|
122
|
-
`||
|
|
123
|
-
`)break;if(
|
|
124
|
-
`)
|
|
125
|
-
`;
|
|
126
|
-
`,r:"\r",t:"\t",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function
|
|
103
|
+
`;I+=N+H.slice(_)+Z,N=`
|
|
104
|
+
`,W=!0}else if(Z==="")if(N===`
|
|
105
|
+
`)I+=`
|
|
106
|
+
`;else N=`
|
|
107
|
+
`;else I+=N+Z,N=" ",W=!1}switch(J.chomp){case"-":break;case"+":for(let Q=V;Q<g.length;++Q)I+=`
|
|
108
|
+
`+g[Q][0].slice(_);if(I[I.length-1]!==`
|
|
109
|
+
`)I+=`
|
|
110
|
+
`;break;default:I+=`
|
|
111
|
+
`}let P=v+J.length+w.source.length;return{value:I,type:z,comment:J.comment,range:[v,P,P]}}function Mb({offset:$,props:w},U,v){if(w[0].type!=="block-scalar-header")return v(w[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:J}=w[0],z=J[0],g=0,V="",_=-1;for(let N=1;N<J.length;++N){let W=J[N];if(!V&&(W==="-"||W==="+"))V=W;else{let P=Number(W);if(!g&&P)g=P;else if(_===-1)_=$+N}}if(_!==-1)v(_,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${J}`);let G=!1,X="",I=J.length;for(let N=1;N<w.length;++N){let W=w[N];switch(W.type){case"space":G=!0;case"newline":I+=W.source.length;break;case"comment":if(U&&!G)v(W,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");I+=W.source.length,X=W.source.substring(1);break;case"error":v(W,"UNEXPECTED_TOKEN",W.message),I+=W.source.length;break;default:{let P=`Unexpected token in block scalar header: ${W.type}`;v(W,"UNEXPECTED_TOKEN",P);let Q=W.source;if(Q&&typeof Q==="string")I+=Q.length}}}return{mode:z,indent:g,chomp:V,comment:X,length:I}}function ib($){let w=$.split(/\n( *)/),U=w[0],v=U.match(/^( *)/),z=[v?.[1]?[v[1],U.slice(v[1].length)]:["",U]];for(let g=1;g<w.length;g+=2)z.push([w[g],w[g+1]]);return z}Eb.resolveBlockScalar=Fb});var U8=E((db)=>{var w8=G$(),Ab=WU();function Rb($,w,U){let{offset:v,type:J,source:z,end:g}=$,V,_,G=(N,W,P)=>U(v+N,W,P);switch(J){case"scalar":V=w8.Scalar.PLAIN,_=kb(z,G);break;case"single-quoted-scalar":V=w8.Scalar.QUOTE_SINGLE,_=Cb(z,G);break;case"double-quoted-scalar":V=w8.Scalar.QUOTE_DOUBLE,_=jb(z,G);break;default:return U($,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${J}`),{value:"",type:null,comment:"",range:[v,v+z.length,v+z.length]}}let X=v+z.length,I=Ab.resolveEnd(g,X,w,U);return{value:_,type:V,comment:I.comment,range:[v,X,I.offset]}}function kb($,w){let U="";switch($[0]){case"\t":U="a tab character";break;case",":U="flow indicator character ,";break;case"%":U="directive indicator character %";break;case"|":case">":{U=`block scalar indicator ${$[0]}`;break}case"@":case"`":{U=`reserved character ${$[0]}`;break}}if(U)w(0,"BAD_SCALAR_START",`Plain value cannot start with ${U}`);return q5($)}function Cb($,w){if($[$.length-1]!=="'"||$.length===1)w($.length,"MISSING_CHAR","Missing closing 'quote");return q5($.slice(1,-1)).replace(/''/g,"'")}function q5($){let w,U;try{w=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
112
|
+
`,"sy"),U=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
113
|
+
`,"sy")}catch{w=/(.*?)[ \t]*\r?\n/sy,U=/[ \t]*(.*?)[ \t]*\r?\n/sy}let v=w.exec($);if(!v)return $;let J=v[1],z=" ",g=w.lastIndex;U.lastIndex=g;while(v=U.exec($)){if(v[1]==="")if(z===`
|
|
114
|
+
`)J+=z;else z=`
|
|
115
|
+
`;else J+=z+v[1],z=" ";g=U.lastIndex}let V=/[ \t]*(.*)/sy;return V.lastIndex=g,v=V.exec($),J+z+(v?.[1]??"")}function jb($,w){let U="";for(let v=1;v<$.length-1;++v){let J=$[v];if(J==="\r"&&$[v+1]===`
|
|
116
|
+
`)continue;if(J===`
|
|
117
|
+
`){let{fold:z,offset:g}=xb($,v);U+=z,v=g}else if(J==="\\"){let z=$[++v],g=rb[z];if(g)U+=g;else if(z===`
|
|
118
|
+
`){z=$[v+1];while(z===" "||z==="\t")z=$[++v+1]}else if(z==="\r"&&$[v+1]===`
|
|
119
|
+
`){z=$[++v+1];while(z===" "||z==="\t")z=$[++v+1]}else if(z==="x"||z==="u"||z==="U"){let V=z==="x"?2:z==="u"?4:8;U+=yb($,v+1,V,w),v+=V}else{let V=$.substr(v-1,2);w(v-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${V}`),U+=V}}else if(J===" "||J==="\t"){let z=v,g=$[v+1];while(g===" "||g==="\t")g=$[++v+1];if(g!==`
|
|
120
|
+
`&&!(g==="\r"&&$[v+2]===`
|
|
121
|
+
`))U+=v>z?$.slice(z,v+1):J}else U+=J}if($[$.length-1]!=='"'||$.length===1)w($.length,"MISSING_CHAR",'Missing closing "quote');return U}function xb($,w){let U="",v=$[w+1];while(v===" "||v==="\t"||v===`
|
|
122
|
+
`||v==="\r"){if(v==="\r"&&$[w+2]!==`
|
|
123
|
+
`)break;if(v===`
|
|
124
|
+
`)U+=`
|
|
125
|
+
`;w+=1,v=$[w+1]}if(!U)U=" ";return{fold:U,offset:w}}var rb={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
126
|
+
`,r:"\r",t:"\t",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function yb($,w,U,v){let J=$.substr(w,U),g=J.length===U&&/^[0-9a-fA-F]+$/.test(J)?parseInt(J,16):NaN;try{return String.fromCodePoint(g)}catch{let V=$.substr(w-2,U+2);return v(w-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${V}`),V}}db.resolveFlowScalar=Rb});var H5=E((ob)=>{var d6=t(),L5=G$(),nb=$8(),hb=U8();function cb($,w,U,v){let{value:J,type:z,comment:g,range:V}=w.type==="block-scalar"?nb.resolveBlockScalar($,w,v):hb.resolveFlowScalar(w,$.options.strict,v),_=U?$.directives.tagName(U.source,(I)=>v(U,"TAG_RESOLVE_FAILED",I)):null,G;if($.options.stringKeys&&$.atKey)G=$.schema[d6.SCALAR];else if(_)G=lb($.schema,J,_,U,v);else if(w.type==="scalar")G=tb($,J,w,v);else G=$.schema[d6.SCALAR];let X;try{let I=G.resolve(J,(N)=>v(U??w,"TAG_RESOLVE_FAILED",N),$.options);X=d6.isScalar(I)?I:new L5.Scalar(I)}catch(I){let N=I instanceof Error?I.message:String(I);v(U??w,"TAG_RESOLVE_FAILED",N),X=new L5.Scalar(J)}if(X.range=V,X.source=J,z)X.type=z;if(_)X.tag=_;if(G.format)X.format=G.format;if(g)X.comment=g;return X}function lb($,w,U,v,J){if(U==="!")return $[d6.SCALAR];let z=[];for(let V of $.tags)if(!V.collection&&V.tag===U)if(V.default&&V.test)z.push(V);else return V;for(let V of z)if(V.test?.test(w))return V;let g=$.knownTags[U];if(g&&!g.collection)return $.tags.push(Object.assign({},g,{default:!1,test:void 0})),g;return J(v,"TAG_RESOLVE_FAILED",`Unresolved tag: ${U}`,U!=="tag:yaml.org,2002:str"),$[d6.SCALAR]}function tb({atKey:$,directives:w,schema:U},v,J,z){let g=U.tags.find((V)=>(V.default===!0||$&&V.default==="key")&&V.test?.test(v))||U[d6.SCALAR];if(U.compat){let V=U.compat.find((_)=>_.default&&_.test?.test(v))??U[d6.SCALAR];if(g.tag!==V.tag){let _=w.tagString(g.tag),G=w.tagString(V.tag),X=`Value may be parsed as either ${_} or ${G}`;z(J,"TAG_RESOLVE_FAILED",X,!0)}}return g}ob.composeScalar=cb});var u5=E((eb)=>{function ab($,w,U){if(w){U??(U=w.length);for(let v=U-1;v>=0;--v){let J=w[v];switch(J.type){case"space":case"comment":case"newline":$-=J.source.length;continue}J=w[++v];while(J?.type==="space")$+=J.source.length,J=w[++v];break}}return $}eb.emptyScalarPosition=ab});var f5=E((VF)=>{var $F=FJ(),wF=t(),UF=B5(),K5=H5(),JF=WU(),vF=u5(),zF={composeNode:D5,composeEmptyNode:J8};function D5($,w,U,v){let J=$.atKey,{spaceBefore:z,comment:g,anchor:V,tag:_}=U,G,X=!0;switch(w.type){case"alias":if(G=gF($,w,v),V||_)v(w,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(G=K5.composeScalar($,w,_,v),V)G.anchor=V.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":try{if(G=UF.composeCollection(zF,$,w,U,v),V)G.anchor=V.source.substring(1)}catch(I){let N=I instanceof Error?I.message:String(I);v(w,"RESOURCE_EXHAUSTION",N)}break;default:{let I=w.type==="error"?w.message:`Unsupported token (type: ${w.type})`;v(w,"UNEXPECTED_TOKEN",I),X=!1}}if(G??(G=J8($,w.offset,void 0,null,U,v)),V&&G.anchor==="")v(V,"BAD_ALIAS","Anchor cannot be an empty string");if(J&&$.options.stringKeys&&(!wF.isScalar(G)||typeof G.value!=="string"||G.tag&&G.tag!=="tag:yaml.org,2002:str"))v(_??w,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(z)G.spaceBefore=!0;if(g)if(w.type==="scalar"&&w.source==="")G.comment=g;else G.commentBefore=g;if($.options.keepSourceTokens&&X)G.srcToken=w;return G}function J8($,w,U,v,{spaceBefore:J,comment:z,anchor:g,tag:V,end:_},G){let X={type:"scalar",offset:vF.emptyScalarPosition(w,U,v),indent:-1,source:""},I=K5.composeScalar($,X,V,G);if(g){if(I.anchor=g.source.substring(1),I.anchor==="")G(g,"BAD_ALIAS","Anchor cannot be an empty string")}if(J)I.spaceBefore=!0;if(z)I.comment=z,I.range[2]=_;return I}function gF({options:$},{offset:w,source:U,end:v},J){let z=new $F.Alias(U.substring(1));if(z.source==="")J(w,"BAD_ALIAS","Alias cannot be an empty string");if(z.source.endsWith(":"))J(w+U.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let g=w+U.length,V=JF.resolveEnd(v,g,$.strict,J);if(z.range=[w,g,V.offset],V.comment)z.comment=V.comment;return z}VF.composeEmptyNode=J8;VF.composeNode=D5});var Z5=E((YF)=>{var XF=mJ(),T5=f5(),IF=WU(),NF=hJ();function WF($,w,{offset:U,start:v,value:J,end:z},g){let V=Object.assign({_directives:w},$),_=new XF.Document(void 0,V),G={atKey:!1,atRoot:!0,directives:_.directives,options:_.options,schema:_.schema},X=NF.resolveProps(v,{indicator:"doc-start",next:J??z?.[0],offset:U,onError:g,parentIndent:0,startOnNewline:!0});if(X.found){if(_.directives.docStart=!0,J&&(J.type==="block-map"||J.type==="block-seq")&&!X.hasNewline)g(X.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}_.contents=J?T5.composeNode(G,J,X,g):T5.composeEmptyNode(G,X.end,v,null,X,g);let I=_.contents.range[2],N=IF.resolveEnd(z,I,!1,g);if(N.comment)_.comment=N.comment;return _.range=[U,I,N.offset],_}YF.composeDoc=WF});var v8=E((HF)=>{var PF=Q4("process"),OF=GN(),BF=mJ(),cJ=nJ(),b5=t(),qF=Z5(),LF=WU();function lJ($){if(typeof $==="number")return[$,$+1];if(Array.isArray($))return $.length===2?$:[$[0],$[1]];let{offset:w,source:U}=$;return[w,w+(typeof U==="string"?U.length:1)]}function F5($){let w="",U=!1,v=!1;for(let J=0;J<$.length;++J){let z=$[J];switch(z[0]){case"#":w+=(w===""?"":v?`
|
|
127
127
|
|
|
128
128
|
`:`
|
|
129
|
-
`)+(
|
|
130
|
-
${
|
|
131
|
-
${
|
|
132
|
-
${
|
|
133
|
-
${
|
|
134
|
-
`}];switch(
|
|
135
|
-
`),
|
|
136
|
-
`,
|
|
137
|
-
`});return{type:"block-scalar",offset:
|
|
138
|
-
`),
|
|
139
|
-
`;if($.type==="block-scalar"){let
|
|
140
|
-
`});for(let
|
|
141
|
-
`};delete $.items,Object.assign($,{type:
|
|
129
|
+
`)+(z.substring(1)||" "),U=!0,v=!1;break;case"%":if($[J+1]?.[0]!=="#")J+=1;U=!1;break;default:if(!U)v=!0;U=!1}}return{comment:w,afterEmptyLine:v}}class M5{constructor($={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(w,U,v,J)=>{let z=lJ(w);if(J)this.warnings.push(new cJ.YAMLWarning(z,U,v));else this.errors.push(new cJ.YAMLParseError(z,U,v))},this.directives=new OF.Directives({version:$.version||"1.2"}),this.options=$}decorate($,w){let{comment:U,afterEmptyLine:v}=F5(this.prelude);if(U){let J=$.contents;if(w)$.comment=$.comment?`${$.comment}
|
|
130
|
+
${U}`:U;else if(v||$.directives.docStart||!J)$.commentBefore=U;else if(b5.isCollection(J)&&!J.flow&&J.items.length>0){let z=J.items[0];if(b5.isPair(z))z=z.key;let g=z.commentBefore;z.commentBefore=g?`${U}
|
|
131
|
+
${g}`:U}else{let z=J.commentBefore;J.commentBefore=z?`${U}
|
|
132
|
+
${z}`:U}}if(w){for(let J=0;J<this.errors.length;++J)$.errors.push(this.errors[J]);for(let J=0;J<this.warnings.length;++J)$.warnings.push(this.warnings[J])}else $.errors=this.errors,$.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:F5(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose($,w=!1,U=-1){for(let v of $)yield*this.next(v);yield*this.end(w,U)}*next($){if(PF.env.LOG_STREAM)console.dir($,{depth:null});switch($.type){case"directive":this.directives.add($.source,(w,U,v)=>{let J=lJ($);J[0]+=w,this.onError(J,"BAD_DIRECTIVE",U,v)}),this.prelude.push($.source),this.atDirectives=!0;break;case"document":{let w=qF.composeDoc(this.options,this.directives,$,this.onError);if(this.atDirectives&&!w.directives.docStart)this.onError($,"MISSING_CHAR","Missing directives-end/doc-start indicator line");if(this.decorate(w,!1),this.doc)yield this.doc;this.doc=w,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push($.source);break;case"error":{let w=$.source?`${$.message}: ${JSON.stringify($.source)}`:$.message,U=new cJ.YAMLParseError(lJ($),"UNEXPECTED_TOKEN",w);if(this.atDirectives||!this.doc)this.errors.push(U);else this.doc.errors.push(U);break}case"doc-end":{if(!this.doc){this.errors.push(new cJ.YAMLParseError(lJ($),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let w=LF.resolveEnd($.end,$.offset+$.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),w.comment){let U=this.doc.comment;this.doc.comment=U?`${U}
|
|
133
|
+
${w.comment}`:w.comment}this.doc.range[2]=w.offset;break}default:this.errors.push(new cJ.YAMLParseError(lJ($),"UNEXPECTED_TOKEN",`Unsupported token ${$.type}`))}}*end($=!1,w=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if($){let U=Object.assign({_directives:this.directives},this.options),v=new BF.Document(void 0,U);if(this.atDirectives)this.onError(w,"MISSING_CHAR","Missing directives-end indicator line");v.range=[0,w,w],this.decorate(v,!1),yield v}}}HF.Composer=M5});var S5=E((MF)=>{var KF=$8(),DF=U8(),fF=nJ(),i5=SJ();function TF($,w=!0,U){if($){let v=(J,z,g)=>{let V=typeof J==="number"?J:Array.isArray(J)?J[0]:J.offset;if(U)U(V,z,g);else throw new fF.YAMLParseError([V,V+1],z,g)};switch($.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return DF.resolveFlowScalar($,w,v);case"block-scalar":return KF.resolveBlockScalar({options:{strict:w}},$,v)}}return null}function ZF($,w){let{implicitKey:U=!1,indent:v,inFlow:J=!1,offset:z=-1,type:g="PLAIN"}=w,V=i5.stringifyString({type:g,value:$},{implicitKey:U,indent:v>0?" ".repeat(v):"",inFlow:J,options:{blockQuote:!0,lineWidth:-1}}),_=w.end??[{type:"newline",offset:-1,indent:v,source:`
|
|
134
|
+
`}];switch(V[0]){case"|":case">":{let G=V.indexOf(`
|
|
135
|
+
`),X=V.substring(0,G),I=V.substring(G+1)+`
|
|
136
|
+
`,N=[{type:"block-scalar-header",offset:z,indent:v,source:X}];if(!E5(N,_))N.push({type:"newline",offset:-1,indent:v,source:`
|
|
137
|
+
`});return{type:"block-scalar",offset:z,indent:v,props:N,source:I}}case'"':return{type:"double-quoted-scalar",offset:z,indent:v,source:V,end:_};case"'":return{type:"single-quoted-scalar",offset:z,indent:v,source:V,end:_};default:return{type:"scalar",offset:z,indent:v,source:V,end:_}}}function bF($,w,U={}){let{afterKey:v=!1,implicitKey:J=!1,inFlow:z=!1,type:g}=U,V="indent"in $?$.indent:null;if(v&&typeof V==="number")V+=2;if(!g)switch($.type){case"single-quoted-scalar":g="QUOTE_SINGLE";break;case"double-quoted-scalar":g="QUOTE_DOUBLE";break;case"block-scalar":{let G=$.props[0];if(G.type!=="block-scalar-header")throw Error("Invalid block scalar header");g=G.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:g="PLAIN"}let _=i5.stringifyString({type:g,value:w},{implicitKey:J||V===null,indent:V!==null&&V>0?" ".repeat(V):"",inFlow:z,options:{blockQuote:!0,lineWidth:-1}});switch(_[0]){case"|":case">":FF($,_);break;case'"':z8($,_,"double-quoted-scalar");break;case"'":z8($,_,"single-quoted-scalar");break;default:z8($,_,"scalar")}}function FF($,w){let U=w.indexOf(`
|
|
138
|
+
`),v=w.substring(0,U),J=w.substring(U+1)+`
|
|
139
|
+
`;if($.type==="block-scalar"){let z=$.props[0];if(z.type!=="block-scalar-header")throw Error("Invalid block scalar header");z.source=v,$.source=J}else{let{offset:z}=$,g="indent"in $?$.indent:-1,V=[{type:"block-scalar-header",offset:z,indent:g,source:v}];if(!E5(V,"end"in $?$.end:void 0))V.push({type:"newline",offset:-1,indent:g,source:`
|
|
140
|
+
`});for(let _ of Object.keys($))if(_!=="type"&&_!=="offset")delete $[_];Object.assign($,{type:"block-scalar",indent:g,props:V,source:J})}}function E5($,w){if(w)for(let U of w)switch(U.type){case"space":case"comment":$.push(U);break;case"newline":return $.push(U),!0}return!1}function z8($,w,U){switch($.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":$.type=U,$.source=w;break;case"block-scalar":{let v=$.props.slice(1),J=w.length;if($.props[0].type==="block-scalar-header")J-=$.props[0].source.length;for(let z of v)z.offset+=J;delete $.props,Object.assign($,{type:U,source:w,end:v});break}case"block-map":case"block-seq":{let J={type:"newline",offset:$.offset+w.length,indent:$.indent,source:`
|
|
141
|
+
`};delete $.items,Object.assign($,{type:U,source:w,end:[J]});break}default:{let v="indent"in $?$.indent:-1,J="end"in $&&Array.isArray($.end)?$.end.filter((z)=>z.type==="space"||z.type==="comment"||z.type==="newline"):[];for(let z of Object.keys($))if(z!=="type"&&z!=="offset")delete $[z];Object.assign($,{type:U,indent:v,source:w,end:J})}}}MF.createScalarToken=ZF;MF.resolveAsScalar=TF;MF.setScalarValue=bF});var A5=E((RF)=>{var AF=($)=>("type"in $)?ez($):az($);function ez($){switch($.type){case"block-scalar":{let w="";for(let U of $.props)w+=ez(U);return w+$.source}case"block-map":case"block-seq":{let w="";for(let U of $.items)w+=az(U);return w}case"flow-collection":{let w=$.start.source;for(let U of $.items)w+=az(U);for(let U of $.end)w+=U.source;return w}case"document":{let w=az($);if($.end)for(let U of $.end)w+=U.source;return w}default:{let w=$.source;if("end"in $&&$.end)for(let U of $.end)w+=U.source;return w}}}function az({start:$,key:w,sep:U,value:v}){let J="";for(let z of $)J+=z.source;if(w)J+=ez(w);if(U)for(let z of U)J+=z.source;if(v)J+=ez(v);return J}RF.stringify=AF});var C5=E((jF)=>{var g8=Symbol("break visit"),CF=Symbol("skip children"),R5=Symbol("remove item");function m6($,w){if("type"in $&&$.type==="document")$={start:$.start,value:$.value};k5(Object.freeze([]),$,w)}m6.BREAK=g8;m6.SKIP=CF;m6.REMOVE=R5;m6.itemAtPath=($,w)=>{let U=$;for(let[v,J]of w){let z=U?.[v];if(z&&"items"in z)U=z.items[J];else return}return U};m6.parentCollection=($,w)=>{let U=m6.itemAtPath($,w.slice(0,-1)),v=w[w.length-1][0],J=U?.[v];if(J&&"items"in J)return J;throw Error("Parent collection not found")};function k5($,w,U){let v=U(w,$);if(typeof v==="symbol")return v;for(let J of["key","value"]){let z=w[J];if(z&&"items"in z){for(let g=0;g<z.items.length;++g){let V=k5(Object.freeze($.concat([[J,g]])),z.items[g],U);if(typeof V==="number")g=V-1;else if(V===g8)return g8;else if(V===R5)z.items.splice(g,1),g-=1}if(typeof v==="function"&&J==="key")v=v(w,$)}}return typeof v==="function"?v(w,$):v}jF.visit=m6});var sz=E((cF)=>{var V8=S5(),rF=A5(),yF=C5(),G8="\uFEFF",_8="\x02",X8="\x18",I8="\x1F",dF=($)=>!!$&&("items"in $),mF=($)=>!!$&&($.type==="scalar"||$.type==="single-quoted-scalar"||$.type==="double-quoted-scalar"||$.type==="block-scalar");function nF($){switch($){case G8:return"<BOM>";case _8:return"<DOC>";case X8:return"<FLOW_END>";case I8:return"<SCALAR>";default:return JSON.stringify($)}}function hF($){switch($){case G8:return"byte-order-mark";case _8:return"doc-mode";case X8:return"flow-error-end";case I8:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
142
142
|
`:case`\r
|
|
143
|
-
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch($[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}
|
|
144
|
-
`:case"\r":case"\t":return!0;default:return!1}}var
|
|
145
|
-
\r `),
|
|
146
|
-
`)return!0;if(
|
|
147
|
-
`;return!1}charAt($){return this.buffer[this.pos+$]}continueScalar($){let
|
|
148
|
-
`||!
|
|
149
|
-
`||
|
|
150
|
-
`,this.pos),this.lineEndPos=$;if($===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[$-1]==="\r")$-=1;return this.buffer.substring(this.pos,$)}hasChars($){return this.pos+$<=this.buffer.length}setNext($){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=$,null}peek($){return this.buffer.substr(this.pos,$)}*parseNext($){switch($){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let $=this.getLine();if($===null)return this.setNext("stream");if($[0]===
|
|
151
|
-
`,this.pos);if(
|
|
152
|
-
`,
|
|
153
|
-
`:$=
|
|
154
|
-
`)break}default:break $}if(!
|
|
155
|
-
`,
|
|
156
|
-
`)
|
|
157
|
-
`&&
|
|
158
|
-
`)
|
|
159
|
-
`,
|
|
160
|
-
`){let
|
|
143
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch($[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}cF.createScalarToken=V8.createScalarToken;cF.resolveAsScalar=V8.resolveAsScalar;cF.setScalarValue=V8.setScalarValue;cF.stringify=rF.stringify;cF.visit=yF.visit;cF.BOM=G8;cF.DOCUMENT=_8;cF.FLOW_END=X8;cF.SCALAR=I8;cF.isCollection=dF;cF.isScalar=mF;cF.prettyToken=nF;cF.tokenType=hF});var W8=E((GM)=>{var tJ=sz();function w4($){switch($){case void 0:case" ":case`
|
|
144
|
+
`:case"\r":case"\t":return!0;default:return!1}}var j5=new Set("0123456789ABCDEFabcdef"),gM=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),$2=new Set(",[]{}"),VM=new Set(` ,[]{}
|
|
145
|
+
\r `),N8=($)=>!$||VM.has($);class x5{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($,w=!1){if($){if(typeof $!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+$:$,this.lineEndPos=null}this.atEnd=!w;let U=this.next??"stream";while(U&&(w||this.hasChars(1)))U=yield*this.parseNext(U)}atLineEnd(){let $=this.pos,w=this.buffer[$];while(w===" "||w==="\t")w=this.buffer[++$];if(!w||w==="#"||w===`
|
|
146
|
+
`)return!0;if(w==="\r")return this.buffer[$+1]===`
|
|
147
|
+
`;return!1}charAt($){return this.buffer[this.pos+$]}continueScalar($){let w=this.buffer[$];if(this.indentNext>0){let U=0;while(w===" ")w=this.buffer[++U+$];if(w==="\r"){let v=this.buffer[U+$+1];if(v===`
|
|
148
|
+
`||!v&&!this.atEnd)return $+U+1}return w===`
|
|
149
|
+
`||U>=this.indentNext||!w&&!this.atEnd?$+U:-1}if(w==="-"||w==="."){let U=this.buffer.substr($,3);if((U==="---"||U==="...")&&w4(this.buffer[$+3]))return-1}return $}getLine(){let $=this.lineEndPos;if(typeof $!=="number"||$!==-1&&$<this.pos)$=this.buffer.indexOf(`
|
|
150
|
+
`,this.pos),this.lineEndPos=$;if($===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[$-1]==="\r")$-=1;return this.buffer.substring(this.pos,$)}hasChars($){return this.pos+$<=this.buffer.length}setNext($){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=$,null}peek($){return this.buffer.substr(this.pos,$)}*parseNext($){switch($){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let $=this.getLine();if($===null)return this.setNext("stream");if($[0]===tJ.BOM)yield*this.pushCount(1),$=$.substring(1);if($[0]==="%"){let w=$.length,U=$.indexOf("#");while(U!==-1){let J=$[U-1];if(J===" "||J==="\t"){w=U-1;break}else U=$.indexOf("#",U+1)}while(!0){let J=$[w-1];if(J===" "||J==="\t")w-=1;else break}let v=(yield*this.pushCount(w))+(yield*this.pushSpaces(!0));return yield*this.pushCount($.length-v),this.pushNewline(),"stream"}if(this.atLineEnd()){let w=yield*this.pushSpaces(!0);return yield*this.pushCount($.length-w),yield*this.pushNewline(),"stream"}return yield tJ.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 w=this.peek(3);if((w==="---"||w==="...")&&w4(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,w==="---"?"doc":"stream"}if(this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!w4(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){let[$,w]=this.peek(2);if(!w&&!this.atEnd)return this.setNext("block-start");if(($==="-"||$==="?"||$===":")&&w4(w)){let U=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=U,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let $=this.getLine();if($===null)return this.setNext("doc");let w=yield*this.pushIndicators();switch($[w]){case"#":yield*this.pushCount($.length-w);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(N8),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return w+=yield*this.parseBlockScalarHeader(),w+=yield*this.pushSpaces(!0),yield*this.pushCount($.length-w),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let $,w,U=-1;do{if($=yield*this.pushNewline(),$>0)w=yield*this.pushSpaces(!1),this.indentValue=U=w;else w=0;w+=yield*this.pushSpaces(!0)}while($+w>0);let v=this.getLine();if(v===null)return this.setNext("flow");if(U!==-1&&U<this.indentNext&&v[0]!=="#"||U===0&&(v.startsWith("---")||v.startsWith("..."))&&w4(v[3])){if(!(U===this.indentNext-1&&this.flowLevel===1&&(v[0]==="]"||v[0]==="}")))return this.flowLevel=0,yield tJ.FLOW_END,yield*this.parseLineStart()}let J=0;while(v[J]===",")J+=yield*this.pushCount(1),J+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(J+=yield*this.pushIndicators(),v[J]){case void 0:return"flow";case"#":return yield*this.pushCount(v.length-J),"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(N8),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let z=this.charAt(1);if(this.flowKey||w4(z)||z===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let $=this.charAt(0),w=this.buffer.indexOf($,this.pos+1);if($==="'")while(w!==-1&&this.buffer[w+1]==="'")w=this.buffer.indexOf("'",w+2);else while(w!==-1){let J=0;while(this.buffer[w-1-J]==="\\")J+=1;if(J%2===0)break;w=this.buffer.indexOf('"',w+1)}let U=this.buffer.substring(0,w),v=U.indexOf(`
|
|
151
|
+
`,this.pos);if(v!==-1){while(v!==-1){let J=this.continueScalar(v+1);if(J===-1)break;v=U.indexOf(`
|
|
152
|
+
`,J)}if(v!==-1)w=v-(U[v-1]==="\r"?2:1)}if(w===-1){if(!this.atEnd)return this.setNext("quoted-scalar");w=this.buffer.length}return yield*this.pushToIndex(w+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let $=this.pos;while(!0){let w=this.buffer[++$];if(w==="+")this.blockScalarKeep=!0;else if(w>"0"&&w<="9")this.blockScalarIndent=Number(w)-1;else if(w!=="-")break}return yield*this.pushUntil((w)=>w4(w)||w==="#")}*parseBlockScalar(){let $=this.pos-1,w=0,U;$:for(let J=this.pos;U=this.buffer[J];++J)switch(U){case" ":w+=1;break;case`
|
|
153
|
+
`:$=J,w=0;break;case"\r":{let z=this.buffer[J+1];if(!z&&!this.atEnd)return this.setNext("block-scalar");if(z===`
|
|
154
|
+
`)break}default:break $}if(!U&&!this.atEnd)return this.setNext("block-scalar");if(w>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=w;else this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let J=this.continueScalar($+1);if(J===-1)break;$=this.buffer.indexOf(`
|
|
155
|
+
`,J)}while($!==-1);if($===-1){if(!this.atEnd)return this.setNext("block-scalar");$=this.buffer.length}}let v=$+1;U=this.buffer[v];while(U===" ")U=this.buffer[++v];if(U==="\t"){while(U==="\t"||U===" "||U==="\r"||U===`
|
|
156
|
+
`)U=this.buffer[++v];$=v-1}else if(!this.blockScalarKeep)do{let J=$-1,z=this.buffer[J];if(z==="\r")z=this.buffer[--J];let g=J;while(z===" ")z=this.buffer[--J];if(z===`
|
|
157
|
+
`&&J>=this.pos&&J+1+w>g)$=J;else break}while(!0);return yield tJ.SCALAR,yield*this.pushToIndex($+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let $=this.flowLevel>0,w=this.pos-1,U=this.pos-1,v;while(v=this.buffer[++U])if(v===":"){let J=this.buffer[U+1];if(w4(J)||$&&$2.has(J))break;w=U}else if(w4(v)){let J=this.buffer[U+1];if(v==="\r")if(J===`
|
|
158
|
+
`)U+=1,v=`
|
|
159
|
+
`,J=this.buffer[U+1];else w=U;if(J==="#"||$&&$2.has(J))break;if(v===`
|
|
160
|
+
`){let z=this.continueScalar(U+1);if(z===-1)break;U=Math.max(U,z-2)}}else{if($&&$2.has(v))break;w=U}if(!v&&!this.atEnd)return this.setNext("plain-scalar");return yield tJ.SCALAR,yield*this.pushToIndex(w+1,!0),$?"flow":"doc"}*pushCount($){if($>0)return yield this.buffer.substr(this.pos,$),this.pos+=$,$;return 0}*pushToIndex($,w){let U=this.buffer.slice(this.pos,$);if(U)return yield U,this.pos+=U.length,U.length;else if(w)yield"";return 0}*pushIndicators(){let $=0;$:while(!0){switch(this.charAt(0)){case"!":$+=yield*this.pushTag(),$+=yield*this.pushSpaces(!0);continue $;case"&":$+=yield*this.pushUntil(N8),$+=yield*this.pushSpaces(!0);continue $;case"-":case"?":case":":{let w=this.flowLevel>0,U=this.charAt(1);if(w4(U)||w&&$2.has(U)){if(!w)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=!1;$+=yield*this.pushCount(1),$+=yield*this.pushSpaces(!0);continue $}}}break $}return $}*pushTag(){if(this.charAt(1)==="<"){let $=this.pos+2,w=this.buffer[$];while(!w4(w)&&w!==">")w=this.buffer[++$];return yield*this.pushToIndex(w===">"?$+1:$,!1)}else{let $=this.pos+1,w=this.buffer[$];while(w)if(gM.has(w))w=this.buffer[++$];else if(w==="%"&&j5.has(this.buffer[$+1])&&j5.has(this.buffer[$+2]))w=this.buffer[$+=3];else break;return yield*this.pushToIndex($,!1)}}*pushNewline(){let $=this.buffer[this.pos];if($===`
|
|
161
161
|
`)return yield*this.pushCount(1);else if($==="\r"&&this.charAt(1)===`
|
|
162
|
-
`)return yield*this.pushCount(2);else return 0}*pushSpaces($){let
|
|
163
|
-
`)+1;while(
|
|
164
|
-
`,
|
|
165
|
-
`)+1;while(
|
|
166
|
-
`,U)+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 U=rJ($),w=Jw(U);return w.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:w,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let U=rJ($),w=Jw(U);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:w,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment($,U){if(this.type!=="comment")return!1;if(this.indent<=U)return!1;return $.every((w)=>w.type==="newline"||w.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()}}}kb.Parser=SB});var RB=f((cb)=>{var bB=cW(),ub=R0(),y0=k0(),Cb=s3(),xb=p(),yb=sW(),EB=$Y();function AB($){let U=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||U&&new yb.LineCounter||null,prettyErrors:U}}function ib($,U={}){let{lineCounter:w,prettyErrors:J}=AB(U),z=new EB.Parser(w?.addNewLine),G=new bB.Composer(U),X=Array.from(G.compose(z.parse($)));if(J&&w)for(let _ of X)_.errors.forEach(y0.prettifyError($,w)),_.warnings.forEach(y0.prettifyError($,w));if(X.length>0)return X;return Object.assign([],{empty:!0},G.streamInfo())}function fB($,U={}){let{lineCounter:w,prettyErrors:J}=AB(U),z=new EB.Parser(w?.addNewLine),G=new bB.Composer(U),X=null;for(let _ of G.compose(z.parse($),!0,$.length))if(!X)X=_;else if(X.options.logLevel!=="silent"){X.errors.push(new y0.YAMLParseError(_.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(J&&w)X.errors.forEach(y0.prettifyError($,w)),X.warnings.forEach(y0.prettifyError($,w));return X}function hb($,U,w){let J=void 0;if(typeof U==="function")J=U;else if(w===void 0&&U&&typeof U==="object")w=U;let z=fB($,w);if(!z)return null;if(z.warnings.forEach((G)=>Cb.warn(z.options.logLevel,G)),z.errors.length>0)if(z.options.logLevel!=="silent")throw z.errors[0];else z.errors=[];return z.toJS(Object.assign({reviver:J},w))}function mb($,U,w){let J=null;if(typeof U==="function"||Array.isArray(U))J=U;else if(w===void 0&&U)w=U;if(typeof w==="string")w=w.length;if(typeof w==="number"){let z=Math.round(w);w=z<1?void 0:z>8?{indent:8}:{indent:z}}if($===void 0){let{keepUndefined:z}=w??U??{};if(!z)return}if(xb.isDocument($)&&!J)return $.toString(w);return new ub.Document($,J,w).toString(w)}cb.parse=hb;cb.parseAllDocuments=ib;cb.parseDocument=fB;cb.stringify=mb});var jY=_q(kY(),1),{program:CA,createCommand:xA,createArgument:yA,createOption:iA,CommanderError:hA,InvalidArgumentError:mA,InvalidOptionArgumentError:cA,Command:uY,Argument:rA,Option:lA,Help:dA}=jY.default;import{existsSync as z5,statSync as wK}from"node:fs";import{mkdir as zK,readFile as JK,writeFile as J5}from"node:fs/promises";import{basename as U5,dirname as GK,extname as XK,join as hG,parse as _K}from"node:path";function C($,U,w,J,z){if(J==="m")throw TypeError("Private method is not writable");if(J==="a"&&!z)throw TypeError("Private accessor was defined without a setter");if(typeof U==="function"?$!==U||!z:!U.has($))throw TypeError("Cannot write private member to an object whose class did not declare it");return J==="a"?z.call($,w):z?z.value=w:U.set($,w),w}function L($,U,w,J){if(w==="a"&&!J)throw TypeError("Private accessor was defined without a getter");if(typeof U==="function"?$!==U||!J:!U.has($))throw TypeError("Cannot read private member from an object whose class did not declare it");return w==="m"?J:w==="a"?J.call($):J?J.value:U.get($)}var GG=function(){let{crypto:$}=globalThis;if($?.randomUUID)return GG=$.randomUUID.bind($),$.randomUUID();let U=new Uint8Array(1),w=$?()=>$.getRandomValues(U)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(J)=>(+J^w()&15>>+J/4).toString(16))};function Xw($){return typeof $==="object"&&$!==null&&(("name"in $)&&$.name==="AbortError"||("message"in $)&&String($.message).includes("FetchRequestCanceledException"))}var _w=($)=>{if($ instanceof Error)return $;if(typeof $==="object"&&$!==null){try{if(Object.prototype.toString.call($)==="[object Error]"){let U=Error($.message,$.cause?{cause:$.cause}:{});if($.stack)U.stack=$.stack;if($.cause&&!U.cause)U.cause=$.cause;if($.name)U.name=$.name;return U}}catch{}try{return Error(JSON.stringify($))}catch{}}return Error($)};class A extends Error{}class z$ extends A{constructor($,U,w,J){super(`${z$.makeMessage($,U,w)}`);this.status=$,this.headers=J,this.requestID=J?.get("x-request-id"),this.error=U;let z=U;this.code=z?.code,this.param=z?.param,this.type=z?.type}static makeMessage($,U,w){let J=U?.message?typeof U.message==="string"?U.message:JSON.stringify(U.message):U?JSON.stringify(U):w;if($&&J)return`${$} ${J}`;if($)return`${$} status code (no body)`;if(J)return J;return"(no status code or body)"}static generate($,U,w,J){if(!$||!J)return new s4({message:w,cause:_w(U)});let z=U?.error;if($===400)return new Nw($,z,w,J);if($===401)return new Ww($,z,w,J);if($===403)return new Yw($,z,w,J);if($===404)return new Qw($,z,w,J);if($===409)return new Vw($,z,w,J);if($===422)return new gw($,z,w,J);if($===429)return new Bw($,z,w,J);if($>=500)return new qw($,z,w,J);return new z$($,z,w,J)}}class N$ extends z${constructor({message:$}={}){super(void 0,void 0,$||"Request was aborted.",void 0)}}class s4 extends z${constructor({message:$,cause:U}){super(void 0,void 0,$||"Connection error.",void 0);if(U)this.cause=U}}class $6 extends s4{constructor({message:$}={}){super({message:$??"Request timed out."})}}class Nw extends z${}class Ww extends z${}class Yw extends z${}class Qw extends z${}class Vw extends z${}class gw extends z${}class Bw extends z${}class qw extends z${}class Hw extends A{constructor(){super("Could not parse response content as the length limit was reached")}}class Iw extends A{constructor(){super("Could not parse response content as the request was rejected by the content filter")}}class g4 extends Error{constructor($){super($)}}class C6 extends z${constructor($,U,w){let J="OAuth2 authentication error",z=void 0;if(U&&typeof U==="object"){let G=U;z=G.error;let X=G.error_description;if(X&&typeof X==="string")J=X;else if(z)J=z}super($,U,J,w);this.error_code=z}}class m0 extends A{constructor($,U,w){super($);this.provider=U,this.cause=w}}var wH=/^[a-z][a-z0-9+.-]*:/i,CY=($)=>{return wH.test($)},H$=($)=>(H$=Array.isArray,H$($)),XG=H$;function c0($){if(typeof $!=="object")return{};return $??{}}function _G($){if(!$)return!0;for(let U in $)return!1;return!0}function xY($,U){return Object.prototype.hasOwnProperty.call($,U)}function Kw($){return $!=null&&typeof $==="object"&&!Array.isArray($)}var yY=($,U)=>{if(typeof U!=="number"||!Number.isInteger(U))throw new A(`${$} must be an integer`);if(U<0)throw new A(`${$} must be a positive integer`);return U};var iY=($)=>{try{return JSON.parse($)}catch(U){return}};var e$=($)=>new Promise((U)=>setTimeout(U,$));var v4="6.45.0";var rY=()=>{return typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u"};function zH(){if(typeof Deno<"u"&&Deno.build!=null)return"deno";if(typeof EdgeRuntime<"u")return"edge";if(Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]")return"node";return"unknown"}var JH=()=>{let $=zH();if($==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":v4,"X-Stainless-OS":mY(Deno.build.os),"X-Stainless-Arch":hY(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version==="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":v4,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if($==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":v4,"X-Stainless-OS":mY(globalThis.process.platform??"unknown"),"X-Stainless-Arch":hY(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let U=GH();if(U)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":v4,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${U.browser}`,"X-Stainless-Runtime-Version":U.version};return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":v4,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function GH(){if(typeof navigator>"u"||!navigator)return null;let $=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:U,pattern:w}of $){let J=w.exec(navigator.userAgent);if(J){let z=J[1]||0,G=J[2]||0,X=J[3]||0;return{browser:U,version:`${z}.${G}.${X}`}}}return null}var hY=($)=>{if($==="x32")return"x32";if($==="x86_64"||$==="x64")return"x64";if($==="arm")return"arm";if($==="aarch64"||$==="arm64")return"arm64";if($)return`other:${$}`;return"unknown"},mY=($)=>{if($=$.toLowerCase(),$.includes("ios"))return"iOS";if($==="android")return"Android";if($==="darwin")return"MacOS";if($==="win32")return"Windows";if($==="freebsd")return"FreeBSD";if($==="openbsd")return"OpenBSD";if($==="linux")return"Linux";if($)return`Other:${$}`;return"Unknown"},cY,lY=()=>{return cY??(cY=JH())};function r0(){if(typeof fetch<"u")return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new OpenAI({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function NG(...$){let U=globalThis.ReadableStream;if(typeof U>"u")throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new U(...$)}function l0($){let U=Symbol.asyncIterator in $?$[Symbol.asyncIterator]():$[Symbol.iterator]();return NG({start(){},async pull(w){let{done:J,value:z}=await U.next();if(J)w.close();else w.enqueue(z)},async cancel(){await U.return?.()}})}function WG($){if($[Symbol.asyncIterator])return $;let U=$.getReader();return{async next(){try{let w=await U.read();if(w?.done)U.releaseLock();return w}catch(w){throw U.releaseLock(),w}},async return(){let w=U.cancel();return U.releaseLock(),await w,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function YG($){if($===null||typeof $!=="object")return;if($[Symbol.asyncIterator]){await $[Symbol.asyncIterator]().return?.();return}let U=$.getReader(),w=U.cancel();U.releaseLock(),await w}var nY=({headers:$,body:U})=>{return{bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(U)}};var QG="RFC3986",VG=($)=>String($),gG={RFC1738:($)=>String($).replace(/%20/g,"+"),RFC3986:VG},pY="RFC1738";var d0=($,U)=>(d0=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),d0($,U)),s$=(()=>{let $=[];for(let U=0;U<256;++U)$.push("%"+((U<16?"0":"")+U.toString(16)).toUpperCase());return $})();var BG=1024,tY=($,U,w,J,z)=>{if($.length===0)return $;let G=$;if(typeof $==="symbol")G=Symbol.prototype.toString.call($);else if(typeof $!=="string")G=String($);if(w==="iso-8859-1")return escape(G).replace(/%u[0-9a-f]{4}/gi,function(_){return"%26%23"+parseInt(_.slice(2),16)+"%3B"});let X="";for(let _=0;_<G.length;_+=BG){let N=G.length>=BG?G.slice(_,_+BG):G,W=[];for(let Y=0;Y<N.length;++Y){let Q=N.charCodeAt(Y);if(Q===45||Q===46||Q===95||Q===126||Q>=48&&Q<=57||Q>=65&&Q<=90||Q>=97&&Q<=122||z===pY&&(Q===40||Q===41)){W[W.length]=N.charAt(Y);continue}if(Q<128){W[W.length]=s$[Q];continue}if(Q<2048){W[W.length]=s$[192|Q>>6]+s$[128|Q&63];continue}if(Q<55296||Q>=57344){W[W.length]=s$[224|Q>>12]+s$[128|Q>>6&63]+s$[128|Q&63];continue}Y+=1,Q=65536+((Q&1023)<<10|N.charCodeAt(Y)&1023),W[W.length]=s$[240|Q>>18]+s$[128|Q>>12&63]+s$[128|Q>>6&63]+s$[128|Q&63]}X+=W.join("")}return X};function aY($){if(!$||typeof $!=="object")return!1;return!!($.constructor&&$.constructor.isBuffer&&$.constructor.isBuffer($))}function qG($,U){if(H$($)){let w=[];for(let J=0;J<$.length;J+=1)w.push(U($[J]));return w}return U($)}var eY={brackets($){return String($)+"[]"},comma:"comma",indices($,U){return String($)+"["+U+"]"},repeat($){return String($)}},sY=function($,U){Array.prototype.push.apply($,H$(U)?U:[U])},oY,W$={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:tY,encodeValuesOnly:!1,format:QG,formatter:VG,indices:!1,serializeDate($){return(oY??(oY=Function.prototype.call.bind(Date.prototype.toISOString)))($)},skipNulls:!1,strictNullHandling:!1};function _H($){return typeof $==="string"||typeof $==="number"||typeof $==="boolean"||typeof $==="symbol"||typeof $==="bigint"}var HG={};function $Q($,U,w,J,z,G,X,_,N,W,Y,Q,V,g,H,q,O,M){let T=$,S=M,E=0,R=!1;while((S=S.get(HG))!==void 0&&!R){let l=S.get($);if(E+=1,typeof l<"u")if(l===E)throw RangeError("Cyclic object value");else R=!0;if(typeof S.get(HG)>"u")E=0}if(typeof W==="function")T=W(U,T);else if(T instanceof Date)T=V?.(T);else if(w==="comma"&&H$(T))T=qG(T,function(l){if(l instanceof Date)return V?.(l);return l});if(T===null){if(G)return N&&!q?N(U,W$.encoder,O,"key",g):U;T=""}if(_H(T)||aY(T)){if(N){let l=q?U:N(U,W$.encoder,O,"key",g);return[H?.(l)+"="+H?.(N(T,W$.encoder,O,"value",g))]}return[H?.(U)+"="+H?.(String(T))]}let u=[];if(typeof T>"u")return u;let x;if(w==="comma"&&H$(T)){if(q&&N)T=qG(T,N);x=[{value:T.length>0?T.join(",")||null:void 0}]}else if(H$(W))x=W;else{let l=Object.keys(T);x=Y?l.sort(Y):l}let k=_?String(U).replace(/\./g,"%2E"):String(U),o=J&&H$(T)&&T.length===1?k+"[]":k;if(z&&H$(T)&&T.length===0)return o+"[]";for(let l=0;l<x.length;++l){let O$=x[l],J$=typeof O$==="object"&&typeof O$.value<"u"?O$.value:T[O$];if(X&&J$===null)continue;let u6=Q&&_?O$.replace(/\./g,"%2E"):O$,sB=H$(T)?typeof w==="function"?w(o,u6):o:o+(Q?"."+u6:"["+u6+"]");M.set($,E);let KY=new WeakMap;KY.set(HG,M),sY(u,$Q(J$,sB,w,J,z,G,X,_,w==="comma"&&q&&H$(T)?null:N,W,Y,Q,V,g,H,q,O,KY))}return u}function NH($=W$){if(typeof $.allowEmptyArrays<"u"&&typeof $.allowEmptyArrays!=="boolean")throw TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof $.encodeDotInKeys<"u"&&typeof $.encodeDotInKeys!=="boolean")throw TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if($.encoder!==null&&typeof $.encoder<"u"&&typeof $.encoder!=="function")throw TypeError("Encoder has to be a function.");let U=$.charset||W$.charset;if(typeof $.charset<"u"&&$.charset!=="utf-8"&&$.charset!=="iso-8859-1")throw TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");let w=QG;if(typeof $.format<"u"){if(!d0(gG,$.format))throw TypeError("Unknown format option provided.");w=$.format}let J=gG[w],z=W$.filter;if(typeof $.filter==="function"||H$($.filter))z=$.filter;let G;if($.arrayFormat&&$.arrayFormat in eY)G=$.arrayFormat;else if("indices"in $)G=$.indices?"indices":"repeat";else G=W$.arrayFormat;if("commaRoundTrip"in $&&typeof $.commaRoundTrip!=="boolean")throw TypeError("`commaRoundTrip` must be a boolean, or absent");let X=typeof $.allowDots>"u"?!!$.encodeDotInKeys===!0?!0:W$.allowDots:!!$.allowDots;return{addQueryPrefix:typeof $.addQueryPrefix==="boolean"?$.addQueryPrefix:W$.addQueryPrefix,allowDots:X,allowEmptyArrays:typeof $.allowEmptyArrays==="boolean"?!!$.allowEmptyArrays:W$.allowEmptyArrays,arrayFormat:G,charset:U,charsetSentinel:typeof $.charsetSentinel==="boolean"?$.charsetSentinel:W$.charsetSentinel,commaRoundTrip:!!$.commaRoundTrip,delimiter:typeof $.delimiter>"u"?W$.delimiter:$.delimiter,encode:typeof $.encode==="boolean"?$.encode:W$.encode,encodeDotInKeys:typeof $.encodeDotInKeys==="boolean"?$.encodeDotInKeys:W$.encodeDotInKeys,encoder:typeof $.encoder==="function"?$.encoder:W$.encoder,encodeValuesOnly:typeof $.encodeValuesOnly==="boolean"?$.encodeValuesOnly:W$.encodeValuesOnly,filter:z,format:w,formatter:J,serializeDate:typeof $.serializeDate==="function"?$.serializeDate:W$.serializeDate,skipNulls:typeof $.skipNulls==="boolean"?$.skipNulls:W$.skipNulls,sort:typeof $.sort==="function"?$.sort:null,strictNullHandling:typeof $.strictNullHandling==="boolean"?$.strictNullHandling:W$.strictNullHandling}}function UQ($,U={}){let w=$,J=NH(U),z,G;if(typeof J.filter==="function")G=J.filter,w=G("",w);else if(H$(J.filter))G=J.filter,z=G;let X=[];if(typeof w!=="object"||w===null)return"";let _=eY[J.arrayFormat],N=_==="comma"&&J.commaRoundTrip;if(!z)z=Object.keys(w);if(J.sort)z.sort(J.sort);let W=new WeakMap;for(let V=0;V<z.length;++V){let g=z[V];if(J.skipNulls&&w[g]===null)continue;sY(X,$Q(w[g],g,_,N,J.allowEmptyArrays,J.strictNullHandling,J.skipNulls,J.encodeDotInKeys,J.encode?J.encoder:null,J.filter,J.sort,J.allowDots,J.serializeDate,J.format,J.formatter,J.encodeValuesOnly,J.charset,W))}let Y=X.join(J.delimiter),Q=J.addQueryPrefix===!0?"?":"";if(J.charsetSentinel)if(J.charset==="iso-8859-1")Q+="utf8=%26%2310003%3B&";else Q+="utf8=%E2%9C%93&";return Y.length>0?Q+Y:""}function wQ($){return UQ($,{arrayFormat:"brackets"})}function GQ($){let U=0;for(let z of $)U+=z.length;let w=new Uint8Array(U),J=0;for(let z of $)w.set(z,J),J+=z.length;return w}var zQ;function x6($){let U;return(zQ??(U=new globalThis.TextEncoder,zQ=U.encode.bind(U)))($)}var JQ;function IG($){let U;return(JQ??(U=new globalThis.TextDecoder,JQ=U.decode.bind(U)))($)}var R$,k$;class y6{constructor(){R$.set(this,void 0),k$.set(this,void 0),C(this,R$,new Uint8Array,"f"),C(this,k$,null,"f")}decode($){if($==null)return[];let U=$ instanceof ArrayBuffer?new Uint8Array($):typeof $==="string"?x6($):$;C(this,R$,GQ([L(this,R$,"f"),U]),"f");let w=[],J;while((J=YH(L(this,R$,"f"),L(this,k$,"f")))!=null){if(J.carriage&&L(this,k$,"f")==null){C(this,k$,J.index,"f");continue}if(L(this,k$,"f")!=null&&(J.index!==L(this,k$,"f")+1||J.carriage)){w.push(IG(L(this,R$,"f").subarray(0,L(this,k$,"f")-1))),C(this,R$,L(this,R$,"f").subarray(L(this,k$,"f")),"f"),C(this,k$,null,"f");continue}let z=L(this,k$,"f")!==null?J.preceding-1:J.preceding,G=IG(L(this,R$,"f").subarray(0,z));w.push(G),C(this,R$,L(this,R$,"f").subarray(J.index),"f"),C(this,k$,null,"f")}return w}flush(){if(!L(this,R$,"f").length)return[];return this.decode(`
|
|
167
|
-
`)}}
|
|
168
|
-
`,"\r"]);
|
|
169
|
-
`);
|
|
170
|
-
`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],z}if(this.chunks.push($),$.startsWith(":"))return null;let[U,w,J]=BH($,":");if(J.startsWith(" "))J=J.substring(1);if(U==="event")this.event=J;else if(U==="data")this.data.push(J);return null}}function BH($,U){let w=$.indexOf(U);if(w!==-1)return[$.substring(0,w),U,$.substring(w+U.length)];return[$,"",""]}async function t0($,U){let{response:w,requestLogID:J,retryOfRequestLogID:z,startTime:G}=U,X=await(async()=>{if(U.options.stream){if(X$($).debug("response",w.status,w.url,w.headers,w.body),U.options.__streamClass)return U.options.__streamClass.fromSSEResponse(w,U.controller,$,U.options.__synthesizeEventData);return j$.fromSSEResponse(w,U.controller,$,U.options.__synthesizeEventData)}if(w.status===204)return null;if(U.options.__binaryResponse)return w;let N=w.headers.get("content-type")?.split(";")[0]?.trim();if(N?.includes("application/json")||N?.endsWith("+json")){if(w.headers.get("content-length")==="0")return;let V=await w.json();return LG(V,w)}return await w.text()})();return X$($).debug(`[${J}] response parsed`,B4({retryOfRequestLogID:z,url:w.url,status:w.status,body:X,durationMs:Date.now()-G})),X}function LG($,U){if(!$||typeof $!=="object"||Array.isArray($))return $;return Object.defineProperty($,"_request_id",{value:U.headers.get("x-request-id"),enumerable:!1})}var Ow;class U6 extends Promise{constructor($,U,w=t0){super((J)=>{J(null)});this.responsePromise=U,this.parseResponse=w,Ow.set(this,void 0),C(this,Ow,$,"f")}_thenUnwrap($){return new U6(L(this,Ow,"f"),this.responsePromise,async(U,w)=>LG($(await this.parseResponse(U,w),w),w.response))}asResponse(){return this.responsePromise.then(($)=>$.response)}async withResponse(){let[$,U]=await Promise.all([this.parse(),this.asResponse()]);return{data:$,response:U,request_id:U.headers.get("x-request-id")}}parse(){if(!this.parsedPromise)this.parsedPromise=this.responsePromise.then(($)=>this.parseResponse(L(this,Ow,"f"),$));return this.parsedPromise}then($,U){return this.parse().then($,U)}catch($){return this.parse().catch($)}finally($){return this.parse().finally($)}}Ow=new WeakMap;var a0;class Tw{constructor($,U,w,J){a0.set(this,void 0),C(this,a0,$,"f"),this.options=J,this.response=U,this.body=w}hasNextPage(){if(!this.getPaginatedItems().length)return!1;return this.nextPageRequestOptions()!=null}async getNextPage(){let $=this.nextPageRequestOptions();if(!$)throw new A("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await L(this,a0,"f").requestAPIList(this.constructor,$)}async*iterPages(){let $=this;yield $;while($.hasNextPage())$=await $.getNextPage(),yield $}async*[(a0=new WeakMap,Symbol.asyncIterator)](){for await(let $ of this.iterPages())for(let U of $.getPaginatedItems())yield U}}class o0 extends U6{constructor($,U,w){super($,U,async(J,z)=>new w(J,z.response,await t0(J,z),z.options))}async*[Symbol.asyncIterator](){let $=await this;for await(let U of $)yield U}}class T$ extends Tw{constructor($,U,w,J){super($,U,w,J);this.data=w.data||[],this.object=w.object}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){return null}}class h extends Tw{constructor($,U,w,J){super($,U,w,J);this.data=w.data||[],this.has_more=w.has_more||!1}getPaginatedItems(){return this.data??[]}hasNextPage(){if(this.has_more===!1)return!1;return super.hasNextPage()}nextPageRequestOptions(){let $=this.getPaginatedItems(),U=$[$.length-1]?.id;if(!U)return null;return{...this.options,query:{...c0(this.options.query),after:U}}}}class n extends Tw{constructor($,U,w,J){super($,U,w,J);this.data=w.data||[],this.has_more=w.has_more||!1,this.last_id=w.last_id||""}getPaginatedItems(){return this.data??[]}hasNextPage(){if(this.has_more===!1)return!1;return super.hasNextPage()}nextPageRequestOptions(){let $=this.last_id;if(!$)return null;return{...this.options,query:{...c0(this.options.query),after:$}}}}class Y$ extends Tw{constructor($,U,w,J){super($,U,w,J);this.data=w.data||[],this.has_more=w.has_more||!1,this.next=w.next||null}getPaginatedItems(){return this.data??[]}hasNextPage(){if(this.has_more===!1)return!1;return super.hasNextPage()}nextPageRequestOptions(){let $=this.next;if(!$)return null;return{...this.options,query:{...c0(this.options.query),after:$}}}}var HH={jwt:"urn:ietf:params:oauth:token-type:jwt",id:"urn:ietf:params:oauth:token-type:id_token"},IH="urn:ietf:params:oauth:grant-type:token-exchange";class PG{constructor($,U){this.cachedToken=null,this.refreshPromise=null,this.tokenExchangeUrl="https://auth.openai.com/oauth/token",this.config=$,this.fetch=U??r0()}async getToken(){if(!this.cachedToken||this.isTokenExpired(this.cachedToken)){if(this.refreshPromise)return await this.refreshPromise;this.refreshPromise=this.refreshToken();try{return await this.refreshPromise}finally{this.refreshPromise=null}}if(this.needsRefresh(this.cachedToken)&&!this.refreshPromise)this.refreshPromise=this.refreshToken().finally(()=>{this.refreshPromise=null});return this.cachedToken.token}async refreshToken(){let $=await this.config.provider.getToken(),U={grant_type:IH,subject_token:$,subject_token_type:HH[this.config.provider.tokenType],identity_provider_id:this.config.identityProviderId,service_account_id:this.config.serviceAccountId};if(this.config.clientId)U.client_id=this.config.clientId;let w=await this.fetch(this.tokenExchangeUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(U)});if(!w.ok){let _=await w.text(),N=void 0;try{N=JSON.parse(_)}catch{}if(w.status===400||w.status===401||w.status===403)throw new C6(w.status,N,w.headers);throw z$.generate(w.status,N,`Token exchange failed with status ${w.status}`,w.headers)}let J=await w.json();if(typeof J!=="object"||J===null||!("access_token"in J)||typeof J.access_token!=="string"||J.access_token.trim().length===0)throw new A("Token exchange response missing 'access_token' field");let z=J.access_token,G=J.expires_in??3600,X=Date.now()+G*1000;return this.cachedToken={token:z,expiresAt:X},z}isTokenExpired($){return Date.now()>=$.expiresAt}needsRefresh($){let w=(this.config.refreshBufferSeconds??1200)*1000;return Date.now()>=$.expiresAt-w}invalidateToken(){this.cachedToken=null,this.refreshPromise=null}}var ZG=()=>{if(typeof File>"u"){let{process:$}=globalThis,U=typeof $?.versions?.node==="string"&&parseInt($.versions.node.split("."))<20;throw Error("`File` is not defined as a global, which is required for file uploads."+(U?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};function i6($,U,w){return ZG(),new File($,U??"unknown_file",w)}function Zw($){return(typeof $==="object"&&$!==null&&(("name"in $)&&$.name&&String($.name)||("url"in $)&&$.url&&String($.url)||("filename"in $)&&$.filename&&String($.filename)||("path"in $)&&$.path&&String($.path))||"").split(/[\\/]/).pop()||void 0}var e0=($)=>$!=null&&typeof $==="object"&&typeof $[Symbol.asyncIterator]==="function",M4=async($,U)=>{if(!OG($.body))return $;return{...$,body:await YQ($.body,U)}},I$=async($,U)=>{return{...$,body:await YQ($.body,U)}},WQ=new WeakMap;function KH($){let U=typeof $==="function"?$:$.fetch,w=WQ.get(U);if(w)return w;let J=(async()=>{try{let z="Response"in U?U.Response:(await U("data:,")).constructor,G=new FormData;if(G.toString()===await new z(G).text())return!1;return!0}catch{return!0}})();return WQ.set(U,J),J}var YQ=async($,U)=>{if(!await KH(U))throw TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let w=new FormData;return await Promise.all(Object.entries($||{}).map(([J,z])=>TG(w,J,z))),w},QQ=($)=>$ instanceof Blob&&("name"in $),LH=($)=>typeof $==="object"&&$!==null&&($ instanceof Response||e0($)||QQ($)),OG=($)=>{if(LH($))return!0;if(Array.isArray($))return $.some(OG);if($&&typeof $==="object"){for(let U in $)if(OG($[U]))return!0}return!1},TG=async($,U,w)=>{if(w===void 0)return;if(w==null)throw TypeError(`Received null for "${U}"; to pass null in FormData, you must use the string 'null'`);if(typeof w==="string"||typeof w==="number"||typeof w==="boolean")$.append(U,String(w));else if(w instanceof Response)$.append(U,i6([await w.blob()],Zw(w)));else if(e0(w))$.append(U,i6([await new Response(l0(w)).blob()],Zw(w)));else if(QQ(w))$.append(U,w,Zw(w));else if(Array.isArray(w))await Promise.all(w.map((J)=>TG($,U+"[]",J)));else if(typeof w==="object")await Promise.all(Object.entries(w).map(([J,z])=>TG($,`${U}[${J}]`,z)));else throw TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${w} instead`)};var VQ=($)=>$!=null&&typeof $==="object"&&typeof $.size==="number"&&typeof $.type==="string"&&typeof $.text==="function"&&typeof $.slice==="function"&&typeof $.arrayBuffer==="function",PH=($)=>$!=null&&typeof $==="object"&&typeof $.name==="string"&&typeof $.lastModified==="number"&&VQ($),OH=($)=>$!=null&&typeof $==="object"&&typeof $.url==="string"&&typeof $.blob==="function";async function h6($,U,w){if(ZG(),$=await $,PH($)){if($ instanceof File)return $;return i6([await $.arrayBuffer()],$.name)}if(OH($)){let z=await $.blob();return U||(U=new URL($.url).pathname.split(/[\\/]/).pop()),i6(await DG(z),U,w)}let J=await DG($);if(U||(U=Zw($)),!w?.type){let z=J.find((G)=>typeof G==="object"&&("type"in G)&&G.type);if(typeof z==="string")w={...w,type:z}}return i6(J,U,w)}async function DG($){let U=[];if(typeof $==="string"||ArrayBuffer.isView($)||$ instanceof ArrayBuffer)U.push($);else if(VQ($))U.push($ instanceof Blob?$:await $.arrayBuffer());else if(e0($))for await(let w of $)U.push(...await DG(w));else{let w=$?.constructor?.name;throw Error(`Unexpected data type: ${typeof $}${w?`; constructor: ${w}`:""}${TH($)}`)}return U}function TH($){if(typeof $!=="object"||$===null)return"";return`; props: [${Object.getOwnPropertyNames($).map((w)=>`"${w}"`).join(", ")}]`}class I{constructor($){this._client=$}}function BQ($){return $.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var gQ=Object.freeze(Object.create(null)),DH=($=BQ)=>function(w,...J){if(w.length===1)return w[0];let z=!1,G=[],X=w.reduce((Y,Q,V)=>{if(/[?#]/.test(Q))z=!0;let g=J[V],H=(z?encodeURIComponent:$)(""+g);if(V!==J.length&&(g==null||typeof g==="object"&&g.toString===Object.getPrototypeOf(Object.getPrototypeOf(g.hasOwnProperty??gQ)??gQ)?.toString))H=g+"",G.push({start:Y.length+Q.length,length:H.length,error:`Value of type ${Object.prototype.toString.call(g).slice(8,-1)} is not a valid path parameter`});return Y+Q+(V===J.length?"":H)},""),_=X.split(/[?#]/,1)[0],N=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,W;while((W=N.exec(_))!==null)G.push({start:W.index,length:W[0].length,error:`Value "${W[0]}" can't be safely passed as a path parameter`});if(G.sort((Y,Q)=>Y.start-Q.start),G.length>0){let Y=0,Q=G.reduce((V,g)=>{let H=" ".repeat(g.start-Y),q="^".repeat(g.length);return Y=g.start+g.length,V+H+q},"");throw new A(`Path parameters result in path with invalid segments:
|
|
171
|
-
${
|
|
162
|
+
`)return yield*this.pushCount(2);else return 0}*pushSpaces($){let w=this.pos-1,U;do U=this.buffer[++w];while(U===" "||$&&U==="\t");let v=w-this.pos;if(v>0)yield this.buffer.substr(this.pos,v),this.pos=w;return v}*pushUntil($){let w=this.pos,U=this.buffer[w];while(!$(U))U=this.buffer[++w];return yield*this.pushToIndex(w,!1)}}GM.Lexer=x5});var Y8=E((XM)=>{class r5{constructor(){this.lineStarts=[],this.addNewLine=($)=>this.lineStarts.push($),this.linePos=($)=>{let w=0,U=this.lineStarts.length;while(w<U){let J=w+U>>1;if(this.lineStarts[J]<$)w=J+1;else U=J}if(this.lineStarts[w]===$)return{line:w+1,col:1};if(w===0)return{line:0,col:$};let v=this.lineStarts[w-1];return{line:w,col:$-v+1}}}}XM.LineCounter=r5});var Q8=E((YM)=>{var NM=Q4("process"),y5=sz(),WM=W8();function J6($,w){for(let U=0;U<$.length;++U)if($[U].type===w)return!0;return!1}function d5($){for(let w=0;w<$.length;++w)switch($[w].type){case"space":case"comment":case"newline":break;default:return w}return-1}function n5($){switch($?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function w2($){switch($.type){case"document":return $.start;case"block-map":{let w=$.items[$.items.length-1];return w.sep??w.start}case"block-seq":return $.items[$.items.length-1].start;default:return[]}}function YU($){if($.length===0)return[];let w=$.length;$:while(--w>=0)switch($[w].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break $}while($[++w]?.type==="space");return $.splice(w,$.length)}function U2($,w){if(w.length<1e5)Array.prototype.push.apply($,w);else for(let U=0;U<w.length;++U)$.push(w[U])}function m5($){if($.start.type==="flow-seq-start"){for(let w of $.items)if(w.sep&&!w.value&&!J6(w.start,"explicit-key-ind")&&!J6(w.sep,"map-value-ind")){if(w.key)w.value=w.key;if(delete w.key,n5(w.value))if(w.value.end)U2(w.value.end,w.sep);else w.value.end=w.sep;else U2(w.start,w.sep);delete w.sep}}}class h5{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 WM.Lexer,this.onNewLine=$}*parse($,w=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let U of this.lexer.lex($,w))yield*this.next(U);if(!w)yield*this.end()}*next($){if(this.source=$,NM.env.LOG_TOKENS)console.log("|",y5.prettyToken($));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=$.length;return}let w=y5.tokenType($);if(!w){let U=`Not a YAML token: ${$}`;yield*this.pop({type:"error",offset:this.offset,message:U,source:$}),this.offset+=$.length}else if(w==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=w,yield*this.step(),w){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 w=$??this.stack.pop();if(!w)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield w;else{let U=this.peek(1);if(w.type==="block-scalar")w.indent="indent"in U?U.indent:0;else if(w.type==="flow-collection"&&U.type==="document")w.indent=0;if(w.type==="flow-collection")m5(w);switch(U.type){case"document":U.value=w;break;case"block-scalar":U.props.push(w);break;case"block-map":{let v=U.items[U.items.length-1];if(v.value){U.items.push({start:[],key:w,sep:[]}),this.onKeyLine=!0;return}else if(v.sep)v.value=w;else{Object.assign(v,{key:w,sep:[]}),this.onKeyLine=!v.explicitKey;return}break}case"block-seq":{let v=U.items[U.items.length-1];if(v.value)U.items.push({start:[],value:w});else v.value=w;break}case"flow-collection":{let v=U.items[U.items.length-1];if(!v||v.value)U.items.push({start:[],key:w,sep:[]});else if(v.sep)v.value=w;else Object.assign(v,{key:w,sep:[]});return}default:yield*this.pop(),yield*this.pop(w)}if((U.type==="document"||U.type==="block-map"||U.type==="block-seq")&&(w.type==="block-map"||w.type==="block-seq")){let v=w.items[w.items.length-1];if(v&&!v.sep&&!v.value&&v.start.length>0&&d5(v.start)===-1&&(w.indent===0||v.start.every((J)=>J.type!=="comment"||J.indent<w.indent))){if(U.type==="document")U.end=v.start;else U.items.push({start:v.start});w.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(d5($.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 w=this.startBlockValue($);if(w)this.stack.push(w);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 w=w2(this.peek(2)),U=YU(w),v;if($.end)v=$.end,v.push(this.sourceToken),delete $.end;else v=[this.sourceToken];let J={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:U,key:$,sep:v}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=J}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 w=this.source.indexOf(`
|
|
163
|
+
`)+1;while(w!==0)this.onNewLine(this.offset+w),w=this.source.indexOf(`
|
|
164
|
+
`,w)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap($){let w=$.items[$.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,w.value){let U="end"in w.value?w.value.end:void 0;if((Array.isArray(U)?U[U.length-1]:void 0)?.type==="comment")U?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else if(w.sep)w.sep.push(this.sourceToken);else w.start.push(this.sourceToken);return;case"space":case"comment":if(w.value)$.items.push({start:[this.sourceToken]});else if(w.sep)w.sep.push(this.sourceToken);else{if(this.atIndentedComment(w.start,$.indent)){let v=$.items[$.items.length-2]?.value?.end;if(Array.isArray(v)){U2(v,w.start),v.push(this.sourceToken),$.items.pop();return}}w.start.push(this.sourceToken)}return}if(this.indent>=$.indent){let U=!this.onKeyLine&&this.indent===$.indent,v=U&&(w.sep||w.explicitKey)&&this.type!=="seq-item-ind",J=[];if(v&&w.sep&&!w.value){let z=[];for(let g=0;g<w.sep.length;++g){let V=w.sep[g];switch(V.type){case"newline":z.push(g);break;case"space":break;case"comment":if(V.indent>$.indent)z.length=0;break;default:z.length=0}}if(z.length>=2)J=w.sep.splice(z[1])}switch(this.type){case"anchor":case"tag":if(v||w.value)J.push(this.sourceToken),$.items.push({start:J}),this.onKeyLine=!0;else if(w.sep)w.sep.push(this.sourceToken);else w.start.push(this.sourceToken);return;case"explicit-key-ind":if(!w.sep&&!w.explicitKey)w.start.push(this.sourceToken),w.explicitKey=!0;else if(v||w.value)J.push(this.sourceToken),$.items.push({start:J,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(w.explicitKey)if(!w.sep)if(J6(w.start,"newline"))Object.assign(w,{key:null,sep:[this.sourceToken]});else{let z=YU(w.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:z,key:null,sep:[this.sourceToken]}]})}else if(w.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(J6(w.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:J,key:null,sep:[this.sourceToken]}]});else if(n5(w.key)&&!J6(w.sep,"newline")){let z=YU(w.start),g=w.key,V=w.sep;V.push(this.sourceToken),delete w.key,delete w.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:z,key:g,sep:V}]})}else if(J.length>0)w.sep=w.sep.concat(J,this.sourceToken);else w.sep.push(this.sourceToken);else if(!w.sep)Object.assign(w,{key:null,sep:[this.sourceToken]});else if(w.value||v)$.items.push({start:J,key:null,sep:[this.sourceToken]});else if(J6(w.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else w.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let z=this.flowScalar(this.type);if(v||w.value)$.items.push({start:J,key:z,sep:[]}),this.onKeyLine=!0;else if(w.sep)this.stack.push(z);else Object.assign(w,{key:z,sep:[]}),this.onKeyLine=!0;return}default:{let z=this.startBlockValue($);if(z){if(z.type==="block-seq"){if(!w.explicitKey&&w.sep&&!J6(w.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(U)$.items.push({start:J});this.stack.push(z);return}}}}yield*this.pop(),yield*this.step()}*blockSequence($){let w=$.items[$.items.length-1];switch(this.type){case"newline":if(w.value){let U="end"in w.value?w.value.end:void 0;if((Array.isArray(U)?U[U.length-1]:void 0)?.type==="comment")U?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else w.start.push(this.sourceToken);return;case"space":case"comment":if(w.value)$.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(w.start,$.indent)){let v=$.items[$.items.length-2]?.value?.end;if(Array.isArray(v)){U2(v,w.start),v.push(this.sourceToken),$.items.pop();return}}w.start.push(this.sourceToken)}return;case"anchor":case"tag":if(w.value||this.indent<=$.indent)break;w.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==$.indent)break;if(w.value||J6(w.start,"seq-item-ind"))$.items.push({start:[this.sourceToken]});else w.start.push(this.sourceToken);return}if(this.indent>$.indent){let U=this.startBlockValue($);if(U){this.stack.push(U);return}}yield*this.pop(),yield*this.step()}*flowCollection($){let w=$.items[$.items.length-1];if(this.type==="flow-error-end"){let U;do yield*this.pop(),U=this.peek(1);while(U?.type==="flow-collection")}else if($.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!w||w.sep)$.items.push({start:[this.sourceToken]});else w.start.push(this.sourceToken);return;case"map-value-ind":if(!w||w.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(w.sep)w.sep.push(this.sourceToken);else Object.assign(w,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!w||w.value)$.items.push({start:[this.sourceToken]});else if(w.sep)w.sep.push(this.sourceToken);else w.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let v=this.flowScalar(this.type);if(!w||w.value)$.items.push({start:[],key:v,sep:[]});else if(w.sep)this.stack.push(v);else Object.assign(w,{key:v,sep:[]});return}case"flow-map-end":case"flow-seq-end":$.end.push(this.sourceToken);return}let U=this.startBlockValue($);if(U)this.stack.push(U);else yield*this.pop(),yield*this.step()}else{let U=this.peek(2);if(U.type==="block-map"&&(this.type==="map-value-ind"&&U.indent===$.indent||this.type==="newline"&&!U.items[U.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&U.type!=="flow-collection"){let v=w2(U),J=YU(v);m5($);let z=$.end.splice(1,$.end.length);z.push(this.sourceToken);let g={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:J,key:$,sep:z}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=g}else yield*this.lineEnd($)}}flowScalar($){if(this.onNewLine){let w=this.source.indexOf(`
|
|
165
|
+
`)+1;while(w!==0)this.onNewLine(this.offset+w),w=this.source.indexOf(`
|
|
166
|
+
`,w)+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 w=w2($),U=YU(w);return U.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:U,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let w=w2($),U=YU(w);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:U,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment($,w){if(this.type!=="comment")return!1;if(this.indent<=w)return!1;return $.every((U)=>U.type==="newline"||U.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()}}}YM.Parser=h5});var p5=E((KM)=>{var c5=v8(),PM=mJ(),oJ=nJ(),OM=YN(),BM=t(),qM=Y8(),l5=Q8();function t5($){let w=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||w&&new qM.LineCounter||null,prettyErrors:w}}function LM($,w={}){let{lineCounter:U,prettyErrors:v}=t5(w),J=new l5.Parser(U?.addNewLine),z=new c5.Composer(w),g=Array.from(z.compose(J.parse($)));if(v&&U)for(let V of g)V.errors.forEach(oJ.prettifyError($,U)),V.warnings.forEach(oJ.prettifyError($,U));if(g.length>0)return g;return Object.assign([],{empty:!0},z.streamInfo())}function o5($,w={}){let{lineCounter:U,prettyErrors:v}=t5(w),J=new l5.Parser(U?.addNewLine),z=new c5.Composer(w),g=null;for(let V of z.compose(J.parse($),!0,$.length))if(!g)g=V;else if(g.options.logLevel!=="silent"){g.errors.push(new oJ.YAMLParseError(V.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(v&&U)g.errors.forEach(oJ.prettifyError($,U)),g.warnings.forEach(oJ.prettifyError($,U));return g}function HM($,w,U){let v=void 0;if(typeof w==="function")v=w;else if(U===void 0&&w&&typeof w==="object")U=w;let J=o5($,U);if(!J)return null;if(J.warnings.forEach((z)=>OM.warn(J.options.logLevel,z)),J.errors.length>0)if(J.options.logLevel!=="silent")throw J.errors[0];else J.errors=[];return J.toJS(Object.assign({reviver:v},U))}function uM($,w,U){let v=null;if(typeof w==="function"||Array.isArray(w))v=w;else if(U===void 0&&w)U=w;if(typeof U==="string")U=U.length;if(typeof U==="number"){let J=Math.round(U);U=J<1?void 0:J>8?{indent:8}:{indent:J}}if($===void 0){let{keepUndefined:J}=U??w??{};if(!J)return}if(BM.isDocument($)&&!v)return $.toString(U);return new PM.Document($,v,U).toString(U)}KM.parse=HM;KM.parseAllDocuments=LM;KM.parseDocument=o5;KM.stringify=uM});var p8=r7(o8(),1),{program:cE,createCommand:lE,createArgument:tE,createOption:oE,CommanderError:pE,InvalidArgumentError:aE,InvalidOptionArgumentError:eE,Command:a8,Argument:sE,Option:$S,Help:wS}=p8.default;import{existsSync as B3,statSync as RB}from"node:fs";import{mkdir as kB,readFile as CB,writeFile as q3}from"node:fs/promises";import{basename as P3,dirname as jB,extname as xB,join as Ug,parse as rB}from"node:path";function j($,w,U,v,J){if(v==="m")throw TypeError("Private method is not writable");if(v==="a"&&!J)throw TypeError("Private accessor was defined without a setter");if(typeof w==="function"?$!==w||!J:!w.has($))throw TypeError("Cannot write private member to an object whose class did not declare it");return v==="a"?J.call($,U):J?J.value=U:w.set($,U),U}function q($,w,U,v){if(U==="a"&&!v)throw TypeError("Private accessor was defined without a getter");if(typeof w==="function"?$!==w||!v:!w.has($))throw TypeError("Cannot read private member from an object whose class did not declare it");return U==="m"?v:U==="a"?v.call($):v?v.value:w.get($)}var L2=function(){let{crypto:$}=globalThis;if($?.randomUUID)return L2=$.randomUUID.bind($),$.randomUUID();let w=new Uint8Array(1),U=$?()=>$.getRandomValues(w)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(v)=>(+v^U()&15>>+v/4).toString(16))};function PU($){return typeof $==="object"&&$!==null&&(("name"in $)&&$.name==="AbortError"||("message"in $)&&String($.message).includes("FetchRequestCanceledException"))}var OU=($)=>{if($ instanceof Error)return $;if(typeof $==="object"&&$!==null){try{if(Object.prototype.toString.call($)==="[object Error]"){let w=Error($.message,$.cause?{cause:$.cause}:{});if($.stack)w.stack=$.stack;if($.cause&&!w.cause)w.cause=$.cause;if($.name)w.name=$.name;return w}}catch{}try{return Error(JSON.stringify($))}catch{}}return Error($)};class i extends Error{}class v$ extends i{constructor($,w,U,v){super(`${v$.makeMessage($,w,U)}`);this.status=$,this.headers=v,this.requestID=v?.get("x-request-id"),this.error=w;let J=w;this.code=J?.code,this.param=J?.param,this.type=J?.type}static makeMessage($,w,U){let v=w?.message?typeof w.message==="string"?w.message:JSON.stringify(w.message):w?JSON.stringify(w):U;if($&&v)return`${$} ${v}`;if($)return`${$} status code (no body)`;if(v)return v;return"(no status code or body)"}static generate($,w,U,v){if(!$||!v)return new g6({message:U,cause:OU(w)});let J=w?.error;if($===400)return new BU($,J,U,v);if($===401)return new qU($,J,U,v);if($===403)return new LU($,J,U,v);if($===404)return new HU($,J,U,v);if($===409)return new uU($,J,U,v);if($===422)return new KU($,J,U,v);if($===429)return new DU($,J,U,v);if($>=500)return new fU($,J,U,v);return new v$($,J,U,v)}}class _$ extends v${constructor({message:$}={}){super(void 0,void 0,$||"Request was aborted.",void 0)}}class g6 extends v${constructor({message:$,cause:w}){super(void 0,void 0,$||"Connection error.",void 0);if(w)this.cause=w}}class V6 extends g6{constructor({message:$}={}){super({message:$??"Request timed out."})}}class BU extends v${}class qU extends v${}class LU extends v${}class HU extends v${}class uU extends v${}class KU extends v${}class DU extends v${}class fU extends v${}class TU extends i{constructor(){super("Could not parse response content as the length limit was reached")}}class ZU extends i{constructor(){super("Could not parse response content as the request was rejected by the content filter")}}class O4 extends Error{constructor($){super($)}}class l6 extends v${constructor($,w,U){let v="OAuth2 authentication error",J=void 0;if(w&&typeof w==="object"){let z=w;J=z.error;let g=z.error_description;if(g&&typeof g==="string")v=g;else if(J)v=J}super($,w,v,U);this.error_code=J}}class w0 extends i{constructor($,w,U){super($);this.provider=w,this.cause=U}}var RP=/^[a-z][a-z0-9+.-]*:/i,e8=($)=>{return RP.test($)},B$=($)=>(B$=Array.isArray,B$($)),H2=B$;function U0($){if(typeof $!=="object")return{};return $??{}}function u2($){if(!$)return!0;for(let w in $)return!1;return!0}function s8($,w){return Object.prototype.hasOwnProperty.call($,w)}function bU($){return $!=null&&typeof $==="object"&&!Array.isArray($)}var $W=($,w)=>{if(typeof w!=="number"||!Number.isInteger(w))throw new i(`${$} must be an integer`);if(w<0)throw new i(`${$} must be a positive integer`);return w};var wW=($)=>{try{return JSON.parse($)}catch(w){return}};var U4=($)=>new Promise((w)=>setTimeout(w,$));var i4="6.45.0";var zW=()=>{return typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u"};function kP(){if(typeof Deno<"u"&&Deno.build!=null)return"deno";if(typeof EdgeRuntime<"u")return"edge";if(Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]")return"node";return"unknown"}var CP=()=>{let $=kP();if($==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":i4,"X-Stainless-OS":JW(Deno.build.os),"X-Stainless-Arch":UW(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version==="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":i4,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if($==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":i4,"X-Stainless-OS":JW(globalThis.process.platform??"unknown"),"X-Stainless-Arch":UW(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let w=jP();if(w)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":i4,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${w.browser}`,"X-Stainless-Runtime-Version":w.version};return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":i4,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function jP(){if(typeof navigator>"u"||!navigator)return null;let $=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:w,pattern:U}of $){let v=U.exec(navigator.userAgent);if(v){let J=v[1]||0,z=v[2]||0,g=v[3]||0;return{browser:w,version:`${J}.${z}.${g}`}}}return null}var UW=($)=>{if($==="x32")return"x32";if($==="x86_64"||$==="x64")return"x64";if($==="arm")return"arm";if($==="aarch64"||$==="arm64")return"arm64";if($)return`other:${$}`;return"unknown"},JW=($)=>{if($=$.toLowerCase(),$.includes("ios"))return"iOS";if($==="android")return"Android";if($==="darwin")return"MacOS";if($==="win32")return"Windows";if($==="freebsd")return"FreeBSD";if($==="openbsd")return"OpenBSD";if($==="linux")return"Linux";if($)return`Other:${$}`;return"Unknown"},vW,gW=()=>{return vW??(vW=CP())};function J0(){if(typeof fetch<"u")return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new OpenAI({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function K2(...$){let w=globalThis.ReadableStream;if(typeof w>"u")throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new w(...$)}function v0($){let w=Symbol.asyncIterator in $?$[Symbol.asyncIterator]():$[Symbol.iterator]();return K2({start(){},async pull(U){let{done:v,value:J}=await w.next();if(v)U.close();else U.enqueue(J)},async cancel(){await w.return?.()}})}function D2($){if($[Symbol.asyncIterator])return $;let w=$.getReader();return{async next(){try{let U=await w.read();if(U?.done)w.releaseLock();return U}catch(U){throw w.releaseLock(),U}},async return(){let U=w.cancel();return w.releaseLock(),await U,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function f2($){if($===null||typeof $!=="object")return;if($[Symbol.asyncIterator]){await $[Symbol.asyncIterator]().return?.();return}let w=$.getReader(),U=w.cancel();w.releaseLock(),await U}var GW=({headers:$,body:w})=>{return{bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(w)}};var T2="RFC3986",Z2=($)=>String($),b2={RFC1738:($)=>String($).replace(/%20/g,"+"),RFC3986:Z2},_W="RFC1738";var z0=($,w)=>(z0=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),z0($,w)),J4=(()=>{let $=[];for(let w=0;w<256;++w)$.push("%"+((w<16?"0":"")+w.toString(16)).toUpperCase());return $})();var F2=1024,XW=($,w,U,v,J)=>{if($.length===0)return $;let z=$;if(typeof $==="symbol")z=Symbol.prototype.toString.call($);else if(typeof $!=="string")z=String($);if(U==="iso-8859-1")return escape(z).replace(/%u[0-9a-f]{4}/gi,function(V){return"%26%23"+parseInt(V.slice(2),16)+"%3B"});let g="";for(let V=0;V<z.length;V+=F2){let _=z.length>=F2?z.slice(V,V+F2):z,G=[];for(let X=0;X<_.length;++X){let I=_.charCodeAt(X);if(I===45||I===46||I===95||I===126||I>=48&&I<=57||I>=65&&I<=90||I>=97&&I<=122||J===_W&&(I===40||I===41)){G[G.length]=_.charAt(X);continue}if(I<128){G[G.length]=J4[I];continue}if(I<2048){G[G.length]=J4[192|I>>6]+J4[128|I&63];continue}if(I<55296||I>=57344){G[G.length]=J4[224|I>>12]+J4[128|I>>6&63]+J4[128|I&63];continue}X+=1,I=65536+((I&1023)<<10|_.charCodeAt(X)&1023),G[G.length]=J4[240|I>>18]+J4[128|I>>12&63]+J4[128|I>>6&63]+J4[128|I&63]}g+=G.join("")}return g};function IW($){if(!$||typeof $!=="object")return!1;return!!($.constructor&&$.constructor.isBuffer&&$.constructor.isBuffer($))}function M2($,w){if(B$($)){let U=[];for(let v=0;v<$.length;v+=1)U.push(w($[v]));return U}return w($)}var WW={brackets($){return String($)+"[]"},comma:"comma",indices($,w){return String($)+"["+w+"]"},repeat($){return String($)}},YW=function($,w){Array.prototype.push.apply($,B$(w)?w:[w])},NW,X$={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:XW,encodeValuesOnly:!1,format:T2,formatter:Z2,indices:!1,serializeDate($){return(NW??(NW=Function.prototype.call.bind(Date.prototype.toISOString)))($)},skipNulls:!1,strictNullHandling:!1};function rP($){return typeof $==="string"||typeof $==="number"||typeof $==="boolean"||typeof $==="symbol"||typeof $==="bigint"}var i2={};function QW($,w,U,v,J,z,g,V,_,G,X,I,N,W,P,Q,H,Z){let u=$,b=Z,M=0,S=!1;while((b=b.get(i2))!==void 0&&!S){let h=b.get($);if(M+=1,typeof h<"u")if(h===M)throw RangeError("Cyclic object value");else S=!0;if(typeof b.get(i2)>"u")M=0}if(typeof G==="function")u=G(w,u);else if(u instanceof Date)u=N?.(u);else if(U==="comma"&&B$(u))u=M2(u,function(h){if(h instanceof Date)return N?.(h);return h});if(u===null){if(z)return _&&!Q?_(w,X$.encoder,H,"key",W):w;u=""}if(rP(u)||IW(u)){if(_){let h=Q?w:_(w,X$.encoder,H,"key",W);return[P?.(h)+"="+P?.(_(u,X$.encoder,H,"value",W))]}return[P?.(w)+"="+P?.(String(u))]}let k=[];if(typeof u>"u")return k;let x;if(U==="comma"&&B$(u)){if(Q&&_)u=M2(u,_);x=[{value:u.length>0?u.join(",")||null:void 0}]}else if(B$(G))x=G;else{let h=Object.keys(u);x=X?h.sort(X):h}let A=V?String(w).replace(/\./g,"%2E"):String(w),a=v&&B$(u)&&u.length===1?A+"[]":A;if(J&&B$(u)&&u.length===0)return a+"[]";for(let h=0;h<x.length;++h){let K$=x[h],z$=typeof K$==="object"&&typeof K$.value<"u"?K$.value:u[K$];if(g&&z$===null)continue;let c6=I&&V?K$.replace(/\./g,"%2E"):K$,E7=B$(u)?typeof U==="function"?U(a,c6):a:a+(I?"."+c6:"["+c6+"]");Z.set($,M);let S8=new WeakMap;S8.set(i2,Z),YW(k,QW(z$,E7,U,v,J,z,g,V,U==="comma"&&Q&&B$(u)?null:_,G,X,I,N,W,P,Q,H,S8))}return k}function yP($=X$){if(typeof $.allowEmptyArrays<"u"&&typeof $.allowEmptyArrays!=="boolean")throw TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof $.encodeDotInKeys<"u"&&typeof $.encodeDotInKeys!=="boolean")throw TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if($.encoder!==null&&typeof $.encoder<"u"&&typeof $.encoder!=="function")throw TypeError("Encoder has to be a function.");let w=$.charset||X$.charset;if(typeof $.charset<"u"&&$.charset!=="utf-8"&&$.charset!=="iso-8859-1")throw TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");let U=T2;if(typeof $.format<"u"){if(!z0(b2,$.format))throw TypeError("Unknown format option provided.");U=$.format}let v=b2[U],J=X$.filter;if(typeof $.filter==="function"||B$($.filter))J=$.filter;let z;if($.arrayFormat&&$.arrayFormat in WW)z=$.arrayFormat;else if("indices"in $)z=$.indices?"indices":"repeat";else z=X$.arrayFormat;if("commaRoundTrip"in $&&typeof $.commaRoundTrip!=="boolean")throw TypeError("`commaRoundTrip` must be a boolean, or absent");let g=typeof $.allowDots>"u"?!!$.encodeDotInKeys===!0?!0:X$.allowDots:!!$.allowDots;return{addQueryPrefix:typeof $.addQueryPrefix==="boolean"?$.addQueryPrefix:X$.addQueryPrefix,allowDots:g,allowEmptyArrays:typeof $.allowEmptyArrays==="boolean"?!!$.allowEmptyArrays:X$.allowEmptyArrays,arrayFormat:z,charset:w,charsetSentinel:typeof $.charsetSentinel==="boolean"?$.charsetSentinel:X$.charsetSentinel,commaRoundTrip:!!$.commaRoundTrip,delimiter:typeof $.delimiter>"u"?X$.delimiter:$.delimiter,encode:typeof $.encode==="boolean"?$.encode:X$.encode,encodeDotInKeys:typeof $.encodeDotInKeys==="boolean"?$.encodeDotInKeys:X$.encodeDotInKeys,encoder:typeof $.encoder==="function"?$.encoder:X$.encoder,encodeValuesOnly:typeof $.encodeValuesOnly==="boolean"?$.encodeValuesOnly:X$.encodeValuesOnly,filter:J,format:U,formatter:v,serializeDate:typeof $.serializeDate==="function"?$.serializeDate:X$.serializeDate,skipNulls:typeof $.skipNulls==="boolean"?$.skipNulls:X$.skipNulls,sort:typeof $.sort==="function"?$.sort:null,strictNullHandling:typeof $.strictNullHandling==="boolean"?$.strictNullHandling:X$.strictNullHandling}}function PW($,w={}){let U=$,v=yP(w),J,z;if(typeof v.filter==="function")z=v.filter,U=z("",U);else if(B$(v.filter))z=v.filter,J=z;let g=[];if(typeof U!=="object"||U===null)return"";let V=WW[v.arrayFormat],_=V==="comma"&&v.commaRoundTrip;if(!J)J=Object.keys(U);if(v.sort)J.sort(v.sort);let G=new WeakMap;for(let N=0;N<J.length;++N){let W=J[N];if(v.skipNulls&&U[W]===null)continue;YW(g,QW(U[W],W,V,_,v.allowEmptyArrays,v.strictNullHandling,v.skipNulls,v.encodeDotInKeys,v.encode?v.encoder:null,v.filter,v.sort,v.allowDots,v.serializeDate,v.format,v.formatter,v.encodeValuesOnly,v.charset,G))}let X=g.join(v.delimiter),I=v.addQueryPrefix===!0?"?":"";if(v.charsetSentinel)if(v.charset==="iso-8859-1")I+="utf8=%26%2310003%3B&";else I+="utf8=%E2%9C%93&";return X.length>0?I+X:""}function OW($){return PW($,{arrayFormat:"brackets"})}function LW($){let w=0;for(let J of $)w+=J.length;let U=new Uint8Array(w),v=0;for(let J of $)U.set(J,v),v+=J.length;return U}var BW;function t6($){let w;return(BW??(w=new globalThis.TextEncoder,BW=w.encode.bind(w)))($)}var qW;function E2($){let w;return(qW??(w=new globalThis.TextDecoder,qW=w.decode.bind(w)))($)}var A$,R$;class o6{constructor(){A$.set(this,void 0),R$.set(this,void 0),j(this,A$,new Uint8Array,"f"),j(this,R$,null,"f")}decode($){if($==null)return[];let w=$ instanceof ArrayBuffer?new Uint8Array($):typeof $==="string"?t6($):$;j(this,A$,LW([q(this,A$,"f"),w]),"f");let U=[],v;while((v=mP(q(this,A$,"f"),q(this,R$,"f")))!=null){if(v.carriage&&q(this,R$,"f")==null){j(this,R$,v.index,"f");continue}if(q(this,R$,"f")!=null&&(v.index!==q(this,R$,"f")+1||v.carriage)){U.push(E2(q(this,A$,"f").subarray(0,q(this,R$,"f")-1))),j(this,A$,q(this,A$,"f").subarray(q(this,R$,"f")),"f"),j(this,R$,null,"f");continue}let J=q(this,R$,"f")!==null?v.preceding-1:v.preceding,z=E2(q(this,A$,"f").subarray(0,J));U.push(z),j(this,A$,q(this,A$,"f").subarray(v.index),"f"),j(this,R$,null,"f")}return U}flush(){if(!q(this,A$,"f").length)return[];return this.decode(`
|
|
167
|
+
`)}}A$=new WeakMap,R$=new WeakMap;o6.NEWLINE_CHARS=new Set([`
|
|
168
|
+
`,"\r"]);o6.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function mP($,w){for(let J=w??0;J<$.length;J++){if($[J]===10)return{preceding:J,index:J+1,carriage:!1};if($[J]===13)return{preceding:J,index:J+1,carriage:!0}}return null}function HW($){for(let v=0;v<$.length-1;v++){if($[v]===10&&$[v+1]===10)return v+2;if($[v]===13&&$[v+1]===13)return v+2;if($[v]===13&&$[v+1]===10&&v+3<$.length&&$[v+2]===13&&$[v+3]===10)return v+4}return-1}var V0={off:0,error:200,warn:300,info:400,debug:500},S2=($,w,U)=>{if(!$)return;if(s8(V0,$))return $;V$(U).warn(`${w} was set to ${JSON.stringify($)}, expected one of ${JSON.stringify(Object.keys(V0))}`);return};function FU(){}function g0($,w,U){if(!w||V0[$]>V0[U])return FU;else return w[$].bind(w)}var nP={error:FU,warn:FU,info:FU,debug:FU},uW=new WeakMap;function V$($){let w=$.logger,U=$.logLevel??"off";if(!w)return nP;let v=uW.get(w);if(v&&v[0]===U)return v[1];let J={error:g0("error",w,U),warn:g0("warn",w,U),info:g0("info",w,U),debug:g0("debug",w,U)};return uW.set(w,[U,J]),J}var B4=($)=>{if($.options)$.options={...$.options},delete $.options.headers;if($.headers)$.headers=Object.fromEntries(($.headers instanceof Headers?[...$.headers]:Object.entries($.headers)).map(([w,U])=>[w,w.toLowerCase()==="authorization"||w.toLowerCase()==="api-key"||w.toLowerCase()==="x-api-key"||w.toLowerCase()==="x-amz-security-token"||w.toLowerCase()==="cookie"||w.toLowerCase()==="set-cookie"?"***":U]));if("retryOfRequestLogID"in $){if($.retryOfRequestLogID)$.retryOf=$.retryOfRequestLogID;delete $.retryOfRequestLogID}return $};var MU;class k${constructor($,w,U){this.iterator=$,MU.set(this,void 0),this.controller=w,j(this,MU,U,"f")}static fromSSEResponse($,w,U,v){let J=!1,z=U?V$(U):console;async function*g(){if(J)throw new i("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");J=!0;let V=!1;try{for await(let _ of hP($,w)){if(V)continue;if(_.data.startsWith("[DONE]")){V=!0;continue}if(_.event===null||!_.event.startsWith("thread.")){let G;try{G=JSON.parse(_.data)}catch(X){throw z.error("Could not parse message into JSON:",_.data),z.error("From chunk:",_.raw),X}if(G&&G.error)throw new v$(void 0,G.error,void 0,$.headers);yield v?{event:_.event,data:G}:G}else{let G;try{G=JSON.parse(_.data)}catch(X){throw console.error("Could not parse message into JSON:",_.data),console.error("From chunk:",_.raw),X}if(_.event=="error")throw new v$(void 0,G.error,G.message,void 0);yield{event:_.event,data:G}}}V=!0}catch(_){if(PU(_))return;throw _}finally{if(!V)w.abort()}}return new k$(g,w,U)}static fromReadableStream($,w,U){let v=!1;async function*J(){let g=new o6,V=D2($);for await(let _ of V)for(let G of g.decode(_))yield G;for(let _ of g.flush())yield _}async function*z(){if(v)throw new i("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");v=!0;let g=!1;try{for await(let V of J()){if(g)continue;if(V)yield JSON.parse(V)}g=!0}catch(V){if(PU(V))return;throw V}finally{if(!g)w.abort()}}return new k$(z,w,U)}[(MU=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let $=[],w=[],U=this.iterator(),v=(J)=>{return{next:()=>{if(J.length===0){let z=U.next();$.push(z),w.push(z)}return J.shift()}}};return[new k$(()=>v($),this.controller,q(this,MU,"f")),new k$(()=>v(w),this.controller,q(this,MU,"f"))]}toReadableStream(){let $=this,w;return K2({async start(){w=$[Symbol.asyncIterator]()},async pull(U){try{let{value:v,done:J}=await w.next();if(J)return U.close();let z=t6(JSON.stringify(v)+`
|
|
169
|
+
`);U.enqueue(z)}catch(v){U.error(v)}},async cancel(){await w.return?.()}})}}async function*hP($,w){if(!$.body){if(w.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new i("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new i("Attempted to iterate over a response with no body")}let U=new KW,v=new o6,J=D2($.body);for await(let z of cP(J))for(let g of v.decode(z)){let V=U.decode(g);if(V)yield V}for(let z of v.flush()){let g=U.decode(z);if(g)yield g}}async function*cP($){let w=new Uint8Array;for await(let U of $){if(U==null)continue;let v=U instanceof ArrayBuffer?new Uint8Array(U):typeof U==="string"?t6(U):U,J=new Uint8Array(w.length+v.length);J.set(w),J.set(v,w.length),w=J;let z;while((z=HW(w))!==-1)yield w.slice(0,z),w=w.slice(z)}if(w.length>0)yield w}class KW{constructor(){this.event=null,this.data=[],this.chunks=[]}decode($){if($.endsWith("\r"))$=$.substring(0,$.length-1);if(!$){if(!this.event&&!this.data.length)return null;let J={event:this.event,data:this.data.join(`
|
|
170
|
+
`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],J}if(this.chunks.push($),$.startsWith(":"))return null;let[w,U,v]=lP($,":");if(v.startsWith(" "))v=v.substring(1);if(w==="event")this.event=v;else if(w==="data")this.data.push(v);return null}}function lP($,w){let U=$.indexOf(w);if(U!==-1)return[$.substring(0,U),w,$.substring(U+w.length)];return[$,"",""]}async function G0($,w){let{response:U,requestLogID:v,retryOfRequestLogID:J,startTime:z}=w,g=await(async()=>{if(w.options.stream){if(V$($).debug("response",U.status,U.url,U.headers,U.body),w.options.__streamClass)return w.options.__streamClass.fromSSEResponse(U,w.controller,$,w.options.__synthesizeEventData);return k$.fromSSEResponse(U,w.controller,$,w.options.__synthesizeEventData)}if(U.status===204)return null;if(w.options.__binaryResponse)return U;let _=U.headers.get("content-type")?.split(";")[0]?.trim();if(_?.includes("application/json")||_?.endsWith("+json")){if(U.headers.get("content-length")==="0")return;let N=await U.json();return A2(N,U)}return await U.text()})();return V$($).debug(`[${v}] response parsed`,B4({retryOfRequestLogID:J,url:U.url,status:U.status,body:g,durationMs:Date.now()-z})),g}function A2($,w){if(!$||typeof $!=="object"||Array.isArray($))return $;return Object.defineProperty($,"_request_id",{value:w.headers.get("x-request-id"),enumerable:!1})}var iU;class G6 extends Promise{constructor($,w,U=G0){super((v)=>{v(null)});this.responsePromise=w,this.parseResponse=U,iU.set(this,void 0),j(this,iU,$,"f")}_thenUnwrap($){return new G6(q(this,iU,"f"),this.responsePromise,async(w,U)=>A2($(await this.parseResponse(w,U),U),U.response))}asResponse(){return this.responsePromise.then(($)=>$.response)}async withResponse(){let[$,w]=await Promise.all([this.parse(),this.asResponse()]);return{data:$,response:w,request_id:w.headers.get("x-request-id")}}parse(){if(!this.parsedPromise)this.parsedPromise=this.responsePromise.then(($)=>this.parseResponse(q(this,iU,"f"),$));return this.parsedPromise}then($,w){return this.parse().then($,w)}catch($){return this.parse().catch($)}finally($){return this.parse().finally($)}}iU=new WeakMap;var _0;class EU{constructor($,w,U,v){_0.set(this,void 0),j(this,_0,$,"f"),this.options=v,this.response=w,this.body=U}hasNextPage(){if(!this.getPaginatedItems().length)return!1;return this.nextPageRequestOptions()!=null}async getNextPage(){let $=this.nextPageRequestOptions();if(!$)throw new i("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await q(this,_0,"f").requestAPIList(this.constructor,$)}async*iterPages(){let $=this;yield $;while($.hasNextPage())$=await $.getNextPage(),yield $}async*[(_0=new WeakMap,Symbol.asyncIterator)](){for await(let $ of this.iterPages())for(let w of $.getPaginatedItems())yield w}}class X0 extends G6{constructor($,w,U){super($,w,async(v,J)=>new U(v,J.response,await G0(v,J),J.options))}async*[Symbol.asyncIterator](){let $=await this;for await(let w of $)yield w}}class D$ extends EU{constructor($,w,U,v){super($,w,U,v);this.data=U.data||[],this.object=U.object}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){return null}}class y extends EU{constructor($,w,U,v){super($,w,U,v);this.data=U.data||[],this.has_more=U.has_more||!1}getPaginatedItems(){return this.data??[]}hasNextPage(){if(this.has_more===!1)return!1;return super.hasNextPage()}nextPageRequestOptions(){let $=this.getPaginatedItems(),w=$[$.length-1]?.id;if(!w)return null;return{...this.options,query:{...U0(this.options.query),after:w}}}}class l extends EU{constructor($,w,U,v){super($,w,U,v);this.data=U.data||[],this.has_more=U.has_more||!1,this.last_id=U.last_id||""}getPaginatedItems(){return this.data??[]}hasNextPage(){if(this.has_more===!1)return!1;return super.hasNextPage()}nextPageRequestOptions(){let $=this.last_id;if(!$)return null;return{...this.options,query:{...U0(this.options.query),after:$}}}}class I$ extends EU{constructor($,w,U,v){super($,w,U,v);this.data=U.data||[],this.has_more=U.has_more||!1,this.next=U.next||null}getPaginatedItems(){return this.data??[]}hasNextPage(){if(this.has_more===!1)return!1;return super.hasNextPage()}nextPageRequestOptions(){let $=this.next;if(!$)return null;return{...this.options,query:{...U0(this.options.query),after:$}}}}var oP={jwt:"urn:ietf:params:oauth:token-type:jwt",id:"urn:ietf:params:oauth:token-type:id_token"},pP="urn:ietf:params:oauth:grant-type:token-exchange";class R2{constructor($,w){this.cachedToken=null,this.refreshPromise=null,this.tokenExchangeUrl="https://auth.openai.com/oauth/token",this.config=$,this.fetch=w??J0()}async getToken(){if(!this.cachedToken||this.isTokenExpired(this.cachedToken)){if(this.refreshPromise)return await this.refreshPromise;this.refreshPromise=this.refreshToken();try{return await this.refreshPromise}finally{this.refreshPromise=null}}if(this.needsRefresh(this.cachedToken)&&!this.refreshPromise)this.refreshPromise=this.refreshToken().finally(()=>{this.refreshPromise=null});return this.cachedToken.token}async refreshToken(){let $=await this.config.provider.getToken(),w={grant_type:pP,subject_token:$,subject_token_type:oP[this.config.provider.tokenType],identity_provider_id:this.config.identityProviderId,service_account_id:this.config.serviceAccountId};if(this.config.clientId)w.client_id=this.config.clientId;let U=await this.fetch(this.tokenExchangeUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(w)});if(!U.ok){let V=await U.text(),_=void 0;try{_=JSON.parse(V)}catch{}if(U.status===400||U.status===401||U.status===403)throw new l6(U.status,_,U.headers);throw v$.generate(U.status,_,`Token exchange failed with status ${U.status}`,U.headers)}let v=await U.json();if(typeof v!=="object"||v===null||!("access_token"in v)||typeof v.access_token!=="string"||v.access_token.trim().length===0)throw new i("Token exchange response missing 'access_token' field");let J=v.access_token,z=v.expires_in??3600,g=Date.now()+z*1000;return this.cachedToken={token:J,expiresAt:g},J}isTokenExpired($){return Date.now()>=$.expiresAt}needsRefresh($){let U=(this.config.refreshBufferSeconds??1200)*1000;return Date.now()>=$.expiresAt-U}invalidateToken(){this.cachedToken=null,this.refreshPromise=null}}var j2=()=>{if(typeof File>"u"){let{process:$}=globalThis,w=typeof $?.versions?.node==="string"&&parseInt($.versions.node.split("."))<20;throw Error("`File` is not defined as a global, which is required for file uploads."+(w?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};function p6($,w,U){return j2(),new File($,w??"unknown_file",U)}function SU($){return(typeof $==="object"&&$!==null&&(("name"in $)&&$.name&&String($.name)||("url"in $)&&$.url&&String($.url)||("filename"in $)&&$.filename&&String($.filename)||("path"in $)&&$.path&&String($.path))||"").split(/[\\/]/).pop()||void 0}var I0=($)=>$!=null&&typeof $==="object"&&typeof $[Symbol.asyncIterator]==="function",E4=async($,w)=>{if(!k2($.body))return $;return{...$,body:await fW($.body,w)}},q$=async($,w)=>{return{...$,body:await fW($.body,w)}},DW=new WeakMap;function aP($){let w=typeof $==="function"?$:$.fetch,U=DW.get(w);if(U)return U;let v=(async()=>{try{let J="Response"in w?w.Response:(await w("data:,")).constructor,z=new FormData;if(z.toString()===await new J(z).text())return!1;return!0}catch{return!0}})();return DW.set(w,v),v}var fW=async($,w)=>{if(!await aP(w))throw TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let U=new FormData;return await Promise.all(Object.entries($||{}).map(([v,J])=>C2(U,v,J))),U},TW=($)=>$ instanceof Blob&&("name"in $),eP=($)=>typeof $==="object"&&$!==null&&($ instanceof Response||I0($)||TW($)),k2=($)=>{if(eP($))return!0;if(Array.isArray($))return $.some(k2);if($&&typeof $==="object"){for(let w in $)if(k2($[w]))return!0}return!1},C2=async($,w,U)=>{if(U===void 0)return;if(U==null)throw TypeError(`Received null for "${w}"; to pass null in FormData, you must use the string 'null'`);if(typeof U==="string"||typeof U==="number"||typeof U==="boolean")$.append(w,String(U));else if(U instanceof Response)$.append(w,p6([await U.blob()],SU(U)));else if(I0(U))$.append(w,p6([await new Response(v0(U)).blob()],SU(U)));else if(TW(U))$.append(w,U,SU(U));else if(Array.isArray(U))await Promise.all(U.map((v)=>C2($,w+"[]",v)));else if(typeof U==="object")await Promise.all(Object.entries(U).map(([v,J])=>C2($,`${w}[${v}]`,J)));else throw TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${U} instead`)};var ZW=($)=>$!=null&&typeof $==="object"&&typeof $.size==="number"&&typeof $.type==="string"&&typeof $.text==="function"&&typeof $.slice==="function"&&typeof $.arrayBuffer==="function",sP=($)=>$!=null&&typeof $==="object"&&typeof $.name==="string"&&typeof $.lastModified==="number"&&ZW($),$O=($)=>$!=null&&typeof $==="object"&&typeof $.url==="string"&&typeof $.blob==="function";async function a6($,w,U){if(j2(),$=await $,sP($)){if($ instanceof File)return $;return p6([await $.arrayBuffer()],$.name)}if($O($)){let J=await $.blob();return w||(w=new URL($.url).pathname.split(/[\\/]/).pop()),p6(await x2(J),w,U)}let v=await x2($);if(w||(w=SU($)),!U?.type){let J=v.find((z)=>typeof z==="object"&&("type"in z)&&z.type);if(typeof J==="string")U={...U,type:J}}return p6(v,w,U)}async function x2($){let w=[];if(typeof $==="string"||ArrayBuffer.isView($)||$ instanceof ArrayBuffer)w.push($);else if(ZW($))w.push($ instanceof Blob?$:await $.arrayBuffer());else if(I0($))for await(let U of $)w.push(...await x2(U));else{let U=$?.constructor?.name;throw Error(`Unexpected data type: ${typeof $}${U?`; constructor: ${U}`:""}${wO($)}`)}return w}function wO($){if(typeof $!=="object"||$===null)return"";return`; props: [${Object.getOwnPropertyNames($).map((U)=>`"${U}"`).join(", ")}]`}class O{constructor($){this._client=$}}function FW($){return $.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var bW=Object.freeze(Object.create(null)),JO=($=FW)=>function(U,...v){if(U.length===1)return U[0];let J=!1,z=[],g=U.reduce((X,I,N)=>{if(/[?#]/.test(I))J=!0;let W=v[N],P=(J?encodeURIComponent:$)(""+W);if(N!==v.length&&(W==null||typeof W==="object"&&W.toString===Object.getPrototypeOf(Object.getPrototypeOf(W.hasOwnProperty??bW)??bW)?.toString))P=W+"",z.push({start:X.length+I.length,length:P.length,error:`Value of type ${Object.prototype.toString.call(W).slice(8,-1)} is not a valid path parameter`});return X+I+(N===v.length?"":P)},""),V=g.split(/[?#]/,1)[0],_=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,G;while((G=_.exec(V))!==null)z.push({start:G.index,length:G[0].length,error:`Value "${G[0]}" can't be safely passed as a path parameter`});if(z.sort((X,I)=>X.start-I.start),z.length>0){let X=0,I=z.reduce((N,W)=>{let P=" ".repeat(W.start-X),Q="^".repeat(W.length);return X=W.start+W.length,N+P+Q},"");throw new i(`Path parameters result in path with invalid segments:
|
|
171
|
+
${z.map((N)=>N.error).join(`
|
|
172
172
|
`)}
|
|
173
|
-
${
|
|
174
|
-
${Q}`)}return X},B=DH(BQ);class m6 extends I{list($,U={},w){return this._client.getAPIList(B`/chat/completions/${$}/messages`,h,{query:U,...w,__security:{bearerAuth:!0}})}}function Dw($){return $!==void 0&&"function"in $&&$.function!==void 0}function Fw($){return $?.$brand==="auto-parseable-response-format"}function w6($){return $?.$brand==="auto-parseable-tool"}function HQ($,U){if(!U||!FG(U))return{...$,choices:$.choices.map((w)=>{return KQ(w.message.tool_calls),{...w,message:{...w.message,parsed:null,...w.message.tool_calls?{tool_calls:w.message.tool_calls}:void 0}}})};return vw($,U)}function vw($,U){let w=$.choices.map((J)=>{if(J.finish_reason==="length")throw new Hw;if(J.finish_reason==="content_filter")throw new Iw;return KQ(J.message.tool_calls),{...J,message:{...J.message,...J.message.tool_calls?{tool_calls:J.message.tool_calls?.map((z)=>MH(U,z))??void 0}:void 0,parsed:J.message.content&&!J.message.refusal?vH(U,J.message.content):null}}});return{...$,choices:w}}function vH($,U){if($.response_format?.type!=="json_schema")return null;if($.response_format?.type==="json_schema"){if("$parseRaw"in $.response_format)return $.response_format.$parseRaw(U);return JSON.parse(U)}return null}function MH($,U){let w=$.tools?.find((J)=>Dw(J)&&J.function?.name===U.function.name);return{...U,function:{...U.function,parsed_arguments:w6(w)?w.$parseRaw(U.function.arguments):w?.function.strict?JSON.parse(U.function.arguments):null}}}function IQ($,U){if(!$||!("tools"in $)||!$.tools)return!1;let w=$.tools?.find((J)=>Dw(J)&&J.function?.name===U.function.name);return Dw(w)&&(w6(w)||w?.function.strict||!1)}function FG($){if(Fw($.response_format))return!0;return $.tools?.some((U)=>w6(U)||U.type==="function"&&U.function.strict===!0)??!1}function KQ($){for(let U of $||[])if(U.type!=="function")throw new A(`Currently only \`function\` tool calls are supported; Received \`${U.type}\``)}function LQ($){for(let U of $??[]){if(U.type!=="function")throw new A(`Currently only \`function\` tool types support auto-parsing; Received \`${U.type}\``);if(U.function.strict!==!0)throw new A(`The \`${U.function.name}\` tool is not marked with \`strict: true\`. Only strict function tools can be auto-parsed`)}}var c6=($)=>{return $?.role==="assistant"},vG=($)=>{return $?.role==="tool"};var s0,$z,Uz,Mw,Sw,wz,bw,q4,zz,Ew,Jz,Gz,r6,PQ,OQ;class z6{constructor(){s0.add(this),this.controller=new AbortController,$z.set(this,void 0),Uz.set(this,()=>{}),Mw.set(this,()=>{}),Sw.set(this,void 0),wz.set(this,()=>{}),bw.set(this,()=>{}),q4.set(this,{}),zz.set(this,[]),Ew.set(this,!1),Jz.set(this,!1),Gz.set(this,!1),r6.set(this,!1),C(this,$z,new Promise(($,U)=>{C(this,Uz,$,"f"),C(this,Mw,U,"f")}),"f"),C(this,Sw,new Promise(($,U)=>{C(this,wz,$,"f"),C(this,bw,U,"f")}),"f"),L(this,$z,"f").catch(()=>{}),L(this,Sw,"f").catch(()=>{})}_run($){setTimeout(()=>{$().then(()=>{this._emitFinal(),this._emit("end")},L(this,s0,"m",OQ).bind(this))},0)}_connected(){if(this.ended)return;L(this,Uz,"f").call(this),this._emit("connect")}get ended(){return L(this,Ew,"f")}get errored(){return L(this,Jz,"f")}get aborted(){return L(this,Gz,"f")}abort(){this.controller.abort()}_listenForAbort($){if(!$||this.ended)return;if($.aborted){this.controller.abort();return}let U=()=>this.controller.abort();$.addEventListener("abort",U,{once:!0}),L(this,zz,"f").push({signal:$,listener:U})}on($,U){return(L(this,q4,"f")[$]||(L(this,q4,"f")[$]=[])).push({listener:U}),this}off($,U){let w=L(this,q4,"f")[$];if(!w)return this;let J=w.findIndex((z)=>z.listener===U);if(J>=0)w.splice(J,1);return this}once($,U){return(L(this,q4,"f")[$]||(L(this,q4,"f")[$]=[])).push({listener:U,once:!0}),this}emitted($){return new Promise((U,w)=>{if(C(this,r6,!0,"f"),$!=="error")this.once("error",w);this.once($,U)})}async done(){C(this,r6,!0,"f"),await L(this,Sw,"f")}_emit($,...U){if(L(this,Ew,"f"))return;if($==="end")L(this,s0,"m",PQ).call(this),C(this,Ew,!0,"f"),L(this,wz,"f").call(this);let w=L(this,q4,"f")[$];if(w)L(this,q4,"f")[$]=w.filter((J)=>!J.once),w.forEach(({listener:J})=>J(...U));if($==="abort"){let J=U[0];if(!L(this,r6,"f")&&!w?.length)Promise.reject(J);L(this,Mw,"f").call(this,J),L(this,bw,"f").call(this,J),this._emit("end");return}if($==="error"){let J=U[0];if(!L(this,r6,"f")&&!w?.length)Promise.reject(J);L(this,Mw,"f").call(this,J),L(this,bw,"f").call(this,J),this._emit("end")}}_emitFinal(){}}$z=new WeakMap,Uz=new WeakMap,Mw=new WeakMap,Sw=new WeakMap,wz=new WeakMap,bw=new WeakMap,q4=new WeakMap,zz=new WeakMap,Ew=new WeakMap,Jz=new WeakMap,Gz=new WeakMap,r6=new WeakMap,s0=new WeakSet,PQ=function(){for(let{signal:U,listener:w}of L(this,zz,"f").splice(0))U.removeEventListener("abort",w)},OQ=function(U){if(C(this,Jz,!0,"f"),U instanceof Error&&U.name==="AbortError")U=new N$;if(U instanceof N$)return C(this,Gz,!0,"f"),this._emit("abort",U);if(U instanceof A)return this._emit("error",U);if(U instanceof Error){let w=new A(U.message);return w.cause=U,this._emit("error",w)}return this._emit("error",new A(String(U)))};function TQ($){return typeof $.parse==="function"}var Z$,MG,Xz,SG,bG,EG,ZQ,DQ,SH=10;class Aw extends z6{constructor(){super(...arguments);Z$.add(this),this._chatCompletions=[],this.messages=[]}_addChatCompletion($){this._chatCompletions.push($),this._emit("chatCompletion",$);let U=$.choices[0]?.message;if(U)this._addMessage(U);return $}_addMessage($,U=!0){if(!("content"in $))$.content=null;if(this.messages.push($),U){if(this._emit("message",$),vG($)&&$.content)this._emit("functionToolCallResult",$.content);else if(c6($)&&$.tool_calls){for(let w of $.tool_calls)if(w.type==="function")this._emit("functionToolCall",w.function)}}}async finalChatCompletion(){await this.done();let $=this._chatCompletions[this._chatCompletions.length-1];if(!$)throw new A("stream ended without producing a ChatCompletion");return $}async finalContent(){return await this.done(),L(this,Z$,"m",MG).call(this)}async finalMessage(){return await this.done(),L(this,Z$,"m",Xz).call(this)}async finalFunctionToolCall(){return await this.done(),L(this,Z$,"m",SG).call(this)}async finalFunctionToolCallResult(){return await this.done(),L(this,Z$,"m",bG).call(this)}async totalUsage(){return await this.done(),L(this,Z$,"m",EG).call(this)}allChatCompletions(){return[...this._chatCompletions]}_emitFinal(){let $=this._chatCompletions[this._chatCompletions.length-1];if($)this._emit("finalChatCompletion",$);let U=L(this,Z$,"m",Xz).call(this);if(U)this._emit("finalMessage",U);let w=L(this,Z$,"m",MG).call(this);if(w)this._emit("finalContent",w);let J=L(this,Z$,"m",SG).call(this);if(J)this._emit("finalFunctionToolCall",J);let z=L(this,Z$,"m",bG).call(this);if(z!=null)this._emit("finalFunctionToolCallResult",z);if(this._chatCompletions.some((G)=>G.usage))this._emit("totalUsage",L(this,Z$,"m",EG).call(this))}async _createChatCompletion($,U,w){this._listenForAbort(w?.signal),L(this,Z$,"m",ZQ).call(this,U);let J=await $.chat.completions.create({...U,stream:!1},{...w,signal:this.controller.signal});return this._connected(),this._addChatCompletion(vw(J,U))}async _runChatCompletion($,U,w){for(let J of U.messages)this._addMessage(J,!1);return await this._createChatCompletion($,U,w)}async _runTools($,U,w,J){let{tool_choice:G="auto",stream:X,..._}=U,N=typeof G!=="string"&&G.type==="function"&&G?.function?.name,{maxChatCompletions:W=SH,afterCompletion:Y}=J||{},Q=U.tools.map((q)=>{if(w6(q)){if(!q.$callback)throw new A("Tool given to `.runTools()` that does not have an associated function");return{type:"function",function:{function:q.$callback,name:q.function.name,description:q.function.description||"",parameters:q.function.parameters,parse:q.$parseRaw,strict:!0}}}return q}),V={};for(let q of Q)if(q.type==="function")V[q.function.name||q.function.function.name]=q.function;let g="tools"in U?Q.map((q)=>q.type==="function"?{type:"function",function:{name:q.function.name||q.function.function.name,parameters:q.function.parameters,description:q.function.description,strict:q.function.strict}}:q):void 0;for(let q of U.messages)this._addMessage(q,!1);let H=async(q)=>{if(q.type!=="function")return{message:void 0,functionCalled:!1};let O=q.id,{name:M,arguments:T}=q.function,S=V[M];if(!S){let u=`Invalid tool_call: ${JSON.stringify(M)}. Available options are: ${Object.keys(V).map((x)=>JSON.stringify(x)).join(", ")}. Please try again`;return{message:{role:"tool",tool_call_id:O,content:u},functionCalled:!1}}if(N&&N!==M){let u=`Invalid tool_call: ${JSON.stringify(M)}. ${JSON.stringify(N)} requested. Please try again`;return{message:{role:"tool",tool_call_id:O,content:u},functionCalled:!1}}let E;if(TQ(S)){let u;try{u=await S.parse(T)}catch(x){let k=x instanceof Error?x.message:String(x);return{message:{role:"tool",tool_call_id:O,content:k},functionCalled:!1}}E=await S.function(u,w)}else E=await S.function(T,w);let R=L(this,Z$,"m",DQ).call(this,E);return{message:{role:"tool",tool_call_id:O,content:R},functionCalled:!0}};for(let q=0;q<W;++q){let O=await this._createChatCompletion($,{..._,tool_choice:G,tools:g,messages:[...this.messages]},J),M=O.choices[0]?.message;if(!M)throw new A("missing message in ChatCompletion response");if(!M.tool_calls?.length){await Y?.(O,w);return}if(N||U.parallel_tool_calls===!1)for(let T of M.tool_calls){let S=await H(T);if(S.message)this._addMessage(S.message);if(N&&S.functionCalled){await Y?.(O,w);return}}else{let T=await Promise.allSettled(M.tool_calls.map(H));for(let S of T)if(S.status==="rejected")throw S.reason;for(let S of T)if(S.status==="fulfilled"&&S.value.message)this._addMessage(S.value.message)}await Y?.(O,w)}return}}Z$=new WeakSet,MG=function(){return L(this,Z$,"m",Xz).call(this).content??null},Xz=function(){let U=this.messages.length;while(U-- >0){let w=this.messages[U];if(c6(w))return{...w,content:w.content??null,refusal:w.refusal??null}}throw new A("stream ended without producing a ChatCompletionMessage with role=assistant")},SG=function(){for(let U=this.messages.length-1;U>=0;U--){let w=this.messages[U];if(c6(w)&&w?.tool_calls?.length)for(let J=w.tool_calls.length-1;J>=0;J--){let z=w.tool_calls[J];if(z?.type==="function")return z.function}}return},bG=function(){for(let U=this.messages.length-1;U>=0;U--){let w=this.messages[U];if(vG(w)&&w.content!=null&&typeof w.content==="string"&&this.messages.some((J)=>J.role==="assistant"&&J.tool_calls?.some((z)=>z.type==="function"&&z.id===w.tool_call_id)))return w.content}return},EG=function(){let U={completion_tokens:0,prompt_tokens:0,total_tokens:0};for(let{usage:w}of this._chatCompletions)if(w)U.completion_tokens+=w.completion_tokens,U.prompt_tokens+=w.prompt_tokens,U.total_tokens+=w.total_tokens;return U},ZQ=function(U){if(U.n!=null&&U.n>1)throw new A("ChatCompletion convenience helpers only support n=1 at this time. To use n>1, please use chat.completions.create() directly.")},DQ=function(U){return typeof U==="string"?U:U===void 0?"undefined":JSON.stringify(U)};class fw extends Aw{static runTools($,U,w){let J=new fw,z={...w,headers:{...w?.headers,"X-Stainless-Helper-Method":"runTools"}};return J._run(()=>J._runTools($,U,J,z)),J}_addMessage($,U=!0){if(super._addMessage($,U),c6($)&&$.content)this._emit("content",$.content)}}var g$={STR:1,NUM:2,ARR:4,OBJ:8,NULL:16,BOOL:32,NAN:64,INFINITY:128,MINUS_INFINITY:256,INF:384,SPECIAL:496,ATOM:499,COLLECTION:12,ALL:511};class FQ extends Error{}class vQ extends Error{}function bH($,U=g$.ALL){if(typeof $!=="string")throw TypeError(`expecting str, got ${typeof $}`);if(!$.trim())throw Error(`${$} is empty`);return EH($.trim(),U)}var EH=($,U)=>{let w=$.length,J=0,z=(V)=>{throw new FQ(`${V} at position ${J}`)},G=(V)=>{throw new vQ(`${V} at position ${J}`)},X=()=>{if(Q(),J>=w)z("Unexpected end of input");if($[J]==='"')return _();if($[J]==="{")return N();if($[J]==="[")return W();if($.substring(J,J+4)==="null"||g$.NULL&U&&w-J<4&&"null".startsWith($.substring(J)))return J+=4,null;if($.substring(J,J+4)==="true"||g$.BOOL&U&&w-J<4&&"true".startsWith($.substring(J)))return J+=4,!0;if($.substring(J,J+5)==="false"||g$.BOOL&U&&w-J<5&&"false".startsWith($.substring(J)))return J+=5,!1;if($.substring(J,J+8)==="Infinity"||g$.INFINITY&U&&w-J<8&&"Infinity".startsWith($.substring(J)))return J+=8,1/0;if($.substring(J,J+9)==="-Infinity"||g$.MINUS_INFINITY&U&&1<w-J&&w-J<9&&"-Infinity".startsWith($.substring(J)))return J+=9,-1/0;if($.substring(J,J+3)==="NaN"||g$.NAN&U&&w-J<3&&"NaN".startsWith($.substring(J)))return J+=3,NaN;return Y()},_=()=>{let V=J,g=!1;J++;while(J<w&&($[J]!=='"'||g&&$[J-1]==="\\"))g=$[J]==="\\"?!g:!1,J++;if($.charAt(J)=='"')try{return JSON.parse($.substring(V,++J-Number(g)))}catch(H){G(String(H))}else if(g$.STR&U)try{return JSON.parse($.substring(V,J-Number(g))+'"')}catch(H){return JSON.parse($.substring(V,$.lastIndexOf("\\"))+'"')}z("Unterminated string literal")},N=()=>{J++,Q();let V={};try{while($[J]!=="}"){if(Q(),J>=w&&g$.OBJ&U)return V;let g=_();Q(),J++;try{let H=X();Object.defineProperty(V,g,{value:H,writable:!0,enumerable:!0,configurable:!0})}catch(H){if(g$.OBJ&U)return V;else throw H}if(Q(),$[J]===",")J++}}catch(g){if(g$.OBJ&U)return V;else z("Expected '}' at end of object")}return J++,V},W=()=>{J++;let V=[];try{while($[J]!=="]")if(V.push(X()),Q(),$[J]===",")J++}catch(g){if(g$.ARR&U)return V;z("Expected ']' at end of array")}return J++,V},Y=()=>{if(J===0){if($==="-"&&g$.NUM&U)z("Not sure what '-' is");try{return JSON.parse($)}catch(g){if(g$.NUM&U)try{if($[$.length-1]===".")return JSON.parse($.substring(0,$.lastIndexOf(".")));return JSON.parse($.substring(0,$.lastIndexOf("e")))}catch(H){}G(String(g))}}let V=J;if($[J]==="-")J++;while($[J]&&!",]}".includes($[J]))J++;if(J==w&&!(g$.NUM&U))z("Unterminated number literal");try{return JSON.parse($.substring(V,J))}catch(g){if($.substring(V,J)==="-"&&g$.NUM&U)z("Not sure what '-' is");try{return JSON.parse($.substring(V,$.lastIndexOf("e")))}catch(H){G(String(H))}}},Q=()=>{while(J<w&&`
|
|
175
|
-
\r `.includes($[
|
|
176
|
-
${
|
|
177
|
-
${
|
|
178
|
-
${
|
|
179
|
-
${Wz($)}`);return{...k,id:x,type:u,function:{...O$,name:l,arguments:o}}})}};return{...g,message:{...M,content:H,role:T,refusal:W.refusal??null},finish_reason:Y,index:Q,logprobs:V}}),created:z,model:G,object:"chat.completion",...X?{system_fingerprint:X}:{}};return HQ(N,U)}function Wz($){return JSON.stringify($)}function SQ($){return}function bQ($){}class d6 extends b4{static fromReadableStream($){let U=new d6(null);return U._run(()=>U._fromReadableStream($)),U}static runTools($,U,w){let J=new d6(U),z={...w,headers:{...w?.headers,"X-Stainless-Helper-Method":"runTools"}};return J._run(()=>J._runTools($,U,J,z)),J}}class E4 extends I{constructor(){super(...arguments);this.messages=new m6(this._client)}create($,U){return this._client.post("/chat/completions",{body:$,...U,stream:$.stream??!1,__security:{bearerAuth:!0}})}retrieve($,U){return this._client.get(B`/chat/completions/${$}`,{...U,__security:{bearerAuth:!0}})}update($,U,w){return this._client.post(B`/chat/completions/${$}`,{body:U,...w,__security:{bearerAuth:!0}})}list($={},U){return this._client.getAPIList("/chat/completions",h,{query:$,...U,__security:{bearerAuth:!0}})}delete($,U){return this._client.delete(B`/chat/completions/${$}`,{...U,__security:{bearerAuth:!0}})}parse($,U){return LQ($.tools),this._client.chat.completions.create($,{...U,headers:{...U?.headers,"X-Stainless-Helper-Method":"chat.completions.parse"}})._thenUnwrap((w)=>vw(w,$))}runTools($,U){if($.stream)return d6.runTools(this._client,$,U);return fw.runTools(this._client,$,U)}stream($,U){return b4.createChatCompletion(this._client,$,U)}}E4.Messages=m6;class J6 extends I{constructor(){super(...arguments);this.completions=new E4(this._client)}}J6.Completions=E4;class Rw extends I{create($,U){return this._client.post("/organization/admin_api_keys",{body:$,...U,__security:{adminAPIKeyAuth:!0}})}retrieve($,U){return this._client.get(B`/organization/admin_api_keys/${$}`,{...U,__security:{adminAPIKeyAuth:!0}})}list($={},U){return this._client.getAPIList("/organization/admin_api_keys",h,{query:$,...U,__security:{adminAPIKeyAuth:!0}})}delete($,U){return this._client.delete(B`/organization/admin_api_keys/${$}`,{...U,__security:{adminAPIKeyAuth:!0}})}}class kw extends I{list($={},U){return this._client.getAPIList("/organization/audit_logs",n,{query:$,...U,__security:{adminAPIKeyAuth:!0}})}}class jw extends I{create($,U){return this._client.post("/organization/certificates",{body:$,...U,__security:{adminAPIKeyAuth:!0}})}retrieve($,U={},w){return this._client.get(B`/organization/certificates/${$}`,{query:U,...w,__security:{adminAPIKeyAuth:!0}})}update($,U,w){return this._client.post(B`/organization/certificates/${$}`,{body:U,...w,__security:{adminAPIKeyAuth:!0}})}list($={},U){return this._client.getAPIList("/organization/certificates",n,{query:$,...U,__security:{adminAPIKeyAuth:!0}})}delete($,U){return this._client.delete(B`/organization/certificates/${$}`,{...U,__security:{adminAPIKeyAuth:!0}})}activate($,U){return this._client.getAPIList("/organization/certificates/activate",T$,{body:$,method:"post",...U,__security:{adminAPIKeyAuth:!0}})}deactivate($,U){return this._client.getAPIList("/organization/certificates/deactivate",T$,{body:$,method:"post",...U,__security:{adminAPIKeyAuth:!0}})}}class uw extends I{retrieve($){return this._client.get("/organization/data_retention",{...$,__security:{adminAPIKeyAuth:!0}})}update($,U){return this._client.post("/organization/data_retention",{body:$,...U,__security:{adminAPIKeyAuth:!0}})}}class Cw extends I{create($,U){return this._client.post("/organization/invites",{body:$,...U,__security:{adminAPIKeyAuth:!0}})}retrieve($,U){return this._client.get(B`/organization/invites/${$}`,{...U,__security:{adminAPIKeyAuth:!0}})}list($={},U){return this._client.getAPIList("/organization/invites",n,{query:$,...U,__security:{adminAPIKeyAuth:!0}})}delete($,U){return this._client.delete(B`/organization/invites/${$}`,{...U,__security:{adminAPIKeyAuth:!0}})}}class xw extends I{create($,U){return this._client.post("/organization/roles",{body:$,...U,__security:{adminAPIKeyAuth:!0}})}retrieve($,U){return this._client.get(B`/organization/roles/${$}`,{...U,__security:{adminAPIKeyAuth:!0}})}update($,U,w){return this._client.post(B`/organization/roles/${$}`,{body:U,...w,__security:{adminAPIKeyAuth:!0}})}list($={},U){return this._client.getAPIList("/organization/roles",Y$,{query:$,...U,__security:{adminAPIKeyAuth:!0}})}delete($,U){return this._client.delete(B`/organization/roles/${$}`,{...U,__security:{adminAPIKeyAuth:!0}})}}class yw extends I{create($,U){return this._client.post("/organization/spend_alerts",{body:$,...U,__security:{adminAPIKeyAuth:!0}})}retrieve($,U){return this._client.get(B`/organization/spend_alerts/${$}`,{...U,__security:{adminAPIKeyAuth:!0}})}update($,U,w){return this._client.post(B`/organization/spend_alerts/${$}`,{body:U,...w,__security:{adminAPIKeyAuth:!0}})}list($={},U){return this._client.getAPIList("/organization/spend_alerts",n,{query:$,...U,__security:{adminAPIKeyAuth:!0}})}delete($,U){return this._client.delete(B`/organization/spend_alerts/${$}`,{...U,__security:{adminAPIKeyAuth:!0}})}}class iw extends I{audioSpeeches($,U){return this._client.get("/organization/usage/audio_speeches",{query:$,...U,__security:{adminAPIKeyAuth:!0}})}audioTranscriptions($,U){return this._client.get("/organization/usage/audio_transcriptions",{query:$,...U,__security:{adminAPIKeyAuth:!0}})}codeInterpreterSessions($,U){return this._client.get("/organization/usage/code_interpreter_sessions",{query:$,...U,__security:{adminAPIKeyAuth:!0}})}completions($,U){return this._client.get("/organization/usage/completions",{query:$,...U,__security:{adminAPIKeyAuth:!0}})}costs($,U){return this._client.get("/organization/costs",{query:$,...U,__security:{adminAPIKeyAuth:!0}})}embeddings($,U){return this._client.get("/organization/usage/embeddings",{query:$,...U,__security:{adminAPIKeyAuth:!0}})}fileSearchCalls($,U){return this._client.get("/organization/usage/file_search_calls",{query:$,...U,__security:{adminAPIKeyAuth:!0}})}images($,U){return this._client.get("/organization/usage/images",{query:$,...U,__security:{adminAPIKeyAuth:!0}})}moderations($,U){return this._client.get("/organization/usage/moderations",{query:$,...U,__security:{adminAPIKeyAuth:!0}})}vectorStores($,U){return this._client.get("/organization/usage/vector_stores",{query:$,...U,__security:{adminAPIKeyAuth:!0}})}webSearchCalls($,U){return this._client.get("/organization/usage/web_search_calls",{query:$,...U,__security:{adminAPIKeyAuth:!0}})}}class hw extends I{create($,U,w){return this._client.post(B`/organization/groups/${$}/roles`,{body:U,...w,__security:{adminAPIKeyAuth:!0}})}retrieve($,U,w){let{group_id:J}=U;return this._client.get(B`/organization/groups/${J}/roles/${$}`,{...w,__security:{adminAPIKeyAuth:!0}})}list($,U={},w){return this._client.getAPIList(B`/organization/groups/${$}/roles`,Y$,{query:U,...w,__security:{adminAPIKeyAuth:!0}})}delete($,U,w){let{group_id:J}=U;return this._client.delete(B`/organization/groups/${J}/roles/${$}`,{...w,__security:{adminAPIKeyAuth:!0}})}}class mw extends I{create($,U,w){return this._client.post(B`/organization/groups/${$}/users`,{body:U,...w,__security:{adminAPIKeyAuth:!0}})}retrieve($,U,w){let{group_id:J}=U;return this._client.get(B`/organization/groups/${J}/users/${$}`,{...w,__security:{adminAPIKeyAuth:!0}})}list($,U={},w){return this._client.getAPIList(B`/organization/groups/${$}/users`,Y$,{query:U,...w,__security:{adminAPIKeyAuth:!0}})}delete($,U,w){let{group_id:J}=U;return this._client.delete(B`/organization/groups/${J}/users/${$}`,{...w,__security:{adminAPIKeyAuth:!0}})}}class G6 extends I{constructor(){super(...arguments);this.users=new mw(this._client),this.roles=new hw(this._client)}create($,U){return this._client.post("/organization/groups",{body:$,...U,__security:{adminAPIKeyAuth:!0}})}retrieve($,U){return this._client.get(B`/organization/groups/${$}`,{...U,__security:{adminAPIKeyAuth:!0}})}update($,U,w){return this._client.post(B`/organization/groups/${$}`,{body:U,...w,__security:{adminAPIKeyAuth:!0}})}list($={},U){return this._client.getAPIList("/organization/groups",Y$,{query:$,...U,__security:{adminAPIKeyAuth:!0}})}delete($,U){return this._client.delete(B`/organization/groups/${$}`,{...U,__security:{adminAPIKeyAuth:!0}})}}G6.Users=mw;G6.Roles=hw;class cw extends I{retrieve($,U,w){let{project_id:J}=U;return this._client.get(B`/organization/projects/${J}/api_keys/${$}`,{...w,__security:{adminAPIKeyAuth:!0}})}list($,U={},w){return this._client.getAPIList(B`/organization/projects/${$}/api_keys`,n,{query:U,...w,__security:{adminAPIKeyAuth:!0}})}delete($,U,w){let{project_id:J}=U;return this._client.delete(B`/organization/projects/${J}/api_keys/${$}`,{...w,__security:{adminAPIKeyAuth:!0}})}}class rw extends I{list($,U={},w){return this._client.getAPIList(B`/organization/projects/${$}/certificates`,n,{query:U,...w,__security:{adminAPIKeyAuth:!0}})}activate($,U,w){return this._client.getAPIList(B`/organization/projects/${$}/certificates/activate`,T$,{body:U,method:"post",...w,__security:{adminAPIKeyAuth:!0}})}deactivate($,U,w){return this._client.getAPIList(B`/organization/projects/${$}/certificates/deactivate`,T$,{body:U,method:"post",...w,__security:{adminAPIKeyAuth:!0}})}}class lw extends I{retrieve($,U){return this._client.get(B`/organization/projects/${$}/data_retention`,{...U,__security:{adminAPIKeyAuth:!0}})}update($,U,w){return this._client.post(B`/organization/projects/${$}/data_retention`,{body:U,...w,__security:{adminAPIKeyAuth:!0}})}}class dw extends I{retrieve($,U){return this._client.get(B`/organization/projects/${$}/hosted_tool_permissions`,{...U,__security:{adminAPIKeyAuth:!0}})}update($,U,w){return this._client.post(B`/organization/projects/${$}/hosted_tool_permissions`,{body:U,...w,__security:{adminAPIKeyAuth:!0}})}}class nw extends I{retrieve($,U){return this._client.get(B`/organization/projects/${$}/model_permissions`,{...U,__security:{adminAPIKeyAuth:!0}})}update($,U,w){return this._client.post(B`/organization/projects/${$}/model_permissions`,{body:U,...w,__security:{adminAPIKeyAuth:!0}})}delete($,U){return this._client.delete(B`/organization/projects/${$}/model_permissions`,{...U,__security:{adminAPIKeyAuth:!0}})}}class pw extends I{listRateLimits($,U={},w){return this._client.getAPIList(B`/organization/projects/${$}/rate_limits`,n,{query:U,...w,__security:{adminAPIKeyAuth:!0}})}updateRateLimit($,U,w){let{project_id:J,...z}=U;return this._client.post(B`/organization/projects/${J}/rate_limits/${$}`,{body:z,...w,__security:{adminAPIKeyAuth:!0}})}}class tw extends I{create($,U,w){return this._client.post(B`/projects/${$}/roles`,{body:U,...w,__security:{adminAPIKeyAuth:!0}})}retrieve($,U,w){let{project_id:J}=U;return this._client.get(B`/projects/${J}/roles/${$}`,{...w,__security:{adminAPIKeyAuth:!0}})}update($,U,w){let{project_id:J,...z}=U;return this._client.post(B`/projects/${J}/roles/${$}`,{body:z,...w,__security:{adminAPIKeyAuth:!0}})}list($,U={},w){return this._client.getAPIList(B`/projects/${$}/roles`,Y$,{query:U,...w,__security:{adminAPIKeyAuth:!0}})}delete($,U,w){let{project_id:J}=U;return this._client.delete(B`/projects/${J}/roles/${$}`,{...w,__security:{adminAPIKeyAuth:!0}})}}class aw extends I{create($,U,w){return this._client.post(B`/organization/projects/${$}/service_accounts`,{body:U,...w,__security:{adminAPIKeyAuth:!0}})}retrieve($,U,w){let{project_id:J}=U;return this._client.get(B`/organization/projects/${J}/service_accounts/${$}`,{...w,__security:{adminAPIKeyAuth:!0}})}update($,U,w){let{project_id:J,...z}=U;return this._client.post(B`/organization/projects/${J}/service_accounts/${$}`,{body:z,...w,__security:{adminAPIKeyAuth:!0}})}list($,U={},w){return this._client.getAPIList(B`/organization/projects/${$}/service_accounts`,n,{query:U,...w,__security:{adminAPIKeyAuth:!0}})}delete($,U,w){let{project_id:J}=U;return this._client.delete(B`/organization/projects/${J}/service_accounts/${$}`,{...w,__security:{adminAPIKeyAuth:!0}})}}class ow extends I{create($,U,w){return this._client.post(B`/organization/projects/${$}/spend_alerts`,{body:U,...w,__security:{adminAPIKeyAuth:!0}})}retrieve($,U,w){let{project_id:J}=U;return this._client.get(B`/organization/projects/${J}/spend_alerts/${$}`,{...w,__security:{adminAPIKeyAuth:!0}})}update($,U,w){let{project_id:J,...z}=U;return this._client.post(B`/organization/projects/${J}/spend_alerts/${$}`,{body:z,...w,__security:{adminAPIKeyAuth:!0}})}list($,U={},w){return this._client.getAPIList(B`/organization/projects/${$}/spend_alerts`,n,{query:U,...w,__security:{adminAPIKeyAuth:!0}})}delete($,U,w){let{project_id:J}=U;return this._client.delete(B`/organization/projects/${J}/spend_alerts/${$}`,{...w,__security:{adminAPIKeyAuth:!0}})}}class ew extends I{create($,U,w){let{project_id:J,...z}=U;return this._client.post(B`/projects/${J}/groups/${$}/roles`,{body:z,...w,__security:{adminAPIKeyAuth:!0}})}retrieve($,U,w){let{project_id:J,group_id:z}=U;return this._client.get(B`/projects/${J}/groups/${z}/roles/${$}`,{...w,__security:{adminAPIKeyAuth:!0}})}list($,U,w){let{project_id:J,...z}=U;return this._client.getAPIList(B`/projects/${J}/groups/${$}/roles`,Y$,{query:z,...w,__security:{adminAPIKeyAuth:!0}})}delete($,U,w){let{project_id:J,group_id:z}=U;return this._client.delete(B`/projects/${J}/groups/${z}/roles/${$}`,{...w,__security:{adminAPIKeyAuth:!0}})}}class n6 extends I{constructor(){super(...arguments);this.roles=new ew(this._client)}create($,U,w){return this._client.post(B`/organization/projects/${$}/groups`,{body:U,...w,__security:{adminAPIKeyAuth:!0}})}retrieve($,U,w){let{project_id:J,...z}=U;return this._client.get(B`/organization/projects/${J}/groups/${$}`,{query:z,...w,__security:{adminAPIKeyAuth:!0}})}list($,U={},w){return this._client.getAPIList(B`/organization/projects/${$}/groups`,Y$,{query:U,...w,__security:{adminAPIKeyAuth:!0}})}delete($,U,w){let{project_id:J}=U;return this._client.delete(B`/organization/projects/${J}/groups/${$}`,{...w,__security:{adminAPIKeyAuth:!0}})}}n6.Roles=ew;class sw extends I{create($,U,w){let{project_id:J,...z}=U;return this._client.post(B`/projects/${J}/users/${$}/roles`,{body:z,...w,__security:{adminAPIKeyAuth:!0}})}retrieve($,U,w){let{project_id:J,user_id:z}=U;return this._client.get(B`/projects/${J}/users/${z}/roles/${$}`,{...w,__security:{adminAPIKeyAuth:!0}})}list($,U,w){let{project_id:J,...z}=U;return this._client.getAPIList(B`/projects/${J}/users/${$}/roles`,Y$,{query:z,...w,__security:{adminAPIKeyAuth:!0}})}delete($,U,w){let{project_id:J,user_id:z}=U;return this._client.delete(B`/projects/${J}/users/${z}/roles/${$}`,{...w,__security:{adminAPIKeyAuth:!0}})}}class p6 extends I{constructor(){super(...arguments);this.roles=new sw(this._client)}create($,U,w){return this._client.post(B`/organization/projects/${$}/users`,{body:U,...w,__security:{adminAPIKeyAuth:!0}})}retrieve($,U,w){let{project_id:J}=U;return this._client.get(B`/organization/projects/${J}/users/${$}`,{...w,__security:{adminAPIKeyAuth:!0}})}update($,U,w){let{project_id:J,...z}=U;return this._client.post(B`/organization/projects/${J}/users/${$}`,{body:z,...w,__security:{adminAPIKeyAuth:!0}})}list($,U={},w){return this._client.getAPIList(B`/organization/projects/${$}/users`,n,{query:U,...w,__security:{adminAPIKeyAuth:!0}})}delete($,U,w){let{project_id:J}=U;return this._client.delete(B`/organization/projects/${J}/users/${$}`,{...w,__security:{adminAPIKeyAuth:!0}})}}p6.Roles=sw;class K$ extends I{constructor(){super(...arguments);this.users=new p6(this._client),this.serviceAccounts=new aw(this._client),this.apiKeys=new cw(this._client),this.rateLimits=new pw(this._client),this.modelPermissions=new nw(this._client),this.hostedToolPermissions=new dw(this._client),this.groups=new n6(this._client),this.roles=new tw(this._client),this.dataRetention=new lw(this._client),this.spendAlerts=new ow(this._client),this.certificates=new rw(this._client)}create($,U){return this._client.post("/organization/projects",{body:$,...U,__security:{adminAPIKeyAuth:!0}})}retrieve($,U){return this._client.get(B`/organization/projects/${$}`,{...U,__security:{adminAPIKeyAuth:!0}})}update($,U,w){return this._client.post(B`/organization/projects/${$}`,{body:U,...w,__security:{adminAPIKeyAuth:!0}})}list($={},U){return this._client.getAPIList("/organization/projects",n,{query:$,...U,__security:{adminAPIKeyAuth:!0}})}archive($,U){return this._client.post(B`/organization/projects/${$}/archive`,{...U,__security:{adminAPIKeyAuth:!0}})}}K$.Users=p6;K$.ServiceAccounts=aw;K$.APIKeys=cw;K$.RateLimits=pw;K$.ModelPermissions=nw;K$.HostedToolPermissions=dw;K$.Groups=n6;K$.Roles=tw;K$.DataRetention=lw;K$.SpendAlerts=ow;K$.Certificates=rw;class $1 extends I{create($,U,w){return this._client.post(B`/organization/users/${$}/roles`,{body:U,...w,__security:{adminAPIKeyAuth:!0}})}retrieve($,U,w){let{user_id:J}=U;return this._client.get(B`/organization/users/${J}/roles/${$}`,{...w,__security:{adminAPIKeyAuth:!0}})}list($,U={},w){return this._client.getAPIList(B`/organization/users/${$}/roles`,Y$,{query:U,...w,__security:{adminAPIKeyAuth:!0}})}delete($,U,w){let{user_id:J}=U;return this._client.delete(B`/organization/users/${J}/roles/${$}`,{...w,__security:{adminAPIKeyAuth:!0}})}}class t6 extends I{constructor(){super(...arguments);this.roles=new $1(this._client)}retrieve($,U){return this._client.get(B`/organization/users/${$}`,{...U,__security:{adminAPIKeyAuth:!0}})}update($,U,w){return this._client.post(B`/organization/users/${$}`,{body:U,...w,__security:{adminAPIKeyAuth:!0}})}list($={},U){return this._client.getAPIList("/organization/users",n,{query:$,...U,__security:{adminAPIKeyAuth:!0}})}delete($,U){return this._client.delete(B`/organization/users/${$}`,{...U,__security:{adminAPIKeyAuth:!0}})}}t6.Roles=$1;class L$ extends I{constructor(){super(...arguments);this.auditLogs=new kw(this._client),this.adminAPIKeys=new Rw(this._client),this.usage=new iw(this._client),this.invites=new Cw(this._client),this.users=new t6(this._client),this.groups=new G6(this._client),this.roles=new xw(this._client),this.dataRetention=new uw(this._client),this.spendAlerts=new yw(this._client),this.certificates=new jw(this._client),this.projects=new K$(this._client)}}L$.AuditLogs=kw;L$.AdminAPIKeys=Rw;L$.Usage=iw;L$.Invites=Cw;L$.Users=t6;L$.Groups=G6;L$.Roles=xw;L$.DataRetention=uw;L$.SpendAlerts=yw;L$.Certificates=jw;L$.Projects=K$;class X6 extends I{constructor(){super(...arguments);this.organization=new L$(this._client)}}X6.Organization=L$;var EQ=Symbol("brand.privateNullableHeaders");function*_I($){if(!$)return;if(EQ in $){let{values:J,nulls:z}=$;yield*J.entries();for(let G of z)yield[G,null];return}let U=!1,w;if($ instanceof Headers)w=$.entries();else if(XG($))w=$;else U=!0,w=Object.entries($??{});for(let J of w){let z=J[0];if(typeof z!=="string")throw TypeError("expected header name to be a string");let G=XG(J[1])?J[1]:[J[1]],X=!1;for(let _ of G){if(_===void 0)continue;if(U&&!X)X=!0,yield[z,null];yield[z,_]}}}var F=($)=>{let U=new Headers,w=new Set;for(let J of $){let z=new Set;for(let[G,X]of _I(J)){let _=G.toLowerCase();if(!z.has(_))U.delete(G),z.add(_);if(X===null)U.delete(G),w.add(_);else U.append(G,X),w.delete(_)}}return{[EQ]:!0,values:U,nulls:w}};class U1 extends I{create($,U){return this._client.post("/audio/speech",{body:$,...U,headers:F([{Accept:"application/octet-stream"},U?.headers]),__security:{bearerAuth:!0},__binaryResponse:!0})}}class w1 extends I{create($,U){return this._client.post("/audio/transcriptions",I$({body:$,...U,stream:$.stream??!1,__metadata:{model:$.model},__security:{bearerAuth:!0}},this._client))}}class z1 extends I{create($,U){return this._client.post("/audio/translations",I$({body:$,...U,__metadata:{model:$.model},__security:{bearerAuth:!0}},this._client))}}class I4 extends I{constructor(){super(...arguments);this.transcriptions=new w1(this._client),this.translations=new z1(this._client),this.speech=new U1(this._client)}}I4.Transcriptions=w1;I4.Translations=z1;I4.Speech=U1;class a6 extends I{create($,U){return this._client.post("/batches",{body:$,...U,__security:{bearerAuth:!0}})}retrieve($,U){return this._client.get(B`/batches/${$}`,{...U,__security:{bearerAuth:!0}})}list($={},U){return this._client.getAPIList("/batches",h,{query:$,...U,__security:{bearerAuth:!0}})}cancel($,U){return this._client.post(B`/batches/${$}/cancel`,{...U,__security:{bearerAuth:!0}})}}class J1 extends I{create($,U){return this._client.post("/assistants",{body:$,...U,headers:F([{"OpenAI-Beta":"assistants=v2"},U?.headers]),__security:{bearerAuth:!0}})}retrieve($,U){return this._client.get(B`/assistants/${$}`,{...U,headers:F([{"OpenAI-Beta":"assistants=v2"},U?.headers]),__security:{bearerAuth:!0}})}update($,U,w){return this._client.post(B`/assistants/${$}`,{body:U,...w,headers:F([{"OpenAI-Beta":"assistants=v2"},w?.headers]),__security:{bearerAuth:!0}})}list($={},U){return this._client.getAPIList("/assistants",h,{query:$,...U,headers:F([{"OpenAI-Beta":"assistants=v2"},U?.headers]),__security:{bearerAuth:!0}})}delete($,U){return this._client.delete(B`/assistants/${$}`,{...U,headers:F([{"OpenAI-Beta":"assistants=v2"},U?.headers]),__security:{bearerAuth:!0}})}}class G1 extends I{create($,U){return this._client.post("/realtime/sessions",{body:$,...U,headers:F([{"OpenAI-Beta":"assistants=v2"},U?.headers]),__security:{bearerAuth:!0}})}}class X1 extends I{create($,U){return this._client.post("/realtime/transcription_sessions",{body:$,...U,headers:F([{"OpenAI-Beta":"assistants=v2"},U?.headers]),__security:{bearerAuth:!0}})}}class _6 extends I{constructor(){super(...arguments);this.sessions=new G1(this._client),this.transcriptionSessions=new X1(this._client)}}_6.Sessions=G1;_6.TranscriptionSessions=X1;class _1 extends I{create($,U){return this._client.post("/chatkit/sessions",{body:$,...U,headers:F([{"OpenAI-Beta":"chatkit_beta=v1"},U?.headers]),__security:{bearerAuth:!0}})}cancel($,U){return this._client.post(B`/chatkit/sessions/${$}/cancel`,{...U,headers:F([{"OpenAI-Beta":"chatkit_beta=v1"},U?.headers]),__security:{bearerAuth:!0}})}}class N1 extends I{retrieve($,U){return this._client.get(B`/chatkit/threads/${$}`,{...U,headers:F([{"OpenAI-Beta":"chatkit_beta=v1"},U?.headers]),__security:{bearerAuth:!0}})}list($={},U){return this._client.getAPIList("/chatkit/threads",n,{query:$,...U,headers:F([{"OpenAI-Beta":"chatkit_beta=v1"},U?.headers]),__security:{bearerAuth:!0}})}delete($,U){return this._client.delete(B`/chatkit/threads/${$}`,{...U,headers:F([{"OpenAI-Beta":"chatkit_beta=v1"},U?.headers]),__security:{bearerAuth:!0}})}listItems($,U={},w){return this._client.getAPIList(B`/chatkit/threads/${$}/items`,n,{query:U,...w,headers:F([{"OpenAI-Beta":"chatkit_beta=v1"},w?.headers]),__security:{bearerAuth:!0}})}}class N6 extends I{constructor(){super(...arguments);this.sessions=new _1(this._client),this.threads=new N1(this._client)}}N6.Sessions=_1;N6.Threads=N1;class W1 extends I{create($,U,w){return this._client.post(B`/threads/${$}/messages`,{body:U,...w,headers:F([{"OpenAI-Beta":"assistants=v2"},w?.headers]),__security:{bearerAuth:!0}})}retrieve($,U,w){let{thread_id:J}=U;return this._client.get(B`/threads/${J}/messages/${$}`,{...w,headers:F([{"OpenAI-Beta":"assistants=v2"},w?.headers]),__security:{bearerAuth:!0}})}update($,U,w){let{thread_id:J,...z}=U;return this._client.post(B`/threads/${J}/messages/${$}`,{body:z,...w,headers:F([{"OpenAI-Beta":"assistants=v2"},w?.headers]),__security:{bearerAuth:!0}})}list($,U={},w){return this._client.getAPIList(B`/threads/${$}/messages`,h,{query:U,...w,headers:F([{"OpenAI-Beta":"assistants=v2"},w?.headers]),__security:{bearerAuth:!0}})}delete($,U,w){let{thread_id:J}=U;return this._client.delete(B`/threads/${J}/messages/${$}`,{...w,headers:F([{"OpenAI-Beta":"assistants=v2"},w?.headers]),__security:{bearerAuth:!0}})}}class Y1 extends I{retrieve($,U,w){let{thread_id:J,run_id:z,...G}=U;return this._client.get(B`/threads/${J}/runs/${z}/steps/${$}`,{query:G,...w,headers:F([{"OpenAI-Beta":"assistants=v2"},w?.headers]),__security:{bearerAuth:!0}})}list($,U,w){let{thread_id:J,...z}=U;return this._client.getAPIList(B`/threads/${J}/runs/${$}/steps`,h,{query:z,...w,headers:F([{"OpenAI-Beta":"assistants=v2"},w?.headers]),__security:{bearerAuth:!0}})}}var AQ=($)=>{if(typeof Buffer<"u"){let U=Buffer.from($,"base64");return Array.from(new Float32Array(U.buffer,U.byteOffset,U.length/Float32Array.BYTES_PER_ELEMENT))}else{let U=atob($),w=U.length,J=new Uint8Array(w);for(let z=0;z<w;z++)J[z]=U.charCodeAt(z);return Array.from(new Float32Array(J.buffer))}};var d$=($)=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[$]?.trim()||void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.($)?.trim()||void 0;return};var B$,Y6,CG,$4,Yz,n$,Q6,o6,W6,gz,u$,Qz,Vz,g1,Q1,V1,fQ,RQ,kQ,jQ,uQ,CQ,xQ;class A4 extends z6{constructor(){super(...arguments);B$.add(this),CG.set(this,[]),$4.set(this,{}),Yz.set(this,{}),n$.set(this,void 0),Q6.set(this,void 0),o6.set(this,void 0),W6.set(this,void 0),gz.set(this,void 0),u$.set(this,void 0),Qz.set(this,void 0),Vz.set(this,void 0),g1.set(this,void 0)}[(CG=new WeakMap,$4=new WeakMap,Yz=new WeakMap,n$=new WeakMap,Q6=new WeakMap,o6=new WeakMap,W6=new WeakMap,gz=new WeakMap,u$=new WeakMap,Qz=new WeakMap,Vz=new WeakMap,g1=new WeakMap,B$=new WeakSet,Symbol.asyncIterator)](){let $=[],U=[],w=!1;return this.on("event",(J)=>{let z=U.shift();if(z)z.resolve(J);else $.push(J)}),this.on("end",()=>{w=!0;for(let J of U)J.resolve(void 0);U.length=0}),this.on("abort",(J)=>{w=!0;for(let z of U)z.reject(J);U.length=0}),this.on("error",(J)=>{w=!0;for(let z of U)z.reject(J);U.length=0}),{next:async()=>{if(!$.length){if(w)return{value:void 0,done:!0};return new Promise((z,G)=>U.push({resolve:z,reject:G})).then((z)=>z?{value:z,done:!1}:{value:void 0,done:!0})}return{value:$.shift(),done:!1}},return:async()=>{return this.abort(),{value:void 0,done:!0}}}}static fromReadableStream($){let U=new Y6;return U._run(()=>U._fromReadableStream($)),U}async _fromReadableStream($,U){this._listenForAbort(U?.signal),this._connected();let w=j$.fromReadableStream($,this.controller);for await(let J of w)L(this,B$,"m",Q1).call(this,J);if(w.controller.signal?.aborted)throw new N$;return this._addRun(L(this,B$,"m",V1).call(this))}toReadableStream(){return new j$(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}static createToolAssistantStream($,U,w,J){let z=new Y6;return z._run(()=>z._runToolAssistantStream($,U,w,{...J,headers:{...J?.headers,"X-Stainless-Helper-Method":"stream"}})),z}async _createToolAssistantStream($,U,w,J){this._listenForAbort(J?.signal);let z={...w,stream:!0},G=await $.submitToolOutputs(U,z,{...J,signal:this.controller.signal});this._connected();for await(let X of G)L(this,B$,"m",Q1).call(this,X);if(G.controller.signal?.aborted)throw new N$;return this._addRun(L(this,B$,"m",V1).call(this))}static createThreadAssistantStream($,U,w){let J=new Y6;return J._run(()=>J._threadAssistantStream($,U,{...w,headers:{...w?.headers,"X-Stainless-Helper-Method":"stream"}})),J}static createAssistantStream($,U,w,J){let z=new Y6;return z._run(()=>z._runAssistantStream($,U,w,{...J,headers:{...J?.headers,"X-Stainless-Helper-Method":"stream"}})),z}currentEvent(){return L(this,Qz,"f")}currentRun(){return L(this,Vz,"f")}currentMessageSnapshot(){return L(this,n$,"f")}currentRunStepSnapshot(){return L(this,g1,"f")}async finalRunSteps(){return await this.done(),Object.values(L(this,$4,"f"))}async finalMessages(){return await this.done(),Object.values(L(this,Yz,"f"))}async finalRun(){if(await this.done(),!L(this,Q6,"f"))throw Error("Final run was not received.");return L(this,Q6,"f")}async _createThreadAssistantStream($,U,w){this._listenForAbort(w?.signal);let J={...U,stream:!0},z=await $.createAndRun(J,{...w,signal:this.controller.signal});this._connected();for await(let G of z)L(this,B$,"m",Q1).call(this,G);if(z.controller.signal?.aborted)throw new N$;return this._addRun(L(this,B$,"m",V1).call(this))}async _createAssistantStream($,U,w,J){this._listenForAbort(J?.signal);let z={...w,stream:!0},G=await $.create(U,z,{...J,signal:this.controller.signal});this._connected();for await(let X of G)L(this,B$,"m",Q1).call(this,X);if(G.controller.signal?.aborted)throw new N$;return this._addRun(L(this,B$,"m",V1).call(this))}static accumulateDelta($,U){for(let[w,J]of Object.entries(U)){if(!$.hasOwnProperty(w)){$[w]=J;continue}let z=$[w];if(z===null||z===void 0){$[w]=J;continue}if(w==="index"||w==="type"){$[w]=J;continue}if(typeof z==="string"&&typeof J==="string")z+=J;else if(typeof z==="number"&&typeof J==="number")z+=J;else if(Kw(z)&&Kw(J))z=this.accumulateDelta(z,J);else if(Array.isArray(z)&&Array.isArray(J)){if(z.every((G)=>typeof G==="string"||typeof G==="number")){z.push(...J);continue}for(let G of J){if(!Kw(G))throw Error(`Expected array delta entry to be an object but got: ${G}`);let X=G.index;if(X==null)throw console.error(G),Error("Expected array delta entry to have an `index` property");if(typeof X!=="number")throw Error(`Expected array delta entry \`index\` property to be a number but got ${X}`);let _=z[X];if(_==null)z.push(G);else z[X]=this.accumulateDelta(_,G)}continue}else throw Error(`Unhandled record type: ${w}, deltaValue: ${J}, accValue: ${z}`);$[w]=z}return $}_addRun($){return $}async _threadAssistantStream($,U,w){return await this._createThreadAssistantStream(U,$,w)}async _runAssistantStream($,U,w,J){return await this._createAssistantStream(U,$,w,J)}async _runToolAssistantStream($,U,w,J){return await this._createToolAssistantStream(U,$,w,J)}}Y6=A4,Q1=function(U){if(this.ended)return;switch(C(this,Qz,U,"f"),L(this,B$,"m",kQ).call(this,U),U.event){case"thread.created":break;case"thread.run.created":case"thread.run.queued":case"thread.run.in_progress":case"thread.run.requires_action":case"thread.run.completed":case"thread.run.incomplete":case"thread.run.failed":case"thread.run.cancelling":case"thread.run.cancelled":case"thread.run.expired":L(this,B$,"m",xQ).call(this,U);break;case"thread.run.step.created":case"thread.run.step.in_progress":case"thread.run.step.delta":case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":L(this,B$,"m",RQ).call(this,U);break;case"thread.message.created":case"thread.message.in_progress":case"thread.message.delta":case"thread.message.completed":case"thread.message.incomplete":L(this,B$,"m",fQ).call(this,U);break;case"error":throw Error("Encountered an error event in event processing - errors should be processed earlier");default:PI(U)}},V1=function(){if(this.ended)throw new A("stream has ended, this shouldn't happen");if(!L(this,Q6,"f"))throw Error("Final run has not been received");return L(this,Q6,"f")},fQ=function(U){let[w,J]=L(this,B$,"m",uQ).call(this,U,L(this,n$,"f"));C(this,n$,w,"f"),L(this,Yz,"f")[w.id]=w;for(let z of J){let G=w.content[z.index];if(G?.type=="text")this._emit("textCreated",G.text)}switch(U.event){case"thread.message.created":this._emit("messageCreated",U.data);break;case"thread.message.in_progress":break;case"thread.message.delta":if(this._emit("messageDelta",U.data.delta,w),U.data.delta.content)for(let z of U.data.delta.content){if(z.type=="text"&&z.text){let G=z.text,X=w.content[z.index];if(X&&X.type=="text")this._emit("textDelta",G,X.text);else throw Error("The snapshot associated with this text delta is not text or missing")}if(z.index!=L(this,o6,"f")){if(L(this,W6,"f"))switch(L(this,W6,"f").type){case"text":this._emit("textDone",L(this,W6,"f").text,L(this,n$,"f"));break;case"image_file":this._emit("imageFileDone",L(this,W6,"f").image_file,L(this,n$,"f"));break}C(this,o6,z.index,"f")}C(this,W6,w.content[z.index],"f")}break;case"thread.message.completed":case"thread.message.incomplete":if(L(this,o6,"f")!==void 0){let z=U.data.content[L(this,o6,"f")];if(z)switch(z.type){case"image_file":this._emit("imageFileDone",z.image_file,L(this,n$,"f"));break;case"text":this._emit("textDone",z.text,L(this,n$,"f"));break}}if(L(this,n$,"f"))this._emit("messageDone",U.data);C(this,n$,void 0,"f")}},RQ=function(U){let w=L(this,B$,"m",jQ).call(this,U);switch(C(this,g1,w,"f"),U.event){case"thread.run.step.created":this._emit("runStepCreated",U.data);break;case"thread.run.step.delta":let J=U.data.delta;if(J.step_details&&J.step_details.type=="tool_calls"&&J.step_details.tool_calls&&w.step_details.type=="tool_calls")for(let G of J.step_details.tool_calls)if(G.index==L(this,gz,"f"))this._emit("toolCallDelta",G,w.step_details.tool_calls[G.index]);else{if(L(this,u$,"f"))this._emit("toolCallDone",L(this,u$,"f"));if(C(this,gz,G.index,"f"),C(this,u$,w.step_details.tool_calls[G.index],"f"),L(this,u$,"f"))this._emit("toolCallCreated",L(this,u$,"f"))}this._emit("runStepDelta",U.data.delta,w);break;case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":if(C(this,g1,void 0,"f"),U.data.step_details.type=="tool_calls"){if(L(this,u$,"f"))this._emit("toolCallDone",L(this,u$,"f")),C(this,u$,void 0,"f")}this._emit("runStepDone",U.data,w);break;case"thread.run.step.in_progress":break}},kQ=function(U){L(this,CG,"f").push(U),this._emit("event",U)},jQ=function(U){switch(U.event){case"thread.run.step.created":return L(this,$4,"f")[U.data.id]=U.data,U.data;case"thread.run.step.delta":let w=L(this,$4,"f")[U.data.id];if(!w)throw Error("Received a RunStepDelta before creation of a snapshot");let J=U.data;if(J.delta){let z=Y6.accumulateDelta(w,J.delta);L(this,$4,"f")[U.data.id]=z}return L(this,$4,"f")[U.data.id];case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":case"thread.run.step.in_progress":L(this,$4,"f")[U.data.id]=U.data;break}if(L(this,$4,"f")[U.data.id])return L(this,$4,"f")[U.data.id];throw Error("No snapshot available")},uQ=function(U,w){let J=[];switch(U.event){case"thread.message.created":return[U.data,J];case"thread.message.delta":if(!w)throw Error("Received a delta with no existing snapshot (there should be one from message creation)");let z=U.data;if(z.delta.content)for(let G of z.delta.content)if(G.index in w.content){let X=w.content[G.index];w.content[G.index]=L(this,B$,"m",CQ).call(this,G,X)}else w.content[G.index]=G,J.push(G);return[w,J];case"thread.message.in_progress":case"thread.message.completed":case"thread.message.incomplete":if(w)return[w,J];else throw Error("Received thread message event with no existing snapshot")}throw Error("Tried to accumulate a non-message event")},CQ=function(U,w){return Y6.accumulateDelta(w,U)},xQ=function(U){switch(C(this,Vz,U.data,"f"),U.event){case"thread.run.created":break;case"thread.run.queued":break;case"thread.run.in_progress":break;case"thread.run.requires_action":case"thread.run.cancelled":case"thread.run.failed":case"thread.run.completed":case"thread.run.expired":case"thread.run.incomplete":if(C(this,Q6,U.data,"f"),L(this,u$,"f"))this._emit("toolCallDone",L(this,u$,"f")),C(this,u$,void 0,"f");break;case"thread.run.cancelling":break}};function PI($){}class e6 extends I{constructor(){super(...arguments);this.steps=new Y1(this._client)}create($,U,w){let{include:J,...z}=U;return this._client.post(B`/threads/${$}/runs`,{query:{include:J},body:z,...w,headers:F([{"OpenAI-Beta":"assistants=v2"},w?.headers]),stream:U.stream??!1,__synthesizeEventData:!0,__security:{bearerAuth:!0}})}retrieve($,U,w){let{thread_id:J}=U;return this._client.get(B`/threads/${J}/runs/${$}`,{...w,headers:F([{"OpenAI-Beta":"assistants=v2"},w?.headers]),__security:{bearerAuth:!0}})}update($,U,w){let{thread_id:J,...z}=U;return this._client.post(B`/threads/${J}/runs/${$}`,{body:z,...w,headers:F([{"OpenAI-Beta":"assistants=v2"},w?.headers]),__security:{bearerAuth:!0}})}list($,U={},w){return this._client.getAPIList(B`/threads/${$}/runs`,h,{query:U,...w,headers:F([{"OpenAI-Beta":"assistants=v2"},w?.headers]),__security:{bearerAuth:!0}})}cancel($,U,w){let{thread_id:J}=U;return this._client.post(B`/threads/${J}/runs/${$}/cancel`,{...w,headers:F([{"OpenAI-Beta":"assistants=v2"},w?.headers]),__security:{bearerAuth:!0}})}async createAndPoll($,U,w){let J=await this.create($,U,w);return await this.poll(J.id,{thread_id:$},w)}createAndStream($,U,w){return A4.createAssistantStream($,this._client.beta.threads.runs,U,w)}async poll($,U,w){let J=F([w?.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":w?.pollIntervalMs?.toString()??void 0}]);while(!0){let{data:z,response:G}=await this.retrieve($,U,{...w,headers:{...w?.headers,...J}}).withResponse();switch(z.status){case"queued":case"in_progress":case"cancelling":let X=5000;if(w?.pollIntervalMs)X=w.pollIntervalMs;else{let _=G.headers.get("openai-poll-after-ms");if(_){let N=parseInt(_);if(!isNaN(N))X=N}}await e$(X);break;case"requires_action":case"incomplete":case"cancelled":case"completed":case"failed":case"expired":return z}}}stream($,U,w){return A4.createAssistantStream($,this._client.beta.threads.runs,U,w)}submitToolOutputs($,U,w){let{thread_id:J,...z}=U;return this._client.post(B`/threads/${J}/runs/${$}/submit_tool_outputs`,{body:z,...w,headers:F([{"OpenAI-Beta":"assistants=v2"},w?.headers]),stream:U.stream??!1,__synthesizeEventData:!0,__security:{bearerAuth:!0}})}async submitToolOutputsAndPoll($,U,w){let J=await this.submitToolOutputs($,U,w);return await this.poll(J.id,U,w)}submitToolOutputsStream($,U,w){return A4.createToolAssistantStream($,this._client.beta.threads.runs,U,w)}}e6.Steps=Y1;class V6 extends I{constructor(){super(...arguments);this.runs=new e6(this._client),this.messages=new W1(this._client)}create($={},U){return this._client.post("/threads",{body:$,...U,headers:F([{"OpenAI-Beta":"assistants=v2"},U?.headers]),__security:{bearerAuth:!0}})}retrieve($,U){return this._client.get(B`/threads/${$}`,{...U,headers:F([{"OpenAI-Beta":"assistants=v2"},U?.headers]),__security:{bearerAuth:!0}})}update($,U,w){return this._client.post(B`/threads/${$}`,{body:U,...w,headers:F([{"OpenAI-Beta":"assistants=v2"},w?.headers]),__security:{bearerAuth:!0}})}delete($,U){return this._client.delete(B`/threads/${$}`,{...U,headers:F([{"OpenAI-Beta":"assistants=v2"},U?.headers]),__security:{bearerAuth:!0}})}createAndRun($,U){return this._client.post("/threads/runs",{body:$,...U,headers:F([{"OpenAI-Beta":"assistants=v2"},U?.headers]),stream:$.stream??!1,__synthesizeEventData:!0,__security:{bearerAuth:!0}})}async createAndRunPoll($,U){let w=await this.createAndRun($,U);return await this.runs.poll(w.id,{thread_id:w.thread_id},U)}createAndRunStream($,U){return A4.createThreadAssistantStream($,this._client.beta.threads,U)}}V6.Runs=e6;V6.Messages=W1;class U4 extends I{constructor(){super(...arguments);this.realtime=new _6(this._client),this.chatkit=new N6(this._client),this.assistants=new J1(this._client),this.threads=new V6(this._client)}}U4.Realtime=_6;U4.ChatKit=N6;U4.Assistants=J1;U4.Threads=V6;class s6 extends I{create($,U){return this._client.post("/completions",{body:$,...U,stream:$.stream??!1,__security:{bearerAuth:!0}})}}class B1 extends I{retrieve($,U,w){let{container_id:J}=U;return this._client.get(B`/containers/${J}/files/${$}/content`,{...w,headers:F([{Accept:"application/binary"},w?.headers]),__security:{bearerAuth:!0},__binaryResponse:!0})}}class $U extends I{constructor(){super(...arguments);this.content=new B1(this._client)}create($,U,w){return this._client.post(B`/containers/${$}/files`,M4({body:U,...w,__security:{bearerAuth:!0}},this._client))}retrieve($,U,w){let{container_id:J}=U;return this._client.get(B`/containers/${J}/files/${$}`,{...w,__security:{bearerAuth:!0}})}list($,U={},w){return this._client.getAPIList(B`/containers/${$}/files`,h,{query:U,...w,__security:{bearerAuth:!0}})}delete($,U,w){let{container_id:J}=U;return this._client.delete(B`/containers/${J}/files/${$}`,{...w,headers:F([{Accept:"*/*"},w?.headers]),__security:{bearerAuth:!0}})}}$U.Content=B1;class g6 extends I{constructor(){super(...arguments);this.files=new $U(this._client)}create($,U){return this._client.post("/containers",{body:$,...U,__security:{bearerAuth:!0}})}retrieve($,U){return this._client.get(B`/containers/${$}`,{...U,__security:{bearerAuth:!0}})}list($={},U){return this._client.getAPIList("/containers",h,{query:$,...U,__security:{bearerAuth:!0}})}delete($,U){return this._client.delete(B`/containers/${$}`,{...U,headers:F([{Accept:"*/*"},U?.headers]),__security:{bearerAuth:!0}})}}g6.Files=$U;class q1 extends I{create($,U,w){let{include:J,...z}=U;return this._client.post(B`/conversations/${$}/items`,{query:{include:J},body:z,...w,__security:{bearerAuth:!0}})}retrieve($,U,w){let{conversation_id:J,...z}=U;return this._client.get(B`/conversations/${J}/items/${$}`,{query:z,...w,__security:{bearerAuth:!0}})}list($,U={},w){return this._client.getAPIList(B`/conversations/${$}/items`,n,{query:U,...w,__security:{bearerAuth:!0}})}delete($,U,w){let{conversation_id:J}=U;return this._client.delete(B`/conversations/${J}/items/${$}`,{...w,__security:{bearerAuth:!0}})}}class B6 extends I{constructor(){super(...arguments);this.items=new q1(this._client)}create($={},U){return this._client.post("/conversations",{body:$,...U,__security:{bearerAuth:!0}})}retrieve($,U){return this._client.get(B`/conversations/${$}`,{...U,__security:{bearerAuth:!0}})}update($,U,w){return this._client.post(B`/conversations/${$}`,{body:U,...w,__security:{bearerAuth:!0}})}delete($,U){return this._client.delete(B`/conversations/${$}`,{...U,__security:{bearerAuth:!0}})}}B6.Items=q1;class UU extends I{create($,U){let w=!!$.encoding_format,J=w?$.encoding_format:"base64";if(w)X$(this._client).debug("embeddings/user defined encoding_format:",$.encoding_format);let z=this._client.post("/embeddings",{body:{...$,encoding_format:J},...U,__security:{bearerAuth:!0}});if(w)return z;return X$(this._client).debug("embeddings/decoding base64 embeddings from base64"),z._thenUnwrap((G)=>{if(G&&G.data)G.data.forEach((X)=>{let _=X.embedding;X.embedding=AQ(_)});return G})}}class H1 extends I{retrieve($,U,w){let{eval_id:J,run_id:z}=U;return this._client.get(B`/evals/${J}/runs/${z}/output_items/${$}`,{...w,__security:{bearerAuth:!0}})}list($,U,w){let{eval_id:J,...z}=U;return this._client.getAPIList(B`/evals/${J}/runs/${$}/output_items`,h,{query:z,...w,__security:{bearerAuth:!0}})}}class wU extends I{constructor(){super(...arguments);this.outputItems=new H1(this._client)}create($,U,w){return this._client.post(B`/evals/${$}/runs`,{body:U,...w,__security:{bearerAuth:!0}})}retrieve($,U,w){let{eval_id:J}=U;return this._client.get(B`/evals/${J}/runs/${$}`,{...w,__security:{bearerAuth:!0}})}list($,U={},w){return this._client.getAPIList(B`/evals/${$}/runs`,h,{query:U,...w,__security:{bearerAuth:!0}})}delete($,U,w){let{eval_id:J}=U;return this._client.delete(B`/evals/${J}/runs/${$}`,{...w,__security:{bearerAuth:!0}})}cancel($,U,w){let{eval_id:J}=U;return this._client.post(B`/evals/${J}/runs/${$}`,{...w,__security:{bearerAuth:!0}})}}wU.OutputItems=H1;class q6 extends I{constructor(){super(...arguments);this.runs=new wU(this._client)}create($,U){return this._client.post("/evals",{body:$,...U,__security:{bearerAuth:!0}})}retrieve($,U){return this._client.get(B`/evals/${$}`,{...U,__security:{bearerAuth:!0}})}update($,U,w){return this._client.post(B`/evals/${$}`,{body:U,...w,__security:{bearerAuth:!0}})}list($={},U){return this._client.getAPIList("/evals",h,{query:$,...U,__security:{bearerAuth:!0}})}delete($,U){return this._client.delete(B`/evals/${$}`,{...U,__security:{bearerAuth:!0}})}}q6.Runs=wU;class zU extends I{create($,U){return this._client.post("/files",I$({body:$,...U,__security:{bearerAuth:!0}},this._client))}retrieve($,U){return this._client.get(B`/files/${$}`,{...U,__security:{bearerAuth:!0}})}list($={},U){return this._client.getAPIList("/files",h,{query:$,...U,__security:{bearerAuth:!0}})}delete($,U){return this._client.delete(B`/files/${$}`,{...U,__security:{bearerAuth:!0}})}content($,U){return this._client.get(B`/files/${$}/content`,{...U,headers:F([{Accept:"application/binary"},U?.headers]),__security:{bearerAuth:!0},__binaryResponse:!0})}async waitForProcessing($,{pollInterval:U=5000,maxWait:w=1800000}={}){let J=new Set(["processed","error","deleted"]),z=Date.now(),G=await this.retrieve($);while(!G.status||!J.has(G.status))if(await e$(U),G=await this.retrieve($),Date.now()-z>w)throw new $6({message:`Giving up on waiting for file ${$} to finish processing after ${w} milliseconds.`});return G}}class I1 extends I{}class K1 extends I{run($,U){return this._client.post("/fine_tuning/alpha/graders/run",{body:$,...U,__security:{bearerAuth:!0}})}validate($,U){return this._client.post("/fine_tuning/alpha/graders/validate",{body:$,...U,__security:{bearerAuth:!0}})}}class JU extends I{constructor(){super(...arguments);this.graders=new K1(this._client)}}JU.Graders=K1;class L1 extends I{create($,U,w){return this._client.getAPIList(B`/fine_tuning/checkpoints/${$}/permissions`,T$,{body:U,method:"post",...w,__security:{adminAPIKeyAuth:!0}})}retrieve($,U={},w){return this._client.get(B`/fine_tuning/checkpoints/${$}/permissions`,{query:U,...w,__security:{adminAPIKeyAuth:!0}})}list($,U={},w){return this._client.getAPIList(B`/fine_tuning/checkpoints/${$}/permissions`,n,{query:U,...w,__security:{adminAPIKeyAuth:!0}})}delete($,U,w){let{fine_tuned_model_checkpoint:J}=U;return this._client.delete(B`/fine_tuning/checkpoints/${J}/permissions/${$}`,{...w,__security:{adminAPIKeyAuth:!0}})}}class GU extends I{constructor(){super(...arguments);this.permissions=new L1(this._client)}}GU.Permissions=L1;class P1 extends I{list($,U={},w){return this._client.getAPIList(B`/fine_tuning/jobs/${$}/checkpoints`,h,{query:U,...w,__security:{bearerAuth:!0}})}}class XU extends I{constructor(){super(...arguments);this.checkpoints=new P1(this._client)}create($,U){return this._client.post("/fine_tuning/jobs",{body:$,...U,__security:{bearerAuth:!0}})}retrieve($,U){return this._client.get(B`/fine_tuning/jobs/${$}`,{...U,__security:{bearerAuth:!0}})}list($={},U){return this._client.getAPIList("/fine_tuning/jobs",h,{query:$,...U,__security:{bearerAuth:!0}})}cancel($,U){return this._client.post(B`/fine_tuning/jobs/${$}/cancel`,{...U,__security:{bearerAuth:!0}})}listEvents($,U={},w){return this._client.getAPIList(B`/fine_tuning/jobs/${$}/events`,h,{query:U,...w,__security:{bearerAuth:!0}})}pause($,U){return this._client.post(B`/fine_tuning/jobs/${$}/pause`,{...U,__security:{bearerAuth:!0}})}resume($,U){return this._client.post(B`/fine_tuning/jobs/${$}/resume`,{...U,__security:{bearerAuth:!0}})}}XU.Checkpoints=P1;class w4 extends I{constructor(){super(...arguments);this.methods=new I1(this._client),this.jobs=new XU(this._client),this.checkpoints=new GU(this._client),this.alpha=new JU(this._client)}}w4.Methods=I1;w4.Jobs=XU;w4.Checkpoints=GU;w4.Alpha=JU;class O1 extends I{}class H6 extends I{constructor(){super(...arguments);this.graderModels=new O1(this._client)}}H6.GraderModels=O1;class _U extends I{createVariation($,U){return this._client.post("/images/variations",I$({body:$,...U,__security:{bearerAuth:!0}},this._client))}edit($,U){return this._client.post("/images/edits",I$({body:$,...U,stream:$.stream??!1,__security:{bearerAuth:!0}},this._client))}generate($,U){return this._client.post("/images/generations",{body:$,...U,stream:$.stream??!1,__security:{bearerAuth:!0}})}}class NU extends I{retrieve($,U){return this._client.get(B`/models/${$}`,{...U,__security:{bearerAuth:!0}})}list($){return this._client.getAPIList("/models",T$,{...$,__security:{bearerAuth:!0}})}delete($,U){return this._client.delete(B`/models/${$}`,{...U,__security:{bearerAuth:!0}})}}class WU extends I{create($,U){return this._client.post("/moderations",{body:$,...U,__security:{bearerAuth:!0}})}}class T1 extends I{accept($,U,w){return this._client.post(B`/realtime/calls/${$}/accept`,{body:U,...w,headers:F([{Accept:"*/*"},w?.headers]),__security:{bearerAuth:!0}})}hangup($,U){return this._client.post(B`/realtime/calls/${$}/hangup`,{...U,headers:F([{Accept:"*/*"},U?.headers]),__security:{bearerAuth:!0}})}refer($,U,w){return this._client.post(B`/realtime/calls/${$}/refer`,{body:U,...w,headers:F([{Accept:"*/*"},w?.headers]),__security:{bearerAuth:!0}})}reject($,U={},w){return this._client.post(B`/realtime/calls/${$}/reject`,{body:U,...w,headers:F([{Accept:"*/*"},w?.headers]),__security:{bearerAuth:!0}})}}class Z1 extends I{create($,U){return this._client.post("/realtime/client_secrets",{body:$,...U,__security:{bearerAuth:!0}})}}class f4 extends I{constructor(){super(...arguments);this.clientSecrets=new Z1(this._client),this.calls=new T1(this._client)}}f4.ClientSecrets=Z1;f4.Calls=T1;function yQ($,U){if(!U||!yI(U)){let w={...$,output_parsed:null,output:$.output.map((J)=>{if(J.type==="function_call")return{...J,parsed_arguments:null};if(J.type==="message")return{...J,content:J.content.map((z)=>({...z,parsed:null}))};else return J})};if(iQ($,w))C$(w);return w}return xG($,U)}function xG($,U){let w=!$.status||$.status==="completed",J=$.output.map((G)=>{if(G.type==="function_call")return{...G,parsed_arguments:w?mI(U,G):null};if(G.type==="message"){let X=G.content.map((_)=>{if(_.type==="output_text")return{..._,parsed:w?xI(U,_.text):null};return _});return{...G,content:X}}return G}),z=Object.assign({},$,{output:J});if(iQ($,z))C$(z);return Object.defineProperty(z,"output_parsed",{enumerable:!0,get(){for(let G of z.output){if(G.type!=="message")continue;for(let X of G.content)if(X.type==="output_text"&&X.parsed!==null)return X.parsed}return null}}),z}function xI($,U){if($.text?.format?.type!=="json_schema")return null;if("$parseRaw"in $.text?.format)return($.text?.format).$parseRaw(U);return JSON.parse(U)}function yI($){if(Fw($.text?.format))return!0;return!1}function iI($){return $?.$brand==="auto-parseable-tool"}function hI($,U){return $.find((w)=>w.type==="function"&&w.name===U)}function mI($,U){let w=hI($.tools??[],U.name);return{...U,...U,parsed_arguments:iI(w)?w.$parseRaw(U.arguments):w?.strict?JSON.parse(U.arguments):null}}function iQ($,U){return!Object.getOwnPropertyDescriptor($,"output_text")||U.output_text==null}function C$($){let U=[];for(let w of $.output){if(w.type!=="message")continue;for(let J of w.content)if(J.type==="output_text")U.push(J.text)}$.output_text=U.join("")}function mQ($,U){if(!U){if($.type!=="response.created")throw new A(`When snapshot hasn't been set yet, expected 'response.created' event, got ${$.type}`);return hQ($.response)}switch($.type){case"response.output_item.added":{if(U.output.push(structuredClone($.item)),$.item.type==="message")C$(U);break}case"response.output_item.done":{if(d(U,$.output_index),U.output[$.output_index]=structuredClone($.item),$.item.type==="message")C$(U);break}case"response.content_part.added":{let w=d(U,$.output_index),J=w.type,z=$.part;if(J==="message"&&z.type!=="reasoning_text"){if(w.content.push(structuredClone(z)),z.type==="output_text")C$(U)}else if(J==="reasoning"&&z.type==="reasoning_text"){if(!w.content)w.content=[];w.content.push(structuredClone(z))}break}case"response.content_part.done":{let w=d(U,$.output_index),J=$.part;if(w.type==="message"&&J.type!=="reasoning_text"){if(h$(w.content,$.content_index),w.content[$.content_index]=structuredClone(J),J.type==="output_text")C$(U)}else if(w.type==="reasoning"&&J.type==="reasoning_text"){let z=w.content;if(!z)throw new A(`missing content at index ${$.content_index}`);h$(z,$.content_index),z[$.content_index]=structuredClone(J)}break}case"response.output_text.delta":{let w=d(U,$.output_index);if(w.type==="message"){let J=h$(w.content,$.content_index);if(J.type!=="output_text")throw new A(`expected content to be 'output_text', got ${J.type}`);J.text+=$.delta,U.output_text+=$.delta}break}case"response.output_text.done":{let w=d(U,$.output_index);if(w.type==="message"){let J=h$(w.content,$.content_index);if(J.type!=="output_text")throw new A(`expected content to be 'output_text', got ${J.type}`);J.text=$.text,C$(U)}break}case"response.output_text.annotation.added":{let w=d(U,$.output_index);if(w.type==="message"){let J=h$(w.content,$.content_index);if(J.type!=="output_text")throw new A(`expected content to be 'output_text', got ${J.type}`);J.annotations[$.annotation_index]=structuredClone($.annotation)}break}case"response.refusal.delta":{let w=d(U,$.output_index);if(w.type==="message"){let J=h$(w.content,$.content_index);if(J.type!=="refusal")throw new A(`expected content to be 'refusal', got ${J.type}`);J.refusal+=$.delta}break}case"response.refusal.done":{let w=d(U,$.output_index);if(w.type==="message"){let J=h$(w.content,$.content_index);if(J.type!=="refusal")throw new A(`expected content to be 'refusal', got ${J.type}`);J.refusal=$.refusal}break}case"response.function_call_arguments.delta":{let w=d(U,$.output_index);if(w.type==="function_call")w.arguments+=$.delta;break}case"response.function_call_arguments.done":{let w=d(U,$.output_index);if(w.type==="function_call")w.arguments=$.arguments;break}case"response.reasoning_text.delta":{let w=d(U,$.output_index);if(w.type==="reasoning"){if(!w.content)throw new A(`missing content at index ${$.content_index}`);let J=h$(w.content,$.content_index);if(J.type!=="reasoning_text")throw new A(`expected content to be 'reasoning_text', got ${J.type}`);J.text+=$.delta}break}case"response.reasoning_text.done":{let w=d(U,$.output_index);if(w.type==="reasoning"){if(!w.content)throw new A(`missing content at index ${$.content_index}`);let J=h$(w.content,$.content_index);if(J.type!=="reasoning_text")throw new A(`expected content to be 'reasoning_text', got ${J.type}`);J.text=$.text}break}case"response.reasoning_summary_part.added":{let w=d(U,$.output_index);if(w.type==="reasoning")w.summary.push(structuredClone($.part));break}case"response.reasoning_summary_part.done":{let w=d(U,$.output_index);if(w.type==="reasoning")h$(w.summary,$.summary_index),w.summary[$.summary_index]=structuredClone($.part);break}case"response.reasoning_summary_text.delta":{let w=d(U,$.output_index);if(w.type==="reasoning"){let J=h$(w.summary,$.summary_index);J.text+=$.delta}break}case"response.reasoning_summary_text.done":{let w=d(U,$.output_index);if(w.type==="reasoning"){let J=h$(w.summary,$.summary_index);J.text=$.text}break}case"response.custom_tool_call_input.delta":{let w=d(U,$.output_index);if(w.type==="custom_tool_call")w.input+=$.delta;break}case"response.custom_tool_call_input.done":{let w=d(U,$.output_index);if(w.type==="custom_tool_call")w.input=$.input;break}case"response.mcp_call_arguments.delta":{let w=d(U,$.output_index);if(w.type==="mcp_call")w.arguments+=$.delta;break}case"response.mcp_call_arguments.done":{let w=d(U,$.output_index);if(w.type==="mcp_call")w.arguments=$.arguments;break}case"response.code_interpreter_call_code.delta":{let w=d(U,$.output_index);if(w.type==="code_interpreter_call")w.code=(w.code??"")+$.delta;break}case"response.code_interpreter_call_code.done":{let w=d(U,$.output_index);if(w.type==="code_interpreter_call")w.code=$.code;break}case"response.code_interpreter_call.in_progress":{let w=d(U,$.output_index);if(w.type==="code_interpreter_call")w.status="in_progress";break}case"response.code_interpreter_call.interpreting":{let w=d(U,$.output_index);if(w.type==="code_interpreter_call")w.status="interpreting";break}case"response.code_interpreter_call.completed":{let w=d(U,$.output_index);if(w.type==="code_interpreter_call")w.status="completed";break}case"response.file_search_call.in_progress":{let w=d(U,$.output_index);if(w.type==="file_search_call")w.status="in_progress";break}case"response.file_search_call.searching":{let w=d(U,$.output_index);if(w.type==="file_search_call")w.status="searching";break}case"response.file_search_call.completed":{let w=d(U,$.output_index);if(w.type==="file_search_call")w.status="completed";break}case"response.web_search_call.in_progress":{let w=d(U,$.output_index);if(w.type==="web_search_call")w.status="in_progress";break}case"response.web_search_call.searching":{let w=d(U,$.output_index);if(w.type==="web_search_call")w.status="searching";break}case"response.web_search_call.completed":{let w=d(U,$.output_index);if(w.type==="web_search_call")w.status="completed";break}case"response.image_generation_call.in_progress":{let w=d(U,$.output_index);if(w.type==="image_generation_call")w.status="in_progress";break}case"response.image_generation_call.generating":{let w=d(U,$.output_index);if(w.type==="image_generation_call")w.status="generating";break}case"response.image_generation_call.completed":{let w=d(U,$.output_index);if(w.type==="image_generation_call")w.status="completed";break}case"response.mcp_call.in_progress":{let w=d(U,$.output_index);if(w.type==="mcp_call")w.status="in_progress";break}case"response.mcp_call.completed":{let w=d(U,$.output_index);if(w.type==="mcp_call")w.status="completed";break}case"response.mcp_call.failed":{let w=d(U,$.output_index);if(w.type==="mcp_call")w.status="failed";break}case"response.created":case"response.queued":case"response.in_progress":case"response.completed":case"response.failed":case"response.incomplete":{U=hQ($.response);break}case"response.audio.delta":case"response.audio.done":case"response.audio.transcript.delta":case"response.audio.transcript.done":case"response.image_generation_call.partial_image":case"response.mcp_list_tools.in_progress":case"response.mcp_list_tools.completed":case"response.mcp_list_tools.failed":case"error":break;default:cI($)}return U}function hQ($){let U=structuredClone($);if(!Object.getOwnPropertyDescriptor(U,"output_text")||U.output_text==null)C$(U);return U}function d($,U){let w=$.output[U];if(!w)throw new A(`missing output at index ${U}`);return w}function h$($,U){let w=$[U];if(!w)throw new A(`missing content at index ${U}`);return w}function cI($){throw new A(`Unhandled response stream event: ${JSON.stringify($)}`)}var D1,Bz,I6,qz,cQ,rQ,lQ;class Hz extends z6{constructor($){super();D1.add(this),Bz.set(this,void 0),I6.set(this,void 0),qz.set(this,void 0),C(this,Bz,$,"f")}static createResponse($,U,w){let J=new Hz(U);return J._run(()=>J._createOrRetrieveResponse($,U,{...w,headers:{...w?.headers,"X-Stainless-Helper-Method":"stream"}})),J}async _createOrRetrieveResponse($,U,w){this._listenForAbort(w?.signal),L(this,D1,"m",cQ).call(this);let J,z=null;if("response_id"in U)J=await $.responses.retrieve(U.response_id,{stream:!0},{...w,signal:this.controller.signal,stream:!0}),z=U.starting_after??null;else J=await $.responses.create({...U,stream:!0},{...w,signal:this.controller.signal});this._connected();for await(let G of J)L(this,D1,"m",rQ).call(this,G,z);if(J.controller.signal?.aborted)throw new N$;return L(this,D1,"m",lQ).call(this)}[(Bz=new WeakMap,I6=new WeakMap,qz=new WeakMap,D1=new WeakSet,cQ=function(){if(this.ended)return;C(this,I6,void 0,"f")},rQ=function(U,w){if(this.ended)return;let J=(G,X)=>{if(w==null||X.sequence_number>w)this._emit(G,X)},z=mQ(U,L(this,I6,"f"));switch(C(this,I6,z,"f"),J("event",U),U.type){case"response.output_text.delta":{let G=z.output[U.output_index];if(!G)throw new A(`missing output at index ${U.output_index}`);if(G.type==="message"){let X=G.content[U.content_index];if(!X)throw new A(`missing content at index ${U.content_index}`);if(X.type!=="output_text")throw new A(`expected content to be 'output_text', got ${X.type}`);J("response.output_text.delta",{...U,snapshot:X.text})}break}case"response.function_call_arguments.delta":{let G=z.output[U.output_index];if(!G)throw new A(`missing output at index ${U.output_index}`);if(G.type==="function_call")J("response.function_call_arguments.delta",{...U,snapshot:G.arguments});break}default:J(U.type,U);break}},lQ=function(){if(this.ended)throw new A("stream has ended, this shouldn't happen");let U=L(this,I6,"f");if(!U)throw new A("request ended without sending any events");C(this,I6,void 0,"f");let w=rI(U,L(this,Bz,"f"));return C(this,qz,w,"f"),w},Symbol.asyncIterator)](){let $=[],U=[],w=!1;return this.on("event",(J)=>{let z=U.shift();if(z)z.resolve(J);else $.push(J)}),this.on("end",()=>{w=!0;for(let J of U)J.resolve(void 0);U.length=0}),this.on("abort",(J)=>{w=!0;for(let z of U)z.reject(J);U.length=0}),this.on("error",(J)=>{w=!0;for(let z of U)z.reject(J);U.length=0}),{next:async()=>{if(!$.length){if(w)return{value:void 0,done:!0};return new Promise((z,G)=>U.push({resolve:z,reject:G})).then((z)=>z?{value:z,done:!1}:{value:void 0,done:!0})}return{value:$.shift(),done:!1}},return:async()=>{return this.abort(),{value:void 0,done:!0}}}}async finalResponse(){await this.done();let $=L(this,qz,"f");if(!$)throw new A("stream ended without producing a ChatCompletion");return $}}function rI($,U){return yQ($,U)}class F1 extends I{list($,U={},w){return this._client.getAPIList(B`/responses/${$}/input_items`,h,{query:U,...w,__security:{bearerAuth:!0}})}}class v1 extends I{count($={},U){return this._client.post("/responses/input_tokens",{body:$,...U,__security:{bearerAuth:!0}})}}class K4 extends I{constructor(){super(...arguments);this.inputItems=new F1(this._client),this.inputTokens=new v1(this._client)}create($,U){return this._client.post("/responses",{body:$,...U,stream:$.stream??!1,__security:{bearerAuth:!0}})._thenUnwrap((w)=>{if("object"in w&&w.object==="response")C$(w);return w})}retrieve($,U={},w){return this._client.get(B`/responses/${$}`,{query:U,...w,stream:U?.stream??!1,__security:{bearerAuth:!0}})._thenUnwrap((J)=>{if("object"in J&&J.object==="response")C$(J);return J})}delete($,U){return this._client.delete(B`/responses/${$}`,{...U,headers:F([{Accept:"*/*"},U?.headers]),__security:{bearerAuth:!0}})}parse($,U){return this._client.responses.create($,U)._thenUnwrap((w)=>xG(w,$))}stream($,U){return Hz.createResponse(this._client,$,U)}cancel($,U){return this._client.post(B`/responses/${$}/cancel`,{...U,__security:{bearerAuth:!0}})}compact($,U){return this._client.post("/responses/compact",{body:$,...U,__security:{bearerAuth:!0}})}}K4.InputItems=F1;K4.InputTokens=v1;class M1 extends I{retrieve($,U){return this._client.get(B`/skills/${$}/content`,{...U,headers:F([{Accept:"application/binary"},U?.headers]),__security:{bearerAuth:!0},__binaryResponse:!0})}}class S1 extends I{retrieve($,U,w){let{skill_id:J}=U;return this._client.get(B`/skills/${J}/versions/${$}/content`,{...w,headers:F([{Accept:"application/binary"},w?.headers]),__security:{bearerAuth:!0},__binaryResponse:!0})}}class YU extends I{constructor(){super(...arguments);this.content=new S1(this._client)}create($,U={},w){return this._client.post(B`/skills/${$}/versions`,M4({body:U,...w,__security:{bearerAuth:!0}},this._client))}retrieve($,U,w){let{skill_id:J}=U;return this._client.get(B`/skills/${J}/versions/${$}`,{...w,__security:{bearerAuth:!0}})}list($,U={},w){return this._client.getAPIList(B`/skills/${$}/versions`,h,{query:U,...w,__security:{bearerAuth:!0}})}delete($,U,w){let{skill_id:J}=U;return this._client.delete(B`/skills/${J}/versions/${$}`,{...w,__security:{bearerAuth:!0}})}}YU.Content=S1;class R4 extends I{constructor(){super(...arguments);this.content=new M1(this._client),this.versions=new YU(this._client)}create($={},U){return this._client.post("/skills",M4({body:$,...U,__security:{bearerAuth:!0}},this._client))}retrieve($,U){return this._client.get(B`/skills/${$}`,{...U,__security:{bearerAuth:!0}})}update($,U,w){return this._client.post(B`/skills/${$}`,{body:U,...w,__security:{bearerAuth:!0}})}list($={},U){return this._client.getAPIList("/skills",h,{query:$,...U,__security:{bearerAuth:!0}})}delete($,U){return this._client.delete(B`/skills/${$}`,{...U,__security:{bearerAuth:!0}})}}R4.Content=M1;R4.Versions=YU;class b1 extends I{create($,U,w){return this._client.post(B`/uploads/${$}/parts`,I$({body:U,...w,__security:{bearerAuth:!0}},this._client))}}class K6 extends I{constructor(){super(...arguments);this.parts=new b1(this._client)}create($,U){return this._client.post("/uploads",{body:$,...U,__security:{bearerAuth:!0}})}cancel($,U){return this._client.post(B`/uploads/${$}/cancel`,{...U,__security:{bearerAuth:!0}})}complete($,U,w){return this._client.post(B`/uploads/${$}/complete`,{body:U,...w,__security:{bearerAuth:!0}})}}K6.Parts=b1;var dQ=async($)=>{let U=await Promise.allSettled($),w=U.filter((z)=>z.status==="rejected");if(w.length){for(let z of w)console.error(z.reason);throw Error(`${w.length} promise(s) failed - see the above errors`)}let J=[];for(let z of U)if(z.status==="fulfilled")J.push(z.value);return J};class E1 extends I{create($,U,w){return this._client.post(B`/vector_stores/${$}/file_batches`,{body:U,...w,headers:F([{"OpenAI-Beta":"assistants=v2"},w?.headers]),__security:{bearerAuth:!0}})}retrieve($,U,w){let{vector_store_id:J}=U;return this._client.get(B`/vector_stores/${J}/file_batches/${$}`,{...w,headers:F([{"OpenAI-Beta":"assistants=v2"},w?.headers]),__security:{bearerAuth:!0}})}cancel($,U,w){let{vector_store_id:J}=U;return this._client.post(B`/vector_stores/${J}/file_batches/${$}/cancel`,{...w,headers:F([{"OpenAI-Beta":"assistants=v2"},w?.headers]),__security:{bearerAuth:!0}})}async createAndPoll($,U,w){let J=await this.create($,U);return await this.poll($,J.id,w)}listFiles($,U,w){let{vector_store_id:J,...z}=U;return this._client.getAPIList(B`/vector_stores/${J}/file_batches/${$}/files`,h,{query:z,...w,headers:F([{"OpenAI-Beta":"assistants=v2"},w?.headers]),__security:{bearerAuth:!0}})}async poll($,U,w){let J=F([w?.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":w?.pollIntervalMs?.toString()??void 0}]);while(!0){let{data:z,response:G}=await this.retrieve(U,{vector_store_id:$},{...w,headers:J}).withResponse();switch(z.status){case"in_progress":let X=5000;if(w?.pollIntervalMs)X=w.pollIntervalMs;else{let _=G.headers.get("openai-poll-after-ms");if(_){let N=parseInt(_);if(!isNaN(N))X=N}}await e$(X);break;case"failed":case"cancelled":case"completed":return z}}}async uploadAndPoll($,{files:U,fileIds:w=[]},J){if(U==null||U.length==0)throw Error("No `files` provided to process. If you've already uploaded files you should use `.createAndPoll()` instead");let z=J?.maxConcurrency??5,G=Math.min(z,U.length),X=this._client,_=U.values(),N=[...w];async function W(Q){for(let V of Q){let g=await X.files.create({file:V,purpose:"assistants"},J);N.push(g.id)}}let Y=Array(G).fill(_).map(W);return await dQ(Y),await this.createAndPoll($,{file_ids:N})}}class A1 extends I{create($,U,w){return this._client.post(B`/vector_stores/${$}/files`,{body:U,...w,headers:F([{"OpenAI-Beta":"assistants=v2"},w?.headers]),__security:{bearerAuth:!0}})}retrieve($,U,w){let{vector_store_id:J}=U;return this._client.get(B`/vector_stores/${J}/files/${$}`,{...w,headers:F([{"OpenAI-Beta":"assistants=v2"},w?.headers]),__security:{bearerAuth:!0}})}update($,U,w){let{vector_store_id:J,...z}=U;return this._client.post(B`/vector_stores/${J}/files/${$}`,{body:z,...w,headers:F([{"OpenAI-Beta":"assistants=v2"},w?.headers]),__security:{bearerAuth:!0}})}list($,U={},w){return this._client.getAPIList(B`/vector_stores/${$}/files`,h,{query:U,...w,headers:F([{"OpenAI-Beta":"assistants=v2"},w?.headers]),__security:{bearerAuth:!0}})}delete($,U,w){let{vector_store_id:J}=U;return this._client.delete(B`/vector_stores/${J}/files/${$}`,{...w,headers:F([{"OpenAI-Beta":"assistants=v2"},w?.headers]),__security:{bearerAuth:!0}})}async createAndPoll($,U,w){let J=await this.create($,U,w);return await this.poll($,J.id,w)}async poll($,U,w){let J=F([w?.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":w?.pollIntervalMs?.toString()??void 0}]);while(!0){let z=await this.retrieve(U,{vector_store_id:$},{...w,headers:J}).withResponse(),G=z.data;switch(G.status){case"in_progress":let X=5000;if(w?.pollIntervalMs)X=w.pollIntervalMs;else{let _=z.response.headers.get("openai-poll-after-ms");if(_){let N=parseInt(_);if(!isNaN(N))X=N}}await e$(X);break;case"failed":case"completed":return G}}}async upload($,U,w){let J=await this._client.files.create({file:U,purpose:"assistants"},w);return this.create($,{file_id:J.id},w)}async uploadAndPoll($,U,w){let J=await this.upload($,U,w);return await this.poll($,J.id,w)}content($,U,w){let{vector_store_id:J}=U;return this._client.getAPIList(B`/vector_stores/${J}/files/${$}/content`,T$,{...w,headers:F([{"OpenAI-Beta":"assistants=v2"},w?.headers]),__security:{bearerAuth:!0}})}}class k4 extends I{constructor(){super(...arguments);this.files=new A1(this._client),this.fileBatches=new E1(this._client)}create($,U){return this._client.post("/vector_stores",{body:$,...U,headers:F([{"OpenAI-Beta":"assistants=v2"},U?.headers]),__security:{bearerAuth:!0}})}retrieve($,U){return this._client.get(B`/vector_stores/${$}`,{...U,headers:F([{"OpenAI-Beta":"assistants=v2"},U?.headers]),__security:{bearerAuth:!0}})}update($,U,w){return this._client.post(B`/vector_stores/${$}`,{body:U,...w,headers:F([{"OpenAI-Beta":"assistants=v2"},w?.headers]),__security:{bearerAuth:!0}})}list($={},U){return this._client.getAPIList("/vector_stores",h,{query:$,...U,headers:F([{"OpenAI-Beta":"assistants=v2"},U?.headers]),__security:{bearerAuth:!0}})}delete($,U){return this._client.delete(B`/vector_stores/${$}`,{...U,headers:F([{"OpenAI-Beta":"assistants=v2"},U?.headers]),__security:{bearerAuth:!0}})}search($,U,w){return this._client.getAPIList(B`/vector_stores/${$}/search`,T$,{body:U,method:"post",...w,headers:F([{"OpenAI-Beta":"assistants=v2"},w?.headers]),__security:{bearerAuth:!0}})}}k4.Files=A1;k4.FileBatches=E1;class QU extends I{create($,U){return this._client.post("/videos",I$({body:$,...U,__security:{bearerAuth:!0}},this._client))}retrieve($,U){return this._client.get(B`/videos/${$}`,{...U,__security:{bearerAuth:!0}})}list($={},U){return this._client.getAPIList("/videos",n,{query:$,...U,__security:{bearerAuth:!0}})}delete($,U){return this._client.delete(B`/videos/${$}`,{...U,__security:{bearerAuth:!0}})}createCharacter($,U){return this._client.post("/videos/characters",I$({body:$,...U,__security:{bearerAuth:!0}},this._client))}downloadContent($,U={},w){return this._client.get(B`/videos/${$}/content`,{query:U,...w,headers:F([{Accept:"application/binary"},w?.headers]),__security:{bearerAuth:!0},__binaryResponse:!0})}edit($,U){return this._client.post("/videos/edits",I$({body:$,...U,__security:{bearerAuth:!0}},this._client))}extend($,U){return this._client.post("/videos/extensions",I$({body:$,...U,__security:{bearerAuth:!0}},this._client))}getCharacter($,U){return this._client.get(B`/videos/characters/${$}`,{...U,__security:{bearerAuth:!0}})}remix($,U,w){return this._client.post(B`/videos/${$}/remix`,M4({body:U,...w,__security:{bearerAuth:!0}},this._client))}}var VU,nQ,Iz;class gU extends I{constructor(){super(...arguments);VU.add(this)}async unwrap($,U,w=this._client.webhookSecret,J=300){return await this.verifySignature($,U,w,J),JSON.parse($)}async verifySignature($,U,w=this._client.webhookSecret,J=300){if(typeof crypto>"u"||typeof crypto.subtle.importKey!=="function"||typeof crypto.subtle.verify!=="function")throw Error("Webhook signature verification is only supported when the `crypto` global is defined");L(this,VU,"m",nQ).call(this,w);let z=F([U]).values,G=L(this,VU,"m",Iz).call(this,z,"webhook-signature"),X=L(this,VU,"m",Iz).call(this,z,"webhook-timestamp"),_=L(this,VU,"m",Iz).call(this,z,"webhook-id"),N=parseInt(X,10);if(isNaN(N))throw new g4("Invalid webhook timestamp format");let W=Math.floor(Date.now()/1000);if(W-N>J)throw new g4("Webhook timestamp is too old");if(N>W+J)throw new g4("Webhook timestamp is too new");let Y=G.split(" ").map((H)=>H.startsWith("v1,")?H.substring(3):H),Q=w.startsWith("whsec_")?Buffer.from(w.replace("whsec_",""),"base64"):Buffer.from(w,"utf-8"),V=_?`${_}.${X}.${$}`:`${X}.${$}`,g=await crypto.subtle.importKey("raw",Q,{name:"HMAC",hash:"SHA-256"},!1,["verify"]);for(let H of Y)try{let q=Buffer.from(H,"base64");if(await crypto.subtle.verify("HMAC",g,q,new TextEncoder().encode(V)))return}catch{continue}throw new g4("The given webhook signature does not match the expected signature")}}VU=new WeakSet,nQ=function(U){if(typeof U!=="string"||U.length===0)throw Error("The webhook secret must either be set using the env var, OPENAI_WEBHOOK_SECRET, on the client class, OpenAI({ webhookSecret: '123' }), or passed to this function")},Iz=function(U,w){if(!U)throw Error("Headers are required");let J=U.get(w);if(J===null||J===void 0)throw Error(`Missing required header: ${w}`);return J};var tQ=Symbol.for("openai.node.providerDefinitions.v1"),aQ=globalThis,oQ=aQ[tQ],eQ=oQ??new WeakMap;if(!oQ)Object.defineProperty(aQ,tQ,{value:eQ});function sQ($){let U=eQ.get($);if(!U)throw Error("Invalid provider. Providers must be created with createProvider().");return U.configure()}var yG,iG,f1,$5,sI="workload-identity-auth";class i{constructor($={}){yG.add(this),f1.set(this,void 0),this.completions=new s6(this),this.chat=new J6(this),this.embeddings=new UU(this),this.files=new zU(this),this.images=new _U(this),this.audio=new I4(this),this.moderations=new WU(this),this.models=new NU(this),this.fineTuning=new w4(this),this.graders=new H6(this),this.vectorStores=new k4(this),this.webhooks=new gU(this),this.beta=new U4(this),this.batches=new a6(this),this.uploads=new K6(this),this.admin=new X6(this),this.responses=new K4(this),this.realtime=new f4(this),this.conversations=new B6(this),this.evals=new q6(this),this.containers=new g6(this),this.skills=new R4(this),this.videos=new QU(this);let U=$.provider;if(U){let H=["apiKey","adminAPIKey","workloadIdentity","baseURL"].filter((q)=>$[q]!=null);if(H.length)throw new A(`The \`provider\` option cannot be used with ${H.map((q)=>`\`${q}\``).join(", ")}. Configure authentication and the base URL through the provider instead.`)}let{baseURL:w=U?null:d$("OPENAI_BASE_URL"),apiKey:J=U?null:d$("OPENAI_API_KEY")??null,adminAPIKey:z=U?null:d$("OPENAI_ADMIN_KEY")??null,organization:G=U?null:d$("OPENAI_ORG_ID")??null,project:X=U?null:d$("OPENAI_PROJECT_ID")??null,webhookSecret:_=d$("OPENAI_WEBHOOK_SECRET")??null,workloadIdentity:N,...W}=$,Y=U?sQ(U):void 0,Q={apiKey:J,adminAPIKey:z,organization:G,project:X,webhookSecret:_,workloadIdentity:N,provider:U,...W,baseURL:Y?.baseURL??(w||"https://api.openai.com/v1")};if(J&&N)throw new A("The `apiKey` and `workloadIdentity` options are mutually exclusive");if(!Y&&!J&&!z&&!N)throw new A("Missing credentials. Please pass an `apiKey`, `workloadIdentity`, `adminAPIKey`, or set the `OPENAI_API_KEY` or `OPENAI_ADMIN_KEY` environment variable.");if(!Q.dangerouslyAllowBrowser&&rY())throw new A(`It looks like you're running in a browser-like environment.
|
|
173
|
+
${g}
|
|
174
|
+
${I}`)}return g},Y=JO(FW);class e6 extends O{list($,w={},U){return this._client.getAPIList(Y`/chat/completions/${$}/messages`,y,{query:w,...U,__security:{bearerAuth:!0}})}}function AU($){return $!==void 0&&"function"in $&&$.function!==void 0}function RU($){return $?.$brand==="auto-parseable-response-format"}function _6($){return $?.$brand==="auto-parseable-tool"}function iW($,w){if(!w||!r2(w))return{...$,choices:$.choices.map((U)=>{return SW(U.message.tool_calls),{...U,message:{...U.message,parsed:null,...U.message.tool_calls?{tool_calls:U.message.tool_calls}:void 0}}})};return kU($,w)}function kU($,w){let U=$.choices.map((v)=>{if(v.finish_reason==="length")throw new TU;if(v.finish_reason==="content_filter")throw new ZU;return SW(v.message.tool_calls),{...v,message:{...v.message,...v.message.tool_calls?{tool_calls:v.message.tool_calls?.map((J)=>gO(w,J))??void 0}:void 0,parsed:v.message.content&&!v.message.refusal?zO(w,v.message.content):null}}});return{...$,choices:U}}function zO($,w){if($.response_format?.type!=="json_schema")return null;if($.response_format?.type==="json_schema"){if("$parseRaw"in $.response_format)return $.response_format.$parseRaw(w);return JSON.parse(w)}return null}function gO($,w){let U=$.tools?.find((v)=>AU(v)&&v.function?.name===w.function.name);return{...w,function:{...w.function,parsed_arguments:_6(U)?U.$parseRaw(w.function.arguments):U?.function.strict?JSON.parse(w.function.arguments):null}}}function EW($,w){if(!$||!("tools"in $)||!$.tools)return!1;let U=$.tools?.find((v)=>AU(v)&&v.function?.name===w.function.name);return AU(U)&&(_6(U)||U?.function.strict||!1)}function r2($){if(RU($.response_format))return!0;return $.tools?.some((w)=>_6(w)||w.type==="function"&&w.function.strict===!0)??!1}function SW($){for(let w of $||[])if(w.type!=="function")throw new i(`Currently only \`function\` tool calls are supported; Received \`${w.type}\``)}function AW($){for(let w of $??[]){if(w.type!=="function")throw new i(`Currently only \`function\` tool types support auto-parsing; Received \`${w.type}\``);if(w.function.strict!==!0)throw new i(`The \`${w.function.name}\` tool is not marked with \`strict: true\`. Only strict function tools can be auto-parsed`)}}var s6=($)=>{return $?.role==="assistant"},y2=($)=>{return $?.role==="tool"};var N0,W0,Y0,CU,jU,Q0,xU,q4,P0,rU,O0,B0,$w,RW,kW;class X6{constructor(){N0.add(this),this.controller=new AbortController,W0.set(this,void 0),Y0.set(this,()=>{}),CU.set(this,()=>{}),jU.set(this,void 0),Q0.set(this,()=>{}),xU.set(this,()=>{}),q4.set(this,{}),P0.set(this,[]),rU.set(this,!1),O0.set(this,!1),B0.set(this,!1),$w.set(this,!1),j(this,W0,new Promise(($,w)=>{j(this,Y0,$,"f"),j(this,CU,w,"f")}),"f"),j(this,jU,new Promise(($,w)=>{j(this,Q0,$,"f"),j(this,xU,w,"f")}),"f"),q(this,W0,"f").catch(()=>{}),q(this,jU,"f").catch(()=>{})}_run($){setTimeout(()=>{$().then(()=>{this._emitFinal(),this._emit("end")},q(this,N0,"m",kW).bind(this))},0)}_connected(){if(this.ended)return;q(this,Y0,"f").call(this),this._emit("connect")}get ended(){return q(this,rU,"f")}get errored(){return q(this,O0,"f")}get aborted(){return q(this,B0,"f")}abort(){this.controller.abort()}_listenForAbort($){if(!$||this.ended)return;if($.aborted){this.controller.abort();return}let w=()=>this.controller.abort();$.addEventListener("abort",w,{once:!0}),q(this,P0,"f").push({signal:$,listener:w})}on($,w){return(q(this,q4,"f")[$]||(q(this,q4,"f")[$]=[])).push({listener:w}),this}off($,w){let U=q(this,q4,"f")[$];if(!U)return this;let v=U.findIndex((J)=>J.listener===w);if(v>=0)U.splice(v,1);return this}once($,w){return(q(this,q4,"f")[$]||(q(this,q4,"f")[$]=[])).push({listener:w,once:!0}),this}emitted($){return new Promise((w,U)=>{if(j(this,$w,!0,"f"),$!=="error")this.once("error",U);this.once($,w)})}async done(){j(this,$w,!0,"f"),await q(this,jU,"f")}_emit($,...w){if(q(this,rU,"f"))return;if($==="end")q(this,N0,"m",RW).call(this),j(this,rU,!0,"f"),q(this,Q0,"f").call(this);let U=q(this,q4,"f")[$];if(U)q(this,q4,"f")[$]=U.filter((v)=>!v.once),U.forEach(({listener:v})=>v(...w));if($==="abort"){let v=w[0];if(!q(this,$w,"f")&&!U?.length)Promise.reject(v);q(this,CU,"f").call(this,v),q(this,xU,"f").call(this,v),this._emit("end");return}if($==="error"){let v=w[0];if(!q(this,$w,"f")&&!U?.length)Promise.reject(v);q(this,CU,"f").call(this,v),q(this,xU,"f").call(this,v),this._emit("end")}}_emitFinal(){}}W0=new WeakMap,Y0=new WeakMap,CU=new WeakMap,jU=new WeakMap,Q0=new WeakMap,xU=new WeakMap,q4=new WeakMap,P0=new WeakMap,rU=new WeakMap,O0=new WeakMap,B0=new WeakMap,$w=new WeakMap,N0=new WeakSet,RW=function(){for(let{signal:w,listener:U}of q(this,P0,"f").splice(0))w.removeEventListener("abort",U)},kW=function(w){if(j(this,O0,!0,"f"),w instanceof Error&&w.name==="AbortError")w=new _$;if(w instanceof _$)return j(this,B0,!0,"f"),this._emit("abort",w);if(w instanceof i)return this._emit("error",w);if(w instanceof Error){let U=new i(w.message);return U.cause=w,this._emit("error",U)}return this._emit("error",new i(String(w)))};function CW($){return typeof $.parse==="function"}var f$,d2,q0,m2,n2,h2,jW,xW,VO=10;class yU extends X6{constructor(){super(...arguments);f$.add(this),this._chatCompletions=[],this.messages=[]}_addChatCompletion($){this._chatCompletions.push($),this._emit("chatCompletion",$);let w=$.choices[0]?.message;if(w)this._addMessage(w);return $}_addMessage($,w=!0){if(!("content"in $))$.content=null;if(this.messages.push($),w){if(this._emit("message",$),y2($)&&$.content)this._emit("functionToolCallResult",$.content);else if(s6($)&&$.tool_calls){for(let U of $.tool_calls)if(U.type==="function")this._emit("functionToolCall",U.function)}}}async finalChatCompletion(){await this.done();let $=this._chatCompletions[this._chatCompletions.length-1];if(!$)throw new i("stream ended without producing a ChatCompletion");return $}async finalContent(){return await this.done(),q(this,f$,"m",d2).call(this)}async finalMessage(){return await this.done(),q(this,f$,"m",q0).call(this)}async finalFunctionToolCall(){return await this.done(),q(this,f$,"m",m2).call(this)}async finalFunctionToolCallResult(){return await this.done(),q(this,f$,"m",n2).call(this)}async totalUsage(){return await this.done(),q(this,f$,"m",h2).call(this)}allChatCompletions(){return[...this._chatCompletions]}_emitFinal(){let $=this._chatCompletions[this._chatCompletions.length-1];if($)this._emit("finalChatCompletion",$);let w=q(this,f$,"m",q0).call(this);if(w)this._emit("finalMessage",w);let U=q(this,f$,"m",d2).call(this);if(U)this._emit("finalContent",U);let v=q(this,f$,"m",m2).call(this);if(v)this._emit("finalFunctionToolCall",v);let J=q(this,f$,"m",n2).call(this);if(J!=null)this._emit("finalFunctionToolCallResult",J);if(this._chatCompletions.some((z)=>z.usage))this._emit("totalUsage",q(this,f$,"m",h2).call(this))}async _createChatCompletion($,w,U){this._listenForAbort(U?.signal),q(this,f$,"m",jW).call(this,w);let v=await $.chat.completions.create({...w,stream:!1},{...U,signal:this.controller.signal});return this._connected(),this._addChatCompletion(kU(v,w))}async _runChatCompletion($,w,U){for(let v of w.messages)this._addMessage(v,!1);return await this._createChatCompletion($,w,U)}async _runTools($,w,U,v){let{tool_choice:z="auto",stream:g,...V}=w,_=typeof z!=="string"&&z.type==="function"&&z?.function?.name,{maxChatCompletions:G=VO,afterCompletion:X}=v||{},I=w.tools.map((Q)=>{if(_6(Q)){if(!Q.$callback)throw new i("Tool given to `.runTools()` that does not have an associated function");return{type:"function",function:{function:Q.$callback,name:Q.function.name,description:Q.function.description||"",parameters:Q.function.parameters,parse:Q.$parseRaw,strict:!0}}}return Q}),N={};for(let Q of I)if(Q.type==="function")N[Q.function.name||Q.function.function.name]=Q.function;let W="tools"in w?I.map((Q)=>Q.type==="function"?{type:"function",function:{name:Q.function.name||Q.function.function.name,parameters:Q.function.parameters,description:Q.function.description,strict:Q.function.strict}}:Q):void 0;for(let Q of w.messages)this._addMessage(Q,!1);let P=async(Q)=>{if(Q.type!=="function")return{message:void 0,functionCalled:!1};let H=Q.id,{name:Z,arguments:u}=Q.function,b=N[Z];if(!b){let k=`Invalid tool_call: ${JSON.stringify(Z)}. Available options are: ${Object.keys(N).map((x)=>JSON.stringify(x)).join(", ")}. Please try again`;return{message:{role:"tool",tool_call_id:H,content:k},functionCalled:!1}}if(_&&_!==Z){let k=`Invalid tool_call: ${JSON.stringify(Z)}. ${JSON.stringify(_)} requested. Please try again`;return{message:{role:"tool",tool_call_id:H,content:k},functionCalled:!1}}let M;if(CW(b)){let k;try{k=await b.parse(u)}catch(x){let A=x instanceof Error?x.message:String(x);return{message:{role:"tool",tool_call_id:H,content:A},functionCalled:!1}}M=await b.function(k,U)}else M=await b.function(u,U);let S=q(this,f$,"m",xW).call(this,M);return{message:{role:"tool",tool_call_id:H,content:S},functionCalled:!0}};for(let Q=0;Q<G;++Q){let H=await this._createChatCompletion($,{...V,tool_choice:z,tools:W,messages:[...this.messages]},v),Z=H.choices[0]?.message;if(!Z)throw new i("missing message in ChatCompletion response");if(!Z.tool_calls?.length){await X?.(H,U);return}if(_||w.parallel_tool_calls===!1)for(let u of Z.tool_calls){let b=await P(u);if(b.message)this._addMessage(b.message);if(_&&b.functionCalled){await X?.(H,U);return}}else{let u=await Promise.allSettled(Z.tool_calls.map(P));for(let b of u)if(b.status==="rejected")throw b.reason;for(let b of u)if(b.status==="fulfilled"&&b.value.message)this._addMessage(b.value.message)}await X?.(H,U)}return}}f$=new WeakSet,d2=function(){return q(this,f$,"m",q0).call(this).content??null},q0=function(){let w=this.messages.length;while(w-- >0){let U=this.messages[w];if(s6(U))return{...U,content:U.content??null,refusal:U.refusal??null}}throw new i("stream ended without producing a ChatCompletionMessage with role=assistant")},m2=function(){for(let w=this.messages.length-1;w>=0;w--){let U=this.messages[w];if(s6(U)&&U?.tool_calls?.length)for(let v=U.tool_calls.length-1;v>=0;v--){let J=U.tool_calls[v];if(J?.type==="function")return J.function}}return},n2=function(){for(let w=this.messages.length-1;w>=0;w--){let U=this.messages[w];if(y2(U)&&U.content!=null&&typeof U.content==="string"&&this.messages.some((v)=>v.role==="assistant"&&v.tool_calls?.some((J)=>J.type==="function"&&J.id===U.tool_call_id)))return U.content}return},h2=function(){let w={completion_tokens:0,prompt_tokens:0,total_tokens:0};for(let{usage:U}of this._chatCompletions)if(U)w.completion_tokens+=U.completion_tokens,w.prompt_tokens+=U.prompt_tokens,w.total_tokens+=U.total_tokens;return w},jW=function(w){if(w.n!=null&&w.n>1)throw new i("ChatCompletion convenience helpers only support n=1 at this time. To use n>1, please use chat.completions.create() directly.")},xW=function(w){return typeof w==="string"?w:w===void 0?"undefined":JSON.stringify(w)};class dU extends yU{static runTools($,w,U){let v=new dU,J={...U,headers:{...U?.headers,"X-Stainless-Helper-Method":"runTools"}};return v._run(()=>v._runTools($,w,v,J)),v}_addMessage($,w=!0){if(super._addMessage($,w),s6($)&&$.content)this._emit("content",$.content)}}var Y$={STR:1,NUM:2,ARR:4,OBJ:8,NULL:16,BOOL:32,NAN:64,INFINITY:128,MINUS_INFINITY:256,INF:384,SPECIAL:496,ATOM:499,COLLECTION:12,ALL:511};class rW extends Error{}class yW extends Error{}function GO($,w=Y$.ALL){if(typeof $!=="string")throw TypeError(`expecting str, got ${typeof $}`);if(!$.trim())throw Error(`${$} is empty`);return _O($.trim(),w)}var _O=($,w)=>{let U=$.length,v=0,J=(N)=>{throw new rW(`${N} at position ${v}`)},z=(N)=>{throw new yW(`${N} at position ${v}`)},g=()=>{if(I(),v>=U)J("Unexpected end of input");if($[v]==='"')return V();if($[v]==="{")return _();if($[v]==="[")return G();if($.substring(v,v+4)==="null"||Y$.NULL&w&&U-v<4&&"null".startsWith($.substring(v)))return v+=4,null;if($.substring(v,v+4)==="true"||Y$.BOOL&w&&U-v<4&&"true".startsWith($.substring(v)))return v+=4,!0;if($.substring(v,v+5)==="false"||Y$.BOOL&w&&U-v<5&&"false".startsWith($.substring(v)))return v+=5,!1;if($.substring(v,v+8)==="Infinity"||Y$.INFINITY&w&&U-v<8&&"Infinity".startsWith($.substring(v)))return v+=8,1/0;if($.substring(v,v+9)==="-Infinity"||Y$.MINUS_INFINITY&w&&1<U-v&&U-v<9&&"-Infinity".startsWith($.substring(v)))return v+=9,-1/0;if($.substring(v,v+3)==="NaN"||Y$.NAN&w&&U-v<3&&"NaN".startsWith($.substring(v)))return v+=3,NaN;return X()},V=()=>{let N=v,W=!1;v++;while(v<U&&($[v]!=='"'||W&&$[v-1]==="\\"))W=$[v]==="\\"?!W:!1,v++;if($.charAt(v)=='"')try{return JSON.parse($.substring(N,++v-Number(W)))}catch(P){z(String(P))}else if(Y$.STR&w)try{return JSON.parse($.substring(N,v-Number(W))+'"')}catch(P){return JSON.parse($.substring(N,$.lastIndexOf("\\"))+'"')}J("Unterminated string literal")},_=()=>{v++,I();let N={};try{while($[v]!=="}"){if(I(),v>=U&&Y$.OBJ&w)return N;let W=V();I(),v++;try{let P=g();Object.defineProperty(N,W,{value:P,writable:!0,enumerable:!0,configurable:!0})}catch(P){if(Y$.OBJ&w)return N;else throw P}if(I(),$[v]===",")v++}}catch(W){if(Y$.OBJ&w)return N;else J("Expected '}' at end of object")}return v++,N},G=()=>{v++;let N=[];try{while($[v]!=="]")if(N.push(g()),I(),$[v]===",")v++}catch(W){if(Y$.ARR&w)return N;J("Expected ']' at end of array")}return v++,N},X=()=>{if(v===0){if($==="-"&&Y$.NUM&w)J("Not sure what '-' is");try{return JSON.parse($)}catch(W){if(Y$.NUM&w)try{if($[$.length-1]===".")return JSON.parse($.substring(0,$.lastIndexOf(".")));return JSON.parse($.substring(0,$.lastIndexOf("e")))}catch(P){}z(String(W))}}let N=v;if($[v]==="-")v++;while($[v]&&!",]}".includes($[v]))v++;if(v==U&&!(Y$.NUM&w))J("Unterminated number literal");try{return JSON.parse($.substring(N,v))}catch(W){if($.substring(N,v)==="-"&&Y$.NUM&w)J("Not sure what '-' is");try{return JSON.parse($.substring(N,$.lastIndexOf("e")))}catch(P){z(String(P))}}},I=()=>{while(v<U&&`
|
|
175
|
+
\r `.includes($[v]))v++};return g()},c2=($)=>GO($,Y$.ALL^Y$.NUM);var N$,L4,ww,S4,l2,L0,t2,o2,p2,H0,a2,dW;class A4 extends yU{constructor($){super();N$.add(this),L4.set(this,void 0),ww.set(this,void 0),S4.set(this,void 0),j(this,L4,$,"f"),j(this,ww,[],"f")}get currentChatCompletionSnapshot(){return q(this,S4,"f")}static fromReadableStream($){let w=new A4(null);return w._run(()=>w._fromReadableStream($)),w}static createChatCompletion($,w,U){let v=new A4(w);return v._run(()=>v._runChatCompletion($,{...w,stream:!0},{...U,headers:{...U?.headers,"X-Stainless-Helper-Method":"stream"}})),v}async _createChatCompletion($,w,U){super._createChatCompletion,this._listenForAbort(U?.signal),q(this,N$,"m",l2).call(this);let v=await $.chat.completions.create({...w,stream:!0},{...U,signal:this.controller.signal});this._connected();for await(let J of v)q(this,N$,"m",t2).call(this,J);if(v.controller.signal?.aborted)throw new _$;return this._addChatCompletion(q(this,N$,"m",H0).call(this))}async _fromReadableStream($,w){this._listenForAbort(w?.signal),q(this,N$,"m",l2).call(this),this._connected();let U=k$.fromReadableStream($,this.controller),v;for await(let J of U){if(v&&v!==J.id)this._addChatCompletion(q(this,N$,"m",H0).call(this));q(this,N$,"m",t2).call(this,J),v=J.id}if(U.controller.signal?.aborted)throw new _$;return this._addChatCompletion(q(this,N$,"m",H0).call(this))}[(L4=new WeakMap,ww=new WeakMap,S4=new WeakMap,N$=new WeakSet,l2=function(){if(this.ended)return;j(this,S4,void 0,"f")},L0=function(w){let U=q(this,ww,"f")[w.index];if(U)return U;return U={content_done:!1,refusal_done:!1,logprobs_content_done:!1,logprobs_refusal_done:!1,done_tool_calls:new Set,current_tool_call_index:null},q(this,ww,"f")[w.index]=U,U},t2=function(w){if(this.ended)return;let U=q(this,N$,"m",dW).call(this,w);this._emit("chunk",w,U);for(let v of w.choices){let J=U.choices[v.index];if(v.delta.content!=null&&J.message?.role==="assistant"&&J.message?.content)this._emit("content",v.delta.content,J.message.content),this._emit("content.delta",{delta:v.delta.content,snapshot:J.message.content,parsed:J.message.parsed});if(v.delta.refusal!=null&&J.message?.role==="assistant"&&J.message?.refusal)this._emit("refusal.delta",{delta:v.delta.refusal,snapshot:J.message.refusal});if(v.logprobs?.content!=null&&J.message?.role==="assistant")this._emit("logprobs.content.delta",{content:v.logprobs?.content,snapshot:J.logprobs?.content??[]});if(v.logprobs?.refusal!=null&&J.message?.role==="assistant")this._emit("logprobs.refusal.delta",{refusal:v.logprobs?.refusal,snapshot:J.logprobs?.refusal??[]});let z=q(this,N$,"m",L0).call(this,J);if(J.finish_reason){if(q(this,N$,"m",p2).call(this,J),z.current_tool_call_index!=null)q(this,N$,"m",o2).call(this,J,z.current_tool_call_index)}for(let g of v.delta.tool_calls??[]){if(z.current_tool_call_index!==g.index){if(q(this,N$,"m",p2).call(this,J),z.current_tool_call_index!=null)q(this,N$,"m",o2).call(this,J,z.current_tool_call_index)}z.current_tool_call_index=g.index}for(let g of v.delta.tool_calls??[]){let V=J.message.tool_calls?.[g.index];if(!V?.type)continue;if(V?.type==="function")this._emit("tool_calls.function.arguments.delta",{name:V.function?.name,index:g.index,arguments:V.function.arguments,parsed_arguments:V.function.parsed_arguments,arguments_delta:g.function?.arguments??""});else nW(V?.type)}}},o2=function(w,U){if(q(this,N$,"m",L0).call(this,w).done_tool_calls.has(U))return;let J=w.message.tool_calls?.[U];if(!J)throw Error("no tool call snapshot");if(!J.type)throw Error("tool call snapshot missing `type`");if(J.type==="function"){let z=q(this,L4,"f")?.tools?.find((g)=>AU(g)&&g.function.name===J.function.name);this._emit("tool_calls.function.arguments.done",{name:J.function.name,index:U,arguments:J.function.arguments,parsed_arguments:_6(z)?z.$parseRaw(J.function.arguments):z?.function.strict?JSON.parse(J.function.arguments):null})}else nW(J.type)},p2=function(w){let U=q(this,N$,"m",L0).call(this,w);if(w.message.content&&!U.content_done){U.content_done=!0;let v=q(this,N$,"m",a2).call(this);this._emit("content.done",{content:w.message.content,parsed:v?v.$parseRaw(w.message.content):null})}if(w.message.refusal&&!U.refusal_done)U.refusal_done=!0,this._emit("refusal.done",{refusal:w.message.refusal});if(w.logprobs?.content&&!U.logprobs_content_done)U.logprobs_content_done=!0,this._emit("logprobs.content.done",{content:w.logprobs.content});if(w.logprobs?.refusal&&!U.logprobs_refusal_done)U.logprobs_refusal_done=!0,this._emit("logprobs.refusal.done",{refusal:w.logprobs.refusal})},H0=function(){if(this.ended)throw new i("stream has ended, this shouldn't happen");let w=q(this,S4,"f");if(!w)throw new i("request ended without sending any chunks");return j(this,S4,void 0,"f"),j(this,ww,[],"f"),XO(w,q(this,L4,"f"))},a2=function(){let w=q(this,L4,"f")?.response_format;if(RU(w))return w;return null},dW=function(w){var U,v,J,z;let g=q(this,S4,"f"),{choices:V,..._}=w;if(!g)g=j(this,S4,{..._,choices:[]},"f");else Object.assign(g,_);for(let{delta:G,finish_reason:X,index:I,logprobs:N=null,...W}of w.choices){let P=g.choices[I];if(!P)P=g.choices[I]={finish_reason:X,index:I,message:{},logprobs:N,...W};if(N)if(!P.logprobs)P.logprobs=Object.assign({},N);else{let{content:S,refusal:k,...x}=N;if(mW(x),Object.assign(P.logprobs,x),S)(U=P.logprobs).content??(U.content=[]),P.logprobs.content.push(...S);if(k)(v=P.logprobs).refusal??(v.refusal=[]),P.logprobs.refusal.push(...k)}if(X){if(P.finish_reason=X,q(this,L4,"f")&&r2(q(this,L4,"f"))){if(X==="length")throw new TU;if(X==="content_filter")throw new ZU}}if(Object.assign(P,W),!G)continue;let{content:Q,refusal:H,function_call:Z,role:u,tool_calls:b,...M}=G;if(mW(M),Object.assign(P.message,M),H)P.message.refusal=(P.message.refusal||"")+H;if(u)P.message.role=u;if(Z)if(!P.message.function_call)P.message.function_call=Z;else{if(Z.name)P.message.function_call.name=Z.name;if(Z.arguments)(J=P.message.function_call).arguments??(J.arguments=""),P.message.function_call.arguments+=Z.arguments}if(Q){if(P.message.content=(P.message.content||"")+Q,!P.message.refusal&&q(this,N$,"m",a2).call(this))P.message.parsed=P.message.content.trim()?c2(P.message.content):null}if(b){if(!P.message.tool_calls)P.message.tool_calls=[];for(let{index:S,id:k,type:x,function:A,...a}of b){let h=(z=P.message.tool_calls)[S]??(z[S]={});if(Object.assign(h,a),k)h.id=k;if(x)h.type=x;if(A)h.function??(h.function={name:A.name??"",arguments:""});if(A?.name)h.function.name=A.name;if(A?.arguments){if(h.function.arguments+=A.arguments,EW(q(this,L4,"f"),h))h.function.parsed_arguments=c2(h.function.arguments)}}}}return g},Symbol.asyncIterator)](){let $=[],w=[],U=!1;return this.on("chunk",(v)=>{let J=w.shift();if(J)J.resolve(v);else $.push(v)}),this.on("end",()=>{U=!0;for(let v of w)v.resolve(void 0);w.length=0}),this.on("abort",(v)=>{U=!0;for(let J of w)J.reject(v);w.length=0}),this.on("error",(v)=>{U=!0;for(let J of w)J.reject(v);w.length=0}),{next:async()=>{if(!$.length){if(U)return{value:void 0,done:!0};return new Promise((J,z)=>w.push({resolve:J,reject:z})).then((J)=>J?{value:J,done:!1}:{value:void 0,done:!0})}return{value:$.shift(),done:!1}},return:async()=>{return this.abort(),{value:void 0,done:!0}}}}toReadableStream(){return new k$(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}function XO($,w){let{id:U,choices:v,created:J,model:z,system_fingerprint:g,...V}=$,_={...V,id:U,choices:v.map(({message:G,finish_reason:X,index:I,logprobs:N,...W})=>{if(!X)throw new i(`missing finish_reason for choice ${I}`);let{content:P=null,function_call:Q,tool_calls:H,...Z}=G,u=G.role;if(!u)throw new i(`missing role for choice ${I}`);if(Q){let{arguments:b,name:M}=Q;if(b==null)throw new i(`missing function_call.arguments for choice ${I}`);if(!M)throw new i(`missing function_call.name for choice ${I}`);return{...W,message:{content:P,function_call:{arguments:b,name:M},role:u,refusal:G.refusal??null},finish_reason:X,index:I,logprobs:N}}if(H)return{...W,index:I,finish_reason:X,logprobs:N,message:{...Z,role:u,content:P,refusal:G.refusal??null,tool_calls:H.map((b,M)=>{let{function:S,type:k,id:x,...A}=b,{arguments:a,name:h,...K$}=S||{};if(x==null)throw new i(`missing choices[${I}].tool_calls[${M}].id
|
|
176
|
+
${u0($)}`);if(k==null)throw new i(`missing choices[${I}].tool_calls[${M}].type
|
|
177
|
+
${u0($)}`);if(h==null)throw new i(`missing choices[${I}].tool_calls[${M}].function.name
|
|
178
|
+
${u0($)}`);if(a==null)throw new i(`missing choices[${I}].tool_calls[${M}].function.arguments
|
|
179
|
+
${u0($)}`);return{...A,id:x,type:k,function:{...K$,name:h,arguments:a}}})}};return{...W,message:{...Z,content:P,role:u,refusal:G.refusal??null},finish_reason:X,index:I,logprobs:N}}),created:J,model:z,object:"chat.completion",...g?{system_fingerprint:g}:{}};return iW(_,w)}function u0($){return JSON.stringify($)}function mW($){return}function nW($){}class Uw extends A4{static fromReadableStream($){let w=new Uw(null);return w._run(()=>w._fromReadableStream($)),w}static runTools($,w,U){let v=new Uw(w),J={...U,headers:{...U?.headers,"X-Stainless-Helper-Method":"runTools"}};return v._run(()=>v._runTools($,w,v,J)),v}}class R4 extends O{constructor(){super(...arguments);this.messages=new e6(this._client)}create($,w){return this._client.post("/chat/completions",{body:$,...w,stream:$.stream??!1,__security:{bearerAuth:!0}})}retrieve($,w){return this._client.get(Y`/chat/completions/${$}`,{...w,__security:{bearerAuth:!0}})}update($,w,U){return this._client.post(Y`/chat/completions/${$}`,{body:w,...U,__security:{bearerAuth:!0}})}list($={},w){return this._client.getAPIList("/chat/completions",y,{query:$,...w,__security:{bearerAuth:!0}})}delete($,w){return this._client.delete(Y`/chat/completions/${$}`,{...w,__security:{bearerAuth:!0}})}parse($,w){return AW($.tools),this._client.chat.completions.create($,{...w,headers:{...w?.headers,"X-Stainless-Helper-Method":"chat.completions.parse"}})._thenUnwrap((U)=>kU(U,$))}runTools($,w){if($.stream)return Uw.runTools(this._client,$,w);return dU.runTools(this._client,$,w)}stream($,w){return A4.createChatCompletion(this._client,$,w)}}R4.Messages=e6;class I6 extends O{constructor(){super(...arguments);this.completions=new R4(this._client)}}I6.Completions=R4;class mU extends O{create($,w){return this._client.post("/organization/admin_api_keys",{body:$,...w,__security:{adminAPIKeyAuth:!0}})}retrieve($,w){return this._client.get(Y`/organization/admin_api_keys/${$}`,{...w,__security:{adminAPIKeyAuth:!0}})}list($={},w){return this._client.getAPIList("/organization/admin_api_keys",y,{query:$,...w,__security:{adminAPIKeyAuth:!0}})}delete($,w){return this._client.delete(Y`/organization/admin_api_keys/${$}`,{...w,__security:{adminAPIKeyAuth:!0}})}}class nU extends O{list($={},w){return this._client.getAPIList("/organization/audit_logs",l,{query:$,...w,__security:{adminAPIKeyAuth:!0}})}}class hU extends O{create($,w){return this._client.post("/organization/certificates",{body:$,...w,__security:{adminAPIKeyAuth:!0}})}retrieve($,w={},U){return this._client.get(Y`/organization/certificates/${$}`,{query:w,...U,__security:{adminAPIKeyAuth:!0}})}update($,w,U){return this._client.post(Y`/organization/certificates/${$}`,{body:w,...U,__security:{adminAPIKeyAuth:!0}})}list($={},w){return this._client.getAPIList("/organization/certificates",l,{query:$,...w,__security:{adminAPIKeyAuth:!0}})}delete($,w){return this._client.delete(Y`/organization/certificates/${$}`,{...w,__security:{adminAPIKeyAuth:!0}})}activate($,w){return this._client.getAPIList("/organization/certificates/activate",D$,{body:$,method:"post",...w,__security:{adminAPIKeyAuth:!0}})}deactivate($,w){return this._client.getAPIList("/organization/certificates/deactivate",D$,{body:$,method:"post",...w,__security:{adminAPIKeyAuth:!0}})}}class cU extends O{retrieve($){return this._client.get("/organization/data_retention",{...$,__security:{adminAPIKeyAuth:!0}})}update($,w){return this._client.post("/organization/data_retention",{body:$,...w,__security:{adminAPIKeyAuth:!0}})}}class lU extends O{create($,w){return this._client.post("/organization/invites",{body:$,...w,__security:{adminAPIKeyAuth:!0}})}retrieve($,w){return this._client.get(Y`/organization/invites/${$}`,{...w,__security:{adminAPIKeyAuth:!0}})}list($={},w){return this._client.getAPIList("/organization/invites",l,{query:$,...w,__security:{adminAPIKeyAuth:!0}})}delete($,w){return this._client.delete(Y`/organization/invites/${$}`,{...w,__security:{adminAPIKeyAuth:!0}})}}class tU extends O{create($,w){return this._client.post("/organization/roles",{body:$,...w,__security:{adminAPIKeyAuth:!0}})}retrieve($,w){return this._client.get(Y`/organization/roles/${$}`,{...w,__security:{adminAPIKeyAuth:!0}})}update($,w,U){return this._client.post(Y`/organization/roles/${$}`,{body:w,...U,__security:{adminAPIKeyAuth:!0}})}list($={},w){return this._client.getAPIList("/organization/roles",I$,{query:$,...w,__security:{adminAPIKeyAuth:!0}})}delete($,w){return this._client.delete(Y`/organization/roles/${$}`,{...w,__security:{adminAPIKeyAuth:!0}})}}class oU extends O{create($,w){return this._client.post("/organization/spend_alerts",{body:$,...w,__security:{adminAPIKeyAuth:!0}})}retrieve($,w){return this._client.get(Y`/organization/spend_alerts/${$}`,{...w,__security:{adminAPIKeyAuth:!0}})}update($,w,U){return this._client.post(Y`/organization/spend_alerts/${$}`,{body:w,...U,__security:{adminAPIKeyAuth:!0}})}list($={},w){return this._client.getAPIList("/organization/spend_alerts",l,{query:$,...w,__security:{adminAPIKeyAuth:!0}})}delete($,w){return this._client.delete(Y`/organization/spend_alerts/${$}`,{...w,__security:{adminAPIKeyAuth:!0}})}}class pU extends O{audioSpeeches($,w){return this._client.get("/organization/usage/audio_speeches",{query:$,...w,__security:{adminAPIKeyAuth:!0}})}audioTranscriptions($,w){return this._client.get("/organization/usage/audio_transcriptions",{query:$,...w,__security:{adminAPIKeyAuth:!0}})}codeInterpreterSessions($,w){return this._client.get("/organization/usage/code_interpreter_sessions",{query:$,...w,__security:{adminAPIKeyAuth:!0}})}completions($,w){return this._client.get("/organization/usage/completions",{query:$,...w,__security:{adminAPIKeyAuth:!0}})}costs($,w){return this._client.get("/organization/costs",{query:$,...w,__security:{adminAPIKeyAuth:!0}})}embeddings($,w){return this._client.get("/organization/usage/embeddings",{query:$,...w,__security:{adminAPIKeyAuth:!0}})}fileSearchCalls($,w){return this._client.get("/organization/usage/file_search_calls",{query:$,...w,__security:{adminAPIKeyAuth:!0}})}images($,w){return this._client.get("/organization/usage/images",{query:$,...w,__security:{adminAPIKeyAuth:!0}})}moderations($,w){return this._client.get("/organization/usage/moderations",{query:$,...w,__security:{adminAPIKeyAuth:!0}})}vectorStores($,w){return this._client.get("/organization/usage/vector_stores",{query:$,...w,__security:{adminAPIKeyAuth:!0}})}webSearchCalls($,w){return this._client.get("/organization/usage/web_search_calls",{query:$,...w,__security:{adminAPIKeyAuth:!0}})}}class aU extends O{create($,w,U){return this._client.post(Y`/organization/groups/${$}/roles`,{body:w,...U,__security:{adminAPIKeyAuth:!0}})}retrieve($,w,U){let{group_id:v}=w;return this._client.get(Y`/organization/groups/${v}/roles/${$}`,{...U,__security:{adminAPIKeyAuth:!0}})}list($,w={},U){return this._client.getAPIList(Y`/organization/groups/${$}/roles`,I$,{query:w,...U,__security:{adminAPIKeyAuth:!0}})}delete($,w,U){let{group_id:v}=w;return this._client.delete(Y`/organization/groups/${v}/roles/${$}`,{...U,__security:{adminAPIKeyAuth:!0}})}}class eU extends O{create($,w,U){return this._client.post(Y`/organization/groups/${$}/users`,{body:w,...U,__security:{adminAPIKeyAuth:!0}})}retrieve($,w,U){let{group_id:v}=w;return this._client.get(Y`/organization/groups/${v}/users/${$}`,{...U,__security:{adminAPIKeyAuth:!0}})}list($,w={},U){return this._client.getAPIList(Y`/organization/groups/${$}/users`,I$,{query:w,...U,__security:{adminAPIKeyAuth:!0}})}delete($,w,U){let{group_id:v}=w;return this._client.delete(Y`/organization/groups/${v}/users/${$}`,{...U,__security:{adminAPIKeyAuth:!0}})}}class N6 extends O{constructor(){super(...arguments);this.users=new eU(this._client),this.roles=new aU(this._client)}create($,w){return this._client.post("/organization/groups",{body:$,...w,__security:{adminAPIKeyAuth:!0}})}retrieve($,w){return this._client.get(Y`/organization/groups/${$}`,{...w,__security:{adminAPIKeyAuth:!0}})}update($,w,U){return this._client.post(Y`/organization/groups/${$}`,{body:w,...U,__security:{adminAPIKeyAuth:!0}})}list($={},w){return this._client.getAPIList("/organization/groups",I$,{query:$,...w,__security:{adminAPIKeyAuth:!0}})}delete($,w){return this._client.delete(Y`/organization/groups/${$}`,{...w,__security:{adminAPIKeyAuth:!0}})}}N6.Users=eU;N6.Roles=aU;class sU extends O{retrieve($,w,U){let{project_id:v}=w;return this._client.get(Y`/organization/projects/${v}/api_keys/${$}`,{...U,__security:{adminAPIKeyAuth:!0}})}list($,w={},U){return this._client.getAPIList(Y`/organization/projects/${$}/api_keys`,l,{query:w,...U,__security:{adminAPIKeyAuth:!0}})}delete($,w,U){let{project_id:v}=w;return this._client.delete(Y`/organization/projects/${v}/api_keys/${$}`,{...U,__security:{adminAPIKeyAuth:!0}})}}class $1 extends O{list($,w={},U){return this._client.getAPIList(Y`/organization/projects/${$}/certificates`,l,{query:w,...U,__security:{adminAPIKeyAuth:!0}})}activate($,w,U){return this._client.getAPIList(Y`/organization/projects/${$}/certificates/activate`,D$,{body:w,method:"post",...U,__security:{adminAPIKeyAuth:!0}})}deactivate($,w,U){return this._client.getAPIList(Y`/organization/projects/${$}/certificates/deactivate`,D$,{body:w,method:"post",...U,__security:{adminAPIKeyAuth:!0}})}}class w1 extends O{retrieve($,w){return this._client.get(Y`/organization/projects/${$}/data_retention`,{...w,__security:{adminAPIKeyAuth:!0}})}update($,w,U){return this._client.post(Y`/organization/projects/${$}/data_retention`,{body:w,...U,__security:{adminAPIKeyAuth:!0}})}}class U1 extends O{retrieve($,w){return this._client.get(Y`/organization/projects/${$}/hosted_tool_permissions`,{...w,__security:{adminAPIKeyAuth:!0}})}update($,w,U){return this._client.post(Y`/organization/projects/${$}/hosted_tool_permissions`,{body:w,...U,__security:{adminAPIKeyAuth:!0}})}}class J1 extends O{retrieve($,w){return this._client.get(Y`/organization/projects/${$}/model_permissions`,{...w,__security:{adminAPIKeyAuth:!0}})}update($,w,U){return this._client.post(Y`/organization/projects/${$}/model_permissions`,{body:w,...U,__security:{adminAPIKeyAuth:!0}})}delete($,w){return this._client.delete(Y`/organization/projects/${$}/model_permissions`,{...w,__security:{adminAPIKeyAuth:!0}})}}class v1 extends O{listRateLimits($,w={},U){return this._client.getAPIList(Y`/organization/projects/${$}/rate_limits`,l,{query:w,...U,__security:{adminAPIKeyAuth:!0}})}updateRateLimit($,w,U){let{project_id:v,...J}=w;return this._client.post(Y`/organization/projects/${v}/rate_limits/${$}`,{body:J,...U,__security:{adminAPIKeyAuth:!0}})}}class z1 extends O{create($,w,U){return this._client.post(Y`/projects/${$}/roles`,{body:w,...U,__security:{adminAPIKeyAuth:!0}})}retrieve($,w,U){let{project_id:v}=w;return this._client.get(Y`/projects/${v}/roles/${$}`,{...U,__security:{adminAPIKeyAuth:!0}})}update($,w,U){let{project_id:v,...J}=w;return this._client.post(Y`/projects/${v}/roles/${$}`,{body:J,...U,__security:{adminAPIKeyAuth:!0}})}list($,w={},U){return this._client.getAPIList(Y`/projects/${$}/roles`,I$,{query:w,...U,__security:{adminAPIKeyAuth:!0}})}delete($,w,U){let{project_id:v}=w;return this._client.delete(Y`/projects/${v}/roles/${$}`,{...U,__security:{adminAPIKeyAuth:!0}})}}class g1 extends O{create($,w,U){return this._client.post(Y`/organization/projects/${$}/service_accounts`,{body:w,...U,__security:{adminAPIKeyAuth:!0}})}retrieve($,w,U){let{project_id:v}=w;return this._client.get(Y`/organization/projects/${v}/service_accounts/${$}`,{...U,__security:{adminAPIKeyAuth:!0}})}update($,w,U){let{project_id:v,...J}=w;return this._client.post(Y`/organization/projects/${v}/service_accounts/${$}`,{body:J,...U,__security:{adminAPIKeyAuth:!0}})}list($,w={},U){return this._client.getAPIList(Y`/organization/projects/${$}/service_accounts`,l,{query:w,...U,__security:{adminAPIKeyAuth:!0}})}delete($,w,U){let{project_id:v}=w;return this._client.delete(Y`/organization/projects/${v}/service_accounts/${$}`,{...U,__security:{adminAPIKeyAuth:!0}})}}class V1 extends O{create($,w,U){return this._client.post(Y`/organization/projects/${$}/spend_alerts`,{body:w,...U,__security:{adminAPIKeyAuth:!0}})}retrieve($,w,U){let{project_id:v}=w;return this._client.get(Y`/organization/projects/${v}/spend_alerts/${$}`,{...U,__security:{adminAPIKeyAuth:!0}})}update($,w,U){let{project_id:v,...J}=w;return this._client.post(Y`/organization/projects/${v}/spend_alerts/${$}`,{body:J,...U,__security:{adminAPIKeyAuth:!0}})}list($,w={},U){return this._client.getAPIList(Y`/organization/projects/${$}/spend_alerts`,l,{query:w,...U,__security:{adminAPIKeyAuth:!0}})}delete($,w,U){let{project_id:v}=w;return this._client.delete(Y`/organization/projects/${v}/spend_alerts/${$}`,{...U,__security:{adminAPIKeyAuth:!0}})}}class G1 extends O{create($,w,U){let{project_id:v,...J}=w;return this._client.post(Y`/projects/${v}/groups/${$}/roles`,{body:J,...U,__security:{adminAPIKeyAuth:!0}})}retrieve($,w,U){let{project_id:v,group_id:J}=w;return this._client.get(Y`/projects/${v}/groups/${J}/roles/${$}`,{...U,__security:{adminAPIKeyAuth:!0}})}list($,w,U){let{project_id:v,...J}=w;return this._client.getAPIList(Y`/projects/${v}/groups/${$}/roles`,I$,{query:J,...U,__security:{adminAPIKeyAuth:!0}})}delete($,w,U){let{project_id:v,group_id:J}=w;return this._client.delete(Y`/projects/${v}/groups/${J}/roles/${$}`,{...U,__security:{adminAPIKeyAuth:!0}})}}class Jw extends O{constructor(){super(...arguments);this.roles=new G1(this._client)}create($,w,U){return this._client.post(Y`/organization/projects/${$}/groups`,{body:w,...U,__security:{adminAPIKeyAuth:!0}})}retrieve($,w,U){let{project_id:v,...J}=w;return this._client.get(Y`/organization/projects/${v}/groups/${$}`,{query:J,...U,__security:{adminAPIKeyAuth:!0}})}list($,w={},U){return this._client.getAPIList(Y`/organization/projects/${$}/groups`,I$,{query:w,...U,__security:{adminAPIKeyAuth:!0}})}delete($,w,U){let{project_id:v}=w;return this._client.delete(Y`/organization/projects/${v}/groups/${$}`,{...U,__security:{adminAPIKeyAuth:!0}})}}Jw.Roles=G1;class _1 extends O{create($,w,U){let{project_id:v,...J}=w;return this._client.post(Y`/projects/${v}/users/${$}/roles`,{body:J,...U,__security:{adminAPIKeyAuth:!0}})}retrieve($,w,U){let{project_id:v,user_id:J}=w;return this._client.get(Y`/projects/${v}/users/${J}/roles/${$}`,{...U,__security:{adminAPIKeyAuth:!0}})}list($,w,U){let{project_id:v,...J}=w;return this._client.getAPIList(Y`/projects/${v}/users/${$}/roles`,I$,{query:J,...U,__security:{adminAPIKeyAuth:!0}})}delete($,w,U){let{project_id:v,user_id:J}=w;return this._client.delete(Y`/projects/${v}/users/${J}/roles/${$}`,{...U,__security:{adminAPIKeyAuth:!0}})}}class vw extends O{constructor(){super(...arguments);this.roles=new _1(this._client)}create($,w,U){return this._client.post(Y`/organization/projects/${$}/users`,{body:w,...U,__security:{adminAPIKeyAuth:!0}})}retrieve($,w,U){let{project_id:v}=w;return this._client.get(Y`/organization/projects/${v}/users/${$}`,{...U,__security:{adminAPIKeyAuth:!0}})}update($,w,U){let{project_id:v,...J}=w;return this._client.post(Y`/organization/projects/${v}/users/${$}`,{body:J,...U,__security:{adminAPIKeyAuth:!0}})}list($,w={},U){return this._client.getAPIList(Y`/organization/projects/${$}/users`,l,{query:w,...U,__security:{adminAPIKeyAuth:!0}})}delete($,w,U){let{project_id:v}=w;return this._client.delete(Y`/organization/projects/${v}/users/${$}`,{...U,__security:{adminAPIKeyAuth:!0}})}}vw.Roles=_1;class L$ extends O{constructor(){super(...arguments);this.users=new vw(this._client),this.serviceAccounts=new g1(this._client),this.apiKeys=new sU(this._client),this.rateLimits=new v1(this._client),this.modelPermissions=new J1(this._client),this.hostedToolPermissions=new U1(this._client),this.groups=new Jw(this._client),this.roles=new z1(this._client),this.dataRetention=new w1(this._client),this.spendAlerts=new V1(this._client),this.certificates=new $1(this._client)}create($,w){return this._client.post("/organization/projects",{body:$,...w,__security:{adminAPIKeyAuth:!0}})}retrieve($,w){return this._client.get(Y`/organization/projects/${$}`,{...w,__security:{adminAPIKeyAuth:!0}})}update($,w,U){return this._client.post(Y`/organization/projects/${$}`,{body:w,...U,__security:{adminAPIKeyAuth:!0}})}list($={},w){return this._client.getAPIList("/organization/projects",l,{query:$,...w,__security:{adminAPIKeyAuth:!0}})}archive($,w){return this._client.post(Y`/organization/projects/${$}/archive`,{...w,__security:{adminAPIKeyAuth:!0}})}}L$.Users=vw;L$.ServiceAccounts=g1;L$.APIKeys=sU;L$.RateLimits=v1;L$.ModelPermissions=J1;L$.HostedToolPermissions=U1;L$.Groups=Jw;L$.Roles=z1;L$.DataRetention=w1;L$.SpendAlerts=V1;L$.Certificates=$1;class X1 extends O{create($,w,U){return this._client.post(Y`/organization/users/${$}/roles`,{body:w,...U,__security:{adminAPIKeyAuth:!0}})}retrieve($,w,U){let{user_id:v}=w;return this._client.get(Y`/organization/users/${v}/roles/${$}`,{...U,__security:{adminAPIKeyAuth:!0}})}list($,w={},U){return this._client.getAPIList(Y`/organization/users/${$}/roles`,I$,{query:w,...U,__security:{adminAPIKeyAuth:!0}})}delete($,w,U){let{user_id:v}=w;return this._client.delete(Y`/organization/users/${v}/roles/${$}`,{...U,__security:{adminAPIKeyAuth:!0}})}}class zw extends O{constructor(){super(...arguments);this.roles=new X1(this._client)}retrieve($,w){return this._client.get(Y`/organization/users/${$}`,{...w,__security:{adminAPIKeyAuth:!0}})}update($,w,U){return this._client.post(Y`/organization/users/${$}`,{body:w,...U,__security:{adminAPIKeyAuth:!0}})}list($={},w){return this._client.getAPIList("/organization/users",l,{query:$,...w,__security:{adminAPIKeyAuth:!0}})}delete($,w){return this._client.delete(Y`/organization/users/${$}`,{...w,__security:{adminAPIKeyAuth:!0}})}}zw.Roles=X1;class H$ extends O{constructor(){super(...arguments);this.auditLogs=new nU(this._client),this.adminAPIKeys=new mU(this._client),this.usage=new pU(this._client),this.invites=new lU(this._client),this.users=new zw(this._client),this.groups=new N6(this._client),this.roles=new tU(this._client),this.dataRetention=new cU(this._client),this.spendAlerts=new oU(this._client),this.certificates=new hU(this._client),this.projects=new L$(this._client)}}H$.AuditLogs=nU;H$.AdminAPIKeys=mU;H$.Usage=pU;H$.Invites=lU;H$.Users=zw;H$.Groups=N6;H$.Roles=tU;H$.DataRetention=cU;H$.SpendAlerts=oU;H$.Certificates=hU;H$.Projects=L$;class W6 extends O{constructor(){super(...arguments);this.organization=new H$(this._client)}}W6.Organization=H$;var hW=Symbol("brand.privateNullableHeaders");function*rO($){if(!$)return;if(hW in $){let{values:v,nulls:J}=$;yield*v.entries();for(let z of J)yield[z,null];return}let w=!1,U;if($ instanceof Headers)U=$.entries();else if(H2($))U=$;else w=!0,U=Object.entries($??{});for(let v of U){let J=v[0];if(typeof J!=="string")throw TypeError("expected header name to be a string");let z=H2(v[1])?v[1]:[v[1]],g=!1;for(let V of z){if(V===void 0)continue;if(w&&!g)g=!0,yield[J,null];yield[J,V]}}}var f=($)=>{let w=new Headers,U=new Set;for(let v of $){let J=new Set;for(let[z,g]of rO(v)){let V=z.toLowerCase();if(!J.has(V))w.delete(z),J.add(V);if(g===null)w.delete(z),U.add(V);else w.append(z,g),U.delete(V)}}return{[hW]:!0,values:w,nulls:U}};class I1 extends O{create($,w){return this._client.post("/audio/speech",{body:$,...w,headers:f([{Accept:"application/octet-stream"},w?.headers]),__security:{bearerAuth:!0},__binaryResponse:!0})}}class N1 extends O{create($,w){return this._client.post("/audio/transcriptions",q$({body:$,...w,stream:$.stream??!1,__metadata:{model:$.model},__security:{bearerAuth:!0}},this._client))}}class W1 extends O{create($,w){return this._client.post("/audio/translations",q$({body:$,...w,__metadata:{model:$.model},__security:{bearerAuth:!0}},this._client))}}class H4 extends O{constructor(){super(...arguments);this.transcriptions=new N1(this._client),this.translations=new W1(this._client),this.speech=new I1(this._client)}}H4.Transcriptions=N1;H4.Translations=W1;H4.Speech=I1;class gw extends O{create($,w){return this._client.post("/batches",{body:$,...w,__security:{bearerAuth:!0}})}retrieve($,w){return this._client.get(Y`/batches/${$}`,{...w,__security:{bearerAuth:!0}})}list($={},w){return this._client.getAPIList("/batches",y,{query:$,...w,__security:{bearerAuth:!0}})}cancel($,w){return this._client.post(Y`/batches/${$}/cancel`,{...w,__security:{bearerAuth:!0}})}}class Y1 extends O{create($,w){return this._client.post("/assistants",{body:$,...w,headers:f([{"OpenAI-Beta":"assistants=v2"},w?.headers]),__security:{bearerAuth:!0}})}retrieve($,w){return this._client.get(Y`/assistants/${$}`,{...w,headers:f([{"OpenAI-Beta":"assistants=v2"},w?.headers]),__security:{bearerAuth:!0}})}update($,w,U){return this._client.post(Y`/assistants/${$}`,{body:w,...U,headers:f([{"OpenAI-Beta":"assistants=v2"},U?.headers]),__security:{bearerAuth:!0}})}list($={},w){return this._client.getAPIList("/assistants",y,{query:$,...w,headers:f([{"OpenAI-Beta":"assistants=v2"},w?.headers]),__security:{bearerAuth:!0}})}delete($,w){return this._client.delete(Y`/assistants/${$}`,{...w,headers:f([{"OpenAI-Beta":"assistants=v2"},w?.headers]),__security:{bearerAuth:!0}})}}class Q1 extends O{create($,w){return this._client.post("/realtime/sessions",{body:$,...w,headers:f([{"OpenAI-Beta":"assistants=v2"},w?.headers]),__security:{bearerAuth:!0}})}}class P1 extends O{create($,w){return this._client.post("/realtime/transcription_sessions",{body:$,...w,headers:f([{"OpenAI-Beta":"assistants=v2"},w?.headers]),__security:{bearerAuth:!0}})}}class Y6 extends O{constructor(){super(...arguments);this.sessions=new Q1(this._client),this.transcriptionSessions=new P1(this._client)}}Y6.Sessions=Q1;Y6.TranscriptionSessions=P1;class O1 extends O{create($,w){return this._client.post("/chatkit/sessions",{body:$,...w,headers:f([{"OpenAI-Beta":"chatkit_beta=v1"},w?.headers]),__security:{bearerAuth:!0}})}cancel($,w){return this._client.post(Y`/chatkit/sessions/${$}/cancel`,{...w,headers:f([{"OpenAI-Beta":"chatkit_beta=v1"},w?.headers]),__security:{bearerAuth:!0}})}}class B1 extends O{retrieve($,w){return this._client.get(Y`/chatkit/threads/${$}`,{...w,headers:f([{"OpenAI-Beta":"chatkit_beta=v1"},w?.headers]),__security:{bearerAuth:!0}})}list($={},w){return this._client.getAPIList("/chatkit/threads",l,{query:$,...w,headers:f([{"OpenAI-Beta":"chatkit_beta=v1"},w?.headers]),__security:{bearerAuth:!0}})}delete($,w){return this._client.delete(Y`/chatkit/threads/${$}`,{...w,headers:f([{"OpenAI-Beta":"chatkit_beta=v1"},w?.headers]),__security:{bearerAuth:!0}})}listItems($,w={},U){return this._client.getAPIList(Y`/chatkit/threads/${$}/items`,l,{query:w,...U,headers:f([{"OpenAI-Beta":"chatkit_beta=v1"},U?.headers]),__security:{bearerAuth:!0}})}}class Q6 extends O{constructor(){super(...arguments);this.sessions=new O1(this._client),this.threads=new B1(this._client)}}Q6.Sessions=O1;Q6.Threads=B1;class q1 extends O{create($,w,U){return this._client.post(Y`/threads/${$}/messages`,{body:w,...U,headers:f([{"OpenAI-Beta":"assistants=v2"},U?.headers]),__security:{bearerAuth:!0}})}retrieve($,w,U){let{thread_id:v}=w;return this._client.get(Y`/threads/${v}/messages/${$}`,{...U,headers:f([{"OpenAI-Beta":"assistants=v2"},U?.headers]),__security:{bearerAuth:!0}})}update($,w,U){let{thread_id:v,...J}=w;return this._client.post(Y`/threads/${v}/messages/${$}`,{body:J,...U,headers:f([{"OpenAI-Beta":"assistants=v2"},U?.headers]),__security:{bearerAuth:!0}})}list($,w={},U){return this._client.getAPIList(Y`/threads/${$}/messages`,y,{query:w,...U,headers:f([{"OpenAI-Beta":"assistants=v2"},U?.headers]),__security:{bearerAuth:!0}})}delete($,w,U){let{thread_id:v}=w;return this._client.delete(Y`/threads/${v}/messages/${$}`,{...U,headers:f([{"OpenAI-Beta":"assistants=v2"},U?.headers]),__security:{bearerAuth:!0}})}}class L1 extends O{retrieve($,w,U){let{thread_id:v,run_id:J,...z}=w;return this._client.get(Y`/threads/${v}/runs/${J}/steps/${$}`,{query:z,...U,headers:f([{"OpenAI-Beta":"assistants=v2"},U?.headers]),__security:{bearerAuth:!0}})}list($,w,U){let{thread_id:v,...J}=w;return this._client.getAPIList(Y`/threads/${v}/runs/${$}/steps`,y,{query:J,...U,headers:f([{"OpenAI-Beta":"assistants=v2"},U?.headers]),__security:{bearerAuth:!0}})}}var cW=($)=>{if(typeof Buffer<"u"){let w=Buffer.from($,"base64");return Array.from(new Float32Array(w.buffer,w.byteOffset,w.length/Float32Array.BYTES_PER_ELEMENT))}else{let w=atob($),U=w.length,v=new Uint8Array(U);for(let J=0;J<U;J++)v[J]=w.charCodeAt(J);return Array.from(new Float32Array(v.buffer))}};var p$=($)=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[$]?.trim()||void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.($)?.trim()||void 0;return};var Q$,O6,e2,v4,K0,a$,B6,Vw,P6,T0,C$,D0,f0,K1,H1,u1,lW,tW,oW,pW,aW,eW,sW;class k4 extends X6{constructor(){super(...arguments);Q$.add(this),e2.set(this,[]),v4.set(this,{}),K0.set(this,{}),a$.set(this,void 0),B6.set(this,void 0),Vw.set(this,void 0),P6.set(this,void 0),T0.set(this,void 0),C$.set(this,void 0),D0.set(this,void 0),f0.set(this,void 0),K1.set(this,void 0)}[(e2=new WeakMap,v4=new WeakMap,K0=new WeakMap,a$=new WeakMap,B6=new WeakMap,Vw=new WeakMap,P6=new WeakMap,T0=new WeakMap,C$=new WeakMap,D0=new WeakMap,f0=new WeakMap,K1=new WeakMap,Q$=new WeakSet,Symbol.asyncIterator)](){let $=[],w=[],U=!1;return this.on("event",(v)=>{let J=w.shift();if(J)J.resolve(v);else $.push(v)}),this.on("end",()=>{U=!0;for(let v of w)v.resolve(void 0);w.length=0}),this.on("abort",(v)=>{U=!0;for(let J of w)J.reject(v);w.length=0}),this.on("error",(v)=>{U=!0;for(let J of w)J.reject(v);w.length=0}),{next:async()=>{if(!$.length){if(U)return{value:void 0,done:!0};return new Promise((J,z)=>w.push({resolve:J,reject:z})).then((J)=>J?{value:J,done:!1}:{value:void 0,done:!0})}return{value:$.shift(),done:!1}},return:async()=>{return this.abort(),{value:void 0,done:!0}}}}static fromReadableStream($){let w=new O6;return w._run(()=>w._fromReadableStream($)),w}async _fromReadableStream($,w){this._listenForAbort(w?.signal),this._connected();let U=k$.fromReadableStream($,this.controller);for await(let v of U)q(this,Q$,"m",H1).call(this,v);if(U.controller.signal?.aborted)throw new _$;return this._addRun(q(this,Q$,"m",u1).call(this))}toReadableStream(){return new k$(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}static createToolAssistantStream($,w,U,v){let J=new O6;return J._run(()=>J._runToolAssistantStream($,w,U,{...v,headers:{...v?.headers,"X-Stainless-Helper-Method":"stream"}})),J}async _createToolAssistantStream($,w,U,v){this._listenForAbort(v?.signal);let J={...U,stream:!0},z=await $.submitToolOutputs(w,J,{...v,signal:this.controller.signal});this._connected();for await(let g of z)q(this,Q$,"m",H1).call(this,g);if(z.controller.signal?.aborted)throw new _$;return this._addRun(q(this,Q$,"m",u1).call(this))}static createThreadAssistantStream($,w,U){let v=new O6;return v._run(()=>v._threadAssistantStream($,w,{...U,headers:{...U?.headers,"X-Stainless-Helper-Method":"stream"}})),v}static createAssistantStream($,w,U,v){let J=new O6;return J._run(()=>J._runAssistantStream($,w,U,{...v,headers:{...v?.headers,"X-Stainless-Helper-Method":"stream"}})),J}currentEvent(){return q(this,D0,"f")}currentRun(){return q(this,f0,"f")}currentMessageSnapshot(){return q(this,a$,"f")}currentRunStepSnapshot(){return q(this,K1,"f")}async finalRunSteps(){return await this.done(),Object.values(q(this,v4,"f"))}async finalMessages(){return await this.done(),Object.values(q(this,K0,"f"))}async finalRun(){if(await this.done(),!q(this,B6,"f"))throw Error("Final run was not received.");return q(this,B6,"f")}async _createThreadAssistantStream($,w,U){this._listenForAbort(U?.signal);let v={...w,stream:!0},J=await $.createAndRun(v,{...U,signal:this.controller.signal});this._connected();for await(let z of J)q(this,Q$,"m",H1).call(this,z);if(J.controller.signal?.aborted)throw new _$;return this._addRun(q(this,Q$,"m",u1).call(this))}async _createAssistantStream($,w,U,v){this._listenForAbort(v?.signal);let J={...U,stream:!0},z=await $.create(w,J,{...v,signal:this.controller.signal});this._connected();for await(let g of z)q(this,Q$,"m",H1).call(this,g);if(z.controller.signal?.aborted)throw new _$;return this._addRun(q(this,Q$,"m",u1).call(this))}static accumulateDelta($,w){for(let[U,v]of Object.entries(w)){if(!$.hasOwnProperty(U)){$[U]=v;continue}let J=$[U];if(J===null||J===void 0){$[U]=v;continue}if(U==="index"||U==="type"){$[U]=v;continue}if(typeof J==="string"&&typeof v==="string")J+=v;else if(typeof J==="number"&&typeof v==="number")J+=v;else if(bU(J)&&bU(v))J=this.accumulateDelta(J,v);else if(Array.isArray(J)&&Array.isArray(v)){if(J.every((z)=>typeof z==="string"||typeof z==="number")){J.push(...v);continue}for(let z of v){if(!bU(z))throw Error(`Expected array delta entry to be an object but got: ${z}`);let g=z.index;if(g==null)throw console.error(z),Error("Expected array delta entry to have an `index` property");if(typeof g!=="number")throw Error(`Expected array delta entry \`index\` property to be a number but got ${g}`);let V=J[g];if(V==null)J.push(z);else J[g]=this.accumulateDelta(V,z)}continue}else throw Error(`Unhandled record type: ${U}, deltaValue: ${v}, accValue: ${J}`);$[U]=J}return $}_addRun($){return $}async _threadAssistantStream($,w,U){return await this._createThreadAssistantStream(w,$,U)}async _runAssistantStream($,w,U,v){return await this._createAssistantStream(w,$,U,v)}async _runToolAssistantStream($,w,U,v){return await this._createToolAssistantStream(w,$,U,v)}}O6=k4,H1=function(w){if(this.ended)return;switch(j(this,D0,w,"f"),q(this,Q$,"m",oW).call(this,w),w.event){case"thread.created":break;case"thread.run.created":case"thread.run.queued":case"thread.run.in_progress":case"thread.run.requires_action":case"thread.run.completed":case"thread.run.incomplete":case"thread.run.failed":case"thread.run.cancelling":case"thread.run.cancelled":case"thread.run.expired":q(this,Q$,"m",sW).call(this,w);break;case"thread.run.step.created":case"thread.run.step.in_progress":case"thread.run.step.delta":case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":q(this,Q$,"m",tW).call(this,w);break;case"thread.message.created":case"thread.message.in_progress":case"thread.message.delta":case"thread.message.completed":case"thread.message.incomplete":q(this,Q$,"m",lW).call(this,w);break;case"error":throw Error("Encountered an error event in event processing - errors should be processed earlier");default:sO(w)}},u1=function(){if(this.ended)throw new i("stream has ended, this shouldn't happen");if(!q(this,B6,"f"))throw Error("Final run has not been received");return q(this,B6,"f")},lW=function(w){let[U,v]=q(this,Q$,"m",aW).call(this,w,q(this,a$,"f"));j(this,a$,U,"f"),q(this,K0,"f")[U.id]=U;for(let J of v){let z=U.content[J.index];if(z?.type=="text")this._emit("textCreated",z.text)}switch(w.event){case"thread.message.created":this._emit("messageCreated",w.data);break;case"thread.message.in_progress":break;case"thread.message.delta":if(this._emit("messageDelta",w.data.delta,U),w.data.delta.content)for(let J of w.data.delta.content){if(J.type=="text"&&J.text){let z=J.text,g=U.content[J.index];if(g&&g.type=="text")this._emit("textDelta",z,g.text);else throw Error("The snapshot associated with this text delta is not text or missing")}if(J.index!=q(this,Vw,"f")){if(q(this,P6,"f"))switch(q(this,P6,"f").type){case"text":this._emit("textDone",q(this,P6,"f").text,q(this,a$,"f"));break;case"image_file":this._emit("imageFileDone",q(this,P6,"f").image_file,q(this,a$,"f"));break}j(this,Vw,J.index,"f")}j(this,P6,U.content[J.index],"f")}break;case"thread.message.completed":case"thread.message.incomplete":if(q(this,Vw,"f")!==void 0){let J=w.data.content[q(this,Vw,"f")];if(J)switch(J.type){case"image_file":this._emit("imageFileDone",J.image_file,q(this,a$,"f"));break;case"text":this._emit("textDone",J.text,q(this,a$,"f"));break}}if(q(this,a$,"f"))this._emit("messageDone",w.data);j(this,a$,void 0,"f")}},tW=function(w){let U=q(this,Q$,"m",pW).call(this,w);switch(j(this,K1,U,"f"),w.event){case"thread.run.step.created":this._emit("runStepCreated",w.data);break;case"thread.run.step.delta":let v=w.data.delta;if(v.step_details&&v.step_details.type=="tool_calls"&&v.step_details.tool_calls&&U.step_details.type=="tool_calls")for(let z of v.step_details.tool_calls)if(z.index==q(this,T0,"f"))this._emit("toolCallDelta",z,U.step_details.tool_calls[z.index]);else{if(q(this,C$,"f"))this._emit("toolCallDone",q(this,C$,"f"));if(j(this,T0,z.index,"f"),j(this,C$,U.step_details.tool_calls[z.index],"f"),q(this,C$,"f"))this._emit("toolCallCreated",q(this,C$,"f"))}this._emit("runStepDelta",w.data.delta,U);break;case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":if(j(this,K1,void 0,"f"),w.data.step_details.type=="tool_calls"){if(q(this,C$,"f"))this._emit("toolCallDone",q(this,C$,"f")),j(this,C$,void 0,"f")}this._emit("runStepDone",w.data,U);break;case"thread.run.step.in_progress":break}},oW=function(w){q(this,e2,"f").push(w),this._emit("event",w)},pW=function(w){switch(w.event){case"thread.run.step.created":return q(this,v4,"f")[w.data.id]=w.data,w.data;case"thread.run.step.delta":let U=q(this,v4,"f")[w.data.id];if(!U)throw Error("Received a RunStepDelta before creation of a snapshot");let v=w.data;if(v.delta){let J=O6.accumulateDelta(U,v.delta);q(this,v4,"f")[w.data.id]=J}return q(this,v4,"f")[w.data.id];case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":case"thread.run.step.in_progress":q(this,v4,"f")[w.data.id]=w.data;break}if(q(this,v4,"f")[w.data.id])return q(this,v4,"f")[w.data.id];throw Error("No snapshot available")},aW=function(w,U){let v=[];switch(w.event){case"thread.message.created":return[w.data,v];case"thread.message.delta":if(!U)throw Error("Received a delta with no existing snapshot (there should be one from message creation)");let J=w.data;if(J.delta.content)for(let z of J.delta.content)if(z.index in U.content){let g=U.content[z.index];U.content[z.index]=q(this,Q$,"m",eW).call(this,z,g)}else U.content[z.index]=z,v.push(z);return[U,v];case"thread.message.in_progress":case"thread.message.completed":case"thread.message.incomplete":if(U)return[U,v];else throw Error("Received thread message event with no existing snapshot")}throw Error("Tried to accumulate a non-message event")},eW=function(w,U){return O6.accumulateDelta(U,w)},sW=function(w){switch(j(this,f0,w.data,"f"),w.event){case"thread.run.created":break;case"thread.run.queued":break;case"thread.run.in_progress":break;case"thread.run.requires_action":case"thread.run.cancelled":case"thread.run.failed":case"thread.run.completed":case"thread.run.expired":case"thread.run.incomplete":if(j(this,B6,w.data,"f"),q(this,C$,"f"))this._emit("toolCallDone",q(this,C$,"f")),j(this,C$,void 0,"f");break;case"thread.run.cancelling":break}};function sO($){}class Gw extends O{constructor(){super(...arguments);this.steps=new L1(this._client)}create($,w,U){let{include:v,...J}=w;return this._client.post(Y`/threads/${$}/runs`,{query:{include:v},body:J,...U,headers:f([{"OpenAI-Beta":"assistants=v2"},U?.headers]),stream:w.stream??!1,__synthesizeEventData:!0,__security:{bearerAuth:!0}})}retrieve($,w,U){let{thread_id:v}=w;return this._client.get(Y`/threads/${v}/runs/${$}`,{...U,headers:f([{"OpenAI-Beta":"assistants=v2"},U?.headers]),__security:{bearerAuth:!0}})}update($,w,U){let{thread_id:v,...J}=w;return this._client.post(Y`/threads/${v}/runs/${$}`,{body:J,...U,headers:f([{"OpenAI-Beta":"assistants=v2"},U?.headers]),__security:{bearerAuth:!0}})}list($,w={},U){return this._client.getAPIList(Y`/threads/${$}/runs`,y,{query:w,...U,headers:f([{"OpenAI-Beta":"assistants=v2"},U?.headers]),__security:{bearerAuth:!0}})}cancel($,w,U){let{thread_id:v}=w;return this._client.post(Y`/threads/${v}/runs/${$}/cancel`,{...U,headers:f([{"OpenAI-Beta":"assistants=v2"},U?.headers]),__security:{bearerAuth:!0}})}async createAndPoll($,w,U){let v=await this.create($,w,U);return await this.poll(v.id,{thread_id:$},U)}createAndStream($,w,U){return k4.createAssistantStream($,this._client.beta.threads.runs,w,U)}async poll($,w,U){let v=f([U?.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":U?.pollIntervalMs?.toString()??void 0}]);while(!0){let{data:J,response:z}=await this.retrieve($,w,{...U,headers:{...U?.headers,...v}}).withResponse();switch(J.status){case"queued":case"in_progress":case"cancelling":let g=5000;if(U?.pollIntervalMs)g=U.pollIntervalMs;else{let V=z.headers.get("openai-poll-after-ms");if(V){let _=parseInt(V);if(!isNaN(_))g=_}}await U4(g);break;case"requires_action":case"incomplete":case"cancelled":case"completed":case"failed":case"expired":return J}}}stream($,w,U){return k4.createAssistantStream($,this._client.beta.threads.runs,w,U)}submitToolOutputs($,w,U){let{thread_id:v,...J}=w;return this._client.post(Y`/threads/${v}/runs/${$}/submit_tool_outputs`,{body:J,...U,headers:f([{"OpenAI-Beta":"assistants=v2"},U?.headers]),stream:w.stream??!1,__synthesizeEventData:!0,__security:{bearerAuth:!0}})}async submitToolOutputsAndPoll($,w,U){let v=await this.submitToolOutputs($,w,U);return await this.poll(v.id,w,U)}submitToolOutputsStream($,w,U){return k4.createToolAssistantStream($,this._client.beta.threads.runs,w,U)}}Gw.Steps=L1;class q6 extends O{constructor(){super(...arguments);this.runs=new Gw(this._client),this.messages=new q1(this._client)}create($={},w){return this._client.post("/threads",{body:$,...w,headers:f([{"OpenAI-Beta":"assistants=v2"},w?.headers]),__security:{bearerAuth:!0}})}retrieve($,w){return this._client.get(Y`/threads/${$}`,{...w,headers:f([{"OpenAI-Beta":"assistants=v2"},w?.headers]),__security:{bearerAuth:!0}})}update($,w,U){return this._client.post(Y`/threads/${$}`,{body:w,...U,headers:f([{"OpenAI-Beta":"assistants=v2"},U?.headers]),__security:{bearerAuth:!0}})}delete($,w){return this._client.delete(Y`/threads/${$}`,{...w,headers:f([{"OpenAI-Beta":"assistants=v2"},w?.headers]),__security:{bearerAuth:!0}})}createAndRun($,w){return this._client.post("/threads/runs",{body:$,...w,headers:f([{"OpenAI-Beta":"assistants=v2"},w?.headers]),stream:$.stream??!1,__synthesizeEventData:!0,__security:{bearerAuth:!0}})}async createAndRunPoll($,w){let U=await this.createAndRun($,w);return await this.runs.poll(U.id,{thread_id:U.thread_id},w)}createAndRunStream($,w){return k4.createThreadAssistantStream($,this._client.beta.threads,w)}}q6.Runs=Gw;q6.Messages=q1;class z4 extends O{constructor(){super(...arguments);this.realtime=new Y6(this._client),this.chatkit=new Q6(this._client),this.assistants=new Y1(this._client),this.threads=new q6(this._client)}}z4.Realtime=Y6;z4.ChatKit=Q6;z4.Assistants=Y1;z4.Threads=q6;class _w extends O{create($,w){return this._client.post("/completions",{body:$,...w,stream:$.stream??!1,__security:{bearerAuth:!0}})}}class D1 extends O{retrieve($,w,U){let{container_id:v}=w;return this._client.get(Y`/containers/${v}/files/${$}/content`,{...U,headers:f([{Accept:"application/binary"},U?.headers]),__security:{bearerAuth:!0},__binaryResponse:!0})}}class Xw extends O{constructor(){super(...arguments);this.content=new D1(this._client)}create($,w,U){return this._client.post(Y`/containers/${$}/files`,E4({body:w,...U,__security:{bearerAuth:!0}},this._client))}retrieve($,w,U){let{container_id:v}=w;return this._client.get(Y`/containers/${v}/files/${$}`,{...U,__security:{bearerAuth:!0}})}list($,w={},U){return this._client.getAPIList(Y`/containers/${$}/files`,y,{query:w,...U,__security:{bearerAuth:!0}})}delete($,w,U){let{container_id:v}=w;return this._client.delete(Y`/containers/${v}/files/${$}`,{...U,headers:f([{Accept:"*/*"},U?.headers]),__security:{bearerAuth:!0}})}}Xw.Content=D1;class L6 extends O{constructor(){super(...arguments);this.files=new Xw(this._client)}create($,w){return this._client.post("/containers",{body:$,...w,__security:{bearerAuth:!0}})}retrieve($,w){return this._client.get(Y`/containers/${$}`,{...w,__security:{bearerAuth:!0}})}list($={},w){return this._client.getAPIList("/containers",y,{query:$,...w,__security:{bearerAuth:!0}})}delete($,w){return this._client.delete(Y`/containers/${$}`,{...w,headers:f([{Accept:"*/*"},w?.headers]),__security:{bearerAuth:!0}})}}L6.Files=Xw;class f1 extends O{create($,w,U){let{include:v,...J}=w;return this._client.post(Y`/conversations/${$}/items`,{query:{include:v},body:J,...U,__security:{bearerAuth:!0}})}retrieve($,w,U){let{conversation_id:v,...J}=w;return this._client.get(Y`/conversations/${v}/items/${$}`,{query:J,...U,__security:{bearerAuth:!0}})}list($,w={},U){return this._client.getAPIList(Y`/conversations/${$}/items`,l,{query:w,...U,__security:{bearerAuth:!0}})}delete($,w,U){let{conversation_id:v}=w;return this._client.delete(Y`/conversations/${v}/items/${$}`,{...U,__security:{bearerAuth:!0}})}}class H6 extends O{constructor(){super(...arguments);this.items=new f1(this._client)}create($={},w){return this._client.post("/conversations",{body:$,...w,__security:{bearerAuth:!0}})}retrieve($,w){return this._client.get(Y`/conversations/${$}`,{...w,__security:{bearerAuth:!0}})}update($,w,U){return this._client.post(Y`/conversations/${$}`,{body:w,...U,__security:{bearerAuth:!0}})}delete($,w){return this._client.delete(Y`/conversations/${$}`,{...w,__security:{bearerAuth:!0}})}}H6.Items=f1;class Iw extends O{create($,w){let U=!!$.encoding_format,v=U?$.encoding_format:"base64";if(U)V$(this._client).debug("embeddings/user defined encoding_format:",$.encoding_format);let J=this._client.post("/embeddings",{body:{...$,encoding_format:v},...w,__security:{bearerAuth:!0}});if(U)return J;return V$(this._client).debug("embeddings/decoding base64 embeddings from base64"),J._thenUnwrap((z)=>{if(z&&z.data)z.data.forEach((g)=>{let V=g.embedding;g.embedding=cW(V)});return z})}}class T1 extends O{retrieve($,w,U){let{eval_id:v,run_id:J}=w;return this._client.get(Y`/evals/${v}/runs/${J}/output_items/${$}`,{...U,__security:{bearerAuth:!0}})}list($,w,U){let{eval_id:v,...J}=w;return this._client.getAPIList(Y`/evals/${v}/runs/${$}/output_items`,y,{query:J,...U,__security:{bearerAuth:!0}})}}class Nw extends O{constructor(){super(...arguments);this.outputItems=new T1(this._client)}create($,w,U){return this._client.post(Y`/evals/${$}/runs`,{body:w,...U,__security:{bearerAuth:!0}})}retrieve($,w,U){let{eval_id:v}=w;return this._client.get(Y`/evals/${v}/runs/${$}`,{...U,__security:{bearerAuth:!0}})}list($,w={},U){return this._client.getAPIList(Y`/evals/${$}/runs`,y,{query:w,...U,__security:{bearerAuth:!0}})}delete($,w,U){let{eval_id:v}=w;return this._client.delete(Y`/evals/${v}/runs/${$}`,{...U,__security:{bearerAuth:!0}})}cancel($,w,U){let{eval_id:v}=w;return this._client.post(Y`/evals/${v}/runs/${$}`,{...U,__security:{bearerAuth:!0}})}}Nw.OutputItems=T1;class u6 extends O{constructor(){super(...arguments);this.runs=new Nw(this._client)}create($,w){return this._client.post("/evals",{body:$,...w,__security:{bearerAuth:!0}})}retrieve($,w){return this._client.get(Y`/evals/${$}`,{...w,__security:{bearerAuth:!0}})}update($,w,U){return this._client.post(Y`/evals/${$}`,{body:w,...U,__security:{bearerAuth:!0}})}list($={},w){return this._client.getAPIList("/evals",y,{query:$,...w,__security:{bearerAuth:!0}})}delete($,w){return this._client.delete(Y`/evals/${$}`,{...w,__security:{bearerAuth:!0}})}}u6.Runs=Nw;class Ww extends O{create($,w){return this._client.post("/files",q$({body:$,...w,__security:{bearerAuth:!0}},this._client))}retrieve($,w){return this._client.get(Y`/files/${$}`,{...w,__security:{bearerAuth:!0}})}list($={},w){return this._client.getAPIList("/files",y,{query:$,...w,__security:{bearerAuth:!0}})}delete($,w){return this._client.delete(Y`/files/${$}`,{...w,__security:{bearerAuth:!0}})}content($,w){return this._client.get(Y`/files/${$}/content`,{...w,headers:f([{Accept:"application/binary"},w?.headers]),__security:{bearerAuth:!0},__binaryResponse:!0})}async waitForProcessing($,{pollInterval:w=5000,maxWait:U=1800000}={}){let v=new Set(["processed","error","deleted"]),J=Date.now(),z=await this.retrieve($);while(!z.status||!v.has(z.status))if(await U4(w),z=await this.retrieve($),Date.now()-J>U)throw new V6({message:`Giving up on waiting for file ${$} to finish processing after ${U} milliseconds.`});return z}}class Z1 extends O{}class b1 extends O{run($,w){return this._client.post("/fine_tuning/alpha/graders/run",{body:$,...w,__security:{bearerAuth:!0}})}validate($,w){return this._client.post("/fine_tuning/alpha/graders/validate",{body:$,...w,__security:{bearerAuth:!0}})}}class Yw extends O{constructor(){super(...arguments);this.graders=new b1(this._client)}}Yw.Graders=b1;class F1 extends O{create($,w,U){return this._client.getAPIList(Y`/fine_tuning/checkpoints/${$}/permissions`,D$,{body:w,method:"post",...U,__security:{adminAPIKeyAuth:!0}})}retrieve($,w={},U){return this._client.get(Y`/fine_tuning/checkpoints/${$}/permissions`,{query:w,...U,__security:{adminAPIKeyAuth:!0}})}list($,w={},U){return this._client.getAPIList(Y`/fine_tuning/checkpoints/${$}/permissions`,l,{query:w,...U,__security:{adminAPIKeyAuth:!0}})}delete($,w,U){let{fine_tuned_model_checkpoint:v}=w;return this._client.delete(Y`/fine_tuning/checkpoints/${v}/permissions/${$}`,{...U,__security:{adminAPIKeyAuth:!0}})}}class Qw extends O{constructor(){super(...arguments);this.permissions=new F1(this._client)}}Qw.Permissions=F1;class M1 extends O{list($,w={},U){return this._client.getAPIList(Y`/fine_tuning/jobs/${$}/checkpoints`,y,{query:w,...U,__security:{bearerAuth:!0}})}}class Pw extends O{constructor(){super(...arguments);this.checkpoints=new M1(this._client)}create($,w){return this._client.post("/fine_tuning/jobs",{body:$,...w,__security:{bearerAuth:!0}})}retrieve($,w){return this._client.get(Y`/fine_tuning/jobs/${$}`,{...w,__security:{bearerAuth:!0}})}list($={},w){return this._client.getAPIList("/fine_tuning/jobs",y,{query:$,...w,__security:{bearerAuth:!0}})}cancel($,w){return this._client.post(Y`/fine_tuning/jobs/${$}/cancel`,{...w,__security:{bearerAuth:!0}})}listEvents($,w={},U){return this._client.getAPIList(Y`/fine_tuning/jobs/${$}/events`,y,{query:w,...U,__security:{bearerAuth:!0}})}pause($,w){return this._client.post(Y`/fine_tuning/jobs/${$}/pause`,{...w,__security:{bearerAuth:!0}})}resume($,w){return this._client.post(Y`/fine_tuning/jobs/${$}/resume`,{...w,__security:{bearerAuth:!0}})}}Pw.Checkpoints=M1;class g4 extends O{constructor(){super(...arguments);this.methods=new Z1(this._client),this.jobs=new Pw(this._client),this.checkpoints=new Qw(this._client),this.alpha=new Yw(this._client)}}g4.Methods=Z1;g4.Jobs=Pw;g4.Checkpoints=Qw;g4.Alpha=Yw;class i1 extends O{}class K6 extends O{constructor(){super(...arguments);this.graderModels=new i1(this._client)}}K6.GraderModels=i1;class Ow extends O{createVariation($,w){return this._client.post("/images/variations",q$({body:$,...w,__security:{bearerAuth:!0}},this._client))}edit($,w){return this._client.post("/images/edits",q$({body:$,...w,stream:$.stream??!1,__security:{bearerAuth:!0}},this._client))}generate($,w){return this._client.post("/images/generations",{body:$,...w,stream:$.stream??!1,__security:{bearerAuth:!0}})}}class Bw extends O{retrieve($,w){return this._client.get(Y`/models/${$}`,{...w,__security:{bearerAuth:!0}})}list($){return this._client.getAPIList("/models",D$,{...$,__security:{bearerAuth:!0}})}delete($,w){return this._client.delete(Y`/models/${$}`,{...w,__security:{bearerAuth:!0}})}}class qw extends O{create($,w){return this._client.post("/moderations",{body:$,...w,__security:{bearerAuth:!0}})}}class E1 extends O{accept($,w,U){return this._client.post(Y`/realtime/calls/${$}/accept`,{body:w,...U,headers:f([{Accept:"*/*"},U?.headers]),__security:{bearerAuth:!0}})}hangup($,w){return this._client.post(Y`/realtime/calls/${$}/hangup`,{...w,headers:f([{Accept:"*/*"},w?.headers]),__security:{bearerAuth:!0}})}refer($,w,U){return this._client.post(Y`/realtime/calls/${$}/refer`,{body:w,...U,headers:f([{Accept:"*/*"},U?.headers]),__security:{bearerAuth:!0}})}reject($,w={},U){return this._client.post(Y`/realtime/calls/${$}/reject`,{body:w,...U,headers:f([{Accept:"*/*"},U?.headers]),__security:{bearerAuth:!0}})}}class S1 extends O{create($,w){return this._client.post("/realtime/client_secrets",{body:$,...w,__security:{bearerAuth:!0}})}}class C4 extends O{constructor(){super(...arguments);this.clientSecrets=new S1(this._client),this.calls=new E1(this._client)}}C4.ClientSecrets=S1;C4.Calls=E1;function $3($,w){if(!w||!BB(w)){let U={...$,output_parsed:null,output:$.output.map((v)=>{if(v.type==="function_call")return{...v,parsed_arguments:null};if(v.type==="message")return{...v,content:v.content.map((J)=>({...J,parsed:null}))};else return v})};if(w3($,U))j$(U);return U}return s2($,w)}function s2($,w){let U=!$.status||$.status==="completed",v=$.output.map((z)=>{if(z.type==="function_call")return{...z,parsed_arguments:U?HB(w,z):null};if(z.type==="message"){let g=z.content.map((V)=>{if(V.type==="output_text")return{...V,parsed:U?OB(w,V.text):null};return V});return{...z,content:g}}return z}),J=Object.assign({},$,{output:v});if(w3($,J))j$(J);return Object.defineProperty(J,"output_parsed",{enumerable:!0,get(){for(let z of J.output){if(z.type!=="message")continue;for(let g of z.content)if(g.type==="output_text"&&g.parsed!==null)return g.parsed}return null}}),J}function OB($,w){if($.text?.format?.type!=="json_schema")return null;if("$parseRaw"in $.text?.format)return($.text?.format).$parseRaw(w);return JSON.parse(w)}function BB($){if(RU($.text?.format))return!0;return!1}function qB($){return $?.$brand==="auto-parseable-tool"}function LB($,w){return $.find((U)=>U.type==="function"&&U.name===w)}function HB($,w){let U=LB($.tools??[],w.name);return{...w,...w,parsed_arguments:qB(U)?U.$parseRaw(w.arguments):U?.strict?JSON.parse(w.arguments):null}}function w3($,w){return!Object.getOwnPropertyDescriptor($,"output_text")||w.output_text==null}function j$($){let w=[];for(let U of $.output){if(U.type!=="message")continue;for(let v of U.content)if(v.type==="output_text")w.push(v.text)}$.output_text=w.join("")}function J3($,w){if(!w){if($.type!=="response.created")throw new i(`When snapshot hasn't been set yet, expected 'response.created' event, got ${$.type}`);return U3($.response)}switch($.type){case"response.output_item.added":{if(w.output.push(structuredClone($.item)),$.item.type==="message")j$(w);break}case"response.output_item.done":{if(c(w,$.output_index),w.output[$.output_index]=structuredClone($.item),$.item.type==="message")j$(w);break}case"response.content_part.added":{let U=c(w,$.output_index),v=U.type,J=$.part;if(v==="message"&&J.type!=="reasoning_text"){if(U.content.push(structuredClone(J)),J.type==="output_text")j$(w)}else if(v==="reasoning"&&J.type==="reasoning_text"){if(!U.content)U.content=[];U.content.push(structuredClone(J))}break}case"response.content_part.done":{let U=c(w,$.output_index),v=$.part;if(U.type==="message"&&v.type!=="reasoning_text"){if(m$(U.content,$.content_index),U.content[$.content_index]=structuredClone(v),v.type==="output_text")j$(w)}else if(U.type==="reasoning"&&v.type==="reasoning_text"){let J=U.content;if(!J)throw new i(`missing content at index ${$.content_index}`);m$(J,$.content_index),J[$.content_index]=structuredClone(v)}break}case"response.output_text.delta":{let U=c(w,$.output_index);if(U.type==="message"){let v=m$(U.content,$.content_index);if(v.type!=="output_text")throw new i(`expected content to be 'output_text', got ${v.type}`);v.text+=$.delta,w.output_text+=$.delta}break}case"response.output_text.done":{let U=c(w,$.output_index);if(U.type==="message"){let v=m$(U.content,$.content_index);if(v.type!=="output_text")throw new i(`expected content to be 'output_text', got ${v.type}`);v.text=$.text,j$(w)}break}case"response.output_text.annotation.added":{let U=c(w,$.output_index);if(U.type==="message"){let v=m$(U.content,$.content_index);if(v.type!=="output_text")throw new i(`expected content to be 'output_text', got ${v.type}`);v.annotations[$.annotation_index]=structuredClone($.annotation)}break}case"response.refusal.delta":{let U=c(w,$.output_index);if(U.type==="message"){let v=m$(U.content,$.content_index);if(v.type!=="refusal")throw new i(`expected content to be 'refusal', got ${v.type}`);v.refusal+=$.delta}break}case"response.refusal.done":{let U=c(w,$.output_index);if(U.type==="message"){let v=m$(U.content,$.content_index);if(v.type!=="refusal")throw new i(`expected content to be 'refusal', got ${v.type}`);v.refusal=$.refusal}break}case"response.function_call_arguments.delta":{let U=c(w,$.output_index);if(U.type==="function_call")U.arguments+=$.delta;break}case"response.function_call_arguments.done":{let U=c(w,$.output_index);if(U.type==="function_call")U.arguments=$.arguments;break}case"response.reasoning_text.delta":{let U=c(w,$.output_index);if(U.type==="reasoning"){if(!U.content)throw new i(`missing content at index ${$.content_index}`);let v=m$(U.content,$.content_index);if(v.type!=="reasoning_text")throw new i(`expected content to be 'reasoning_text', got ${v.type}`);v.text+=$.delta}break}case"response.reasoning_text.done":{let U=c(w,$.output_index);if(U.type==="reasoning"){if(!U.content)throw new i(`missing content at index ${$.content_index}`);let v=m$(U.content,$.content_index);if(v.type!=="reasoning_text")throw new i(`expected content to be 'reasoning_text', got ${v.type}`);v.text=$.text}break}case"response.reasoning_summary_part.added":{let U=c(w,$.output_index);if(U.type==="reasoning")U.summary.push(structuredClone($.part));break}case"response.reasoning_summary_part.done":{let U=c(w,$.output_index);if(U.type==="reasoning")m$(U.summary,$.summary_index),U.summary[$.summary_index]=structuredClone($.part);break}case"response.reasoning_summary_text.delta":{let U=c(w,$.output_index);if(U.type==="reasoning"){let v=m$(U.summary,$.summary_index);v.text+=$.delta}break}case"response.reasoning_summary_text.done":{let U=c(w,$.output_index);if(U.type==="reasoning"){let v=m$(U.summary,$.summary_index);v.text=$.text}break}case"response.custom_tool_call_input.delta":{let U=c(w,$.output_index);if(U.type==="custom_tool_call")U.input+=$.delta;break}case"response.custom_tool_call_input.done":{let U=c(w,$.output_index);if(U.type==="custom_tool_call")U.input=$.input;break}case"response.mcp_call_arguments.delta":{let U=c(w,$.output_index);if(U.type==="mcp_call")U.arguments+=$.delta;break}case"response.mcp_call_arguments.done":{let U=c(w,$.output_index);if(U.type==="mcp_call")U.arguments=$.arguments;break}case"response.code_interpreter_call_code.delta":{let U=c(w,$.output_index);if(U.type==="code_interpreter_call")U.code=(U.code??"")+$.delta;break}case"response.code_interpreter_call_code.done":{let U=c(w,$.output_index);if(U.type==="code_interpreter_call")U.code=$.code;break}case"response.code_interpreter_call.in_progress":{let U=c(w,$.output_index);if(U.type==="code_interpreter_call")U.status="in_progress";break}case"response.code_interpreter_call.interpreting":{let U=c(w,$.output_index);if(U.type==="code_interpreter_call")U.status="interpreting";break}case"response.code_interpreter_call.completed":{let U=c(w,$.output_index);if(U.type==="code_interpreter_call")U.status="completed";break}case"response.file_search_call.in_progress":{let U=c(w,$.output_index);if(U.type==="file_search_call")U.status="in_progress";break}case"response.file_search_call.searching":{let U=c(w,$.output_index);if(U.type==="file_search_call")U.status="searching";break}case"response.file_search_call.completed":{let U=c(w,$.output_index);if(U.type==="file_search_call")U.status="completed";break}case"response.web_search_call.in_progress":{let U=c(w,$.output_index);if(U.type==="web_search_call")U.status="in_progress";break}case"response.web_search_call.searching":{let U=c(w,$.output_index);if(U.type==="web_search_call")U.status="searching";break}case"response.web_search_call.completed":{let U=c(w,$.output_index);if(U.type==="web_search_call")U.status="completed";break}case"response.image_generation_call.in_progress":{let U=c(w,$.output_index);if(U.type==="image_generation_call")U.status="in_progress";break}case"response.image_generation_call.generating":{let U=c(w,$.output_index);if(U.type==="image_generation_call")U.status="generating";break}case"response.image_generation_call.completed":{let U=c(w,$.output_index);if(U.type==="image_generation_call")U.status="completed";break}case"response.mcp_call.in_progress":{let U=c(w,$.output_index);if(U.type==="mcp_call")U.status="in_progress";break}case"response.mcp_call.completed":{let U=c(w,$.output_index);if(U.type==="mcp_call")U.status="completed";break}case"response.mcp_call.failed":{let U=c(w,$.output_index);if(U.type==="mcp_call")U.status="failed";break}case"response.created":case"response.queued":case"response.in_progress":case"response.completed":case"response.failed":case"response.incomplete":{w=U3($.response);break}case"response.audio.delta":case"response.audio.done":case"response.audio.transcript.delta":case"response.audio.transcript.done":case"response.image_generation_call.partial_image":case"response.mcp_list_tools.in_progress":case"response.mcp_list_tools.completed":case"response.mcp_list_tools.failed":case"error":break;default:uB($)}return w}function U3($){let w=structuredClone($);if(!Object.getOwnPropertyDescriptor(w,"output_text")||w.output_text==null)j$(w);return w}function c($,w){let U=$.output[w];if(!U)throw new i(`missing output at index ${w}`);return U}function m$($,w){let U=$[w];if(!U)throw new i(`missing content at index ${w}`);return U}function uB($){throw new i(`Unhandled response stream event: ${JSON.stringify($)}`)}var A1,Z0,D6,b0,v3,z3,g3;class F0 extends X6{constructor($){super();A1.add(this),Z0.set(this,void 0),D6.set(this,void 0),b0.set(this,void 0),j(this,Z0,$,"f")}static createResponse($,w,U){let v=new F0(w);return v._run(()=>v._createOrRetrieveResponse($,w,{...U,headers:{...U?.headers,"X-Stainless-Helper-Method":"stream"}})),v}async _createOrRetrieveResponse($,w,U){this._listenForAbort(U?.signal),q(this,A1,"m",v3).call(this);let v,J=null;if("response_id"in w)v=await $.responses.retrieve(w.response_id,{stream:!0},{...U,signal:this.controller.signal,stream:!0}),J=w.starting_after??null;else v=await $.responses.create({...w,stream:!0},{...U,signal:this.controller.signal});this._connected();for await(let z of v)q(this,A1,"m",z3).call(this,z,J);if(v.controller.signal?.aborted)throw new _$;return q(this,A1,"m",g3).call(this)}[(Z0=new WeakMap,D6=new WeakMap,b0=new WeakMap,A1=new WeakSet,v3=function(){if(this.ended)return;j(this,D6,void 0,"f")},z3=function(w,U){if(this.ended)return;let v=(z,g)=>{if(U==null||g.sequence_number>U)this._emit(z,g)},J=J3(w,q(this,D6,"f"));switch(j(this,D6,J,"f"),v("event",w),w.type){case"response.output_text.delta":{let z=J.output[w.output_index];if(!z)throw new i(`missing output at index ${w.output_index}`);if(z.type==="message"){let g=z.content[w.content_index];if(!g)throw new i(`missing content at index ${w.content_index}`);if(g.type!=="output_text")throw new i(`expected content to be 'output_text', got ${g.type}`);v("response.output_text.delta",{...w,snapshot:g.text})}break}case"response.function_call_arguments.delta":{let z=J.output[w.output_index];if(!z)throw new i(`missing output at index ${w.output_index}`);if(z.type==="function_call")v("response.function_call_arguments.delta",{...w,snapshot:z.arguments});break}default:v(w.type,w);break}},g3=function(){if(this.ended)throw new i("stream has ended, this shouldn't happen");let w=q(this,D6,"f");if(!w)throw new i("request ended without sending any events");j(this,D6,void 0,"f");let U=KB(w,q(this,Z0,"f"));return j(this,b0,U,"f"),U},Symbol.asyncIterator)](){let $=[],w=[],U=!1;return this.on("event",(v)=>{let J=w.shift();if(J)J.resolve(v);else $.push(v)}),this.on("end",()=>{U=!0;for(let v of w)v.resolve(void 0);w.length=0}),this.on("abort",(v)=>{U=!0;for(let J of w)J.reject(v);w.length=0}),this.on("error",(v)=>{U=!0;for(let J of w)J.reject(v);w.length=0}),{next:async()=>{if(!$.length){if(U)return{value:void 0,done:!0};return new Promise((J,z)=>w.push({resolve:J,reject:z})).then((J)=>J?{value:J,done:!1}:{value:void 0,done:!0})}return{value:$.shift(),done:!1}},return:async()=>{return this.abort(),{value:void 0,done:!0}}}}async finalResponse(){await this.done();let $=q(this,b0,"f");if(!$)throw new i("stream ended without producing a ChatCompletion");return $}}function KB($,w){return $3($,w)}class R1 extends O{list($,w={},U){return this._client.getAPIList(Y`/responses/${$}/input_items`,y,{query:w,...U,__security:{bearerAuth:!0}})}}class k1 extends O{count($={},w){return this._client.post("/responses/input_tokens",{body:$,...w,__security:{bearerAuth:!0}})}}class u4 extends O{constructor(){super(...arguments);this.inputItems=new R1(this._client),this.inputTokens=new k1(this._client)}create($,w){return this._client.post("/responses",{body:$,...w,stream:$.stream??!1,__security:{bearerAuth:!0}})._thenUnwrap((U)=>{if("object"in U&&U.object==="response")j$(U);return U})}retrieve($,w={},U){return this._client.get(Y`/responses/${$}`,{query:w,...U,stream:w?.stream??!1,__security:{bearerAuth:!0}})._thenUnwrap((v)=>{if("object"in v&&v.object==="response")j$(v);return v})}delete($,w){return this._client.delete(Y`/responses/${$}`,{...w,headers:f([{Accept:"*/*"},w?.headers]),__security:{bearerAuth:!0}})}parse($,w){return this._client.responses.create($,w)._thenUnwrap((U)=>s2(U,$))}stream($,w){return F0.createResponse(this._client,$,w)}cancel($,w){return this._client.post(Y`/responses/${$}/cancel`,{...w,__security:{bearerAuth:!0}})}compact($,w){return this._client.post("/responses/compact",{body:$,...w,__security:{bearerAuth:!0}})}}u4.InputItems=R1;u4.InputTokens=k1;class C1 extends O{retrieve($,w){return this._client.get(Y`/skills/${$}/content`,{...w,headers:f([{Accept:"application/binary"},w?.headers]),__security:{bearerAuth:!0},__binaryResponse:!0})}}class j1 extends O{retrieve($,w,U){let{skill_id:v}=w;return this._client.get(Y`/skills/${v}/versions/${$}/content`,{...U,headers:f([{Accept:"application/binary"},U?.headers]),__security:{bearerAuth:!0},__binaryResponse:!0})}}class Lw extends O{constructor(){super(...arguments);this.content=new j1(this._client)}create($,w={},U){return this._client.post(Y`/skills/${$}/versions`,E4({body:w,...U,__security:{bearerAuth:!0}},this._client))}retrieve($,w,U){let{skill_id:v}=w;return this._client.get(Y`/skills/${v}/versions/${$}`,{...U,__security:{bearerAuth:!0}})}list($,w={},U){return this._client.getAPIList(Y`/skills/${$}/versions`,y,{query:w,...U,__security:{bearerAuth:!0}})}delete($,w,U){let{skill_id:v}=w;return this._client.delete(Y`/skills/${v}/versions/${$}`,{...U,__security:{bearerAuth:!0}})}}Lw.Content=j1;class j4 extends O{constructor(){super(...arguments);this.content=new C1(this._client),this.versions=new Lw(this._client)}create($={},w){return this._client.post("/skills",E4({body:$,...w,__security:{bearerAuth:!0}},this._client))}retrieve($,w){return this._client.get(Y`/skills/${$}`,{...w,__security:{bearerAuth:!0}})}update($,w,U){return this._client.post(Y`/skills/${$}`,{body:w,...U,__security:{bearerAuth:!0}})}list($={},w){return this._client.getAPIList("/skills",y,{query:$,...w,__security:{bearerAuth:!0}})}delete($,w){return this._client.delete(Y`/skills/${$}`,{...w,__security:{bearerAuth:!0}})}}j4.Content=C1;j4.Versions=Lw;class x1 extends O{create($,w,U){return this._client.post(Y`/uploads/${$}/parts`,q$({body:w,...U,__security:{bearerAuth:!0}},this._client))}}class f6 extends O{constructor(){super(...arguments);this.parts=new x1(this._client)}create($,w){return this._client.post("/uploads",{body:$,...w,__security:{bearerAuth:!0}})}cancel($,w){return this._client.post(Y`/uploads/${$}/cancel`,{...w,__security:{bearerAuth:!0}})}complete($,w,U){return this._client.post(Y`/uploads/${$}/complete`,{body:w,...U,__security:{bearerAuth:!0}})}}f6.Parts=x1;var V3=async($)=>{let w=await Promise.allSettled($),U=w.filter((J)=>J.status==="rejected");if(U.length){for(let J of U)console.error(J.reason);throw Error(`${U.length} promise(s) failed - see the above errors`)}let v=[];for(let J of w)if(J.status==="fulfilled")v.push(J.value);return v};class r1 extends O{create($,w,U){return this._client.post(Y`/vector_stores/${$}/file_batches`,{body:w,...U,headers:f([{"OpenAI-Beta":"assistants=v2"},U?.headers]),__security:{bearerAuth:!0}})}retrieve($,w,U){let{vector_store_id:v}=w;return this._client.get(Y`/vector_stores/${v}/file_batches/${$}`,{...U,headers:f([{"OpenAI-Beta":"assistants=v2"},U?.headers]),__security:{bearerAuth:!0}})}cancel($,w,U){let{vector_store_id:v}=w;return this._client.post(Y`/vector_stores/${v}/file_batches/${$}/cancel`,{...U,headers:f([{"OpenAI-Beta":"assistants=v2"},U?.headers]),__security:{bearerAuth:!0}})}async createAndPoll($,w,U){let v=await this.create($,w);return await this.poll($,v.id,U)}listFiles($,w,U){let{vector_store_id:v,...J}=w;return this._client.getAPIList(Y`/vector_stores/${v}/file_batches/${$}/files`,y,{query:J,...U,headers:f([{"OpenAI-Beta":"assistants=v2"},U?.headers]),__security:{bearerAuth:!0}})}async poll($,w,U){let v=f([U?.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":U?.pollIntervalMs?.toString()??void 0}]);while(!0){let{data:J,response:z}=await this.retrieve(w,{vector_store_id:$},{...U,headers:v}).withResponse();switch(J.status){case"in_progress":let g=5000;if(U?.pollIntervalMs)g=U.pollIntervalMs;else{let V=z.headers.get("openai-poll-after-ms");if(V){let _=parseInt(V);if(!isNaN(_))g=_}}await U4(g);break;case"failed":case"cancelled":case"completed":return J}}}async uploadAndPoll($,{files:w,fileIds:U=[]},v){if(w==null||w.length==0)throw Error("No `files` provided to process. If you've already uploaded files you should use `.createAndPoll()` instead");let J=v?.maxConcurrency??5,z=Math.min(J,w.length),g=this._client,V=w.values(),_=[...U];async function G(I){for(let N of I){let W=await g.files.create({file:N,purpose:"assistants"},v);_.push(W.id)}}let X=Array(z).fill(V).map(G);return await V3(X),await this.createAndPoll($,{file_ids:_})}}class y1 extends O{create($,w,U){return this._client.post(Y`/vector_stores/${$}/files`,{body:w,...U,headers:f([{"OpenAI-Beta":"assistants=v2"},U?.headers]),__security:{bearerAuth:!0}})}retrieve($,w,U){let{vector_store_id:v}=w;return this._client.get(Y`/vector_stores/${v}/files/${$}`,{...U,headers:f([{"OpenAI-Beta":"assistants=v2"},U?.headers]),__security:{bearerAuth:!0}})}update($,w,U){let{vector_store_id:v,...J}=w;return this._client.post(Y`/vector_stores/${v}/files/${$}`,{body:J,...U,headers:f([{"OpenAI-Beta":"assistants=v2"},U?.headers]),__security:{bearerAuth:!0}})}list($,w={},U){return this._client.getAPIList(Y`/vector_stores/${$}/files`,y,{query:w,...U,headers:f([{"OpenAI-Beta":"assistants=v2"},U?.headers]),__security:{bearerAuth:!0}})}delete($,w,U){let{vector_store_id:v}=w;return this._client.delete(Y`/vector_stores/${v}/files/${$}`,{...U,headers:f([{"OpenAI-Beta":"assistants=v2"},U?.headers]),__security:{bearerAuth:!0}})}async createAndPoll($,w,U){let v=await this.create($,w,U);return await this.poll($,v.id,U)}async poll($,w,U){let v=f([U?.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":U?.pollIntervalMs?.toString()??void 0}]);while(!0){let J=await this.retrieve(w,{vector_store_id:$},{...U,headers:v}).withResponse(),z=J.data;switch(z.status){case"in_progress":let g=5000;if(U?.pollIntervalMs)g=U.pollIntervalMs;else{let V=J.response.headers.get("openai-poll-after-ms");if(V){let _=parseInt(V);if(!isNaN(_))g=_}}await U4(g);break;case"failed":case"completed":return z}}}async upload($,w,U){let v=await this._client.files.create({file:w,purpose:"assistants"},U);return this.create($,{file_id:v.id},U)}async uploadAndPoll($,w,U){let v=await this.upload($,w,U);return await this.poll($,v.id,U)}content($,w,U){let{vector_store_id:v}=w;return this._client.getAPIList(Y`/vector_stores/${v}/files/${$}/content`,D$,{...U,headers:f([{"OpenAI-Beta":"assistants=v2"},U?.headers]),__security:{bearerAuth:!0}})}}class x4 extends O{constructor(){super(...arguments);this.files=new y1(this._client),this.fileBatches=new r1(this._client)}create($,w){return this._client.post("/vector_stores",{body:$,...w,headers:f([{"OpenAI-Beta":"assistants=v2"},w?.headers]),__security:{bearerAuth:!0}})}retrieve($,w){return this._client.get(Y`/vector_stores/${$}`,{...w,headers:f([{"OpenAI-Beta":"assistants=v2"},w?.headers]),__security:{bearerAuth:!0}})}update($,w,U){return this._client.post(Y`/vector_stores/${$}`,{body:w,...U,headers:f([{"OpenAI-Beta":"assistants=v2"},U?.headers]),__security:{bearerAuth:!0}})}list($={},w){return this._client.getAPIList("/vector_stores",y,{query:$,...w,headers:f([{"OpenAI-Beta":"assistants=v2"},w?.headers]),__security:{bearerAuth:!0}})}delete($,w){return this._client.delete(Y`/vector_stores/${$}`,{...w,headers:f([{"OpenAI-Beta":"assistants=v2"},w?.headers]),__security:{bearerAuth:!0}})}search($,w,U){return this._client.getAPIList(Y`/vector_stores/${$}/search`,D$,{body:w,method:"post",...U,headers:f([{"OpenAI-Beta":"assistants=v2"},U?.headers]),__security:{bearerAuth:!0}})}}x4.Files=y1;x4.FileBatches=r1;class Hw extends O{create($,w){return this._client.post("/videos",q$({body:$,...w,__security:{bearerAuth:!0}},this._client))}retrieve($,w){return this._client.get(Y`/videos/${$}`,{...w,__security:{bearerAuth:!0}})}list($={},w){return this._client.getAPIList("/videos",l,{query:$,...w,__security:{bearerAuth:!0}})}delete($,w){return this._client.delete(Y`/videos/${$}`,{...w,__security:{bearerAuth:!0}})}createCharacter($,w){return this._client.post("/videos/characters",q$({body:$,...w,__security:{bearerAuth:!0}},this._client))}downloadContent($,w={},U){return this._client.get(Y`/videos/${$}/content`,{query:w,...U,headers:f([{Accept:"application/binary"},U?.headers]),__security:{bearerAuth:!0},__binaryResponse:!0})}edit($,w){return this._client.post("/videos/edits",q$({body:$,...w,__security:{bearerAuth:!0}},this._client))}extend($,w){return this._client.post("/videos/extensions",q$({body:$,...w,__security:{bearerAuth:!0}},this._client))}getCharacter($,w){return this._client.get(Y`/videos/characters/${$}`,{...w,__security:{bearerAuth:!0}})}remix($,w,U){return this._client.post(Y`/videos/${$}/remix`,E4({body:w,...U,__security:{bearerAuth:!0}},this._client))}}var uw,G3,M0;class Kw extends O{constructor(){super(...arguments);uw.add(this)}async unwrap($,w,U=this._client.webhookSecret,v=300){return await this.verifySignature($,w,U,v),JSON.parse($)}async verifySignature($,w,U=this._client.webhookSecret,v=300){if(typeof crypto>"u"||typeof crypto.subtle.importKey!=="function"||typeof crypto.subtle.verify!=="function")throw Error("Webhook signature verification is only supported when the `crypto` global is defined");q(this,uw,"m",G3).call(this,U);let J=f([w]).values,z=q(this,uw,"m",M0).call(this,J,"webhook-signature"),g=q(this,uw,"m",M0).call(this,J,"webhook-timestamp"),V=q(this,uw,"m",M0).call(this,J,"webhook-id"),_=parseInt(g,10);if(isNaN(_))throw new O4("Invalid webhook timestamp format");let G=Math.floor(Date.now()/1000);if(G-_>v)throw new O4("Webhook timestamp is too old");if(_>G+v)throw new O4("Webhook timestamp is too new");let X=z.split(" ").map((P)=>P.startsWith("v1,")?P.substring(3):P),I=U.startsWith("whsec_")?Buffer.from(U.replace("whsec_",""),"base64"):Buffer.from(U,"utf-8"),N=V?`${V}.${g}.${$}`:`${g}.${$}`,W=await crypto.subtle.importKey("raw",I,{name:"HMAC",hash:"SHA-256"},!1,["verify"]);for(let P of X)try{let Q=Buffer.from(P,"base64");if(await crypto.subtle.verify("HMAC",W,Q,new TextEncoder().encode(N)))return}catch{continue}throw new O4("The given webhook signature does not match the expected signature")}}uw=new WeakSet,G3=function(w){if(typeof w!=="string"||w.length===0)throw Error("The webhook secret must either be set using the env var, OPENAI_WEBHOOK_SECRET, on the client class, OpenAI({ webhookSecret: '123' }), or passed to this function")},M0=function(w,U){if(!w)throw Error("Headers are required");let v=w.get(U);if(v===null||v===void 0)throw Error(`Missing required header: ${U}`);return v};var X3=Symbol.for("openai.node.providerDefinitions.v1"),I3=globalThis,N3=I3[X3],W3=N3??new WeakMap;if(!N3)Object.defineProperty(I3,X3,{value:W3});function Y3($){let w=W3.get($);if(!w)throw Error("Invalid provider. Providers must be created with createProvider().");return w.configure()}var $g,wg,d1,Q3,EB="workload-identity-auth";class r{constructor($={}){$g.add(this),d1.set(this,void 0),this.completions=new _w(this),this.chat=new I6(this),this.embeddings=new Iw(this),this.files=new Ww(this),this.images=new Ow(this),this.audio=new H4(this),this.moderations=new qw(this),this.models=new Bw(this),this.fineTuning=new g4(this),this.graders=new K6(this),this.vectorStores=new x4(this),this.webhooks=new Kw(this),this.beta=new z4(this),this.batches=new gw(this),this.uploads=new f6(this),this.admin=new W6(this),this.responses=new u4(this),this.realtime=new C4(this),this.conversations=new H6(this),this.evals=new u6(this),this.containers=new L6(this),this.skills=new j4(this),this.videos=new Hw(this);let w=$.provider;if(w){let P=["apiKey","adminAPIKey","workloadIdentity","baseURL"].filter((Q)=>$[Q]!=null);if(P.length)throw new i(`The \`provider\` option cannot be used with ${P.map((Q)=>`\`${Q}\``).join(", ")}. Configure authentication and the base URL through the provider instead.`)}let{baseURL:U=w?null:p$("OPENAI_BASE_URL"),apiKey:v=w?null:p$("OPENAI_API_KEY")??null,adminAPIKey:J=w?null:p$("OPENAI_ADMIN_KEY")??null,organization:z=w?null:p$("OPENAI_ORG_ID")??null,project:g=w?null:p$("OPENAI_PROJECT_ID")??null,webhookSecret:V=p$("OPENAI_WEBHOOK_SECRET")??null,workloadIdentity:_,...G}=$,X=w?Y3(w):void 0,I={apiKey:v,adminAPIKey:J,organization:z,project:g,webhookSecret:V,workloadIdentity:_,provider:w,...G,baseURL:X?.baseURL??(U||"https://api.openai.com/v1")};if(v&&_)throw new i("The `apiKey` and `workloadIdentity` options are mutually exclusive");if(!X&&!v&&!J&&!_)throw new i("Missing credentials. Please pass an `apiKey`, `workloadIdentity`, `adminAPIKey`, or set the `OPENAI_API_KEY` or `OPENAI_ADMIN_KEY` environment variable.");if(!I.dangerouslyAllowBrowser&&zW())throw new i(`It looks like you're running in a browser-like environment.
|
|
180
180
|
|
|
181
181
|
This is disabled by default, as it risks exposing your secret API credentials to attackers.
|
|
182
182
|
If you understand the risks and have appropriate mitigations in place,
|
|
@@ -185,86 +185,86 @@ you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g.,
|
|
|
185
185
|
new OpenAI({ apiKey, dangerouslyAllowBrowser: true });
|
|
186
186
|
|
|
187
187
|
https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety
|
|
188
|
-
`);this.baseURL=
|
|
189
|
-
`)){let O=q.indexOf(":");if(O>=0)H[q.substring(0,O).trim()]=q.substring(O+1).trim()}Q.defaultHeaders=F([H,Q.defaultHeaders])}if(this._options=Q,this._provider=Y,N)this._workloadIdentityAuth=new PG(N,this.fetch);this.apiKey=typeof J==="string"?J:null,this.adminAPIKey=z,this.organization=G,this.project=X,this.webhookSecret=_}withOptions($){let U=this._options.provider,w=$.provider??U,J={...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this._options.apiKey,adminAPIKey:this.adminAPIKey,workloadIdentity:this._options.workloadIdentity,organization:this.organization,project:this.project,webhookSecret:this.webhookSecret};if(w){if(delete J.apiKey,delete J.adminAPIKey,delete J.workloadIdentity,delete J.baseURL,w!==U)delete J.organization,delete J.project,delete J.defaultHeaders}return new this.constructor({...J,...$,provider:w})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:$,nulls:U},w={bearerAuth:!0,adminAPIKeyAuth:!0}){if($.get("authorization")||$.get("api-key"))return;if(U.has("authorization")||U.has("api-key"))return;if(this._workloadIdentityAuth&&w.bearerAuth)return;throw Error('Could not resolve authentication method. Expected either apiKey or adminAPIKey to be set. Or for one of the "Authorization" or "api-key" headers to be explicitly omitted')}async authHeaders($,U={bearerAuth:!0,adminAPIKeyAuth:!0}){return F([U.bearerAuth?await this.bearerAuth($):null,U.adminAPIKeyAuth?await this.adminAPIKeyAuth($):null])}async bearerAuth($){if(this._workloadIdentityAuth)return F([{Authorization:`Bearer ${await this._workloadIdentityAuth.getToken()}`}]);if(this.apiKey==null)return;return F([{Authorization:`Bearer ${this.apiKey}`}])}async adminAPIKeyAuth($){if(this.adminAPIKey==null)return;return F([{Authorization:`Bearer ${this.adminAPIKey}`}])}stringifyQuery($){return wQ($)}getUserAgent(){return`${this.constructor.name}/JS ${v4}`}defaultIdempotencyKey(){return`stainless-node-retry-${GG()}`}makeStatusError($,U,w,J){return z$.generate($,U,w,J)}async _callApiKey(){if(this._provider)return!1;let $=this._options.apiKey;if(typeof $!=="function")return!1;let U;try{U=await $()}catch(w){if(w instanceof A)throw w;throw new A(`Failed to get token from 'apiKey' function: ${w.message}`,{cause:w})}if(typeof U!=="string"||!U)throw new A(`Expected 'apiKey' function argument to return a string but it returned ${U}`);return this.apiKey=U,!0}buildURL($,U,w){let J=!L(this,yG,"m",$5).call(this)&&w||this.baseURL,z=CY($)?new URL($):new URL(J+(J.endsWith("/")&&$.startsWith("/")?$.slice(1):$)),G=this.defaultQuery(),X=Object.fromEntries(z.searchParams);if(!_G(G)||!_G(X))U={...X,...G,...U};if(typeof U==="object"&&U&&!Array.isArray(U))z.search=this.stringifyQuery(U);return z.toString()}async prepareOptions($){if(this._provider)return;if(($.__security??{bearerAuth:!0}).bearerAuth)await this._callApiKey()}async prepareRequest($,{url:U,options:w}){}get($,U){return this.methodRequest("get",$,U)}post($,U){return this.methodRequest("post",$,U)}patch($,U){return this.methodRequest("patch",$,U)}put($,U){return this.methodRequest("put",$,U)}delete($,U){return this.methodRequest("delete",$,U)}methodRequest($,U,w){return this.request(Promise.resolve(w).then((J)=>{return{method:$,path:U,...J}}))}request($,U=null){return new U6(this,this.makeRequest($,U,void 0))}async makeRequest($,U,w){let J=await $,z=J.maxRetries??this.maxRetries;if(U==null)U=z;await this.prepareOptions(J);let{req:G,url:X,timeout:_}=await this.buildRequest(J,{retryCount:z-U});await this.prepareRequest(G,{url:X,options:J}),await this._provider?.prepareRequest?.(G,{url:X,options:J});let N="log_"+(Math.random()*16777216|0).toString(16).padStart(6,"0"),W=w===void 0?"":`, retryOf: ${w}`,Y=Date.now();if(X$(this).debug(`[${N}] sending request`,B4({retryOfRequestLogID:w,method:J.method,url:X,options:J,headers:G.headers})),J.signal?.aborted)throw new N$;let Q=J.__security??{bearerAuth:!0},V=new AbortController,g=await this.fetchWithAuth(X,G,_,V,Q).catch(_w),H=Date.now();if(g instanceof globalThis.Error){let M=`retrying, ${U} attempts remaining`;if(J.signal?.aborted)throw new N$;let T=Xw(g)||/timed? ?out/i.test(String(g)+("cause"in g?String(g.cause):""));if(U)return X$(this).info(`[${N}] connection ${T?"timed out":"failed"} - ${M}`),X$(this).debug(`[${N}] connection ${T?"timed out":"failed"} (${M})`,B4({retryOfRequestLogID:w,url:X,durationMs:H-Y,message:g.message})),this.retryRequest(J,U,w??N);if(X$(this).info(`[${N}] connection ${T?"timed out":"failed"} - error; no more retries left`),X$(this).debug(`[${N}] connection ${T?"timed out":"failed"} (error; no more retries left)`,B4({retryOfRequestLogID:w,url:X,durationMs:H-Y,message:g.message})),g instanceof C6||g instanceof m0)throw g;if(T)throw new $6;throw new s4({message:$K(g),cause:g})}let q=[...g.headers.entries()].filter(([M])=>M==="x-request-id").map(([M,T])=>", "+M+": "+JSON.stringify(T)).join(""),O=`[${N}${W}${q}] ${G.method} ${X} ${g.ok?"succeeded":"failed"} with status ${g.status} in ${H-Y}ms`;if(!g.ok){if(g.status===401&&this._workloadIdentityAuth&&Q.bearerAuth&&!J.__metadata?.hasStreamingBody&&!J.__metadata?.workloadIdentityTokenRefreshed)return await YG(g.body),this._workloadIdentityAuth.invalidateToken(),this.makeRequest({...J,__metadata:{...J.__metadata,workloadIdentityTokenRefreshed:!0}},U,w??N);let M=await this.shouldRetry(g);if(U&&M){let x=`retrying, ${U} attempts remaining`;return await YG(g.body),X$(this).info(`${O} - ${x}`),X$(this).debug(`[${N}] response error (${x})`,B4({retryOfRequestLogID:w,url:g.url,status:g.status,headers:g.headers,durationMs:H-Y})),this.retryRequest(J,U,w??N,g.headers)}let T=M?"error; no more retries left":"error; not retryable";X$(this).info(`${O} - ${T}`);let S=await g.text().catch((x)=>_w(x).message),E=iY(S),R=E?void 0:S;throw X$(this).debug(`[${N}] response error (${T})`,B4({retryOfRequestLogID:w,url:g.url,status:g.status,headers:g.headers,message:R,durationMs:Date.now()-Y})),this.makeStatusError(g.status,E,R,g.headers)}return X$(this).info(O),X$(this).debug(`[${N}] response start`,B4({retryOfRequestLogID:w,url:g.url,status:g.status,headers:g.headers,durationMs:H-Y})),{response:g,options:J,controller:V,requestLogID:N,retryOfRequestLogID:w,startTime:Y}}getAPIList($,U,w){return this.requestAPIList(U,w&&"then"in w?w.then((J)=>({method:"get",path:$,...J})):{method:"get",path:$,...w})}requestAPIList($,U){let w=this.makeRequest(U,null,void 0);return new o0(this,w,$)}async fetchWithAuth($,U,w,J,z={bearerAuth:!0,adminAPIKeyAuth:!0}){if(this._workloadIdentityAuth&&z.bearerAuth){let X=U.headers,_=X.get("Authorization");if(!_||_===`Bearer ${sI}`){let N=await this._workloadIdentityAuth.getToken();X.set("Authorization",`Bearer ${N}`)}}return await this.fetchWithTimeout($,U,w,J)}async fetchWithTimeout($,U,w,J){let{signal:z,method:G,...X}=U||{},_=this._makeAbort(J);if(z)z.addEventListener("abort",_,{once:!0});let N=setTimeout(_,w),W=globalThis.ReadableStream&&X.body instanceof globalThis.ReadableStream||typeof X.body==="object"&&X.body!==null&&Symbol.asyncIterator in X.body,Y={signal:J.signal,...W?{duplex:"half"}:{},method:"GET",...X};if(G)Y.method=G.toUpperCase();try{return await this.fetch.call(void 0,$,Y)}finally{clearTimeout(N)}}async shouldRetry($){let U=$.headers.get("x-should-retry");if(U==="true")return!0;if(U==="false")return!1;if($.status===408)return!0;if($.status===409)return!0;if($.status===429)return!0;if($.status>=500)return!0;return!1}async retryRequest($,U,w,J){let z,G=J?.get("retry-after-ms");if(G){let _=parseFloat(G);if(!Number.isNaN(_))z=_}let X=J?.get("retry-after");if(X&&!z){let _=parseFloat(X);if(!Number.isNaN(_))z=_*1000;else z=Date.parse(X)-Date.now()}if(z===void 0){let _=$.maxRetries??this.maxRetries;z=this.calculateDefaultRetryTimeoutMillis(U,_)}return await e$(z),this.makeRequest($,U-1,w)}calculateDefaultRetryTimeoutMillis($,U){let z=U-$,G=Math.min(0.5*Math.pow(2,z),8),X=1-Math.random()*0.25;return G*X*1000}async buildRequest($,{retryCount:U=0}={}){let w={...$},{method:J,path:z,query:G,defaultBaseURL:X}=w,_=this.buildURL(z,G,X);if("timeout"in w)yY("timeout",w.timeout);w.timeout=w.timeout??this.timeout;let{bodyHeaders:N,body:W,isStreamingBody:Y}=this.buildBody({options:w});if(Y)$.__metadata={...$.__metadata,hasStreamingBody:!0};let Q=await this.buildHeaders({options:$,method:J,bodyHeaders:N,retryCount:U});return{req:{method:J,headers:Q,...w.signal&&{signal:w.signal},...globalThis.ReadableStream&&W instanceof globalThis.ReadableStream&&{duplex:"half"},...W&&{body:W},...this.fetchOptions??{},...w.fetchOptions??{}},url:_,timeout:w.timeout}}async buildHeaders({options:$,method:U,bodyHeaders:w,retryCount:J}){let z={};if(this.idempotencyHeader&&U!=="get"){if(!$.idempotencyKey)$.idempotencyKey=this.defaultIdempotencyKey();z[this.idempotencyHeader]=$.idempotencyKey}let G=F([z,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(J),...$.timeout?{"X-Stainless-Timeout":String(Math.trunc($.timeout/1000))}:{},...lY(),"OpenAI-Organization":this.organization,"OpenAI-Project":this.project},this._provider?void 0:await this.authHeaders($,$.__security??{bearerAuth:!0}),this._options.defaultHeaders,w,$.headers]);if(!this._provider)this.validateHeaders(G,$.__security??{bearerAuth:!0});return G.values}_makeAbort($){return()=>$.abort()}buildBody({options:$}){let{body:U,headers:w}=$;if(!U){if(U===void 0&&"body"in $)return{...L(this,f1,"f").call(this,{body:U,headers:F([w])}),isStreamingBody:!1};return{bodyHeaders:void 0,body:void 0,isStreamingBody:!1}}let J=F([w]),z=typeof globalThis.ReadableStream<"u"&&U instanceof globalThis.ReadableStream,G=!z&&(typeof U==="string"||U instanceof ArrayBuffer||ArrayBuffer.isView(U)||typeof globalThis.Blob<"u"&&U instanceof globalThis.Blob||U instanceof URLSearchParams||U instanceof FormData);if(ArrayBuffer.isView(U)||U instanceof ArrayBuffer||U instanceof DataView||typeof U==="string"&&J.values.has("content-type")||globalThis.Blob&&U instanceof globalThis.Blob||U instanceof FormData||U instanceof URLSearchParams||z)return{bodyHeaders:void 0,body:U,isStreamingBody:!G};else if(typeof U==="object"&&((Symbol.asyncIterator in U)||(Symbol.iterator in U)&&("next"in U)&&typeof U.next==="function"))return{bodyHeaders:void 0,body:l0(U),isStreamingBody:!0};else if(typeof U==="object"&&J.values.get("content-type")==="application/x-www-form-urlencoded")return{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(U),isStreamingBody:!1};else return{...L(this,f1,"f").call(this,{body:U,headers:J}),isStreamingBody:!1}}}iG=i,f1=new WeakMap,yG=new WeakSet,$5=function(){return this._provider!==void 0||this.baseURL!=="https://api.openai.com/v1"};i.OpenAI=iG;i.DEFAULT_TIMEOUT=600000;i.OpenAIError=A;i.APIError=z$;i.APIConnectionError=s4;i.APIConnectionTimeoutError=$6;i.APIUserAbortError=N$;i.NotFoundError=Qw;i.ConflictError=Vw;i.RateLimitError=Bw;i.BadRequestError=Nw;i.AuthenticationError=Ww;i.InternalServerError=qw;i.PermissionDeniedError=Yw;i.UnprocessableEntityError=gw;i.InvalidWebhookSignatureError=g4;i.toFile=h6;i.Completions=s6;i.Chat=J6;i.Embeddings=UU;i.Files=zU;i.Images=_U;i.Audio=I4;i.Moderations=WU;i.Models=NU;i.FineTuning=w4;i.Graders=H6;i.VectorStores=k4;i.Webhooks=gU;i.Beta=U4;i.Batches=a6;i.Uploads=K6;i.Admin=X6;i.Responses=K4;i.Realtime=f4;i.Conversations=B6;i.Evals=q6;i.Containers=g6;i.Skills=R4;i.Videos=QU;function $K($){if(UK($))return"Connection error. This may be caused by passing an undici dispatcher, such as ProxyAgent, that is incompatible with the fetch implementation. If you are using undici's ProxyAgent, pass the fetch implementation from the same undici package: import { fetch, ProxyAgent } from 'undici'; new OpenAI({ fetch, fetchOptions: { dispatcher: new ProxyAgent(...) } });";return}function UK($){let U=$;for(let w=0;w<8&&U&&typeof U==="object";w++){let J=U;if(J.code==="UND_ERR_INVALID_ARG"&&typeof J.message==="string"&&J.message.includes("invalid onRequestStart method"))return!0;U=J.cause}return!1}async function NK($){if($.source==="-"){let w=[];for await(let z of process.stdin)w.push(typeof z==="string"?Buffer.from(z):z);let J=Buffer.concat(w);return{...$,data:J,fileName:$.name??`stdin${gK($.mime)}`}}if(VK($.source)){let w=await fetch($.source);if(!w.ok)throw Error(`Failed to fetch asset ${$.source}: ${w.status} ${w.statusText}`);let J=new Uint8Array(await w.arrayBuffer()),z=new URL($.source),G=($.name??U5(z.pathname))||"asset";return{...$,mime:$.mime??w.headers.get("content-type")??void 0,data:J,fileName:G}}if(!z5($.source))throw Error(`Asset not found: ${$.source}`);let U=await JK($.source);return{...$,mime:$.mime??Kz($.source),data:U,fileName:$.name??U5($.source)}}async function Lz($){let U=await NK($);return h6(U.data,U.fileName,{type:U.mime??Kz(U.fileName)})}function mG($,U){let w=[],J=$===void 0?[]:Array.isArray($)?$:[$];for(let z of J)w.push({role:"image",source:z,mime:Kz(z)});if(U)w.push({role:"mask",source:U,mime:Kz(U)});return w}async function Pz($){let U=WK($.format),w=YK({output:$.output,index:$.index,total:$.total,format:U,defaultName:$.defaultName});await zK(GK(w),{recursive:!0});let J=typeof $.data==="string"?Buffer.from($.data,"base64"):Buffer.from($.data);return await J5(w,J),w}async function G5($){let U=await fetch($.url);if(!U.ok)throw Error(`Failed to download generated asset: ${U.status} ${U.statusText}`);let w=new Uint8Array(await U.arrayBuffer());return Pz({...$,data:w})}async function Oz($,U,w){for(let J of $.outputs){let z=`${J}.json`,G={...$,operation:w,prompt:U.prompt,params:U.params??{},output:J,createdAt:new Date().toISOString()};await J5(z,`${JSON.stringify(G,null,2)}
|
|
190
|
-
`)}}function Kz($){switch(XK($).toLowerCase()){case".png":return"image/png";case".jpg":case".jpeg":return"image/jpeg";case".webp":return"image/webp";case".gif":return"image/gif";case".mp3":return"audio/mpeg";case".wav":return"audio/wav";case".mp4":return"video/mp4";default:return}}function WK($){if(!$)return"png";return $.replace(/^\./,"").toLowerCase()}function YK($){let U=$.output;if(!U)return hG(process.cwd(),`${$.defaultName}${w5($.index,$.total)}.${$.format}`);if(U.endsWith("/")||z5(U)&&QK(U))return hG(U,`${$.defaultName}${w5($.index,$.total)}.${$.format}`);if($.total<=1)return U;let w=_K(U);return hG(w.dir,`${w.name}-${$.index+1}${w.ext||`.${$.format}`}`)}function w5($,U){return U<=1?"":`-${$+1}`}function QK($){try{return wK($).isDirectory()}catch{return!1}}function VK($){return $.startsWith("http://")||$.startsWith("https://")}function gK($){if(!$)return"";switch($){case"image/png":return".png";case"image/jpeg":return".jpg";case"image/webp":return".webp";default:return""}}import{chmodSync as JO,existsSync as GO,mkdirSync as XO,readFileSync as _O,writeFileSync as NO}from"node:fs";import{dirname as WO,join as YO}from"node:path";var y={};Y4(y,{xor:()=>C7,xid:()=>X7,void:()=>A7,uuidv7:()=>e5,uuidv6:()=>o5,uuidv4:()=>a5,uuid:()=>t5,util:()=>v,url:()=>s5,uppercase:()=>FU,unknown:()=>M6,union:()=>t2,undefined:()=>b7,ulid:()=>G7,uint64:()=>M7,uint32:()=>D7,tuple:()=>Y3,trim:()=>AU,treeifyError:()=>UX,transform:()=>o2,toUpperCase:()=>RU,toLowerCase:()=>fU,toJSONSchema:()=>T2,templateLiteral:()=>o7,symbol:()=>S7,superRefine:()=>x3,success:()=>n7,stringbool:()=>GV,stringFormat:()=>I7,string:()=>w0,strictObject:()=>j7,startsWith:()=>MU,slugify:()=>kU,size:()=>D6,setErrorMap:()=>nP,set:()=>m7,safeParseAsync:()=>x9,safeParse:()=>C9,safeEncodeAsync:()=>l9,safeEncode:()=>c9,safeDecodeAsync:()=>d9,safeDecode:()=>r9,registry:()=>nz,regexes:()=>x$,regex:()=>ZU,refine:()=>C3,record:()=>Q3,readonly:()=>A3,property:()=>K2,promise:()=>e7,prettifyError:()=>wX,preprocess:()=>_V,prefault:()=>Z3,positive:()=>B2,pipe:()=>b2,partialRecord:()=>y7,parseAsync:()=>u9,parse:()=>j9,overwrite:()=>p$,optional:()=>J0,object:()=>k7,number:()=>p9,nullish:()=>d7,nullable:()=>G0,null:()=>s9,normalize:()=>EU,nonpositive:()=>H2,nonoptional:()=>D3,nonnegative:()=>I2,never:()=>p2,negative:()=>q2,nativeEnum:()=>c7,nanoid:()=>w7,nan:()=>p7,multipleOf:()=>y4,minSize:()=>X4,minLength:()=>P4,mime:()=>bU,meta:()=>zV,maxSize:()=>i4,maxLength:()=>F6,map:()=>h7,mac:()=>W7,lte:()=>y$,lt:()=>J4,lowercase:()=>DU,looseRecord:()=>i7,looseObject:()=>u7,locales:()=>e1,literal:()=>r7,length:()=>v6,lazy:()=>k3,ksuid:()=>_7,keyof:()=>R7,jwt:()=>H7,json:()=>XV,iso:()=>CU,ipv6:()=>Y7,ipv4:()=>N7,invertCodec:()=>a7,intersection:()=>N3,int64:()=>v7,int32:()=>Z7,int:()=>S2,instanceof:()=>JV,includes:()=>vU,httpUrl:()=>$7,hostname:()=>K7,hex:()=>L7,hash:()=>P7,guid:()=>p5,gte:()=>v$,gt:()=>G4,globalRegistry:()=>q$,getErrorMap:()=>pP,function:()=>s7,fromJSONSchema:()=>WV,formatError:()=>h1,float64:()=>T7,float32:()=>O7,flattenError:()=>i1,file:()=>l7,exactOptional:()=>K3,enum:()=>a2,endsWith:()=>SU,encodeAsync:()=>h9,encode:()=>y9,emoji:()=>U7,email:()=>n5,e164:()=>q7,discriminatedUnion:()=>x7,describe:()=>wV,decodeAsync:()=>m9,decode:()=>i9,date:()=>f7,custom:()=>UV,cuid2:()=>J7,cuid:()=>z7,core:()=>O4,config:()=>G$,coerce:()=>i3,codec:()=>t7,clone:()=>D$,cidrv6:()=>V7,cidrv4:()=>Q7,check:()=>$V,catch:()=>M3,boolean:()=>t9,bigint:()=>F7,base64url:()=>B7,base64:()=>g7,array:()=>W0,any:()=>E7,_function:()=>s7,_default:()=>O3,_ZodString:()=>E2,ZodXor:()=>G3,ZodXID:()=>C2,ZodVoid:()=>z3,ZodUnknown:()=>U3,ZodUnion:()=>Q0,ZodUndefined:()=>o9,ZodUUID:()=>_4,ZodURL:()=>_0,ZodULID:()=>u2,ZodType:()=>c,ZodTuple:()=>W3,ZodTransform:()=>H3,ZodTemplateLiteral:()=>f3,ZodSymbol:()=>a9,ZodSuccess:()=>F3,ZodStringFormat:()=>s,ZodString:()=>iU,ZodSet:()=>g3,ZodRecord:()=>xU,ZodRealError:()=>E$,ZodReadonly:()=>E3,ZodPromise:()=>j3,ZodPreprocess:()=>b3,ZodPrefault:()=>T3,ZodPipe:()=>V0,ZodOptional:()=>e2,ZodObject:()=>Y0,ZodNumberFormat:()=>S6,ZodNumber:()=>mU,ZodNullable:()=>L3,ZodNull:()=>e9,ZodNonOptional:()=>s2,ZodNever:()=>w3,ZodNanoID:()=>R2,ZodNaN:()=>S3,ZodMap:()=>V3,ZodMAC:()=>n9,ZodLiteral:()=>B3,ZodLazy:()=>R3,ZodKSUID:()=>x2,ZodJWT:()=>d2,ZodIssueCode:()=>dP,ZodIntersection:()=>_3,ZodISOTime:()=>v2,ZodISODuration:()=>M2,ZodISODateTime:()=>D2,ZodISODate:()=>F2,ZodIPv6:()=>i2,ZodIPv4:()=>y2,ZodGUID:()=>z0,ZodFunction:()=>u3,ZodFirstPartyTypeKind:()=>y3,ZodFile:()=>q3,ZodExactOptional:()=>I3,ZodError:()=>rP,ZodEnum:()=>yU,ZodEmoji:()=>f2,ZodEmail:()=>A2,ZodE164:()=>l2,ZodDiscriminatedUnion:()=>X3,ZodDefault:()=>P3,ZodDate:()=>N0,ZodCustomStringFormat:()=>hU,ZodCustom:()=>B0,ZodCodec:()=>g0,ZodCatch:()=>v3,ZodCUID2:()=>j2,ZodCUID:()=>k2,ZodCIDRv6:()=>m2,ZodCIDRv4:()=>h2,ZodBoolean:()=>cU,ZodBigIntFormat:()=>n2,ZodBigInt:()=>rU,ZodBase64URL:()=>r2,ZodBase64:()=>c2,ZodArray:()=>J3,ZodAny:()=>$3,TimePrecision:()=>Y8,NEVER:()=>cG,$output:()=>J8,$input:()=>G8,$brand:()=>rG});var O4={};Y4(O4,{version:()=>eX,util:()=>v,treeifyError:()=>UX,toJSONSchema:()=>T2,toDotPath:()=>V5,safeParseAsync:()=>JX,safeParse:()=>zX,safeEncodeAsync:()=>dK,safeEncode:()=>rK,safeDecodeAsync:()=>nK,safeDecode:()=>lK,registry:()=>nz,regexes:()=>x$,process:()=>a,prettifyError:()=>wX,parseAsync:()=>Fz,parse:()=>Dz,meta:()=>r8,locales:()=>e1,isValidJWT:()=>k5,isValidBase64URL:()=>R5,isValidBase64:()=>P_,initializeContext:()=>h4,globalRegistry:()=>q$,globalConfig:()=>L6,formatError:()=>h1,flattenError:()=>i1,finalize:()=>c4,extractDefs:()=>m4,encodeAsync:()=>mK,encode:()=>iK,describe:()=>c8,decodeAsync:()=>cK,decode:()=>hK,createToJSONSchemaMethod:()=>d8,createStandardJSONSchemaMethod:()=>uU,config:()=>G$,clone:()=>D$,_xor:()=>PP,_xid:()=>J2,_void:()=>k8,_uuidv7:()=>ez,_uuidv6:()=>oz,_uuidv4:()=>az,_uuid:()=>tz,_url:()=>$0,_uppercase:()=>FU,_unknown:()=>f8,_union:()=>LP,_undefined:()=>b8,_ulid:()=>z2,_uint64:()=>M8,_uint32:()=>O8,_tuple:()=>ZP,_trim:()=>AU,_transform:()=>EP,_toUpperCase:()=>RU,_toLowerCase:()=>fU,_templateLiteral:()=>yP,_symbol:()=>S8,_superRefine:()=>m8,_success:()=>jP,_stringbool:()=>l8,_stringFormat:()=>jU,_string:()=>_8,_startsWith:()=>MU,_slugify:()=>kU,_size:()=>D6,_set:()=>vP,_safeParseAsync:()=>PU,_safeParse:()=>LU,_safeEncodeAsync:()=>fz,_safeEncode:()=>Ez,_safeDecodeAsync:()=>Rz,_safeDecode:()=>Az,_regex:()=>ZU,_refine:()=>h8,_record:()=>DP,_readonly:()=>xP,_property:()=>K2,_promise:()=>hP,_positive:()=>B2,_pipe:()=>CP,_parseAsync:()=>KU,_parse:()=>IU,_overwrite:()=>p$,_optional:()=>AP,_number:()=>q8,_nullable:()=>fP,_null:()=>E8,_normalize:()=>EU,_nonpositive:()=>H2,_nonoptional:()=>kP,_nonnegative:()=>I2,_never:()=>R8,_negative:()=>q2,_nativeEnum:()=>SP,_nanoid:()=>$2,_nan:()=>C8,_multipleOf:()=>y4,_minSize:()=>X4,_minLength:()=>P4,_min:()=>v$,_mime:()=>bU,_maxSize:()=>i4,_maxLength:()=>F6,_max:()=>y$,_map:()=>FP,_mac:()=>W8,_lte:()=>y$,_lt:()=>J4,_lowercase:()=>DU,_literal:()=>bP,_length:()=>v6,_lazy:()=>iP,_ksuid:()=>G2,_jwt:()=>g2,_isoTime:()=>g8,_isoDuration:()=>B8,_isoDateTime:()=>Q8,_isoDate:()=>V8,_ipv6:()=>_2,_ipv4:()=>X2,_intersection:()=>TP,_int64:()=>v8,_int32:()=>P8,_int:()=>I8,_includes:()=>vU,_guid:()=>s1,_gte:()=>v$,_gt:()=>G4,_float64:()=>L8,_float32:()=>K8,_file:()=>y8,_enum:()=>MP,_endsWith:()=>SU,_encodeAsync:()=>Sz,_encode:()=>vz,_emoji:()=>sz,_email:()=>pz,_e164:()=>V2,_discriminatedUnion:()=>OP,_default:()=>RP,_decodeAsync:()=>bz,_decode:()=>Mz,_date:()=>j8,_custom:()=>i8,_cuid2:()=>w2,_cuid:()=>U2,_coercedString:()=>N8,_coercedNumber:()=>H8,_coercedDate:()=>u8,_coercedBoolean:()=>Z8,_coercedBigint:()=>F8,_cidrv6:()=>W2,_cidrv4:()=>N2,_check:()=>c5,_catch:()=>uP,_boolean:()=>T8,_bigint:()=>D8,_base64url:()=>Q2,_base64:()=>Y2,_array:()=>x8,_any:()=>A8,TimePrecision:()=>Y8,NEVER:()=>cG,JSONSchemaGenerator:()=>E9,JSONSchema:()=>r5,Doc:()=>Cz,$output:()=>J8,$input:()=>G8,$constructor:()=>K,$brand:()=>rG,$ZodXor:()=>x_,$ZodXID:()=>W_,$ZodVoid:()=>k_,$ZodUnknown:()=>f_,$ZodUnion:()=>d1,$ZodUndefined:()=>b_,$ZodUUID:()=>U_,$ZodURL:()=>z_,$ZodULID:()=>N_,$ZodType:()=>m,$ZodTuple:()=>rz,$ZodTransform:()=>n_,$ZodTemplateLiteral:()=>JN,$ZodSymbol:()=>S_,$ZodSuccess:()=>s_,$ZodStringFormat:()=>e,$ZodString:()=>Z6,$ZodSet:()=>c_,$ZodRegistry:()=>X8,$ZodRecord:()=>h_,$ZodRealError:()=>b$,$ZodReadonly:()=>zN,$ZodPromise:()=>XN,$ZodPreprocess:()=>wN,$ZodPrefault:()=>o_,$ZodPipe:()=>dz,$ZodOptional:()=>lz,$ZodObjectJIT:()=>C_,$ZodObject:()=>C5,$ZodNumberFormat:()=>v_,$ZodNumber:()=>mz,$ZodNullable:()=>t_,$ZodNull:()=>E_,$ZodNonOptional:()=>e_,$ZodNever:()=>R_,$ZodNanoID:()=>G_,$ZodNaN:()=>UN,$ZodMap:()=>m_,$ZodMAC:()=>I_,$ZodLiteral:()=>l_,$ZodLazy:()=>_N,$ZodKSUID:()=>Y_,$ZodJWT:()=>D_,$ZodIntersection:()=>i_,$ZodISOTime:()=>g_,$ZodISODuration:()=>B_,$ZodISODateTime:()=>Q_,$ZodISODate:()=>V_,$ZodIPv6:()=>H_,$ZodIPv4:()=>q_,$ZodGUID:()=>$_,$ZodFunction:()=>GN,$ZodFile:()=>d_,$ZodExactOptional:()=>p_,$ZodError:()=>y1,$ZodEnum:()=>r_,$ZodEncodeError:()=>P6,$ZodEmoji:()=>J_,$ZodEmail:()=>w_,$ZodE164:()=>Z_,$ZodDiscriminatedUnion:()=>y_,$ZodDefault:()=>a_,$ZodDate:()=>j_,$ZodCustomStringFormat:()=>F_,$ZodCustom:()=>NN,$ZodCodec:()=>n1,$ZodCheckUpperCase:()=>lX,$ZodCheckStringFormat:()=>OU,$ZodCheckStartsWith:()=>nX,$ZodCheckSizeEquals:()=>yX,$ZodCheckRegex:()=>cX,$ZodCheckProperty:()=>tX,$ZodCheckOverwrite:()=>oX,$ZodCheckNumberFormat:()=>jX,$ZodCheckMultipleOf:()=>kX,$ZodCheckMinSize:()=>xX,$ZodCheckMinLength:()=>hX,$ZodCheckMimeType:()=>aX,$ZodCheckMaxSize:()=>CX,$ZodCheckMaxLength:()=>iX,$ZodCheckLowerCase:()=>rX,$ZodCheckLessThan:()=>jz,$ZodCheckLengthEquals:()=>mX,$ZodCheckIncludes:()=>dX,$ZodCheckGreaterThan:()=>uz,$ZodCheckEndsWith:()=>pX,$ZodCheckBigIntFormat:()=>uX,$ZodCheck:()=>$$,$ZodCatch:()=>$N,$ZodCUID2:()=>__,$ZodCUID:()=>X_,$ZodCIDRv6:()=>L_,$ZodCIDRv4:()=>K_,$ZodBoolean:()=>l1,$ZodBigIntFormat:()=>M_,$ZodBigInt:()=>cz,$ZodBase64URL:()=>T_,$ZodBase64:()=>O_,$ZodAsyncError:()=>z4,$ZodArray:()=>u_,$ZodAny:()=>A_});var X5,cG=Object.freeze({status:"aborted"});function K($,U,w){function J(_,N){if(!_._zod)Object.defineProperty(_,"_zod",{value:{def:N,constr:X,traits:new Set},enumerable:!1});if(_._zod.traits.has($))return;_._zod.traits.add($),U(_,N);let W=X.prototype,Y=Object.keys(W);for(let Q=0;Q<Y.length;Q++){let V=Y[Q];if(!(V in _))_[V]=W[V].bind(_)}}let z=w?.Parent??Object;class G extends z{}Object.defineProperty(G,"name",{value:$});function X(_){var N;let W=w?.Parent?new G:this;J(W,_),(N=W._zod).deferred??(N.deferred=[]);for(let Y of W._zod.deferred)Y();return W}return Object.defineProperty(X,"init",{value:J}),Object.defineProperty(X,Symbol.hasInstance,{value:(_)=>{if(w?.Parent&&_ instanceof w.Parent)return!0;return _?._zod?.traits?.has($)}}),Object.defineProperty(X,"name",{value:$}),X}var rG=Symbol("zod_brand");class z4 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class P6 extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}}(X5=globalThis).__zod_globalConfig??(X5.__zod_globalConfig={});var L6=globalThis.__zod_globalConfig;function G$($){if($)Object.assign(L6,$);return L6}var v={};Y4(v,{unwrapMessage:()=>R1,uint8ArrayToHex:()=>xK,uint8ArrayToBase64url:()=>uK,uint8ArrayToBase64:()=>W5,stringifyPrimitive:()=>Z,slugify:()=>nG,shallowClone:()=>tG,safeExtend:()=>EK,required:()=>RK,randomString:()=>ZK,propertyKeyTypes:()=>u1,promiseAllObject:()=>TK,primitiveTypes:()=>aG,prefixIssues:()=>S$,pick:()=>MK,partial:()=>fK,parsedType:()=>D,optionalKeys:()=>oG,omit:()=>SK,objectClone:()=>LK,numKeys:()=>DK,nullish:()=>j4,normalizeParams:()=>b,mergeDefs:()=>L4,merge:()=>AK,jsonStringifyReplacer:()=>BU,joinValues:()=>P,issue:()=>HU,isPlainObject:()=>C4,isObject:()=>O6,hexToUint8Array:()=>CK,getSizableOrigin:()=>C1,getParsedType:()=>FK,getLengthableOrigin:()=>x1,getEnumValues:()=>k1,getElementAtPath:()=>OK,floatSafeRemainder:()=>dG,finalizeIssue:()=>F$,extend:()=>bK,explicitlyAborted:()=>$X,escapeRegex:()=>m$,esc:()=>Tz,defineLazy:()=>r,createTransparentProxy:()=>vK,cloneDef:()=>PK,clone:()=>D$,cleanRegex:()=>j1,cleanEnum:()=>kK,captureStackTrace:()=>Zz,cached:()=>qU,base64urlToUint8Array:()=>jK,base64ToUint8Array:()=>N5,assignProp:()=>u4,assertNotEqual:()=>qK,assertNever:()=>IK,assertIs:()=>HK,assertEqual:()=>BK,assert:()=>KK,allowsEval:()=>pG,aborted:()=>x4,NUMBER_FORMAT_RANGES:()=>eG,Class:()=>Y5,BIGINT_FORMAT_RANGES:()=>sG});function BK($){return $}function qK($){return $}function HK($){}function IK($){throw Error("Unexpected value in exhaustive check")}function KK($){}function k1($){let U=Object.values($).filter((J)=>typeof J==="number");return Object.entries($).filter(([J,z])=>U.indexOf(+J)===-1).map(([J,z])=>z)}function P($,U="|"){return $.map((w)=>Z(w)).join(U)}function BU($,U){if(typeof U==="bigint")return U.toString();return U}function qU($){return{get value(){{let w=$();return Object.defineProperty(this,"value",{value:w}),w}throw Error("cached value already set")}}}function j4($){return $===null||$===void 0}function j1($){let U=$.startsWith("^")?1:0,w=$.endsWith("$")?$.length-1:$.length;return $.slice(U,w)}function dG($,U){let w=$/U,J=Math.round(w),z=Number.EPSILON*Math.max(Math.abs(w),1);if(Math.abs(w-J)<z)return 0;return w-J}var _5=Symbol("evaluating");function r($,U,w){let J=void 0;Object.defineProperty($,U,{get(){if(J===_5)return;if(J===void 0)J=_5,J=w();return J},set(z){Object.defineProperty($,U,{value:z})},configurable:!0})}function LK($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function u4($,U,w){Object.defineProperty($,U,{value:w,writable:!0,enumerable:!0,configurable:!0})}function L4(...$){let U={};for(let w of $){let J=Object.getOwnPropertyDescriptors(w);Object.assign(U,J)}return Object.defineProperties({},U)}function PK($){return L4($._zod.def)}function OK($,U){if(!U)return $;return U.reduce((w,J)=>w?.[J],$)}function TK($){let U=Object.keys($),w=U.map((J)=>$[J]);return Promise.all(w).then((J)=>{let z={};for(let G=0;G<U.length;G++)z[U[G]]=J[G];return z})}function ZK($=10){let w="";for(let J=0;J<$;J++)w+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return w}function Tz($){return JSON.stringify($)}function nG($){return $.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Zz="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};function O6($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var pG=qU(()=>{if(L6.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function C4($){if(O6($)===!1)return!1;let U=$.constructor;if(U===void 0)return!0;if(typeof U!=="function")return!0;let w=U.prototype;if(O6(w)===!1)return!1;if(Object.prototype.hasOwnProperty.call(w,"isPrototypeOf")===!1)return!1;return!0}function tG($){if(C4($))return{...$};if(Array.isArray($))return[...$];if($ instanceof Map)return new Map($);if($ instanceof Set)return new Set($);return $}function DK($){let U=0;for(let w in $)if(Object.prototype.hasOwnProperty.call($,w))U++;return U}var FK=($)=>{let U=typeof $;switch(U){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: ${U}`)}},u1=new Set(["string","number","symbol"]),aG=new Set(["string","number","bigint","boolean","symbol","undefined"]);function m$($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function D$($,U,w){let J=new $._zod.constr(U??$._zod.def);if(!U||w?.parent)J._zod.parent=$;return J}function b($){let U=$;if(!U)return{};if(typeof U==="string")return{error:()=>U};if(U?.message!==void 0){if(U?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");U.error=U.message}if(delete U.message,typeof U.error==="string")return{...U,error:()=>U.error};return U}function vK($){let U;return new Proxy({},{get(w,J,z){return U??(U=$()),Reflect.get(U,J,z)},set(w,J,z,G){return U??(U=$()),Reflect.set(U,J,z,G)},has(w,J){return U??(U=$()),Reflect.has(U,J)},deleteProperty(w,J){return U??(U=$()),Reflect.deleteProperty(U,J)},ownKeys(w){return U??(U=$()),Reflect.ownKeys(U)},getOwnPropertyDescriptor(w,J){return U??(U=$()),Reflect.getOwnPropertyDescriptor(U,J)},defineProperty(w,J,z){return U??(U=$()),Reflect.defineProperty(U,J,z)}})}function Z($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function oG($){return Object.keys($).filter((U)=>{return $[U]._zod.optin==="optional"&&$[U]._zod.optout==="optional"})}var eG={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]},sG={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function MK($,U){let w=$._zod.def,J=w.checks;if(J&&J.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let G=L4($._zod.def,{get shape(){let X={};for(let _ in U){if(!(_ in w.shape))throw Error(`Unrecognized key: "${_}"`);if(!U[_])continue;X[_]=w.shape[_]}return u4(this,"shape",X),X},checks:[]});return D$($,G)}function SK($,U){let w=$._zod.def,J=w.checks;if(J&&J.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let G=L4($._zod.def,{get shape(){let X={...$._zod.def.shape};for(let _ in U){if(!(_ in w.shape))throw Error(`Unrecognized key: "${_}"`);if(!U[_])continue;delete X[_]}return u4(this,"shape",X),X},checks:[]});return D$($,G)}function bK($,U){if(!C4(U))throw Error("Invalid input to extend: expected a plain object");let w=$._zod.def.checks;if(w&&w.length>0){let G=$._zod.def.shape;for(let X in U)if(Object.getOwnPropertyDescriptor(G,X)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let z=L4($._zod.def,{get shape(){let G={...$._zod.def.shape,...U};return u4(this,"shape",G),G}});return D$($,z)}function EK($,U){if(!C4(U))throw Error("Invalid input to safeExtend: expected a plain object");let w=L4($._zod.def,{get shape(){let J={...$._zod.def.shape,...U};return u4(this,"shape",J),J}});return D$($,w)}function AK($,U){if($._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let w=L4($._zod.def,{get shape(){let J={...$._zod.def.shape,...U._zod.def.shape};return u4(this,"shape",J),J},get catchall(){return U._zod.def.catchall},checks:U._zod.def.checks??[]});return D$($,w)}function fK($,U,w){let z=U._zod.def.checks;if(z&&z.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let X=L4(U._zod.def,{get shape(){let _=U._zod.def.shape,N={..._};if(w)for(let W in w){if(!(W in _))throw Error(`Unrecognized key: "${W}"`);if(!w[W])continue;N[W]=$?new $({type:"optional",innerType:_[W]}):_[W]}else for(let W in _)N[W]=$?new $({type:"optional",innerType:_[W]}):_[W];return u4(this,"shape",N),N},checks:[]});return D$(U,X)}function RK($,U,w){let J=L4(U._zod.def,{get shape(){let z=U._zod.def.shape,G={...z};if(w)for(let X in w){if(!(X in G))throw Error(`Unrecognized key: "${X}"`);if(!w[X])continue;G[X]=new $({type:"nonoptional",innerType:z[X]})}else for(let X in z)G[X]=new $({type:"nonoptional",innerType:z[X]});return u4(this,"shape",G),G}});return D$(U,J)}function x4($,U=0){if($.aborted===!0)return!0;for(let w=U;w<$.issues.length;w++)if($.issues[w]?.continue!==!0)return!0;return!1}function $X($,U=0){if($.aborted===!0)return!0;for(let w=U;w<$.issues.length;w++)if($.issues[w]?.continue===!1)return!0;return!1}function S$($,U){return U.map((w)=>{var J;return(J=w).path??(J.path=[]),w.path.unshift($),w})}function R1($){return typeof $==="string"?$:$?.message}function F$($,U,w){let J=$.message?$.message:R1($.inst?._zod.def?.error?.($))??R1(U?.error?.($))??R1(w.customError?.($))??R1(w.localeError?.($))??"Invalid input",{inst:z,continue:G,input:X,..._}=$;if(_.path??(_.path=[]),_.message=J,U?.reportInput)_.input=X;return _}function C1($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function x1($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function D($){let U=typeof $;switch(U){case"number":return Number.isNaN($)?"nan":"number";case"object":{if($===null)return"null";if(Array.isArray($))return"array";let w=$;if(w&&Object.getPrototypeOf(w)!==Object.prototype&&"constructor"in w&&w.constructor)return w.constructor.name}}return U}function HU(...$){let[U,w,J]=$;if(typeof U==="string")return{message:U,code:"custom",input:w,inst:J};return{...U}}function kK($){return Object.entries($).filter(([U,w])=>{return Number.isNaN(Number.parseInt(U,10))}).map((U)=>U[1])}function N5($){let U=atob($),w=new Uint8Array(U.length);for(let J=0;J<U.length;J++)w[J]=U.charCodeAt(J);return w}function W5($){let U="";for(let w=0;w<$.length;w++)U+=String.fromCharCode($[w]);return btoa(U)}function jK($){let U=$.replace(/-/g,"+").replace(/_/g,"/"),w="=".repeat((4-U.length%4)%4);return N5(U+w)}function uK($){return W5($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function CK($){let U=$.replace(/^0x/,"");if(U.length%2!==0)throw Error("Invalid hex string length");let w=new Uint8Array(U.length/2);for(let J=0;J<U.length;J+=2)w[J/2]=Number.parseInt(U.slice(J,J+2),16);return w}function xK($){return Array.from($).map((U)=>U.toString(16).padStart(2,"0")).join("")}class Y5{constructor(...$){}}var Q5=($,U)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:U,enumerable:!1}),$.message=JSON.stringify(U,BU,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},y1=K("$ZodError",Q5),b$=K("$ZodError",Q5,{Parent:Error});function i1($,U=(w)=>w.message){let w={},J=[];for(let z of $.issues)if(z.path.length>0)w[z.path[0]]=w[z.path[0]]||[],w[z.path[0]].push(U(z));else J.push(U(z));return{formErrors:J,fieldErrors:w}}function h1($,U=(w)=>w.message){let w={_errors:[]},J=(z,G=[])=>{for(let X of z.issues)if(X.code==="invalid_union"&&X.errors.length)X.errors.map((_)=>J({issues:_},[...G,...X.path]));else if(X.code==="invalid_key")J({issues:X.issues},[...G,...X.path]);else if(X.code==="invalid_element")J({issues:X.issues},[...G,...X.path]);else{let _=[...G,...X.path];if(_.length===0)w._errors.push(U(X));else{let N=w,W=0;while(W<_.length){let Y=_[W];if(W!==_.length-1)N[Y]=N[Y]||{_errors:[]};else N[Y]=N[Y]||{_errors:[]},N[Y]._errors.push(U(X));N=N[Y],W++}}}};return J($),w}function UX($,U=(w)=>w.message){let w={errors:[]},J=(z,G=[])=>{var X,_;for(let N of z.issues)if(N.code==="invalid_union"&&N.errors.length)N.errors.map((W)=>J({issues:W},[...G,...N.path]));else if(N.code==="invalid_key")J({issues:N.issues},[...G,...N.path]);else if(N.code==="invalid_element")J({issues:N.issues},[...G,...N.path]);else{let W=[...G,...N.path];if(W.length===0){w.errors.push(U(N));continue}let Y=w,Q=0;while(Q<W.length){let V=W[Q],g=Q===W.length-1;if(typeof V==="string")Y.properties??(Y.properties={}),(X=Y.properties)[V]??(X[V]={errors:[]}),Y=Y.properties[V];else Y.items??(Y.items=[]),(_=Y.items)[V]??(_[V]={errors:[]}),Y=Y.items[V];if(g)Y.errors.push(U(N));Q++}}};return J($),w}function V5($){let U=[],w=$.map((J)=>typeof J==="object"?J.key:J);for(let J of w)if(typeof J==="number")U.push(`[${J}]`);else if(typeof J==="symbol")U.push(`[${JSON.stringify(String(J))}]`);else if(/[^\w$]/.test(J))U.push(`[${JSON.stringify(J)}]`);else{if(U.length)U.push(".");U.push(J)}return U.join("")}function wX($){let U=[],w=[...$.issues].sort((J,z)=>(J.path??[]).length-(z.path??[]).length);for(let J of w)if(U.push(`✖ ${J.message}`),J.path?.length)U.push(` → at ${V5(J.path)}`);return U.join(`
|
|
191
|
-
`)}var IU=($)=>(U,w,J,z)=>{let G=J?{...J,async:!1}:{async:!1},X=U._zod.run({value:w,issues:[]},G);if(X instanceof Promise)throw new z4;if(X.issues.length){let _=new(z?.Err??$)(X.issues.map((N)=>F$(N,G,G$())));throw Zz(_,z?.callee),_}return X.value},Dz=IU(b$),KU=($)=>async(U,w,J,z)=>{let G=J?{...J,async:!0}:{async:!0},X=U._zod.run({value:w,issues:[]},G);if(X instanceof Promise)X=await X;if(X.issues.length){let _=new(z?.Err??$)(X.issues.map((N)=>F$(N,G,G$())));throw Zz(_,z?.callee),_}return X.value},Fz=KU(b$),LU=($)=>(U,w,J)=>{let z=J?{...J,async:!1}:{async:!1},G=U._zod.run({value:w,issues:[]},z);if(G instanceof Promise)throw new z4;return G.issues.length?{success:!1,error:new($??y1)(G.issues.map((X)=>F$(X,z,G$())))}:{success:!0,data:G.value}},zX=LU(b$),PU=($)=>async(U,w,J)=>{let z=J?{...J,async:!0}:{async:!0},G=U._zod.run({value:w,issues:[]},z);if(G instanceof Promise)G=await G;return G.issues.length?{success:!1,error:new $(G.issues.map((X)=>F$(X,z,G$())))}:{success:!0,data:G.value}},JX=PU(b$),vz=($)=>(U,w,J)=>{let z=J?{...J,direction:"backward"}:{direction:"backward"};return IU($)(U,w,z)},iK=vz(b$),Mz=($)=>(U,w,J)=>{return IU($)(U,w,J)},hK=Mz(b$),Sz=($)=>async(U,w,J)=>{let z=J?{...J,direction:"backward"}:{direction:"backward"};return KU($)(U,w,z)},mK=Sz(b$),bz=($)=>async(U,w,J)=>{return KU($)(U,w,J)},cK=bz(b$),Ez=($)=>(U,w,J)=>{let z=J?{...J,direction:"backward"}:{direction:"backward"};return LU($)(U,w,z)},rK=Ez(b$),Az=($)=>(U,w,J)=>{return LU($)(U,w,J)},lK=Az(b$),fz=($)=>async(U,w,J)=>{let z=J?{...J,direction:"backward"}:{direction:"backward"};return PU($)(U,w,z)},dK=fz(b$),Rz=($)=>async(U,w,J)=>{return PU($)(U,w,J)},nK=Rz(b$);var x$={};Y4(x$,{xid:()=>NX,uuid7:()=>oK,uuid6:()=>aK,uuid4:()=>tK,uuid:()=>T6,uppercase:()=>RX,unicodeEmail:()=>g5,undefined:()=>AX,ulid:()=>_X,time:()=>DX,string:()=>vX,sha512_hex:()=>KL,sha512_base64url:()=>PL,sha512_base64:()=>LL,sha384_hex:()=>qL,sha384_base64url:()=>IL,sha384_base64:()=>HL,sha256_hex:()=>VL,sha256_base64url:()=>BL,sha256_base64:()=>gL,sha1_hex:()=>WL,sha1_base64url:()=>QL,sha1_base64:()=>YL,rfc5322Email:()=>sK,number:()=>m1,null:()=>EX,nanoid:()=>YX,md5_hex:()=>XL,md5_base64url:()=>NL,md5_base64:()=>_L,mac:()=>IX,lowercase:()=>fX,ksuid:()=>WX,ipv6:()=>HX,ipv4:()=>qX,integer:()=>SX,idnEmail:()=>$L,httpProtocol:()=>OX,html5Email:()=>eK,hostname:()=>zL,hex:()=>GL,guid:()=>VX,extendedDuration:()=>pK,emoji:()=>BX,email:()=>gX,e164:()=>TX,duration:()=>QX,domain:()=>JL,datetime:()=>FX,date:()=>ZX,cuid2:()=>XX,cuid:()=>GX,cidrv6:()=>LX,cidrv4:()=>KX,browserEmail:()=>UL,boolean:()=>bX,bigint:()=>MX,base64url:()=>kz,base64:()=>PX});var GX=/^[cC][0-9a-z]{6,}$/,XX=/^[0-9a-z]+$/,_X=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,NX=/^[0-9a-vA-V]{20}$/,WX=/^[A-Za-z0-9]{27}$/,YX=/^[a-zA-Z0-9_-]{21}$/,QX=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,pK=/^[-+]?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)?)??$/,VX=/^([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})$`)},tK=T6(4),aK=T6(6),oK=T6(7),gX=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,eK=/^[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])?)*$/,sK=/^(([^<>()\[\]\\.,;:\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,}))$/,g5=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,$L=g5,UL=/^[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])?)*$/,wL="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function BX(){return new RegExp(wL,"u")}var qX=/^(?:(?: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])$/,HX=/^(([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}|:))$/,IX=($)=>{let U=m$($??":");return new RegExp(`^(?:[0-9A-F]{2}${U}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${U}){5}[0-9a-f]{2}$`)},KX=/^((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])$/,LX=/^(([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])$/,PX=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,kz=/^[A-Za-z0-9_-]*$/,zL=/^(?=.{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])?)*\.?$/,JL=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,OX=/^https?$/,TX=/^\+[1-9]\d{6,14}$/,B5="(?:(?:\\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])))",ZX=new RegExp(`^${B5}$`);function q5($){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 DX($){return new RegExp(`^${q5($)}$`)}function FX($){let U=q5({precision:$.precision}),w=["Z"];if($.local)w.push("");if($.offset)w.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let J=`${U}(?:${w.join("|")})`;return new RegExp(`^${B5}T(?:${J})$`)}var vX=($)=>{let U=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${U}$`)},MX=/^-?\d+n?$/,SX=/^-?\d+$/,m1=/^-?\d+(?:\.\d+)?$/,bX=/^(?:true|false)$/i,EX=/^null$/i;var AX=/^undefined$/i;var fX=/^[^A-Z]*$/,RX=/^[^a-z]*$/,GL=/^[0-9a-fA-F]*$/;function c1($,U){return new RegExp(`^[A-Za-z0-9+/]{${$}}${U}$`)}function r1($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var XL=/^[0-9a-fA-F]{32}$/,_L=c1(22,"=="),NL=r1(22),WL=/^[0-9a-fA-F]{40}$/,YL=c1(27,"="),QL=r1(27),VL=/^[0-9a-fA-F]{64}$/,gL=c1(43,"="),BL=r1(43),qL=/^[0-9a-fA-F]{96}$/,HL=c1(64,""),IL=r1(64),KL=/^[0-9a-fA-F]{128}$/,LL=c1(86,"=="),PL=r1(86);var $$=K("$ZodCheck",($,U)=>{var w;$._zod??($._zod={}),$._zod.def=U,(w=$._zod).onattach??(w.onattach=[])}),I5={number:"number",bigint:"bigint",object:"date"},jz=K("$ZodCheckLessThan",($,U)=>{$$.init($,U);let w=I5[typeof U.value];$._zod.onattach.push((J)=>{let z=J._zod.bag,G=(U.inclusive?z.maximum:z.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(U.value<G)if(U.inclusive)z.maximum=U.value;else z.exclusiveMaximum=U.value}),$._zod.check=(J)=>{if(U.inclusive?J.value<=U.value:J.value<U.value)return;J.issues.push({origin:w,code:"too_big",maximum:typeof U.value==="object"?U.value.getTime():U.value,input:J.value,inclusive:U.inclusive,inst:$,continue:!U.abort})}}),uz=K("$ZodCheckGreaterThan",($,U)=>{$$.init($,U);let w=I5[typeof U.value];$._zod.onattach.push((J)=>{let z=J._zod.bag,G=(U.inclusive?z.minimum:z.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(U.value>G)if(U.inclusive)z.minimum=U.value;else z.exclusiveMinimum=U.value}),$._zod.check=(J)=>{if(U.inclusive?J.value>=U.value:J.value>U.value)return;J.issues.push({origin:w,code:"too_small",minimum:typeof U.value==="object"?U.value.getTime():U.value,input:J.value,inclusive:U.inclusive,inst:$,continue:!U.abort})}}),kX=K("$ZodCheckMultipleOf",($,U)=>{$$.init($,U),$._zod.onattach.push((w)=>{var J;(J=w._zod.bag).multipleOf??(J.multipleOf=U.value)}),$._zod.check=(w)=>{if(typeof w.value!==typeof U.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof w.value==="bigint"?w.value%U.value===BigInt(0):dG(w.value,U.value)===0)return;w.issues.push({origin:typeof w.value,code:"not_multiple_of",divisor:U.value,input:w.value,inst:$,continue:!U.abort})}}),jX=K("$ZodCheckNumberFormat",($,U)=>{$$.init($,U),U.format=U.format||"float64";let w=U.format?.includes("int"),J=w?"int":"number",[z,G]=eG[U.format];$._zod.onattach.push((X)=>{let _=X._zod.bag;if(_.format=U.format,_.minimum=z,_.maximum=G,w)_.pattern=SX}),$._zod.check=(X)=>{let _=X.value;if(w){if(!Number.isInteger(_)){X.issues.push({expected:J,format:U.format,code:"invalid_type",continue:!1,input:_,inst:$});return}if(!Number.isSafeInteger(_)){if(_>0)X.issues.push({input:_,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:J,inclusive:!0,continue:!U.abort});else X.issues.push({input:_,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:J,inclusive:!0,continue:!U.abort});return}}if(_<z)X.issues.push({origin:"number",input:_,code:"too_small",minimum:z,inclusive:!0,inst:$,continue:!U.abort});if(_>G)X.issues.push({origin:"number",input:_,code:"too_big",maximum:G,inclusive:!0,inst:$,continue:!U.abort})}}),uX=K("$ZodCheckBigIntFormat",($,U)=>{$$.init($,U);let[w,J]=sG[U.format];$._zod.onattach.push((z)=>{let G=z._zod.bag;G.format=U.format,G.minimum=w,G.maximum=J}),$._zod.check=(z)=>{let G=z.value;if(G<w)z.issues.push({origin:"bigint",input:G,code:"too_small",minimum:w,inclusive:!0,inst:$,continue:!U.abort});if(G>J)z.issues.push({origin:"bigint",input:G,code:"too_big",maximum:J,inclusive:!0,inst:$,continue:!U.abort})}}),CX=K("$ZodCheckMaxSize",($,U)=>{var w;$$.init($,U),(w=$._zod.def).when??(w.when=(J)=>{let z=J.value;return!j4(z)&&z.size!==void 0}),$._zod.onattach.push((J)=>{let z=J._zod.bag.maximum??Number.POSITIVE_INFINITY;if(U.maximum<z)J._zod.bag.maximum=U.maximum}),$._zod.check=(J)=>{let z=J.value;if(z.size<=U.maximum)return;J.issues.push({origin:C1(z),code:"too_big",maximum:U.maximum,inclusive:!0,input:z,inst:$,continue:!U.abort})}}),xX=K("$ZodCheckMinSize",($,U)=>{var w;$$.init($,U),(w=$._zod.def).when??(w.when=(J)=>{let z=J.value;return!j4(z)&&z.size!==void 0}),$._zod.onattach.push((J)=>{let z=J._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(U.minimum>z)J._zod.bag.minimum=U.minimum}),$._zod.check=(J)=>{let z=J.value;if(z.size>=U.minimum)return;J.issues.push({origin:C1(z),code:"too_small",minimum:U.minimum,inclusive:!0,input:z,inst:$,continue:!U.abort})}}),yX=K("$ZodCheckSizeEquals",($,U)=>{var w;$$.init($,U),(w=$._zod.def).when??(w.when=(J)=>{let z=J.value;return!j4(z)&&z.size!==void 0}),$._zod.onattach.push((J)=>{let z=J._zod.bag;z.minimum=U.size,z.maximum=U.size,z.size=U.size}),$._zod.check=(J)=>{let z=J.value,G=z.size;if(G===U.size)return;let X=G>U.size;J.issues.push({origin:C1(z),...X?{code:"too_big",maximum:U.size}:{code:"too_small",minimum:U.size},inclusive:!0,exact:!0,input:J.value,inst:$,continue:!U.abort})}}),iX=K("$ZodCheckMaxLength",($,U)=>{var w;$$.init($,U),(w=$._zod.def).when??(w.when=(J)=>{let z=J.value;return!j4(z)&&z.length!==void 0}),$._zod.onattach.push((J)=>{let z=J._zod.bag.maximum??Number.POSITIVE_INFINITY;if(U.maximum<z)J._zod.bag.maximum=U.maximum}),$._zod.check=(J)=>{let z=J.value;if(z.length<=U.maximum)return;let X=x1(z);J.issues.push({origin:X,code:"too_big",maximum:U.maximum,inclusive:!0,input:z,inst:$,continue:!U.abort})}}),hX=K("$ZodCheckMinLength",($,U)=>{var w;$$.init($,U),(w=$._zod.def).when??(w.when=(J)=>{let z=J.value;return!j4(z)&&z.length!==void 0}),$._zod.onattach.push((J)=>{let z=J._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(U.minimum>z)J._zod.bag.minimum=U.minimum}),$._zod.check=(J)=>{let z=J.value;if(z.length>=U.minimum)return;let X=x1(z);J.issues.push({origin:X,code:"too_small",minimum:U.minimum,inclusive:!0,input:z,inst:$,continue:!U.abort})}}),mX=K("$ZodCheckLengthEquals",($,U)=>{var w;$$.init($,U),(w=$._zod.def).when??(w.when=(J)=>{let z=J.value;return!j4(z)&&z.length!==void 0}),$._zod.onattach.push((J)=>{let z=J._zod.bag;z.minimum=U.length,z.maximum=U.length,z.length=U.length}),$._zod.check=(J)=>{let z=J.value,G=z.length;if(G===U.length)return;let X=x1(z),_=G>U.length;J.issues.push({origin:X,..._?{code:"too_big",maximum:U.length}:{code:"too_small",minimum:U.length},inclusive:!0,exact:!0,input:J.value,inst:$,continue:!U.abort})}}),OU=K("$ZodCheckStringFormat",($,U)=>{var w,J;if($$.init($,U),$._zod.onattach.push((z)=>{let G=z._zod.bag;if(G.format=U.format,U.pattern)G.patterns??(G.patterns=new Set),G.patterns.add(U.pattern)}),U.pattern)(w=$._zod).check??(w.check=(z)=>{if(U.pattern.lastIndex=0,U.pattern.test(z.value))return;z.issues.push({origin:"string",code:"invalid_format",format:U.format,input:z.value,...U.pattern?{pattern:U.pattern.toString()}:{},inst:$,continue:!U.abort})});else(J=$._zod).check??(J.check=()=>{})}),cX=K("$ZodCheckRegex",($,U)=>{OU.init($,U),$._zod.check=(w)=>{if(U.pattern.lastIndex=0,U.pattern.test(w.value))return;w.issues.push({origin:"string",code:"invalid_format",format:"regex",input:w.value,pattern:U.pattern.toString(),inst:$,continue:!U.abort})}}),rX=K("$ZodCheckLowerCase",($,U)=>{U.pattern??(U.pattern=fX),OU.init($,U)}),lX=K("$ZodCheckUpperCase",($,U)=>{U.pattern??(U.pattern=RX),OU.init($,U)}),dX=K("$ZodCheckIncludes",($,U)=>{$$.init($,U);let w=m$(U.includes),J=new RegExp(typeof U.position==="number"?`^.{${U.position}}${w}`:w);U.pattern=J,$._zod.onattach.push((z)=>{let G=z._zod.bag;G.patterns??(G.patterns=new Set),G.patterns.add(J)}),$._zod.check=(z)=>{if(z.value.includes(U.includes,U.position))return;z.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:U.includes,input:z.value,inst:$,continue:!U.abort})}}),nX=K("$ZodCheckStartsWith",($,U)=>{$$.init($,U);let w=new RegExp(`^${m$(U.prefix)}.*`);U.pattern??(U.pattern=w),$._zod.onattach.push((J)=>{let z=J._zod.bag;z.patterns??(z.patterns=new Set),z.patterns.add(w)}),$._zod.check=(J)=>{if(J.value.startsWith(U.prefix))return;J.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:U.prefix,input:J.value,inst:$,continue:!U.abort})}}),pX=K("$ZodCheckEndsWith",($,U)=>{$$.init($,U);let w=new RegExp(`.*${m$(U.suffix)}$`);U.pattern??(U.pattern=w),$._zod.onattach.push((J)=>{let z=J._zod.bag;z.patterns??(z.patterns=new Set),z.patterns.add(w)}),$._zod.check=(J)=>{if(J.value.endsWith(U.suffix))return;J.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:U.suffix,input:J.value,inst:$,continue:!U.abort})}});function H5($,U,w){if($.issues.length)U.issues.push(...S$(w,$.issues))}var tX=K("$ZodCheckProperty",($,U)=>{$$.init($,U),$._zod.check=(w)=>{let J=U.schema._zod.run({value:w.value[U.property],issues:[]},{});if(J instanceof Promise)return J.then((z)=>H5(z,w,U.property));H5(J,w,U.property);return}}),aX=K("$ZodCheckMimeType",($,U)=>{$$.init($,U);let w=new Set(U.mime);$._zod.onattach.push((J)=>{J._zod.bag.mime=U.mime}),$._zod.check=(J)=>{if(w.has(J.value.type))return;J.issues.push({code:"invalid_value",values:U.mime,input:J.value.type,inst:$,continue:!U.abort})}}),oX=K("$ZodCheckOverwrite",($,U)=>{$$.init($,U),$._zod.check=(w)=>{w.value=U.tx(w.value)}});class Cz{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 w=$.split(`
|
|
192
|
-
`).filter((
|
|
193
|
-
`))}}var eX={major:4,minor:4,patch:3};var m=K("$ZodType",($,U)=>{var w;$??($={}),$._zod.def=U,$._zod.bag=$._zod.bag||{},$._zod.version=eX;let J=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))J.unshift($);for(let z of J)for(let G of z._zod.onattach)G($);if(J.length===0)(w=$._zod).deferred??(w.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let z=(X,_,N)=>{let W=x4(X),Y;for(let Q of _){if(Q._zod.def.when){if($X(X))continue;if(!Q._zod.def.when(X))continue}else if(W)continue;let V=X.issues.length,g=Q._zod.check(X);if(g instanceof Promise&&N?.async===!1)throw new z4;if(Y||g instanceof Promise)Y=(Y??Promise.resolve()).then(async()=>{if(await g,X.issues.length===V)return;if(!W)W=x4(X,V)});else{if(X.issues.length===V)continue;if(!W)W=x4(X,V)}}if(Y)return Y.then(()=>{return X});return X},G=(X,_,N)=>{if(x4(X))return X.aborted=!0,X;let W=z(_,J,N);if(W instanceof Promise){if(N.async===!1)throw new z4;return W.then((Y)=>$._zod.parse(Y,N))}return $._zod.parse(W,N)};$._zod.run=(X,_)=>{if(_.skipChecks)return $._zod.parse(X,_);if(_.direction==="backward"){let W=$._zod.parse({value:X.value,issues:[]},{..._,skipChecks:!0});if(W instanceof Promise)return W.then((Y)=>{return G(Y,X,_)});return G(W,X,_)}let N=$._zod.parse(X,_);if(N instanceof Promise){if(_.async===!1)throw new z4;return N.then((W)=>z(W,J,_))}return z(N,J,_)}}r($,"~standard",()=>({validate:(z)=>{try{let G=zX($,z);return G.success?{value:G.data}:{issues:G.error?.issues}}catch(G){return JX($,z).then((X)=>X.success?{value:X.data}:{issues:X.error?.issues})}},vendor:"zod",version:1}))}),Z6=K("$ZodString",($,U)=>{m.init($,U),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??vX($._zod.bag),$._zod.parse=(w,J)=>{if(U.coerce)try{w.value=String(w.value)}catch(z){}if(typeof w.value==="string")return w;return w.issues.push({expected:"string",code:"invalid_type",input:w.value,inst:$}),w}}),e=K("$ZodStringFormat",($,U)=>{OU.init($,U),Z6.init($,U)}),$_=K("$ZodGUID",($,U)=>{U.pattern??(U.pattern=VX),e.init($,U)}),U_=K("$ZodUUID",($,U)=>{if(U.version){let J={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[U.version];if(J===void 0)throw Error(`Invalid UUID version: "${U.version}"`);U.pattern??(U.pattern=T6(J))}else U.pattern??(U.pattern=T6());e.init($,U)}),w_=K("$ZodEmail",($,U)=>{U.pattern??(U.pattern=gX),e.init($,U)}),z_=K("$ZodURL",($,U)=>{e.init($,U),$._zod.check=(w)=>{try{let J=w.value.trim();if(!U.normalize&&U.protocol?.source===OX.source){if(!/^https?:\/\//i.test(J)){w.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:w.value,inst:$,continue:!U.abort});return}}let z=new URL(J);if(U.hostname){if(U.hostname.lastIndex=0,!U.hostname.test(z.hostname))w.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:U.hostname.source,input:w.value,inst:$,continue:!U.abort})}if(U.protocol){if(U.protocol.lastIndex=0,!U.protocol.test(z.protocol.endsWith(":")?z.protocol.slice(0,-1):z.protocol))w.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:U.protocol.source,input:w.value,inst:$,continue:!U.abort})}if(U.normalize)w.value=z.href;else w.value=J;return}catch(J){w.issues.push({code:"invalid_format",format:"url",input:w.value,inst:$,continue:!U.abort})}}}),J_=K("$ZodEmoji",($,U)=>{U.pattern??(U.pattern=BX()),e.init($,U)}),G_=K("$ZodNanoID",($,U)=>{U.pattern??(U.pattern=YX),e.init($,U)}),X_=K("$ZodCUID",($,U)=>{U.pattern??(U.pattern=GX),e.init($,U)}),__=K("$ZodCUID2",($,U)=>{U.pattern??(U.pattern=XX),e.init($,U)}),N_=K("$ZodULID",($,U)=>{U.pattern??(U.pattern=_X),e.init($,U)}),W_=K("$ZodXID",($,U)=>{U.pattern??(U.pattern=NX),e.init($,U)}),Y_=K("$ZodKSUID",($,U)=>{U.pattern??(U.pattern=WX),e.init($,U)}),Q_=K("$ZodISODateTime",($,U)=>{U.pattern??(U.pattern=FX(U)),e.init($,U)}),V_=K("$ZodISODate",($,U)=>{U.pattern??(U.pattern=ZX),e.init($,U)}),g_=K("$ZodISOTime",($,U)=>{U.pattern??(U.pattern=DX(U)),e.init($,U)}),B_=K("$ZodISODuration",($,U)=>{U.pattern??(U.pattern=QX),e.init($,U)}),q_=K("$ZodIPv4",($,U)=>{U.pattern??(U.pattern=qX),e.init($,U),$._zod.bag.format="ipv4"}),H_=K("$ZodIPv6",($,U)=>{U.pattern??(U.pattern=HX),e.init($,U),$._zod.bag.format="ipv6",$._zod.check=(w)=>{try{new URL(`http://[${w.value}]`)}catch{w.issues.push({code:"invalid_format",format:"ipv6",input:w.value,inst:$,continue:!U.abort})}}}),I_=K("$ZodMAC",($,U)=>{U.pattern??(U.pattern=IX(U.delimiter)),e.init($,U),$._zod.bag.format="mac"}),K_=K("$ZodCIDRv4",($,U)=>{U.pattern??(U.pattern=KX),e.init($,U)}),L_=K("$ZodCIDRv6",($,U)=>{U.pattern??(U.pattern=LX),e.init($,U),$._zod.check=(w)=>{let J=w.value.split("/");try{if(J.length!==2)throw Error();let[z,G]=J;if(!G)throw Error();let X=Number(G);if(`${X}`!==G)throw Error();if(X<0||X>128)throw Error();new URL(`http://[${z}]`)}catch{w.issues.push({code:"invalid_format",format:"cidrv6",input:w.value,inst:$,continue:!U.abort})}}});function P_($){if($==="")return!0;if(/\s/.test($))return!1;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}var O_=K("$ZodBase64",($,U)=>{U.pattern??(U.pattern=PX),e.init($,U),$._zod.bag.contentEncoding="base64",$._zod.check=(w)=>{if(P_(w.value))return;w.issues.push({code:"invalid_format",format:"base64",input:w.value,inst:$,continue:!U.abort})}});function R5($){if(!kz.test($))return!1;let U=$.replace(/[-_]/g,(J)=>J==="-"?"+":"/"),w=U.padEnd(Math.ceil(U.length/4)*4,"=");return P_(w)}var T_=K("$ZodBase64URL",($,U)=>{U.pattern??(U.pattern=kz),e.init($,U),$._zod.bag.contentEncoding="base64url",$._zod.check=(w)=>{if(R5(w.value))return;w.issues.push({code:"invalid_format",format:"base64url",input:w.value,inst:$,continue:!U.abort})}}),Z_=K("$ZodE164",($,U)=>{U.pattern??(U.pattern=TX),e.init($,U)});function k5($,U=null){try{let w=$.split(".");if(w.length!==3)return!1;let[J]=w;if(!J)return!1;let z=JSON.parse(atob(J));if("typ"in z&&z?.typ!=="JWT")return!1;if(!z.alg)return!1;if(U&&(!("alg"in z)||z.alg!==U))return!1;return!0}catch{return!1}}var D_=K("$ZodJWT",($,U)=>{e.init($,U),$._zod.check=(w)=>{if(k5(w.value,U.alg))return;w.issues.push({code:"invalid_format",format:"jwt",input:w.value,inst:$,continue:!U.abort})}}),F_=K("$ZodCustomStringFormat",($,U)=>{e.init($,U),$._zod.check=(w)=>{if(U.fn(w.value))return;w.issues.push({code:"invalid_format",format:U.format,input:w.value,inst:$,continue:!U.abort})}}),mz=K("$ZodNumber",($,U)=>{m.init($,U),$._zod.pattern=$._zod.bag.pattern??m1,$._zod.parse=(w,J)=>{if(U.coerce)try{w.value=Number(w.value)}catch(X){}let z=w.value;if(typeof z==="number"&&!Number.isNaN(z)&&Number.isFinite(z))return w;let G=typeof z==="number"?Number.isNaN(z)?"NaN":!Number.isFinite(z)?"Infinity":void 0:void 0;return w.issues.push({expected:"number",code:"invalid_type",input:z,inst:$,...G?{received:G}:{}}),w}}),v_=K("$ZodNumberFormat",($,U)=>{jX.init($,U),mz.init($,U)}),l1=K("$ZodBoolean",($,U)=>{m.init($,U),$._zod.pattern=bX,$._zod.parse=(w,J)=>{if(U.coerce)try{w.value=Boolean(w.value)}catch(G){}let z=w.value;if(typeof z==="boolean")return w;return w.issues.push({expected:"boolean",code:"invalid_type",input:z,inst:$}),w}}),cz=K("$ZodBigInt",($,U)=>{m.init($,U),$._zod.pattern=MX,$._zod.parse=(w,J)=>{if(U.coerce)try{w.value=BigInt(w.value)}catch(z){}if(typeof w.value==="bigint")return w;return w.issues.push({expected:"bigint",code:"invalid_type",input:w.value,inst:$}),w}}),M_=K("$ZodBigIntFormat",($,U)=>{uX.init($,U),cz.init($,U)}),S_=K("$ZodSymbol",($,U)=>{m.init($,U),$._zod.parse=(w,J)=>{let z=w.value;if(typeof z==="symbol")return w;return w.issues.push({expected:"symbol",code:"invalid_type",input:z,inst:$}),w}}),b_=K("$ZodUndefined",($,U)=>{m.init($,U),$._zod.pattern=AX,$._zod.values=new Set([void 0]),$._zod.parse=(w,J)=>{let z=w.value;if(typeof z>"u")return w;return w.issues.push({expected:"undefined",code:"invalid_type",input:z,inst:$}),w}}),E_=K("$ZodNull",($,U)=>{m.init($,U),$._zod.pattern=EX,$._zod.values=new Set([null]),$._zod.parse=(w,J)=>{let z=w.value;if(z===null)return w;return w.issues.push({expected:"null",code:"invalid_type",input:z,inst:$}),w}}),A_=K("$ZodAny",($,U)=>{m.init($,U),$._zod.parse=(w)=>w}),f_=K("$ZodUnknown",($,U)=>{m.init($,U),$._zod.parse=(w)=>w}),R_=K("$ZodNever",($,U)=>{m.init($,U),$._zod.parse=(w,J)=>{return w.issues.push({expected:"never",code:"invalid_type",input:w.value,inst:$}),w}}),k_=K("$ZodVoid",($,U)=>{m.init($,U),$._zod.parse=(w,J)=>{let z=w.value;if(typeof z>"u")return w;return w.issues.push({expected:"void",code:"invalid_type",input:z,inst:$}),w}}),j_=K("$ZodDate",($,U)=>{m.init($,U),$._zod.parse=(w,J)=>{if(U.coerce)try{w.value=new Date(w.value)}catch(_){}let z=w.value,G=z instanceof Date;if(G&&!Number.isNaN(z.getTime()))return w;return w.issues.push({expected:"date",code:"invalid_type",input:z,...G?{received:"Invalid Date"}:{},inst:$}),w}});function L5($,U,w){if($.issues.length)U.issues.push(...S$(w,$.issues));U.value[w]=$.value}var u_=K("$ZodArray",($,U)=>{m.init($,U),$._zod.parse=(w,J)=>{let z=w.value;if(!Array.isArray(z))return w.issues.push({expected:"array",code:"invalid_type",input:z,inst:$}),w;w.value=Array(z.length);let G=[];for(let X=0;X<z.length;X++){let _=z[X],N=U.element._zod.run({value:_,issues:[]},J);if(N instanceof Promise)G.push(N.then((W)=>L5(W,w,X)));else L5(N,w,X)}if(G.length)return Promise.all(G).then(()=>w);return w}});function hz($,U,w,J,z,G){let X=w in J;if($.issues.length){if(z&&G&&!X)return;U.issues.push(...S$(w,$.issues))}if(!X&&!z){if(!$.issues.length)U.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[w]});return}if($.value===void 0){if(X)U.value[w]=void 0}else U.value[w]=$.value}function j5($){let U=Object.keys($.shape);for(let J of U)if(!$.shape?.[J]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${J}": expected a Zod schema`);let w=oG($.shape);return{...$,keys:U,keySet:new Set(U),numKeys:U.length,optionalKeys:new Set(w)}}function u5($,U,w,J,z,G){let X=[],_=z.keySet,N=z.catchall._zod,W=N.def.type,Y=N.optin==="optional",Q=N.optout==="optional";for(let V in U){if(V==="__proto__")continue;if(_.has(V))continue;if(W==="never"){X.push(V);continue}let g=N.run({value:U[V],issues:[]},J);if(g instanceof Promise)$.push(g.then((H)=>hz(H,w,V,U,Y,Q)));else hz(g,w,V,U,Y,Q)}if(X.length)w.issues.push({code:"unrecognized_keys",keys:X,input:U,inst:G});if(!$.length)return w;return Promise.all($).then(()=>{return w})}var C5=K("$ZodObject",($,U)=>{if(m.init($,U),!Object.getOwnPropertyDescriptor(U,"shape")?.get){let _=U.shape;Object.defineProperty(U,"shape",{get:()=>{let N={..._};return Object.defineProperty(U,"shape",{value:N}),N}})}let J=qU(()=>j5(U));r($._zod,"propValues",()=>{let _=U.shape,N={};for(let W in _){let Y=_[W]._zod;if(Y.values){N[W]??(N[W]=new Set);for(let Q of Y.values)N[W].add(Q)}}return N});let z=O6,G=U.catchall,X;$._zod.parse=(_,N)=>{X??(X=J.value);let W=_.value;if(!z(W))return _.issues.push({expected:"object",code:"invalid_type",input:W,inst:$}),_;_.value={};let Y=[],Q=X.shape;for(let V of X.keys){let g=Q[V],H=g._zod.optin==="optional",q=g._zod.optout==="optional",O=g._zod.run({value:W[V],issues:[]},N);if(O instanceof Promise)Y.push(O.then((M)=>hz(M,_,V,W,H,q)));else hz(O,_,V,W,H,q)}if(!G)return Y.length?Promise.all(Y).then(()=>_):_;return u5(Y,W,_,N,J.value,$)}}),C_=K("$ZodObjectJIT",($,U)=>{C5.init($,U);let w=$._zod.parse,J=qU(()=>j5(U)),z=(V)=>{let g=new Cz(["shape","payload","ctx"]),H=J.value,q=(S)=>{let E=Tz(S);return`shape[${E}]._zod.run({ value: input[${E}], issues: [] }, ctx)`};g.write("const input = payload.value;");let O=Object.create(null),M=0;for(let S of H.keys)O[S]=`key_${M++}`;g.write("const newResult = {};");for(let S of H.keys){let E=O[S],R=Tz(S),u=V[S],x=u?._zod?.optin==="optional",k=u?._zod?.optout==="optional";if(g.write(`const ${E} = ${q(S)};`),x&&k)g.write(`
|
|
194
|
-
if (${
|
|
195
|
-
if (${
|
|
196
|
-
payload.issues = payload.issues.concat(${
|
|
188
|
+
`);this.baseURL=I.baseURL,this.timeout=I.timeout??wg.DEFAULT_TIMEOUT,this.logger=I.logger??console;let N="warn";this.logLevel=N,this.logLevel=S2(I.logLevel,"ClientOptions.logLevel",this)??S2(p$("OPENAI_LOG"),"process.env['OPENAI_LOG']",this)??N,this.fetchOptions=I.fetchOptions,this.maxRetries=I.maxRetries??2,this.fetch=I.fetch??J0(),j(this,d1,GW,"f");let W=w?void 0:p$("OPENAI_CUSTOM_HEADERS");if(W){let P={};for(let Q of W.split(`
|
|
189
|
+
`)){let H=Q.indexOf(":");if(H>=0)P[Q.substring(0,H).trim()]=Q.substring(H+1).trim()}I.defaultHeaders=f([P,I.defaultHeaders])}if(this._options=I,this._provider=X,_)this._workloadIdentityAuth=new R2(_,this.fetch);this.apiKey=typeof v==="string"?v:null,this.adminAPIKey=J,this.organization=z,this.project=g,this.webhookSecret=V}withOptions($){let w=this._options.provider,U=$.provider??w,v={...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this._options.apiKey,adminAPIKey:this.adminAPIKey,workloadIdentity:this._options.workloadIdentity,organization:this.organization,project:this.project,webhookSecret:this.webhookSecret};if(U){if(delete v.apiKey,delete v.adminAPIKey,delete v.workloadIdentity,delete v.baseURL,U!==w)delete v.organization,delete v.project,delete v.defaultHeaders}return new this.constructor({...v,...$,provider:U})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:$,nulls:w},U={bearerAuth:!0,adminAPIKeyAuth:!0}){if($.get("authorization")||$.get("api-key"))return;if(w.has("authorization")||w.has("api-key"))return;if(this._workloadIdentityAuth&&U.bearerAuth)return;throw Error('Could not resolve authentication method. Expected either apiKey or adminAPIKey to be set. Or for one of the "Authorization" or "api-key" headers to be explicitly omitted')}async authHeaders($,w={bearerAuth:!0,adminAPIKeyAuth:!0}){return f([w.bearerAuth?await this.bearerAuth($):null,w.adminAPIKeyAuth?await this.adminAPIKeyAuth($):null])}async bearerAuth($){if(this._workloadIdentityAuth)return f([{Authorization:`Bearer ${await this._workloadIdentityAuth.getToken()}`}]);if(this.apiKey==null)return;return f([{Authorization:`Bearer ${this.apiKey}`}])}async adminAPIKeyAuth($){if(this.adminAPIKey==null)return;return f([{Authorization:`Bearer ${this.adminAPIKey}`}])}stringifyQuery($){return OW($)}getUserAgent(){return`${this.constructor.name}/JS ${i4}`}defaultIdempotencyKey(){return`stainless-node-retry-${L2()}`}makeStatusError($,w,U,v){return v$.generate($,w,U,v)}async _callApiKey(){if(this._provider)return!1;let $=this._options.apiKey;if(typeof $!=="function")return!1;let w;try{w=await $()}catch(U){if(U instanceof i)throw U;throw new i(`Failed to get token from 'apiKey' function: ${U.message}`,{cause:U})}if(typeof w!=="string"||!w)throw new i(`Expected 'apiKey' function argument to return a string but it returned ${w}`);return this.apiKey=w,!0}buildURL($,w,U){let v=!q(this,$g,"m",Q3).call(this)&&U||this.baseURL,J=e8($)?new URL($):new URL(v+(v.endsWith("/")&&$.startsWith("/")?$.slice(1):$)),z=this.defaultQuery(),g=Object.fromEntries(J.searchParams);if(!u2(z)||!u2(g))w={...g,...z,...w};if(typeof w==="object"&&w&&!Array.isArray(w))J.search=this.stringifyQuery(w);return J.toString()}async prepareOptions($){if(this._provider)return;if(($.__security??{bearerAuth:!0}).bearerAuth)await this._callApiKey()}async prepareRequest($,{url:w,options:U}){}get($,w){return this.methodRequest("get",$,w)}post($,w){return this.methodRequest("post",$,w)}patch($,w){return this.methodRequest("patch",$,w)}put($,w){return this.methodRequest("put",$,w)}delete($,w){return this.methodRequest("delete",$,w)}methodRequest($,w,U){return this.request(Promise.resolve(U).then((v)=>{return{method:$,path:w,...v}}))}request($,w=null){return new G6(this,this.makeRequest($,w,void 0))}async makeRequest($,w,U){let v=await $,J=v.maxRetries??this.maxRetries;if(w==null)w=J;await this.prepareOptions(v);let{req:z,url:g,timeout:V}=await this.buildRequest(v,{retryCount:J-w});await this.prepareRequest(z,{url:g,options:v}),await this._provider?.prepareRequest?.(z,{url:g,options:v});let _="log_"+(Math.random()*16777216|0).toString(16).padStart(6,"0"),G=U===void 0?"":`, retryOf: ${U}`,X=Date.now();if(V$(this).debug(`[${_}] sending request`,B4({retryOfRequestLogID:U,method:v.method,url:g,options:v,headers:z.headers})),v.signal?.aborted)throw new _$;let I=v.__security??{bearerAuth:!0},N=new AbortController,W=await this.fetchWithAuth(g,z,V,N,I).catch(OU),P=Date.now();if(W instanceof globalThis.Error){let Z=`retrying, ${w} attempts remaining`;if(v.signal?.aborted)throw new _$;let u=PU(W)||/timed? ?out/i.test(String(W)+("cause"in W?String(W.cause):""));if(w)return V$(this).info(`[${_}] connection ${u?"timed out":"failed"} - ${Z}`),V$(this).debug(`[${_}] connection ${u?"timed out":"failed"} (${Z})`,B4({retryOfRequestLogID:U,url:g,durationMs:P-X,message:W.message})),this.retryRequest(v,w,U??_);if(V$(this).info(`[${_}] connection ${u?"timed out":"failed"} - error; no more retries left`),V$(this).debug(`[${_}] connection ${u?"timed out":"failed"} (error; no more retries left)`,B4({retryOfRequestLogID:U,url:g,durationMs:P-X,message:W.message})),W instanceof l6||W instanceof w0)throw W;if(u)throw new V6;throw new g6({message:SB(W),cause:W})}let Q=[...W.headers.entries()].filter(([Z])=>Z==="x-request-id").map(([Z,u])=>", "+Z+": "+JSON.stringify(u)).join(""),H=`[${_}${G}${Q}] ${z.method} ${g} ${W.ok?"succeeded":"failed"} with status ${W.status} in ${P-X}ms`;if(!W.ok){if(W.status===401&&this._workloadIdentityAuth&&I.bearerAuth&&!v.__metadata?.hasStreamingBody&&!v.__metadata?.workloadIdentityTokenRefreshed)return await f2(W.body),this._workloadIdentityAuth.invalidateToken(),this.makeRequest({...v,__metadata:{...v.__metadata,workloadIdentityTokenRefreshed:!0}},w,U??_);let Z=await this.shouldRetry(W);if(w&&Z){let x=`retrying, ${w} attempts remaining`;return await f2(W.body),V$(this).info(`${H} - ${x}`),V$(this).debug(`[${_}] response error (${x})`,B4({retryOfRequestLogID:U,url:W.url,status:W.status,headers:W.headers,durationMs:P-X})),this.retryRequest(v,w,U??_,W.headers)}let u=Z?"error; no more retries left":"error; not retryable";V$(this).info(`${H} - ${u}`);let b=await W.text().catch((x)=>OU(x).message),M=wW(b),S=M?void 0:b;throw V$(this).debug(`[${_}] response error (${u})`,B4({retryOfRequestLogID:U,url:W.url,status:W.status,headers:W.headers,message:S,durationMs:Date.now()-X})),this.makeStatusError(W.status,M,S,W.headers)}return V$(this).info(H),V$(this).debug(`[${_}] response start`,B4({retryOfRequestLogID:U,url:W.url,status:W.status,headers:W.headers,durationMs:P-X})),{response:W,options:v,controller:N,requestLogID:_,retryOfRequestLogID:U,startTime:X}}getAPIList($,w,U){return this.requestAPIList(w,U&&"then"in U?U.then((v)=>({method:"get",path:$,...v})):{method:"get",path:$,...U})}requestAPIList($,w){let U=this.makeRequest(w,null,void 0);return new X0(this,U,$)}async fetchWithAuth($,w,U,v,J={bearerAuth:!0,adminAPIKeyAuth:!0}){if(this._workloadIdentityAuth&&J.bearerAuth){let g=w.headers,V=g.get("Authorization");if(!V||V===`Bearer ${EB}`){let _=await this._workloadIdentityAuth.getToken();g.set("Authorization",`Bearer ${_}`)}}return await this.fetchWithTimeout($,w,U,v)}async fetchWithTimeout($,w,U,v){let{signal:J,method:z,...g}=w||{},V=this._makeAbort(v);if(J)J.addEventListener("abort",V,{once:!0});let _=setTimeout(V,U),G=globalThis.ReadableStream&&g.body instanceof globalThis.ReadableStream||typeof g.body==="object"&&g.body!==null&&Symbol.asyncIterator in g.body,X={signal:v.signal,...G?{duplex:"half"}:{},method:"GET",...g};if(z)X.method=z.toUpperCase();try{return await this.fetch.call(void 0,$,X)}finally{clearTimeout(_)}}async shouldRetry($){let w=$.headers.get("x-should-retry");if(w==="true")return!0;if(w==="false")return!1;if($.status===408)return!0;if($.status===409)return!0;if($.status===429)return!0;if($.status>=500)return!0;return!1}async retryRequest($,w,U,v){let J,z=v?.get("retry-after-ms");if(z){let V=parseFloat(z);if(!Number.isNaN(V))J=V}let g=v?.get("retry-after");if(g&&!J){let V=parseFloat(g);if(!Number.isNaN(V))J=V*1000;else J=Date.parse(g)-Date.now()}if(J===void 0){let V=$.maxRetries??this.maxRetries;J=this.calculateDefaultRetryTimeoutMillis(w,V)}return await U4(J),this.makeRequest($,w-1,U)}calculateDefaultRetryTimeoutMillis($,w){let J=w-$,z=Math.min(0.5*Math.pow(2,J),8),g=1-Math.random()*0.25;return z*g*1000}async buildRequest($,{retryCount:w=0}={}){let U={...$},{method:v,path:J,query:z,defaultBaseURL:g}=U,V=this.buildURL(J,z,g);if("timeout"in U)$W("timeout",U.timeout);U.timeout=U.timeout??this.timeout;let{bodyHeaders:_,body:G,isStreamingBody:X}=this.buildBody({options:U});if(X)$.__metadata={...$.__metadata,hasStreamingBody:!0};let I=await this.buildHeaders({options:$,method:v,bodyHeaders:_,retryCount:w});return{req:{method:v,headers:I,...U.signal&&{signal:U.signal},...globalThis.ReadableStream&&G instanceof globalThis.ReadableStream&&{duplex:"half"},...G&&{body:G},...this.fetchOptions??{},...U.fetchOptions??{}},url:V,timeout:U.timeout}}async buildHeaders({options:$,method:w,bodyHeaders:U,retryCount:v}){let J={};if(this.idempotencyHeader&&w!=="get"){if(!$.idempotencyKey)$.idempotencyKey=this.defaultIdempotencyKey();J[this.idempotencyHeader]=$.idempotencyKey}let z=f([J,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(v),...$.timeout?{"X-Stainless-Timeout":String(Math.trunc($.timeout/1000))}:{},...gW(),"OpenAI-Organization":this.organization,"OpenAI-Project":this.project},this._provider?void 0:await this.authHeaders($,$.__security??{bearerAuth:!0}),this._options.defaultHeaders,U,$.headers]);if(!this._provider)this.validateHeaders(z,$.__security??{bearerAuth:!0});return z.values}_makeAbort($){return()=>$.abort()}buildBody({options:$}){let{body:w,headers:U}=$;if(!w){if(w===void 0&&"body"in $)return{...q(this,d1,"f").call(this,{body:w,headers:f([U])}),isStreamingBody:!1};return{bodyHeaders:void 0,body:void 0,isStreamingBody:!1}}let v=f([U]),J=typeof globalThis.ReadableStream<"u"&&w instanceof globalThis.ReadableStream,z=!J&&(typeof w==="string"||w instanceof ArrayBuffer||ArrayBuffer.isView(w)||typeof globalThis.Blob<"u"&&w instanceof globalThis.Blob||w instanceof URLSearchParams||w instanceof FormData);if(ArrayBuffer.isView(w)||w instanceof ArrayBuffer||w instanceof DataView||typeof w==="string"&&v.values.has("content-type")||globalThis.Blob&&w instanceof globalThis.Blob||w instanceof FormData||w instanceof URLSearchParams||J)return{bodyHeaders:void 0,body:w,isStreamingBody:!z};else if(typeof w==="object"&&((Symbol.asyncIterator in w)||(Symbol.iterator in w)&&("next"in w)&&typeof w.next==="function"))return{bodyHeaders:void 0,body:v0(w),isStreamingBody:!0};else if(typeof w==="object"&&v.values.get("content-type")==="application/x-www-form-urlencoded")return{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(w),isStreamingBody:!1};else return{...q(this,d1,"f").call(this,{body:w,headers:v}),isStreamingBody:!1}}}wg=r,d1=new WeakMap,$g=new WeakSet,Q3=function(){return this._provider!==void 0||this.baseURL!=="https://api.openai.com/v1"};r.OpenAI=wg;r.DEFAULT_TIMEOUT=600000;r.OpenAIError=i;r.APIError=v$;r.APIConnectionError=g6;r.APIConnectionTimeoutError=V6;r.APIUserAbortError=_$;r.NotFoundError=HU;r.ConflictError=uU;r.RateLimitError=DU;r.BadRequestError=BU;r.AuthenticationError=qU;r.InternalServerError=fU;r.PermissionDeniedError=LU;r.UnprocessableEntityError=KU;r.InvalidWebhookSignatureError=O4;r.toFile=a6;r.Completions=_w;r.Chat=I6;r.Embeddings=Iw;r.Files=Ww;r.Images=Ow;r.Audio=H4;r.Moderations=qw;r.Models=Bw;r.FineTuning=g4;r.Graders=K6;r.VectorStores=x4;r.Webhooks=Kw;r.Beta=z4;r.Batches=gw;r.Uploads=f6;r.Admin=W6;r.Responses=u4;r.Realtime=C4;r.Conversations=H6;r.Evals=u6;r.Containers=L6;r.Skills=j4;r.Videos=Hw;function SB($){if(AB($))return"Connection error. This may be caused by passing an undici dispatcher, such as ProxyAgent, that is incompatible with the fetch implementation. If you are using undici's ProxyAgent, pass the fetch implementation from the same undici package: import { fetch, ProxyAgent } from 'undici'; new OpenAI({ fetch, fetchOptions: { dispatcher: new ProxyAgent(...) } });";return}function AB($){let w=$;for(let U=0;U<8&&w&&typeof w==="object";U++){let v=w;if(v.code==="UND_ERR_INVALID_ARG"&&typeof v.message==="string"&&v.message.includes("invalid onRequestStart method"))return!0;w=v.cause}return!1}async function yB($){if($.source==="-"){let U=[];for await(let J of process.stdin)U.push(typeof J==="string"?Buffer.from(J):J);let v=Buffer.concat(U);return{...$,data:v,fileName:$.name??`stdin${cB($.mime)}`}}if(hB($.source)){let U=await fetch($.source);if(!U.ok)throw Error(`Failed to fetch asset ${$.source}: ${U.status} ${U.statusText}`);let v=new Uint8Array(await U.arrayBuffer()),J=new URL($.source),z=($.name??P3(J.pathname))||"asset";return{...$,mime:$.mime??U.headers.get("content-type")??void 0,data:v,fileName:z}}if(!B3($.source))throw Error(`Asset not found: ${$.source}`);let w=await CB($.source);return{...$,mime:$.mime??i0($.source),data:w,fileName:$.name??P3($.source)}}async function r4($){let w=await yB($);return a6(w.data,w.fileName,{type:w.mime??i0(w.fileName)})}function Jg($,w){let U=[],v=$===void 0?[]:Array.isArray($)?$:[$];for(let J of v)U.push({role:"image",source:J,mime:i0(J)});if(w)U.push({role:"mask",source:w,mime:i0(w)});return U}async function E0($){let w=dB($.format);return L3({...$,format:w})}async function L3($){let w=mB($);await kB(jB(w),{recursive:!0});let U=typeof $.data==="string"?Buffer.from($.data,"base64"):Buffer.from($.data);return await q3(w,U),w}async function H3($){let w=await fetch($.url);if(!w.ok)throw Error(`Failed to download generated asset: ${w.status} ${w.statusText}`);let U=new Uint8Array(await w.arrayBuffer());return E0({...$,data:U})}async function u3($){if(!$.response.ok)throw Error(`Failed to download generated asset: ${$.response.status} ${$.response.statusText}`);let w=new Uint8Array(await $.response.arrayBuffer());return L3({...$,data:w})}async function T6($,w,U){for(let v of $.outputs){let J=`${v}.json`,z={...$,operation:U,prompt:w.prompt,params:w.params??{},output:v,createdAt:new Date().toISOString()};await q3(J,`${JSON.stringify(z,null,2)}
|
|
190
|
+
`)}}function i0($){switch(xB($).toLowerCase()){case".png":return"image/png";case".jpg":case".jpeg":return"image/jpeg";case".webp":return"image/webp";case".gif":return"image/gif";case".mp3":return"audio/mpeg";case".wav":return"audio/wav";case".mp4":return"video/mp4";case".mov":return"video/quicktime";default:return}}function dB($){if(!$)return"png";return $.replace(/^\./,"").toLowerCase()}function mB($){let w=$.output;if(!w)return Ug(process.cwd(),`${$.defaultName}${O3($.index,$.total)}.${$.format}`);if(w.endsWith("/")||B3(w)&&nB(w))return Ug(w,`${$.defaultName}${O3($.index,$.total)}.${$.format}`);if($.total<=1)return w;let U=rB(w);return Ug(U.dir,`${U.name}-${$.index+1}${U.ext||`.${$.format}`}`)}function O3($,w){return w<=1?"":`-${$+1}`}function nB($){try{return RB($).isDirectory()}catch{return!1}}function hB($){return $.startsWith("http://")||$.startsWith("https://")}function cB($){if(!$)return"";switch($){case"image/png":return".png";case"image/jpeg":return".jpg";case"image/webp":return".webp";case"video/mp4":return".mp4";case"video/quicktime":return".mov";default:return""}}import{chmodSync as CH,existsSync as jH,mkdirSync as xH,readFileSync as rH,writeFileSync as yH}from"node:fs";import{dirname as dH,join as mH}from"node:path";var C={};Y4(C,{xor:()=>$Y,xid:()=>K9,void:()=>t9,uuidv7:()=>Q9,uuidv6:()=>Y9,uuidv4:()=>W9,uuid:()=>N9,util:()=>T,url:()=>P9,uppercase:()=>Rw,unknown:()=>R6,union:()=>gz,undefined:()=>c9,ulid:()=>u9,uint64:()=>n9,uint32:()=>y9,tuple:()=>fI,trim:()=>yw,treeifyError:()=>Pg,transform:()=>Gz,toUpperCase:()=>mw,toLowerCase:()=>dw,toJSONSchema:()=>Sv,templateLiteral:()=>YY,symbol:()=>h9,superRefine:()=>sI,success:()=>XY,stringbool:()=>uY,stringFormat:()=>A9,string:()=>NJ,strictObject:()=>e9,startsWith:()=>Cw,slugify:()=>nw,size:()=>E6,setErrorMap:()=>TH,set:()=>zY,safeParseAsync:()=>sX,safeParse:()=>eX,safeEncodeAsync:()=>gI,safeEncode:()=>vI,safeDecodeAsync:()=>VI,safeDecode:()=>zI,registry:()=>vv,regexes:()=>x$,regex:()=>Sw,refine:()=>eI,record:()=>TI,readonly:()=>cI,property:()=>Fv,promise:()=>QY,prettifyError:()=>Og,preprocess:()=>DY,prefault:()=>jI,positive:()=>fv,pipe:()=>rv,partialRecord:()=>UY,parseAsync:()=>aX,parse:()=>pX,overwrite:()=>e$,optional:()=>YJ,object:()=>a9,number:()=>_I,nullish:()=>_Y,nullable:()=>QJ,null:()=>YI,normalize:()=>rw,nonpositive:()=>Zv,nonoptional:()=>xI,nonnegative:()=>bv,never:()=>zz,negative:()=>Tv,nativeEnum:()=>gY,nanoid:()=>q9,nan:()=>IY,multipleOf:()=>h4,minSize:()=>X4,minLength:()=>D4,mime:()=>xw,meta:()=>LY,maxSize:()=>c4,maxLength:()=>S6,map:()=>vY,mac:()=>T9,lte:()=>r$,lt:()=>G4,lowercase:()=>Aw,looseRecord:()=>JY,looseObject:()=>s9,locales:()=>GJ,literal:()=>VY,length:()=>A6,lazy:()=>oI,ksuid:()=>D9,keyof:()=>p9,jwt:()=>S9,json:()=>KY,iso:()=>lw,ipv6:()=>Z9,ipv4:()=>f9,invertCodec:()=>WY,intersection:()=>KI,int64:()=>m9,int32:()=>r9,int:()=>xv,instanceof:()=>HY,includes:()=>kw,httpUrl:()=>O9,hostname:()=>R9,hex:()=>k9,hash:()=>C9,guid:()=>I9,gte:()=>b$,gt:()=>_4,globalRegistry:()=>P$,getErrorMap:()=>ZH,function:()=>PY,fromJSONSchema:()=>TY,formatError:()=>a1,float64:()=>x9,float32:()=>j9,flattenError:()=>p1,file:()=>GY,exactOptional:()=>SI,enum:()=>Vz,endsWith:()=>jw,encodeAsync:()=>UI,encode:()=>$I,emoji:()=>B9,email:()=>X9,e164:()=>E9,discriminatedUnion:()=>wY,describe:()=>qY,decodeAsync:()=>JI,decode:()=>wI,date:()=>o9,custom:()=>BY,cuid2:()=>H9,cuid:()=>L9,core:()=>f4,config:()=>g$,coerce:()=>wN,codec:()=>NY,clone:()=>T$,cidrv6:()=>F9,cidrv4:()=>b9,check:()=>OY,catch:()=>dI,boolean:()=>XI,bigint:()=>d9,base64url:()=>i9,base64:()=>M9,array:()=>qJ,any:()=>l9,_function:()=>PY,_default:()=>kI,_ZodString:()=>yv,ZodXor:()=>LI,ZodXID:()=>tv,ZodVoid:()=>BI,ZodUnknown:()=>PI,ZodUnion:()=>HJ,ZodUndefined:()=>NI,ZodUUID:()=>I4,ZodURL:()=>OJ,ZodULID:()=>lv,ZodType:()=>m,ZodTuple:()=>DI,ZodTransform:()=>iI,ZodTemplateLiteral:()=>lI,ZodSymbol:()=>II,ZodSuccess:()=>rI,ZodStringFormat:()=>s,ZodString:()=>pw,ZodSet:()=>bI,ZodRecord:()=>tw,ZodRealError:()=>E$,ZodReadonly:()=>hI,ZodPromise:()=>pI,ZodPreprocess:()=>nI,ZodPrefault:()=>CI,ZodPipe:()=>uJ,ZodOptional:()=>_z,ZodObject:()=>LJ,ZodNumberFormat:()=>k6,ZodNumber:()=>ew,ZodNullable:()=>AI,ZodNull:()=>WI,ZodNonOptional:()=>Xz,ZodNever:()=>OI,ZodNanoID:()=>nv,ZodNaN:()=>mI,ZodMap:()=>ZI,ZodMAC:()=>GI,ZodLiteral:()=>FI,ZodLazy:()=>tI,ZodKSUID:()=>ov,ZodJWT:()=>Jz,ZodIssueCode:()=>fH,ZodIntersection:()=>uI,ZodISOTime:()=>Cv,ZodISODuration:()=>jv,ZodISODateTime:()=>Rv,ZodISODate:()=>kv,ZodIPv6:()=>av,ZodIPv4:()=>pv,ZodGUID:()=>WJ,ZodFunction:()=>aI,ZodFirstPartyTypeKind:()=>$N,ZodFile:()=>MI,ZodExactOptional:()=>EI,ZodError:()=>KH,ZodEnum:()=>ow,ZodEmoji:()=>mv,ZodEmail:()=>dv,ZodE164:()=>Uz,ZodDiscriminatedUnion:()=>HI,ZodDefault:()=>RI,ZodDate:()=>BJ,ZodCustomStringFormat:()=>aw,ZodCustom:()=>DJ,ZodCodec:()=>KJ,ZodCatch:()=>yI,ZodCUID2:()=>cv,ZodCUID:()=>hv,ZodCIDRv6:()=>sv,ZodCIDRv4:()=>ev,ZodBoolean:()=>sw,ZodBigIntFormat:()=>vz,ZodBigInt:()=>$U,ZodBase64URL:()=>wz,ZodBase64:()=>$z,ZodArray:()=>qI,ZodAny:()=>QI,TimePrecision:()=>f_,NEVER:()=>vg,$output:()=>q_,$input:()=>L_,$brand:()=>zg});var f4={};Y4(f4,{version:()=>WV,util:()=>T,treeifyError:()=>Pg,toJSONSchema:()=>Sv,toDotPath:()=>F3,safeParseAsync:()=>qg,safeParse:()=>Bg,safeEncodeAsync:()=>fq,safeEncode:()=>Kq,safeDecodeAsync:()=>Tq,safeDecode:()=>Dq,registry:()=>vv,regexes:()=>x$,process:()=>p,prettifyError:()=>Og,parseAsync:()=>k0,parse:()=>R0,meta:()=>zX,locales:()=>GJ,isValidJWT:()=>a3,isValidBase64URL:()=>p3,isValidBase64:()=>RV,initializeContext:()=>l4,globalRegistry:()=>P$,globalConfig:()=>Z6,formatError:()=>a1,flattenError:()=>p1,finalize:()=>o4,extractDefs:()=>t4,encodeAsync:()=>Hq,encode:()=>qq,describe:()=>vX,decodeAsync:()=>uq,decode:()=>Lq,createToJSONSchemaMethod:()=>VX,createStandardJSONSchemaMethod:()=>cw,config:()=>g$,clone:()=>T$,_xor:()=>sL,_xid:()=>Qv,_void:()=>o_,_uuidv7:()=>_v,_uuidv6:()=>Gv,_uuidv4:()=>Vv,_uuid:()=>gv,_url:()=>XJ,_uppercase:()=>Rw,_unknown:()=>l_,_union:()=>eL,_undefined:()=>n_,_ulid:()=>Yv,_uint64:()=>d_,_uint32:()=>k_,_tuple:()=>UH,_trim:()=>yw,_transform:()=>_H,_toUpperCase:()=>mw,_toLowerCase:()=>dw,_templateLiteral:()=>BH,_symbol:()=>m_,_superRefine:()=>JX,_success:()=>YH,_stringbool:()=>gX,_stringFormat:()=>hw,_string:()=>u_,_startsWith:()=>Cw,_slugify:()=>nw,_size:()=>E6,_set:()=>zH,_safeParseAsync:()=>Mw,_safeParse:()=>Fw,_safeEncodeAsync:()=>m0,_safeEncode:()=>y0,_safeDecodeAsync:()=>n0,_safeDecode:()=>d0,_regex:()=>Sw,_refine:()=>UX,_record:()=>JH,_readonly:()=>OH,_property:()=>Fv,_promise:()=>LH,_positive:()=>fv,_pipe:()=>PH,_parseAsync:()=>bw,_parse:()=>Zw,_overwrite:()=>e$,_optional:()=>XH,_number:()=>M_,_nullable:()=>IH,_null:()=>h_,_normalize:()=>rw,_nonpositive:()=>Zv,_nonoptional:()=>WH,_nonnegative:()=>bv,_never:()=>t_,_negative:()=>Tv,_nativeEnum:()=>VH,_nanoid:()=>Iv,_nan:()=>e_,_multipleOf:()=>h4,_minSize:()=>X4,_minLength:()=>D4,_min:()=>b$,_mime:()=>xw,_maxSize:()=>c4,_maxLength:()=>S6,_max:()=>r$,_map:()=>vH,_mac:()=>D_,_lte:()=>r$,_lt:()=>G4,_lowercase:()=>Aw,_literal:()=>GH,_length:()=>A6,_lazy:()=>qH,_ksuid:()=>Pv,_jwt:()=>Dv,_isoTime:()=>b_,_isoDuration:()=>F_,_isoDateTime:()=>T_,_isoDate:()=>Z_,_ipv6:()=>Bv,_ipv4:()=>Ov,_intersection:()=>wH,_int64:()=>y_,_int32:()=>R_,_int:()=>E_,_includes:()=>kw,_guid:()=>_J,_gte:()=>b$,_gt:()=>_4,_float64:()=>A_,_float32:()=>S_,_file:()=>$X,_enum:()=>gH,_endsWith:()=>jw,_encodeAsync:()=>x0,_encode:()=>C0,_emoji:()=>Xv,_email:()=>zv,_e164:()=>Kv,_discriminatedUnion:()=>$H,_default:()=>NH,_decodeAsync:()=>r0,_decode:()=>j0,_date:()=>p_,_custom:()=>wX,_cuid2:()=>Wv,_cuid:()=>Nv,_coercedString:()=>K_,_coercedNumber:()=>i_,_coercedDate:()=>a_,_coercedBoolean:()=>j_,_coercedBigint:()=>r_,_cidrv6:()=>Lv,_cidrv4:()=>qv,_check:()=>g9,_catch:()=>QH,_boolean:()=>C_,_bigint:()=>x_,_base64url:()=>uv,_base64:()=>Hv,_array:()=>s_,_any:()=>c_,TimePrecision:()=>f_,NEVER:()=>vg,JSONSchemaGenerator:()=>hX,JSONSchema:()=>V9,Doc:()=>t0,$output:()=>q_,$input:()=>L_,$constructor:()=>B,$brand:()=>zg,$ZodXor:()=>sV,$ZodXID:()=>DV,$ZodVoid:()=>oV,$ZodUnknown:()=>lV,$ZodUnion:()=>UJ,$ZodUndefined:()=>nV,$ZodUUID:()=>PV,$ZodURL:()=>BV,$ZodULID:()=>KV,$ZodType:()=>d,$ZodTuple:()=>wv,$ZodTransform:()=>GG,$ZodTemplateLiteral:()=>qG,$ZodSymbol:()=>mV,$ZodSuccess:()=>YG,$ZodStringFormat:()=>e,$ZodString:()=>i6,$ZodSet:()=>vG,$ZodRegistry:()=>H_,$ZodRecord:()=>UG,$ZodRealError:()=>i$,$ZodReadonly:()=>BG,$ZodPromise:()=>HG,$ZodPreprocess:()=>OG,$ZodPrefault:()=>NG,$ZodPipe:()=>Jv,$ZodOptional:()=>Uv,$ZodObjectJIT:()=>eV,$ZodObject:()=>$9,$ZodNumberFormat:()=>yV,$ZodNumber:()=>s0,$ZodNullable:()=>XG,$ZodNull:()=>hV,$ZodNonOptional:()=>WG,$ZodNever:()=>tV,$ZodNanoID:()=>LV,$ZodNaN:()=>PG,$ZodMap:()=>JG,$ZodMAC:()=>EV,$ZodLiteral:()=>gG,$ZodLazy:()=>uG,$ZodKSUID:()=>fV,$ZodJWT:()=>xV,$ZodIntersection:()=>wG,$ZodISOTime:()=>bV,$ZodISODuration:()=>FV,$ZodISODateTime:()=>TV,$ZodISODate:()=>ZV,$ZodIPv6:()=>iV,$ZodIPv4:()=>MV,$ZodGUID:()=>QV,$ZodFunction:()=>LG,$ZodFile:()=>VG,$ZodExactOptional:()=>_G,$ZodError:()=>o1,$ZodEnum:()=>zG,$ZodEncodeError:()=>b6,$ZodEmoji:()=>qV,$ZodEmail:()=>OV,$ZodE164:()=>jV,$ZodDiscriminatedUnion:()=>$G,$ZodDefault:()=>IG,$ZodDate:()=>pV,$ZodCustomStringFormat:()=>rV,$ZodCustom:()=>KG,$ZodCodec:()=>JJ,$ZodCheckUpperCase:()=>gV,$ZodCheckStringFormat:()=>iw,$ZodCheckStartsWith:()=>GV,$ZodCheckSizeEquals:()=>$V,$ZodCheckRegex:()=>vV,$ZodCheckProperty:()=>XV,$ZodCheckOverwrite:()=>NV,$ZodCheckNumberFormat:()=>pg,$ZodCheckMultipleOf:()=>og,$ZodCheckMinSize:()=>sg,$ZodCheckMinLength:()=>UV,$ZodCheckMimeType:()=>IV,$ZodCheckMaxSize:()=>eg,$ZodCheckMaxLength:()=>wV,$ZodCheckLowerCase:()=>zV,$ZodCheckLessThan:()=>c0,$ZodCheckLengthEquals:()=>JV,$ZodCheckIncludes:()=>VV,$ZodCheckGreaterThan:()=>l0,$ZodCheckEndsWith:()=>_V,$ZodCheckBigIntFormat:()=>ag,$ZodCheck:()=>$$,$ZodCatch:()=>QG,$ZodCUID2:()=>uV,$ZodCUID:()=>HV,$ZodCIDRv6:()=>AV,$ZodCIDRv4:()=>SV,$ZodBoolean:()=>wJ,$ZodBigIntFormat:()=>dV,$ZodBigInt:()=>$v,$ZodBase64URL:()=>CV,$ZodBase64:()=>kV,$ZodAsyncError:()=>V4,$ZodArray:()=>aV,$ZodAny:()=>cV});var K3,vg=Object.freeze({status:"aborted"});function B($,w,U){function v(V,_){if(!V._zod)Object.defineProperty(V,"_zod",{value:{def:_,constr:g,traits:new Set},enumerable:!1});if(V._zod.traits.has($))return;V._zod.traits.add($),w(V,_);let G=g.prototype,X=Object.keys(G);for(let I=0;I<X.length;I++){let N=X[I];if(!(N in V))V[N]=G[N].bind(V)}}let J=U?.Parent??Object;class z extends J{}Object.defineProperty(z,"name",{value:$});function g(V){var _;let G=U?.Parent?new z:this;v(G,V),(_=G._zod).deferred??(_.deferred=[]);for(let X of G._zod.deferred)X();return G}return Object.defineProperty(g,"init",{value:v}),Object.defineProperty(g,Symbol.hasInstance,{value:(V)=>{if(U?.Parent&&V instanceof U.Parent)return!0;return V?._zod?.traits?.has($)}}),Object.defineProperty(g,"name",{value:$}),g}var zg=Symbol("zod_brand");class V4 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class b6 extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}}(K3=globalThis).__zod_globalConfig??(K3.__zod_globalConfig={});var Z6=globalThis.__zod_globalConfig;function g$($){if($)Object.assign(Z6,$);return Z6}var T={};Y4(T,{unwrapMessage:()=>m1,uint8ArrayToHex:()=>Oq,uint8ArrayToBase64url:()=>Qq,uint8ArrayToBase64:()=>T3,stringifyPrimitive:()=>K,slugify:()=>Gg,shallowClone:()=>Xg,safeExtend:()=>_q,required:()=>Nq,randomString:()=>Uq,propertyKeyTypes:()=>c1,promiseAllObject:()=>wq,primitiveTypes:()=>Ig,prefixIssues:()=>M$,pick:()=>gq,partial:()=>Iq,parsedType:()=>D,optionalKeys:()=>Ng,omit:()=>Vq,objectClone:()=>eB,numKeys:()=>Jq,nullish:()=>y4,normalizeParams:()=>F,mergeDefs:()=>K4,merge:()=>Xq,jsonStringifyReplacer:()=>Dw,joinValues:()=>L,issue:()=>Tw,isPlainObject:()=>m4,isObject:()=>F6,hexToUint8Array:()=>Pq,getSizableOrigin:()=>l1,getParsedType:()=>vq,getLengthableOrigin:()=>t1,getEnumValues:()=>n1,getElementAtPath:()=>$q,floatSafeRemainder:()=>Vg,finalizeIssue:()=>Z$,extend:()=>Gq,explicitlyAborted:()=>Qg,escapeRegex:()=>n$,esc:()=>S0,defineLazy:()=>n,createTransparentProxy:()=>zq,cloneDef:()=>sB,clone:()=>T$,cleanRegex:()=>h1,cleanEnum:()=>Wq,captureStackTrace:()=>A0,cached:()=>fw,base64urlToUint8Array:()=>Yq,base64ToUint8Array:()=>f3,assignProp:()=>d4,assertNotEqual:()=>tB,assertNever:()=>pB,assertIs:()=>oB,assertEqual:()=>lB,assert:()=>aB,allowsEval:()=>_g,aborted:()=>n4,NUMBER_FORMAT_RANGES:()=>Wg,Class:()=>Z3,BIGINT_FORMAT_RANGES:()=>Yg});function lB($){return $}function tB($){return $}function oB($){}function pB($){throw Error("Unexpected value in exhaustive check")}function aB($){}function n1($){let w=Object.values($).filter((v)=>typeof v==="number");return Object.entries($).filter(([v,J])=>w.indexOf(+v)===-1).map(([v,J])=>J)}function L($,w="|"){return $.map((U)=>K(U)).join(w)}function Dw($,w){if(typeof w==="bigint")return w.toString();return w}function fw($){return{get value(){{let U=$();return Object.defineProperty(this,"value",{value:U}),U}throw Error("cached value already set")}}}function y4($){return $===null||$===void 0}function h1($){let w=$.startsWith("^")?1:0,U=$.endsWith("$")?$.length-1:$.length;return $.slice(w,U)}function Vg($,w){let U=$/w,v=Math.round(U),J=Number.EPSILON*Math.max(Math.abs(U),1);if(Math.abs(U-v)<J)return 0;return U-v}var D3=Symbol("evaluating");function n($,w,U){let v=void 0;Object.defineProperty($,w,{get(){if(v===D3)return;if(v===void 0)v=D3,v=U();return v},set(J){Object.defineProperty($,w,{value:J})},configurable:!0})}function eB($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function d4($,w,U){Object.defineProperty($,w,{value:U,writable:!0,enumerable:!0,configurable:!0})}function K4(...$){let w={};for(let U of $){let v=Object.getOwnPropertyDescriptors(U);Object.assign(w,v)}return Object.defineProperties({},w)}function sB($){return K4($._zod.def)}function $q($,w){if(!w)return $;return w.reduce((U,v)=>U?.[v],$)}function wq($){let w=Object.keys($),U=w.map((v)=>$[v]);return Promise.all(U).then((v)=>{let J={};for(let z=0;z<w.length;z++)J[w[z]]=v[z];return J})}function Uq($=10){let U="";for(let v=0;v<$;v++)U+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return U}function S0($){return JSON.stringify($)}function Gg($){return $.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var A0="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};function F6($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var _g=fw(()=>{if(Z6.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function m4($){if(F6($)===!1)return!1;let w=$.constructor;if(w===void 0)return!0;if(typeof w!=="function")return!0;let U=w.prototype;if(F6(U)===!1)return!1;if(Object.prototype.hasOwnProperty.call(U,"isPrototypeOf")===!1)return!1;return!0}function Xg($){if(m4($))return{...$};if(Array.isArray($))return[...$];if($ instanceof Map)return new Map($);if($ instanceof Set)return new Set($);return $}function Jq($){let w=0;for(let U in $)if(Object.prototype.hasOwnProperty.call($,U))w++;return w}var vq=($)=>{let w=typeof $;switch(w){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: ${w}`)}},c1=new Set(["string","number","symbol"]),Ig=new Set(["string","number","bigint","boolean","symbol","undefined"]);function n$($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function T$($,w,U){let v=new $._zod.constr(w??$._zod.def);if(!w||U?.parent)v._zod.parent=$;return v}function F($){let w=$;if(!w)return{};if(typeof w==="string")return{error:()=>w};if(w?.message!==void 0){if(w?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");w.error=w.message}if(delete w.message,typeof w.error==="string")return{...w,error:()=>w.error};return w}function zq($){let w;return new Proxy({},{get(U,v,J){return w??(w=$()),Reflect.get(w,v,J)},set(U,v,J,z){return w??(w=$()),Reflect.set(w,v,J,z)},has(U,v){return w??(w=$()),Reflect.has(w,v)},deleteProperty(U,v){return w??(w=$()),Reflect.deleteProperty(w,v)},ownKeys(U){return w??(w=$()),Reflect.ownKeys(w)},getOwnPropertyDescriptor(U,v){return w??(w=$()),Reflect.getOwnPropertyDescriptor(w,v)},defineProperty(U,v,J){return w??(w=$()),Reflect.defineProperty(w,v,J)}})}function K($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function Ng($){return Object.keys($).filter((w)=>{return $[w]._zod.optin==="optional"&&$[w]._zod.optout==="optional"})}var Wg={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]},Yg={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function gq($,w){let U=$._zod.def,v=U.checks;if(v&&v.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let z=K4($._zod.def,{get shape(){let g={};for(let V in w){if(!(V in U.shape))throw Error(`Unrecognized key: "${V}"`);if(!w[V])continue;g[V]=U.shape[V]}return d4(this,"shape",g),g},checks:[]});return T$($,z)}function Vq($,w){let U=$._zod.def,v=U.checks;if(v&&v.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let z=K4($._zod.def,{get shape(){let g={...$._zod.def.shape};for(let V in w){if(!(V in U.shape))throw Error(`Unrecognized key: "${V}"`);if(!w[V])continue;delete g[V]}return d4(this,"shape",g),g},checks:[]});return T$($,z)}function Gq($,w){if(!m4(w))throw Error("Invalid input to extend: expected a plain object");let U=$._zod.def.checks;if(U&&U.length>0){let z=$._zod.def.shape;for(let g in w)if(Object.getOwnPropertyDescriptor(z,g)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let J=K4($._zod.def,{get shape(){let z={...$._zod.def.shape,...w};return d4(this,"shape",z),z}});return T$($,J)}function _q($,w){if(!m4(w))throw Error("Invalid input to safeExtend: expected a plain object");let U=K4($._zod.def,{get shape(){let v={...$._zod.def.shape,...w};return d4(this,"shape",v),v}});return T$($,U)}function Xq($,w){if($._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let U=K4($._zod.def,{get shape(){let v={...$._zod.def.shape,...w._zod.def.shape};return d4(this,"shape",v),v},get catchall(){return w._zod.def.catchall},checks:w._zod.def.checks??[]});return T$($,U)}function Iq($,w,U){let J=w._zod.def.checks;if(J&&J.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let g=K4(w._zod.def,{get shape(){let V=w._zod.def.shape,_={...V};if(U)for(let G in U){if(!(G in V))throw Error(`Unrecognized key: "${G}"`);if(!U[G])continue;_[G]=$?new $({type:"optional",innerType:V[G]}):V[G]}else for(let G in V)_[G]=$?new $({type:"optional",innerType:V[G]}):V[G];return d4(this,"shape",_),_},checks:[]});return T$(w,g)}function Nq($,w,U){let v=K4(w._zod.def,{get shape(){let J=w._zod.def.shape,z={...J};if(U)for(let g in U){if(!(g in z))throw Error(`Unrecognized key: "${g}"`);if(!U[g])continue;z[g]=new $({type:"nonoptional",innerType:J[g]})}else for(let g in J)z[g]=new $({type:"nonoptional",innerType:J[g]});return d4(this,"shape",z),z}});return T$(w,v)}function n4($,w=0){if($.aborted===!0)return!0;for(let U=w;U<$.issues.length;U++)if($.issues[U]?.continue!==!0)return!0;return!1}function Qg($,w=0){if($.aborted===!0)return!0;for(let U=w;U<$.issues.length;U++)if($.issues[U]?.continue===!1)return!0;return!1}function M$($,w){return w.map((U)=>{var v;return(v=U).path??(v.path=[]),U.path.unshift($),U})}function m1($){return typeof $==="string"?$:$?.message}function Z$($,w,U){let v=$.message?$.message:m1($.inst?._zod.def?.error?.($))??m1(w?.error?.($))??m1(U.customError?.($))??m1(U.localeError?.($))??"Invalid input",{inst:J,continue:z,input:g,...V}=$;if(V.path??(V.path=[]),V.message=v,w?.reportInput)V.input=g;return V}function l1($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function t1($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function D($){let w=typeof $;switch(w){case"number":return Number.isNaN($)?"nan":"number";case"object":{if($===null)return"null";if(Array.isArray($))return"array";let U=$;if(U&&Object.getPrototypeOf(U)!==Object.prototype&&"constructor"in U&&U.constructor)return U.constructor.name}}return w}function Tw(...$){let[w,U,v]=$;if(typeof w==="string")return{message:w,code:"custom",input:U,inst:v};return{...w}}function Wq($){return Object.entries($).filter(([w,U])=>{return Number.isNaN(Number.parseInt(w,10))}).map((w)=>w[1])}function f3($){let w=atob($),U=new Uint8Array(w.length);for(let v=0;v<w.length;v++)U[v]=w.charCodeAt(v);return U}function T3($){let w="";for(let U=0;U<$.length;U++)w+=String.fromCharCode($[U]);return btoa(w)}function Yq($){let w=$.replace(/-/g,"+").replace(/_/g,"/"),U="=".repeat((4-w.length%4)%4);return f3(w+U)}function Qq($){return T3($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Pq($){let w=$.replace(/^0x/,"");if(w.length%2!==0)throw Error("Invalid hex string length");let U=new Uint8Array(w.length/2);for(let v=0;v<w.length;v+=2)U[v/2]=Number.parseInt(w.slice(v,v+2),16);return U}function Oq($){return Array.from($).map((w)=>w.toString(16).padStart(2,"0")).join("")}class Z3{constructor(...$){}}var b3=($,w)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:w,enumerable:!1}),$.message=JSON.stringify(w,Dw,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},o1=B("$ZodError",b3),i$=B("$ZodError",b3,{Parent:Error});function p1($,w=(U)=>U.message){let U={},v=[];for(let J of $.issues)if(J.path.length>0)U[J.path[0]]=U[J.path[0]]||[],U[J.path[0]].push(w(J));else v.push(w(J));return{formErrors:v,fieldErrors:U}}function a1($,w=(U)=>U.message){let U={_errors:[]},v=(J,z=[])=>{for(let g of J.issues)if(g.code==="invalid_union"&&g.errors.length)g.errors.map((V)=>v({issues:V},[...z,...g.path]));else if(g.code==="invalid_key")v({issues:g.issues},[...z,...g.path]);else if(g.code==="invalid_element")v({issues:g.issues},[...z,...g.path]);else{let V=[...z,...g.path];if(V.length===0)U._errors.push(w(g));else{let _=U,G=0;while(G<V.length){let X=V[G];if(G!==V.length-1)_[X]=_[X]||{_errors:[]};else _[X]=_[X]||{_errors:[]},_[X]._errors.push(w(g));_=_[X],G++}}}};return v($),U}function Pg($,w=(U)=>U.message){let U={errors:[]},v=(J,z=[])=>{var g,V;for(let _ of J.issues)if(_.code==="invalid_union"&&_.errors.length)_.errors.map((G)=>v({issues:G},[...z,..._.path]));else if(_.code==="invalid_key")v({issues:_.issues},[...z,..._.path]);else if(_.code==="invalid_element")v({issues:_.issues},[...z,..._.path]);else{let G=[...z,..._.path];if(G.length===0){U.errors.push(w(_));continue}let X=U,I=0;while(I<G.length){let N=G[I],W=I===G.length-1;if(typeof N==="string")X.properties??(X.properties={}),(g=X.properties)[N]??(g[N]={errors:[]}),X=X.properties[N];else X.items??(X.items=[]),(V=X.items)[N]??(V[N]={errors:[]}),X=X.items[N];if(W)X.errors.push(w(_));I++}}};return v($),U}function F3($){let w=[],U=$.map((v)=>typeof v==="object"?v.key:v);for(let v of U)if(typeof v==="number")w.push(`[${v}]`);else if(typeof v==="symbol")w.push(`[${JSON.stringify(String(v))}]`);else if(/[^\w$]/.test(v))w.push(`[${JSON.stringify(v)}]`);else{if(w.length)w.push(".");w.push(v)}return w.join("")}function Og($){let w=[],U=[...$.issues].sort((v,J)=>(v.path??[]).length-(J.path??[]).length);for(let v of U)if(w.push(`✖ ${v.message}`),v.path?.length)w.push(` → at ${F3(v.path)}`);return w.join(`
|
|
191
|
+
`)}var Zw=($)=>(w,U,v,J)=>{let z=v?{...v,async:!1}:{async:!1},g=w._zod.run({value:U,issues:[]},z);if(g instanceof Promise)throw new V4;if(g.issues.length){let V=new(J?.Err??$)(g.issues.map((_)=>Z$(_,z,g$())));throw A0(V,J?.callee),V}return g.value},R0=Zw(i$),bw=($)=>async(w,U,v,J)=>{let z=v?{...v,async:!0}:{async:!0},g=w._zod.run({value:U,issues:[]},z);if(g instanceof Promise)g=await g;if(g.issues.length){let V=new(J?.Err??$)(g.issues.map((_)=>Z$(_,z,g$())));throw A0(V,J?.callee),V}return g.value},k0=bw(i$),Fw=($)=>(w,U,v)=>{let J=v?{...v,async:!1}:{async:!1},z=w._zod.run({value:U,issues:[]},J);if(z instanceof Promise)throw new V4;return z.issues.length?{success:!1,error:new($??o1)(z.issues.map((g)=>Z$(g,J,g$())))}:{success:!0,data:z.value}},Bg=Fw(i$),Mw=($)=>async(w,U,v)=>{let J=v?{...v,async:!0}:{async:!0},z=w._zod.run({value:U,issues:[]},J);if(z instanceof Promise)z=await z;return z.issues.length?{success:!1,error:new $(z.issues.map((g)=>Z$(g,J,g$())))}:{success:!0,data:z.value}},qg=Mw(i$),C0=($)=>(w,U,v)=>{let J=v?{...v,direction:"backward"}:{direction:"backward"};return Zw($)(w,U,J)},qq=C0(i$),j0=($)=>(w,U,v)=>{return Zw($)(w,U,v)},Lq=j0(i$),x0=($)=>async(w,U,v)=>{let J=v?{...v,direction:"backward"}:{direction:"backward"};return bw($)(w,U,J)},Hq=x0(i$),r0=($)=>async(w,U,v)=>{return bw($)(w,U,v)},uq=r0(i$),y0=($)=>(w,U,v)=>{let J=v?{...v,direction:"backward"}:{direction:"backward"};return Fw($)(w,U,J)},Kq=y0(i$),d0=($)=>(w,U,v)=>{return Fw($)(w,U,v)},Dq=d0(i$),m0=($)=>async(w,U,v)=>{let J=v?{...v,direction:"backward"}:{direction:"backward"};return Mw($)(w,U,J)},fq=m0(i$),n0=($)=>async(w,U,v)=>{return Mw($)(w,U,v)},Tq=n0(i$);var x$={};Y4(x$,{xid:()=>Kg,uuid7:()=>Mq,uuid6:()=>Fq,uuid4:()=>bq,uuid:()=>M6,uppercase:()=>tg,unicodeEmail:()=>M3,undefined:()=>cg,ulid:()=>ug,time:()=>xg,string:()=>yg,sha512_hex:()=>aq,sha512_base64url:()=>sq,sha512_base64:()=>eq,sha384_hex:()=>tq,sha384_base64url:()=>pq,sha384_base64:()=>oq,sha256_hex:()=>hq,sha256_base64url:()=>lq,sha256_base64:()=>cq,sha1_hex:()=>dq,sha1_base64url:()=>nq,sha1_base64:()=>mq,rfc5322Email:()=>Eq,number:()=>e1,null:()=>hg,nanoid:()=>fg,md5_hex:()=>xq,md5_base64url:()=>yq,md5_base64:()=>rq,mac:()=>Eg,lowercase:()=>lg,ksuid:()=>Dg,ipv6:()=>ig,ipv4:()=>Mg,integer:()=>mg,idnEmail:()=>Sq,httpProtocol:()=>kg,html5Email:()=>iq,hostname:()=>kq,hex:()=>jq,guid:()=>Zg,extendedDuration:()=>Zq,emoji:()=>Fg,email:()=>bg,e164:()=>Cg,duration:()=>Tg,domain:()=>Cq,datetime:()=>rg,date:()=>jg,cuid2:()=>Hg,cuid:()=>Lg,cidrv6:()=>Ag,cidrv4:()=>Sg,browserEmail:()=>Aq,boolean:()=>ng,bigint:()=>dg,base64url:()=>h0,base64:()=>Rg});var Lg=/^[cC][0-9a-z]{6,}$/,Hg=/^[0-9a-z]+$/,ug=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Kg=/^[0-9a-vA-V]{20}$/,Dg=/^[A-Za-z0-9]{27}$/,fg=/^[a-zA-Z0-9_-]{21}$/,Tg=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Zq=/^[-+]?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)?)??$/,Zg=/^([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})$/,M6=($)=>{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})$`)},bq=M6(4),Fq=M6(6),Mq=M6(7),bg=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,iq=/^[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])?)*$/,Eq=/^(([^<>()\[\]\\.,;:\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,}))$/,M3=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Sq=M3,Aq=/^[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])?)*$/,Rq="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Fg(){return new RegExp(Rq,"u")}var Mg=/^(?:(?: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])$/,ig=/^(([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}|:))$/,Eg=($)=>{let w=n$($??":");return new RegExp(`^(?:[0-9A-F]{2}${w}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${w}){5}[0-9a-f]{2}$`)},Sg=/^((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])$/,Ag=/^(([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])$/,Rg=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,h0=/^[A-Za-z0-9_-]*$/,kq=/^(?=.{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])?)*\.?$/,Cq=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,kg=/^https?$/,Cg=/^\+[1-9]\d{6,14}$/,i3="(?:(?:\\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])))",jg=new RegExp(`^${i3}$`);function E3($){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 xg($){return new RegExp(`^${E3($)}$`)}function rg($){let w=E3({precision:$.precision}),U=["Z"];if($.local)U.push("");if($.offset)U.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let v=`${w}(?:${U.join("|")})`;return new RegExp(`^${i3}T(?:${v})$`)}var yg=($)=>{let w=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${w}$`)},dg=/^-?\d+n?$/,mg=/^-?\d+$/,e1=/^-?\d+(?:\.\d+)?$/,ng=/^(?:true|false)$/i,hg=/^null$/i;var cg=/^undefined$/i;var lg=/^[^A-Z]*$/,tg=/^[^a-z]*$/,jq=/^[0-9a-fA-F]*$/;function s1($,w){return new RegExp(`^[A-Za-z0-9+/]{${$}}${w}$`)}function $J($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var xq=/^[0-9a-fA-F]{32}$/,rq=s1(22,"=="),yq=$J(22),dq=/^[0-9a-fA-F]{40}$/,mq=s1(27,"="),nq=$J(27),hq=/^[0-9a-fA-F]{64}$/,cq=s1(43,"="),lq=$J(43),tq=/^[0-9a-fA-F]{96}$/,oq=s1(64,""),pq=$J(64),aq=/^[0-9a-fA-F]{128}$/,eq=s1(86,"=="),sq=$J(86);var $$=B("$ZodCheck",($,w)=>{var U;$._zod??($._zod={}),$._zod.def=w,(U=$._zod).onattach??(U.onattach=[])}),A3={number:"number",bigint:"bigint",object:"date"},c0=B("$ZodCheckLessThan",($,w)=>{$$.init($,w);let U=A3[typeof w.value];$._zod.onattach.push((v)=>{let J=v._zod.bag,z=(w.inclusive?J.maximum:J.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(w.value<z)if(w.inclusive)J.maximum=w.value;else J.exclusiveMaximum=w.value}),$._zod.check=(v)=>{if(w.inclusive?v.value<=w.value:v.value<w.value)return;v.issues.push({origin:U,code:"too_big",maximum:typeof w.value==="object"?w.value.getTime():w.value,input:v.value,inclusive:w.inclusive,inst:$,continue:!w.abort})}}),l0=B("$ZodCheckGreaterThan",($,w)=>{$$.init($,w);let U=A3[typeof w.value];$._zod.onattach.push((v)=>{let J=v._zod.bag,z=(w.inclusive?J.minimum:J.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(w.value>z)if(w.inclusive)J.minimum=w.value;else J.exclusiveMinimum=w.value}),$._zod.check=(v)=>{if(w.inclusive?v.value>=w.value:v.value>w.value)return;v.issues.push({origin:U,code:"too_small",minimum:typeof w.value==="object"?w.value.getTime():w.value,input:v.value,inclusive:w.inclusive,inst:$,continue:!w.abort})}}),og=B("$ZodCheckMultipleOf",($,w)=>{$$.init($,w),$._zod.onattach.push((U)=>{var v;(v=U._zod.bag).multipleOf??(v.multipleOf=w.value)}),$._zod.check=(U)=>{if(typeof U.value!==typeof w.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof U.value==="bigint"?U.value%w.value===BigInt(0):Vg(U.value,w.value)===0)return;U.issues.push({origin:typeof U.value,code:"not_multiple_of",divisor:w.value,input:U.value,inst:$,continue:!w.abort})}}),pg=B("$ZodCheckNumberFormat",($,w)=>{$$.init($,w),w.format=w.format||"float64";let U=w.format?.includes("int"),v=U?"int":"number",[J,z]=Wg[w.format];$._zod.onattach.push((g)=>{let V=g._zod.bag;if(V.format=w.format,V.minimum=J,V.maximum=z,U)V.pattern=mg}),$._zod.check=(g)=>{let V=g.value;if(U){if(!Number.isInteger(V)){g.issues.push({expected:v,format:w.format,code:"invalid_type",continue:!1,input:V,inst:$});return}if(!Number.isSafeInteger(V)){if(V>0)g.issues.push({input:V,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:v,inclusive:!0,continue:!w.abort});else g.issues.push({input:V,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:v,inclusive:!0,continue:!w.abort});return}}if(V<J)g.issues.push({origin:"number",input:V,code:"too_small",minimum:J,inclusive:!0,inst:$,continue:!w.abort});if(V>z)g.issues.push({origin:"number",input:V,code:"too_big",maximum:z,inclusive:!0,inst:$,continue:!w.abort})}}),ag=B("$ZodCheckBigIntFormat",($,w)=>{$$.init($,w);let[U,v]=Yg[w.format];$._zod.onattach.push((J)=>{let z=J._zod.bag;z.format=w.format,z.minimum=U,z.maximum=v}),$._zod.check=(J)=>{let z=J.value;if(z<U)J.issues.push({origin:"bigint",input:z,code:"too_small",minimum:U,inclusive:!0,inst:$,continue:!w.abort});if(z>v)J.issues.push({origin:"bigint",input:z,code:"too_big",maximum:v,inclusive:!0,inst:$,continue:!w.abort})}}),eg=B("$ZodCheckMaxSize",($,w)=>{var U;$$.init($,w),(U=$._zod.def).when??(U.when=(v)=>{let J=v.value;return!y4(J)&&J.size!==void 0}),$._zod.onattach.push((v)=>{let J=v._zod.bag.maximum??Number.POSITIVE_INFINITY;if(w.maximum<J)v._zod.bag.maximum=w.maximum}),$._zod.check=(v)=>{let J=v.value;if(J.size<=w.maximum)return;v.issues.push({origin:l1(J),code:"too_big",maximum:w.maximum,inclusive:!0,input:J,inst:$,continue:!w.abort})}}),sg=B("$ZodCheckMinSize",($,w)=>{var U;$$.init($,w),(U=$._zod.def).when??(U.when=(v)=>{let J=v.value;return!y4(J)&&J.size!==void 0}),$._zod.onattach.push((v)=>{let J=v._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(w.minimum>J)v._zod.bag.minimum=w.minimum}),$._zod.check=(v)=>{let J=v.value;if(J.size>=w.minimum)return;v.issues.push({origin:l1(J),code:"too_small",minimum:w.minimum,inclusive:!0,input:J,inst:$,continue:!w.abort})}}),$V=B("$ZodCheckSizeEquals",($,w)=>{var U;$$.init($,w),(U=$._zod.def).when??(U.when=(v)=>{let J=v.value;return!y4(J)&&J.size!==void 0}),$._zod.onattach.push((v)=>{let J=v._zod.bag;J.minimum=w.size,J.maximum=w.size,J.size=w.size}),$._zod.check=(v)=>{let J=v.value,z=J.size;if(z===w.size)return;let g=z>w.size;v.issues.push({origin:l1(J),...g?{code:"too_big",maximum:w.size}:{code:"too_small",minimum:w.size},inclusive:!0,exact:!0,input:v.value,inst:$,continue:!w.abort})}}),wV=B("$ZodCheckMaxLength",($,w)=>{var U;$$.init($,w),(U=$._zod.def).when??(U.when=(v)=>{let J=v.value;return!y4(J)&&J.length!==void 0}),$._zod.onattach.push((v)=>{let J=v._zod.bag.maximum??Number.POSITIVE_INFINITY;if(w.maximum<J)v._zod.bag.maximum=w.maximum}),$._zod.check=(v)=>{let J=v.value;if(J.length<=w.maximum)return;let g=t1(J);v.issues.push({origin:g,code:"too_big",maximum:w.maximum,inclusive:!0,input:J,inst:$,continue:!w.abort})}}),UV=B("$ZodCheckMinLength",($,w)=>{var U;$$.init($,w),(U=$._zod.def).when??(U.when=(v)=>{let J=v.value;return!y4(J)&&J.length!==void 0}),$._zod.onattach.push((v)=>{let J=v._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(w.minimum>J)v._zod.bag.minimum=w.minimum}),$._zod.check=(v)=>{let J=v.value;if(J.length>=w.minimum)return;let g=t1(J);v.issues.push({origin:g,code:"too_small",minimum:w.minimum,inclusive:!0,input:J,inst:$,continue:!w.abort})}}),JV=B("$ZodCheckLengthEquals",($,w)=>{var U;$$.init($,w),(U=$._zod.def).when??(U.when=(v)=>{let J=v.value;return!y4(J)&&J.length!==void 0}),$._zod.onattach.push((v)=>{let J=v._zod.bag;J.minimum=w.length,J.maximum=w.length,J.length=w.length}),$._zod.check=(v)=>{let J=v.value,z=J.length;if(z===w.length)return;let g=t1(J),V=z>w.length;v.issues.push({origin:g,...V?{code:"too_big",maximum:w.length}:{code:"too_small",minimum:w.length},inclusive:!0,exact:!0,input:v.value,inst:$,continue:!w.abort})}}),iw=B("$ZodCheckStringFormat",($,w)=>{var U,v;if($$.init($,w),$._zod.onattach.push((J)=>{let z=J._zod.bag;if(z.format=w.format,w.pattern)z.patterns??(z.patterns=new Set),z.patterns.add(w.pattern)}),w.pattern)(U=$._zod).check??(U.check=(J)=>{if(w.pattern.lastIndex=0,w.pattern.test(J.value))return;J.issues.push({origin:"string",code:"invalid_format",format:w.format,input:J.value,...w.pattern?{pattern:w.pattern.toString()}:{},inst:$,continue:!w.abort})});else(v=$._zod).check??(v.check=()=>{})}),vV=B("$ZodCheckRegex",($,w)=>{iw.init($,w),$._zod.check=(U)=>{if(w.pattern.lastIndex=0,w.pattern.test(U.value))return;U.issues.push({origin:"string",code:"invalid_format",format:"regex",input:U.value,pattern:w.pattern.toString(),inst:$,continue:!w.abort})}}),zV=B("$ZodCheckLowerCase",($,w)=>{w.pattern??(w.pattern=lg),iw.init($,w)}),gV=B("$ZodCheckUpperCase",($,w)=>{w.pattern??(w.pattern=tg),iw.init($,w)}),VV=B("$ZodCheckIncludes",($,w)=>{$$.init($,w);let U=n$(w.includes),v=new RegExp(typeof w.position==="number"?`^.{${w.position}}${U}`:U);w.pattern=v,$._zod.onattach.push((J)=>{let z=J._zod.bag;z.patterns??(z.patterns=new Set),z.patterns.add(v)}),$._zod.check=(J)=>{if(J.value.includes(w.includes,w.position))return;J.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:w.includes,input:J.value,inst:$,continue:!w.abort})}}),GV=B("$ZodCheckStartsWith",($,w)=>{$$.init($,w);let U=new RegExp(`^${n$(w.prefix)}.*`);w.pattern??(w.pattern=U),$._zod.onattach.push((v)=>{let J=v._zod.bag;J.patterns??(J.patterns=new Set),J.patterns.add(U)}),$._zod.check=(v)=>{if(v.value.startsWith(w.prefix))return;v.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:w.prefix,input:v.value,inst:$,continue:!w.abort})}}),_V=B("$ZodCheckEndsWith",($,w)=>{$$.init($,w);let U=new RegExp(`.*${n$(w.suffix)}$`);w.pattern??(w.pattern=U),$._zod.onattach.push((v)=>{let J=v._zod.bag;J.patterns??(J.patterns=new Set),J.patterns.add(U)}),$._zod.check=(v)=>{if(v.value.endsWith(w.suffix))return;v.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:w.suffix,input:v.value,inst:$,continue:!w.abort})}});function S3($,w,U){if($.issues.length)w.issues.push(...M$(U,$.issues))}var XV=B("$ZodCheckProperty",($,w)=>{$$.init($,w),$._zod.check=(U)=>{let v=w.schema._zod.run({value:U.value[w.property],issues:[]},{});if(v instanceof Promise)return v.then((J)=>S3(J,U,w.property));S3(v,U,w.property);return}}),IV=B("$ZodCheckMimeType",($,w)=>{$$.init($,w);let U=new Set(w.mime);$._zod.onattach.push((v)=>{v._zod.bag.mime=w.mime}),$._zod.check=(v)=>{if(U.has(v.value.type))return;v.issues.push({code:"invalid_value",values:w.mime,input:v.value.type,inst:$,continue:!w.abort})}}),NV=B("$ZodCheckOverwrite",($,w)=>{$$.init($,w),$._zod.check=(U)=>{U.value=w.tx(U.value)}});class t0{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 U=$.split(`
|
|
192
|
+
`).filter((z)=>z),v=Math.min(...U.map((z)=>z.length-z.trimStart().length)),J=U.map((z)=>z.slice(v)).map((z)=>" ".repeat(this.indent*2)+z);for(let z of J)this.content.push(z)}compile(){let $=Function,w=this?.args,v=[...(this?.content??[""]).map((J)=>` ${J}`)];return new $(...w,v.join(`
|
|
193
|
+
`))}}var WV={major:4,minor:4,patch:3};var d=B("$ZodType",($,w)=>{var U;$??($={}),$._zod.def=w,$._zod.bag=$._zod.bag||{},$._zod.version=WV;let v=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))v.unshift($);for(let J of v)for(let z of J._zod.onattach)z($);if(v.length===0)(U=$._zod).deferred??(U.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let J=(g,V,_)=>{let G=n4(g),X;for(let I of V){if(I._zod.def.when){if(Qg(g))continue;if(!I._zod.def.when(g))continue}else if(G)continue;let N=g.issues.length,W=I._zod.check(g);if(W instanceof Promise&&_?.async===!1)throw new V4;if(X||W instanceof Promise)X=(X??Promise.resolve()).then(async()=>{if(await W,g.issues.length===N)return;if(!G)G=n4(g,N)});else{if(g.issues.length===N)continue;if(!G)G=n4(g,N)}}if(X)return X.then(()=>{return g});return g},z=(g,V,_)=>{if(n4(g))return g.aborted=!0,g;let G=J(V,v,_);if(G instanceof Promise){if(_.async===!1)throw new V4;return G.then((X)=>$._zod.parse(X,_))}return $._zod.parse(G,_)};$._zod.run=(g,V)=>{if(V.skipChecks)return $._zod.parse(g,V);if(V.direction==="backward"){let G=$._zod.parse({value:g.value,issues:[]},{...V,skipChecks:!0});if(G instanceof Promise)return G.then((X)=>{return z(X,g,V)});return z(G,g,V)}let _=$._zod.parse(g,V);if(_ instanceof Promise){if(V.async===!1)throw new V4;return _.then((G)=>J(G,v,V))}return J(_,v,V)}}n($,"~standard",()=>({validate:(J)=>{try{let z=Bg($,J);return z.success?{value:z.data}:{issues:z.error?.issues}}catch(z){return qg($,J).then((g)=>g.success?{value:g.data}:{issues:g.error?.issues})}},vendor:"zod",version:1}))}),i6=B("$ZodString",($,w)=>{d.init($,w),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??yg($._zod.bag),$._zod.parse=(U,v)=>{if(w.coerce)try{U.value=String(U.value)}catch(J){}if(typeof U.value==="string")return U;return U.issues.push({expected:"string",code:"invalid_type",input:U.value,inst:$}),U}}),e=B("$ZodStringFormat",($,w)=>{iw.init($,w),i6.init($,w)}),QV=B("$ZodGUID",($,w)=>{w.pattern??(w.pattern=Zg),e.init($,w)}),PV=B("$ZodUUID",($,w)=>{if(w.version){let v={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[w.version];if(v===void 0)throw Error(`Invalid UUID version: "${w.version}"`);w.pattern??(w.pattern=M6(v))}else w.pattern??(w.pattern=M6());e.init($,w)}),OV=B("$ZodEmail",($,w)=>{w.pattern??(w.pattern=bg),e.init($,w)}),BV=B("$ZodURL",($,w)=>{e.init($,w),$._zod.check=(U)=>{try{let v=U.value.trim();if(!w.normalize&&w.protocol?.source===kg.source){if(!/^https?:\/\//i.test(v)){U.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:U.value,inst:$,continue:!w.abort});return}}let J=new URL(v);if(w.hostname){if(w.hostname.lastIndex=0,!w.hostname.test(J.hostname))U.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:w.hostname.source,input:U.value,inst:$,continue:!w.abort})}if(w.protocol){if(w.protocol.lastIndex=0,!w.protocol.test(J.protocol.endsWith(":")?J.protocol.slice(0,-1):J.protocol))U.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:w.protocol.source,input:U.value,inst:$,continue:!w.abort})}if(w.normalize)U.value=J.href;else U.value=v;return}catch(v){U.issues.push({code:"invalid_format",format:"url",input:U.value,inst:$,continue:!w.abort})}}}),qV=B("$ZodEmoji",($,w)=>{w.pattern??(w.pattern=Fg()),e.init($,w)}),LV=B("$ZodNanoID",($,w)=>{w.pattern??(w.pattern=fg),e.init($,w)}),HV=B("$ZodCUID",($,w)=>{w.pattern??(w.pattern=Lg),e.init($,w)}),uV=B("$ZodCUID2",($,w)=>{w.pattern??(w.pattern=Hg),e.init($,w)}),KV=B("$ZodULID",($,w)=>{w.pattern??(w.pattern=ug),e.init($,w)}),DV=B("$ZodXID",($,w)=>{w.pattern??(w.pattern=Kg),e.init($,w)}),fV=B("$ZodKSUID",($,w)=>{w.pattern??(w.pattern=Dg),e.init($,w)}),TV=B("$ZodISODateTime",($,w)=>{w.pattern??(w.pattern=rg(w)),e.init($,w)}),ZV=B("$ZodISODate",($,w)=>{w.pattern??(w.pattern=jg),e.init($,w)}),bV=B("$ZodISOTime",($,w)=>{w.pattern??(w.pattern=xg(w)),e.init($,w)}),FV=B("$ZodISODuration",($,w)=>{w.pattern??(w.pattern=Tg),e.init($,w)}),MV=B("$ZodIPv4",($,w)=>{w.pattern??(w.pattern=Mg),e.init($,w),$._zod.bag.format="ipv4"}),iV=B("$ZodIPv6",($,w)=>{w.pattern??(w.pattern=ig),e.init($,w),$._zod.bag.format="ipv6",$._zod.check=(U)=>{try{new URL(`http://[${U.value}]`)}catch{U.issues.push({code:"invalid_format",format:"ipv6",input:U.value,inst:$,continue:!w.abort})}}}),EV=B("$ZodMAC",($,w)=>{w.pattern??(w.pattern=Eg(w.delimiter)),e.init($,w),$._zod.bag.format="mac"}),SV=B("$ZodCIDRv4",($,w)=>{w.pattern??(w.pattern=Sg),e.init($,w)}),AV=B("$ZodCIDRv6",($,w)=>{w.pattern??(w.pattern=Ag),e.init($,w),$._zod.check=(U)=>{let v=U.value.split("/");try{if(v.length!==2)throw Error();let[J,z]=v;if(!z)throw Error();let g=Number(z);if(`${g}`!==z)throw Error();if(g<0||g>128)throw Error();new URL(`http://[${J}]`)}catch{U.issues.push({code:"invalid_format",format:"cidrv6",input:U.value,inst:$,continue:!w.abort})}}});function RV($){if($==="")return!0;if(/\s/.test($))return!1;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}var kV=B("$ZodBase64",($,w)=>{w.pattern??(w.pattern=Rg),e.init($,w),$._zod.bag.contentEncoding="base64",$._zod.check=(U)=>{if(RV(U.value))return;U.issues.push({code:"invalid_format",format:"base64",input:U.value,inst:$,continue:!w.abort})}});function p3($){if(!h0.test($))return!1;let w=$.replace(/[-_]/g,(v)=>v==="-"?"+":"/"),U=w.padEnd(Math.ceil(w.length/4)*4,"=");return RV(U)}var CV=B("$ZodBase64URL",($,w)=>{w.pattern??(w.pattern=h0),e.init($,w),$._zod.bag.contentEncoding="base64url",$._zod.check=(U)=>{if(p3(U.value))return;U.issues.push({code:"invalid_format",format:"base64url",input:U.value,inst:$,continue:!w.abort})}}),jV=B("$ZodE164",($,w)=>{w.pattern??(w.pattern=Cg),e.init($,w)});function a3($,w=null){try{let U=$.split(".");if(U.length!==3)return!1;let[v]=U;if(!v)return!1;let J=JSON.parse(atob(v));if("typ"in J&&J?.typ!=="JWT")return!1;if(!J.alg)return!1;if(w&&(!("alg"in J)||J.alg!==w))return!1;return!0}catch{return!1}}var xV=B("$ZodJWT",($,w)=>{e.init($,w),$._zod.check=(U)=>{if(a3(U.value,w.alg))return;U.issues.push({code:"invalid_format",format:"jwt",input:U.value,inst:$,continue:!w.abort})}}),rV=B("$ZodCustomStringFormat",($,w)=>{e.init($,w),$._zod.check=(U)=>{if(w.fn(U.value))return;U.issues.push({code:"invalid_format",format:w.format,input:U.value,inst:$,continue:!w.abort})}}),s0=B("$ZodNumber",($,w)=>{d.init($,w),$._zod.pattern=$._zod.bag.pattern??e1,$._zod.parse=(U,v)=>{if(w.coerce)try{U.value=Number(U.value)}catch(g){}let J=U.value;if(typeof J==="number"&&!Number.isNaN(J)&&Number.isFinite(J))return U;let z=typeof J==="number"?Number.isNaN(J)?"NaN":!Number.isFinite(J)?"Infinity":void 0:void 0;return U.issues.push({expected:"number",code:"invalid_type",input:J,inst:$,...z?{received:z}:{}}),U}}),yV=B("$ZodNumberFormat",($,w)=>{pg.init($,w),s0.init($,w)}),wJ=B("$ZodBoolean",($,w)=>{d.init($,w),$._zod.pattern=ng,$._zod.parse=(U,v)=>{if(w.coerce)try{U.value=Boolean(U.value)}catch(z){}let J=U.value;if(typeof J==="boolean")return U;return U.issues.push({expected:"boolean",code:"invalid_type",input:J,inst:$}),U}}),$v=B("$ZodBigInt",($,w)=>{d.init($,w),$._zod.pattern=dg,$._zod.parse=(U,v)=>{if(w.coerce)try{U.value=BigInt(U.value)}catch(J){}if(typeof U.value==="bigint")return U;return U.issues.push({expected:"bigint",code:"invalid_type",input:U.value,inst:$}),U}}),dV=B("$ZodBigIntFormat",($,w)=>{ag.init($,w),$v.init($,w)}),mV=B("$ZodSymbol",($,w)=>{d.init($,w),$._zod.parse=(U,v)=>{let J=U.value;if(typeof J==="symbol")return U;return U.issues.push({expected:"symbol",code:"invalid_type",input:J,inst:$}),U}}),nV=B("$ZodUndefined",($,w)=>{d.init($,w),$._zod.pattern=cg,$._zod.values=new Set([void 0]),$._zod.parse=(U,v)=>{let J=U.value;if(typeof J>"u")return U;return U.issues.push({expected:"undefined",code:"invalid_type",input:J,inst:$}),U}}),hV=B("$ZodNull",($,w)=>{d.init($,w),$._zod.pattern=hg,$._zod.values=new Set([null]),$._zod.parse=(U,v)=>{let J=U.value;if(J===null)return U;return U.issues.push({expected:"null",code:"invalid_type",input:J,inst:$}),U}}),cV=B("$ZodAny",($,w)=>{d.init($,w),$._zod.parse=(U)=>U}),lV=B("$ZodUnknown",($,w)=>{d.init($,w),$._zod.parse=(U)=>U}),tV=B("$ZodNever",($,w)=>{d.init($,w),$._zod.parse=(U,v)=>{return U.issues.push({expected:"never",code:"invalid_type",input:U.value,inst:$}),U}}),oV=B("$ZodVoid",($,w)=>{d.init($,w),$._zod.parse=(U,v)=>{let J=U.value;if(typeof J>"u")return U;return U.issues.push({expected:"void",code:"invalid_type",input:J,inst:$}),U}}),pV=B("$ZodDate",($,w)=>{d.init($,w),$._zod.parse=(U,v)=>{if(w.coerce)try{U.value=new Date(U.value)}catch(V){}let J=U.value,z=J instanceof Date;if(z&&!Number.isNaN(J.getTime()))return U;return U.issues.push({expected:"date",code:"invalid_type",input:J,...z?{received:"Invalid Date"}:{},inst:$}),U}});function k3($,w,U){if($.issues.length)w.issues.push(...M$(U,$.issues));w.value[U]=$.value}var aV=B("$ZodArray",($,w)=>{d.init($,w),$._zod.parse=(U,v)=>{let J=U.value;if(!Array.isArray(J))return U.issues.push({expected:"array",code:"invalid_type",input:J,inst:$}),U;U.value=Array(J.length);let z=[];for(let g=0;g<J.length;g++){let V=J[g],_=w.element._zod.run({value:V,issues:[]},v);if(_ instanceof Promise)z.push(_.then((G)=>k3(G,U,g)));else k3(_,U,g)}if(z.length)return Promise.all(z).then(()=>U);return U}});function e0($,w,U,v,J,z){let g=U in v;if($.issues.length){if(J&&z&&!g)return;w.issues.push(...M$(U,$.issues))}if(!g&&!J){if(!$.issues.length)w.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[U]});return}if($.value===void 0){if(g)w.value[U]=void 0}else w.value[U]=$.value}function e3($){let w=Object.keys($.shape);for(let v of w)if(!$.shape?.[v]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${v}": expected a Zod schema`);let U=Ng($.shape);return{...$,keys:w,keySet:new Set(w),numKeys:w.length,optionalKeys:new Set(U)}}function s3($,w,U,v,J,z){let g=[],V=J.keySet,_=J.catchall._zod,G=_.def.type,X=_.optin==="optional",I=_.optout==="optional";for(let N in w){if(N==="__proto__")continue;if(V.has(N))continue;if(G==="never"){g.push(N);continue}let W=_.run({value:w[N],issues:[]},v);if(W instanceof Promise)$.push(W.then((P)=>e0(P,U,N,w,X,I)));else e0(W,U,N,w,X,I)}if(g.length)U.issues.push({code:"unrecognized_keys",keys:g,input:w,inst:z});if(!$.length)return U;return Promise.all($).then(()=>{return U})}var $9=B("$ZodObject",($,w)=>{if(d.init($,w),!Object.getOwnPropertyDescriptor(w,"shape")?.get){let V=w.shape;Object.defineProperty(w,"shape",{get:()=>{let _={...V};return Object.defineProperty(w,"shape",{value:_}),_}})}let v=fw(()=>e3(w));n($._zod,"propValues",()=>{let V=w.shape,_={};for(let G in V){let X=V[G]._zod;if(X.values){_[G]??(_[G]=new Set);for(let I of X.values)_[G].add(I)}}return _});let J=F6,z=w.catchall,g;$._zod.parse=(V,_)=>{g??(g=v.value);let G=V.value;if(!J(G))return V.issues.push({expected:"object",code:"invalid_type",input:G,inst:$}),V;V.value={};let X=[],I=g.shape;for(let N of g.keys){let W=I[N],P=W._zod.optin==="optional",Q=W._zod.optout==="optional",H=W._zod.run({value:G[N],issues:[]},_);if(H instanceof Promise)X.push(H.then((Z)=>e0(Z,V,N,G,P,Q)));else e0(H,V,N,G,P,Q)}if(!z)return X.length?Promise.all(X).then(()=>V):V;return s3(X,G,V,_,v.value,$)}}),eV=B("$ZodObjectJIT",($,w)=>{$9.init($,w);let U=$._zod.parse,v=fw(()=>e3(w)),J=(N)=>{let W=new t0(["shape","payload","ctx"]),P=v.value,Q=(b)=>{let M=S0(b);return`shape[${M}]._zod.run({ value: input[${M}], issues: [] }, ctx)`};W.write("const input = payload.value;");let H=Object.create(null),Z=0;for(let b of P.keys)H[b]=`key_${Z++}`;W.write("const newResult = {};");for(let b of P.keys){let M=H[b],S=S0(b),k=N[b],x=k?._zod?.optin==="optional",A=k?._zod?.optout==="optional";if(W.write(`const ${M} = ${Q(b)};`),x&&A)W.write(`
|
|
194
|
+
if (${M}.issues.length) {
|
|
195
|
+
if (${S} in input) {
|
|
196
|
+
payload.issues = payload.issues.concat(${M}.issues.map(iss => ({
|
|
197
197
|
...iss,
|
|
198
|
-
path: iss.path ? [${
|
|
198
|
+
path: iss.path ? [${S}, ...iss.path] : [${S}]
|
|
199
199
|
})));
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
-
if (${
|
|
204
|
-
if (${
|
|
205
|
-
newResult[${
|
|
203
|
+
if (${M}.value === undefined) {
|
|
204
|
+
if (${S} in input) {
|
|
205
|
+
newResult[${S}] = undefined;
|
|
206
206
|
}
|
|
207
207
|
} else {
|
|
208
|
-
newResult[${
|
|
208
|
+
newResult[${S}] = ${M}.value;
|
|
209
209
|
}
|
|
210
210
|
|
|
211
|
-
`);else if(!x)
|
|
212
|
-
const ${
|
|
213
|
-
if (${
|
|
214
|
-
payload.issues = payload.issues.concat(${
|
|
211
|
+
`);else if(!x)W.write(`
|
|
212
|
+
const ${M}_present = ${S} in input;
|
|
213
|
+
if (${M}.issues.length) {
|
|
214
|
+
payload.issues = payload.issues.concat(${M}.issues.map(iss => ({
|
|
215
215
|
...iss,
|
|
216
|
-
path: iss.path ? [${
|
|
216
|
+
path: iss.path ? [${S}, ...iss.path] : [${S}]
|
|
217
217
|
})));
|
|
218
218
|
}
|
|
219
|
-
if (!${
|
|
219
|
+
if (!${M}_present && !${M}.issues.length) {
|
|
220
220
|
payload.issues.push({
|
|
221
221
|
code: "invalid_type",
|
|
222
222
|
expected: "nonoptional",
|
|
223
223
|
input: undefined,
|
|
224
|
-
path: [${
|
|
224
|
+
path: [${S}]
|
|
225
225
|
});
|
|
226
226
|
}
|
|
227
227
|
|
|
228
|
-
if (${
|
|
229
|
-
if (${
|
|
230
|
-
newResult[${
|
|
228
|
+
if (${M}_present) {
|
|
229
|
+
if (${M}.value === undefined) {
|
|
230
|
+
newResult[${S}] = undefined;
|
|
231
231
|
} else {
|
|
232
|
-
newResult[${
|
|
232
|
+
newResult[${S}] = ${M}.value;
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
235
|
|
|
236
|
-
`);else
|
|
237
|
-
if (${
|
|
238
|
-
payload.issues = payload.issues.concat(${
|
|
236
|
+
`);else W.write(`
|
|
237
|
+
if (${M}.issues.length) {
|
|
238
|
+
payload.issues = payload.issues.concat(${M}.issues.map(iss => ({
|
|
239
239
|
...iss,
|
|
240
|
-
path: iss.path ? [${
|
|
240
|
+
path: iss.path ? [${S}, ...iss.path] : [${S}]
|
|
241
241
|
})));
|
|
242
242
|
}
|
|
243
243
|
|
|
244
|
-
if (${
|
|
245
|
-
if (${
|
|
246
|
-
newResult[${
|
|
244
|
+
if (${M}.value === undefined) {
|
|
245
|
+
if (${S} in input) {
|
|
246
|
+
newResult[${S}] = undefined;
|
|
247
247
|
}
|
|
248
248
|
} else {
|
|
249
|
-
newResult[${
|
|
249
|
+
newResult[${S}] = ${M}.value;
|
|
250
250
|
}
|
|
251
251
|
|
|
252
|
-
`)}g.write("payload.value = newResult;"),g.write("return payload;");let T=g.compile();return(S,E)=>T(V,S,E)},G,X=O6,_=!L6.jitless,W=_&&pG.value,Y=U.catchall,Q;$._zod.parse=(V,g)=>{Q??(Q=J.value);let H=V.value;if(!X(H))return V.issues.push({expected:"object",code:"invalid_type",input:H,inst:$}),V;if(_&&W&&g?.async===!1&&g.jitless!==!0){if(!G)G=z(U.shape);if(V=G(V,g),!Y)return V;return u5([],H,V,g,Q,$)}return w(V,g)}});function P5($,U,w,J){for(let G of $)if(G.issues.length===0)return U.value=G.value,U;let z=$.filter((G)=>!x4(G));if(z.length===1)return U.value=z[0].value,z[0];return U.issues.push({code:"invalid_union",input:U.value,inst:w,errors:$.map((G)=>G.issues.map((X)=>F$(X,J,G$())))}),U}var d1=K("$ZodUnion",($,U)=>{m.init($,U),r($._zod,"optin",()=>U.options.some((J)=>J._zod.optin==="optional")?"optional":void 0),r($._zod,"optout",()=>U.options.some((J)=>J._zod.optout==="optional")?"optional":void 0),r($._zod,"values",()=>{if(U.options.every((J)=>J._zod.values))return new Set(U.options.flatMap((J)=>Array.from(J._zod.values)));return}),r($._zod,"pattern",()=>{if(U.options.every((J)=>J._zod.pattern)){let J=U.options.map((z)=>z._zod.pattern);return new RegExp(`^(${J.map((z)=>j1(z.source)).join("|")})$`)}return});let w=U.options.length===1?U.options[0]._zod.run:null;$._zod.parse=(J,z)=>{if(w)return w(J,z);let G=!1,X=[];for(let _ of U.options){let N=_._zod.run({value:J.value,issues:[]},z);if(N instanceof Promise)X.push(N),G=!0;else{if(N.issues.length===0)return N;X.push(N)}}if(!G)return P5(X,J,$,z);return Promise.all(X).then((_)=>{return P5(_,J,$,z)})}});function O5($,U,w,J){let z=$.filter((G)=>G.issues.length===0);if(z.length===1)return U.value=z[0].value,U;if(z.length===0)U.issues.push({code:"invalid_union",input:U.value,inst:w,errors:$.map((G)=>G.issues.map((X)=>F$(X,J,G$())))});else U.issues.push({code:"invalid_union",input:U.value,inst:w,errors:[],inclusive:!1});return U}var x_=K("$ZodXor",($,U)=>{d1.init($,U),U.inclusive=!1;let w=U.options.length===1?U.options[0]._zod.run:null;$._zod.parse=(J,z)=>{if(w)return w(J,z);let G=!1,X=[];for(let _ of U.options){let N=_._zod.run({value:J.value,issues:[]},z);if(N instanceof Promise)X.push(N),G=!0;else X.push(N)}if(!G)return O5(X,J,$,z);return Promise.all(X).then((_)=>{return O5(_,J,$,z)})}}),y_=K("$ZodDiscriminatedUnion",($,U)=>{U.inclusive=!1,d1.init($,U);let w=$._zod.parse;r($._zod,"propValues",()=>{let z={};for(let G of U.options){let X=G._zod.propValues;if(!X||Object.keys(X).length===0)throw Error(`Invalid discriminated union option at index "${U.options.indexOf(G)}"`);for(let[_,N]of Object.entries(X)){if(!z[_])z[_]=new Set;for(let W of N)z[_].add(W)}}return z});let J=qU(()=>{let z=U.options,G=new Map;for(let X of z){let _=X._zod.propValues?.[U.discriminator];if(!_||_.size===0)throw Error(`Invalid discriminated union option at index "${U.options.indexOf(X)}"`);for(let N of _){if(G.has(N))throw Error(`Duplicate discriminator value "${String(N)}"`);G.set(N,X)}}return G});$._zod.parse=(z,G)=>{let X=z.value;if(!O6(X))return z.issues.push({code:"invalid_type",expected:"object",input:X,inst:$}),z;let _=J.value.get(X?.[U.discriminator]);if(_)return _._zod.run(z,G);if(U.unionFallback||G.direction==="backward")return w(z,G);return z.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:U.discriminator,options:Array.from(J.value.keys()),input:X,path:[U.discriminator],inst:$}),z}}),i_=K("$ZodIntersection",($,U)=>{m.init($,U),$._zod.parse=(w,J)=>{let z=w.value,G=U.left._zod.run({value:z,issues:[]},J),X=U.right._zod.run({value:z,issues:[]},J);if(G instanceof Promise||X instanceof Promise)return Promise.all([G,X]).then(([N,W])=>{return T5(w,N,W)});return T5(w,G,X)}});function sX($,U){if($===U)return{valid:!0,data:$};if($ instanceof Date&&U instanceof Date&&+$===+U)return{valid:!0,data:$};if(C4($)&&C4(U)){let w=Object.keys(U),J=Object.keys($).filter((G)=>w.indexOf(G)!==-1),z={...$,...U};for(let G of J){let X=sX($[G],U[G]);if(!X.valid)return{valid:!1,mergeErrorPath:[G,...X.mergeErrorPath]};z[G]=X.data}return{valid:!0,data:z}}if(Array.isArray($)&&Array.isArray(U)){if($.length!==U.length)return{valid:!1,mergeErrorPath:[]};let w=[];for(let J=0;J<$.length;J++){let z=$[J],G=U[J],X=sX(z,G);if(!X.valid)return{valid:!1,mergeErrorPath:[J,...X.mergeErrorPath]};w.push(X.data)}return{valid:!0,data:w}}return{valid:!1,mergeErrorPath:[]}}function T5($,U,w){let J=new Map,z;for(let _ of U.issues)if(_.code==="unrecognized_keys"){z??(z=_);for(let N of _.keys){if(!J.has(N))J.set(N,{});J.get(N).l=!0}}else $.issues.push(_);for(let _ of w.issues)if(_.code==="unrecognized_keys")for(let N of _.keys){if(!J.has(N))J.set(N,{});J.get(N).r=!0}else $.issues.push(_);let G=[...J].filter(([,_])=>_.l&&_.r).map(([_])=>_);if(G.length&&z)$.issues.push({...z,keys:G});if(x4($))return $;let X=sX(U.value,w.value);if(!X.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(X.mergeErrorPath)}`);return $.value=X.data,$}var rz=K("$ZodTuple",($,U)=>{m.init($,U);let w=U.items;$._zod.parse=(J,z)=>{let G=J.value;if(!Array.isArray(G))return J.issues.push({input:G,inst:$,expected:"tuple",code:"invalid_type"}),J;J.value=[];let X=[],_=Z5(w,"optin"),N=Z5(w,"optout");if(!U.rest){if(G.length<_)return J.issues.push({code:"too_small",minimum:_,inclusive:!0,input:G,inst:$,origin:"array"}),J;if(G.length>w.length)J.issues.push({code:"too_big",maximum:w.length,inclusive:!0,input:G,inst:$,origin:"array"})}let W=Array(w.length);for(let Y=0;Y<w.length;Y++){let Q=w[Y]._zod.run({value:G[Y],issues:[]},z);if(Q instanceof Promise)X.push(Q.then((V)=>{W[Y]=V}));else W[Y]=Q}if(U.rest){let Y=w.length-1,Q=G.slice(w.length);for(let V of Q){Y++;let g=U.rest._zod.run({value:V,issues:[]},z);if(g instanceof Promise)X.push(g.then((H)=>D5(H,J,Y)));else D5(g,J,Y)}}if(X.length)return Promise.all(X).then(()=>F5(W,J,w,G,N));return F5(W,J,w,G,N)}});function Z5($,U){for(let w=$.length-1;w>=0;w--)if($[w]._zod[U]!=="optional")return w+1;return 0}function D5($,U,w){if($.issues.length)U.issues.push(...S$(w,$.issues));U.value[w]=$.value}function F5($,U,w,J,z){for(let G=0;G<w.length;G++){let X=$[G],_=G<J.length;if(X.issues.length){if(!_&&G>=z){U.value.length=G;break}U.issues.push(...S$(G,X.issues))}U.value[G]=X.value}for(let G=U.value.length-1;G>=J.length;G--)if(w[G]._zod.optout==="optional"&&U.value[G]===void 0)U.value.length=G;else break;return U}var h_=K("$ZodRecord",($,U)=>{m.init($,U),$._zod.parse=(w,J)=>{let z=w.value;if(!C4(z))return w.issues.push({expected:"record",code:"invalid_type",input:z,inst:$}),w;let G=[],X=U.keyType._zod.values;if(X){w.value={};let _=new Set;for(let W of X)if(typeof W==="string"||typeof W==="number"||typeof W==="symbol"){_.add(typeof W==="number"?W.toString():W);let Y=U.keyType._zod.run({value:W,issues:[]},J);if(Y instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(Y.issues.length){w.issues.push({code:"invalid_key",origin:"record",issues:Y.issues.map((g)=>F$(g,J,G$())),input:W,path:[W],inst:$});continue}let Q=Y.value,V=U.valueType._zod.run({value:z[W],issues:[]},J);if(V instanceof Promise)G.push(V.then((g)=>{if(g.issues.length)w.issues.push(...S$(W,g.issues));w.value[Q]=g.value}));else{if(V.issues.length)w.issues.push(...S$(W,V.issues));w.value[Q]=V.value}}let N;for(let W in z)if(!_.has(W))N=N??[],N.push(W);if(N&&N.length>0)w.issues.push({code:"unrecognized_keys",input:z,inst:$,keys:N})}else{w.value={};for(let _ of Reflect.ownKeys(z)){if(_==="__proto__")continue;if(!Object.prototype.propertyIsEnumerable.call(z,_))continue;let N=U.keyType._zod.run({value:_,issues:[]},J);if(N instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof _==="string"&&m1.test(_)&&N.issues.length){let Q=U.keyType._zod.run({value:Number(_),issues:[]},J);if(Q instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(Q.issues.length===0)N=Q}if(N.issues.length){if(U.mode==="loose")w.value[_]=z[_];else w.issues.push({code:"invalid_key",origin:"record",issues:N.issues.map((Q)=>F$(Q,J,G$())),input:_,path:[_],inst:$});continue}let Y=U.valueType._zod.run({value:z[_],issues:[]},J);if(Y instanceof Promise)G.push(Y.then((Q)=>{if(Q.issues.length)w.issues.push(...S$(_,Q.issues));w.value[N.value]=Q.value}));else{if(Y.issues.length)w.issues.push(...S$(_,Y.issues));w.value[N.value]=Y.value}}}if(G.length)return Promise.all(G).then(()=>w);return w}}),m_=K("$ZodMap",($,U)=>{m.init($,U),$._zod.parse=(w,J)=>{let z=w.value;if(!(z instanceof Map))return w.issues.push({expected:"map",code:"invalid_type",input:z,inst:$}),w;let G=[];w.value=new Map;for(let[X,_]of z){let N=U.keyType._zod.run({value:X,issues:[]},J),W=U.valueType._zod.run({value:_,issues:[]},J);if(N instanceof Promise||W instanceof Promise)G.push(Promise.all([N,W]).then(([Y,Q])=>{v5(Y,Q,w,X,z,$,J)}));else v5(N,W,w,X,z,$,J)}if(G.length)return Promise.all(G).then(()=>w);return w}});function v5($,U,w,J,z,G,X){if($.issues.length)if(u1.has(typeof J))w.issues.push(...S$(J,$.issues));else w.issues.push({code:"invalid_key",origin:"map",input:z,inst:G,issues:$.issues.map((_)=>F$(_,X,G$()))});if(U.issues.length)if(u1.has(typeof J))w.issues.push(...S$(J,U.issues));else w.issues.push({origin:"map",code:"invalid_element",input:z,inst:G,key:J,issues:U.issues.map((_)=>F$(_,X,G$()))});w.value.set($.value,U.value)}var c_=K("$ZodSet",($,U)=>{m.init($,U),$._zod.parse=(w,J)=>{let z=w.value;if(!(z instanceof Set))return w.issues.push({input:z,inst:$,expected:"set",code:"invalid_type"}),w;let G=[];w.value=new Set;for(let X of z){let _=U.valueType._zod.run({value:X,issues:[]},J);if(_ instanceof Promise)G.push(_.then((N)=>M5(N,w)));else M5(_,w)}if(G.length)return Promise.all(G).then(()=>w);return w}});function M5($,U){if($.issues.length)U.issues.push(...$.issues);U.value.add($.value)}var r_=K("$ZodEnum",($,U)=>{m.init($,U);let w=k1(U.entries),J=new Set(w);$._zod.values=J,$._zod.pattern=new RegExp(`^(${w.filter((z)=>u1.has(typeof z)).map((z)=>typeof z==="string"?m$(z):z.toString()).join("|")})$`),$._zod.parse=(z,G)=>{let X=z.value;if(J.has(X))return z;return z.issues.push({code:"invalid_value",values:w,input:X,inst:$}),z}}),l_=K("$ZodLiteral",($,U)=>{if(m.init($,U),U.values.length===0)throw Error("Cannot create literal schema with no valid values");let w=new Set(U.values);$._zod.values=w,$._zod.pattern=new RegExp(`^(${U.values.map((J)=>typeof J==="string"?m$(J):J?m$(J.toString()):String(J)).join("|")})$`),$._zod.parse=(J,z)=>{let G=J.value;if(w.has(G))return J;return J.issues.push({code:"invalid_value",values:U.values,input:G,inst:$}),J}}),d_=K("$ZodFile",($,U)=>{m.init($,U),$._zod.parse=(w,J)=>{let z=w.value;if(z instanceof File)return w;return w.issues.push({expected:"file",code:"invalid_type",input:z,inst:$}),w}}),n_=K("$ZodTransform",($,U)=>{m.init($,U),$._zod.optin="optional",$._zod.parse=(w,J)=>{if(J.direction==="backward")throw new P6($.constructor.name);let z=U.transform(w.value,w);if(J.async)return(z instanceof Promise?z:Promise.resolve(z)).then((X)=>{return w.value=X,w.fallback=!0,w});if(z instanceof Promise)throw new z4;return w.value=z,w.fallback=!0,w}});function S5($,U){if(U===void 0&&($.issues.length||$.fallback))return{issues:[],value:void 0};return $}var lz=K("$ZodOptional",($,U)=>{m.init($,U),$._zod.optin="optional",$._zod.optout="optional",r($._zod,"values",()=>{return U.innerType._zod.values?new Set([...U.innerType._zod.values,void 0]):void 0}),r($._zod,"pattern",()=>{let w=U.innerType._zod.pattern;return w?new RegExp(`^(${j1(w.source)})?$`):void 0}),$._zod.parse=(w,J)=>{if(U.innerType._zod.optin==="optional"){let z=w.value,G=U.innerType._zod.run(w,J);if(G instanceof Promise)return G.then((X)=>S5(X,z));return S5(G,z)}if(w.value===void 0)return w;return U.innerType._zod.run(w,J)}}),p_=K("$ZodExactOptional",($,U)=>{lz.init($,U),r($._zod,"values",()=>U.innerType._zod.values),r($._zod,"pattern",()=>U.innerType._zod.pattern),$._zod.parse=(w,J)=>{return U.innerType._zod.run(w,J)}}),t_=K("$ZodNullable",($,U)=>{m.init($,U),r($._zod,"optin",()=>U.innerType._zod.optin),r($._zod,"optout",()=>U.innerType._zod.optout),r($._zod,"pattern",()=>{let w=U.innerType._zod.pattern;return w?new RegExp(`^(${j1(w.source)}|null)$`):void 0}),r($._zod,"values",()=>{return U.innerType._zod.values?new Set([...U.innerType._zod.values,null]):void 0}),$._zod.parse=(w,J)=>{if(w.value===null)return w;return U.innerType._zod.run(w,J)}}),a_=K("$ZodDefault",($,U)=>{m.init($,U),$._zod.optin="optional",r($._zod,"values",()=>U.innerType._zod.values),$._zod.parse=(w,J)=>{if(J.direction==="backward")return U.innerType._zod.run(w,J);if(w.value===void 0)return w.value=U.defaultValue,w;let z=U.innerType._zod.run(w,J);if(z instanceof Promise)return z.then((G)=>b5(G,U));return b5(z,U)}});function b5($,U){if($.value===void 0)$.value=U.defaultValue;return $}var o_=K("$ZodPrefault",($,U)=>{m.init($,U),$._zod.optin="optional",r($._zod,"values",()=>U.innerType._zod.values),$._zod.parse=(w,J)=>{if(J.direction==="backward")return U.innerType._zod.run(w,J);if(w.value===void 0)w.value=U.defaultValue;return U.innerType._zod.run(w,J)}}),e_=K("$ZodNonOptional",($,U)=>{m.init($,U),r($._zod,"values",()=>{let w=U.innerType._zod.values;return w?new Set([...w].filter((J)=>J!==void 0)):void 0}),$._zod.parse=(w,J)=>{let z=U.innerType._zod.run(w,J);if(z instanceof Promise)return z.then((G)=>E5(G,$));return E5(z,$)}});function E5($,U){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:U});return $}var s_=K("$ZodSuccess",($,U)=>{m.init($,U),$._zod.parse=(w,J)=>{if(J.direction==="backward")throw new P6("ZodSuccess");let z=U.innerType._zod.run(w,J);if(z instanceof Promise)return z.then((G)=>{return w.value=G.issues.length===0,w});return w.value=z.issues.length===0,w}}),$N=K("$ZodCatch",($,U)=>{m.init($,U),$._zod.optin="optional",r($._zod,"optout",()=>U.innerType._zod.optout),r($._zod,"values",()=>U.innerType._zod.values),$._zod.parse=(w,J)=>{if(J.direction==="backward")return U.innerType._zod.run(w,J);let z=U.innerType._zod.run(w,J);if(z instanceof Promise)return z.then((G)=>{if(w.value=G.value,G.issues.length)w.value=U.catchValue({...w,error:{issues:G.issues.map((X)=>F$(X,J,G$()))},input:w.value}),w.issues=[],w.fallback=!0;return w});if(w.value=z.value,z.issues.length)w.value=U.catchValue({...w,error:{issues:z.issues.map((G)=>F$(G,J,G$()))},input:w.value}),w.issues=[],w.fallback=!0;return w}}),UN=K("$ZodNaN",($,U)=>{m.init($,U),$._zod.parse=(w,J)=>{if(typeof w.value!=="number"||!Number.isNaN(w.value))return w.issues.push({input:w.value,inst:$,expected:"nan",code:"invalid_type"}),w;return w}}),dz=K("$ZodPipe",($,U)=>{m.init($,U),r($._zod,"values",()=>U.in._zod.values),r($._zod,"optin",()=>U.in._zod.optin),r($._zod,"optout",()=>U.out._zod.optout),r($._zod,"propValues",()=>U.in._zod.propValues),$._zod.parse=(w,J)=>{if(J.direction==="backward"){let G=U.out._zod.run(w,J);if(G instanceof Promise)return G.then((X)=>xz(X,U.in,J));return xz(G,U.in,J)}let z=U.in._zod.run(w,J);if(z instanceof Promise)return z.then((G)=>xz(G,U.out,J));return xz(z,U.out,J)}});function xz($,U,w){if($.issues.length)return $.aborted=!0,$;return U._zod.run({value:$.value,issues:$.issues,fallback:$.fallback},w)}var n1=K("$ZodCodec",($,U)=>{m.init($,U),r($._zod,"values",()=>U.in._zod.values),r($._zod,"optin",()=>U.in._zod.optin),r($._zod,"optout",()=>U.out._zod.optout),r($._zod,"propValues",()=>U.in._zod.propValues),$._zod.parse=(w,J)=>{if((J.direction||"forward")==="forward"){let G=U.in._zod.run(w,J);if(G instanceof Promise)return G.then((X)=>yz(X,U,J));return yz(G,U,J)}else{let G=U.out._zod.run(w,J);if(G instanceof Promise)return G.then((X)=>yz(X,U,J));return yz(G,U,J)}}});function yz($,U,w){if($.issues.length)return $.aborted=!0,$;if((w.direction||"forward")==="forward"){let z=U.transform($.value,$);if(z instanceof Promise)return z.then((G)=>iz($,G,U.out,w));return iz($,z,U.out,w)}else{let z=U.reverseTransform($.value,$);if(z instanceof Promise)return z.then((G)=>iz($,G,U.in,w));return iz($,z,U.in,w)}}function iz($,U,w,J){if($.issues.length)return $.aborted=!0,$;return w._zod.run({value:U,issues:$.issues},J)}var wN=K("$ZodPreprocess",($,U)=>{dz.init($,U)}),zN=K("$ZodReadonly",($,U)=>{m.init($,U),r($._zod,"propValues",()=>U.innerType._zod.propValues),r($._zod,"values",()=>U.innerType._zod.values),r($._zod,"optin",()=>U.innerType?._zod?.optin),r($._zod,"optout",()=>U.innerType?._zod?.optout),$._zod.parse=(w,J)=>{if(J.direction==="backward")return U.innerType._zod.run(w,J);let z=U.innerType._zod.run(w,J);if(z instanceof Promise)return z.then(A5);return A5(z)}});function A5($){return $.value=Object.freeze($.value),$}var JN=K("$ZodTemplateLiteral",($,U)=>{m.init($,U);let w=[];for(let J of U.parts)if(typeof J==="object"&&J!==null){if(!J._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...J._zod.traits].shift()}`);let z=J._zod.pattern instanceof RegExp?J._zod.pattern.source:J._zod.pattern;if(!z)throw Error(`Invalid template literal part: ${J._zod.traits}`);let G=z.startsWith("^")?1:0,X=z.endsWith("$")?z.length-1:z.length;w.push(z.slice(G,X))}else if(J===null||aG.has(typeof J))w.push(m$(`${J}`));else throw Error(`Invalid template literal part: ${J}`);$._zod.pattern=new RegExp(`^${w.join("")}$`),$._zod.parse=(J,z)=>{if(typeof J.value!=="string")return J.issues.push({input:J.value,inst:$,expected:"string",code:"invalid_type"}),J;if($._zod.pattern.lastIndex=0,!$._zod.pattern.test(J.value))return J.issues.push({input:J.value,inst:$,code:"invalid_format",format:U.format??"template_literal",pattern:$._zod.pattern.source}),J;return J}}),GN=K("$ZodFunction",($,U)=>{return m.init($,U),$._def=U,$._zod.def=U,$.implement=(w)=>{if(typeof w!=="function")throw Error("implement() must be called with a function");return function(...J){let z=$._def.input?Dz($._def.input,J):J,G=Reflect.apply(w,this,z);if($._def.output)return Dz($._def.output,G);return G}},$.implementAsync=(w)=>{if(typeof w!=="function")throw Error("implementAsync() must be called with a function");return async function(...J){let z=$._def.input?await Fz($._def.input,J):J,G=await Reflect.apply(w,this,z);if($._def.output)return await Fz($._def.output,G);return G}},$._zod.parse=(w,J)=>{if(typeof w.value!=="function")return w.issues.push({code:"invalid_type",expected:"function",input:w.value,inst:$}),w;if($._def.output&&$._def.output._zod.def.type==="promise")w.value=$.implementAsync(w.value);else w.value=$.implement(w.value);return w},$.input=(...w)=>{let J=$.constructor;if(Array.isArray(w[0]))return new J({type:"function",input:new rz({type:"tuple",items:w[0],rest:w[1]}),output:$._def.output});return new J({type:"function",input:w[0],output:$._def.output})},$.output=(w)=>{return new $.constructor({type:"function",input:$._def.input,output:w})},$}),XN=K("$ZodPromise",($,U)=>{m.init($,U),$._zod.parse=(w,J)=>{return Promise.resolve(w.value).then((z)=>U.innerType._zod.run({value:z,issues:[]},J))}}),_N=K("$ZodLazy",($,U)=>{m.init($,U),r($._zod,"innerType",()=>{let w=U;if(!w._cachedInner)w._cachedInner=U.getter();return w._cachedInner}),r($._zod,"pattern",()=>$._zod.innerType?._zod?.pattern),r($._zod,"propValues",()=>$._zod.innerType?._zod?.propValues),r($._zod,"optin",()=>$._zod.innerType?._zod?.optin??void 0),r($._zod,"optout",()=>$._zod.innerType?._zod?.optout??void 0),$._zod.parse=(w,J)=>{return $._zod.innerType._zod.run(w,J)}}),NN=K("$ZodCustom",($,U)=>{$$.init($,U),m.init($,U),$._zod.parse=(w,J)=>{return w},$._zod.check=(w)=>{let J=w.value,z=U.fn(J);if(z instanceof Promise)return z.then((G)=>f5(G,w,J,$));f5(z,w,J,$);return}});function f5($,U,w,J){if(!$){let z={code:"custom",input:w,inst:J,path:[...J._zod.def.path??[]],continue:!J._zod.def.abort};if(J._zod.def.params)z.params=J._zod.def.params;U.issues.push(HU(z))}}var e1={};Y4(e1,{zhTW:()=>w8,zhCN:()=>U8,yo:()=>z8,vi:()=>$8,uz:()=>sN,ur:()=>eN,uk:()=>o1,ua:()=>oN,tr:()=>aN,th:()=>tN,ta:()=>pN,sv:()=>nN,sl:()=>dN,ru:()=>lN,ro:()=>rN,pt:()=>cN,ps:()=>hN,pl:()=>mN,ota:()=>iN,no:()=>yN,nl:()=>xN,ms:()=>CN,mk:()=>uN,lt:()=>jN,ko:()=>kN,km:()=>t1,kh:()=>RN,ka:()=>fN,ja:()=>AN,it:()=>EN,is:()=>bN,id:()=>SN,hy:()=>MN,hu:()=>vN,hr:()=>FN,he:()=>DN,frCA:()=>ZN,fr:()=>TN,fi:()=>ON,fa:()=>PN,es:()=>LN,eo:()=>KN,en:()=>p1,el:()=>IN,de:()=>HN,da:()=>qN,cs:()=>BN,ca:()=>gN,bg:()=>VN,be:()=>QN,az:()=>YN,ar:()=>WN});var TL=()=>{let $={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function U(z){return $[z]??null}let w={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:"مدخل"},J={nan:"NaN"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(/^[A-Z]/.test(z.expected))return`مدخلات غير مقبولة: يفترض إدخال instanceof ${z.expected}، ولكن تم إدخال ${_}`;return`مدخلات غير مقبولة: يفترض إدخال ${G}، ولكن تم إدخال ${_}`}case"invalid_value":if(z.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${Z(z.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${P(z.values,"|")}`;case"too_big":{let G=z.inclusive?"<=":"<",X=U(z.origin);if(X)return` أكبر من اللازم: يفترض أن تكون ${z.origin??"القيمة"} ${G} ${z.maximum.toString()} ${X.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${z.origin??"القيمة"} ${G} ${z.maximum.toString()}`}case"too_small":{let G=z.inclusive?">=":">",X=U(z.origin);if(X)return`أصغر من اللازم: يفترض لـ ${z.origin} أن يكون ${G} ${z.minimum.toString()} ${X.unit}`;return`أصغر من اللازم: يفترض لـ ${z.origin} أن يكون ${G} ${z.minimum.toString()}`}case"invalid_format":{let G=z;if(G.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${z.prefix}"`;if(G.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${G.suffix}"`;if(G.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${G.includes}"`;if(G.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${G.pattern}`;return`${w[G.format]??z.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${z.divisor}`;case"unrecognized_keys":return`معرف${z.keys.length>1?"ات":""} غريب${z.keys.length>1?"ة":""}: ${P(z.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${z.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${z.origin}`;default:return"مدخل غير مقبول"}}};function WN(){return{localeError:TL()}}var ZL=()=>{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 U(z){return $[z]??null}let w={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"},J={nan:"NaN"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(/^[A-Z]/.test(z.expected))return`Yanlış dəyər: gözlənilən instanceof ${z.expected}, daxil olan ${_}`;return`Yanlış dəyər: gözlənilən ${G}, daxil olan ${_}`}case"invalid_value":if(z.values.length===1)return`Yanlış dəyər: gözlənilən ${Z(z.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${P(z.values,"|")}`;case"too_big":{let G=z.inclusive?"<=":"<",X=U(z.origin);if(X)return`Çox böyük: gözlənilən ${z.origin??"dəyər"} ${G}${z.maximum.toString()} ${X.unit??"element"}`;return`Çox böyük: gözlənilən ${z.origin??"dəyər"} ${G}${z.maximum.toString()}`}case"too_small":{let G=z.inclusive?">=":">",X=U(z.origin);if(X)return`Çox kiçik: gözlənilən ${z.origin} ${G}${z.minimum.toString()} ${X.unit}`;return`Çox kiçik: gözlənilən ${z.origin} ${G}${z.minimum.toString()}`}case"invalid_format":{let G=z;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ış ${w[G.format]??z.format}`}case"not_multiple_of":return`Yanlış ədəd: ${z.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${z.keys.length>1?"lar":""}: ${P(z.keys,", ")}`;case"invalid_key":return`${z.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${z.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function YN(){return{localeError:ZL()}}function x5($,U,w,J){let z=Math.abs($),G=z%10,X=z%100;if(X>=11&&X<=19)return J;if(G===1)return U;if(G>=2&&G<=4)return w;return J}var DL=()=>{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 U(z){return $[z]??null}let w={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:"увод"},J={nan:"NaN",number:"лік",array:"масіў"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(/^[A-Z]/.test(z.expected))return`Няправільны ўвод: чакаўся instanceof ${z.expected}, атрымана ${_}`;return`Няправільны ўвод: чакаўся ${G}, атрымана ${_}`}case"invalid_value":if(z.values.length===1)return`Няправільны ўвод: чакалася ${Z(z.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${P(z.values,"|")}`;case"too_big":{let G=z.inclusive?"<=":"<",X=U(z.origin);if(X){let _=Number(z.maximum),N=x5(_,X.unit.one,X.unit.few,X.unit.many);return`Занадта вялікі: чакалася, што ${z.origin??"значэнне"} павінна ${X.verb} ${G}${z.maximum.toString()} ${N}`}return`Занадта вялікі: чакалася, што ${z.origin??"значэнне"} павінна быць ${G}${z.maximum.toString()}`}case"too_small":{let G=z.inclusive?">=":">",X=U(z.origin);if(X){let _=Number(z.minimum),N=x5(_,X.unit.one,X.unit.few,X.unit.many);return`Занадта малы: чакалася, што ${z.origin} павінна ${X.verb} ${G}${z.minimum.toString()} ${N}`}return`Занадта малы: чакалася, што ${z.origin} павінна быць ${G}${z.minimum.toString()}`}case"invalid_format":{let G=z;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`Няправільны ${w[G.format]??z.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${z.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${z.keys.length>1?"ключы":"ключ"}: ${P(z.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${z.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${z.origin}`;default:return"Няправільны ўвод"}}};function QN(){return{localeError:DL()}}var FL=()=>{let $={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function U(z){return $[z]??null}let w={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:"вход"},J={nan:"NaN",number:"число",array:"масив"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(/^[A-Z]/.test(z.expected))return`Невалиден вход: очакван instanceof ${z.expected}, получен ${_}`;return`Невалиден вход: очакван ${G}, получен ${_}`}case"invalid_value":if(z.values.length===1)return`Невалиден вход: очакван ${Z(z.values[0])}`;return`Невалидна опция: очаквано едно от ${P(z.values,"|")}`;case"too_big":{let G=z.inclusive?"<=":"<",X=U(z.origin);if(X)return`Твърде голямо: очаква се ${z.origin??"стойност"} да съдържа ${G}${z.maximum.toString()} ${X.unit??"елемента"}`;return`Твърде голямо: очаква се ${z.origin??"стойност"} да бъде ${G}${z.maximum.toString()}`}case"too_small":{let G=z.inclusive?">=":">",X=U(z.origin);if(X)return`Твърде малко: очаква се ${z.origin} да съдържа ${G}${z.minimum.toString()} ${X.unit}`;return`Твърде малко: очаква се ${z.origin} да бъде ${G}${z.minimum.toString()}`}case"invalid_format":{let G=z;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 X="Невалиден";if(G.format==="emoji")X="Невалидно";if(G.format==="datetime")X="Невалидно";if(G.format==="date")X="Невалидна";if(G.format==="time")X="Невалидно";if(G.format==="duration")X="Невалидна";return`${X} ${w[G.format]??z.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${z.divisor}`;case"unrecognized_keys":return`Неразпознат${z.keys.length>1?"и":""} ключ${z.keys.length>1?"ове":""}: ${P(z.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${z.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${z.origin}`;default:return"Невалиден вход"}}};function VN(){return{localeError:FL()}}var vL=()=>{let $={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function U(z){return $[z]??null}let w={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"},J={nan:"NaN"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(/^[A-Z]/.test(z.expected))return`Tipus invàlid: s'esperava instanceof ${z.expected}, s'ha rebut ${_}`;return`Tipus invàlid: s'esperava ${G}, s'ha rebut ${_}`}case"invalid_value":if(z.values.length===1)return`Valor invàlid: s'esperava ${Z(z.values[0])}`;return`Opció invàlida: s'esperava una de ${P(z.values," o ")}`;case"too_big":{let G=z.inclusive?"com a màxim":"menys de",X=U(z.origin);if(X)return`Massa gran: s'esperava que ${z.origin??"el valor"} contingués ${G} ${z.maximum.toString()} ${X.unit??"elements"}`;return`Massa gran: s'esperava que ${z.origin??"el valor"} fos ${G} ${z.maximum.toString()}`}case"too_small":{let G=z.inclusive?"com a mínim":"més de",X=U(z.origin);if(X)return`Massa petit: s'esperava que ${z.origin} contingués ${G} ${z.minimum.toString()} ${X.unit}`;return`Massa petit: s'esperava que ${z.origin} fos ${G} ${z.minimum.toString()}`}case"invalid_format":{let G=z;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 ${w[G.format]??z.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${z.divisor}`;case"unrecognized_keys":return`Clau${z.keys.length>1?"s":""} no reconeguda${z.keys.length>1?"s":""}: ${P(z.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${z.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${z.origin}`;default:return"Entrada invàlida"}}};function gN(){return{localeError:vL()}}var ML=()=>{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 U(z){return $[z]??null}let w={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"},J={nan:"NaN",number:"číslo",string:"řetězec",function:"funkce",array:"pole"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(/^[A-Z]/.test(z.expected))return`Neplatný vstup: očekáváno instanceof ${z.expected}, obdrženo ${_}`;return`Neplatný vstup: očekáváno ${G}, obdrženo ${_}`}case"invalid_value":if(z.values.length===1)return`Neplatný vstup: očekáváno ${Z(z.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${P(z.values,"|")}`;case"too_big":{let G=z.inclusive?"<=":"<",X=U(z.origin);if(X)return`Hodnota je příliš velká: ${z.origin??"hodnota"} musí mít ${G}${z.maximum.toString()} ${X.unit??"prvků"}`;return`Hodnota je příliš velká: ${z.origin??"hodnota"} musí být ${G}${z.maximum.toString()}`}case"too_small":{let G=z.inclusive?">=":">",X=U(z.origin);if(X)return`Hodnota je příliš malá: ${z.origin??"hodnota"} musí mít ${G}${z.minimum.toString()} ${X.unit??"prvků"}`;return`Hodnota je příliš malá: ${z.origin??"hodnota"} musí být ${G}${z.minimum.toString()}`}case"invalid_format":{let G=z;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 ${w[G.format]??z.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${z.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${P(z.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${z.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${z.origin}`;default:return"Neplatný vstup"}}};function BN(){return{localeError:ML()}}var SL=()=>{let $={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function U(z){return $[z]??null}let w={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"},J={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(/^[A-Z]/.test(z.expected))return`Ugyldigt input: forventede instanceof ${z.expected}, fik ${_}`;return`Ugyldigt input: forventede ${G}, fik ${_}`}case"invalid_value":if(z.values.length===1)return`Ugyldig værdi: forventede ${Z(z.values[0])}`;return`Ugyldigt valg: forventede en af følgende ${P(z.values,"|")}`;case"too_big":{let G=z.inclusive?"<=":"<",X=U(z.origin),_=J[z.origin]??z.origin;if(X)return`For stor: forventede ${_??"value"} ${X.verb} ${G} ${z.maximum.toString()} ${X.unit??"elementer"}`;return`For stor: forventede ${_??"value"} havde ${G} ${z.maximum.toString()}`}case"too_small":{let G=z.inclusive?">=":">",X=U(z.origin),_=J[z.origin]??z.origin;if(X)return`For lille: forventede ${_} ${X.verb} ${G} ${z.minimum.toString()} ${X.unit}`;return`For lille: forventede ${_} havde ${G} ${z.minimum.toString()}`}case"invalid_format":{let G=z;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 ${w[G.format]??z.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${z.divisor}`;case"unrecognized_keys":return`${z.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${P(z.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${z.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${z.origin}`;default:return"Ugyldigt input"}}};function qN(){return{localeError:SL()}}var bL=()=>{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 U(z){return $[z]??null}let w={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"},J={nan:"NaN",number:"Zahl",array:"Array"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(/^[A-Z]/.test(z.expected))return`Ungültige Eingabe: erwartet instanceof ${z.expected}, erhalten ${_}`;return`Ungültige Eingabe: erwartet ${G}, erhalten ${_}`}case"invalid_value":if(z.values.length===1)return`Ungültige Eingabe: erwartet ${Z(z.values[0])}`;return`Ungültige Option: erwartet eine von ${P(z.values,"|")}`;case"too_big":{let G=z.inclusive?"<=":"<",X=U(z.origin);if(X)return`Zu groß: erwartet, dass ${z.origin??"Wert"} ${G}${z.maximum.toString()} ${X.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${z.origin??"Wert"} ${G}${z.maximum.toString()} ist`}case"too_small":{let G=z.inclusive?">=":">",X=U(z.origin);if(X)return`Zu klein: erwartet, dass ${z.origin} ${G}${z.minimum.toString()} ${X.unit} hat`;return`Zu klein: erwartet, dass ${z.origin} ${G}${z.minimum.toString()} ist`}case"invalid_format":{let G=z;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: ${w[G.format]??z.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${z.divisor} sein`;case"unrecognized_keys":return`${z.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${P(z.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${z.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${z.origin}`;default:return"Ungültige Eingabe"}}};function HN(){return{localeError:bL()}}var EL=()=>{let $={string:{unit:"χαρακτήρες",verb:"να έχει"},file:{unit:"bytes",verb:"να έχει"},array:{unit:"στοιχεία",verb:"να έχει"},set:{unit:"στοιχεία",verb:"να έχει"},map:{unit:"καταχωρήσεις",verb:"να έχει"}};function U(z){return $[z]??null}let w={regex:"είσοδος",email:"διεύθυνση 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",mac:"διεύθυνση MAC",cidrv4:"εύρος IPv4",cidrv6:"εύρος IPv6",base64:"συμβολοσειρά κωδικοποιημένη σε base64",base64url:"συμβολοσειρά κωδικοποιημένη σε base64url",json_string:"συμβολοσειρά JSON",e164:"αριθμός E.164",jwt:"JWT",template_literal:"είσοδος"},J={nan:"NaN"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(typeof z.expected==="string"&&/^[A-Z]/.test(z.expected))return`Μη έγκυρη είσοδος: αναμενόταν instanceof ${z.expected}, λήφθηκε ${_}`;return`Μη έγκυρη είσοδος: αναμενόταν ${G}, λήφθηκε ${_}`}case"invalid_value":if(z.values.length===1)return`Μη έγκυρη είσοδος: αναμενόταν ${Z(z.values[0])}`;return`Μη έγκυρη επιλογή: αναμενόταν ένα από ${P(z.values,"|")}`;case"too_big":{let G=z.inclusive?"<=":"<",X=U(z.origin);if(X)return`Πολύ μεγάλο: αναμενόταν ${z.origin??"τιμή"} να έχει ${G}${z.maximum.toString()} ${X.unit??"στοιχεία"}`;return`Πολύ μεγάλο: αναμενόταν ${z.origin??"τιμή"} να είναι ${G}${z.maximum.toString()}`}case"too_small":{let G=z.inclusive?">=":">",X=U(z.origin);if(X)return`Πολύ μικρό: αναμενόταν ${z.origin} να έχει ${G}${z.minimum.toString()} ${X.unit}`;return`Πολύ μικρό: αναμενόταν ${z.origin} να είναι ${G}${z.minimum.toString()}`}case"invalid_format":{let G=z;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`Μη έγκυρο: ${w[G.format]??z.format}`}case"not_multiple_of":return`Μη έγκυρος αριθμός: πρέπει να είναι πολλαπλάσιο του ${z.divisor}`;case"unrecognized_keys":return`Άγνωστ${z.keys.length>1?"α":"ο"} κλειδ${z.keys.length>1?"ιά":"ί"}: ${P(z.keys,", ")}`;case"invalid_key":return`Μη έγκυρο κλειδί στο ${z.origin}`;case"invalid_union":return"Μη έγκυρη είσοδος";case"invalid_element":return`Μη έγκυρη τιμή στο ${z.origin}`;default:return"Μη έγκυρη είσοδος"}}};function IN(){return{localeError:EL()}}var AL=()=>{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 U(z){return $[z]??null}let w={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"},J={nan:"NaN"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;return`Invalid input: expected ${G}, received ${_}`}case"invalid_value":if(z.values.length===1)return`Invalid input: expected ${Z(z.values[0])}`;return`Invalid option: expected one of ${P(z.values,"|")}`;case"too_big":{let G=z.inclusive?"<=":"<",X=U(z.origin);if(X)return`Too big: expected ${z.origin??"value"} to have ${G}${z.maximum.toString()} ${X.unit??"elements"}`;return`Too big: expected ${z.origin??"value"} to be ${G}${z.maximum.toString()}`}case"too_small":{let G=z.inclusive?">=":">",X=U(z.origin);if(X)return`Too small: expected ${z.origin} to have ${G}${z.minimum.toString()} ${X.unit}`;return`Too small: expected ${z.origin} to be ${G}${z.minimum.toString()}`}case"invalid_format":{let G=z;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 ${w[G.format]??z.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${z.divisor}`;case"unrecognized_keys":return`Unrecognized key${z.keys.length>1?"s":""}: ${P(z.keys,", ")}`;case"invalid_key":return`Invalid key in ${z.origin}`;case"invalid_union":if(z.options&&Array.isArray(z.options)&&z.options.length>0)return`Invalid discriminator value. Expected ${z.options.map((X)=>`'${X}'`).join(" | ")}`;return"Invalid input";case"invalid_element":return`Invalid value in ${z.origin}`;default:return"Invalid input"}}};function p1(){return{localeError:AL()}}var fL=()=>{let $={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function U(z){return $[z]??null}let w={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"},J={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(/^[A-Z]/.test(z.expected))return`Nevalida enigo: atendiĝis instanceof ${z.expected}, riceviĝis ${_}`;return`Nevalida enigo: atendiĝis ${G}, riceviĝis ${_}`}case"invalid_value":if(z.values.length===1)return`Nevalida enigo: atendiĝis ${Z(z.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${P(z.values,"|")}`;case"too_big":{let G=z.inclusive?"<=":"<",X=U(z.origin);if(X)return`Tro granda: atendiĝis ke ${z.origin??"valoro"} havu ${G}${z.maximum.toString()} ${X.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${z.origin??"valoro"} havu ${G}${z.maximum.toString()}`}case"too_small":{let G=z.inclusive?">=":">",X=U(z.origin);if(X)return`Tro malgranda: atendiĝis ke ${z.origin} havu ${G}${z.minimum.toString()} ${X.unit}`;return`Tro malgranda: atendiĝis ke ${z.origin} estu ${G}${z.minimum.toString()}`}case"invalid_format":{let G=z;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 ${w[G.format]??z.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${z.divisor}`;case"unrecognized_keys":return`Nekonata${z.keys.length>1?"j":""} ŝlosilo${z.keys.length>1?"j":""}: ${P(z.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${z.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${z.origin}`;default:return"Nevalida enigo"}}};function KN(){return{localeError:fL()}}var RL=()=>{let $={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function U(z){return $[z]??null}let w={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"},J={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(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(/^[A-Z]/.test(z.expected))return`Entrada inválida: se esperaba instanceof ${z.expected}, recibido ${_}`;return`Entrada inválida: se esperaba ${G}, recibido ${_}`}case"invalid_value":if(z.values.length===1)return`Entrada inválida: se esperaba ${Z(z.values[0])}`;return`Opción inválida: se esperaba una de ${P(z.values,"|")}`;case"too_big":{let G=z.inclusive?"<=":"<",X=U(z.origin),_=J[z.origin]??z.origin;if(X)return`Demasiado grande: se esperaba que ${_??"valor"} tuviera ${G}${z.maximum.toString()} ${X.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${_??"valor"} fuera ${G}${z.maximum.toString()}`}case"too_small":{let G=z.inclusive?">=":">",X=U(z.origin),_=J[z.origin]??z.origin;if(X)return`Demasiado pequeño: se esperaba que ${_} tuviera ${G}${z.minimum.toString()} ${X.unit}`;return`Demasiado pequeño: se esperaba que ${_} fuera ${G}${z.minimum.toString()}`}case"invalid_format":{let G=z;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 ${w[G.format]??z.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${z.divisor}`;case"unrecognized_keys":return`Llave${z.keys.length>1?"s":""} desconocida${z.keys.length>1?"s":""}: ${P(z.keys,", ")}`;case"invalid_key":return`Llave inválida en ${J[z.origin]??z.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${J[z.origin]??z.origin}`;default:return"Entrada inválida"}}};function LN(){return{localeError:RL()}}var kL=()=>{let $={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function U(z){return $[z]??null}let w={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:"ورودی"},J={nan:"NaN",number:"عدد",array:"آرایه"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(/^[A-Z]/.test(z.expected))return`ورودی نامعتبر: میبایست instanceof ${z.expected} میبود، ${_} دریافت شد`;return`ورودی نامعتبر: میبایست ${G} میبود، ${_} دریافت شد`}case"invalid_value":if(z.values.length===1)return`ورودی نامعتبر: میبایست ${Z(z.values[0])} میبود`;return`گزینه نامعتبر: میبایست یکی از ${P(z.values,"|")} میبود`;case"too_big":{let G=z.inclusive?"<=":"<",X=U(z.origin);if(X)return`خیلی بزرگ: ${z.origin??"مقدار"} باید ${G}${z.maximum.toString()} ${X.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${z.origin??"مقدار"} باید ${G}${z.maximum.toString()} باشد`}case"too_small":{let G=z.inclusive?">=":">",X=U(z.origin);if(X)return`خیلی کوچک: ${z.origin} باید ${G}${z.minimum.toString()} ${X.unit} باشد`;return`خیلی کوچک: ${z.origin} باید ${G}${z.minimum.toString()} باشد`}case"invalid_format":{let G=z;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`${w[G.format]??z.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${z.divisor} باشد`;case"unrecognized_keys":return`کلید${z.keys.length>1?"های":""} ناشناس: ${P(z.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${z.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${z.origin}`;default:return"ورودی نامعتبر"}}};function PN(){return{localeError:kL()}}var jL=()=>{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 U(z){return $[z]??null}let w={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"},J={nan:"NaN"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(/^[A-Z]/.test(z.expected))return`Virheellinen tyyppi: odotettiin instanceof ${z.expected}, oli ${_}`;return`Virheellinen tyyppi: odotettiin ${G}, oli ${_}`}case"invalid_value":if(z.values.length===1)return`Virheellinen syöte: täytyy olla ${Z(z.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${P(z.values,"|")}`;case"too_big":{let G=z.inclusive?"<=":"<",X=U(z.origin);if(X)return`Liian suuri: ${X.subject} täytyy olla ${G}${z.maximum.toString()} ${X.unit}`.trim();return`Liian suuri: arvon täytyy olla ${G}${z.maximum.toString()}`}case"too_small":{let G=z.inclusive?">=":">",X=U(z.origin);if(X)return`Liian pieni: ${X.subject} täytyy olla ${G}${z.minimum.toString()} ${X.unit}`.trim();return`Liian pieni: arvon täytyy olla ${G}${z.minimum.toString()}`}case"invalid_format":{let G=z;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 ${w[G.format]??z.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${z.divisor} monikerta`;case"unrecognized_keys":return`${z.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${P(z.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 ON(){return{localeError:jL()}}var uL=()=>{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 U(z){return $[z]??null}let w={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"},J={string:"chaîne",number:"nombre",int:"entier",boolean:"booléen",bigint:"grand entier",symbol:"symbole",undefined:"indéfini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(/^[A-Z]/.test(z.expected))return`Entrée invalide : instanceof ${z.expected} attendu, ${_} reçu`;return`Entrée invalide : ${G} attendu, ${_} reçu`}case"invalid_value":if(z.values.length===1)return`Entrée invalide : ${Z(z.values[0])} attendu`;return`Option invalide : une valeur parmi ${P(z.values,"|")} attendue`;case"too_big":{let G=z.inclusive?"<=":"<",X=U(z.origin);if(X)return`Trop grand : ${J[z.origin]??"valeur"} doit ${X.verb} ${G}${z.maximum.toString()} ${X.unit??"élément(s)"}`;return`Trop grand : ${J[z.origin]??"valeur"} doit être ${G}${z.maximum.toString()}`}case"too_small":{let G=z.inclusive?">=":">",X=U(z.origin);if(X)return`Trop petit : ${J[z.origin]??"valeur"} doit ${X.verb} ${G}${z.minimum.toString()} ${X.unit}`;return`Trop petit : ${J[z.origin]??"valeur"} doit être ${G}${z.minimum.toString()}`}case"invalid_format":{let G=z;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`${w[G.format]??z.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${z.divisor}`;case"unrecognized_keys":return`Clé${z.keys.length>1?"s":""} non reconnue${z.keys.length>1?"s":""} : ${P(z.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${z.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${z.origin}`;default:return"Entrée invalide"}}};function TN(){return{localeError:uL()}}var CL=()=>{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 U(z){return $[z]??null}let w={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"},J={nan:"NaN"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(/^[A-Z]/.test(z.expected))return`Entrée invalide : attendu instanceof ${z.expected}, reçu ${_}`;return`Entrée invalide : attendu ${G}, reçu ${_}`}case"invalid_value":if(z.values.length===1)return`Entrée invalide : attendu ${Z(z.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${P(z.values,"|")}`;case"too_big":{let G=z.inclusive?"≤":"<",X=U(z.origin);if(X)return`Trop grand : attendu que ${z.origin??"la valeur"} ait ${G}${z.maximum.toString()} ${X.unit}`;return`Trop grand : attendu que ${z.origin??"la valeur"} soit ${G}${z.maximum.toString()}`}case"too_small":{let G=z.inclusive?"≥":">",X=U(z.origin);if(X)return`Trop petit : attendu que ${z.origin} ait ${G}${z.minimum.toString()} ${X.unit}`;return`Trop petit : attendu que ${z.origin} soit ${G}${z.minimum.toString()}`}case"invalid_format":{let G=z;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`${w[G.format]??z.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${z.divisor}`;case"unrecognized_keys":return`Clé${z.keys.length>1?"s":""} non reconnue${z.keys.length>1?"s":""} : ${P(z.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${z.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${z.origin}`;default:return"Entrée invalide"}}};function ZN(){return{localeError:CL()}}var xL=()=>{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"}},U={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},w=(W)=>W?$[W]:void 0,J=(W)=>{let Y=w(W);if(Y)return Y.label;return W??$.unknown.label},z=(W)=>`ה${J(W)}`,G=(W)=>{return(w(W)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות"},X=(W)=>{if(!W)return null;return U[W]??null},_={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"}},N={nan:"NaN"};return(W)=>{switch(W.code){case"invalid_type":{let Y=W.expected,Q=N[Y??""]??J(Y),V=D(W.input),g=N[V]??$[V]?.label??V;if(/^[A-Z]/.test(W.expected))return`קלט לא תקין: צריך להיות instanceof ${W.expected}, התקבל ${g}`;return`קלט לא תקין: צריך להיות ${Q}, התקבל ${g}`}case"invalid_value":{if(W.values.length===1)return`ערך לא תקין: הערך חייב להיות ${Z(W.values[0])}`;let Y=W.values.map((g)=>Z(g));if(W.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${Y[0]} או ${Y[1]}`;let Q=Y[Y.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${Y.slice(0,-1).join(", ")} או ${Q}`}case"too_big":{let Y=X(W.origin),Q=z(W.origin??"value");if(W.origin==="string")return`${Y?.longLabel??"ארוך"} מדי: ${Q} צריכה להכיל ${W.maximum.toString()} ${Y?.unit??""} ${W.inclusive?"או פחות":"לכל היותר"}`.trim();if(W.origin==="number"){let H=W.inclusive?`קטן או שווה ל-${W.maximum}`:`קטן מ-${W.maximum}`;return`גדול מדי: ${Q} צריך להיות ${H}`}if(W.origin==="array"||W.origin==="set"){let H=W.origin==="set"?"צריכה":"צריך",q=W.inclusive?`${W.maximum} ${Y?.unit??""} או פחות`:`פחות מ-${W.maximum} ${Y?.unit??""}`;return`גדול מדי: ${Q} ${H} להכיל ${q}`.trim()}let V=W.inclusive?"<=":"<",g=G(W.origin??"value");if(Y?.unit)return`${Y.longLabel} מדי: ${Q} ${g} ${V}${W.maximum.toString()} ${Y.unit}`;return`${Y?.longLabel??"גדול"} מדי: ${Q} ${g} ${V}${W.maximum.toString()}`}case"too_small":{let Y=X(W.origin),Q=z(W.origin??"value");if(W.origin==="string")return`${Y?.shortLabel??"קצר"} מדי: ${Q} צריכה להכיל ${W.minimum.toString()} ${Y?.unit??""} ${W.inclusive?"או יותר":"לפחות"}`.trim();if(W.origin==="number"){let H=W.inclusive?`גדול או שווה ל-${W.minimum}`:`גדול מ-${W.minimum}`;return`קטן מדי: ${Q} צריך להיות ${H}`}if(W.origin==="array"||W.origin==="set"){let H=W.origin==="set"?"צריכה":"צריך";if(W.minimum===1&&W.inclusive){let O=W.origin==="set"?"לפחות פריט אחד":"לפחות פריט אחד";return`קטן מדי: ${Q} ${H} להכיל ${O}`}let q=W.inclusive?`${W.minimum} ${Y?.unit??""} או יותר`:`יותר מ-${W.minimum} ${Y?.unit??""}`;return`קטן מדי: ${Q} ${H} להכיל ${q}`.trim()}let V=W.inclusive?">=":">",g=G(W.origin??"value");if(Y?.unit)return`${Y.shortLabel} מדי: ${Q} ${g} ${V}${W.minimum.toString()} ${Y.unit}`;return`${Y?.shortLabel??"קטן"} מדי: ${Q} ${g} ${V}${W.minimum.toString()}`}case"invalid_format":{let Y=W;if(Y.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${Y.prefix}"`;if(Y.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${Y.suffix}"`;if(Y.format==="includes")return`המחרוזת חייבת לכלול "${Y.includes}"`;if(Y.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${Y.pattern}`;let Q=_[Y.format],V=Q?.label??Y.format,H=(Q?.gender??"m")==="f"?"תקינה":"תקין";return`${V} לא ${H}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${W.divisor}`;case"unrecognized_keys":return`מפתח${W.keys.length>1?"ות":""} לא מזוה${W.keys.length>1?"ים":"ה"}: ${P(W.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${z(W.origin??"array")}`;default:return"קלט לא תקין"}}};function DN(){return{localeError:xL()}}var yL=()=>{let $={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function U(z){return $[z]??null}let w={regex:"unos",email:"email 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:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},J={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(/^[A-Z]/.test(z.expected))return`Neispravan unos: očekuje se instanceof ${z.expected}, a primljeno je ${_}`;return`Neispravan unos: očekuje se ${G}, a primljeno je ${_}`}case"invalid_value":if(z.values.length===1)return`Neispravna vrijednost: očekivano ${Z(z.values[0])}`;return`Neispravna opcija: očekivano jedno od ${P(z.values,"|")}`;case"too_big":{let G=z.inclusive?"<=":"<",X=U(z.origin),_=J[z.origin]??z.origin;if(X)return`Preveliko: očekivano da ${_??"vrijednost"} ima ${G}${z.maximum.toString()} ${X.unit??"elemenata"}`;return`Preveliko: očekivano da ${_??"vrijednost"} bude ${G}${z.maximum.toString()}`}case"too_small":{let G=z.inclusive?">=":">",X=U(z.origin),_=J[z.origin]??z.origin;if(X)return`Premalo: očekivano da ${_} ima ${G}${z.minimum.toString()} ${X.unit}`;return`Premalo: očekivano da ${_} bude ${G}${z.minimum.toString()}`}case"invalid_format":{let G=z;if(G.format==="starts_with")return`Neispravan tekst: mora započinjati s "${G.prefix}"`;if(G.format==="ends_with")return`Neispravan tekst: mora završavati s "${G.suffix}"`;if(G.format==="includes")return`Neispravan tekst: mora sadržavati "${G.includes}"`;if(G.format==="regex")return`Neispravan tekst: mora odgovarati uzorku ${G.pattern}`;return`Neispravna ${w[G.format]??z.format}`}case"not_multiple_of":return`Neispravan broj: mora biti višekratnik od ${z.divisor}`;case"unrecognized_keys":return`Neprepoznat${z.keys.length>1?"i ključevi":" ključ"}: ${P(z.keys,", ")}`;case"invalid_key":return`Neispravan ključ u ${J[z.origin]??z.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${J[z.origin]??z.origin}`;default:return"Neispravan unos"}}};function FN(){return{localeError:yL()}}var iL=()=>{let $={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function U(z){return $[z]??null}let w={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"},J={nan:"NaN",number:"szám",array:"tömb"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(/^[A-Z]/.test(z.expected))return`Érvénytelen bemenet: a várt érték instanceof ${z.expected}, a kapott érték ${_}`;return`Érvénytelen bemenet: a várt érték ${G}, a kapott érték ${_}`}case"invalid_value":if(z.values.length===1)return`Érvénytelen bemenet: a várt érték ${Z(z.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${P(z.values,"|")}`;case"too_big":{let G=z.inclusive?"<=":"<",X=U(z.origin);if(X)return`Túl nagy: ${z.origin??"érték"} mérete túl nagy ${G}${z.maximum.toString()} ${X.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${z.origin??"érték"} túl nagy: ${G}${z.maximum.toString()}`}case"too_small":{let G=z.inclusive?">=":">",X=U(z.origin);if(X)return`Túl kicsi: a bemeneti érték ${z.origin} mérete túl kicsi ${G}${z.minimum.toString()} ${X.unit}`;return`Túl kicsi: a bemeneti érték ${z.origin} túl kicsi ${G}${z.minimum.toString()}`}case"invalid_format":{let G=z;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 ${w[G.format]??z.format}`}case"not_multiple_of":return`Érvénytelen szám: ${z.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${z.keys.length>1?"s":""}: ${P(z.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${z.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${z.origin}`;default:return"Érvénytelen bemenet"}}};function vN(){return{localeError:iL()}}function y5($,U,w){return Math.abs($)===1?U:w}function TU($){if(!$)return"";let U=["ա","ե","ը","ի","ո","ու","օ"],w=$[$.length-1];return $+(U.includes(w)?"ն":"ը")}var hL=()=>{let $={string:{unit:{one:"նշան",many:"նշաններ"},verb:"ունենալ"},file:{unit:{one:"բայթ",many:"բայթեր"},verb:"ունենալ"},array:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"},set:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"}};function U(z){return $[z]??null}let w={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:"մուտք"},J={nan:"NaN",number:"թիվ",array:"զանգված"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(/^[A-Z]/.test(z.expected))return`Սխալ մուտքագրում․ սպասվում էր instanceof ${z.expected}, ստացվել է ${_}`;return`Սխալ մուտքագրում․ սպասվում էր ${G}, ստացվել է ${_}`}case"invalid_value":if(z.values.length===1)return`Սխալ մուտքագրում․ սպասվում էր ${Z(z.values[1])}`;return`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${P(z.values,"|")}`;case"too_big":{let G=z.inclusive?"<=":"<",X=U(z.origin);if(X){let _=Number(z.maximum),N=y5(_,X.unit.one,X.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${TU(z.origin??"արժեք")} կունենա ${G}${z.maximum.toString()} ${N}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${TU(z.origin??"արժեք")} լինի ${G}${z.maximum.toString()}`}case"too_small":{let G=z.inclusive?">=":">",X=U(z.origin);if(X){let _=Number(z.minimum),N=y5(_,X.unit.one,X.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${TU(z.origin)} կունենա ${G}${z.minimum.toString()} ${N}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${TU(z.origin)} լինի ${G}${z.minimum.toString()}`}case"invalid_format":{let G=z;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`Սխալ ${w[G.format]??z.format}`}case"not_multiple_of":return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${z.divisor}-ի`;case"unrecognized_keys":return`Չճանաչված բանալի${z.keys.length>1?"ներ":""}. ${P(z.keys,", ")}`;case"invalid_key":return`Սխալ բանալի ${TU(z.origin)}-ում`;case"invalid_union":return"Սխալ մուտքագրում";case"invalid_element":return`Սխալ արժեք ${TU(z.origin)}-ում`;default:return"Սխալ մուտքագրում"}}};function MN(){return{localeError:hL()}}var mL=()=>{let $={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function U(z){return $[z]??null}let w={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"},J={nan:"NaN"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(/^[A-Z]/.test(z.expected))return`Input tidak valid: diharapkan instanceof ${z.expected}, diterima ${_}`;return`Input tidak valid: diharapkan ${G}, diterima ${_}`}case"invalid_value":if(z.values.length===1)return`Input tidak valid: diharapkan ${Z(z.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${P(z.values,"|")}`;case"too_big":{let G=z.inclusive?"<=":"<",X=U(z.origin);if(X)return`Terlalu besar: diharapkan ${z.origin??"value"} memiliki ${G}${z.maximum.toString()} ${X.unit??"elemen"}`;return`Terlalu besar: diharapkan ${z.origin??"value"} menjadi ${G}${z.maximum.toString()}`}case"too_small":{let G=z.inclusive?">=":">",X=U(z.origin);if(X)return`Terlalu kecil: diharapkan ${z.origin} memiliki ${G}${z.minimum.toString()} ${X.unit}`;return`Terlalu kecil: diharapkan ${z.origin} menjadi ${G}${z.minimum.toString()}`}case"invalid_format":{let G=z;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`${w[G.format]??z.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${z.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${z.keys.length>1?"s":""}: ${P(z.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${z.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${z.origin}`;default:return"Input tidak valid"}}};function SN(){return{localeError:mL()}}var cL=()=>{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 U(z){return $[z]??null}let w={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"},J={nan:"NaN",number:"númer",array:"fylki"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(/^[A-Z]/.test(z.expected))return`Rangt gildi: Þú slóst inn ${_} þar sem á að vera instanceof ${z.expected}`;return`Rangt gildi: Þú slóst inn ${_} þar sem á að vera ${G}`}case"invalid_value":if(z.values.length===1)return`Rangt gildi: gert ráð fyrir ${Z(z.values[0])}`;return`Ógilt val: má vera eitt af eftirfarandi ${P(z.values,"|")}`;case"too_big":{let G=z.inclusive?"<=":"<",X=U(z.origin);if(X)return`Of stórt: gert er ráð fyrir að ${z.origin??"gildi"} hafi ${G}${z.maximum.toString()} ${X.unit??"hluti"}`;return`Of stórt: gert er ráð fyrir að ${z.origin??"gildi"} sé ${G}${z.maximum.toString()}`}case"too_small":{let G=z.inclusive?">=":">",X=U(z.origin);if(X)return`Of lítið: gert er ráð fyrir að ${z.origin} hafi ${G}${z.minimum.toString()} ${X.unit}`;return`Of lítið: gert er ráð fyrir að ${z.origin} sé ${G}${z.minimum.toString()}`}case"invalid_format":{let G=z;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 ${w[G.format]??z.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${z.divisor}`;case"unrecognized_keys":return`Óþekkt ${z.keys.length>1?"ir lyklar":"ur lykill"}: ${P(z.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${z.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${z.origin}`;default:return"Rangt gildi"}}};function bN(){return{localeError:cL()}}var rL=()=>{let $={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function U(z){return $[z]??null}let w={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"},J={nan:"NaN",number:"numero",array:"vettore"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(/^[A-Z]/.test(z.expected))return`Input non valido: atteso instanceof ${z.expected}, ricevuto ${_}`;return`Input non valido: atteso ${G}, ricevuto ${_}`}case"invalid_value":if(z.values.length===1)return`Input non valido: atteso ${Z(z.values[0])}`;return`Opzione non valida: atteso uno tra ${P(z.values,"|")}`;case"too_big":{let G=z.inclusive?"<=":"<",X=U(z.origin);if(X)return`Troppo grande: ${z.origin??"valore"} deve avere ${G}${z.maximum.toString()} ${X.unit??"elementi"}`;return`Troppo grande: ${z.origin??"valore"} deve essere ${G}${z.maximum.toString()}`}case"too_small":{let G=z.inclusive?">=":">",X=U(z.origin);if(X)return`Troppo piccolo: ${z.origin} deve avere ${G}${z.minimum.toString()} ${X.unit}`;return`Troppo piccolo: ${z.origin} deve essere ${G}${z.minimum.toString()}`}case"invalid_format":{let G=z;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`Input non valido: ${w[G.format]??z.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${z.divisor}`;case"unrecognized_keys":return`Chiav${z.keys.length>1?"i":"e"} non riconosciut${z.keys.length>1?"e":"a"}: ${P(z.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${z.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${z.origin}`;default:return"Input non valido"}}};function EN(){return{localeError:rL()}}var lL=()=>{let $={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function U(z){return $[z]??null}let w={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:"入力値"},J={nan:"NaN",number:"数値",array:"配列"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(/^[A-Z]/.test(z.expected))return`無効な入力: instanceof ${z.expected}が期待されましたが、${_}が入力されました`;return`無効な入力: ${G}が期待されましたが、${_}が入力されました`}case"invalid_value":if(z.values.length===1)return`無効な入力: ${Z(z.values[0])}が期待されました`;return`無効な選択: ${P(z.values,"、")}のいずれかである必要があります`;case"too_big":{let G=z.inclusive?"以下である":"より小さい",X=U(z.origin);if(X)return`大きすぎる値: ${z.origin??"値"}は${z.maximum.toString()}${X.unit??"要素"}${G}必要があります`;return`大きすぎる値: ${z.origin??"値"}は${z.maximum.toString()}${G}必要があります`}case"too_small":{let G=z.inclusive?"以上である":"より大きい",X=U(z.origin);if(X)return`小さすぎる値: ${z.origin}は${z.minimum.toString()}${X.unit}${G}必要があります`;return`小さすぎる値: ${z.origin}は${z.minimum.toString()}${G}必要があります`}case"invalid_format":{let G=z;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`無効な${w[G.format]??z.format}`}case"not_multiple_of":return`無効な数値: ${z.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${z.keys.length>1?"群":""}: ${P(z.keys,"、")}`;case"invalid_key":return`${z.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${z.origin}内の無効な値`;default:return"無効な入力"}}};function AN(){return{localeError:lL()}}var dL=()=>{let $={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function U(z){return $[z]??null}let w={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:"შეყვანა"},J={nan:"NaN",number:"რიცხვი",string:"ველი",boolean:"ბულეანი",function:"ფუნქცია",array:"მასივი"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(/^[A-Z]/.test(z.expected))return`არასწორი შეყვანა: მოსალოდნელი instanceof ${z.expected}, მიღებული ${_}`;return`არასწორი შეყვანა: მოსალოდნელი ${G}, მიღებული ${_}`}case"invalid_value":if(z.values.length===1)return`არასწორი შეყვანა: მოსალოდნელი ${Z(z.values[0])}`;return`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${P(z.values,"|")}-დან`;case"too_big":{let G=z.inclusive?"<=":"<",X=U(z.origin);if(X)return`ზედმეტად დიდი: მოსალოდნელი ${z.origin??"მნიშვნელობა"} ${X.verb} ${G}${z.maximum.toString()} ${X.unit}`;return`ზედმეტად დიდი: მოსალოდნელი ${z.origin??"მნიშვნელობა"} იყოს ${G}${z.maximum.toString()}`}case"too_small":{let G=z.inclusive?">=":">",X=U(z.origin);if(X)return`ზედმეტად პატარა: მოსალოდნელი ${z.origin} ${X.verb} ${G}${z.minimum.toString()} ${X.unit}`;return`ზედმეტად პატარა: მოსალოდნელი ${z.origin} იყოს ${G}${z.minimum.toString()}`}case"invalid_format":{let G=z;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`არასწორი ${w[G.format]??z.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${z.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${z.keys.length>1?"ები":"ი"}: ${P(z.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${z.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${z.origin}-ში`;default:return"არასწორი შეყვანა"}}};function fN(){return{localeError:dL()}}var nL=()=>{let $={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function U(z){return $[z]??null}let w={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:"ទិន្នន័យបញ្ចូល"},J={nan:"NaN",number:"លេខ",array:"អារេ (Array)",null:"គ្មានតម្លៃ (null)"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(/^[A-Z]/.test(z.expected))return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${z.expected} ប៉ុន្តែទទួលបាន ${_}`;return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${G} ប៉ុន្តែទទួលបាន ${_}`}case"invalid_value":if(z.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${Z(z.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${P(z.values,"|")}`;case"too_big":{let G=z.inclusive?"<=":"<",X=U(z.origin);if(X)return`ធំពេក៖ ត្រូវការ ${z.origin??"តម្លៃ"} ${G} ${z.maximum.toString()} ${X.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${z.origin??"តម្លៃ"} ${G} ${z.maximum.toString()}`}case"too_small":{let G=z.inclusive?">=":">",X=U(z.origin);if(X)return`តូចពេក៖ ត្រូវការ ${z.origin} ${G} ${z.minimum.toString()} ${X.unit}`;return`តូចពេក៖ ត្រូវការ ${z.origin} ${G} ${z.minimum.toString()}`}case"invalid_format":{let G=z;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`មិនត្រឹមត្រូវ៖ ${w[G.format]??z.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${z.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${P(z.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${z.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${z.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function t1(){return{localeError:nL()}}function RN(){return t1()}var pL=()=>{let $={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function U(z){return $[z]??null}let w={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:"입력"},J={nan:"NaN"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(/^[A-Z]/.test(z.expected))return`잘못된 입력: 예상 타입은 instanceof ${z.expected}, 받은 타입은 ${_}입니다`;return`잘못된 입력: 예상 타입은 ${G}, 받은 타입은 ${_}입니다`}case"invalid_value":if(z.values.length===1)return`잘못된 입력: 값은 ${Z(z.values[0])} 이어야 합니다`;return`잘못된 옵션: ${P(z.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let G=z.inclusive?"이하":"미만",X=G==="미만"?"이어야 합니다":"여야 합니다",_=U(z.origin),N=_?.unit??"요소";if(_)return`${z.origin??"값"}이 너무 큽니다: ${z.maximum.toString()}${N} ${G}${X}`;return`${z.origin??"값"}이 너무 큽니다: ${z.maximum.toString()} ${G}${X}`}case"too_small":{let G=z.inclusive?"이상":"초과",X=G==="이상"?"이어야 합니다":"여야 합니다",_=U(z.origin),N=_?.unit??"요소";if(_)return`${z.origin??"값"}이 너무 작습니다: ${z.minimum.toString()}${N} ${G}${X}`;return`${z.origin??"값"}이 너무 작습니다: ${z.minimum.toString()} ${G}${X}`}case"invalid_format":{let G=z;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`잘못된 ${w[G.format]??z.format}`}case"not_multiple_of":return`잘못된 숫자: ${z.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${P(z.keys,", ")}`;case"invalid_key":return`잘못된 키: ${z.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${z.origin}`;default:return"잘못된 입력"}}};function kN(){return{localeError:pL()}}var a1=($)=>{return $.charAt(0).toUpperCase()+$.slice(1)};function i5($){let U=Math.abs($),w=U%10,J=U%100;if(J>=11&&J<=19||w===0)return"many";if(w===1)return"one";return"few"}var tL=()=>{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 U(z,G,X,_){let N=$[z]??null;if(N===null)return N;return{unit:N.unit[G],verb:N.verb[_][X?"inclusive":"notInclusive"]}}let w={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"},J={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(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(/^[A-Z]/.test(z.expected))return`Gautas tipas ${_}, o tikėtasi - instanceof ${z.expected}`;return`Gautas tipas ${_}, o tikėtasi - ${G}`}case"invalid_value":if(z.values.length===1)return`Privalo būti ${Z(z.values[0])}`;return`Privalo būti vienas iš ${P(z.values,"|")} pasirinkimų`;case"too_big":{let G=J[z.origin]??z.origin,X=U(z.origin,i5(Number(z.maximum)),z.inclusive??!1,"smaller");if(X?.verb)return`${a1(G??z.origin??"reikšmė")} ${X.verb} ${z.maximum.toString()} ${X.unit??"elementų"}`;let _=z.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${a1(G??z.origin??"reikšmė")} turi būti ${_} ${z.maximum.toString()} ${X?.unit}`}case"too_small":{let G=J[z.origin]??z.origin,X=U(z.origin,i5(Number(z.minimum)),z.inclusive??!1,"bigger");if(X?.verb)return`${a1(G??z.origin??"reikšmė")} ${X.verb} ${z.minimum.toString()} ${X.unit??"elementų"}`;let _=z.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${a1(G??z.origin??"reikšmė")} turi būti ${_} ${z.minimum.toString()} ${X?.unit}`}case"invalid_format":{let G=z;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 ${w[G.format]??z.format}`}case"not_multiple_of":return`Skaičius privalo būti ${z.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${z.keys.length>1?"i":"as"} rakt${z.keys.length>1?"ai":"as"}: ${P(z.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let G=J[z.origin]??z.origin;return`${a1(G??z.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function jN(){return{localeError:tL()}}var aL=()=>{let $={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function U(z){return $[z]??null}let w={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:"внес"},J={nan:"NaN",number:"број",array:"низа"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(/^[A-Z]/.test(z.expected))return`Грешен внес: се очекува instanceof ${z.expected}, примено ${_}`;return`Грешен внес: се очекува ${G}, примено ${_}`}case"invalid_value":if(z.values.length===1)return`Invalid input: expected ${Z(z.values[0])}`;return`Грешана опција: се очекува една ${P(z.values,"|")}`;case"too_big":{let G=z.inclusive?"<=":"<",X=U(z.origin);if(X)return`Премногу голем: се очекува ${z.origin??"вредноста"} да има ${G}${z.maximum.toString()} ${X.unit??"елементи"}`;return`Премногу голем: се очекува ${z.origin??"вредноста"} да биде ${G}${z.maximum.toString()}`}case"too_small":{let G=z.inclusive?">=":">",X=U(z.origin);if(X)return`Премногу мал: се очекува ${z.origin} да има ${G}${z.minimum.toString()} ${X.unit}`;return`Премногу мал: се очекува ${z.origin} да биде ${G}${z.minimum.toString()}`}case"invalid_format":{let G=z;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 ${w[G.format]??z.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${z.divisor}`;case"unrecognized_keys":return`${z.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${P(z.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${z.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${z.origin}`;default:return"Грешен внес"}}};function uN(){return{localeError:aL()}}var oL=()=>{let $={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function U(z){return $[z]??null}let w={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"},J={nan:"NaN",number:"nombor"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(/^[A-Z]/.test(z.expected))return`Input tidak sah: dijangka instanceof ${z.expected}, diterima ${_}`;return`Input tidak sah: dijangka ${G}, diterima ${_}`}case"invalid_value":if(z.values.length===1)return`Input tidak sah: dijangka ${Z(z.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${P(z.values,"|")}`;case"too_big":{let G=z.inclusive?"<=":"<",X=U(z.origin);if(X)return`Terlalu besar: dijangka ${z.origin??"nilai"} ${X.verb} ${G}${z.maximum.toString()} ${X.unit??"elemen"}`;return`Terlalu besar: dijangka ${z.origin??"nilai"} adalah ${G}${z.maximum.toString()}`}case"too_small":{let G=z.inclusive?">=":">",X=U(z.origin);if(X)return`Terlalu kecil: dijangka ${z.origin} ${X.verb} ${G}${z.minimum.toString()} ${X.unit}`;return`Terlalu kecil: dijangka ${z.origin} adalah ${G}${z.minimum.toString()}`}case"invalid_format":{let G=z;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`${w[G.format]??z.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${z.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${P(z.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${z.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${z.origin}`;default:return"Input tidak sah"}}};function CN(){return{localeError:oL()}}var eL=()=>{let $={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function U(z){return $[z]??null}let w={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"},J={nan:"NaN",number:"getal"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(/^[A-Z]/.test(z.expected))return`Ongeldige invoer: verwacht instanceof ${z.expected}, ontving ${_}`;return`Ongeldige invoer: verwacht ${G}, ontving ${_}`}case"invalid_value":if(z.values.length===1)return`Ongeldige invoer: verwacht ${Z(z.values[0])}`;return`Ongeldige optie: verwacht één van ${P(z.values,"|")}`;case"too_big":{let G=z.inclusive?"<=":"<",X=U(z.origin),_=z.origin==="date"?"laat":z.origin==="string"?"lang":"groot";if(X)return`Te ${_}: verwacht dat ${z.origin??"waarde"} ${G}${z.maximum.toString()} ${X.unit??"elementen"} ${X.verb}`;return`Te ${_}: verwacht dat ${z.origin??"waarde"} ${G}${z.maximum.toString()} is`}case"too_small":{let G=z.inclusive?">=":">",X=U(z.origin),_=z.origin==="date"?"vroeg":z.origin==="string"?"kort":"klein";if(X)return`Te ${_}: verwacht dat ${z.origin} ${G}${z.minimum.toString()} ${X.unit} ${X.verb}`;return`Te ${_}: verwacht dat ${z.origin} ${G}${z.minimum.toString()} is`}case"invalid_format":{let G=z;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: ${w[G.format]??z.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${z.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${z.keys.length>1?"s":""}: ${P(z.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${z.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${z.origin}`;default:return"Ongeldige invoer"}}};function xN(){return{localeError:eL()}}var sL=()=>{let $={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function U(z){return $[z]??null}let w={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"},J={nan:"NaN",number:"tall",array:"liste"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(/^[A-Z]/.test(z.expected))return`Ugyldig input: forventet instanceof ${z.expected}, fikk ${_}`;return`Ugyldig input: forventet ${G}, fikk ${_}`}case"invalid_value":if(z.values.length===1)return`Ugyldig verdi: forventet ${Z(z.values[0])}`;return`Ugyldig valg: forventet en av ${P(z.values,"|")}`;case"too_big":{let G=z.inclusive?"<=":"<",X=U(z.origin);if(X)return`For stor(t): forventet ${z.origin??"value"} til å ha ${G}${z.maximum.toString()} ${X.unit??"elementer"}`;return`For stor(t): forventet ${z.origin??"value"} til å ha ${G}${z.maximum.toString()}`}case"too_small":{let G=z.inclusive?">=":">",X=U(z.origin);if(X)return`For lite(n): forventet ${z.origin} til å ha ${G}${z.minimum.toString()} ${X.unit}`;return`For lite(n): forventet ${z.origin} til å ha ${G}${z.minimum.toString()}`}case"invalid_format":{let G=z;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 ${w[G.format]??z.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${z.divisor}`;case"unrecognized_keys":return`${z.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${P(z.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${z.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${z.origin}`;default:return"Ugyldig input"}}};function yN(){return{localeError:sL()}}var $P=()=>{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 U(z){return $[z]??null}let w={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"},J={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(/^[A-Z]/.test(z.expected))return`Fâsit giren: umulan instanceof ${z.expected}, alınan ${_}`;return`Fâsit giren: umulan ${G}, alınan ${_}`}case"invalid_value":if(z.values.length===1)return`Fâsit giren: umulan ${Z(z.values[0])}`;return`Fâsit tercih: mûteberler ${P(z.values,"|")}`;case"too_big":{let G=z.inclusive?"<=":"<",X=U(z.origin);if(X)return`Fazla büyük: ${z.origin??"value"}, ${G}${z.maximum.toString()} ${X.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${z.origin??"value"}, ${G}${z.maximum.toString()} olmalıydı.`}case"too_small":{let G=z.inclusive?">=":">",X=U(z.origin);if(X)return`Fazla küçük: ${z.origin}, ${G}${z.minimum.toString()} ${X.unit} sahip olmalıydı.`;return`Fazla küçük: ${z.origin}, ${G}${z.minimum.toString()} olmalıydı.`}case"invalid_format":{let G=z;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 ${w[G.format]??z.format}`}case"not_multiple_of":return`Fâsit sayı: ${z.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${z.keys.length>1?"s":""}: ${P(z.keys,", ")}`;case"invalid_key":return`${z.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${z.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function iN(){return{localeError:$P()}}var UP=()=>{let $={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function U(z){return $[z]??null}let w={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:"ورودي"},J={nan:"NaN",number:"عدد",array:"ارې"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(/^[A-Z]/.test(z.expected))return`ناسم ورودي: باید instanceof ${z.expected} وای, مګر ${_} ترلاسه شو`;return`ناسم ورودي: باید ${G} وای, مګر ${_} ترلاسه شو`}case"invalid_value":if(z.values.length===1)return`ناسم ورودي: باید ${Z(z.values[0])} وای`;return`ناسم انتخاب: باید یو له ${P(z.values,"|")} څخه وای`;case"too_big":{let G=z.inclusive?"<=":"<",X=U(z.origin);if(X)return`ډیر لوی: ${z.origin??"ارزښت"} باید ${G}${z.maximum.toString()} ${X.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${z.origin??"ارزښت"} باید ${G}${z.maximum.toString()} وي`}case"too_small":{let G=z.inclusive?">=":">",X=U(z.origin);if(X)return`ډیر کوچنی: ${z.origin} باید ${G}${z.minimum.toString()} ${X.unit} ولري`;return`ډیر کوچنی: ${z.origin} باید ${G}${z.minimum.toString()} وي`}case"invalid_format":{let G=z;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`${w[G.format]??z.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${z.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${z.keys.length>1?"کلیډونه":"کلیډ"}: ${P(z.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${z.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${z.origin} کې`;default:return"ناسمه ورودي"}}};function hN(){return{localeError:UP()}}var wP=()=>{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 U(z){return $[z]??null}let w={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"},J={nan:"NaN",number:"liczba",array:"tablica"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(/^[A-Z]/.test(z.expected))return`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${z.expected}, otrzymano ${_}`;return`Nieprawidłowe dane wejściowe: oczekiwano ${G}, otrzymano ${_}`}case"invalid_value":if(z.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${Z(z.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${P(z.values,"|")}`;case"too_big":{let G=z.inclusive?"<=":"<",X=U(z.origin);if(X)return`Za duża wartość: oczekiwano, że ${z.origin??"wartość"} będzie mieć ${G}${z.maximum.toString()} ${X.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${z.origin??"wartość"} będzie wynosić ${G}${z.maximum.toString()}`}case"too_small":{let G=z.inclusive?">=":">",X=U(z.origin);if(X)return`Za mała wartość: oczekiwano, że ${z.origin??"wartość"} będzie mieć ${G}${z.minimum.toString()} ${X.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${z.origin??"wartość"} będzie wynosić ${G}${z.minimum.toString()}`}case"invalid_format":{let G=z;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) ${w[G.format]??z.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${z.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${z.keys.length>1?"s":""}: ${P(z.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${z.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${z.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function mN(){return{localeError:wP()}}var zP=()=>{let $={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function U(z){return $[z]??null}let w={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"},J={nan:"NaN",number:"número",null:"nulo"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(/^[A-Z]/.test(z.expected))return`Tipo inválido: esperado instanceof ${z.expected}, recebido ${_}`;return`Tipo inválido: esperado ${G}, recebido ${_}`}case"invalid_value":if(z.values.length===1)return`Entrada inválida: esperado ${Z(z.values[0])}`;return`Opção inválida: esperada uma das ${P(z.values,"|")}`;case"too_big":{let G=z.inclusive?"<=":"<",X=U(z.origin);if(X)return`Muito grande: esperado que ${z.origin??"valor"} tivesse ${G}${z.maximum.toString()} ${X.unit??"elementos"}`;return`Muito grande: esperado que ${z.origin??"valor"} fosse ${G}${z.maximum.toString()}`}case"too_small":{let G=z.inclusive?">=":">",X=U(z.origin);if(X)return`Muito pequeno: esperado que ${z.origin} tivesse ${G}${z.minimum.toString()} ${X.unit}`;return`Muito pequeno: esperado que ${z.origin} fosse ${G}${z.minimum.toString()}`}case"invalid_format":{let G=z;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`${w[G.format]??z.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${z.divisor}`;case"unrecognized_keys":return`Chave${z.keys.length>1?"s":""} desconhecida${z.keys.length>1?"s":""}: ${P(z.keys,", ")}`;case"invalid_key":return`Chave inválida em ${z.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${z.origin}`;default:return"Campo inválido"}}};function cN(){return{localeError:zP()}}var JP=()=>{let $={string:{unit:"caractere",verb:"să aibă"},file:{unit:"octeți",verb:"să aibă"},array:{unit:"elemente",verb:"să aibă"},set:{unit:"elemente",verb:"să aibă"},map:{unit:"intrări",verb:"să aibă"}};function U(z){return $[z]??null}let w={regex:"intrare",email:"adresă de 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:"dată și oră ISO",date:"dată ISO",time:"oră ISO",duration:"durată ISO",ipv4:"adresă IPv4",ipv6:"adresă IPv6",mac:"adresă MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"șir codat base64",base64url:"șir codat base64url",json_string:"șir JSON",e164:"număr E.164",jwt:"JWT",template_literal:"intrare"},J={nan:"NaN",string:"șir",number:"număr",boolean:"boolean",function:"funcție",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"număr mare",void:"void",never:"never",map:"hartă",set:"set"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;return`Intrare invalidă: așteptat ${G}, primit ${_}`}case"invalid_value":if(z.values.length===1)return`Intrare invalidă: așteptat ${Z(z.values[0])}`;return`Opțiune invalidă: așteptat una dintre ${P(z.values,"|")}`;case"too_big":{let G=z.inclusive?"<=":"<",X=U(z.origin);if(X)return`Prea mare: așteptat ca ${z.origin??"valoarea"} ${X.verb} ${G}${z.maximum.toString()} ${X.unit??"elemente"}`;return`Prea mare: așteptat ca ${z.origin??"valoarea"} să fie ${G}${z.maximum.toString()}`}case"too_small":{let G=z.inclusive?">=":">",X=U(z.origin);if(X)return`Prea mic: așteptat ca ${z.origin} ${X.verb} ${G}${z.minimum.toString()} ${X.unit}`;return`Prea mic: așteptat ca ${z.origin} să fie ${G}${z.minimum.toString()}`}case"invalid_format":{let G=z;if(G.format==="starts_with")return`Șir invalid: trebuie să înceapă cu "${G.prefix}"`;if(G.format==="ends_with")return`Șir invalid: trebuie să se termine cu "${G.suffix}"`;if(G.format==="includes")return`Șir invalid: trebuie să includă "${G.includes}"`;if(G.format==="regex")return`Șir invalid: trebuie să se potrivească cu modelul ${G.pattern}`;return`Format invalid: ${w[G.format]??z.format}`}case"not_multiple_of":return`Număr invalid: trebuie să fie multiplu de ${z.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${P(z.keys,", ")}`;case"invalid_key":return`Cheie invalidă în ${z.origin}`;case"invalid_union":return"Intrare invalidă";case"invalid_element":return`Valoare invalidă în ${z.origin}`;default:return"Intrare invalidă"}}};function rN(){return{localeError:JP()}}function h5($,U,w,J){let z=Math.abs($),G=z%10,X=z%100;if(X>=11&&X<=19)return J;if(G===1)return U;if(G>=2&&G<=4)return w;return J}var GP=()=>{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 U(z){return $[z]??null}let w={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:"ввод"},J={nan:"NaN",number:"число",array:"массив"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(/^[A-Z]/.test(z.expected))return`Неверный ввод: ожидалось instanceof ${z.expected}, получено ${_}`;return`Неверный ввод: ожидалось ${G}, получено ${_}`}case"invalid_value":if(z.values.length===1)return`Неверный ввод: ожидалось ${Z(z.values[0])}`;return`Неверный вариант: ожидалось одно из ${P(z.values,"|")}`;case"too_big":{let G=z.inclusive?"<=":"<",X=U(z.origin);if(X){let _=Number(z.maximum),N=h5(_,X.unit.one,X.unit.few,X.unit.many);return`Слишком большое значение: ожидалось, что ${z.origin??"значение"} будет иметь ${G}${z.maximum.toString()} ${N}`}return`Слишком большое значение: ожидалось, что ${z.origin??"значение"} будет ${G}${z.maximum.toString()}`}case"too_small":{let G=z.inclusive?">=":">",X=U(z.origin);if(X){let _=Number(z.minimum),N=h5(_,X.unit.one,X.unit.few,X.unit.many);return`Слишком маленькое значение: ожидалось, что ${z.origin} будет иметь ${G}${z.minimum.toString()} ${N}`}return`Слишком маленькое значение: ожидалось, что ${z.origin} будет ${G}${z.minimum.toString()}`}case"invalid_format":{let G=z;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`Неверный ${w[G.format]??z.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${z.divisor}`;case"unrecognized_keys":return`Нераспознанн${z.keys.length>1?"ые":"ый"} ключ${z.keys.length>1?"и":""}: ${P(z.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${z.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${z.origin}`;default:return"Неверные входные данные"}}};function lN(){return{localeError:GP()}}var XP=()=>{let $={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function U(z){return $[z]??null}let w={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"},J={nan:"NaN",number:"število",array:"tabela"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(/^[A-Z]/.test(z.expected))return`Neveljaven vnos: pričakovano instanceof ${z.expected}, prejeto ${_}`;return`Neveljaven vnos: pričakovano ${G}, prejeto ${_}`}case"invalid_value":if(z.values.length===1)return`Neveljaven vnos: pričakovano ${Z(z.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${P(z.values,"|")}`;case"too_big":{let G=z.inclusive?"<=":"<",X=U(z.origin);if(X)return`Preveliko: pričakovano, da bo ${z.origin??"vrednost"} imelo ${G}${z.maximum.toString()} ${X.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${z.origin??"vrednost"} ${G}${z.maximum.toString()}`}case"too_small":{let G=z.inclusive?">=":">",X=U(z.origin);if(X)return`Premajhno: pričakovano, da bo ${z.origin} imelo ${G}${z.minimum.toString()} ${X.unit}`;return`Premajhno: pričakovano, da bo ${z.origin} ${G}${z.minimum.toString()}`}case"invalid_format":{let G=z;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 ${w[G.format]??z.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${z.divisor}`;case"unrecognized_keys":return`Neprepoznan${z.keys.length>1?"i ključi":" ključ"}: ${P(z.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${z.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${z.origin}`;default:return"Neveljaven vnos"}}};function dN(){return{localeError:XP()}}var _P=()=>{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 U(z){return $[z]??null}let w={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"},J={nan:"NaN",number:"antal",array:"lista"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(/^[A-Z]/.test(z.expected))return`Ogiltig inmatning: förväntat instanceof ${z.expected}, fick ${_}`;return`Ogiltig inmatning: förväntat ${G}, fick ${_}`}case"invalid_value":if(z.values.length===1)return`Ogiltig inmatning: förväntat ${Z(z.values[0])}`;return`Ogiltigt val: förväntade en av ${P(z.values,"|")}`;case"too_big":{let G=z.inclusive?"<=":"<",X=U(z.origin);if(X)return`För stor(t): förväntade ${z.origin??"värdet"} att ha ${G}${z.maximum.toString()} ${X.unit??"element"}`;return`För stor(t): förväntat ${z.origin??"värdet"} att ha ${G}${z.maximum.toString()}`}case"too_small":{let G=z.inclusive?">=":">",X=U(z.origin);if(X)return`För lite(t): förväntade ${z.origin??"värdet"} att ha ${G}${z.minimum.toString()} ${X.unit}`;return`För lite(t): förväntade ${z.origin??"värdet"} att ha ${G}${z.minimum.toString()}`}case"invalid_format":{let G=z;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) ${w[G.format]??z.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${z.divisor}`;case"unrecognized_keys":return`${z.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${P(z.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${z.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${z.origin??"värdet"}`;default:return"Ogiltig input"}}};function nN(){return{localeError:_P()}}var NP=()=>{let $={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function U(z){return $[z]??null}let w={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"},J={nan:"NaN",number:"எண்",array:"அணி",null:"வெறுமை"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(/^[A-Z]/.test(z.expected))return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${z.expected}, பெறப்பட்டது ${_}`;return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${G}, பெறப்பட்டது ${_}`}case"invalid_value":if(z.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${Z(z.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${P(z.values,"|")} இல் ஒன்று`;case"too_big":{let G=z.inclusive?"<=":"<",X=U(z.origin);if(X)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${z.origin??"மதிப்பு"} ${G}${z.maximum.toString()} ${X.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${z.origin??"மதிப்பு"} ${G}${z.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let G=z.inclusive?">=":">",X=U(z.origin);if(X)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${z.origin} ${G}${z.minimum.toString()} ${X.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${z.origin} ${G}${z.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let G=z;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`தவறான ${w[G.format]??z.format}`}case"not_multiple_of":return`தவறான எண்: ${z.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${z.keys.length>1?"கள்":""}: ${P(z.keys,", ")}`;case"invalid_key":return`${z.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${z.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function pN(){return{localeError:NP()}}var WP=()=>{let $={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function U(z){return $[z]??null}let w={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:"ข้อมูลที่ป้อน"},J={nan:"NaN",number:"ตัวเลข",array:"อาร์เรย์ (Array)",null:"ไม่มีค่า (null)"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(/^[A-Z]/.test(z.expected))return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${z.expected} แต่ได้รับ ${_}`;return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${G} แต่ได้รับ ${_}`}case"invalid_value":if(z.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${Z(z.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${P(z.values,"|")}`;case"too_big":{let G=z.inclusive?"ไม่เกิน":"น้อยกว่า",X=U(z.origin);if(X)return`เกินกำหนด: ${z.origin??"ค่า"} ควรมี${G} ${z.maximum.toString()} ${X.unit??"รายการ"}`;return`เกินกำหนด: ${z.origin??"ค่า"} ควรมี${G} ${z.maximum.toString()}`}case"too_small":{let G=z.inclusive?"อย่างน้อย":"มากกว่า",X=U(z.origin);if(X)return`น้อยกว่ากำหนด: ${z.origin} ควรมี${G} ${z.minimum.toString()} ${X.unit}`;return`น้อยกว่ากำหนด: ${z.origin} ควรมี${G} ${z.minimum.toString()}`}case"invalid_format":{let G=z;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`รูปแบบไม่ถูกต้อง: ${w[G.format]??z.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${z.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${P(z.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${z.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${z.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function tN(){return{localeError:WP()}}var YP=()=>{let $={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function U(z){return $[z]??null}let w={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"},J={nan:"NaN"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(/^[A-Z]/.test(z.expected))return`Geçersiz değer: beklenen instanceof ${z.expected}, alınan ${_}`;return`Geçersiz değer: beklenen ${G}, alınan ${_}`}case"invalid_value":if(z.values.length===1)return`Geçersiz değer: beklenen ${Z(z.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${P(z.values,"|")}`;case"too_big":{let G=z.inclusive?"<=":"<",X=U(z.origin);if(X)return`Çok büyük: beklenen ${z.origin??"değer"} ${G}${z.maximum.toString()} ${X.unit??"öğe"}`;return`Çok büyük: beklenen ${z.origin??"değer"} ${G}${z.maximum.toString()}`}case"too_small":{let G=z.inclusive?">=":">",X=U(z.origin);if(X)return`Çok küçük: beklenen ${z.origin} ${G}${z.minimum.toString()} ${X.unit}`;return`Çok küçük: beklenen ${z.origin} ${G}${z.minimum.toString()}`}case"invalid_format":{let G=z;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 ${w[G.format]??z.format}`}case"not_multiple_of":return`Geçersiz sayı: ${z.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${z.keys.length>1?"lar":""}: ${P(z.keys,", ")}`;case"invalid_key":return`${z.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${z.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function aN(){return{localeError:YP()}}var QP=()=>{let $={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function U(z){return $[z]??null}let w={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:"вхідні дані"},J={nan:"NaN",number:"число",array:"масив"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(/^[A-Z]/.test(z.expected))return`Неправильні вхідні дані: очікується instanceof ${z.expected}, отримано ${_}`;return`Неправильні вхідні дані: очікується ${G}, отримано ${_}`}case"invalid_value":if(z.values.length===1)return`Неправильні вхідні дані: очікується ${Z(z.values[0])}`;return`Неправильна опція: очікується одне з ${P(z.values,"|")}`;case"too_big":{let G=z.inclusive?"<=":"<",X=U(z.origin);if(X)return`Занадто велике: очікується, що ${z.origin??"значення"} ${X.verb} ${G}${z.maximum.toString()} ${X.unit??"елементів"}`;return`Занадто велике: очікується, що ${z.origin??"значення"} буде ${G}${z.maximum.toString()}`}case"too_small":{let G=z.inclusive?">=":">",X=U(z.origin);if(X)return`Занадто мале: очікується, що ${z.origin} ${X.verb} ${G}${z.minimum.toString()} ${X.unit}`;return`Занадто мале: очікується, що ${z.origin} буде ${G}${z.minimum.toString()}`}case"invalid_format":{let G=z;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`Неправильний ${w[G.format]??z.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${z.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${z.keys.length>1?"і":""}: ${P(z.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${z.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${z.origin}`;default:return"Неправильні вхідні дані"}}};function o1(){return{localeError:QP()}}function oN(){return o1()}var VP=()=>{let $={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function U(z){return $[z]??null}let w={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:"ان پٹ"},J={nan:"NaN",number:"نمبر",array:"آرے",null:"نل"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(/^[A-Z]/.test(z.expected))return`غلط ان پٹ: instanceof ${z.expected} متوقع تھا، ${_} موصول ہوا`;return`غلط ان پٹ: ${G} متوقع تھا، ${_} موصول ہوا`}case"invalid_value":if(z.values.length===1)return`غلط ان پٹ: ${Z(z.values[0])} متوقع تھا`;return`غلط آپشن: ${P(z.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let G=z.inclusive?"<=":"<",X=U(z.origin);if(X)return`بہت بڑا: ${z.origin??"ویلیو"} کے ${G}${z.maximum.toString()} ${X.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${z.origin??"ویلیو"} کا ${G}${z.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let G=z.inclusive?">=":">",X=U(z.origin);if(X)return`بہت چھوٹا: ${z.origin} کے ${G}${z.minimum.toString()} ${X.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${z.origin} کا ${G}${z.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let G=z;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`غلط ${w[G.format]??z.format}`}case"not_multiple_of":return`غلط نمبر: ${z.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${z.keys.length>1?"ز":""}: ${P(z.keys,"، ")}`;case"invalid_key":return`${z.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${z.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function eN(){return{localeError:VP()}}var gP=()=>{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"},map:{unit:"yozuv",verb:"bo‘lishi kerak"}};function U(z){return $[z]??null}let w={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"},J={nan:"NaN",number:"raqam",array:"massiv"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(/^[A-Z]/.test(z.expected))return`Noto‘g‘ri kirish: kutilgan instanceof ${z.expected}, qabul qilingan ${_}`;return`Noto‘g‘ri kirish: kutilgan ${G}, qabul qilingan ${_}`}case"invalid_value":if(z.values.length===1)return`Noto‘g‘ri kirish: kutilgan ${Z(z.values[0])}`;return`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${P(z.values,"|")}`;case"too_big":{let G=z.inclusive?"<=":"<",X=U(z.origin);if(X)return`Juda katta: kutilgan ${z.origin??"qiymat"} ${G}${z.maximum.toString()} ${X.unit} ${X.verb}`;return`Juda katta: kutilgan ${z.origin??"qiymat"} ${G}${z.maximum.toString()}`}case"too_small":{let G=z.inclusive?">=":">",X=U(z.origin);if(X)return`Juda kichik: kutilgan ${z.origin} ${G}${z.minimum.toString()} ${X.unit} ${X.verb}`;return`Juda kichik: kutilgan ${z.origin} ${G}${z.minimum.toString()}`}case"invalid_format":{let G=z;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 ${w[G.format]??z.format}`}case"not_multiple_of":return`Noto‘g‘ri raqam: ${z.divisor} ning karralisi bo‘lishi kerak`;case"unrecognized_keys":return`Noma’lum kalit${z.keys.length>1?"lar":""}: ${P(z.keys,", ")}`;case"invalid_key":return`${z.origin} dagi kalit noto‘g‘ri`;case"invalid_union":return"Noto‘g‘ri kirish";case"invalid_element":return`${z.origin} da noto‘g‘ri qiymat`;default:return"Noto‘g‘ri kirish"}}};function sN(){return{localeError:gP()}}var BP=()=>{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 U(z){return $[z]??null}let w={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"},J={nan:"NaN",number:"số",array:"mảng"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(/^[A-Z]/.test(z.expected))return`Đầu vào không hợp lệ: mong đợi instanceof ${z.expected}, nhận được ${_}`;return`Đầu vào không hợp lệ: mong đợi ${G}, nhận được ${_}`}case"invalid_value":if(z.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${Z(z.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${P(z.values,"|")}`;case"too_big":{let G=z.inclusive?"<=":"<",X=U(z.origin);if(X)return`Quá lớn: mong đợi ${z.origin??"giá trị"} ${X.verb} ${G}${z.maximum.toString()} ${X.unit??"phần tử"}`;return`Quá lớn: mong đợi ${z.origin??"giá trị"} ${G}${z.maximum.toString()}`}case"too_small":{let G=z.inclusive?">=":">",X=U(z.origin);if(X)return`Quá nhỏ: mong đợi ${z.origin} ${X.verb} ${G}${z.minimum.toString()} ${X.unit}`;return`Quá nhỏ: mong đợi ${z.origin} ${G}${z.minimum.toString()}`}case"invalid_format":{let G=z;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`${w[G.format]??z.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 ${z.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${P(z.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${z.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 ${z.origin}`;default:return"Đầu vào không hợp lệ"}}};function $8(){return{localeError:BP()}}var qP=()=>{let $={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function U(z){return $[z]??null}let w={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:"输入"},J={nan:"NaN",number:"数字",array:"数组",null:"空值(null)"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(/^[A-Z]/.test(z.expected))return`无效输入:期望 instanceof ${z.expected},实际接收 ${_}`;return`无效输入:期望 ${G},实际接收 ${_}`}case"invalid_value":if(z.values.length===1)return`无效输入:期望 ${Z(z.values[0])}`;return`无效选项:期望以下之一 ${P(z.values,"|")}`;case"too_big":{let G=z.inclusive?"<=":"<",X=U(z.origin);if(X)return`数值过大:期望 ${z.origin??"值"} ${G}${z.maximum.toString()} ${X.unit??"个元素"}`;return`数值过大:期望 ${z.origin??"值"} ${G}${z.maximum.toString()}`}case"too_small":{let G=z.inclusive?">=":">",X=U(z.origin);if(X)return`数值过小:期望 ${z.origin} ${G}${z.minimum.toString()} ${X.unit}`;return`数值过小:期望 ${z.origin} ${G}${z.minimum.toString()}`}case"invalid_format":{let G=z;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`无效${w[G.format]??z.format}`}case"not_multiple_of":return`无效数字:必须是 ${z.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${P(z.keys,", ")}`;case"invalid_key":return`${z.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${z.origin} 中包含无效值(value)`;default:return"无效输入"}}};function U8(){return{localeError:qP()}}var HP=()=>{let $={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function U(z){return $[z]??null}let w={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:"輸入"},J={nan:"NaN"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(/^[A-Z]/.test(z.expected))return`無效的輸入值:預期為 instanceof ${z.expected},但收到 ${_}`;return`無效的輸入值:預期為 ${G},但收到 ${_}`}case"invalid_value":if(z.values.length===1)return`無效的輸入值:預期為 ${Z(z.values[0])}`;return`無效的選項:預期為以下其中之一 ${P(z.values,"|")}`;case"too_big":{let G=z.inclusive?"<=":"<",X=U(z.origin);if(X)return`數值過大:預期 ${z.origin??"值"} 應為 ${G}${z.maximum.toString()} ${X.unit??"個元素"}`;return`數值過大:預期 ${z.origin??"值"} 應為 ${G}${z.maximum.toString()}`}case"too_small":{let G=z.inclusive?">=":">",X=U(z.origin);if(X)return`數值過小:預期 ${z.origin} 應為 ${G}${z.minimum.toString()} ${X.unit}`;return`數值過小:預期 ${z.origin} 應為 ${G}${z.minimum.toString()}`}case"invalid_format":{let G=z;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`無效的 ${w[G.format]??z.format}`}case"not_multiple_of":return`無效的數字:必須為 ${z.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${z.keys.length>1?"們":""}:${P(z.keys,"、")}`;case"invalid_key":return`${z.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${z.origin} 中有無效的值`;default:return"無效的輸入值"}}};function w8(){return{localeError:HP()}}var IP=()=>{let $={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function U(z){return $[z]??null}let w={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é"},J={nan:"NaN",number:"nọ́mbà",array:"akopọ"};return(z)=>{switch(z.code){case"invalid_type":{let G=J[z.expected]??z.expected,X=D(z.input),_=J[X]??X;if(/^[A-Z]/.test(z.expected))return`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${z.expected}, àmọ̀ a rí ${_}`;return`Ìbáwọlé aṣìṣe: a ní láti fi ${G}, àmọ̀ a rí ${_}`}case"invalid_value":if(z.values.length===1)return`Ìbáwọlé aṣìṣe: a ní láti fi ${Z(z.values[0])}`;return`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${P(z.values,"|")}`;case"too_big":{let G=z.inclusive?"<=":"<",X=U(z.origin);if(X)return`Tó pọ̀ jù: a ní láti jẹ́ pé ${z.origin??"iye"} ${X.verb} ${G}${z.maximum} ${X.unit}`;return`Tó pọ̀ jù: a ní láti jẹ́ ${G}${z.maximum}`}case"too_small":{let G=z.inclusive?">=":">",X=U(z.origin);if(X)return`Kéré ju: a ní láti jẹ́ pé ${z.origin} ${X.verb} ${G}${z.minimum} ${X.unit}`;return`Kéré ju: a ní láti jẹ́ ${G}${z.minimum}`}case"invalid_format":{let G=z;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: ${w[G.format]??z.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${z.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${P(z.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${z.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${z.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function z8(){return{localeError:IP()}}var m5,J8=Symbol("ZodOutput"),G8=Symbol("ZodInput");class X8{constructor(){this._map=new WeakMap,this._idmap=new Map}add($,...U){let w=U[0];if(this._map.set($,w),w&&typeof w==="object"&&"id"in w)this._idmap.set(w.id,$);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove($){let U=this._map.get($);if(U&&typeof U==="object"&&"id"in U)this._idmap.delete(U.id);return this._map.delete($),this}get($){let U=$._zod.parent;if(U){let w={...this.get(U)??{}};delete w.id;let J={...w,...this._map.get($)};return Object.keys(J).length?J:void 0}return this._map.get($)}has($){return this._map.has($)}}function nz(){return new X8}(m5=globalThis).__zod_globalRegistry??(m5.__zod_globalRegistry=nz());var q$=globalThis.__zod_globalRegistry;function _8($,U){return new $({type:"string",...b(U)})}function N8($,U){return new $({type:"string",coerce:!0,...b(U)})}function pz($,U){return new $({type:"string",format:"email",check:"string_format",abort:!1,...b(U)})}function s1($,U){return new $({type:"string",format:"guid",check:"string_format",abort:!1,...b(U)})}function tz($,U){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,...b(U)})}function az($,U){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...b(U)})}function oz($,U){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...b(U)})}function ez($,U){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...b(U)})}function $0($,U){return new $({type:"string",format:"url",check:"string_format",abort:!1,...b(U)})}function sz($,U){return new $({type:"string",format:"emoji",check:"string_format",abort:!1,...b(U)})}function $2($,U){return new $({type:"string",format:"nanoid",check:"string_format",abort:!1,...b(U)})}function U2($,U){return new $({type:"string",format:"cuid",check:"string_format",abort:!1,...b(U)})}function w2($,U){return new $({type:"string",format:"cuid2",check:"string_format",abort:!1,...b(U)})}function z2($,U){return new $({type:"string",format:"ulid",check:"string_format",abort:!1,...b(U)})}function J2($,U){return new $({type:"string",format:"xid",check:"string_format",abort:!1,...b(U)})}function G2($,U){return new $({type:"string",format:"ksuid",check:"string_format",abort:!1,...b(U)})}function X2($,U){return new $({type:"string",format:"ipv4",check:"string_format",abort:!1,...b(U)})}function _2($,U){return new $({type:"string",format:"ipv6",check:"string_format",abort:!1,...b(U)})}function W8($,U){return new $({type:"string",format:"mac",check:"string_format",abort:!1,...b(U)})}function N2($,U){return new $({type:"string",format:"cidrv4",check:"string_format",abort:!1,...b(U)})}function W2($,U){return new $({type:"string",format:"cidrv6",check:"string_format",abort:!1,...b(U)})}function Y2($,U){return new $({type:"string",format:"base64",check:"string_format",abort:!1,...b(U)})}function Q2($,U){return new $({type:"string",format:"base64url",check:"string_format",abort:!1,...b(U)})}function V2($,U){return new $({type:"string",format:"e164",check:"string_format",abort:!1,...b(U)})}function g2($,U){return new $({type:"string",format:"jwt",check:"string_format",abort:!1,...b(U)})}var Y8={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Q8($,U){return new $({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...b(U)})}function V8($,U){return new $({type:"string",format:"date",check:"string_format",...b(U)})}function g8($,U){return new $({type:"string",format:"time",check:"string_format",precision:null,...b(U)})}function B8($,U){return new $({type:"string",format:"duration",check:"string_format",...b(U)})}function q8($,U){return new $({type:"number",checks:[],...b(U)})}function H8($,U){return new $({type:"number",coerce:!0,checks:[],...b(U)})}function I8($,U){return new $({type:"number",check:"number_format",abort:!1,format:"safeint",...b(U)})}function K8($,U){return new $({type:"number",check:"number_format",abort:!1,format:"float32",...b(U)})}function L8($,U){return new $({type:"number",check:"number_format",abort:!1,format:"float64",...b(U)})}function P8($,U){return new $({type:"number",check:"number_format",abort:!1,format:"int32",...b(U)})}function O8($,U){return new $({type:"number",check:"number_format",abort:!1,format:"uint32",...b(U)})}function T8($,U){return new $({type:"boolean",...b(U)})}function Z8($,U){return new $({type:"boolean",coerce:!0,...b(U)})}function D8($,U){return new $({type:"bigint",...b(U)})}function F8($,U){return new $({type:"bigint",coerce:!0,...b(U)})}function v8($,U){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...b(U)})}function M8($,U){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...b(U)})}function S8($,U){return new $({type:"symbol",...b(U)})}function b8($,U){return new $({type:"undefined",...b(U)})}function E8($,U){return new $({type:"null",...b(U)})}function A8($){return new $({type:"any"})}function f8($){return new $({type:"unknown"})}function R8($,U){return new $({type:"never",...b(U)})}function k8($,U){return new $({type:"void",...b(U)})}function j8($,U){return new $({type:"date",...b(U)})}function u8($,U){return new $({type:"date",coerce:!0,...b(U)})}function C8($,U){return new $({type:"nan",...b(U)})}function J4($,U){return new jz({check:"less_than",...b(U),value:$,inclusive:!1})}function y$($,U){return new jz({check:"less_than",...b(U),value:$,inclusive:!0})}function G4($,U){return new uz({check:"greater_than",...b(U),value:$,inclusive:!1})}function v$($,U){return new uz({check:"greater_than",...b(U),value:$,inclusive:!0})}function B2($){return G4(0,$)}function q2($){return J4(0,$)}function H2($){return y$(0,$)}function I2($){return v$(0,$)}function y4($,U){return new kX({check:"multiple_of",...b(U),value:$})}function i4($,U){return new CX({check:"max_size",...b(U),maximum:$})}function X4($,U){return new xX({check:"min_size",...b(U),minimum:$})}function D6($,U){return new yX({check:"size_equals",...b(U),size:$})}function F6($,U){return new iX({check:"max_length",...b(U),maximum:$})}function P4($,U){return new hX({check:"min_length",...b(U),minimum:$})}function v6($,U){return new mX({check:"length_equals",...b(U),length:$})}function ZU($,U){return new cX({check:"string_format",format:"regex",...b(U),pattern:$})}function DU($){return new rX({check:"string_format",format:"lowercase",...b($)})}function FU($){return new lX({check:"string_format",format:"uppercase",...b($)})}function vU($,U){return new dX({check:"string_format",format:"includes",...b(U),includes:$})}function MU($,U){return new nX({check:"string_format",format:"starts_with",...b(U),prefix:$})}function SU($,U){return new pX({check:"string_format",format:"ends_with",...b(U),suffix:$})}function K2($,U,w){return new tX({check:"property",property:$,schema:U,...b(w)})}function bU($,U){return new aX({check:"mime_type",mime:$,...b(U)})}function p$($){return new oX({check:"overwrite",tx:$})}function EU($){return p$((U)=>U.normalize($))}function AU(){return p$(($)=>$.trim())}function fU(){return p$(($)=>$.toLowerCase())}function RU(){return p$(($)=>$.toUpperCase())}function kU(){return p$(($)=>nG($))}function x8($,U,w){return new $({type:"array",element:U,...b(w)})}function LP($,U,w){return new $({type:"union",options:U,...b(w)})}function PP($,U,w){return new $({type:"union",options:U,inclusive:!1,...b(w)})}function OP($,U,w,J){return new $({type:"union",options:w,discriminator:U,...b(J)})}function TP($,U,w){return new $({type:"intersection",left:U,right:w})}function ZP($,U,w,J){let z=w instanceof m;return new $({type:"tuple",items:U,rest:z?w:null,...b(z?J:w)})}function DP($,U,w,J){return new $({type:"record",keyType:U,valueType:w,...b(J)})}function FP($,U,w,J){return new $({type:"map",keyType:U,valueType:w,...b(J)})}function vP($,U,w){return new $({type:"set",valueType:U,...b(w)})}function MP($,U,w){let J=Array.isArray(U)?Object.fromEntries(U.map((z)=>[z,z])):U;return new $({type:"enum",entries:J,...b(w)})}function SP($,U,w){return new $({type:"enum",entries:U,...b(w)})}function bP($,U,w){return new $({type:"literal",values:Array.isArray(U)?U:[U],...b(w)})}function y8($,U){return new $({type:"file",...b(U)})}function EP($,U){return new $({type:"transform",transform:U})}function AP($,U){return new $({type:"optional",innerType:U})}function fP($,U){return new $({type:"nullable",innerType:U})}function RP($,U,w){return new $({type:"default",innerType:U,get defaultValue(){return typeof w==="function"?w():tG(w)}})}function kP($,U,w){return new $({type:"nonoptional",innerType:U,...b(w)})}function jP($,U){return new $({type:"success",innerType:U})}function uP($,U,w){return new $({type:"catch",innerType:U,catchValue:typeof w==="function"?w:()=>w})}function CP($,U,w){return new $({type:"pipe",in:U,out:w})}function xP($,U){return new $({type:"readonly",innerType:U})}function yP($,U,w){return new $({type:"template_literal",parts:U,...b(w)})}function iP($,U){return new $({type:"lazy",getter:U})}function hP($,U){return new $({type:"promise",innerType:U})}function i8($,U,w){let J=b(w);return J.abort??(J.abort=!0),new $({type:"custom",check:"custom",fn:U,...J})}function h8($,U,w){return new $({type:"custom",check:"custom",fn:U,...b(w)})}function m8($,U){let w=c5((J)=>{return J.addIssue=(z)=>{if(typeof z==="string")J.issues.push(HU(z,J.value,w._zod.def));else{let G=z;if(G.fatal)G.continue=!1;G.code??(G.code="custom"),G.input??(G.input=J.value),G.inst??(G.inst=w),G.continue??(G.continue=!w._zod.def.abort),J.issues.push(HU(G))}},$(J.value,J)},U);return w}function c5($,U){let w=new $$({check:"custom",...b(U)});return w._zod.check=$,w}function c8($){let U=new $$({check:"describe"});return U._zod.onattach=[(w)=>{let J=q$.get(w)??{};q$.add(w,{...J,description:$})}],U._zod.check=()=>{},U}function r8($){let U=new $$({check:"meta"});return U._zod.onattach=[(w)=>{let J=q$.get(w)??{};q$.add(w,{...J,...$})}],U._zod.check=()=>{},U}function l8($,U){let w=b(U),J=w.truthy??["true","1","yes","on","y","enabled"],z=w.falsy??["false","0","no","off","n","disabled"];if(w.case!=="sensitive")J=J.map((g)=>typeof g==="string"?g.toLowerCase():g),z=z.map((g)=>typeof g==="string"?g.toLowerCase():g);let G=new Set(J),X=new Set(z),_=$.Codec??n1,N=$.Boolean??l1,Y=new($.String??Z6)({type:"string",error:w.error}),Q=new N({type:"boolean",error:w.error}),V=new _({type:"pipe",in:Y,out:Q,transform:(g,H)=>{let q=g;if(w.case!=="sensitive")q=q.toLowerCase();if(G.has(q))return!0;else if(X.has(q))return!1;else return H.issues.push({code:"invalid_value",expected:"stringbool",values:[...G,...X],input:H.value,inst:V,continue:!1}),{}},reverseTransform:(g,H)=>{if(g===!0)return J[0]||"true";else return z[0]||"false"},error:w.error});return V}function jU($,U,w,J={}){let z=b(J),G={...b(J),check:"string_format",type:"string",format:U,fn:typeof w==="function"?w:(_)=>w.test(_),...z};if(w instanceof RegExp)G.pattern=w;return new $(G)}function h4($){let U=$?.target??"draft-2020-12";if(U==="draft-4")U="draft-04";if(U==="draft-7")U="draft-07";return{processors:$.processors??{},metadataRegistry:$?.metadata??q$,target:U,unrepresentable:$?.unrepresentable??"throw",override:$?.override??(()=>{}),io:$?.io??"output",counter:0,seen:new Map,cycles:$?.cycles??"ref",reused:$?.reused??"inline",external:$?.external??void 0}}function a($,U,w={path:[],schemaPath:[]}){var J;let z=$._zod.def,G=U.seen.get($);if(G){if(G.count++,w.schemaPath.includes($))G.cycle=w.path;return G.schema}let X={schema:{},count:1,cycle:void 0,path:w.path};U.seen.set($,X);let _=$._zod.toJSONSchema?.();if(_)X.schema=_;else{let Y={...w,schemaPath:[...w.schemaPath,$],path:w.path};if($._zod.processJSONSchema)$._zod.processJSONSchema(U,X.schema,Y);else{let V=X.schema,g=U.processors[z.type];if(!g)throw Error(`[toJSONSchema]: Non-representable type encountered: ${z.type}`);g($,U,V,Y)}let Q=$._zod.parent;if(Q){if(!X.ref)X.ref=Q;a(Q,U,Y),U.seen.get(Q).isParent=!0}}let N=U.metadataRegistry.get($);if(N)Object.assign(X.schema,N);if(U.io==="input"&&M$($))delete X.schema.examples,delete X.schema.default;if(U.io==="input"&&"_prefault"in X.schema)(J=X.schema).default??(J.default=X.schema._prefault);return delete X.schema._prefault,U.seen.get($).schema}function m4($,U){let w=$.seen.get(U);if(!w)throw Error("Unprocessed schema. This is a bug in Zod.");let J=new Map;for(let X of $.seen.entries()){let _=$.metadataRegistry.get(X[0])?.id;if(_){let N=J.get(_);if(N&&N!==X[0])throw Error(`Duplicate schema id "${_}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);J.set(_,X[0])}}let z=(X)=>{let _=$.target==="draft-2020-12"?"$defs":"definitions";if($.external){let Q=$.external.registry.get(X[0])?.id,V=$.external.uri??((H)=>H);if(Q)return{ref:V(Q)};let g=X[1].defId??X[1].schema.id??`schema${$.counter++}`;return X[1].defId=g,{defId:g,ref:`${V("__shared")}#/${_}/${g}`}}if(X[1]===w)return{ref:"#"};let W=`${"#"}/${_}/`,Y=X[1].schema.id??`__schema${$.counter++}`;return{defId:Y,ref:W+Y}},G=(X)=>{if(X[1].schema.$ref)return;let _=X[1],{ref:N,defId:W}=z(X);if(_.def={..._.schema},W)_.defId=W;let Y=_.schema;for(let Q in Y)delete Y[Q];Y.$ref=N};if($.cycles==="throw")for(let X of $.seen.entries()){let _=X[1];if(_.cycle)throw Error(`Cycle detected: #/${_.cycle?.join("/")}/<root>
|
|
252
|
+
`)}W.write("payload.value = newResult;"),W.write("return payload;");let u=W.compile();return(b,M)=>u(N,b,M)},z,g=F6,V=!Z6.jitless,G=V&&_g.value,X=w.catchall,I;$._zod.parse=(N,W)=>{I??(I=v.value);let P=N.value;if(!g(P))return N.issues.push({expected:"object",code:"invalid_type",input:P,inst:$}),N;if(V&&G&&W?.async===!1&&W.jitless!==!0){if(!z)z=J(w.shape);if(N=z(N,W),!X)return N;return s3([],P,N,W,I,$)}return U(N,W)}});function C3($,w,U,v){for(let z of $)if(z.issues.length===0)return w.value=z.value,w;let J=$.filter((z)=>!n4(z));if(J.length===1)return w.value=J[0].value,J[0];return w.issues.push({code:"invalid_union",input:w.value,inst:U,errors:$.map((z)=>z.issues.map((g)=>Z$(g,v,g$())))}),w}var UJ=B("$ZodUnion",($,w)=>{d.init($,w),n($._zod,"optin",()=>w.options.some((v)=>v._zod.optin==="optional")?"optional":void 0),n($._zod,"optout",()=>w.options.some((v)=>v._zod.optout==="optional")?"optional":void 0),n($._zod,"values",()=>{if(w.options.every((v)=>v._zod.values))return new Set(w.options.flatMap((v)=>Array.from(v._zod.values)));return}),n($._zod,"pattern",()=>{if(w.options.every((v)=>v._zod.pattern)){let v=w.options.map((J)=>J._zod.pattern);return new RegExp(`^(${v.map((J)=>h1(J.source)).join("|")})$`)}return});let U=w.options.length===1?w.options[0]._zod.run:null;$._zod.parse=(v,J)=>{if(U)return U(v,J);let z=!1,g=[];for(let V of w.options){let _=V._zod.run({value:v.value,issues:[]},J);if(_ instanceof Promise)g.push(_),z=!0;else{if(_.issues.length===0)return _;g.push(_)}}if(!z)return C3(g,v,$,J);return Promise.all(g).then((V)=>{return C3(V,v,$,J)})}});function j3($,w,U,v){let J=$.filter((z)=>z.issues.length===0);if(J.length===1)return w.value=J[0].value,w;if(J.length===0)w.issues.push({code:"invalid_union",input:w.value,inst:U,errors:$.map((z)=>z.issues.map((g)=>Z$(g,v,g$())))});else w.issues.push({code:"invalid_union",input:w.value,inst:U,errors:[],inclusive:!1});return w}var sV=B("$ZodXor",($,w)=>{UJ.init($,w),w.inclusive=!1;let U=w.options.length===1?w.options[0]._zod.run:null;$._zod.parse=(v,J)=>{if(U)return U(v,J);let z=!1,g=[];for(let V of w.options){let _=V._zod.run({value:v.value,issues:[]},J);if(_ instanceof Promise)g.push(_),z=!0;else g.push(_)}if(!z)return j3(g,v,$,J);return Promise.all(g).then((V)=>{return j3(V,v,$,J)})}}),$G=B("$ZodDiscriminatedUnion",($,w)=>{w.inclusive=!1,UJ.init($,w);let U=$._zod.parse;n($._zod,"propValues",()=>{let J={};for(let z of w.options){let g=z._zod.propValues;if(!g||Object.keys(g).length===0)throw Error(`Invalid discriminated union option at index "${w.options.indexOf(z)}"`);for(let[V,_]of Object.entries(g)){if(!J[V])J[V]=new Set;for(let G of _)J[V].add(G)}}return J});let v=fw(()=>{let J=w.options,z=new Map;for(let g of J){let V=g._zod.propValues?.[w.discriminator];if(!V||V.size===0)throw Error(`Invalid discriminated union option at index "${w.options.indexOf(g)}"`);for(let _ of V){if(z.has(_))throw Error(`Duplicate discriminator value "${String(_)}"`);z.set(_,g)}}return z});$._zod.parse=(J,z)=>{let g=J.value;if(!F6(g))return J.issues.push({code:"invalid_type",expected:"object",input:g,inst:$}),J;let V=v.value.get(g?.[w.discriminator]);if(V)return V._zod.run(J,z);if(w.unionFallback||z.direction==="backward")return U(J,z);return J.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:w.discriminator,options:Array.from(v.value.keys()),input:g,path:[w.discriminator],inst:$}),J}}),wG=B("$ZodIntersection",($,w)=>{d.init($,w),$._zod.parse=(U,v)=>{let J=U.value,z=w.left._zod.run({value:J,issues:[]},v),g=w.right._zod.run({value:J,issues:[]},v);if(z instanceof Promise||g instanceof Promise)return Promise.all([z,g]).then(([_,G])=>{return x3(U,_,G)});return x3(U,z,g)}});function YV($,w){if($===w)return{valid:!0,data:$};if($ instanceof Date&&w instanceof Date&&+$===+w)return{valid:!0,data:$};if(m4($)&&m4(w)){let U=Object.keys(w),v=Object.keys($).filter((z)=>U.indexOf(z)!==-1),J={...$,...w};for(let z of v){let g=YV($[z],w[z]);if(!g.valid)return{valid:!1,mergeErrorPath:[z,...g.mergeErrorPath]};J[z]=g.data}return{valid:!0,data:J}}if(Array.isArray($)&&Array.isArray(w)){if($.length!==w.length)return{valid:!1,mergeErrorPath:[]};let U=[];for(let v=0;v<$.length;v++){let J=$[v],z=w[v],g=YV(J,z);if(!g.valid)return{valid:!1,mergeErrorPath:[v,...g.mergeErrorPath]};U.push(g.data)}return{valid:!0,data:U}}return{valid:!1,mergeErrorPath:[]}}function x3($,w,U){let v=new Map,J;for(let V of w.issues)if(V.code==="unrecognized_keys"){J??(J=V);for(let _ of V.keys){if(!v.has(_))v.set(_,{});v.get(_).l=!0}}else $.issues.push(V);for(let V of U.issues)if(V.code==="unrecognized_keys")for(let _ of V.keys){if(!v.has(_))v.set(_,{});v.get(_).r=!0}else $.issues.push(V);let z=[...v].filter(([,V])=>V.l&&V.r).map(([V])=>V);if(z.length&&J)$.issues.push({...J,keys:z});if(n4($))return $;let g=YV(w.value,U.value);if(!g.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(g.mergeErrorPath)}`);return $.value=g.data,$}var wv=B("$ZodTuple",($,w)=>{d.init($,w);let U=w.items;$._zod.parse=(v,J)=>{let z=v.value;if(!Array.isArray(z))return v.issues.push({input:z,inst:$,expected:"tuple",code:"invalid_type"}),v;v.value=[];let g=[],V=r3(U,"optin"),_=r3(U,"optout");if(!w.rest){if(z.length<V)return v.issues.push({code:"too_small",minimum:V,inclusive:!0,input:z,inst:$,origin:"array"}),v;if(z.length>U.length)v.issues.push({code:"too_big",maximum:U.length,inclusive:!0,input:z,inst:$,origin:"array"})}let G=Array(U.length);for(let X=0;X<U.length;X++){let I=U[X]._zod.run({value:z[X],issues:[]},J);if(I instanceof Promise)g.push(I.then((N)=>{G[X]=N}));else G[X]=I}if(w.rest){let X=U.length-1,I=z.slice(U.length);for(let N of I){X++;let W=w.rest._zod.run({value:N,issues:[]},J);if(W instanceof Promise)g.push(W.then((P)=>y3(P,v,X)));else y3(W,v,X)}}if(g.length)return Promise.all(g).then(()=>d3(G,v,U,z,_));return d3(G,v,U,z,_)}});function r3($,w){for(let U=$.length-1;U>=0;U--)if($[U]._zod[w]!=="optional")return U+1;return 0}function y3($,w,U){if($.issues.length)w.issues.push(...M$(U,$.issues));w.value[U]=$.value}function d3($,w,U,v,J){for(let z=0;z<U.length;z++){let g=$[z],V=z<v.length;if(g.issues.length){if(!V&&z>=J){w.value.length=z;break}w.issues.push(...M$(z,g.issues))}w.value[z]=g.value}for(let z=w.value.length-1;z>=v.length;z--)if(U[z]._zod.optout==="optional"&&w.value[z]===void 0)w.value.length=z;else break;return w}var UG=B("$ZodRecord",($,w)=>{d.init($,w),$._zod.parse=(U,v)=>{let J=U.value;if(!m4(J))return U.issues.push({expected:"record",code:"invalid_type",input:J,inst:$}),U;let z=[],g=w.keyType._zod.values;if(g){U.value={};let V=new Set;for(let G of g)if(typeof G==="string"||typeof G==="number"||typeof G==="symbol"){V.add(typeof G==="number"?G.toString():G);let X=w.keyType._zod.run({value:G,issues:[]},v);if(X instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(X.issues.length){U.issues.push({code:"invalid_key",origin:"record",issues:X.issues.map((W)=>Z$(W,v,g$())),input:G,path:[G],inst:$});continue}let I=X.value,N=w.valueType._zod.run({value:J[G],issues:[]},v);if(N instanceof Promise)z.push(N.then((W)=>{if(W.issues.length)U.issues.push(...M$(G,W.issues));U.value[I]=W.value}));else{if(N.issues.length)U.issues.push(...M$(G,N.issues));U.value[I]=N.value}}let _;for(let G in J)if(!V.has(G))_=_??[],_.push(G);if(_&&_.length>0)U.issues.push({code:"unrecognized_keys",input:J,inst:$,keys:_})}else{U.value={};for(let V of Reflect.ownKeys(J)){if(V==="__proto__")continue;if(!Object.prototype.propertyIsEnumerable.call(J,V))continue;let _=w.keyType._zod.run({value:V,issues:[]},v);if(_ instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof V==="string"&&e1.test(V)&&_.issues.length){let I=w.keyType._zod.run({value:Number(V),issues:[]},v);if(I instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(I.issues.length===0)_=I}if(_.issues.length){if(w.mode==="loose")U.value[V]=J[V];else U.issues.push({code:"invalid_key",origin:"record",issues:_.issues.map((I)=>Z$(I,v,g$())),input:V,path:[V],inst:$});continue}let X=w.valueType._zod.run({value:J[V],issues:[]},v);if(X instanceof Promise)z.push(X.then((I)=>{if(I.issues.length)U.issues.push(...M$(V,I.issues));U.value[_.value]=I.value}));else{if(X.issues.length)U.issues.push(...M$(V,X.issues));U.value[_.value]=X.value}}}if(z.length)return Promise.all(z).then(()=>U);return U}}),JG=B("$ZodMap",($,w)=>{d.init($,w),$._zod.parse=(U,v)=>{let J=U.value;if(!(J instanceof Map))return U.issues.push({expected:"map",code:"invalid_type",input:J,inst:$}),U;let z=[];U.value=new Map;for(let[g,V]of J){let _=w.keyType._zod.run({value:g,issues:[]},v),G=w.valueType._zod.run({value:V,issues:[]},v);if(_ instanceof Promise||G instanceof Promise)z.push(Promise.all([_,G]).then(([X,I])=>{m3(X,I,U,g,J,$,v)}));else m3(_,G,U,g,J,$,v)}if(z.length)return Promise.all(z).then(()=>U);return U}});function m3($,w,U,v,J,z,g){if($.issues.length)if(c1.has(typeof v))U.issues.push(...M$(v,$.issues));else U.issues.push({code:"invalid_key",origin:"map",input:J,inst:z,issues:$.issues.map((V)=>Z$(V,g,g$()))});if(w.issues.length)if(c1.has(typeof v))U.issues.push(...M$(v,w.issues));else U.issues.push({origin:"map",code:"invalid_element",input:J,inst:z,key:v,issues:w.issues.map((V)=>Z$(V,g,g$()))});U.value.set($.value,w.value)}var vG=B("$ZodSet",($,w)=>{d.init($,w),$._zod.parse=(U,v)=>{let J=U.value;if(!(J instanceof Set))return U.issues.push({input:J,inst:$,expected:"set",code:"invalid_type"}),U;let z=[];U.value=new Set;for(let g of J){let V=w.valueType._zod.run({value:g,issues:[]},v);if(V instanceof Promise)z.push(V.then((_)=>n3(_,U)));else n3(V,U)}if(z.length)return Promise.all(z).then(()=>U);return U}});function n3($,w){if($.issues.length)w.issues.push(...$.issues);w.value.add($.value)}var zG=B("$ZodEnum",($,w)=>{d.init($,w);let U=n1(w.entries),v=new Set(U);$._zod.values=v,$._zod.pattern=new RegExp(`^(${U.filter((J)=>c1.has(typeof J)).map((J)=>typeof J==="string"?n$(J):J.toString()).join("|")})$`),$._zod.parse=(J,z)=>{let g=J.value;if(v.has(g))return J;return J.issues.push({code:"invalid_value",values:U,input:g,inst:$}),J}}),gG=B("$ZodLiteral",($,w)=>{if(d.init($,w),w.values.length===0)throw Error("Cannot create literal schema with no valid values");let U=new Set(w.values);$._zod.values=U,$._zod.pattern=new RegExp(`^(${w.values.map((v)=>typeof v==="string"?n$(v):v?n$(v.toString()):String(v)).join("|")})$`),$._zod.parse=(v,J)=>{let z=v.value;if(U.has(z))return v;return v.issues.push({code:"invalid_value",values:w.values,input:z,inst:$}),v}}),VG=B("$ZodFile",($,w)=>{d.init($,w),$._zod.parse=(U,v)=>{let J=U.value;if(J instanceof File)return U;return U.issues.push({expected:"file",code:"invalid_type",input:J,inst:$}),U}}),GG=B("$ZodTransform",($,w)=>{d.init($,w),$._zod.optin="optional",$._zod.parse=(U,v)=>{if(v.direction==="backward")throw new b6($.constructor.name);let J=w.transform(U.value,U);if(v.async)return(J instanceof Promise?J:Promise.resolve(J)).then((g)=>{return U.value=g,U.fallback=!0,U});if(J instanceof Promise)throw new V4;return U.value=J,U.fallback=!0,U}});function h3($,w){if(w===void 0&&($.issues.length||$.fallback))return{issues:[],value:void 0};return $}var Uv=B("$ZodOptional",($,w)=>{d.init($,w),$._zod.optin="optional",$._zod.optout="optional",n($._zod,"values",()=>{return w.innerType._zod.values?new Set([...w.innerType._zod.values,void 0]):void 0}),n($._zod,"pattern",()=>{let U=w.innerType._zod.pattern;return U?new RegExp(`^(${h1(U.source)})?$`):void 0}),$._zod.parse=(U,v)=>{if(w.innerType._zod.optin==="optional"){let J=U.value,z=w.innerType._zod.run(U,v);if(z instanceof Promise)return z.then((g)=>h3(g,J));return h3(z,J)}if(U.value===void 0)return U;return w.innerType._zod.run(U,v)}}),_G=B("$ZodExactOptional",($,w)=>{Uv.init($,w),n($._zod,"values",()=>w.innerType._zod.values),n($._zod,"pattern",()=>w.innerType._zod.pattern),$._zod.parse=(U,v)=>{return w.innerType._zod.run(U,v)}}),XG=B("$ZodNullable",($,w)=>{d.init($,w),n($._zod,"optin",()=>w.innerType._zod.optin),n($._zod,"optout",()=>w.innerType._zod.optout),n($._zod,"pattern",()=>{let U=w.innerType._zod.pattern;return U?new RegExp(`^(${h1(U.source)}|null)$`):void 0}),n($._zod,"values",()=>{return w.innerType._zod.values?new Set([...w.innerType._zod.values,null]):void 0}),$._zod.parse=(U,v)=>{if(U.value===null)return U;return w.innerType._zod.run(U,v)}}),IG=B("$ZodDefault",($,w)=>{d.init($,w),$._zod.optin="optional",n($._zod,"values",()=>w.innerType._zod.values),$._zod.parse=(U,v)=>{if(v.direction==="backward")return w.innerType._zod.run(U,v);if(U.value===void 0)return U.value=w.defaultValue,U;let J=w.innerType._zod.run(U,v);if(J instanceof Promise)return J.then((z)=>c3(z,w));return c3(J,w)}});function c3($,w){if($.value===void 0)$.value=w.defaultValue;return $}var NG=B("$ZodPrefault",($,w)=>{d.init($,w),$._zod.optin="optional",n($._zod,"values",()=>w.innerType._zod.values),$._zod.parse=(U,v)=>{if(v.direction==="backward")return w.innerType._zod.run(U,v);if(U.value===void 0)U.value=w.defaultValue;return w.innerType._zod.run(U,v)}}),WG=B("$ZodNonOptional",($,w)=>{d.init($,w),n($._zod,"values",()=>{let U=w.innerType._zod.values;return U?new Set([...U].filter((v)=>v!==void 0)):void 0}),$._zod.parse=(U,v)=>{let J=w.innerType._zod.run(U,v);if(J instanceof Promise)return J.then((z)=>l3(z,$));return l3(J,$)}});function l3($,w){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:w});return $}var YG=B("$ZodSuccess",($,w)=>{d.init($,w),$._zod.parse=(U,v)=>{if(v.direction==="backward")throw new b6("ZodSuccess");let J=w.innerType._zod.run(U,v);if(J instanceof Promise)return J.then((z)=>{return U.value=z.issues.length===0,U});return U.value=J.issues.length===0,U}}),QG=B("$ZodCatch",($,w)=>{d.init($,w),$._zod.optin="optional",n($._zod,"optout",()=>w.innerType._zod.optout),n($._zod,"values",()=>w.innerType._zod.values),$._zod.parse=(U,v)=>{if(v.direction==="backward")return w.innerType._zod.run(U,v);let J=w.innerType._zod.run(U,v);if(J instanceof Promise)return J.then((z)=>{if(U.value=z.value,z.issues.length)U.value=w.catchValue({...U,error:{issues:z.issues.map((g)=>Z$(g,v,g$()))},input:U.value}),U.issues=[],U.fallback=!0;return U});if(U.value=J.value,J.issues.length)U.value=w.catchValue({...U,error:{issues:J.issues.map((z)=>Z$(z,v,g$()))},input:U.value}),U.issues=[],U.fallback=!0;return U}}),PG=B("$ZodNaN",($,w)=>{d.init($,w),$._zod.parse=(U,v)=>{if(typeof U.value!=="number"||!Number.isNaN(U.value))return U.issues.push({input:U.value,inst:$,expected:"nan",code:"invalid_type"}),U;return U}}),Jv=B("$ZodPipe",($,w)=>{d.init($,w),n($._zod,"values",()=>w.in._zod.values),n($._zod,"optin",()=>w.in._zod.optin),n($._zod,"optout",()=>w.out._zod.optout),n($._zod,"propValues",()=>w.in._zod.propValues),$._zod.parse=(U,v)=>{if(v.direction==="backward"){let z=w.out._zod.run(U,v);if(z instanceof Promise)return z.then((g)=>o0(g,w.in,v));return o0(z,w.in,v)}let J=w.in._zod.run(U,v);if(J instanceof Promise)return J.then((z)=>o0(z,w.out,v));return o0(J,w.out,v)}});function o0($,w,U){if($.issues.length)return $.aborted=!0,$;return w._zod.run({value:$.value,issues:$.issues,fallback:$.fallback},U)}var JJ=B("$ZodCodec",($,w)=>{d.init($,w),n($._zod,"values",()=>w.in._zod.values),n($._zod,"optin",()=>w.in._zod.optin),n($._zod,"optout",()=>w.out._zod.optout),n($._zod,"propValues",()=>w.in._zod.propValues),$._zod.parse=(U,v)=>{if((v.direction||"forward")==="forward"){let z=w.in._zod.run(U,v);if(z instanceof Promise)return z.then((g)=>p0(g,w,v));return p0(z,w,v)}else{let z=w.out._zod.run(U,v);if(z instanceof Promise)return z.then((g)=>p0(g,w,v));return p0(z,w,v)}}});function p0($,w,U){if($.issues.length)return $.aborted=!0,$;if((U.direction||"forward")==="forward"){let J=w.transform($.value,$);if(J instanceof Promise)return J.then((z)=>a0($,z,w.out,U));return a0($,J,w.out,U)}else{let J=w.reverseTransform($.value,$);if(J instanceof Promise)return J.then((z)=>a0($,z,w.in,U));return a0($,J,w.in,U)}}function a0($,w,U,v){if($.issues.length)return $.aborted=!0,$;return U._zod.run({value:w,issues:$.issues},v)}var OG=B("$ZodPreprocess",($,w)=>{Jv.init($,w)}),BG=B("$ZodReadonly",($,w)=>{d.init($,w),n($._zod,"propValues",()=>w.innerType._zod.propValues),n($._zod,"values",()=>w.innerType._zod.values),n($._zod,"optin",()=>w.innerType?._zod?.optin),n($._zod,"optout",()=>w.innerType?._zod?.optout),$._zod.parse=(U,v)=>{if(v.direction==="backward")return w.innerType._zod.run(U,v);let J=w.innerType._zod.run(U,v);if(J instanceof Promise)return J.then(t3);return t3(J)}});function t3($){return $.value=Object.freeze($.value),$}var qG=B("$ZodTemplateLiteral",($,w)=>{d.init($,w);let U=[];for(let v of w.parts)if(typeof v==="object"&&v!==null){if(!v._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...v._zod.traits].shift()}`);let J=v._zod.pattern instanceof RegExp?v._zod.pattern.source:v._zod.pattern;if(!J)throw Error(`Invalid template literal part: ${v._zod.traits}`);let z=J.startsWith("^")?1:0,g=J.endsWith("$")?J.length-1:J.length;U.push(J.slice(z,g))}else if(v===null||Ig.has(typeof v))U.push(n$(`${v}`));else throw Error(`Invalid template literal part: ${v}`);$._zod.pattern=new RegExp(`^${U.join("")}$`),$._zod.parse=(v,J)=>{if(typeof v.value!=="string")return v.issues.push({input:v.value,inst:$,expected:"string",code:"invalid_type"}),v;if($._zod.pattern.lastIndex=0,!$._zod.pattern.test(v.value))return v.issues.push({input:v.value,inst:$,code:"invalid_format",format:w.format??"template_literal",pattern:$._zod.pattern.source}),v;return v}}),LG=B("$ZodFunction",($,w)=>{return d.init($,w),$._def=w,$._zod.def=w,$.implement=(U)=>{if(typeof U!=="function")throw Error("implement() must be called with a function");return function(...v){let J=$._def.input?R0($._def.input,v):v,z=Reflect.apply(U,this,J);if($._def.output)return R0($._def.output,z);return z}},$.implementAsync=(U)=>{if(typeof U!=="function")throw Error("implementAsync() must be called with a function");return async function(...v){let J=$._def.input?await k0($._def.input,v):v,z=await Reflect.apply(U,this,J);if($._def.output)return await k0($._def.output,z);return z}},$._zod.parse=(U,v)=>{if(typeof U.value!=="function")return U.issues.push({code:"invalid_type",expected:"function",input:U.value,inst:$}),U;if($._def.output&&$._def.output._zod.def.type==="promise")U.value=$.implementAsync(U.value);else U.value=$.implement(U.value);return U},$.input=(...U)=>{let v=$.constructor;if(Array.isArray(U[0]))return new v({type:"function",input:new wv({type:"tuple",items:U[0],rest:U[1]}),output:$._def.output});return new v({type:"function",input:U[0],output:$._def.output})},$.output=(U)=>{return new $.constructor({type:"function",input:$._def.input,output:U})},$}),HG=B("$ZodPromise",($,w)=>{d.init($,w),$._zod.parse=(U,v)=>{return Promise.resolve(U.value).then((J)=>w.innerType._zod.run({value:J,issues:[]},v))}}),uG=B("$ZodLazy",($,w)=>{d.init($,w),n($._zod,"innerType",()=>{let U=w;if(!U._cachedInner)U._cachedInner=w.getter();return U._cachedInner}),n($._zod,"pattern",()=>$._zod.innerType?._zod?.pattern),n($._zod,"propValues",()=>$._zod.innerType?._zod?.propValues),n($._zod,"optin",()=>$._zod.innerType?._zod?.optin??void 0),n($._zod,"optout",()=>$._zod.innerType?._zod?.optout??void 0),$._zod.parse=(U,v)=>{return $._zod.innerType._zod.run(U,v)}}),KG=B("$ZodCustom",($,w)=>{$$.init($,w),d.init($,w),$._zod.parse=(U,v)=>{return U},$._zod.check=(U)=>{let v=U.value,J=w.fn(v);if(J instanceof Promise)return J.then((z)=>o3(z,U,v,$));o3(J,U,v,$);return}});function o3($,w,U,v){if(!$){let J={code:"custom",input:U,inst:v,path:[...v._zod.def.path??[]],continue:!v._zod.def.abort};if(v._zod.def.params)J.params=v._zod.def.params;w.issues.push(Tw(J))}}var GJ={};Y4(GJ,{zhTW:()=>O_,zhCN:()=>P_,yo:()=>B_,vi:()=>Q_,uz:()=>Y_,ur:()=>W_,uk:()=>VJ,ua:()=>N_,tr:()=>I_,th:()=>X_,ta:()=>__,sv:()=>G_,sl:()=>V_,ru:()=>g_,ro:()=>z_,pt:()=>v_,ps:()=>U_,pl:()=>J_,ota:()=>w_,no:()=>$_,nl:()=>sG,ms:()=>eG,mk:()=>aG,lt:()=>pG,ko:()=>oG,km:()=>zJ,kh:()=>tG,ka:()=>lG,ja:()=>cG,it:()=>hG,is:()=>nG,id:()=>mG,hy:()=>dG,hu:()=>yG,hr:()=>rG,he:()=>xG,frCA:()=>jG,fr:()=>CG,fi:()=>kG,fa:()=>RG,es:()=>AG,eo:()=>SG,en:()=>vJ,el:()=>EG,de:()=>iG,da:()=>MG,cs:()=>FG,ca:()=>bG,bg:()=>ZG,be:()=>TG,az:()=>fG,ar:()=>DG});var wL=()=>{let $={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function w(J){return $[J]??null}let U={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:"مدخل"},v={nan:"NaN"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(/^[A-Z]/.test(J.expected))return`مدخلات غير مقبولة: يفترض إدخال instanceof ${J.expected}، ولكن تم إدخال ${V}`;return`مدخلات غير مقبولة: يفترض إدخال ${z}، ولكن تم إدخال ${V}`}case"invalid_value":if(J.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${K(J.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${L(J.values,"|")}`;case"too_big":{let z=J.inclusive?"<=":"<",g=w(J.origin);if(g)return` أكبر من اللازم: يفترض أن تكون ${J.origin??"القيمة"} ${z} ${J.maximum.toString()} ${g.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${J.origin??"القيمة"} ${z} ${J.maximum.toString()}`}case"too_small":{let z=J.inclusive?">=":">",g=w(J.origin);if(g)return`أصغر من اللازم: يفترض لـ ${J.origin} أن يكون ${z} ${J.minimum.toString()} ${g.unit}`;return`أصغر من اللازم: يفترض لـ ${J.origin} أن يكون ${z} ${J.minimum.toString()}`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${J.prefix}"`;if(z.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${z.suffix}"`;if(z.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${z.includes}"`;if(z.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${z.pattern}`;return`${U[z.format]??J.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${J.divisor}`;case"unrecognized_keys":return`معرف${J.keys.length>1?"ات":""} غريب${J.keys.length>1?"ة":""}: ${L(J.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${J.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${J.origin}`;default:return"مدخل غير مقبول"}}};function DG(){return{localeError:wL()}}var UL=()=>{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 w(J){return $[J]??null}let U={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"},v={nan:"NaN"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(/^[A-Z]/.test(J.expected))return`Yanlış dəyər: gözlənilən instanceof ${J.expected}, daxil olan ${V}`;return`Yanlış dəyər: gözlənilən ${z}, daxil olan ${V}`}case"invalid_value":if(J.values.length===1)return`Yanlış dəyər: gözlənilən ${K(J.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${L(J.values,"|")}`;case"too_big":{let z=J.inclusive?"<=":"<",g=w(J.origin);if(g)return`Çox böyük: gözlənilən ${J.origin??"dəyər"} ${z}${J.maximum.toString()} ${g.unit??"element"}`;return`Çox böyük: gözlənilən ${J.origin??"dəyər"} ${z}${J.maximum.toString()}`}case"too_small":{let z=J.inclusive?">=":">",g=w(J.origin);if(g)return`Çox kiçik: gözlənilən ${J.origin} ${z}${J.minimum.toString()} ${g.unit}`;return`Çox kiçik: gözlənilən ${J.origin} ${z}${J.minimum.toString()}`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`Yanlış mətn: "${z.prefix}" ilə başlamalıdır`;if(z.format==="ends_with")return`Yanlış mətn: "${z.suffix}" ilə bitməlidir`;if(z.format==="includes")return`Yanlış mətn: "${z.includes}" daxil olmalıdır`;if(z.format==="regex")return`Yanlış mətn: ${z.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${U[z.format]??J.format}`}case"not_multiple_of":return`Yanlış ədəd: ${J.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${J.keys.length>1?"lar":""}: ${L(J.keys,", ")}`;case"invalid_key":return`${J.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${J.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function fG(){return{localeError:UL()}}function w9($,w,U,v){let J=Math.abs($),z=J%10,g=J%100;if(g>=11&&g<=19)return v;if(z===1)return w;if(z>=2&&z<=4)return U;return v}var JL=()=>{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 w(J){return $[J]??null}let U={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:"увод"},v={nan:"NaN",number:"лік",array:"масіў"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(/^[A-Z]/.test(J.expected))return`Няправільны ўвод: чакаўся instanceof ${J.expected}, атрымана ${V}`;return`Няправільны ўвод: чакаўся ${z}, атрымана ${V}`}case"invalid_value":if(J.values.length===1)return`Няправільны ўвод: чакалася ${K(J.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${L(J.values,"|")}`;case"too_big":{let z=J.inclusive?"<=":"<",g=w(J.origin);if(g){let V=Number(J.maximum),_=w9(V,g.unit.one,g.unit.few,g.unit.many);return`Занадта вялікі: чакалася, што ${J.origin??"значэнне"} павінна ${g.verb} ${z}${J.maximum.toString()} ${_}`}return`Занадта вялікі: чакалася, што ${J.origin??"значэнне"} павінна быць ${z}${J.maximum.toString()}`}case"too_small":{let z=J.inclusive?">=":">",g=w(J.origin);if(g){let V=Number(J.minimum),_=w9(V,g.unit.one,g.unit.few,g.unit.many);return`Занадта малы: чакалася, што ${J.origin} павінна ${g.verb} ${z}${J.minimum.toString()} ${_}`}return`Занадта малы: чакалася, што ${J.origin} павінна быць ${z}${J.minimum.toString()}`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`Няправільны радок: павінен пачынацца з "${z.prefix}"`;if(z.format==="ends_with")return`Няправільны радок: павінен заканчвацца на "${z.suffix}"`;if(z.format==="includes")return`Няправільны радок: павінен змяшчаць "${z.includes}"`;if(z.format==="regex")return`Няправільны радок: павінен адпавядаць шаблону ${z.pattern}`;return`Няправільны ${U[z.format]??J.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${J.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${J.keys.length>1?"ключы":"ключ"}: ${L(J.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${J.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${J.origin}`;default:return"Няправільны ўвод"}}};function TG(){return{localeError:JL()}}var vL=()=>{let $={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function w(J){return $[J]??null}let U={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:"вход"},v={nan:"NaN",number:"число",array:"масив"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(/^[A-Z]/.test(J.expected))return`Невалиден вход: очакван instanceof ${J.expected}, получен ${V}`;return`Невалиден вход: очакван ${z}, получен ${V}`}case"invalid_value":if(J.values.length===1)return`Невалиден вход: очакван ${K(J.values[0])}`;return`Невалидна опция: очаквано едно от ${L(J.values,"|")}`;case"too_big":{let z=J.inclusive?"<=":"<",g=w(J.origin);if(g)return`Твърде голямо: очаква се ${J.origin??"стойност"} да съдържа ${z}${J.maximum.toString()} ${g.unit??"елемента"}`;return`Твърде голямо: очаква се ${J.origin??"стойност"} да бъде ${z}${J.maximum.toString()}`}case"too_small":{let z=J.inclusive?">=":">",g=w(J.origin);if(g)return`Твърде малко: очаква се ${J.origin} да съдържа ${z}${J.minimum.toString()} ${g.unit}`;return`Твърде малко: очаква се ${J.origin} да бъде ${z}${J.minimum.toString()}`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`Невалиден низ: трябва да започва с "${z.prefix}"`;if(z.format==="ends_with")return`Невалиден низ: трябва да завършва с "${z.suffix}"`;if(z.format==="includes")return`Невалиден низ: трябва да включва "${z.includes}"`;if(z.format==="regex")return`Невалиден низ: трябва да съвпада с ${z.pattern}`;let g="Невалиден";if(z.format==="emoji")g="Невалидно";if(z.format==="datetime")g="Невалидно";if(z.format==="date")g="Невалидна";if(z.format==="time")g="Невалидно";if(z.format==="duration")g="Невалидна";return`${g} ${U[z.format]??J.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${J.divisor}`;case"unrecognized_keys":return`Неразпознат${J.keys.length>1?"и":""} ключ${J.keys.length>1?"ове":""}: ${L(J.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${J.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${J.origin}`;default:return"Невалиден вход"}}};function ZG(){return{localeError:vL()}}var zL=()=>{let $={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function w(J){return $[J]??null}let U={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"},v={nan:"NaN"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(/^[A-Z]/.test(J.expected))return`Tipus invàlid: s'esperava instanceof ${J.expected}, s'ha rebut ${V}`;return`Tipus invàlid: s'esperava ${z}, s'ha rebut ${V}`}case"invalid_value":if(J.values.length===1)return`Valor invàlid: s'esperava ${K(J.values[0])}`;return`Opció invàlida: s'esperava una de ${L(J.values," o ")}`;case"too_big":{let z=J.inclusive?"com a màxim":"menys de",g=w(J.origin);if(g)return`Massa gran: s'esperava que ${J.origin??"el valor"} contingués ${z} ${J.maximum.toString()} ${g.unit??"elements"}`;return`Massa gran: s'esperava que ${J.origin??"el valor"} fos ${z} ${J.maximum.toString()}`}case"too_small":{let z=J.inclusive?"com a mínim":"més de",g=w(J.origin);if(g)return`Massa petit: s'esperava que ${J.origin} contingués ${z} ${J.minimum.toString()} ${g.unit}`;return`Massa petit: s'esperava que ${J.origin} fos ${z} ${J.minimum.toString()}`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`Format invàlid: ha de començar amb "${z.prefix}"`;if(z.format==="ends_with")return`Format invàlid: ha d'acabar amb "${z.suffix}"`;if(z.format==="includes")return`Format invàlid: ha d'incloure "${z.includes}"`;if(z.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${z.pattern}`;return`Format invàlid per a ${U[z.format]??J.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${J.divisor}`;case"unrecognized_keys":return`Clau${J.keys.length>1?"s":""} no reconeguda${J.keys.length>1?"s":""}: ${L(J.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${J.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${J.origin}`;default:return"Entrada invàlida"}}};function bG(){return{localeError:zL()}}var gL=()=>{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 w(J){return $[J]??null}let U={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"},v={nan:"NaN",number:"číslo",string:"řetězec",function:"funkce",array:"pole"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(/^[A-Z]/.test(J.expected))return`Neplatný vstup: očekáváno instanceof ${J.expected}, obdrženo ${V}`;return`Neplatný vstup: očekáváno ${z}, obdrženo ${V}`}case"invalid_value":if(J.values.length===1)return`Neplatný vstup: očekáváno ${K(J.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${L(J.values,"|")}`;case"too_big":{let z=J.inclusive?"<=":"<",g=w(J.origin);if(g)return`Hodnota je příliš velká: ${J.origin??"hodnota"} musí mít ${z}${J.maximum.toString()} ${g.unit??"prvků"}`;return`Hodnota je příliš velká: ${J.origin??"hodnota"} musí být ${z}${J.maximum.toString()}`}case"too_small":{let z=J.inclusive?">=":">",g=w(J.origin);if(g)return`Hodnota je příliš malá: ${J.origin??"hodnota"} musí mít ${z}${J.minimum.toString()} ${g.unit??"prvků"}`;return`Hodnota je příliš malá: ${J.origin??"hodnota"} musí být ${z}${J.minimum.toString()}`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`Neplatný řetězec: musí začínat na "${z.prefix}"`;if(z.format==="ends_with")return`Neplatný řetězec: musí končit na "${z.suffix}"`;if(z.format==="includes")return`Neplatný řetězec: musí obsahovat "${z.includes}"`;if(z.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${z.pattern}`;return`Neplatný formát ${U[z.format]??J.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${J.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${L(J.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${J.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${J.origin}`;default:return"Neplatný vstup"}}};function FG(){return{localeError:gL()}}var VL=()=>{let $={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function w(J){return $[J]??null}let U={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"},v={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(/^[A-Z]/.test(J.expected))return`Ugyldigt input: forventede instanceof ${J.expected}, fik ${V}`;return`Ugyldigt input: forventede ${z}, fik ${V}`}case"invalid_value":if(J.values.length===1)return`Ugyldig værdi: forventede ${K(J.values[0])}`;return`Ugyldigt valg: forventede en af følgende ${L(J.values,"|")}`;case"too_big":{let z=J.inclusive?"<=":"<",g=w(J.origin),V=v[J.origin]??J.origin;if(g)return`For stor: forventede ${V??"value"} ${g.verb} ${z} ${J.maximum.toString()} ${g.unit??"elementer"}`;return`For stor: forventede ${V??"value"} havde ${z} ${J.maximum.toString()}`}case"too_small":{let z=J.inclusive?">=":">",g=w(J.origin),V=v[J.origin]??J.origin;if(g)return`For lille: forventede ${V} ${g.verb} ${z} ${J.minimum.toString()} ${g.unit}`;return`For lille: forventede ${V} havde ${z} ${J.minimum.toString()}`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`Ugyldig streng: skal starte med "${z.prefix}"`;if(z.format==="ends_with")return`Ugyldig streng: skal ende med "${z.suffix}"`;if(z.format==="includes")return`Ugyldig streng: skal indeholde "${z.includes}"`;if(z.format==="regex")return`Ugyldig streng: skal matche mønsteret ${z.pattern}`;return`Ugyldig ${U[z.format]??J.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${J.divisor}`;case"unrecognized_keys":return`${J.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${L(J.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${J.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${J.origin}`;default:return"Ugyldigt input"}}};function MG(){return{localeError:VL()}}var GL=()=>{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 w(J){return $[J]??null}let U={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"},v={nan:"NaN",number:"Zahl",array:"Array"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(/^[A-Z]/.test(J.expected))return`Ungültige Eingabe: erwartet instanceof ${J.expected}, erhalten ${V}`;return`Ungültige Eingabe: erwartet ${z}, erhalten ${V}`}case"invalid_value":if(J.values.length===1)return`Ungültige Eingabe: erwartet ${K(J.values[0])}`;return`Ungültige Option: erwartet eine von ${L(J.values,"|")}`;case"too_big":{let z=J.inclusive?"<=":"<",g=w(J.origin);if(g)return`Zu groß: erwartet, dass ${J.origin??"Wert"} ${z}${J.maximum.toString()} ${g.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${J.origin??"Wert"} ${z}${J.maximum.toString()} ist`}case"too_small":{let z=J.inclusive?">=":">",g=w(J.origin);if(g)return`Zu klein: erwartet, dass ${J.origin} ${z}${J.minimum.toString()} ${g.unit} hat`;return`Zu klein: erwartet, dass ${J.origin} ${z}${J.minimum.toString()} ist`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`Ungültiger String: muss mit "${z.prefix}" beginnen`;if(z.format==="ends_with")return`Ungültiger String: muss mit "${z.suffix}" enden`;if(z.format==="includes")return`Ungültiger String: muss "${z.includes}" enthalten`;if(z.format==="regex")return`Ungültiger String: muss dem Muster ${z.pattern} entsprechen`;return`Ungültig: ${U[z.format]??J.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${J.divisor} sein`;case"unrecognized_keys":return`${J.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${L(J.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${J.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${J.origin}`;default:return"Ungültige Eingabe"}}};function iG(){return{localeError:GL()}}var _L=()=>{let $={string:{unit:"χαρακτήρες",verb:"να έχει"},file:{unit:"bytes",verb:"να έχει"},array:{unit:"στοιχεία",verb:"να έχει"},set:{unit:"στοιχεία",verb:"να έχει"},map:{unit:"καταχωρήσεις",verb:"να έχει"}};function w(J){return $[J]??null}let U={regex:"είσοδος",email:"διεύθυνση 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",mac:"διεύθυνση MAC",cidrv4:"εύρος IPv4",cidrv6:"εύρος IPv6",base64:"συμβολοσειρά κωδικοποιημένη σε base64",base64url:"συμβολοσειρά κωδικοποιημένη σε base64url",json_string:"συμβολοσειρά JSON",e164:"αριθμός E.164",jwt:"JWT",template_literal:"είσοδος"},v={nan:"NaN"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(typeof J.expected==="string"&&/^[A-Z]/.test(J.expected))return`Μη έγκυρη είσοδος: αναμενόταν instanceof ${J.expected}, λήφθηκε ${V}`;return`Μη έγκυρη είσοδος: αναμενόταν ${z}, λήφθηκε ${V}`}case"invalid_value":if(J.values.length===1)return`Μη έγκυρη είσοδος: αναμενόταν ${K(J.values[0])}`;return`Μη έγκυρη επιλογή: αναμενόταν ένα από ${L(J.values,"|")}`;case"too_big":{let z=J.inclusive?"<=":"<",g=w(J.origin);if(g)return`Πολύ μεγάλο: αναμενόταν ${J.origin??"τιμή"} να έχει ${z}${J.maximum.toString()} ${g.unit??"στοιχεία"}`;return`Πολύ μεγάλο: αναμενόταν ${J.origin??"τιμή"} να είναι ${z}${J.maximum.toString()}`}case"too_small":{let z=J.inclusive?">=":">",g=w(J.origin);if(g)return`Πολύ μικρό: αναμενόταν ${J.origin} να έχει ${z}${J.minimum.toString()} ${g.unit}`;return`Πολύ μικρό: αναμενόταν ${J.origin} να είναι ${z}${J.minimum.toString()}`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`Μη έγκυρη συμβολοσειρά: πρέπει να ξεκινά με "${z.prefix}"`;if(z.format==="ends_with")return`Μη έγκυρη συμβολοσειρά: πρέπει να τελειώνει με "${z.suffix}"`;if(z.format==="includes")return`Μη έγκυρη συμβολοσειρά: πρέπει να περιέχει "${z.includes}"`;if(z.format==="regex")return`Μη έγκυρη συμβολοσειρά: πρέπει να ταιριάζει με το μοτίβο ${z.pattern}`;return`Μη έγκυρο: ${U[z.format]??J.format}`}case"not_multiple_of":return`Μη έγκυρος αριθμός: πρέπει να είναι πολλαπλάσιο του ${J.divisor}`;case"unrecognized_keys":return`Άγνωστ${J.keys.length>1?"α":"ο"} κλειδ${J.keys.length>1?"ιά":"ί"}: ${L(J.keys,", ")}`;case"invalid_key":return`Μη έγκυρο κλειδί στο ${J.origin}`;case"invalid_union":return"Μη έγκυρη είσοδος";case"invalid_element":return`Μη έγκυρη τιμή στο ${J.origin}`;default:return"Μη έγκυρη είσοδος"}}};function EG(){return{localeError:_L()}}var XL=()=>{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 w(J){return $[J]??null}let U={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"},v={nan:"NaN"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;return`Invalid input: expected ${z}, received ${V}`}case"invalid_value":if(J.values.length===1)return`Invalid input: expected ${K(J.values[0])}`;return`Invalid option: expected one of ${L(J.values,"|")}`;case"too_big":{let z=J.inclusive?"<=":"<",g=w(J.origin);if(g)return`Too big: expected ${J.origin??"value"} to have ${z}${J.maximum.toString()} ${g.unit??"elements"}`;return`Too big: expected ${J.origin??"value"} to be ${z}${J.maximum.toString()}`}case"too_small":{let z=J.inclusive?">=":">",g=w(J.origin);if(g)return`Too small: expected ${J.origin} to have ${z}${J.minimum.toString()} ${g.unit}`;return`Too small: expected ${J.origin} to be ${z}${J.minimum.toString()}`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`Invalid string: must start with "${z.prefix}"`;if(z.format==="ends_with")return`Invalid string: must end with "${z.suffix}"`;if(z.format==="includes")return`Invalid string: must include "${z.includes}"`;if(z.format==="regex")return`Invalid string: must match pattern ${z.pattern}`;return`Invalid ${U[z.format]??J.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${J.divisor}`;case"unrecognized_keys":return`Unrecognized key${J.keys.length>1?"s":""}: ${L(J.keys,", ")}`;case"invalid_key":return`Invalid key in ${J.origin}`;case"invalid_union":if(J.options&&Array.isArray(J.options)&&J.options.length>0)return`Invalid discriminator value. Expected ${J.options.map((g)=>`'${g}'`).join(" | ")}`;return"Invalid input";case"invalid_element":return`Invalid value in ${J.origin}`;default:return"Invalid input"}}};function vJ(){return{localeError:XL()}}var IL=()=>{let $={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function w(J){return $[J]??null}let U={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"},v={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(/^[A-Z]/.test(J.expected))return`Nevalida enigo: atendiĝis instanceof ${J.expected}, riceviĝis ${V}`;return`Nevalida enigo: atendiĝis ${z}, riceviĝis ${V}`}case"invalid_value":if(J.values.length===1)return`Nevalida enigo: atendiĝis ${K(J.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${L(J.values,"|")}`;case"too_big":{let z=J.inclusive?"<=":"<",g=w(J.origin);if(g)return`Tro granda: atendiĝis ke ${J.origin??"valoro"} havu ${z}${J.maximum.toString()} ${g.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${J.origin??"valoro"} havu ${z}${J.maximum.toString()}`}case"too_small":{let z=J.inclusive?">=":">",g=w(J.origin);if(g)return`Tro malgranda: atendiĝis ke ${J.origin} havu ${z}${J.minimum.toString()} ${g.unit}`;return`Tro malgranda: atendiĝis ke ${J.origin} estu ${z}${J.minimum.toString()}`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${z.prefix}"`;if(z.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${z.suffix}"`;if(z.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${z.includes}"`;if(z.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${z.pattern}`;return`Nevalida ${U[z.format]??J.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${J.divisor}`;case"unrecognized_keys":return`Nekonata${J.keys.length>1?"j":""} ŝlosilo${J.keys.length>1?"j":""}: ${L(J.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${J.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${J.origin}`;default:return"Nevalida enigo"}}};function SG(){return{localeError:IL()}}var NL=()=>{let $={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function w(J){return $[J]??null}let U={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"},v={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(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(/^[A-Z]/.test(J.expected))return`Entrada inválida: se esperaba instanceof ${J.expected}, recibido ${V}`;return`Entrada inválida: se esperaba ${z}, recibido ${V}`}case"invalid_value":if(J.values.length===1)return`Entrada inválida: se esperaba ${K(J.values[0])}`;return`Opción inválida: se esperaba una de ${L(J.values,"|")}`;case"too_big":{let z=J.inclusive?"<=":"<",g=w(J.origin),V=v[J.origin]??J.origin;if(g)return`Demasiado grande: se esperaba que ${V??"valor"} tuviera ${z}${J.maximum.toString()} ${g.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${V??"valor"} fuera ${z}${J.maximum.toString()}`}case"too_small":{let z=J.inclusive?">=":">",g=w(J.origin),V=v[J.origin]??J.origin;if(g)return`Demasiado pequeño: se esperaba que ${V} tuviera ${z}${J.minimum.toString()} ${g.unit}`;return`Demasiado pequeño: se esperaba que ${V} fuera ${z}${J.minimum.toString()}`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`Cadena inválida: debe comenzar con "${z.prefix}"`;if(z.format==="ends_with")return`Cadena inválida: debe terminar en "${z.suffix}"`;if(z.format==="includes")return`Cadena inválida: debe incluir "${z.includes}"`;if(z.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${z.pattern}`;return`Inválido ${U[z.format]??J.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${J.divisor}`;case"unrecognized_keys":return`Llave${J.keys.length>1?"s":""} desconocida${J.keys.length>1?"s":""}: ${L(J.keys,", ")}`;case"invalid_key":return`Llave inválida en ${v[J.origin]??J.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${v[J.origin]??J.origin}`;default:return"Entrada inválida"}}};function AG(){return{localeError:NL()}}var WL=()=>{let $={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function w(J){return $[J]??null}let U={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:"ورودی"},v={nan:"NaN",number:"عدد",array:"آرایه"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(/^[A-Z]/.test(J.expected))return`ورودی نامعتبر: میبایست instanceof ${J.expected} میبود، ${V} دریافت شد`;return`ورودی نامعتبر: میبایست ${z} میبود، ${V} دریافت شد`}case"invalid_value":if(J.values.length===1)return`ورودی نامعتبر: میبایست ${K(J.values[0])} میبود`;return`گزینه نامعتبر: میبایست یکی از ${L(J.values,"|")} میبود`;case"too_big":{let z=J.inclusive?"<=":"<",g=w(J.origin);if(g)return`خیلی بزرگ: ${J.origin??"مقدار"} باید ${z}${J.maximum.toString()} ${g.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${J.origin??"مقدار"} باید ${z}${J.maximum.toString()} باشد`}case"too_small":{let z=J.inclusive?">=":">",g=w(J.origin);if(g)return`خیلی کوچک: ${J.origin} باید ${z}${J.minimum.toString()} ${g.unit} باشد`;return`خیلی کوچک: ${J.origin} باید ${z}${J.minimum.toString()} باشد`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`رشته نامعتبر: باید با "${z.prefix}" شروع شود`;if(z.format==="ends_with")return`رشته نامعتبر: باید با "${z.suffix}" تمام شود`;if(z.format==="includes")return`رشته نامعتبر: باید شامل "${z.includes}" باشد`;if(z.format==="regex")return`رشته نامعتبر: باید با الگوی ${z.pattern} مطابقت داشته باشد`;return`${U[z.format]??J.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${J.divisor} باشد`;case"unrecognized_keys":return`کلید${J.keys.length>1?"های":""} ناشناس: ${L(J.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${J.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${J.origin}`;default:return"ورودی نامعتبر"}}};function RG(){return{localeError:WL()}}var YL=()=>{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 w(J){return $[J]??null}let U={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"},v={nan:"NaN"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(/^[A-Z]/.test(J.expected))return`Virheellinen tyyppi: odotettiin instanceof ${J.expected}, oli ${V}`;return`Virheellinen tyyppi: odotettiin ${z}, oli ${V}`}case"invalid_value":if(J.values.length===1)return`Virheellinen syöte: täytyy olla ${K(J.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${L(J.values,"|")}`;case"too_big":{let z=J.inclusive?"<=":"<",g=w(J.origin);if(g)return`Liian suuri: ${g.subject} täytyy olla ${z}${J.maximum.toString()} ${g.unit}`.trim();return`Liian suuri: arvon täytyy olla ${z}${J.maximum.toString()}`}case"too_small":{let z=J.inclusive?">=":">",g=w(J.origin);if(g)return`Liian pieni: ${g.subject} täytyy olla ${z}${J.minimum.toString()} ${g.unit}`.trim();return`Liian pieni: arvon täytyy olla ${z}${J.minimum.toString()}`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${z.prefix}"`;if(z.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${z.suffix}"`;if(z.format==="includes")return`Virheellinen syöte: täytyy sisältää "${z.includes}"`;if(z.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${z.pattern}`;return`Virheellinen ${U[z.format]??J.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${J.divisor} monikerta`;case"unrecognized_keys":return`${J.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${L(J.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 kG(){return{localeError:YL()}}var QL=()=>{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 w(J){return $[J]??null}let U={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"},v={string:"chaîne",number:"nombre",int:"entier",boolean:"booléen",bigint:"grand entier",symbol:"symbole",undefined:"indéfini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(/^[A-Z]/.test(J.expected))return`Entrée invalide : instanceof ${J.expected} attendu, ${V} reçu`;return`Entrée invalide : ${z} attendu, ${V} reçu`}case"invalid_value":if(J.values.length===1)return`Entrée invalide : ${K(J.values[0])} attendu`;return`Option invalide : une valeur parmi ${L(J.values,"|")} attendue`;case"too_big":{let z=J.inclusive?"<=":"<",g=w(J.origin);if(g)return`Trop grand : ${v[J.origin]??"valeur"} doit ${g.verb} ${z}${J.maximum.toString()} ${g.unit??"élément(s)"}`;return`Trop grand : ${v[J.origin]??"valeur"} doit être ${z}${J.maximum.toString()}`}case"too_small":{let z=J.inclusive?">=":">",g=w(J.origin);if(g)return`Trop petit : ${v[J.origin]??"valeur"} doit ${g.verb} ${z}${J.minimum.toString()} ${g.unit}`;return`Trop petit : ${v[J.origin]??"valeur"} doit être ${z}${J.minimum.toString()}`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`Chaîne invalide : doit commencer par "${z.prefix}"`;if(z.format==="ends_with")return`Chaîne invalide : doit se terminer par "${z.suffix}"`;if(z.format==="includes")return`Chaîne invalide : doit inclure "${z.includes}"`;if(z.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${z.pattern}`;return`${U[z.format]??J.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${J.divisor}`;case"unrecognized_keys":return`Clé${J.keys.length>1?"s":""} non reconnue${J.keys.length>1?"s":""} : ${L(J.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${J.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${J.origin}`;default:return"Entrée invalide"}}};function CG(){return{localeError:QL()}}var PL=()=>{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 w(J){return $[J]??null}let U={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"},v={nan:"NaN"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(/^[A-Z]/.test(J.expected))return`Entrée invalide : attendu instanceof ${J.expected}, reçu ${V}`;return`Entrée invalide : attendu ${z}, reçu ${V}`}case"invalid_value":if(J.values.length===1)return`Entrée invalide : attendu ${K(J.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${L(J.values,"|")}`;case"too_big":{let z=J.inclusive?"≤":"<",g=w(J.origin);if(g)return`Trop grand : attendu que ${J.origin??"la valeur"} ait ${z}${J.maximum.toString()} ${g.unit}`;return`Trop grand : attendu que ${J.origin??"la valeur"} soit ${z}${J.maximum.toString()}`}case"too_small":{let z=J.inclusive?"≥":">",g=w(J.origin);if(g)return`Trop petit : attendu que ${J.origin} ait ${z}${J.minimum.toString()} ${g.unit}`;return`Trop petit : attendu que ${J.origin} soit ${z}${J.minimum.toString()}`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`Chaîne invalide : doit commencer par "${z.prefix}"`;if(z.format==="ends_with")return`Chaîne invalide : doit se terminer par "${z.suffix}"`;if(z.format==="includes")return`Chaîne invalide : doit inclure "${z.includes}"`;if(z.format==="regex")return`Chaîne invalide : doit correspondre au motif ${z.pattern}`;return`${U[z.format]??J.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${J.divisor}`;case"unrecognized_keys":return`Clé${J.keys.length>1?"s":""} non reconnue${J.keys.length>1?"s":""} : ${L(J.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${J.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${J.origin}`;default:return"Entrée invalide"}}};function jG(){return{localeError:PL()}}var OL=()=>{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"}},w={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},U=(G)=>G?$[G]:void 0,v=(G)=>{let X=U(G);if(X)return X.label;return G??$.unknown.label},J=(G)=>`ה${v(G)}`,z=(G)=>{return(U(G)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות"},g=(G)=>{if(!G)return null;return w[G]??null},V={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"}},_={nan:"NaN"};return(G)=>{switch(G.code){case"invalid_type":{let X=G.expected,I=_[X??""]??v(X),N=D(G.input),W=_[N]??$[N]?.label??N;if(/^[A-Z]/.test(G.expected))return`קלט לא תקין: צריך להיות instanceof ${G.expected}, התקבל ${W}`;return`קלט לא תקין: צריך להיות ${I}, התקבל ${W}`}case"invalid_value":{if(G.values.length===1)return`ערך לא תקין: הערך חייב להיות ${K(G.values[0])}`;let X=G.values.map((W)=>K(W));if(G.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${X[0]} או ${X[1]}`;let I=X[X.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${X.slice(0,-1).join(", ")} או ${I}`}case"too_big":{let X=g(G.origin),I=J(G.origin??"value");if(G.origin==="string")return`${X?.longLabel??"ארוך"} מדי: ${I} צריכה להכיל ${G.maximum.toString()} ${X?.unit??""} ${G.inclusive?"או פחות":"לכל היותר"}`.trim();if(G.origin==="number"){let P=G.inclusive?`קטן או שווה ל-${G.maximum}`:`קטן מ-${G.maximum}`;return`גדול מדי: ${I} צריך להיות ${P}`}if(G.origin==="array"||G.origin==="set"){let P=G.origin==="set"?"צריכה":"צריך",Q=G.inclusive?`${G.maximum} ${X?.unit??""} או פחות`:`פחות מ-${G.maximum} ${X?.unit??""}`;return`גדול מדי: ${I} ${P} להכיל ${Q}`.trim()}let N=G.inclusive?"<=":"<",W=z(G.origin??"value");if(X?.unit)return`${X.longLabel} מדי: ${I} ${W} ${N}${G.maximum.toString()} ${X.unit}`;return`${X?.longLabel??"גדול"} מדי: ${I} ${W} ${N}${G.maximum.toString()}`}case"too_small":{let X=g(G.origin),I=J(G.origin??"value");if(G.origin==="string")return`${X?.shortLabel??"קצר"} מדי: ${I} צריכה להכיל ${G.minimum.toString()} ${X?.unit??""} ${G.inclusive?"או יותר":"לפחות"}`.trim();if(G.origin==="number"){let P=G.inclusive?`גדול או שווה ל-${G.minimum}`:`גדול מ-${G.minimum}`;return`קטן מדי: ${I} צריך להיות ${P}`}if(G.origin==="array"||G.origin==="set"){let P=G.origin==="set"?"צריכה":"צריך";if(G.minimum===1&&G.inclusive){let H=G.origin==="set"?"לפחות פריט אחד":"לפחות פריט אחד";return`קטן מדי: ${I} ${P} להכיל ${H}`}let Q=G.inclusive?`${G.minimum} ${X?.unit??""} או יותר`:`יותר מ-${G.minimum} ${X?.unit??""}`;return`קטן מדי: ${I} ${P} להכיל ${Q}`.trim()}let N=G.inclusive?">=":">",W=z(G.origin??"value");if(X?.unit)return`${X.shortLabel} מדי: ${I} ${W} ${N}${G.minimum.toString()} ${X.unit}`;return`${X?.shortLabel??"קטן"} מדי: ${I} ${W} ${N}${G.minimum.toString()}`}case"invalid_format":{let X=G;if(X.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${X.prefix}"`;if(X.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${X.suffix}"`;if(X.format==="includes")return`המחרוזת חייבת לכלול "${X.includes}"`;if(X.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${X.pattern}`;let I=V[X.format],N=I?.label??X.format,P=(I?.gender??"m")==="f"?"תקינה":"תקין";return`${N} לא ${P}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${G.divisor}`;case"unrecognized_keys":return`מפתח${G.keys.length>1?"ות":""} לא מזוה${G.keys.length>1?"ים":"ה"}: ${L(G.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${J(G.origin??"array")}`;default:return"קלט לא תקין"}}};function xG(){return{localeError:OL()}}var BL=()=>{let $={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function w(J){return $[J]??null}let U={regex:"unos",email:"email 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:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},v={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(/^[A-Z]/.test(J.expected))return`Neispravan unos: očekuje se instanceof ${J.expected}, a primljeno je ${V}`;return`Neispravan unos: očekuje se ${z}, a primljeno je ${V}`}case"invalid_value":if(J.values.length===1)return`Neispravna vrijednost: očekivano ${K(J.values[0])}`;return`Neispravna opcija: očekivano jedno od ${L(J.values,"|")}`;case"too_big":{let z=J.inclusive?"<=":"<",g=w(J.origin),V=v[J.origin]??J.origin;if(g)return`Preveliko: očekivano da ${V??"vrijednost"} ima ${z}${J.maximum.toString()} ${g.unit??"elemenata"}`;return`Preveliko: očekivano da ${V??"vrijednost"} bude ${z}${J.maximum.toString()}`}case"too_small":{let z=J.inclusive?">=":">",g=w(J.origin),V=v[J.origin]??J.origin;if(g)return`Premalo: očekivano da ${V} ima ${z}${J.minimum.toString()} ${g.unit}`;return`Premalo: očekivano da ${V} bude ${z}${J.minimum.toString()}`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`Neispravan tekst: mora započinjati s "${z.prefix}"`;if(z.format==="ends_with")return`Neispravan tekst: mora završavati s "${z.suffix}"`;if(z.format==="includes")return`Neispravan tekst: mora sadržavati "${z.includes}"`;if(z.format==="regex")return`Neispravan tekst: mora odgovarati uzorku ${z.pattern}`;return`Neispravna ${U[z.format]??J.format}`}case"not_multiple_of":return`Neispravan broj: mora biti višekratnik od ${J.divisor}`;case"unrecognized_keys":return`Neprepoznat${J.keys.length>1?"i ključevi":" ključ"}: ${L(J.keys,", ")}`;case"invalid_key":return`Neispravan ključ u ${v[J.origin]??J.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${v[J.origin]??J.origin}`;default:return"Neispravan unos"}}};function rG(){return{localeError:BL()}}var qL=()=>{let $={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function w(J){return $[J]??null}let U={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"},v={nan:"NaN",number:"szám",array:"tömb"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(/^[A-Z]/.test(J.expected))return`Érvénytelen bemenet: a várt érték instanceof ${J.expected}, a kapott érték ${V}`;return`Érvénytelen bemenet: a várt érték ${z}, a kapott érték ${V}`}case"invalid_value":if(J.values.length===1)return`Érvénytelen bemenet: a várt érték ${K(J.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${L(J.values,"|")}`;case"too_big":{let z=J.inclusive?"<=":"<",g=w(J.origin);if(g)return`Túl nagy: ${J.origin??"érték"} mérete túl nagy ${z}${J.maximum.toString()} ${g.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${J.origin??"érték"} túl nagy: ${z}${J.maximum.toString()}`}case"too_small":{let z=J.inclusive?">=":">",g=w(J.origin);if(g)return`Túl kicsi: a bemeneti érték ${J.origin} mérete túl kicsi ${z}${J.minimum.toString()} ${g.unit}`;return`Túl kicsi: a bemeneti érték ${J.origin} túl kicsi ${z}${J.minimum.toString()}`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`Érvénytelen string: "${z.prefix}" értékkel kell kezdődnie`;if(z.format==="ends_with")return`Érvénytelen string: "${z.suffix}" értékkel kell végződnie`;if(z.format==="includes")return`Érvénytelen string: "${z.includes}" értéket kell tartalmaznia`;if(z.format==="regex")return`Érvénytelen string: ${z.pattern} mintának kell megfelelnie`;return`Érvénytelen ${U[z.format]??J.format}`}case"not_multiple_of":return`Érvénytelen szám: ${J.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${J.keys.length>1?"s":""}: ${L(J.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${J.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${J.origin}`;default:return"Érvénytelen bemenet"}}};function yG(){return{localeError:qL()}}function U9($,w,U){return Math.abs($)===1?w:U}function Ew($){if(!$)return"";let w=["ա","ե","ը","ի","ո","ու","օ"],U=$[$.length-1];return $+(w.includes(U)?"ն":"ը")}var LL=()=>{let $={string:{unit:{one:"նշան",many:"նշաններ"},verb:"ունենալ"},file:{unit:{one:"բայթ",many:"բայթեր"},verb:"ունենալ"},array:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"},set:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"}};function w(J){return $[J]??null}let U={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:"մուտք"},v={nan:"NaN",number:"թիվ",array:"զանգված"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(/^[A-Z]/.test(J.expected))return`Սխալ մուտքագրում․ սպասվում էր instanceof ${J.expected}, ստացվել է ${V}`;return`Սխալ մուտքագրում․ սպասվում էր ${z}, ստացվել է ${V}`}case"invalid_value":if(J.values.length===1)return`Սխալ մուտքագրում․ սպասվում էր ${K(J.values[1])}`;return`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${L(J.values,"|")}`;case"too_big":{let z=J.inclusive?"<=":"<",g=w(J.origin);if(g){let V=Number(J.maximum),_=U9(V,g.unit.one,g.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${Ew(J.origin??"արժեք")} կունենա ${z}${J.maximum.toString()} ${_}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${Ew(J.origin??"արժեք")} լինի ${z}${J.maximum.toString()}`}case"too_small":{let z=J.inclusive?">=":">",g=w(J.origin);if(g){let V=Number(J.minimum),_=U9(V,g.unit.one,g.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${Ew(J.origin)} կունենա ${z}${J.minimum.toString()} ${_}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${Ew(J.origin)} լինի ${z}${J.minimum.toString()}`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`Սխալ տող․ պետք է սկսվի "${z.prefix}"-ով`;if(z.format==="ends_with")return`Սխալ տող․ պետք է ավարտվի "${z.suffix}"-ով`;if(z.format==="includes")return`Սխալ տող․ պետք է պարունակի "${z.includes}"`;if(z.format==="regex")return`Սխալ տող․ պետք է համապատասխանի ${z.pattern} ձևաչափին`;return`Սխալ ${U[z.format]??J.format}`}case"not_multiple_of":return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${J.divisor}-ի`;case"unrecognized_keys":return`Չճանաչված բանալի${J.keys.length>1?"ներ":""}. ${L(J.keys,", ")}`;case"invalid_key":return`Սխալ բանալի ${Ew(J.origin)}-ում`;case"invalid_union":return"Սխալ մուտքագրում";case"invalid_element":return`Սխալ արժեք ${Ew(J.origin)}-ում`;default:return"Սխալ մուտքագրում"}}};function dG(){return{localeError:LL()}}var HL=()=>{let $={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function w(J){return $[J]??null}let U={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"},v={nan:"NaN"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(/^[A-Z]/.test(J.expected))return`Input tidak valid: diharapkan instanceof ${J.expected}, diterima ${V}`;return`Input tidak valid: diharapkan ${z}, diterima ${V}`}case"invalid_value":if(J.values.length===1)return`Input tidak valid: diharapkan ${K(J.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${L(J.values,"|")}`;case"too_big":{let z=J.inclusive?"<=":"<",g=w(J.origin);if(g)return`Terlalu besar: diharapkan ${J.origin??"value"} memiliki ${z}${J.maximum.toString()} ${g.unit??"elemen"}`;return`Terlalu besar: diharapkan ${J.origin??"value"} menjadi ${z}${J.maximum.toString()}`}case"too_small":{let z=J.inclusive?">=":">",g=w(J.origin);if(g)return`Terlalu kecil: diharapkan ${J.origin} memiliki ${z}${J.minimum.toString()} ${g.unit}`;return`Terlalu kecil: diharapkan ${J.origin} menjadi ${z}${J.minimum.toString()}`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`String tidak valid: harus dimulai dengan "${z.prefix}"`;if(z.format==="ends_with")return`String tidak valid: harus berakhir dengan "${z.suffix}"`;if(z.format==="includes")return`String tidak valid: harus menyertakan "${z.includes}"`;if(z.format==="regex")return`String tidak valid: harus sesuai pola ${z.pattern}`;return`${U[z.format]??J.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${J.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${J.keys.length>1?"s":""}: ${L(J.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${J.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${J.origin}`;default:return"Input tidak valid"}}};function mG(){return{localeError:HL()}}var uL=()=>{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 w(J){return $[J]??null}let U={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"},v={nan:"NaN",number:"númer",array:"fylki"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(/^[A-Z]/.test(J.expected))return`Rangt gildi: Þú slóst inn ${V} þar sem á að vera instanceof ${J.expected}`;return`Rangt gildi: Þú slóst inn ${V} þar sem á að vera ${z}`}case"invalid_value":if(J.values.length===1)return`Rangt gildi: gert ráð fyrir ${K(J.values[0])}`;return`Ógilt val: má vera eitt af eftirfarandi ${L(J.values,"|")}`;case"too_big":{let z=J.inclusive?"<=":"<",g=w(J.origin);if(g)return`Of stórt: gert er ráð fyrir að ${J.origin??"gildi"} hafi ${z}${J.maximum.toString()} ${g.unit??"hluti"}`;return`Of stórt: gert er ráð fyrir að ${J.origin??"gildi"} sé ${z}${J.maximum.toString()}`}case"too_small":{let z=J.inclusive?">=":">",g=w(J.origin);if(g)return`Of lítið: gert er ráð fyrir að ${J.origin} hafi ${z}${J.minimum.toString()} ${g.unit}`;return`Of lítið: gert er ráð fyrir að ${J.origin} sé ${z}${J.minimum.toString()}`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`Ógildur strengur: verður að byrja á "${z.prefix}"`;if(z.format==="ends_with")return`Ógildur strengur: verður að enda á "${z.suffix}"`;if(z.format==="includes")return`Ógildur strengur: verður að innihalda "${z.includes}"`;if(z.format==="regex")return`Ógildur strengur: verður að fylgja mynstri ${z.pattern}`;return`Rangt ${U[z.format]??J.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${J.divisor}`;case"unrecognized_keys":return`Óþekkt ${J.keys.length>1?"ir lyklar":"ur lykill"}: ${L(J.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${J.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${J.origin}`;default:return"Rangt gildi"}}};function nG(){return{localeError:uL()}}var KL=()=>{let $={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function w(J){return $[J]??null}let U={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"},v={nan:"NaN",number:"numero",array:"vettore"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(/^[A-Z]/.test(J.expected))return`Input non valido: atteso instanceof ${J.expected}, ricevuto ${V}`;return`Input non valido: atteso ${z}, ricevuto ${V}`}case"invalid_value":if(J.values.length===1)return`Input non valido: atteso ${K(J.values[0])}`;return`Opzione non valida: atteso uno tra ${L(J.values,"|")}`;case"too_big":{let z=J.inclusive?"<=":"<",g=w(J.origin);if(g)return`Troppo grande: ${J.origin??"valore"} deve avere ${z}${J.maximum.toString()} ${g.unit??"elementi"}`;return`Troppo grande: ${J.origin??"valore"} deve essere ${z}${J.maximum.toString()}`}case"too_small":{let z=J.inclusive?">=":">",g=w(J.origin);if(g)return`Troppo piccolo: ${J.origin} deve avere ${z}${J.minimum.toString()} ${g.unit}`;return`Troppo piccolo: ${J.origin} deve essere ${z}${J.minimum.toString()}`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`Stringa non valida: deve iniziare con "${z.prefix}"`;if(z.format==="ends_with")return`Stringa non valida: deve terminare con "${z.suffix}"`;if(z.format==="includes")return`Stringa non valida: deve includere "${z.includes}"`;if(z.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${z.pattern}`;return`Input non valido: ${U[z.format]??J.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${J.divisor}`;case"unrecognized_keys":return`Chiav${J.keys.length>1?"i":"e"} non riconosciut${J.keys.length>1?"e":"a"}: ${L(J.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${J.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${J.origin}`;default:return"Input non valido"}}};function hG(){return{localeError:KL()}}var DL=()=>{let $={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function w(J){return $[J]??null}let U={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:"入力値"},v={nan:"NaN",number:"数値",array:"配列"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(/^[A-Z]/.test(J.expected))return`無効な入力: instanceof ${J.expected}が期待されましたが、${V}が入力されました`;return`無効な入力: ${z}が期待されましたが、${V}が入力されました`}case"invalid_value":if(J.values.length===1)return`無効な入力: ${K(J.values[0])}が期待されました`;return`無効な選択: ${L(J.values,"、")}のいずれかである必要があります`;case"too_big":{let z=J.inclusive?"以下である":"より小さい",g=w(J.origin);if(g)return`大きすぎる値: ${J.origin??"値"}は${J.maximum.toString()}${g.unit??"要素"}${z}必要があります`;return`大きすぎる値: ${J.origin??"値"}は${J.maximum.toString()}${z}必要があります`}case"too_small":{let z=J.inclusive?"以上である":"より大きい",g=w(J.origin);if(g)return`小さすぎる値: ${J.origin}は${J.minimum.toString()}${g.unit}${z}必要があります`;return`小さすぎる値: ${J.origin}は${J.minimum.toString()}${z}必要があります`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`無効な文字列: "${z.prefix}"で始まる必要があります`;if(z.format==="ends_with")return`無効な文字列: "${z.suffix}"で終わる必要があります`;if(z.format==="includes")return`無効な文字列: "${z.includes}"を含む必要があります`;if(z.format==="regex")return`無効な文字列: パターン${z.pattern}に一致する必要があります`;return`無効な${U[z.format]??J.format}`}case"not_multiple_of":return`無効な数値: ${J.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${J.keys.length>1?"群":""}: ${L(J.keys,"、")}`;case"invalid_key":return`${J.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${J.origin}内の無効な値`;default:return"無効な入力"}}};function cG(){return{localeError:DL()}}var fL=()=>{let $={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function w(J){return $[J]??null}let U={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:"შეყვანა"},v={nan:"NaN",number:"რიცხვი",string:"ველი",boolean:"ბულეანი",function:"ფუნქცია",array:"მასივი"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(/^[A-Z]/.test(J.expected))return`არასწორი შეყვანა: მოსალოდნელი instanceof ${J.expected}, მიღებული ${V}`;return`არასწორი შეყვანა: მოსალოდნელი ${z}, მიღებული ${V}`}case"invalid_value":if(J.values.length===1)return`არასწორი შეყვანა: მოსალოდნელი ${K(J.values[0])}`;return`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${L(J.values,"|")}-დან`;case"too_big":{let z=J.inclusive?"<=":"<",g=w(J.origin);if(g)return`ზედმეტად დიდი: მოსალოდნელი ${J.origin??"მნიშვნელობა"} ${g.verb} ${z}${J.maximum.toString()} ${g.unit}`;return`ზედმეტად დიდი: მოსალოდნელი ${J.origin??"მნიშვნელობა"} იყოს ${z}${J.maximum.toString()}`}case"too_small":{let z=J.inclusive?">=":">",g=w(J.origin);if(g)return`ზედმეტად პატარა: მოსალოდნელი ${J.origin} ${g.verb} ${z}${J.minimum.toString()} ${g.unit}`;return`ზედმეტად პატარა: მოსალოდნელი ${J.origin} იყოს ${z}${J.minimum.toString()}`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`არასწორი ველი: უნდა იწყებოდეს "${z.prefix}"-ით`;if(z.format==="ends_with")return`არასწორი ველი: უნდა მთავრდებოდეს "${z.suffix}"-ით`;if(z.format==="includes")return`არასწორი ველი: უნდა შეიცავდეს "${z.includes}"-ს`;if(z.format==="regex")return`არასწორი ველი: უნდა შეესაბამებოდეს შაბლონს ${z.pattern}`;return`არასწორი ${U[z.format]??J.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${J.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${J.keys.length>1?"ები":"ი"}: ${L(J.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${J.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${J.origin}-ში`;default:return"არასწორი შეყვანა"}}};function lG(){return{localeError:fL()}}var TL=()=>{let $={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function w(J){return $[J]??null}let U={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:"ទិន្នន័យបញ្ចូល"},v={nan:"NaN",number:"លេខ",array:"អារេ (Array)",null:"គ្មានតម្លៃ (null)"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(/^[A-Z]/.test(J.expected))return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${J.expected} ប៉ុន្តែទទួលបាន ${V}`;return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${z} ប៉ុន្តែទទួលបាន ${V}`}case"invalid_value":if(J.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${K(J.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${L(J.values,"|")}`;case"too_big":{let z=J.inclusive?"<=":"<",g=w(J.origin);if(g)return`ធំពេក៖ ត្រូវការ ${J.origin??"តម្លៃ"} ${z} ${J.maximum.toString()} ${g.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${J.origin??"តម្លៃ"} ${z} ${J.maximum.toString()}`}case"too_small":{let z=J.inclusive?">=":">",g=w(J.origin);if(g)return`តូចពេក៖ ត្រូវការ ${J.origin} ${z} ${J.minimum.toString()} ${g.unit}`;return`តូចពេក៖ ត្រូវការ ${J.origin} ${z} ${J.minimum.toString()}`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${z.prefix}"`;if(z.format==="ends_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${z.suffix}"`;if(z.format==="includes")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${z.includes}"`;if(z.format==="regex")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${z.pattern}`;return`មិនត្រឹមត្រូវ៖ ${U[z.format]??J.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${J.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${L(J.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${J.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${J.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function zJ(){return{localeError:TL()}}function tG(){return zJ()}var ZL=()=>{let $={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function w(J){return $[J]??null}let U={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:"입력"},v={nan:"NaN"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(/^[A-Z]/.test(J.expected))return`잘못된 입력: 예상 타입은 instanceof ${J.expected}, 받은 타입은 ${V}입니다`;return`잘못된 입력: 예상 타입은 ${z}, 받은 타입은 ${V}입니다`}case"invalid_value":if(J.values.length===1)return`잘못된 입력: 값은 ${K(J.values[0])} 이어야 합니다`;return`잘못된 옵션: ${L(J.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let z=J.inclusive?"이하":"미만",g=z==="미만"?"이어야 합니다":"여야 합니다",V=w(J.origin),_=V?.unit??"요소";if(V)return`${J.origin??"값"}이 너무 큽니다: ${J.maximum.toString()}${_} ${z}${g}`;return`${J.origin??"값"}이 너무 큽니다: ${J.maximum.toString()} ${z}${g}`}case"too_small":{let z=J.inclusive?"이상":"초과",g=z==="이상"?"이어야 합니다":"여야 합니다",V=w(J.origin),_=V?.unit??"요소";if(V)return`${J.origin??"값"}이 너무 작습니다: ${J.minimum.toString()}${_} ${z}${g}`;return`${J.origin??"값"}이 너무 작습니다: ${J.minimum.toString()} ${z}${g}`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`잘못된 문자열: "${z.prefix}"(으)로 시작해야 합니다`;if(z.format==="ends_with")return`잘못된 문자열: "${z.suffix}"(으)로 끝나야 합니다`;if(z.format==="includes")return`잘못된 문자열: "${z.includes}"을(를) 포함해야 합니다`;if(z.format==="regex")return`잘못된 문자열: 정규식 ${z.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${U[z.format]??J.format}`}case"not_multiple_of":return`잘못된 숫자: ${J.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${L(J.keys,", ")}`;case"invalid_key":return`잘못된 키: ${J.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${J.origin}`;default:return"잘못된 입력"}}};function oG(){return{localeError:ZL()}}var gJ=($)=>{return $.charAt(0).toUpperCase()+$.slice(1)};function J9($){let w=Math.abs($),U=w%10,v=w%100;if(v>=11&&v<=19||U===0)return"many";if(U===1)return"one";return"few"}var bL=()=>{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 w(J,z,g,V){let _=$[J]??null;if(_===null)return _;return{unit:_.unit[z],verb:_.verb[V][g?"inclusive":"notInclusive"]}}let U={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"},v={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(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(/^[A-Z]/.test(J.expected))return`Gautas tipas ${V}, o tikėtasi - instanceof ${J.expected}`;return`Gautas tipas ${V}, o tikėtasi - ${z}`}case"invalid_value":if(J.values.length===1)return`Privalo būti ${K(J.values[0])}`;return`Privalo būti vienas iš ${L(J.values,"|")} pasirinkimų`;case"too_big":{let z=v[J.origin]??J.origin,g=w(J.origin,J9(Number(J.maximum)),J.inclusive??!1,"smaller");if(g?.verb)return`${gJ(z??J.origin??"reikšmė")} ${g.verb} ${J.maximum.toString()} ${g.unit??"elementų"}`;let V=J.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${gJ(z??J.origin??"reikšmė")} turi būti ${V} ${J.maximum.toString()} ${g?.unit}`}case"too_small":{let z=v[J.origin]??J.origin,g=w(J.origin,J9(Number(J.minimum)),J.inclusive??!1,"bigger");if(g?.verb)return`${gJ(z??J.origin??"reikšmė")} ${g.verb} ${J.minimum.toString()} ${g.unit??"elementų"}`;let V=J.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${gJ(z??J.origin??"reikšmė")} turi būti ${V} ${J.minimum.toString()} ${g?.unit}`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`Eilutė privalo prasidėti "${z.prefix}"`;if(z.format==="ends_with")return`Eilutė privalo pasibaigti "${z.suffix}"`;if(z.format==="includes")return`Eilutė privalo įtraukti "${z.includes}"`;if(z.format==="regex")return`Eilutė privalo atitikti ${z.pattern}`;return`Neteisingas ${U[z.format]??J.format}`}case"not_multiple_of":return`Skaičius privalo būti ${J.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${J.keys.length>1?"i":"as"} rakt${J.keys.length>1?"ai":"as"}: ${L(J.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let z=v[J.origin]??J.origin;return`${gJ(z??J.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function pG(){return{localeError:bL()}}var FL=()=>{let $={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function w(J){return $[J]??null}let U={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:"внес"},v={nan:"NaN",number:"број",array:"низа"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(/^[A-Z]/.test(J.expected))return`Грешен внес: се очекува instanceof ${J.expected}, примено ${V}`;return`Грешен внес: се очекува ${z}, примено ${V}`}case"invalid_value":if(J.values.length===1)return`Invalid input: expected ${K(J.values[0])}`;return`Грешана опција: се очекува една ${L(J.values,"|")}`;case"too_big":{let z=J.inclusive?"<=":"<",g=w(J.origin);if(g)return`Премногу голем: се очекува ${J.origin??"вредноста"} да има ${z}${J.maximum.toString()} ${g.unit??"елементи"}`;return`Премногу голем: се очекува ${J.origin??"вредноста"} да биде ${z}${J.maximum.toString()}`}case"too_small":{let z=J.inclusive?">=":">",g=w(J.origin);if(g)return`Премногу мал: се очекува ${J.origin} да има ${z}${J.minimum.toString()} ${g.unit}`;return`Премногу мал: се очекува ${J.origin} да биде ${z}${J.minimum.toString()}`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`Неважечка низа: мора да започнува со "${z.prefix}"`;if(z.format==="ends_with")return`Неважечка низа: мора да завршува со "${z.suffix}"`;if(z.format==="includes")return`Неважечка низа: мора да вклучува "${z.includes}"`;if(z.format==="regex")return`Неважечка низа: мора да одгоара на патернот ${z.pattern}`;return`Invalid ${U[z.format]??J.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${J.divisor}`;case"unrecognized_keys":return`${J.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${L(J.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${J.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${J.origin}`;default:return"Грешен внес"}}};function aG(){return{localeError:FL()}}var ML=()=>{let $={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function w(J){return $[J]??null}let U={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"},v={nan:"NaN",number:"nombor"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(/^[A-Z]/.test(J.expected))return`Input tidak sah: dijangka instanceof ${J.expected}, diterima ${V}`;return`Input tidak sah: dijangka ${z}, diterima ${V}`}case"invalid_value":if(J.values.length===1)return`Input tidak sah: dijangka ${K(J.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${L(J.values,"|")}`;case"too_big":{let z=J.inclusive?"<=":"<",g=w(J.origin);if(g)return`Terlalu besar: dijangka ${J.origin??"nilai"} ${g.verb} ${z}${J.maximum.toString()} ${g.unit??"elemen"}`;return`Terlalu besar: dijangka ${J.origin??"nilai"} adalah ${z}${J.maximum.toString()}`}case"too_small":{let z=J.inclusive?">=":">",g=w(J.origin);if(g)return`Terlalu kecil: dijangka ${J.origin} ${g.verb} ${z}${J.minimum.toString()} ${g.unit}`;return`Terlalu kecil: dijangka ${J.origin} adalah ${z}${J.minimum.toString()}`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`String tidak sah: mesti bermula dengan "${z.prefix}"`;if(z.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${z.suffix}"`;if(z.format==="includes")return`String tidak sah: mesti mengandungi "${z.includes}"`;if(z.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${z.pattern}`;return`${U[z.format]??J.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${J.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${L(J.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${J.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${J.origin}`;default:return"Input tidak sah"}}};function eG(){return{localeError:ML()}}var iL=()=>{let $={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function w(J){return $[J]??null}let U={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"},v={nan:"NaN",number:"getal"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(/^[A-Z]/.test(J.expected))return`Ongeldige invoer: verwacht instanceof ${J.expected}, ontving ${V}`;return`Ongeldige invoer: verwacht ${z}, ontving ${V}`}case"invalid_value":if(J.values.length===1)return`Ongeldige invoer: verwacht ${K(J.values[0])}`;return`Ongeldige optie: verwacht één van ${L(J.values,"|")}`;case"too_big":{let z=J.inclusive?"<=":"<",g=w(J.origin),V=J.origin==="date"?"laat":J.origin==="string"?"lang":"groot";if(g)return`Te ${V}: verwacht dat ${J.origin??"waarde"} ${z}${J.maximum.toString()} ${g.unit??"elementen"} ${g.verb}`;return`Te ${V}: verwacht dat ${J.origin??"waarde"} ${z}${J.maximum.toString()} is`}case"too_small":{let z=J.inclusive?">=":">",g=w(J.origin),V=J.origin==="date"?"vroeg":J.origin==="string"?"kort":"klein";if(g)return`Te ${V}: verwacht dat ${J.origin} ${z}${J.minimum.toString()} ${g.unit} ${g.verb}`;return`Te ${V}: verwacht dat ${J.origin} ${z}${J.minimum.toString()} is`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`Ongeldige tekst: moet met "${z.prefix}" beginnen`;if(z.format==="ends_with")return`Ongeldige tekst: moet op "${z.suffix}" eindigen`;if(z.format==="includes")return`Ongeldige tekst: moet "${z.includes}" bevatten`;if(z.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${z.pattern}`;return`Ongeldig: ${U[z.format]??J.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${J.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${J.keys.length>1?"s":""}: ${L(J.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${J.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${J.origin}`;default:return"Ongeldige invoer"}}};function sG(){return{localeError:iL()}}var EL=()=>{let $={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function w(J){return $[J]??null}let U={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"},v={nan:"NaN",number:"tall",array:"liste"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(/^[A-Z]/.test(J.expected))return`Ugyldig input: forventet instanceof ${J.expected}, fikk ${V}`;return`Ugyldig input: forventet ${z}, fikk ${V}`}case"invalid_value":if(J.values.length===1)return`Ugyldig verdi: forventet ${K(J.values[0])}`;return`Ugyldig valg: forventet en av ${L(J.values,"|")}`;case"too_big":{let z=J.inclusive?"<=":"<",g=w(J.origin);if(g)return`For stor(t): forventet ${J.origin??"value"} til å ha ${z}${J.maximum.toString()} ${g.unit??"elementer"}`;return`For stor(t): forventet ${J.origin??"value"} til å ha ${z}${J.maximum.toString()}`}case"too_small":{let z=J.inclusive?">=":">",g=w(J.origin);if(g)return`For lite(n): forventet ${J.origin} til å ha ${z}${J.minimum.toString()} ${g.unit}`;return`For lite(n): forventet ${J.origin} til å ha ${z}${J.minimum.toString()}`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`Ugyldig streng: må starte med "${z.prefix}"`;if(z.format==="ends_with")return`Ugyldig streng: må ende med "${z.suffix}"`;if(z.format==="includes")return`Ugyldig streng: må inneholde "${z.includes}"`;if(z.format==="regex")return`Ugyldig streng: må matche mønsteret ${z.pattern}`;return`Ugyldig ${U[z.format]??J.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${J.divisor}`;case"unrecognized_keys":return`${J.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${L(J.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${J.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${J.origin}`;default:return"Ugyldig input"}}};function $_(){return{localeError:EL()}}var SL=()=>{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 w(J){return $[J]??null}let U={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"},v={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(/^[A-Z]/.test(J.expected))return`Fâsit giren: umulan instanceof ${J.expected}, alınan ${V}`;return`Fâsit giren: umulan ${z}, alınan ${V}`}case"invalid_value":if(J.values.length===1)return`Fâsit giren: umulan ${K(J.values[0])}`;return`Fâsit tercih: mûteberler ${L(J.values,"|")}`;case"too_big":{let z=J.inclusive?"<=":"<",g=w(J.origin);if(g)return`Fazla büyük: ${J.origin??"value"}, ${z}${J.maximum.toString()} ${g.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${J.origin??"value"}, ${z}${J.maximum.toString()} olmalıydı.`}case"too_small":{let z=J.inclusive?">=":">",g=w(J.origin);if(g)return`Fazla küçük: ${J.origin}, ${z}${J.minimum.toString()} ${g.unit} sahip olmalıydı.`;return`Fazla küçük: ${J.origin}, ${z}${J.minimum.toString()} olmalıydı.`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`Fâsit metin: "${z.prefix}" ile başlamalı.`;if(z.format==="ends_with")return`Fâsit metin: "${z.suffix}" ile bitmeli.`;if(z.format==="includes")return`Fâsit metin: "${z.includes}" ihtivâ etmeli.`;if(z.format==="regex")return`Fâsit metin: ${z.pattern} nakşına uymalı.`;return`Fâsit ${U[z.format]??J.format}`}case"not_multiple_of":return`Fâsit sayı: ${J.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${J.keys.length>1?"s":""}: ${L(J.keys,", ")}`;case"invalid_key":return`${J.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${J.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function w_(){return{localeError:SL()}}var AL=()=>{let $={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function w(J){return $[J]??null}let U={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:"ورودي"},v={nan:"NaN",number:"عدد",array:"ارې"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(/^[A-Z]/.test(J.expected))return`ناسم ورودي: باید instanceof ${J.expected} وای, مګر ${V} ترلاسه شو`;return`ناسم ورودي: باید ${z} وای, مګر ${V} ترلاسه شو`}case"invalid_value":if(J.values.length===1)return`ناسم ورودي: باید ${K(J.values[0])} وای`;return`ناسم انتخاب: باید یو له ${L(J.values,"|")} څخه وای`;case"too_big":{let z=J.inclusive?"<=":"<",g=w(J.origin);if(g)return`ډیر لوی: ${J.origin??"ارزښت"} باید ${z}${J.maximum.toString()} ${g.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${J.origin??"ارزښت"} باید ${z}${J.maximum.toString()} وي`}case"too_small":{let z=J.inclusive?">=":">",g=w(J.origin);if(g)return`ډیر کوچنی: ${J.origin} باید ${z}${J.minimum.toString()} ${g.unit} ولري`;return`ډیر کوچنی: ${J.origin} باید ${z}${J.minimum.toString()} وي`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`ناسم متن: باید د "${z.prefix}" سره پیل شي`;if(z.format==="ends_with")return`ناسم متن: باید د "${z.suffix}" سره پای ته ورسيږي`;if(z.format==="includes")return`ناسم متن: باید "${z.includes}" ولري`;if(z.format==="regex")return`ناسم متن: باید د ${z.pattern} سره مطابقت ولري`;return`${U[z.format]??J.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${J.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${J.keys.length>1?"کلیډونه":"کلیډ"}: ${L(J.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${J.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${J.origin} کې`;default:return"ناسمه ورودي"}}};function U_(){return{localeError:AL()}}var RL=()=>{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 w(J){return $[J]??null}let U={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"},v={nan:"NaN",number:"liczba",array:"tablica"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(/^[A-Z]/.test(J.expected))return`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${J.expected}, otrzymano ${V}`;return`Nieprawidłowe dane wejściowe: oczekiwano ${z}, otrzymano ${V}`}case"invalid_value":if(J.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${K(J.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${L(J.values,"|")}`;case"too_big":{let z=J.inclusive?"<=":"<",g=w(J.origin);if(g)return`Za duża wartość: oczekiwano, że ${J.origin??"wartość"} będzie mieć ${z}${J.maximum.toString()} ${g.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${J.origin??"wartość"} będzie wynosić ${z}${J.maximum.toString()}`}case"too_small":{let z=J.inclusive?">=":">",g=w(J.origin);if(g)return`Za mała wartość: oczekiwano, że ${J.origin??"wartość"} będzie mieć ${z}${J.minimum.toString()} ${g.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${J.origin??"wartość"} będzie wynosić ${z}${J.minimum.toString()}`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${z.prefix}"`;if(z.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${z.suffix}"`;if(z.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${z.includes}"`;if(z.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${z.pattern}`;return`Nieprawidłow(y/a/e) ${U[z.format]??J.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${J.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${J.keys.length>1?"s":""}: ${L(J.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${J.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${J.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function J_(){return{localeError:RL()}}var kL=()=>{let $={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function w(J){return $[J]??null}let U={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"},v={nan:"NaN",number:"número",null:"nulo"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(/^[A-Z]/.test(J.expected))return`Tipo inválido: esperado instanceof ${J.expected}, recebido ${V}`;return`Tipo inválido: esperado ${z}, recebido ${V}`}case"invalid_value":if(J.values.length===1)return`Entrada inválida: esperado ${K(J.values[0])}`;return`Opção inválida: esperada uma das ${L(J.values,"|")}`;case"too_big":{let z=J.inclusive?"<=":"<",g=w(J.origin);if(g)return`Muito grande: esperado que ${J.origin??"valor"} tivesse ${z}${J.maximum.toString()} ${g.unit??"elementos"}`;return`Muito grande: esperado que ${J.origin??"valor"} fosse ${z}${J.maximum.toString()}`}case"too_small":{let z=J.inclusive?">=":">",g=w(J.origin);if(g)return`Muito pequeno: esperado que ${J.origin} tivesse ${z}${J.minimum.toString()} ${g.unit}`;return`Muito pequeno: esperado que ${J.origin} fosse ${z}${J.minimum.toString()}`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`Texto inválido: deve começar com "${z.prefix}"`;if(z.format==="ends_with")return`Texto inválido: deve terminar com "${z.suffix}"`;if(z.format==="includes")return`Texto inválido: deve incluir "${z.includes}"`;if(z.format==="regex")return`Texto inválido: deve corresponder ao padrão ${z.pattern}`;return`${U[z.format]??J.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${J.divisor}`;case"unrecognized_keys":return`Chave${J.keys.length>1?"s":""} desconhecida${J.keys.length>1?"s":""}: ${L(J.keys,", ")}`;case"invalid_key":return`Chave inválida em ${J.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${J.origin}`;default:return"Campo inválido"}}};function v_(){return{localeError:kL()}}var CL=()=>{let $={string:{unit:"caractere",verb:"să aibă"},file:{unit:"octeți",verb:"să aibă"},array:{unit:"elemente",verb:"să aibă"},set:{unit:"elemente",verb:"să aibă"},map:{unit:"intrări",verb:"să aibă"}};function w(J){return $[J]??null}let U={regex:"intrare",email:"adresă de 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:"dată și oră ISO",date:"dată ISO",time:"oră ISO",duration:"durată ISO",ipv4:"adresă IPv4",ipv6:"adresă IPv6",mac:"adresă MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"șir codat base64",base64url:"șir codat base64url",json_string:"șir JSON",e164:"număr E.164",jwt:"JWT",template_literal:"intrare"},v={nan:"NaN",string:"șir",number:"număr",boolean:"boolean",function:"funcție",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"număr mare",void:"void",never:"never",map:"hartă",set:"set"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;return`Intrare invalidă: așteptat ${z}, primit ${V}`}case"invalid_value":if(J.values.length===1)return`Intrare invalidă: așteptat ${K(J.values[0])}`;return`Opțiune invalidă: așteptat una dintre ${L(J.values,"|")}`;case"too_big":{let z=J.inclusive?"<=":"<",g=w(J.origin);if(g)return`Prea mare: așteptat ca ${J.origin??"valoarea"} ${g.verb} ${z}${J.maximum.toString()} ${g.unit??"elemente"}`;return`Prea mare: așteptat ca ${J.origin??"valoarea"} să fie ${z}${J.maximum.toString()}`}case"too_small":{let z=J.inclusive?">=":">",g=w(J.origin);if(g)return`Prea mic: așteptat ca ${J.origin} ${g.verb} ${z}${J.minimum.toString()} ${g.unit}`;return`Prea mic: așteptat ca ${J.origin} să fie ${z}${J.minimum.toString()}`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`Șir invalid: trebuie să înceapă cu "${z.prefix}"`;if(z.format==="ends_with")return`Șir invalid: trebuie să se termine cu "${z.suffix}"`;if(z.format==="includes")return`Șir invalid: trebuie să includă "${z.includes}"`;if(z.format==="regex")return`Șir invalid: trebuie să se potrivească cu modelul ${z.pattern}`;return`Format invalid: ${U[z.format]??J.format}`}case"not_multiple_of":return`Număr invalid: trebuie să fie multiplu de ${J.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${L(J.keys,", ")}`;case"invalid_key":return`Cheie invalidă în ${J.origin}`;case"invalid_union":return"Intrare invalidă";case"invalid_element":return`Valoare invalidă în ${J.origin}`;default:return"Intrare invalidă"}}};function z_(){return{localeError:CL()}}function v9($,w,U,v){let J=Math.abs($),z=J%10,g=J%100;if(g>=11&&g<=19)return v;if(z===1)return w;if(z>=2&&z<=4)return U;return v}var jL=()=>{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 w(J){return $[J]??null}let U={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:"ввод"},v={nan:"NaN",number:"число",array:"массив"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(/^[A-Z]/.test(J.expected))return`Неверный ввод: ожидалось instanceof ${J.expected}, получено ${V}`;return`Неверный ввод: ожидалось ${z}, получено ${V}`}case"invalid_value":if(J.values.length===1)return`Неверный ввод: ожидалось ${K(J.values[0])}`;return`Неверный вариант: ожидалось одно из ${L(J.values,"|")}`;case"too_big":{let z=J.inclusive?"<=":"<",g=w(J.origin);if(g){let V=Number(J.maximum),_=v9(V,g.unit.one,g.unit.few,g.unit.many);return`Слишком большое значение: ожидалось, что ${J.origin??"значение"} будет иметь ${z}${J.maximum.toString()} ${_}`}return`Слишком большое значение: ожидалось, что ${J.origin??"значение"} будет ${z}${J.maximum.toString()}`}case"too_small":{let z=J.inclusive?">=":">",g=w(J.origin);if(g){let V=Number(J.minimum),_=v9(V,g.unit.one,g.unit.few,g.unit.many);return`Слишком маленькое значение: ожидалось, что ${J.origin} будет иметь ${z}${J.minimum.toString()} ${_}`}return`Слишком маленькое значение: ожидалось, что ${J.origin} будет ${z}${J.minimum.toString()}`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`Неверная строка: должна начинаться с "${z.prefix}"`;if(z.format==="ends_with")return`Неверная строка: должна заканчиваться на "${z.suffix}"`;if(z.format==="includes")return`Неверная строка: должна содержать "${z.includes}"`;if(z.format==="regex")return`Неверная строка: должна соответствовать шаблону ${z.pattern}`;return`Неверный ${U[z.format]??J.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${J.divisor}`;case"unrecognized_keys":return`Нераспознанн${J.keys.length>1?"ые":"ый"} ключ${J.keys.length>1?"и":""}: ${L(J.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${J.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${J.origin}`;default:return"Неверные входные данные"}}};function g_(){return{localeError:jL()}}var xL=()=>{let $={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function w(J){return $[J]??null}let U={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"},v={nan:"NaN",number:"število",array:"tabela"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(/^[A-Z]/.test(J.expected))return`Neveljaven vnos: pričakovano instanceof ${J.expected}, prejeto ${V}`;return`Neveljaven vnos: pričakovano ${z}, prejeto ${V}`}case"invalid_value":if(J.values.length===1)return`Neveljaven vnos: pričakovano ${K(J.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${L(J.values,"|")}`;case"too_big":{let z=J.inclusive?"<=":"<",g=w(J.origin);if(g)return`Preveliko: pričakovano, da bo ${J.origin??"vrednost"} imelo ${z}${J.maximum.toString()} ${g.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${J.origin??"vrednost"} ${z}${J.maximum.toString()}`}case"too_small":{let z=J.inclusive?">=":">",g=w(J.origin);if(g)return`Premajhno: pričakovano, da bo ${J.origin} imelo ${z}${J.minimum.toString()} ${g.unit}`;return`Premajhno: pričakovano, da bo ${J.origin} ${z}${J.minimum.toString()}`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`Neveljaven niz: mora se začeti z "${z.prefix}"`;if(z.format==="ends_with")return`Neveljaven niz: mora se končati z "${z.suffix}"`;if(z.format==="includes")return`Neveljaven niz: mora vsebovati "${z.includes}"`;if(z.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${z.pattern}`;return`Neveljaven ${U[z.format]??J.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${J.divisor}`;case"unrecognized_keys":return`Neprepoznan${J.keys.length>1?"i ključi":" ključ"}: ${L(J.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${J.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${J.origin}`;default:return"Neveljaven vnos"}}};function V_(){return{localeError:xL()}}var rL=()=>{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 w(J){return $[J]??null}let U={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"},v={nan:"NaN",number:"antal",array:"lista"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(/^[A-Z]/.test(J.expected))return`Ogiltig inmatning: förväntat instanceof ${J.expected}, fick ${V}`;return`Ogiltig inmatning: förväntat ${z}, fick ${V}`}case"invalid_value":if(J.values.length===1)return`Ogiltig inmatning: förväntat ${K(J.values[0])}`;return`Ogiltigt val: förväntade en av ${L(J.values,"|")}`;case"too_big":{let z=J.inclusive?"<=":"<",g=w(J.origin);if(g)return`För stor(t): förväntade ${J.origin??"värdet"} att ha ${z}${J.maximum.toString()} ${g.unit??"element"}`;return`För stor(t): förväntat ${J.origin??"värdet"} att ha ${z}${J.maximum.toString()}`}case"too_small":{let z=J.inclusive?">=":">",g=w(J.origin);if(g)return`För lite(t): förväntade ${J.origin??"värdet"} att ha ${z}${J.minimum.toString()} ${g.unit}`;return`För lite(t): förväntade ${J.origin??"värdet"} att ha ${z}${J.minimum.toString()}`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`Ogiltig sträng: måste börja med "${z.prefix}"`;if(z.format==="ends_with")return`Ogiltig sträng: måste sluta med "${z.suffix}"`;if(z.format==="includes")return`Ogiltig sträng: måste innehålla "${z.includes}"`;if(z.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${z.pattern}"`;return`Ogiltig(t) ${U[z.format]??J.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${J.divisor}`;case"unrecognized_keys":return`${J.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${L(J.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${J.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${J.origin??"värdet"}`;default:return"Ogiltig input"}}};function G_(){return{localeError:rL()}}var yL=()=>{let $={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function w(J){return $[J]??null}let U={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"},v={nan:"NaN",number:"எண்",array:"அணி",null:"வெறுமை"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(/^[A-Z]/.test(J.expected))return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${J.expected}, பெறப்பட்டது ${V}`;return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${z}, பெறப்பட்டது ${V}`}case"invalid_value":if(J.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${K(J.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${L(J.values,"|")} இல் ஒன்று`;case"too_big":{let z=J.inclusive?"<=":"<",g=w(J.origin);if(g)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${J.origin??"மதிப்பு"} ${z}${J.maximum.toString()} ${g.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${J.origin??"மதிப்பு"} ${z}${J.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let z=J.inclusive?">=":">",g=w(J.origin);if(g)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${J.origin} ${z}${J.minimum.toString()} ${g.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${J.origin} ${z}${J.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`தவறான சரம்: "${z.prefix}" இல் தொடங்க வேண்டும்`;if(z.format==="ends_with")return`தவறான சரம்: "${z.suffix}" இல் முடிவடைய வேண்டும்`;if(z.format==="includes")return`தவறான சரம்: "${z.includes}" ஐ உள்ளடக்க வேண்டும்`;if(z.format==="regex")return`தவறான சரம்: ${z.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${U[z.format]??J.format}`}case"not_multiple_of":return`தவறான எண்: ${J.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${J.keys.length>1?"கள்":""}: ${L(J.keys,", ")}`;case"invalid_key":return`${J.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${J.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function __(){return{localeError:yL()}}var dL=()=>{let $={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function w(J){return $[J]??null}let U={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:"ข้อมูลที่ป้อน"},v={nan:"NaN",number:"ตัวเลข",array:"อาร์เรย์ (Array)",null:"ไม่มีค่า (null)"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(/^[A-Z]/.test(J.expected))return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${J.expected} แต่ได้รับ ${V}`;return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${z} แต่ได้รับ ${V}`}case"invalid_value":if(J.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${K(J.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${L(J.values,"|")}`;case"too_big":{let z=J.inclusive?"ไม่เกิน":"น้อยกว่า",g=w(J.origin);if(g)return`เกินกำหนด: ${J.origin??"ค่า"} ควรมี${z} ${J.maximum.toString()} ${g.unit??"รายการ"}`;return`เกินกำหนด: ${J.origin??"ค่า"} ควรมี${z} ${J.maximum.toString()}`}case"too_small":{let z=J.inclusive?"อย่างน้อย":"มากกว่า",g=w(J.origin);if(g)return`น้อยกว่ากำหนด: ${J.origin} ควรมี${z} ${J.minimum.toString()} ${g.unit}`;return`น้อยกว่ากำหนด: ${J.origin} ควรมี${z} ${J.minimum.toString()}`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${z.prefix}"`;if(z.format==="ends_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${z.suffix}"`;if(z.format==="includes")return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${z.includes}" อยู่ในข้อความ`;if(z.format==="regex")return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${z.pattern}`;return`รูปแบบไม่ถูกต้อง: ${U[z.format]??J.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${J.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${L(J.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${J.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${J.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function X_(){return{localeError:dL()}}var mL=()=>{let $={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function w(J){return $[J]??null}let U={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"},v={nan:"NaN"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(/^[A-Z]/.test(J.expected))return`Geçersiz değer: beklenen instanceof ${J.expected}, alınan ${V}`;return`Geçersiz değer: beklenen ${z}, alınan ${V}`}case"invalid_value":if(J.values.length===1)return`Geçersiz değer: beklenen ${K(J.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${L(J.values,"|")}`;case"too_big":{let z=J.inclusive?"<=":"<",g=w(J.origin);if(g)return`Çok büyük: beklenen ${J.origin??"değer"} ${z}${J.maximum.toString()} ${g.unit??"öğe"}`;return`Çok büyük: beklenen ${J.origin??"değer"} ${z}${J.maximum.toString()}`}case"too_small":{let z=J.inclusive?">=":">",g=w(J.origin);if(g)return`Çok küçük: beklenen ${J.origin} ${z}${J.minimum.toString()} ${g.unit}`;return`Çok küçük: beklenen ${J.origin} ${z}${J.minimum.toString()}`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`Geçersiz metin: "${z.prefix}" ile başlamalı`;if(z.format==="ends_with")return`Geçersiz metin: "${z.suffix}" ile bitmeli`;if(z.format==="includes")return`Geçersiz metin: "${z.includes}" içermeli`;if(z.format==="regex")return`Geçersiz metin: ${z.pattern} desenine uymalı`;return`Geçersiz ${U[z.format]??J.format}`}case"not_multiple_of":return`Geçersiz sayı: ${J.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${J.keys.length>1?"lar":""}: ${L(J.keys,", ")}`;case"invalid_key":return`${J.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${J.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function I_(){return{localeError:mL()}}var nL=()=>{let $={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function w(J){return $[J]??null}let U={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:"вхідні дані"},v={nan:"NaN",number:"число",array:"масив"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(/^[A-Z]/.test(J.expected))return`Неправильні вхідні дані: очікується instanceof ${J.expected}, отримано ${V}`;return`Неправильні вхідні дані: очікується ${z}, отримано ${V}`}case"invalid_value":if(J.values.length===1)return`Неправильні вхідні дані: очікується ${K(J.values[0])}`;return`Неправильна опція: очікується одне з ${L(J.values,"|")}`;case"too_big":{let z=J.inclusive?"<=":"<",g=w(J.origin);if(g)return`Занадто велике: очікується, що ${J.origin??"значення"} ${g.verb} ${z}${J.maximum.toString()} ${g.unit??"елементів"}`;return`Занадто велике: очікується, що ${J.origin??"значення"} буде ${z}${J.maximum.toString()}`}case"too_small":{let z=J.inclusive?">=":">",g=w(J.origin);if(g)return`Занадто мале: очікується, що ${J.origin} ${g.verb} ${z}${J.minimum.toString()} ${g.unit}`;return`Занадто мале: очікується, що ${J.origin} буде ${z}${J.minimum.toString()}`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`Неправильний рядок: повинен починатися з "${z.prefix}"`;if(z.format==="ends_with")return`Неправильний рядок: повинен закінчуватися на "${z.suffix}"`;if(z.format==="includes")return`Неправильний рядок: повинен містити "${z.includes}"`;if(z.format==="regex")return`Неправильний рядок: повинен відповідати шаблону ${z.pattern}`;return`Неправильний ${U[z.format]??J.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${J.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${J.keys.length>1?"і":""}: ${L(J.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${J.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${J.origin}`;default:return"Неправильні вхідні дані"}}};function VJ(){return{localeError:nL()}}function N_(){return VJ()}var hL=()=>{let $={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function w(J){return $[J]??null}let U={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:"ان پٹ"},v={nan:"NaN",number:"نمبر",array:"آرے",null:"نل"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(/^[A-Z]/.test(J.expected))return`غلط ان پٹ: instanceof ${J.expected} متوقع تھا، ${V} موصول ہوا`;return`غلط ان پٹ: ${z} متوقع تھا، ${V} موصول ہوا`}case"invalid_value":if(J.values.length===1)return`غلط ان پٹ: ${K(J.values[0])} متوقع تھا`;return`غلط آپشن: ${L(J.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let z=J.inclusive?"<=":"<",g=w(J.origin);if(g)return`بہت بڑا: ${J.origin??"ویلیو"} کے ${z}${J.maximum.toString()} ${g.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${J.origin??"ویلیو"} کا ${z}${J.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let z=J.inclusive?">=":">",g=w(J.origin);if(g)return`بہت چھوٹا: ${J.origin} کے ${z}${J.minimum.toString()} ${g.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${J.origin} کا ${z}${J.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`غلط سٹرنگ: "${z.prefix}" سے شروع ہونا چاہیے`;if(z.format==="ends_with")return`غلط سٹرنگ: "${z.suffix}" پر ختم ہونا چاہیے`;if(z.format==="includes")return`غلط سٹرنگ: "${z.includes}" شامل ہونا چاہیے`;if(z.format==="regex")return`غلط سٹرنگ: پیٹرن ${z.pattern} سے میچ ہونا چاہیے`;return`غلط ${U[z.format]??J.format}`}case"not_multiple_of":return`غلط نمبر: ${J.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${J.keys.length>1?"ز":""}: ${L(J.keys,"، ")}`;case"invalid_key":return`${J.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${J.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function W_(){return{localeError:hL()}}var cL=()=>{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"},map:{unit:"yozuv",verb:"bo‘lishi kerak"}};function w(J){return $[J]??null}let U={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"},v={nan:"NaN",number:"raqam",array:"massiv"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(/^[A-Z]/.test(J.expected))return`Noto‘g‘ri kirish: kutilgan instanceof ${J.expected}, qabul qilingan ${V}`;return`Noto‘g‘ri kirish: kutilgan ${z}, qabul qilingan ${V}`}case"invalid_value":if(J.values.length===1)return`Noto‘g‘ri kirish: kutilgan ${K(J.values[0])}`;return`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${L(J.values,"|")}`;case"too_big":{let z=J.inclusive?"<=":"<",g=w(J.origin);if(g)return`Juda katta: kutilgan ${J.origin??"qiymat"} ${z}${J.maximum.toString()} ${g.unit} ${g.verb}`;return`Juda katta: kutilgan ${J.origin??"qiymat"} ${z}${J.maximum.toString()}`}case"too_small":{let z=J.inclusive?">=":">",g=w(J.origin);if(g)return`Juda kichik: kutilgan ${J.origin} ${z}${J.minimum.toString()} ${g.unit} ${g.verb}`;return`Juda kichik: kutilgan ${J.origin} ${z}${J.minimum.toString()}`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`Noto‘g‘ri satr: "${z.prefix}" bilan boshlanishi kerak`;if(z.format==="ends_with")return`Noto‘g‘ri satr: "${z.suffix}" bilan tugashi kerak`;if(z.format==="includes")return`Noto‘g‘ri satr: "${z.includes}" ni o‘z ichiga olishi kerak`;if(z.format==="regex")return`Noto‘g‘ri satr: ${z.pattern} shabloniga mos kelishi kerak`;return`Noto‘g‘ri ${U[z.format]??J.format}`}case"not_multiple_of":return`Noto‘g‘ri raqam: ${J.divisor} ning karralisi bo‘lishi kerak`;case"unrecognized_keys":return`Noma’lum kalit${J.keys.length>1?"lar":""}: ${L(J.keys,", ")}`;case"invalid_key":return`${J.origin} dagi kalit noto‘g‘ri`;case"invalid_union":return"Noto‘g‘ri kirish";case"invalid_element":return`${J.origin} da noto‘g‘ri qiymat`;default:return"Noto‘g‘ri kirish"}}};function Y_(){return{localeError:cL()}}var lL=()=>{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 w(J){return $[J]??null}let U={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"},v={nan:"NaN",number:"số",array:"mảng"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(/^[A-Z]/.test(J.expected))return`Đầu vào không hợp lệ: mong đợi instanceof ${J.expected}, nhận được ${V}`;return`Đầu vào không hợp lệ: mong đợi ${z}, nhận được ${V}`}case"invalid_value":if(J.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${K(J.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${L(J.values,"|")}`;case"too_big":{let z=J.inclusive?"<=":"<",g=w(J.origin);if(g)return`Quá lớn: mong đợi ${J.origin??"giá trị"} ${g.verb} ${z}${J.maximum.toString()} ${g.unit??"phần tử"}`;return`Quá lớn: mong đợi ${J.origin??"giá trị"} ${z}${J.maximum.toString()}`}case"too_small":{let z=J.inclusive?">=":">",g=w(J.origin);if(g)return`Quá nhỏ: mong đợi ${J.origin} ${g.verb} ${z}${J.minimum.toString()} ${g.unit}`;return`Quá nhỏ: mong đợi ${J.origin} ${z}${J.minimum.toString()}`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${z.prefix}"`;if(z.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${z.suffix}"`;if(z.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${z.includes}"`;if(z.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${z.pattern}`;return`${U[z.format]??J.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 ${J.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${L(J.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${J.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 ${J.origin}`;default:return"Đầu vào không hợp lệ"}}};function Q_(){return{localeError:lL()}}var tL=()=>{let $={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function w(J){return $[J]??null}let U={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:"输入"},v={nan:"NaN",number:"数字",array:"数组",null:"空值(null)"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(/^[A-Z]/.test(J.expected))return`无效输入:期望 instanceof ${J.expected},实际接收 ${V}`;return`无效输入:期望 ${z},实际接收 ${V}`}case"invalid_value":if(J.values.length===1)return`无效输入:期望 ${K(J.values[0])}`;return`无效选项:期望以下之一 ${L(J.values,"|")}`;case"too_big":{let z=J.inclusive?"<=":"<",g=w(J.origin);if(g)return`数值过大:期望 ${J.origin??"值"} ${z}${J.maximum.toString()} ${g.unit??"个元素"}`;return`数值过大:期望 ${J.origin??"值"} ${z}${J.maximum.toString()}`}case"too_small":{let z=J.inclusive?">=":">",g=w(J.origin);if(g)return`数值过小:期望 ${J.origin} ${z}${J.minimum.toString()} ${g.unit}`;return`数值过小:期望 ${J.origin} ${z}${J.minimum.toString()}`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`无效字符串:必须以 "${z.prefix}" 开头`;if(z.format==="ends_with")return`无效字符串:必须以 "${z.suffix}" 结尾`;if(z.format==="includes")return`无效字符串:必须包含 "${z.includes}"`;if(z.format==="regex")return`无效字符串:必须满足正则表达式 ${z.pattern}`;return`无效${U[z.format]??J.format}`}case"not_multiple_of":return`无效数字:必须是 ${J.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${L(J.keys,", ")}`;case"invalid_key":return`${J.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${J.origin} 中包含无效值(value)`;default:return"无效输入"}}};function P_(){return{localeError:tL()}}var oL=()=>{let $={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function w(J){return $[J]??null}let U={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:"輸入"},v={nan:"NaN"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(/^[A-Z]/.test(J.expected))return`無效的輸入值:預期為 instanceof ${J.expected},但收到 ${V}`;return`無效的輸入值:預期為 ${z},但收到 ${V}`}case"invalid_value":if(J.values.length===1)return`無效的輸入值:預期為 ${K(J.values[0])}`;return`無效的選項:預期為以下其中之一 ${L(J.values,"|")}`;case"too_big":{let z=J.inclusive?"<=":"<",g=w(J.origin);if(g)return`數值過大:預期 ${J.origin??"值"} 應為 ${z}${J.maximum.toString()} ${g.unit??"個元素"}`;return`數值過大:預期 ${J.origin??"值"} 應為 ${z}${J.maximum.toString()}`}case"too_small":{let z=J.inclusive?">=":">",g=w(J.origin);if(g)return`數值過小:預期 ${J.origin} 應為 ${z}${J.minimum.toString()} ${g.unit}`;return`數值過小:預期 ${J.origin} 應為 ${z}${J.minimum.toString()}`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`無效的字串:必須以 "${z.prefix}" 開頭`;if(z.format==="ends_with")return`無效的字串:必須以 "${z.suffix}" 結尾`;if(z.format==="includes")return`無效的字串:必須包含 "${z.includes}"`;if(z.format==="regex")return`無效的字串:必須符合格式 ${z.pattern}`;return`無效的 ${U[z.format]??J.format}`}case"not_multiple_of":return`無效的數字:必須為 ${J.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${J.keys.length>1?"們":""}:${L(J.keys,"、")}`;case"invalid_key":return`${J.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${J.origin} 中有無效的值`;default:return"無效的輸入值"}}};function O_(){return{localeError:oL()}}var pL=()=>{let $={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function w(J){return $[J]??null}let U={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é"},v={nan:"NaN",number:"nọ́mbà",array:"akopọ"};return(J)=>{switch(J.code){case"invalid_type":{let z=v[J.expected]??J.expected,g=D(J.input),V=v[g]??g;if(/^[A-Z]/.test(J.expected))return`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${J.expected}, àmọ̀ a rí ${V}`;return`Ìbáwọlé aṣìṣe: a ní láti fi ${z}, àmọ̀ a rí ${V}`}case"invalid_value":if(J.values.length===1)return`Ìbáwọlé aṣìṣe: a ní láti fi ${K(J.values[0])}`;return`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${L(J.values,"|")}`;case"too_big":{let z=J.inclusive?"<=":"<",g=w(J.origin);if(g)return`Tó pọ̀ jù: a ní láti jẹ́ pé ${J.origin??"iye"} ${g.verb} ${z}${J.maximum} ${g.unit}`;return`Tó pọ̀ jù: a ní láti jẹ́ ${z}${J.maximum}`}case"too_small":{let z=J.inclusive?">=":">",g=w(J.origin);if(g)return`Kéré ju: a ní láti jẹ́ pé ${J.origin} ${g.verb} ${z}${J.minimum} ${g.unit}`;return`Kéré ju: a ní láti jẹ́ ${z}${J.minimum}`}case"invalid_format":{let z=J;if(z.format==="starts_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${z.prefix}"`;if(z.format==="ends_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${z.suffix}"`;if(z.format==="includes")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${z.includes}"`;if(z.format==="regex")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${z.pattern}`;return`Aṣìṣe: ${U[z.format]??J.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${J.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${L(J.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${J.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${J.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function B_(){return{localeError:pL()}}var z9,q_=Symbol("ZodOutput"),L_=Symbol("ZodInput");class H_{constructor(){this._map=new WeakMap,this._idmap=new Map}add($,...w){let U=w[0];if(this._map.set($,U),U&&typeof U==="object"&&"id"in U)this._idmap.set(U.id,$);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove($){let w=this._map.get($);if(w&&typeof w==="object"&&"id"in w)this._idmap.delete(w.id);return this._map.delete($),this}get($){let w=$._zod.parent;if(w){let U={...this.get(w)??{}};delete U.id;let v={...U,...this._map.get($)};return Object.keys(v).length?v:void 0}return this._map.get($)}has($){return this._map.has($)}}function vv(){return new H_}(z9=globalThis).__zod_globalRegistry??(z9.__zod_globalRegistry=vv());var P$=globalThis.__zod_globalRegistry;function u_($,w){return new $({type:"string",...F(w)})}function K_($,w){return new $({type:"string",coerce:!0,...F(w)})}function zv($,w){return new $({type:"string",format:"email",check:"string_format",abort:!1,...F(w)})}function _J($,w){return new $({type:"string",format:"guid",check:"string_format",abort:!1,...F(w)})}function gv($,w){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,...F(w)})}function Vv($,w){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...F(w)})}function Gv($,w){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...F(w)})}function _v($,w){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...F(w)})}function XJ($,w){return new $({type:"string",format:"url",check:"string_format",abort:!1,...F(w)})}function Xv($,w){return new $({type:"string",format:"emoji",check:"string_format",abort:!1,...F(w)})}function Iv($,w){return new $({type:"string",format:"nanoid",check:"string_format",abort:!1,...F(w)})}function Nv($,w){return new $({type:"string",format:"cuid",check:"string_format",abort:!1,...F(w)})}function Wv($,w){return new $({type:"string",format:"cuid2",check:"string_format",abort:!1,...F(w)})}function Yv($,w){return new $({type:"string",format:"ulid",check:"string_format",abort:!1,...F(w)})}function Qv($,w){return new $({type:"string",format:"xid",check:"string_format",abort:!1,...F(w)})}function Pv($,w){return new $({type:"string",format:"ksuid",check:"string_format",abort:!1,...F(w)})}function Ov($,w){return new $({type:"string",format:"ipv4",check:"string_format",abort:!1,...F(w)})}function Bv($,w){return new $({type:"string",format:"ipv6",check:"string_format",abort:!1,...F(w)})}function D_($,w){return new $({type:"string",format:"mac",check:"string_format",abort:!1,...F(w)})}function qv($,w){return new $({type:"string",format:"cidrv4",check:"string_format",abort:!1,...F(w)})}function Lv($,w){return new $({type:"string",format:"cidrv6",check:"string_format",abort:!1,...F(w)})}function Hv($,w){return new $({type:"string",format:"base64",check:"string_format",abort:!1,...F(w)})}function uv($,w){return new $({type:"string",format:"base64url",check:"string_format",abort:!1,...F(w)})}function Kv($,w){return new $({type:"string",format:"e164",check:"string_format",abort:!1,...F(w)})}function Dv($,w){return new $({type:"string",format:"jwt",check:"string_format",abort:!1,...F(w)})}var f_={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function T_($,w){return new $({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...F(w)})}function Z_($,w){return new $({type:"string",format:"date",check:"string_format",...F(w)})}function b_($,w){return new $({type:"string",format:"time",check:"string_format",precision:null,...F(w)})}function F_($,w){return new $({type:"string",format:"duration",check:"string_format",...F(w)})}function M_($,w){return new $({type:"number",checks:[],...F(w)})}function i_($,w){return new $({type:"number",coerce:!0,checks:[],...F(w)})}function E_($,w){return new $({type:"number",check:"number_format",abort:!1,format:"safeint",...F(w)})}function S_($,w){return new $({type:"number",check:"number_format",abort:!1,format:"float32",...F(w)})}function A_($,w){return new $({type:"number",check:"number_format",abort:!1,format:"float64",...F(w)})}function R_($,w){return new $({type:"number",check:"number_format",abort:!1,format:"int32",...F(w)})}function k_($,w){return new $({type:"number",check:"number_format",abort:!1,format:"uint32",...F(w)})}function C_($,w){return new $({type:"boolean",...F(w)})}function j_($,w){return new $({type:"boolean",coerce:!0,...F(w)})}function x_($,w){return new $({type:"bigint",...F(w)})}function r_($,w){return new $({type:"bigint",coerce:!0,...F(w)})}function y_($,w){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...F(w)})}function d_($,w){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...F(w)})}function m_($,w){return new $({type:"symbol",...F(w)})}function n_($,w){return new $({type:"undefined",...F(w)})}function h_($,w){return new $({type:"null",...F(w)})}function c_($){return new $({type:"any"})}function l_($){return new $({type:"unknown"})}function t_($,w){return new $({type:"never",...F(w)})}function o_($,w){return new $({type:"void",...F(w)})}function p_($,w){return new $({type:"date",...F(w)})}function a_($,w){return new $({type:"date",coerce:!0,...F(w)})}function e_($,w){return new $({type:"nan",...F(w)})}function G4($,w){return new c0({check:"less_than",...F(w),value:$,inclusive:!1})}function r$($,w){return new c0({check:"less_than",...F(w),value:$,inclusive:!0})}function _4($,w){return new l0({check:"greater_than",...F(w),value:$,inclusive:!1})}function b$($,w){return new l0({check:"greater_than",...F(w),value:$,inclusive:!0})}function fv($){return _4(0,$)}function Tv($){return G4(0,$)}function Zv($){return r$(0,$)}function bv($){return b$(0,$)}function h4($,w){return new og({check:"multiple_of",...F(w),value:$})}function c4($,w){return new eg({check:"max_size",...F(w),maximum:$})}function X4($,w){return new sg({check:"min_size",...F(w),minimum:$})}function E6($,w){return new $V({check:"size_equals",...F(w),size:$})}function S6($,w){return new wV({check:"max_length",...F(w),maximum:$})}function D4($,w){return new UV({check:"min_length",...F(w),minimum:$})}function A6($,w){return new JV({check:"length_equals",...F(w),length:$})}function Sw($,w){return new vV({check:"string_format",format:"regex",...F(w),pattern:$})}function Aw($){return new zV({check:"string_format",format:"lowercase",...F($)})}function Rw($){return new gV({check:"string_format",format:"uppercase",...F($)})}function kw($,w){return new VV({check:"string_format",format:"includes",...F(w),includes:$})}function Cw($,w){return new GV({check:"string_format",format:"starts_with",...F(w),prefix:$})}function jw($,w){return new _V({check:"string_format",format:"ends_with",...F(w),suffix:$})}function Fv($,w,U){return new XV({check:"property",property:$,schema:w,...F(U)})}function xw($,w){return new IV({check:"mime_type",mime:$,...F(w)})}function e$($){return new NV({check:"overwrite",tx:$})}function rw($){return e$((w)=>w.normalize($))}function yw(){return e$(($)=>$.trim())}function dw(){return e$(($)=>$.toLowerCase())}function mw(){return e$(($)=>$.toUpperCase())}function nw(){return e$(($)=>Gg($))}function s_($,w,U){return new $({type:"array",element:w,...F(U)})}function eL($,w,U){return new $({type:"union",options:w,...F(U)})}function sL($,w,U){return new $({type:"union",options:w,inclusive:!1,...F(U)})}function $H($,w,U,v){return new $({type:"union",options:U,discriminator:w,...F(v)})}function wH($,w,U){return new $({type:"intersection",left:w,right:U})}function UH($,w,U,v){let J=U instanceof d;return new $({type:"tuple",items:w,rest:J?U:null,...F(J?v:U)})}function JH($,w,U,v){return new $({type:"record",keyType:w,valueType:U,...F(v)})}function vH($,w,U,v){return new $({type:"map",keyType:w,valueType:U,...F(v)})}function zH($,w,U){return new $({type:"set",valueType:w,...F(U)})}function gH($,w,U){let v=Array.isArray(w)?Object.fromEntries(w.map((J)=>[J,J])):w;return new $({type:"enum",entries:v,...F(U)})}function VH($,w,U){return new $({type:"enum",entries:w,...F(U)})}function GH($,w,U){return new $({type:"literal",values:Array.isArray(w)?w:[w],...F(U)})}function $X($,w){return new $({type:"file",...F(w)})}function _H($,w){return new $({type:"transform",transform:w})}function XH($,w){return new $({type:"optional",innerType:w})}function IH($,w){return new $({type:"nullable",innerType:w})}function NH($,w,U){return new $({type:"default",innerType:w,get defaultValue(){return typeof U==="function"?U():Xg(U)}})}function WH($,w,U){return new $({type:"nonoptional",innerType:w,...F(U)})}function YH($,w){return new $({type:"success",innerType:w})}function QH($,w,U){return new $({type:"catch",innerType:w,catchValue:typeof U==="function"?U:()=>U})}function PH($,w,U){return new $({type:"pipe",in:w,out:U})}function OH($,w){return new $({type:"readonly",innerType:w})}function BH($,w,U){return new $({type:"template_literal",parts:w,...F(U)})}function qH($,w){return new $({type:"lazy",getter:w})}function LH($,w){return new $({type:"promise",innerType:w})}function wX($,w,U){let v=F(U);return v.abort??(v.abort=!0),new $({type:"custom",check:"custom",fn:w,...v})}function UX($,w,U){return new $({type:"custom",check:"custom",fn:w,...F(U)})}function JX($,w){let U=g9((v)=>{return v.addIssue=(J)=>{if(typeof J==="string")v.issues.push(Tw(J,v.value,U._zod.def));else{let z=J;if(z.fatal)z.continue=!1;z.code??(z.code="custom"),z.input??(z.input=v.value),z.inst??(z.inst=U),z.continue??(z.continue=!U._zod.def.abort),v.issues.push(Tw(z))}},$(v.value,v)},w);return U}function g9($,w){let U=new $$({check:"custom",...F(w)});return U._zod.check=$,U}function vX($){let w=new $$({check:"describe"});return w._zod.onattach=[(U)=>{let v=P$.get(U)??{};P$.add(U,{...v,description:$})}],w._zod.check=()=>{},w}function zX($){let w=new $$({check:"meta"});return w._zod.onattach=[(U)=>{let v=P$.get(U)??{};P$.add(U,{...v,...$})}],w._zod.check=()=>{},w}function gX($,w){let U=F(w),v=U.truthy??["true","1","yes","on","y","enabled"],J=U.falsy??["false","0","no","off","n","disabled"];if(U.case!=="sensitive")v=v.map((W)=>typeof W==="string"?W.toLowerCase():W),J=J.map((W)=>typeof W==="string"?W.toLowerCase():W);let z=new Set(v),g=new Set(J),V=$.Codec??JJ,_=$.Boolean??wJ,X=new($.String??i6)({type:"string",error:U.error}),I=new _({type:"boolean",error:U.error}),N=new V({type:"pipe",in:X,out:I,transform:(W,P)=>{let Q=W;if(U.case!=="sensitive")Q=Q.toLowerCase();if(z.has(Q))return!0;else if(g.has(Q))return!1;else return P.issues.push({code:"invalid_value",expected:"stringbool",values:[...z,...g],input:P.value,inst:N,continue:!1}),{}},reverseTransform:(W,P)=>{if(W===!0)return v[0]||"true";else return J[0]||"false"},error:U.error});return N}function hw($,w,U,v={}){let J=F(v),z={...F(v),check:"string_format",type:"string",format:w,fn:typeof U==="function"?U:(V)=>U.test(V),...J};if(U instanceof RegExp)z.pattern=U;return new $(z)}function l4($){let w=$?.target??"draft-2020-12";if(w==="draft-4")w="draft-04";if(w==="draft-7")w="draft-07";return{processors:$.processors??{},metadataRegistry:$?.metadata??P$,target:w,unrepresentable:$?.unrepresentable??"throw",override:$?.override??(()=>{}),io:$?.io??"output",counter:0,seen:new Map,cycles:$?.cycles??"ref",reused:$?.reused??"inline",external:$?.external??void 0}}function p($,w,U={path:[],schemaPath:[]}){var v;let J=$._zod.def,z=w.seen.get($);if(z){if(z.count++,U.schemaPath.includes($))z.cycle=U.path;return z.schema}let g={schema:{},count:1,cycle:void 0,path:U.path};w.seen.set($,g);let V=$._zod.toJSONSchema?.();if(V)g.schema=V;else{let X={...U,schemaPath:[...U.schemaPath,$],path:U.path};if($._zod.processJSONSchema)$._zod.processJSONSchema(w,g.schema,X);else{let N=g.schema,W=w.processors[J.type];if(!W)throw Error(`[toJSONSchema]: Non-representable type encountered: ${J.type}`);W($,w,N,X)}let I=$._zod.parent;if(I){if(!g.ref)g.ref=I;p(I,w,X),w.seen.get(I).isParent=!0}}let _=w.metadataRegistry.get($);if(_)Object.assign(g.schema,_);if(w.io==="input"&&F$($))delete g.schema.examples,delete g.schema.default;if(w.io==="input"&&"_prefault"in g.schema)(v=g.schema).default??(v.default=g.schema._prefault);return delete g.schema._prefault,w.seen.get($).schema}function t4($,w){let U=$.seen.get(w);if(!U)throw Error("Unprocessed schema. This is a bug in Zod.");let v=new Map;for(let g of $.seen.entries()){let V=$.metadataRegistry.get(g[0])?.id;if(V){let _=v.get(V);if(_&&_!==g[0])throw Error(`Duplicate schema id "${V}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);v.set(V,g[0])}}let J=(g)=>{let V=$.target==="draft-2020-12"?"$defs":"definitions";if($.external){let I=$.external.registry.get(g[0])?.id,N=$.external.uri??((P)=>P);if(I)return{ref:N(I)};let W=g[1].defId??g[1].schema.id??`schema${$.counter++}`;return g[1].defId=W,{defId:W,ref:`${N("__shared")}#/${V}/${W}`}}if(g[1]===U)return{ref:"#"};let G=`${"#"}/${V}/`,X=g[1].schema.id??`__schema${$.counter++}`;return{defId:X,ref:G+X}},z=(g)=>{if(g[1].schema.$ref)return;let V=g[1],{ref:_,defId:G}=J(g);if(V.def={...V.schema},G)V.defId=G;let X=V.schema;for(let I in X)delete X[I];X.$ref=_};if($.cycles==="throw")for(let g of $.seen.entries()){let V=g[1];if(V.cycle)throw Error(`Cycle detected: #/${V.cycle?.join("/")}/<root>
|
|
253
253
|
|
|
254
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let X of $.seen.entries()){let _=X[1];if(U===X[0]){G(X);continue}if($.external){let W=$.external.registry.get(X[0])?.id;if(U!==X[0]&&W){G(X);continue}}if($.metadataRegistry.get(X[0])?.id){G(X);continue}if(_.cycle){G(X);continue}if(_.count>1){if($.reused==="ref"){G(X);continue}}}}function c4($,U){let w=$.seen.get(U);if(!w)throw Error("Unprocessed schema. This is a bug in Zod.");let J=(_)=>{let N=$.seen.get(_);if(N.ref===null)return;let W=N.def??N.schema,Y={...W},Q=N.ref;if(N.ref=null,Q){J(Q);let g=$.seen.get(Q),H=g.schema;if(H.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))W.allOf=W.allOf??[],W.allOf.push(H);else Object.assign(W,H);if(Object.assign(W,Y),_._zod.parent===Q)for(let O in W){if(O==="$ref"||O==="allOf")continue;if(!(O in Y))delete W[O]}if(H.$ref&&g.def)for(let O in W){if(O==="$ref"||O==="allOf")continue;if(O in g.def&&JSON.stringify(W[O])===JSON.stringify(g.def[O]))delete W[O]}}let V=_._zod.parent;if(V&&V!==Q){J(V);let g=$.seen.get(V);if(g?.schema.$ref){if(W.$ref=g.schema.$ref,g.def)for(let H in W){if(H==="$ref"||H==="allOf")continue;if(H in g.def&&JSON.stringify(W[H])===JSON.stringify(g.def[H]))delete W[H]}}}$.override({zodSchema:_,jsonSchema:W,path:N.path??[]})};for(let _ of[...$.seen.entries()].reverse())J(_[0]);let z={};if($.target==="draft-2020-12")z.$schema="https://json-schema.org/draft/2020-12/schema";else if($.target==="draft-07")z.$schema="http://json-schema.org/draft-07/schema#";else if($.target==="draft-04")z.$schema="http://json-schema.org/draft-04/schema#";else if($.target==="openapi-3.0");if($.external?.uri){let _=$.external.registry.get(U)?.id;if(!_)throw Error("Schema is missing an `id` property");z.$id=$.external.uri(_)}Object.assign(z,w.def??w.schema);let G=$.metadataRegistry.get(U)?.id;if(G!==void 0&&z.id===G)delete z.id;let X=$.external?.defs??{};for(let _ of $.seen.entries()){let N=_[1];if(N.def&&N.defId){if(N.def.id===N.defId)delete N.def.id;X[N.defId]=N.def}}if($.external);else if(Object.keys(X).length>0)if($.target==="draft-2020-12")z.$defs=X;else z.definitions=X;try{let _=JSON.parse(JSON.stringify(z));return Object.defineProperty(_,"~standard",{value:{...U["~standard"],jsonSchema:{input:uU(U,"input",$.processors),output:uU(U,"output",$.processors)}},enumerable:!1,writable:!1}),_}catch(_){throw Error("Error converting schema to JSON.")}}function M$($,U){let w=U??{seen:new Set};if(w.seen.has($))return!1;w.seen.add($);let J=$._zod.def;if(J.type==="transform")return!0;if(J.type==="array")return M$(J.element,w);if(J.type==="set")return M$(J.valueType,w);if(J.type==="lazy")return M$(J.getter(),w);if(J.type==="promise"||J.type==="optional"||J.type==="nonoptional"||J.type==="nullable"||J.type==="readonly"||J.type==="default"||J.type==="prefault")return M$(J.innerType,w);if(J.type==="intersection")return M$(J.left,w)||M$(J.right,w);if(J.type==="record"||J.type==="map")return M$(J.keyType,w)||M$(J.valueType,w);if(J.type==="pipe"){if($._zod.traits.has("$ZodCodec"))return!0;return M$(J.in,w)||M$(J.out,w)}if(J.type==="object"){for(let z in J.shape)if(M$(J.shape[z],w))return!0;return!1}if(J.type==="union"){for(let z of J.options)if(M$(z,w))return!0;return!1}if(J.type==="tuple"){for(let z of J.items)if(M$(z,w))return!0;if(J.rest&&M$(J.rest,w))return!0;return!1}return!1}var d8=($,U={})=>(w)=>{let J=h4({...w,processors:U});return a($,J),m4(J,$),c4(J,$)},uU=($,U,w={})=>(J)=>{let{libraryOptions:z,target:G}=J??{},X=h4({...z??{},target:G,io:U,processors:w});return a($,X),m4(X,$),c4(X,$)};var mP={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},n8=($,U,w,J)=>{let z=w;z.type="string";let{minimum:G,maximum:X,format:_,patterns:N,contentEncoding:W}=$._zod.bag;if(typeof G==="number")z.minLength=G;if(typeof X==="number")z.maxLength=X;if(_){if(z.format=mP[_]??_,z.format==="")delete z.format;if(_==="time")delete z.format}if(W)z.contentEncoding=W;if(N&&N.size>0){let Y=[...N];if(Y.length===1)z.pattern=Y[0].source;else if(Y.length>1)z.allOf=[...Y.map((Q)=>({...U.target==="draft-07"||U.target==="draft-04"||U.target==="openapi-3.0"?{type:"string"}:{},pattern:Q.source}))]}},p8=($,U,w,J)=>{let z=w,{minimum:G,maximum:X,format:_,multipleOf:N,exclusiveMaximum:W,exclusiveMinimum:Y}=$._zod.bag;if(typeof _==="string"&&_.includes("int"))z.type="integer";else z.type="number";let Q=typeof Y==="number"&&Y>=(G??Number.NEGATIVE_INFINITY),V=typeof W==="number"&&W<=(X??Number.POSITIVE_INFINITY),g=U.target==="draft-04"||U.target==="openapi-3.0";if(Q)if(g)z.minimum=Y,z.exclusiveMinimum=!0;else z.exclusiveMinimum=Y;else if(typeof G==="number")z.minimum=G;if(V)if(g)z.maximum=W,z.exclusiveMaximum=!0;else z.exclusiveMaximum=W;else if(typeof X==="number")z.maximum=X;if(typeof N==="number")z.multipleOf=N},t8=($,U,w,J)=>{w.type="boolean"},a8=($,U,w,J)=>{if(U.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},o8=($,U,w,J)=>{if(U.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},e8=($,U,w,J)=>{if(U.target==="openapi-3.0")w.type="string",w.nullable=!0,w.enum=[null];else w.type="null"},s8=($,U,w,J)=>{if(U.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},$9=($,U,w,J)=>{if(U.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},U9=($,U,w,J)=>{w.not={}},w9=($,U,w,J)=>{},z9=($,U,w,J)=>{},J9=($,U,w,J)=>{if(U.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},G9=($,U,w,J)=>{let z=$._zod.def,G=k1(z.entries);if(G.every((X)=>typeof X==="number"))w.type="number";if(G.every((X)=>typeof X==="string"))w.type="string";w.enum=G},X9=($,U,w,J)=>{let z=$._zod.def,G=[];for(let X of z.values)if(X===void 0){if(U.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof X==="bigint")if(U.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else G.push(Number(X));else G.push(X);if(G.length===0);else if(G.length===1){let X=G[0];if(w.type=X===null?"null":typeof X,U.target==="draft-04"||U.target==="openapi-3.0")w.enum=[X];else w.const=X}else{if(G.every((X)=>typeof X==="number"))w.type="number";if(G.every((X)=>typeof X==="string"))w.type="string";if(G.every((X)=>typeof X==="boolean"))w.type="boolean";if(G.every((X)=>X===null))w.type="null";w.enum=G}},_9=($,U,w,J)=>{if(U.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},N9=($,U,w,J)=>{let z=w,G=$._zod.pattern;if(!G)throw Error("Pattern not found in template literal");z.type="string",z.pattern=G.source},W9=($,U,w,J)=>{let z=w,G={type:"string",format:"binary",contentEncoding:"binary"},{minimum:X,maximum:_,mime:N}=$._zod.bag;if(X!==void 0)G.minLength=X;if(_!==void 0)G.maxLength=_;if(N)if(N.length===1)G.contentMediaType=N[0],Object.assign(z,G);else Object.assign(z,G),z.anyOf=N.map((W)=>({contentMediaType:W}));else Object.assign(z,G)},Y9=($,U,w,J)=>{w.type="boolean"},Q9=($,U,w,J)=>{if(U.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},V9=($,U,w,J)=>{if(U.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},g9=($,U,w,J)=>{if(U.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},B9=($,U,w,J)=>{if(U.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},q9=($,U,w,J)=>{if(U.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},H9=($,U,w,J)=>{let z=w,G=$._zod.def,{minimum:X,maximum:_}=$._zod.bag;if(typeof X==="number")z.minItems=X;if(typeof _==="number")z.maxItems=_;z.type="array",z.items=a(G.element,U,{...J,path:[...J.path,"items"]})},I9=($,U,w,J)=>{let z=w,G=$._zod.def;z.type="object",z.properties={};let X=G.shape;for(let W in X)z.properties[W]=a(X[W],U,{...J,path:[...J.path,"properties",W]});let _=new Set(Object.keys(X)),N=new Set([..._].filter((W)=>{let Y=G.shape[W]._zod;if(U.io==="input")return Y.optin===void 0;else return Y.optout===void 0}));if(N.size>0)z.required=Array.from(N);if(G.catchall?._zod.def.type==="never")z.additionalProperties=!1;else if(!G.catchall){if(U.io==="output")z.additionalProperties=!1}else if(G.catchall)z.additionalProperties=a(G.catchall,U,{...J,path:[...J.path,"additionalProperties"]})},P2=($,U,w,J)=>{let z=$._zod.def,G=z.inclusive===!1,X=z.options.map((_,N)=>a(_,U,{...J,path:[...J.path,G?"oneOf":"anyOf",N]}));if(G)w.oneOf=X;else w.anyOf=X},K9=($,U,w,J)=>{let z=$._zod.def,G=a(z.left,U,{...J,path:[...J.path,"allOf",0]}),X=a(z.right,U,{...J,path:[...J.path,"allOf",1]}),_=(W)=>("allOf"in W)&&Object.keys(W).length===1,N=[..._(G)?G.allOf:[G],..._(X)?X.allOf:[X]];w.allOf=N},L9=($,U,w,J)=>{let z=w,G=$._zod.def;z.type="array";let X=U.target==="draft-2020-12"?"prefixItems":"items",_=U.target==="draft-2020-12"?"items":U.target==="openapi-3.0"?"items":"additionalItems",N=G.items.map((V,g)=>a(V,U,{...J,path:[...J.path,X,g]})),W=G.rest?a(G.rest,U,{...J,path:[...J.path,_,...U.target==="openapi-3.0"?[G.items.length]:[]]}):null;if(U.target==="draft-2020-12"){if(z.prefixItems=N,W)z.items=W}else if(U.target==="openapi-3.0"){if(z.items={anyOf:N},W)z.items.anyOf.push(W);if(z.minItems=N.length,!W)z.maxItems=N.length}else if(z.items=N,W)z.additionalItems=W;let{minimum:Y,maximum:Q}=$._zod.bag;if(typeof Y==="number")z.minItems=Y;if(typeof Q==="number")z.maxItems=Q},P9=($,U,w,J)=>{let z=w,G=$._zod.def;z.type="object";let X=G.keyType,N=X._zod.bag?.patterns;if(G.mode==="loose"&&N&&N.size>0){let Y=a(G.valueType,U,{...J,path:[...J.path,"patternProperties","*"]});z.patternProperties={};for(let Q of N)z.patternProperties[Q.source]=Y}else{if(U.target==="draft-07"||U.target==="draft-2020-12")z.propertyNames=a(G.keyType,U,{...J,path:[...J.path,"propertyNames"]});z.additionalProperties=a(G.valueType,U,{...J,path:[...J.path,"additionalProperties"]})}let W=X._zod.values;if(W){let Y=[...W].filter((Q)=>typeof Q==="string"||typeof Q==="number");if(Y.length>0)z.required=Y}},O9=($,U,w,J)=>{let z=$._zod.def,G=a(z.innerType,U,J),X=U.seen.get($);if(U.target==="openapi-3.0")X.ref=z.innerType,w.nullable=!0;else w.anyOf=[G,{type:"null"}]},T9=($,U,w,J)=>{let z=$._zod.def;a(z.innerType,U,J);let G=U.seen.get($);G.ref=z.innerType},Z9=($,U,w,J)=>{let z=$._zod.def;a(z.innerType,U,J);let G=U.seen.get($);G.ref=z.innerType,w.default=JSON.parse(JSON.stringify(z.defaultValue))},D9=($,U,w,J)=>{let z=$._zod.def;a(z.innerType,U,J);let G=U.seen.get($);if(G.ref=z.innerType,U.io==="input")w._prefault=JSON.parse(JSON.stringify(z.defaultValue))},F9=($,U,w,J)=>{let z=$._zod.def;a(z.innerType,U,J);let G=U.seen.get($);G.ref=z.innerType;let X;try{X=z.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}w.default=X},v9=($,U,w,J)=>{let z=$._zod.def,G=z.in._zod.traits.has("$ZodTransform"),X=U.io==="input"?G?z.out:z.in:z.out;a(X,U,J);let _=U.seen.get($);_.ref=X},M9=($,U,w,J)=>{let z=$._zod.def;a(z.innerType,U,J);let G=U.seen.get($);G.ref=z.innerType,w.readOnly=!0},S9=($,U,w,J)=>{let z=$._zod.def;a(z.innerType,U,J);let G=U.seen.get($);G.ref=z.innerType},O2=($,U,w,J)=>{let z=$._zod.def;a(z.innerType,U,J);let G=U.seen.get($);G.ref=z.innerType},b9=($,U,w,J)=>{let z=$._zod.innerType;a(z,U,J);let G=U.seen.get($);G.ref=z},L2={string:n8,number:p8,boolean:t8,bigint:a8,symbol:o8,null:e8,undefined:s8,void:$9,never:U9,any:w9,unknown:z9,date:J9,enum:G9,literal:X9,nan:_9,template_literal:N9,file:W9,success:Y9,custom:Q9,function:V9,transform:g9,map:B9,set:q9,array:H9,object:I9,union:P2,intersection:K9,tuple:L9,record:P9,nullable:O9,nonoptional:T9,default:Z9,prefault:D9,catch:F9,pipe:v9,readonly:M9,promise:S9,optional:O2,lazy:b9};function T2($,U){if("_idmap"in $){let J=$,z=h4({...U,processors:L2}),G={};for(let N of J._idmap.entries()){let[W,Y]=N;a(Y,z)}let X={},_={registry:J,uri:U?.uri,defs:G};z.external=_;for(let N of J._idmap.entries()){let[W,Y]=N;m4(z,Y),X[W]=c4(z,Y)}if(Object.keys(G).length>0){let N=z.target==="draft-2020-12"?"$defs":"definitions";X.__shared={[N]:G}}return{schemas:X}}let w=h4({...U,processors:L2});return a($,w),m4(w,$),c4(w,$)}class E9{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 U=$?.target??"draft-2020-12";if(U==="draft-4")U="draft-04";if(U==="draft-7")U="draft-07";this.ctx=h4({processors:L2,target:U,...$?.metadata&&{metadata:$.metadata},...$?.unrepresentable&&{unrepresentable:$.unrepresentable},...$?.override&&{override:$.override},...$?.io&&{io:$.io}})}process($,U={path:[],schemaPath:[]}){return a($,this.ctx,U)}emit($,U){if(U){if(U.cycles)this.ctx.cycles=U.cycles;if(U.reused)this.ctx.reused=U.reused;if(U.external)this.ctx.external=U.external}m4(this.ctx,$);let w=c4(this.ctx,$),{"~standard":J,...z}=w;return z}}var r5={};var U0={};Y4(U0,{xor:()=>C7,xid:()=>X7,void:()=>A7,uuidv7:()=>e5,uuidv6:()=>o5,uuidv4:()=>a5,uuid:()=>t5,url:()=>s5,unknown:()=>M6,union:()=>t2,undefined:()=>b7,ulid:()=>G7,uint64:()=>M7,uint32:()=>D7,tuple:()=>Y3,transform:()=>o2,templateLiteral:()=>o7,symbol:()=>S7,superRefine:()=>x3,success:()=>n7,stringbool:()=>GV,stringFormat:()=>I7,string:()=>w0,strictObject:()=>j7,set:()=>m7,refine:()=>C3,record:()=>Q3,readonly:()=>A3,promise:()=>e7,preprocess:()=>_V,prefault:()=>Z3,pipe:()=>b2,partialRecord:()=>y7,optional:()=>J0,object:()=>k7,number:()=>p9,nullish:()=>d7,nullable:()=>G0,null:()=>s9,nonoptional:()=>D3,never:()=>p2,nativeEnum:()=>c7,nanoid:()=>w7,nan:()=>p7,meta:()=>zV,map:()=>h7,mac:()=>W7,looseRecord:()=>i7,looseObject:()=>u7,literal:()=>r7,lazy:()=>k3,ksuid:()=>_7,keyof:()=>R7,jwt:()=>H7,json:()=>XV,ipv6:()=>Y7,ipv4:()=>N7,invertCodec:()=>a7,intersection:()=>N3,int64:()=>v7,int32:()=>Z7,int:()=>S2,instanceof:()=>JV,httpUrl:()=>$7,hostname:()=>K7,hex:()=>L7,hash:()=>P7,guid:()=>p5,function:()=>s7,float64:()=>T7,float32:()=>O7,file:()=>l7,exactOptional:()=>K3,enum:()=>a2,emoji:()=>U7,email:()=>n5,e164:()=>q7,discriminatedUnion:()=>x7,describe:()=>wV,date:()=>f7,custom:()=>UV,cuid2:()=>J7,cuid:()=>z7,codec:()=>t7,cidrv6:()=>V7,cidrv4:()=>Q7,check:()=>$V,catch:()=>M3,boolean:()=>t9,bigint:()=>F7,base64url:()=>B7,base64:()=>g7,array:()=>W0,any:()=>E7,_function:()=>s7,_default:()=>O3,_ZodString:()=>E2,ZodXor:()=>G3,ZodXID:()=>C2,ZodVoid:()=>z3,ZodUnknown:()=>U3,ZodUnion:()=>Q0,ZodUndefined:()=>o9,ZodUUID:()=>_4,ZodURL:()=>_0,ZodULID:()=>u2,ZodType:()=>c,ZodTuple:()=>W3,ZodTransform:()=>H3,ZodTemplateLiteral:()=>f3,ZodSymbol:()=>a9,ZodSuccess:()=>F3,ZodStringFormat:()=>s,ZodString:()=>iU,ZodSet:()=>g3,ZodRecord:()=>xU,ZodReadonly:()=>E3,ZodPromise:()=>j3,ZodPreprocess:()=>b3,ZodPrefault:()=>T3,ZodPipe:()=>V0,ZodOptional:()=>e2,ZodObject:()=>Y0,ZodNumberFormat:()=>S6,ZodNumber:()=>mU,ZodNullable:()=>L3,ZodNull:()=>e9,ZodNonOptional:()=>s2,ZodNever:()=>w3,ZodNanoID:()=>R2,ZodNaN:()=>S3,ZodMap:()=>V3,ZodMAC:()=>n9,ZodLiteral:()=>B3,ZodLazy:()=>R3,ZodKSUID:()=>x2,ZodJWT:()=>d2,ZodIntersection:()=>_3,ZodIPv6:()=>i2,ZodIPv4:()=>y2,ZodGUID:()=>z0,ZodFunction:()=>u3,ZodFile:()=>q3,ZodExactOptional:()=>I3,ZodEnum:()=>yU,ZodEmoji:()=>f2,ZodEmail:()=>A2,ZodE164:()=>l2,ZodDiscriminatedUnion:()=>X3,ZodDefault:()=>P3,ZodDate:()=>N0,ZodCustomStringFormat:()=>hU,ZodCustom:()=>B0,ZodCodec:()=>g0,ZodCatch:()=>v3,ZodCUID2:()=>j2,ZodCUID:()=>k2,ZodCIDRv6:()=>m2,ZodCIDRv4:()=>h2,ZodBoolean:()=>cU,ZodBigIntFormat:()=>n2,ZodBigInt:()=>rU,ZodBase64URL:()=>r2,ZodBase64:()=>c2,ZodArray:()=>J3,ZodAny:()=>$3});var Z2={};Y4(Z2,{uppercase:()=>FU,trim:()=>AU,toUpperCase:()=>RU,toLowerCase:()=>fU,startsWith:()=>MU,slugify:()=>kU,size:()=>D6,regex:()=>ZU,property:()=>K2,positive:()=>B2,overwrite:()=>p$,normalize:()=>EU,nonpositive:()=>H2,nonnegative:()=>I2,negative:()=>q2,multipleOf:()=>y4,minSize:()=>X4,minLength:()=>P4,mime:()=>bU,maxSize:()=>i4,maxLength:()=>F6,lte:()=>y$,lt:()=>J4,lowercase:()=>DU,length:()=>v6,includes:()=>vU,gte:()=>v$,gt:()=>G4,endsWith:()=>SU});var CU={};Y4(CU,{time:()=>R9,duration:()=>k9,datetime:()=>A9,date:()=>f9,ZodISOTime:()=>v2,ZodISODuration:()=>M2,ZodISODateTime:()=>D2,ZodISODate:()=>F2});var D2=K("ZodISODateTime",($,U)=>{Q_.init($,U),s.init($,U)});function A9($){return Q8(D2,$)}var F2=K("ZodISODate",($,U)=>{V_.init($,U),s.init($,U)});function f9($){return V8(F2,$)}var v2=K("ZodISOTime",($,U)=>{g_.init($,U),s.init($,U)});function R9($){return g8(v2,$)}var M2=K("ZodISODuration",($,U)=>{B_.init($,U),s.init($,U)});function k9($){return B8(M2,$)}var l5=($,U)=>{y1.init($,U),$.name="ZodError",Object.defineProperties($,{format:{value:(w)=>h1($,w)},flatten:{value:(w)=>i1($,w)},addIssue:{value:(w)=>{$.issues.push(w),$.message=JSON.stringify($.issues,BU,2)}},addIssues:{value:(w)=>{$.issues.push(...w),$.message=JSON.stringify($.issues,BU,2)}},isEmpty:{get(){return $.issues.length===0}}})},rP=K("ZodError",l5),E$=K("ZodError",l5,{Parent:Error});var j9=IU(E$),u9=KU(E$),C9=LU(E$),x9=PU(E$),y9=vz(E$),i9=Mz(E$),h9=Sz(E$),m9=bz(E$),c9=Ez(E$),r9=Az(E$),l9=fz(E$),d9=Rz(E$);var d5=new WeakMap;function X0($,U,w){let J=Object.getPrototypeOf($),z=d5.get(J);if(!z)z=new Set,d5.set(J,z);if(z.has(U))return;z.add(U);for(let G in w){let X=w[G];Object.defineProperty(J,G,{configurable:!0,enumerable:!1,get(){let _=X.bind(this);return Object.defineProperty(this,G,{configurable:!0,writable:!0,enumerable:!0,value:_}),_},set(_){Object.defineProperty(this,G,{configurable:!0,writable:!0,enumerable:!0,value:_})}})}}var c=K("ZodType",($,U)=>{return m.init($,U),Object.assign($["~standard"],{jsonSchema:{input:uU($,"input"),output:uU($,"output")}}),$.toJSONSchema=d8($,{}),$.def=U,$.type=U.type,Object.defineProperty($,"_def",{value:U}),$.parse=(w,J)=>j9($,w,J,{callee:$.parse}),$.safeParse=(w,J)=>C9($,w,J),$.parseAsync=async(w,J)=>u9($,w,J,{callee:$.parseAsync}),$.safeParseAsync=async(w,J)=>x9($,w,J),$.spa=$.safeParseAsync,$.encode=(w,J)=>y9($,w,J),$.decode=(w,J)=>i9($,w,J),$.encodeAsync=async(w,J)=>h9($,w,J),$.decodeAsync=async(w,J)=>m9($,w,J),$.safeEncode=(w,J)=>c9($,w,J),$.safeDecode=(w,J)=>r9($,w,J),$.safeEncodeAsync=async(w,J)=>l9($,w,J),$.safeDecodeAsync=async(w,J)=>d9($,w,J),X0($,"ZodType",{check(...w){let J=this.def;return this.clone(v.mergeDefs(J,{checks:[...J.checks??[],...w.map((z)=>typeof z==="function"?{_zod:{check:z,def:{check:"custom"},onattach:[]}}:z)]}),{parent:!0})},with(...w){return this.check(...w)},clone(w,J){return D$(this,w,J)},brand(){return this},register(w,J){return w.add(this,J),this},refine(w,J){return this.check(C3(w,J))},superRefine(w,J){return this.check(x3(w,J))},overwrite(w){return this.check(p$(w))},optional(){return J0(this)},exactOptional(){return K3(this)},nullable(){return G0(this)},nullish(){return J0(G0(this))},nonoptional(w){return D3(this,w)},array(){return W0(this)},or(w){return t2([this,w])},and(w){return N3(this,w)},transform(w){return b2(this,o2(w))},default(w){return O3(this,w)},prefault(w){return Z3(this,w)},catch(w){return M3(this,w)},pipe(w){return b2(this,w)},readonly(){return A3(this)},describe(w){let J=this.clone();return q$.add(J,{description:w}),J},meta(...w){if(w.length===0)return q$.get(this);let J=this.clone();return q$.add(J,w[0]),J},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(w){return w(this)}}),Object.defineProperty($,"description",{get(){return q$.get($)?.description},configurable:!0}),$}),E2=K("_ZodString",($,U)=>{Z6.init($,U),c.init($,U),$._zod.processJSONSchema=(J,z,G)=>n8($,J,z,G);let w=$._zod.bag;$.format=w.format??null,$.minLength=w.minimum??null,$.maxLength=w.maximum??null,X0($,"_ZodString",{regex(...J){return this.check(ZU(...J))},includes(...J){return this.check(vU(...J))},startsWith(...J){return this.check(MU(...J))},endsWith(...J){return this.check(SU(...J))},min(...J){return this.check(P4(...J))},max(...J){return this.check(F6(...J))},length(...J){return this.check(v6(...J))},nonempty(...J){return this.check(P4(1,...J))},lowercase(J){return this.check(DU(J))},uppercase(J){return this.check(FU(J))},trim(){return this.check(AU())},normalize(...J){return this.check(EU(...J))},toLowerCase(){return this.check(fU())},toUpperCase(){return this.check(RU())},slugify(){return this.check(kU())}})}),iU=K("ZodString",($,U)=>{Z6.init($,U),E2.init($,U),$.email=(w)=>$.check(pz(A2,w)),$.url=(w)=>$.check($0(_0,w)),$.jwt=(w)=>$.check(g2(d2,w)),$.emoji=(w)=>$.check(sz(f2,w)),$.guid=(w)=>$.check(s1(z0,w)),$.uuid=(w)=>$.check(tz(_4,w)),$.uuidv4=(w)=>$.check(az(_4,w)),$.uuidv6=(w)=>$.check(oz(_4,w)),$.uuidv7=(w)=>$.check(ez(_4,w)),$.nanoid=(w)=>$.check($2(R2,w)),$.guid=(w)=>$.check(s1(z0,w)),$.cuid=(w)=>$.check(U2(k2,w)),$.cuid2=(w)=>$.check(w2(j2,w)),$.ulid=(w)=>$.check(z2(u2,w)),$.base64=(w)=>$.check(Y2(c2,w)),$.base64url=(w)=>$.check(Q2(r2,w)),$.xid=(w)=>$.check(J2(C2,w)),$.ksuid=(w)=>$.check(G2(x2,w)),$.ipv4=(w)=>$.check(X2(y2,w)),$.ipv6=(w)=>$.check(_2(i2,w)),$.cidrv4=(w)=>$.check(N2(h2,w)),$.cidrv6=(w)=>$.check(W2(m2,w)),$.e164=(w)=>$.check(V2(l2,w)),$.datetime=(w)=>$.check(A9(w)),$.date=(w)=>$.check(f9(w)),$.time=(w)=>$.check(R9(w)),$.duration=(w)=>$.check(k9(w))});function w0($){return _8(iU,$)}var s=K("ZodStringFormat",($,U)=>{e.init($,U),E2.init($,U)}),A2=K("ZodEmail",($,U)=>{w_.init($,U),s.init($,U)});function n5($){return pz(A2,$)}var z0=K("ZodGUID",($,U)=>{$_.init($,U),s.init($,U)});function p5($){return s1(z0,$)}var _4=K("ZodUUID",($,U)=>{U_.init($,U),s.init($,U)});function t5($){return tz(_4,$)}function a5($){return az(_4,$)}function o5($){return oz(_4,$)}function e5($){return ez(_4,$)}var _0=K("ZodURL",($,U)=>{z_.init($,U),s.init($,U)});function s5($){return $0(_0,$)}function $7($){return $0(_0,{protocol:x$.httpProtocol,hostname:x$.domain,...v.normalizeParams($)})}var f2=K("ZodEmoji",($,U)=>{J_.init($,U),s.init($,U)});function U7($){return sz(f2,$)}var R2=K("ZodNanoID",($,U)=>{G_.init($,U),s.init($,U)});function w7($){return $2(R2,$)}var k2=K("ZodCUID",($,U)=>{X_.init($,U),s.init($,U)});function z7($){return U2(k2,$)}var j2=K("ZodCUID2",($,U)=>{__.init($,U),s.init($,U)});function J7($){return w2(j2,$)}var u2=K("ZodULID",($,U)=>{N_.init($,U),s.init($,U)});function G7($){return z2(u2,$)}var C2=K("ZodXID",($,U)=>{W_.init($,U),s.init($,U)});function X7($){return J2(C2,$)}var x2=K("ZodKSUID",($,U)=>{Y_.init($,U),s.init($,U)});function _7($){return G2(x2,$)}var y2=K("ZodIPv4",($,U)=>{q_.init($,U),s.init($,U)});function N7($){return X2(y2,$)}var n9=K("ZodMAC",($,U)=>{I_.init($,U),s.init($,U)});function W7($){return W8(n9,$)}var i2=K("ZodIPv6",($,U)=>{H_.init($,U),s.init($,U)});function Y7($){return _2(i2,$)}var h2=K("ZodCIDRv4",($,U)=>{K_.init($,U),s.init($,U)});function Q7($){return N2(h2,$)}var m2=K("ZodCIDRv6",($,U)=>{L_.init($,U),s.init($,U)});function V7($){return W2(m2,$)}var c2=K("ZodBase64",($,U)=>{O_.init($,U),s.init($,U)});function g7($){return Y2(c2,$)}var r2=K("ZodBase64URL",($,U)=>{T_.init($,U),s.init($,U)});function B7($){return Q2(r2,$)}var l2=K("ZodE164",($,U)=>{Z_.init($,U),s.init($,U)});function q7($){return V2(l2,$)}var d2=K("ZodJWT",($,U)=>{D_.init($,U),s.init($,U)});function H7($){return g2(d2,$)}var hU=K("ZodCustomStringFormat",($,U)=>{F_.init($,U),s.init($,U)});function I7($,U,w={}){return jU(hU,$,U,w)}function K7($){return jU(hU,"hostname",x$.hostname,$)}function L7($){return jU(hU,"hex",x$.hex,$)}function P7($,U){let w=U?.enc??"hex",J=`${$}_${w}`,z=x$[J];if(!z)throw Error(`Unrecognized hash format: ${J}`);return jU(hU,J,z,U)}var mU=K("ZodNumber",($,U)=>{mz.init($,U),c.init($,U),$._zod.processJSONSchema=(J,z,G)=>p8($,J,z,G),X0($,"ZodNumber",{gt(J,z){return this.check(G4(J,z))},gte(J,z){return this.check(v$(J,z))},min(J,z){return this.check(v$(J,z))},lt(J,z){return this.check(J4(J,z))},lte(J,z){return this.check(y$(J,z))},max(J,z){return this.check(y$(J,z))},int(J){return this.check(S2(J))},safe(J){return this.check(S2(J))},positive(J){return this.check(G4(0,J))},nonnegative(J){return this.check(v$(0,J))},negative(J){return this.check(J4(0,J))},nonpositive(J){return this.check(y$(0,J))},multipleOf(J,z){return this.check(y4(J,z))},step(J,z){return this.check(y4(J,z))},finite(){return this}});let w=$._zod.bag;$.minValue=Math.max(w.minimum??Number.NEGATIVE_INFINITY,w.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,$.maxValue=Math.min(w.maximum??Number.POSITIVE_INFINITY,w.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,$.isInt=(w.format??"").includes("int")||Number.isSafeInteger(w.multipleOf??0.5),$.isFinite=!0,$.format=w.format??null});function p9($){return q8(mU,$)}var S6=K("ZodNumberFormat",($,U)=>{v_.init($,U),mU.init($,U)});function S2($){return I8(S6,$)}function O7($){return K8(S6,$)}function T7($){return L8(S6,$)}function Z7($){return P8(S6,$)}function D7($){return O8(S6,$)}var cU=K("ZodBoolean",($,U)=>{l1.init($,U),c.init($,U),$._zod.processJSONSchema=(w,J,z)=>t8($,w,J,z)});function t9($){return T8(cU,$)}var rU=K("ZodBigInt",($,U)=>{cz.init($,U),c.init($,U),$._zod.processJSONSchema=(J,z,G)=>a8($,J,z,G),$.gte=(J,z)=>$.check(v$(J,z)),$.min=(J,z)=>$.check(v$(J,z)),$.gt=(J,z)=>$.check(G4(J,z)),$.gte=(J,z)=>$.check(v$(J,z)),$.min=(J,z)=>$.check(v$(J,z)),$.lt=(J,z)=>$.check(J4(J,z)),$.lte=(J,z)=>$.check(y$(J,z)),$.max=(J,z)=>$.check(y$(J,z)),$.positive=(J)=>$.check(G4(BigInt(0),J)),$.negative=(J)=>$.check(J4(BigInt(0),J)),$.nonpositive=(J)=>$.check(y$(BigInt(0),J)),$.nonnegative=(J)=>$.check(v$(BigInt(0),J)),$.multipleOf=(J,z)=>$.check(y4(J,z));let w=$._zod.bag;$.minValue=w.minimum??null,$.maxValue=w.maximum??null,$.format=w.format??null});function F7($){return D8(rU,$)}var n2=K("ZodBigIntFormat",($,U)=>{M_.init($,U),rU.init($,U)});function v7($){return v8(n2,$)}function M7($){return M8(n2,$)}var a9=K("ZodSymbol",($,U)=>{S_.init($,U),c.init($,U),$._zod.processJSONSchema=(w,J,z)=>o8($,w,J,z)});function S7($){return S8(a9,$)}var o9=K("ZodUndefined",($,U)=>{b_.init($,U),c.init($,U),$._zod.processJSONSchema=(w,J,z)=>s8($,w,J,z)});function b7($){return b8(o9,$)}var e9=K("ZodNull",($,U)=>{E_.init($,U),c.init($,U),$._zod.processJSONSchema=(w,J,z)=>e8($,w,J,z)});function s9($){return E8(e9,$)}var $3=K("ZodAny",($,U)=>{A_.init($,U),c.init($,U),$._zod.processJSONSchema=(w,J,z)=>w9($,w,J,z)});function E7(){return A8($3)}var U3=K("ZodUnknown",($,U)=>{f_.init($,U),c.init($,U),$._zod.processJSONSchema=(w,J,z)=>z9($,w,J,z)});function M6(){return f8(U3)}var w3=K("ZodNever",($,U)=>{R_.init($,U),c.init($,U),$._zod.processJSONSchema=(w,J,z)=>U9($,w,J,z)});function p2($){return R8(w3,$)}var z3=K("ZodVoid",($,U)=>{k_.init($,U),c.init($,U),$._zod.processJSONSchema=(w,J,z)=>$9($,w,J,z)});function A7($){return k8(z3,$)}var N0=K("ZodDate",($,U)=>{j_.init($,U),c.init($,U),$._zod.processJSONSchema=(J,z,G)=>J9($,J,z,G),$.min=(J,z)=>$.check(v$(J,z)),$.max=(J,z)=>$.check(y$(J,z));let w=$._zod.bag;$.minDate=w.minimum?new Date(w.minimum):null,$.maxDate=w.maximum?new Date(w.maximum):null});function f7($){return j8(N0,$)}var J3=K("ZodArray",($,U)=>{u_.init($,U),c.init($,U),$._zod.processJSONSchema=(w,J,z)=>H9($,w,J,z),$.element=U.element,X0($,"ZodArray",{min(w,J){return this.check(P4(w,J))},nonempty(w){return this.check(P4(1,w))},max(w,J){return this.check(F6(w,J))},length(w,J){return this.check(v6(w,J))},unwrap(){return this.element}})});function W0($,U){return x8(J3,$,U)}function R7($){let U=$._zod.def.shape;return a2(Object.keys(U))}var Y0=K("ZodObject",($,U)=>{C_.init($,U),c.init($,U),$._zod.processJSONSchema=(w,J,z)=>I9($,w,J,z),v.defineLazy($,"shape",()=>{return U.shape}),X0($,"ZodObject",{keyof(){return a2(Object.keys(this._zod.def.shape))},catchall(w){return this.clone({...this._zod.def,catchall:w})},passthrough(){return this.clone({...this._zod.def,catchall:M6()})},loose(){return this.clone({...this._zod.def,catchall:M6()})},strict(){return this.clone({...this._zod.def,catchall:p2()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(w){return v.extend(this,w)},safeExtend(w){return v.safeExtend(this,w)},merge(w){return v.merge(this,w)},pick(w){return v.pick(this,w)},omit(w){return v.omit(this,w)},partial(...w){return v.partial(e2,this,w[0])},required(...w){return v.required(s2,this,w[0])}})});function k7($,U){let w={type:"object",shape:$??{},...v.normalizeParams(U)};return new Y0(w)}function j7($,U){return new Y0({type:"object",shape:$,catchall:p2(),...v.normalizeParams(U)})}function u7($,U){return new Y0({type:"object",shape:$,catchall:M6(),...v.normalizeParams(U)})}var Q0=K("ZodUnion",($,U)=>{d1.init($,U),c.init($,U),$._zod.processJSONSchema=(w,J,z)=>P2($,w,J,z),$.options=U.options});function t2($,U){return new Q0({type:"union",options:$,...v.normalizeParams(U)})}var G3=K("ZodXor",($,U)=>{Q0.init($,U),x_.init($,U),$._zod.processJSONSchema=(w,J,z)=>P2($,w,J,z),$.options=U.options});function C7($,U){return new G3({type:"union",options:$,inclusive:!1,...v.normalizeParams(U)})}var X3=K("ZodDiscriminatedUnion",($,U)=>{Q0.init($,U),y_.init($,U)});function x7($,U,w){return new X3({type:"union",options:U,discriminator:$,...v.normalizeParams(w)})}var _3=K("ZodIntersection",($,U)=>{i_.init($,U),c.init($,U),$._zod.processJSONSchema=(w,J,z)=>K9($,w,J,z)});function N3($,U){return new _3({type:"intersection",left:$,right:U})}var W3=K("ZodTuple",($,U)=>{rz.init($,U),c.init($,U),$._zod.processJSONSchema=(w,J,z)=>L9($,w,J,z),$.rest=(w)=>$.clone({...$._zod.def,rest:w})});function Y3($,U,w){let J=U instanceof m,z=J?w:U;return new W3({type:"tuple",items:$,rest:J?U:null,...v.normalizeParams(z)})}var xU=K("ZodRecord",($,U)=>{h_.init($,U),c.init($,U),$._zod.processJSONSchema=(w,J,z)=>P9($,w,J,z),$.keyType=U.keyType,$.valueType=U.valueType});function Q3($,U,w){if(!U||!U._zod)return new xU({type:"record",keyType:w0(),valueType:$,...v.normalizeParams(U)});return new xU({type:"record",keyType:$,valueType:U,...v.normalizeParams(w)})}function y7($,U,w){let J=D$($);return J._zod.values=void 0,new xU({type:"record",keyType:J,valueType:U,...v.normalizeParams(w)})}function i7($,U,w){return new xU({type:"record",keyType:$,valueType:U,mode:"loose",...v.normalizeParams(w)})}var V3=K("ZodMap",($,U)=>{m_.init($,U),c.init($,U),$._zod.processJSONSchema=(w,J,z)=>B9($,w,J,z),$.keyType=U.keyType,$.valueType=U.valueType,$.min=(...w)=>$.check(X4(...w)),$.nonempty=(w)=>$.check(X4(1,w)),$.max=(...w)=>$.check(i4(...w)),$.size=(...w)=>$.check(D6(...w))});function h7($,U,w){return new V3({type:"map",keyType:$,valueType:U,...v.normalizeParams(w)})}var g3=K("ZodSet",($,U)=>{c_.init($,U),c.init($,U),$._zod.processJSONSchema=(w,J,z)=>q9($,w,J,z),$.min=(...w)=>$.check(X4(...w)),$.nonempty=(w)=>$.check(X4(1,w)),$.max=(...w)=>$.check(i4(...w)),$.size=(...w)=>$.check(D6(...w))});function m7($,U){return new g3({type:"set",valueType:$,...v.normalizeParams(U)})}var yU=K("ZodEnum",($,U)=>{r_.init($,U),c.init($,U),$._zod.processJSONSchema=(J,z,G)=>G9($,J,z,G),$.enum=U.entries,$.options=Object.values(U.entries);let w=new Set(Object.keys(U.entries));$.extract=(J,z)=>{let G={};for(let X of J)if(w.has(X))G[X]=U.entries[X];else throw Error(`Key ${X} not found in enum`);return new yU({...U,checks:[],...v.normalizeParams(z),entries:G})},$.exclude=(J,z)=>{let G={...U.entries};for(let X of J)if(w.has(X))delete G[X];else throw Error(`Key ${X} not found in enum`);return new yU({...U,checks:[],...v.normalizeParams(z),entries:G})}});function a2($,U){let w=Array.isArray($)?Object.fromEntries($.map((J)=>[J,J])):$;return new yU({type:"enum",entries:w,...v.normalizeParams(U)})}function c7($,U){return new yU({type:"enum",entries:$,...v.normalizeParams(U)})}var B3=K("ZodLiteral",($,U)=>{l_.init($,U),c.init($,U),$._zod.processJSONSchema=(w,J,z)=>X9($,w,J,z),$.values=new Set(U.values),Object.defineProperty($,"value",{get(){if(U.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return U.values[0]}})});function r7($,U){return new B3({type:"literal",values:Array.isArray($)?$:[$],...v.normalizeParams(U)})}var q3=K("ZodFile",($,U)=>{d_.init($,U),c.init($,U),$._zod.processJSONSchema=(w,J,z)=>W9($,w,J,z),$.min=(w,J)=>$.check(X4(w,J)),$.max=(w,J)=>$.check(i4(w,J)),$.mime=(w,J)=>$.check(bU(Array.isArray(w)?w:[w],J))});function l7($){return y8(q3,$)}var H3=K("ZodTransform",($,U)=>{n_.init($,U),c.init($,U),$._zod.processJSONSchema=(w,J,z)=>g9($,w,J,z),$._zod.parse=(w,J)=>{if(J.direction==="backward")throw new P6($.constructor.name);w.addIssue=(G)=>{if(typeof G==="string")w.issues.push(v.issue(G,w.value,U));else{let X=G;if(X.fatal)X.continue=!1;X.code??(X.code="custom"),X.input??(X.input=w.value),X.inst??(X.inst=$),w.issues.push(v.issue(X))}};let z=U.transform(w.value,w);if(z instanceof Promise)return z.then((G)=>{return w.value=G,w.fallback=!0,w});return w.value=z,w.fallback=!0,w}});function o2($){return new H3({type:"transform",transform:$})}var e2=K("ZodOptional",($,U)=>{lz.init($,U),c.init($,U),$._zod.processJSONSchema=(w,J,z)=>O2($,w,J,z),$.unwrap=()=>$._zod.def.innerType});function J0($){return new e2({type:"optional",innerType:$})}var I3=K("ZodExactOptional",($,U)=>{p_.init($,U),c.init($,U),$._zod.processJSONSchema=(w,J,z)=>O2($,w,J,z),$.unwrap=()=>$._zod.def.innerType});function K3($){return new I3({type:"optional",innerType:$})}var L3=K("ZodNullable",($,U)=>{t_.init($,U),c.init($,U),$._zod.processJSONSchema=(w,J,z)=>O9($,w,J,z),$.unwrap=()=>$._zod.def.innerType});function G0($){return new L3({type:"nullable",innerType:$})}function d7($){return J0(G0($))}var P3=K("ZodDefault",($,U)=>{a_.init($,U),c.init($,U),$._zod.processJSONSchema=(w,J,z)=>Z9($,w,J,z),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});function O3($,U){return new P3({type:"default",innerType:$,get defaultValue(){return typeof U==="function"?U():v.shallowClone(U)}})}var T3=K("ZodPrefault",($,U)=>{o_.init($,U),c.init($,U),$._zod.processJSONSchema=(w,J,z)=>D9($,w,J,z),$.unwrap=()=>$._zod.def.innerType});function Z3($,U){return new T3({type:"prefault",innerType:$,get defaultValue(){return typeof U==="function"?U():v.shallowClone(U)}})}var s2=K("ZodNonOptional",($,U)=>{e_.init($,U),c.init($,U),$._zod.processJSONSchema=(w,J,z)=>T9($,w,J,z),$.unwrap=()=>$._zod.def.innerType});function D3($,U){return new s2({type:"nonoptional",innerType:$,...v.normalizeParams(U)})}var F3=K("ZodSuccess",($,U)=>{s_.init($,U),c.init($,U),$._zod.processJSONSchema=(w,J,z)=>Y9($,w,J,z),$.unwrap=()=>$._zod.def.innerType});function n7($){return new F3({type:"success",innerType:$})}var v3=K("ZodCatch",($,U)=>{$N.init($,U),c.init($,U),$._zod.processJSONSchema=(w,J,z)=>F9($,w,J,z),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});function M3($,U){return new v3({type:"catch",innerType:$,catchValue:typeof U==="function"?U:()=>U})}var S3=K("ZodNaN",($,U)=>{UN.init($,U),c.init($,U),$._zod.processJSONSchema=(w,J,z)=>_9($,w,J,z)});function p7($){return C8(S3,$)}var V0=K("ZodPipe",($,U)=>{dz.init($,U),c.init($,U),$._zod.processJSONSchema=(w,J,z)=>v9($,w,J,z),$.in=U.in,$.out=U.out});function b2($,U){return new V0({type:"pipe",in:$,out:U})}var g0=K("ZodCodec",($,U)=>{V0.init($,U),n1.init($,U)});function t7($,U,w){return new g0({type:"pipe",in:$,out:U,transform:w.decode,reverseTransform:w.encode})}function a7($){let U=$._zod.def;return new g0({type:"pipe",in:U.out,out:U.in,transform:U.reverseTransform,reverseTransform:U.transform})}var b3=K("ZodPreprocess",($,U)=>{V0.init($,U),wN.init($,U)}),E3=K("ZodReadonly",($,U)=>{zN.init($,U),c.init($,U),$._zod.processJSONSchema=(w,J,z)=>M9($,w,J,z),$.unwrap=()=>$._zod.def.innerType});function A3($){return new E3({type:"readonly",innerType:$})}var f3=K("ZodTemplateLiteral",($,U)=>{JN.init($,U),c.init($,U),$._zod.processJSONSchema=(w,J,z)=>N9($,w,J,z)});function o7($,U){return new f3({type:"template_literal",parts:$,...v.normalizeParams(U)})}var R3=K("ZodLazy",($,U)=>{_N.init($,U),c.init($,U),$._zod.processJSONSchema=(w,J,z)=>b9($,w,J,z),$.unwrap=()=>$._zod.def.getter()});function k3($){return new R3({type:"lazy",getter:$})}var j3=K("ZodPromise",($,U)=>{XN.init($,U),c.init($,U),$._zod.processJSONSchema=(w,J,z)=>S9($,w,J,z),$.unwrap=()=>$._zod.def.innerType});function e7($){return new j3({type:"promise",innerType:$})}var u3=K("ZodFunction",($,U)=>{GN.init($,U),c.init($,U),$._zod.processJSONSchema=(w,J,z)=>V9($,w,J,z)});function s7($){return new u3({type:"function",input:Array.isArray($?.input)?Y3($?.input):$?.input??W0(M6()),output:$?.output??M6()})}var B0=K("ZodCustom",($,U)=>{NN.init($,U),c.init($,U),$._zod.processJSONSchema=(w,J,z)=>Q9($,w,J,z)});function $V($){let U=new $$({check:"custom"});return U._zod.check=$,U}function UV($,U){return i8(B0,$??(()=>!0),U)}function C3($,U={}){return h8(B0,$,U)}function x3($,U){return m8($,U)}var wV=c8,zV=r8;function JV($,U={}){let w=new B0({type:"custom",check:"custom",fn:(J)=>J instanceof $,abort:!0,...v.normalizeParams(U)});return w._zod.bag.Class=$,w._zod.check=(J)=>{if(!(J.value instanceof $))J.issues.push({code:"invalid_type",expected:$.name,input:J.value,inst:w,path:[...w._zod.def.path??[]]})},w}var GV=(...$)=>l8({Codec:g0,Boolean:cU,String:iU},...$);function XV($){let U=k3(()=>{return t2([w0($),p9(),t9(),s9(),W0(U),Q3(w0(),U)])});return U}function _V($,U){return new b3({type:"pipe",in:o2($),out:U})}var dP={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 nP($){G$({customError:$})}function pP(){return G$().customError}var y3;(function($){})(y3||(y3={}));var j={...U0,...Z2,iso:CU},tP=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 aP($,U){let w=$.$schema;if(w==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(w==="http://json-schema.org/draft-07/schema#")return"draft-7";if(w==="http://json-schema.org/draft-04/schema#")return"draft-4";return U??"draft-2020-12"}function oP($,U){if(!$.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let w=$.slice(1).split("/").filter(Boolean);if(w.length===0)return U.rootSchema;let J=U.version==="draft-2020-12"?"$defs":"definitions";if(w[0]===J){let z=w[1];if(!z||!U.defs[z])throw Error(`Reference not found: ${$}`);return U.defs[z]}throw Error(`Reference not found: ${$}`)}function NV($,U){if($.not!==void 0){if(typeof $.not==="object"&&Object.keys($.not).length===0)return j.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 z=$.$ref;if(U.refs.has(z))return U.refs.get(z);if(U.processing.has(z))return j.lazy(()=>{if(!U.refs.has(z))throw Error(`Circular reference not resolved: ${z}`);return U.refs.get(z)});U.processing.add(z);let G=oP(z,U),X=P$(G,U);return U.refs.set(z,X),U.processing.delete(z),X}if($.enum!==void 0){let z=$.enum;if(U.version==="openapi-3.0"&&$.nullable===!0&&z.length===1&&z[0]===null)return j.null();if(z.length===0)return j.never();if(z.length===1)return j.literal(z[0]);if(z.every((X)=>typeof X==="string"))return j.enum(z);let G=z.map((X)=>j.literal(X));if(G.length<2)return G[0];return j.union([G[0],G[1],...G.slice(2)])}if($.const!==void 0)return j.literal($.const);let w=$.type;if(Array.isArray(w)){let z=w.map((G)=>{let X={...$,type:G};return NV(X,U)});if(z.length===0)return j.never();if(z.length===1)return z[0];return j.union(z)}if(!w)return j.any();let J;switch(w){case"string":{let z=j.string();if($.format){let G=$.format;if(G==="email")z=z.check(j.email());else if(G==="uri"||G==="uri-reference")z=z.check(j.url());else if(G==="uuid"||G==="guid")z=z.check(j.uuid());else if(G==="date-time")z=z.check(j.iso.datetime());else if(G==="date")z=z.check(j.iso.date());else if(G==="time")z=z.check(j.iso.time());else if(G==="duration")z=z.check(j.iso.duration());else if(G==="ipv4")z=z.check(j.ipv4());else if(G==="ipv6")z=z.check(j.ipv6());else if(G==="mac")z=z.check(j.mac());else if(G==="cidr")z=z.check(j.cidrv4());else if(G==="cidr-v6")z=z.check(j.cidrv6());else if(G==="base64")z=z.check(j.base64());else if(G==="base64url")z=z.check(j.base64url());else if(G==="e164")z=z.check(j.e164());else if(G==="jwt")z=z.check(j.jwt());else if(G==="emoji")z=z.check(j.emoji());else if(G==="nanoid")z=z.check(j.nanoid());else if(G==="cuid")z=z.check(j.cuid());else if(G==="cuid2")z=z.check(j.cuid2());else if(G==="ulid")z=z.check(j.ulid());else if(G==="xid")z=z.check(j.xid());else if(G==="ksuid")z=z.check(j.ksuid())}if(typeof $.minLength==="number")z=z.min($.minLength);if(typeof $.maxLength==="number")z=z.max($.maxLength);if($.pattern)z=z.regex(new RegExp($.pattern));J=z;break}case"number":case"integer":{let z=w==="integer"?j.number().int():j.number();if(typeof $.minimum==="number")z=z.min($.minimum);if(typeof $.maximum==="number")z=z.max($.maximum);if(typeof $.exclusiveMinimum==="number")z=z.gt($.exclusiveMinimum);else if($.exclusiveMinimum===!0&&typeof $.minimum==="number")z=z.gt($.minimum);if(typeof $.exclusiveMaximum==="number")z=z.lt($.exclusiveMaximum);else if($.exclusiveMaximum===!0&&typeof $.maximum==="number")z=z.lt($.maximum);if(typeof $.multipleOf==="number")z=z.multipleOf($.multipleOf);J=z;break}case"boolean":{J=j.boolean();break}case"null":{J=j.null();break}case"object":{let z={},G=$.properties||{},X=new Set($.required||[]);for(let[N,W]of Object.entries(G)){let Y=P$(W,U);z[N]=X.has(N)?Y:Y.optional()}if($.propertyNames){let N=P$($.propertyNames,U),W=$.additionalProperties&&typeof $.additionalProperties==="object"?P$($.additionalProperties,U):j.any();if(Object.keys(z).length===0){J=j.record(N,W);break}let Y=j.object(z).passthrough(),Q=j.looseRecord(N,W);J=j.intersection(Y,Q);break}if($.patternProperties){let N=$.patternProperties,W=Object.keys(N),Y=[];for(let V of W){let g=P$(N[V],U),H=j.string().regex(new RegExp(V));Y.push(j.looseRecord(H,g))}let Q=[];if(Object.keys(z).length>0)Q.push(j.object(z).passthrough());if(Q.push(...Y),Q.length===0)J=j.object({}).passthrough();else if(Q.length===1)J=Q[0];else{let V=j.intersection(Q[0],Q[1]);for(let g=2;g<Q.length;g++)V=j.intersection(V,Q[g]);J=V}break}let _=j.object(z);if($.additionalProperties===!1)J=_.strict();else if(typeof $.additionalProperties==="object")J=_.catchall(P$($.additionalProperties,U));else J=_.passthrough();break}case"array":{let{prefixItems:z,items:G}=$;if(z&&Array.isArray(z)){let X=z.map((N)=>P$(N,U)),_=G&&typeof G==="object"&&!Array.isArray(G)?P$(G,U):void 0;if(_)J=j.tuple(X).rest(_);else J=j.tuple(X);if(typeof $.minItems==="number")J=J.check(j.minLength($.minItems));if(typeof $.maxItems==="number")J=J.check(j.maxLength($.maxItems))}else if(Array.isArray(G)){let X=G.map((N)=>P$(N,U)),_=$.additionalItems&&typeof $.additionalItems==="object"?P$($.additionalItems,U):void 0;if(_)J=j.tuple(X).rest(_);else J=j.tuple(X);if(typeof $.minItems==="number")J=J.check(j.minLength($.minItems));if(typeof $.maxItems==="number")J=J.check(j.maxLength($.maxItems))}else if(G!==void 0){let X=P$(G,U),_=j.array(X);if(typeof $.minItems==="number")_=_.min($.minItems);if(typeof $.maxItems==="number")_=_.max($.maxItems);J=_}else J=j.array(j.any());break}default:throw Error(`Unsupported type: ${w}`)}return J}function P$($,U){if(typeof $==="boolean")return $?j.any():j.never();let w=NV($,U),J=$.type||$.enum!==void 0||$.const!==void 0;if($.anyOf&&Array.isArray($.anyOf)){let _=$.anyOf.map((W)=>P$(W,U)),N=j.union(_);w=J?j.intersection(w,N):N}if($.oneOf&&Array.isArray($.oneOf)){let _=$.oneOf.map((W)=>P$(W,U)),N=j.xor(_);w=J?j.intersection(w,N):N}if($.allOf&&Array.isArray($.allOf))if($.allOf.length===0)w=J?w:j.any();else{let _=J?w:P$($.allOf[0],U),N=J?0:1;for(let W=N;W<$.allOf.length;W++)_=j.intersection(_,P$($.allOf[W],U));w=_}if($.nullable===!0&&U.version==="openapi-3.0")w=j.nullable(w);if($.readOnly===!0)w=j.readonly(w);if($.default!==void 0)w=w.default($.default);let z={},G=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let _ of G)if(_ in $)z[_]=$[_];let X=["contentEncoding","contentMediaType","contentSchema"];for(let _ of X)if(_ in $)z[_]=$[_];for(let _ of Object.keys($))if(!tP.has(_))z[_]=$[_];if(Object.keys(z).length>0)U.registry.add(w,z);if($.description)w=w.describe($.description);return w}function WV($,U){if(typeof $==="boolean")return $?j.any():j.never();let w;try{w=JSON.parse(JSON.stringify($))}catch{throw Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let J=aP(w,U?.defaultTarget),z=w.$defs||w.definitions||{},G={version:J,defs:z,refs:new Map,processing:new Set,rootSchema:w,registry:U?.registry??q$};return P$(w,G)}var i3={};Y4(i3,{string:()=>eP,number:()=>sP,date:()=>wO,boolean:()=>$O,bigint:()=>UO});function eP($){return N8(iU,$)}function sP($){return H8(mU,$)}function $O($){return Z8(cU,$)}function UO($){return F8(rU,$)}function wO($){return u8(N0,$)}G$(p1());import{join as zO}from"node:path";function lU($){if($)return $;if(process.env.PLOOF_HOME)return process.env.PLOOF_HOME;return zO(process.env.HOME??process.cwd(),".ploof")}var QO=y.object({apiKey:y.string().optional(),organization:y.string().optional(),project:y.string().optional(),baseURL:y.string().optional()}),VO=y.object({providers:y.record(y.string(),y.object({defaultProfile:y.string().default("default"),profiles:y.record(y.string(),QO).default({})})).default({})});class T4{credPath;constructor($){this.credPath=YO(lU($),"credentials.json")}login($,U,w,J=!0){if(!w.apiKey)throw Error("API key is required.");let z=this.read(),G=z.providers[$]??{defaultProfile:U,profiles:{}};if(G.profiles[U]=w,J)G.defaultProfile=U;z.providers[$]=G,this.write(z)}logout($,U){let w=this.read(),J=w.providers[$];if(!J)return!1;let z=U??J.defaultProfile;if(!J.profiles[z])return!1;delete J.profiles[z];let G=Object.keys(J.profiles);if(G.length===0)delete w.providers[$];else if(J.defaultProfile===z)J.defaultProfile=G[0];return this.write(w),!0}listProfiles($){let U=this.read(),w={};for(let[J,z]of Object.entries(U.providers)){if($&&J!==$)continue;w[J]=Object.keys(z.profiles)}return w}getDefaultProfile($){return this.read().providers[$]?.defaultProfile??"default"}getCredential($,U){if($==="openai"){let X=process.env.PLOOF_OPENAI_API_KEY??process.env.OPENAI_API_KEY;if(X)return{apiKey:X,organization:process.env.PLOOF_OPENAI_ORG,project:process.env.PLOOF_OPENAI_PROJECT,baseURL:process.env.PLOOF_OPENAI_BASE_URL,source:"env",profile:U??"env"}}let J=this.read().providers[$];if(!J)return null;let z=U??J.defaultProfile,G=J.profiles[z];if(!G?.apiKey)return null;return{...G,source:"stored",profile:z}}status($,U){let w=U??this.getDefaultProfile($),J=this.getCredential($,U);if(!J?.apiKey)return{provider:$,profile:w,authenticated:!1};return{provider:$,profile:J.profile??w,authenticated:!0,source:J.source,keyPrefix:gO(J.apiKey),organization:J.organization,project:J.project,baseURL:J.baseURL}}read(){try{if(!GO(this.credPath))return{providers:{}};let $=_O(this.credPath,"utf-8");return VO.parse(JSON.parse($))}catch{return{providers:{}}}}write($){XO(WO(this.credPath),{recursive:!0}),NO(this.credPath,`${JSON.stringify($,null,2)}
|
|
255
|
-
`,{mode:384});try{
|
|
256
|
-
`)}}var
|
|
254
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let g of $.seen.entries()){let V=g[1];if(w===g[0]){z(g);continue}if($.external){let G=$.external.registry.get(g[0])?.id;if(w!==g[0]&&G){z(g);continue}}if($.metadataRegistry.get(g[0])?.id){z(g);continue}if(V.cycle){z(g);continue}if(V.count>1){if($.reused==="ref"){z(g);continue}}}}function o4($,w){let U=$.seen.get(w);if(!U)throw Error("Unprocessed schema. This is a bug in Zod.");let v=(V)=>{let _=$.seen.get(V);if(_.ref===null)return;let G=_.def??_.schema,X={...G},I=_.ref;if(_.ref=null,I){v(I);let W=$.seen.get(I),P=W.schema;if(P.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))G.allOf=G.allOf??[],G.allOf.push(P);else Object.assign(G,P);if(Object.assign(G,X),V._zod.parent===I)for(let H in G){if(H==="$ref"||H==="allOf")continue;if(!(H in X))delete G[H]}if(P.$ref&&W.def)for(let H in G){if(H==="$ref"||H==="allOf")continue;if(H in W.def&&JSON.stringify(G[H])===JSON.stringify(W.def[H]))delete G[H]}}let N=V._zod.parent;if(N&&N!==I){v(N);let W=$.seen.get(N);if(W?.schema.$ref){if(G.$ref=W.schema.$ref,W.def)for(let P in G){if(P==="$ref"||P==="allOf")continue;if(P in W.def&&JSON.stringify(G[P])===JSON.stringify(W.def[P]))delete G[P]}}}$.override({zodSchema:V,jsonSchema:G,path:_.path??[]})};for(let V of[...$.seen.entries()].reverse())v(V[0]);let J={};if($.target==="draft-2020-12")J.$schema="https://json-schema.org/draft/2020-12/schema";else if($.target==="draft-07")J.$schema="http://json-schema.org/draft-07/schema#";else if($.target==="draft-04")J.$schema="http://json-schema.org/draft-04/schema#";else if($.target==="openapi-3.0");if($.external?.uri){let V=$.external.registry.get(w)?.id;if(!V)throw Error("Schema is missing an `id` property");J.$id=$.external.uri(V)}Object.assign(J,U.def??U.schema);let z=$.metadataRegistry.get(w)?.id;if(z!==void 0&&J.id===z)delete J.id;let g=$.external?.defs??{};for(let V of $.seen.entries()){let _=V[1];if(_.def&&_.defId){if(_.def.id===_.defId)delete _.def.id;g[_.defId]=_.def}}if($.external);else if(Object.keys(g).length>0)if($.target==="draft-2020-12")J.$defs=g;else J.definitions=g;try{let V=JSON.parse(JSON.stringify(J));return Object.defineProperty(V,"~standard",{value:{...w["~standard"],jsonSchema:{input:cw(w,"input",$.processors),output:cw(w,"output",$.processors)}},enumerable:!1,writable:!1}),V}catch(V){throw Error("Error converting schema to JSON.")}}function F$($,w){let U=w??{seen:new Set};if(U.seen.has($))return!1;U.seen.add($);let v=$._zod.def;if(v.type==="transform")return!0;if(v.type==="array")return F$(v.element,U);if(v.type==="set")return F$(v.valueType,U);if(v.type==="lazy")return F$(v.getter(),U);if(v.type==="promise"||v.type==="optional"||v.type==="nonoptional"||v.type==="nullable"||v.type==="readonly"||v.type==="default"||v.type==="prefault")return F$(v.innerType,U);if(v.type==="intersection")return F$(v.left,U)||F$(v.right,U);if(v.type==="record"||v.type==="map")return F$(v.keyType,U)||F$(v.valueType,U);if(v.type==="pipe"){if($._zod.traits.has("$ZodCodec"))return!0;return F$(v.in,U)||F$(v.out,U)}if(v.type==="object"){for(let J in v.shape)if(F$(v.shape[J],U))return!0;return!1}if(v.type==="union"){for(let J of v.options)if(F$(J,U))return!0;return!1}if(v.type==="tuple"){for(let J of v.items)if(F$(J,U))return!0;if(v.rest&&F$(v.rest,U))return!0;return!1}return!1}var VX=($,w={})=>(U)=>{let v=l4({...U,processors:w});return p($,v),t4(v,$),o4(v,$)},cw=($,w,U={})=>(v)=>{let{libraryOptions:J,target:z}=v??{},g=l4({...J??{},target:z,io:w,processors:U});return p($,g),t4(g,$),o4(g,$)};var HH={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},GX=($,w,U,v)=>{let J=U;J.type="string";let{minimum:z,maximum:g,format:V,patterns:_,contentEncoding:G}=$._zod.bag;if(typeof z==="number")J.minLength=z;if(typeof g==="number")J.maxLength=g;if(V){if(J.format=HH[V]??V,J.format==="")delete J.format;if(V==="time")delete J.format}if(G)J.contentEncoding=G;if(_&&_.size>0){let X=[..._];if(X.length===1)J.pattern=X[0].source;else if(X.length>1)J.allOf=[...X.map((I)=>({...w.target==="draft-07"||w.target==="draft-04"||w.target==="openapi-3.0"?{type:"string"}:{},pattern:I.source}))]}},_X=($,w,U,v)=>{let J=U,{minimum:z,maximum:g,format:V,multipleOf:_,exclusiveMaximum:G,exclusiveMinimum:X}=$._zod.bag;if(typeof V==="string"&&V.includes("int"))J.type="integer";else J.type="number";let I=typeof X==="number"&&X>=(z??Number.NEGATIVE_INFINITY),N=typeof G==="number"&&G<=(g??Number.POSITIVE_INFINITY),W=w.target==="draft-04"||w.target==="openapi-3.0";if(I)if(W)J.minimum=X,J.exclusiveMinimum=!0;else J.exclusiveMinimum=X;else if(typeof z==="number")J.minimum=z;if(N)if(W)J.maximum=G,J.exclusiveMaximum=!0;else J.exclusiveMaximum=G;else if(typeof g==="number")J.maximum=g;if(typeof _==="number")J.multipleOf=_},XX=($,w,U,v)=>{U.type="boolean"},IX=($,w,U,v)=>{if(w.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},NX=($,w,U,v)=>{if(w.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},WX=($,w,U,v)=>{if(w.target==="openapi-3.0")U.type="string",U.nullable=!0,U.enum=[null];else U.type="null"},YX=($,w,U,v)=>{if(w.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},QX=($,w,U,v)=>{if(w.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},PX=($,w,U,v)=>{U.not={}},OX=($,w,U,v)=>{},BX=($,w,U,v)=>{},qX=($,w,U,v)=>{if(w.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},LX=($,w,U,v)=>{let J=$._zod.def,z=n1(J.entries);if(z.every((g)=>typeof g==="number"))U.type="number";if(z.every((g)=>typeof g==="string"))U.type="string";U.enum=z},HX=($,w,U,v)=>{let J=$._zod.def,z=[];for(let g of J.values)if(g===void 0){if(w.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof g==="bigint")if(w.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else z.push(Number(g));else z.push(g);if(z.length===0);else if(z.length===1){let g=z[0];if(U.type=g===null?"null":typeof g,w.target==="draft-04"||w.target==="openapi-3.0")U.enum=[g];else U.const=g}else{if(z.every((g)=>typeof g==="number"))U.type="number";if(z.every((g)=>typeof g==="string"))U.type="string";if(z.every((g)=>typeof g==="boolean"))U.type="boolean";if(z.every((g)=>g===null))U.type="null";U.enum=z}},uX=($,w,U,v)=>{if(w.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},KX=($,w,U,v)=>{let J=U,z=$._zod.pattern;if(!z)throw Error("Pattern not found in template literal");J.type="string",J.pattern=z.source},DX=($,w,U,v)=>{let J=U,z={type:"string",format:"binary",contentEncoding:"binary"},{minimum:g,maximum:V,mime:_}=$._zod.bag;if(g!==void 0)z.minLength=g;if(V!==void 0)z.maxLength=V;if(_)if(_.length===1)z.contentMediaType=_[0],Object.assign(J,z);else Object.assign(J,z),J.anyOf=_.map((G)=>({contentMediaType:G}));else Object.assign(J,z)},fX=($,w,U,v)=>{U.type="boolean"},TX=($,w,U,v)=>{if(w.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},ZX=($,w,U,v)=>{if(w.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},bX=($,w,U,v)=>{if(w.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},FX=($,w,U,v)=>{if(w.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},MX=($,w,U,v)=>{if(w.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},iX=($,w,U,v)=>{let J=U,z=$._zod.def,{minimum:g,maximum:V}=$._zod.bag;if(typeof g==="number")J.minItems=g;if(typeof V==="number")J.maxItems=V;J.type="array",J.items=p(z.element,w,{...v,path:[...v.path,"items"]})},EX=($,w,U,v)=>{let J=U,z=$._zod.def;J.type="object",J.properties={};let g=z.shape;for(let G in g)J.properties[G]=p(g[G],w,{...v,path:[...v.path,"properties",G]});let V=new Set(Object.keys(g)),_=new Set([...V].filter((G)=>{let X=z.shape[G]._zod;if(w.io==="input")return X.optin===void 0;else return X.optout===void 0}));if(_.size>0)J.required=Array.from(_);if(z.catchall?._zod.def.type==="never")J.additionalProperties=!1;else if(!z.catchall){if(w.io==="output")J.additionalProperties=!1}else if(z.catchall)J.additionalProperties=p(z.catchall,w,{...v,path:[...v.path,"additionalProperties"]})},iv=($,w,U,v)=>{let J=$._zod.def,z=J.inclusive===!1,g=J.options.map((V,_)=>p(V,w,{...v,path:[...v.path,z?"oneOf":"anyOf",_]}));if(z)U.oneOf=g;else U.anyOf=g},SX=($,w,U,v)=>{let J=$._zod.def,z=p(J.left,w,{...v,path:[...v.path,"allOf",0]}),g=p(J.right,w,{...v,path:[...v.path,"allOf",1]}),V=(G)=>("allOf"in G)&&Object.keys(G).length===1,_=[...V(z)?z.allOf:[z],...V(g)?g.allOf:[g]];U.allOf=_},AX=($,w,U,v)=>{let J=U,z=$._zod.def;J.type="array";let g=w.target==="draft-2020-12"?"prefixItems":"items",V=w.target==="draft-2020-12"?"items":w.target==="openapi-3.0"?"items":"additionalItems",_=z.items.map((N,W)=>p(N,w,{...v,path:[...v.path,g,W]})),G=z.rest?p(z.rest,w,{...v,path:[...v.path,V,...w.target==="openapi-3.0"?[z.items.length]:[]]}):null;if(w.target==="draft-2020-12"){if(J.prefixItems=_,G)J.items=G}else if(w.target==="openapi-3.0"){if(J.items={anyOf:_},G)J.items.anyOf.push(G);if(J.minItems=_.length,!G)J.maxItems=_.length}else if(J.items=_,G)J.additionalItems=G;let{minimum:X,maximum:I}=$._zod.bag;if(typeof X==="number")J.minItems=X;if(typeof I==="number")J.maxItems=I},RX=($,w,U,v)=>{let J=U,z=$._zod.def;J.type="object";let g=z.keyType,_=g._zod.bag?.patterns;if(z.mode==="loose"&&_&&_.size>0){let X=p(z.valueType,w,{...v,path:[...v.path,"patternProperties","*"]});J.patternProperties={};for(let I of _)J.patternProperties[I.source]=X}else{if(w.target==="draft-07"||w.target==="draft-2020-12")J.propertyNames=p(z.keyType,w,{...v,path:[...v.path,"propertyNames"]});J.additionalProperties=p(z.valueType,w,{...v,path:[...v.path,"additionalProperties"]})}let G=g._zod.values;if(G){let X=[...G].filter((I)=>typeof I==="string"||typeof I==="number");if(X.length>0)J.required=X}},kX=($,w,U,v)=>{let J=$._zod.def,z=p(J.innerType,w,v),g=w.seen.get($);if(w.target==="openapi-3.0")g.ref=J.innerType,U.nullable=!0;else U.anyOf=[z,{type:"null"}]},CX=($,w,U,v)=>{let J=$._zod.def;p(J.innerType,w,v);let z=w.seen.get($);z.ref=J.innerType},jX=($,w,U,v)=>{let J=$._zod.def;p(J.innerType,w,v);let z=w.seen.get($);z.ref=J.innerType,U.default=JSON.parse(JSON.stringify(J.defaultValue))},xX=($,w,U,v)=>{let J=$._zod.def;p(J.innerType,w,v);let z=w.seen.get($);if(z.ref=J.innerType,w.io==="input")U._prefault=JSON.parse(JSON.stringify(J.defaultValue))},rX=($,w,U,v)=>{let J=$._zod.def;p(J.innerType,w,v);let z=w.seen.get($);z.ref=J.innerType;let g;try{g=J.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}U.default=g},yX=($,w,U,v)=>{let J=$._zod.def,z=J.in._zod.traits.has("$ZodTransform"),g=w.io==="input"?z?J.out:J.in:J.out;p(g,w,v);let V=w.seen.get($);V.ref=g},dX=($,w,U,v)=>{let J=$._zod.def;p(J.innerType,w,v);let z=w.seen.get($);z.ref=J.innerType,U.readOnly=!0},mX=($,w,U,v)=>{let J=$._zod.def;p(J.innerType,w,v);let z=w.seen.get($);z.ref=J.innerType},Ev=($,w,U,v)=>{let J=$._zod.def;p(J.innerType,w,v);let z=w.seen.get($);z.ref=J.innerType},nX=($,w,U,v)=>{let J=$._zod.innerType;p(J,w,v);let z=w.seen.get($);z.ref=J},Mv={string:GX,number:_X,boolean:XX,bigint:IX,symbol:NX,null:WX,undefined:YX,void:QX,never:PX,any:OX,unknown:BX,date:qX,enum:LX,literal:HX,nan:uX,template_literal:KX,file:DX,success:fX,custom:TX,function:ZX,transform:bX,map:FX,set:MX,array:iX,object:EX,union:iv,intersection:SX,tuple:AX,record:RX,nullable:kX,nonoptional:CX,default:jX,prefault:xX,catch:rX,pipe:yX,readonly:dX,promise:mX,optional:Ev,lazy:nX};function Sv($,w){if("_idmap"in $){let v=$,J=l4({...w,processors:Mv}),z={};for(let _ of v._idmap.entries()){let[G,X]=_;p(X,J)}let g={},V={registry:v,uri:w?.uri,defs:z};J.external=V;for(let _ of v._idmap.entries()){let[G,X]=_;t4(J,X),g[G]=o4(J,X)}if(Object.keys(z).length>0){let _=J.target==="draft-2020-12"?"$defs":"definitions";g.__shared={[_]:z}}return{schemas:g}}let U=l4({...w,processors:Mv});return p($,U),t4(U,$),o4(U,$)}class hX{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 w=$?.target??"draft-2020-12";if(w==="draft-4")w="draft-04";if(w==="draft-7")w="draft-07";this.ctx=l4({processors:Mv,target:w,...$?.metadata&&{metadata:$.metadata},...$?.unrepresentable&&{unrepresentable:$.unrepresentable},...$?.override&&{override:$.override},...$?.io&&{io:$.io}})}process($,w={path:[],schemaPath:[]}){return p($,this.ctx,w)}emit($,w){if(w){if(w.cycles)this.ctx.cycles=w.cycles;if(w.reused)this.ctx.reused=w.reused;if(w.external)this.ctx.external=w.external}t4(this.ctx,$);let U=o4(this.ctx,$),{"~standard":v,...J}=U;return J}}var V9={};var IJ={};Y4(IJ,{xor:()=>$Y,xid:()=>K9,void:()=>t9,uuidv7:()=>Q9,uuidv6:()=>Y9,uuidv4:()=>W9,uuid:()=>N9,url:()=>P9,unknown:()=>R6,union:()=>gz,undefined:()=>c9,ulid:()=>u9,uint64:()=>n9,uint32:()=>y9,tuple:()=>fI,transform:()=>Gz,templateLiteral:()=>YY,symbol:()=>h9,superRefine:()=>sI,success:()=>XY,stringbool:()=>uY,stringFormat:()=>A9,string:()=>NJ,strictObject:()=>e9,set:()=>zY,refine:()=>eI,record:()=>TI,readonly:()=>cI,promise:()=>QY,preprocess:()=>DY,prefault:()=>jI,pipe:()=>rv,partialRecord:()=>UY,optional:()=>YJ,object:()=>a9,number:()=>_I,nullish:()=>_Y,nullable:()=>QJ,null:()=>YI,nonoptional:()=>xI,never:()=>zz,nativeEnum:()=>gY,nanoid:()=>q9,nan:()=>IY,meta:()=>LY,map:()=>vY,mac:()=>T9,looseRecord:()=>JY,looseObject:()=>s9,literal:()=>VY,lazy:()=>oI,ksuid:()=>D9,keyof:()=>p9,jwt:()=>S9,json:()=>KY,ipv6:()=>Z9,ipv4:()=>f9,invertCodec:()=>WY,intersection:()=>KI,int64:()=>m9,int32:()=>r9,int:()=>xv,instanceof:()=>HY,httpUrl:()=>O9,hostname:()=>R9,hex:()=>k9,hash:()=>C9,guid:()=>I9,function:()=>PY,float64:()=>x9,float32:()=>j9,file:()=>GY,exactOptional:()=>SI,enum:()=>Vz,emoji:()=>B9,email:()=>X9,e164:()=>E9,discriminatedUnion:()=>wY,describe:()=>qY,date:()=>o9,custom:()=>BY,cuid2:()=>H9,cuid:()=>L9,codec:()=>NY,cidrv6:()=>F9,cidrv4:()=>b9,check:()=>OY,catch:()=>dI,boolean:()=>XI,bigint:()=>d9,base64url:()=>i9,base64:()=>M9,array:()=>qJ,any:()=>l9,_function:()=>PY,_default:()=>kI,_ZodString:()=>yv,ZodXor:()=>LI,ZodXID:()=>tv,ZodVoid:()=>BI,ZodUnknown:()=>PI,ZodUnion:()=>HJ,ZodUndefined:()=>NI,ZodUUID:()=>I4,ZodURL:()=>OJ,ZodULID:()=>lv,ZodType:()=>m,ZodTuple:()=>DI,ZodTransform:()=>iI,ZodTemplateLiteral:()=>lI,ZodSymbol:()=>II,ZodSuccess:()=>rI,ZodStringFormat:()=>s,ZodString:()=>pw,ZodSet:()=>bI,ZodRecord:()=>tw,ZodReadonly:()=>hI,ZodPromise:()=>pI,ZodPreprocess:()=>nI,ZodPrefault:()=>CI,ZodPipe:()=>uJ,ZodOptional:()=>_z,ZodObject:()=>LJ,ZodNumberFormat:()=>k6,ZodNumber:()=>ew,ZodNullable:()=>AI,ZodNull:()=>WI,ZodNonOptional:()=>Xz,ZodNever:()=>OI,ZodNanoID:()=>nv,ZodNaN:()=>mI,ZodMap:()=>ZI,ZodMAC:()=>GI,ZodLiteral:()=>FI,ZodLazy:()=>tI,ZodKSUID:()=>ov,ZodJWT:()=>Jz,ZodIntersection:()=>uI,ZodIPv6:()=>av,ZodIPv4:()=>pv,ZodGUID:()=>WJ,ZodFunction:()=>aI,ZodFile:()=>MI,ZodExactOptional:()=>EI,ZodEnum:()=>ow,ZodEmoji:()=>mv,ZodEmail:()=>dv,ZodE164:()=>Uz,ZodDiscriminatedUnion:()=>HI,ZodDefault:()=>RI,ZodDate:()=>BJ,ZodCustomStringFormat:()=>aw,ZodCustom:()=>DJ,ZodCodec:()=>KJ,ZodCatch:()=>yI,ZodCUID2:()=>cv,ZodCUID:()=>hv,ZodCIDRv6:()=>sv,ZodCIDRv4:()=>ev,ZodBoolean:()=>sw,ZodBigIntFormat:()=>vz,ZodBigInt:()=>$U,ZodBase64URL:()=>wz,ZodBase64:()=>$z,ZodArray:()=>qI,ZodAny:()=>QI});var Av={};Y4(Av,{uppercase:()=>Rw,trim:()=>yw,toUpperCase:()=>mw,toLowerCase:()=>dw,startsWith:()=>Cw,slugify:()=>nw,size:()=>E6,regex:()=>Sw,property:()=>Fv,positive:()=>fv,overwrite:()=>e$,normalize:()=>rw,nonpositive:()=>Zv,nonnegative:()=>bv,negative:()=>Tv,multipleOf:()=>h4,minSize:()=>X4,minLength:()=>D4,mime:()=>xw,maxSize:()=>c4,maxLength:()=>S6,lte:()=>r$,lt:()=>G4,lowercase:()=>Aw,length:()=>A6,includes:()=>kw,gte:()=>b$,gt:()=>_4,endsWith:()=>jw});var lw={};Y4(lw,{time:()=>tX,duration:()=>oX,datetime:()=>cX,date:()=>lX,ZodISOTime:()=>Cv,ZodISODuration:()=>jv,ZodISODateTime:()=>Rv,ZodISODate:()=>kv});var Rv=B("ZodISODateTime",($,w)=>{TV.init($,w),s.init($,w)});function cX($){return T_(Rv,$)}var kv=B("ZodISODate",($,w)=>{ZV.init($,w),s.init($,w)});function lX($){return Z_(kv,$)}var Cv=B("ZodISOTime",($,w)=>{bV.init($,w),s.init($,w)});function tX($){return b_(Cv,$)}var jv=B("ZodISODuration",($,w)=>{FV.init($,w),s.init($,w)});function oX($){return F_(jv,$)}var G9=($,w)=>{o1.init($,w),$.name="ZodError",Object.defineProperties($,{format:{value:(U)=>a1($,U)},flatten:{value:(U)=>p1($,U)},addIssue:{value:(U)=>{$.issues.push(U),$.message=JSON.stringify($.issues,Dw,2)}},addIssues:{value:(U)=>{$.issues.push(...U),$.message=JSON.stringify($.issues,Dw,2)}},isEmpty:{get(){return $.issues.length===0}}})},KH=B("ZodError",G9),E$=B("ZodError",G9,{Parent:Error});var pX=Zw(E$),aX=bw(E$),eX=Fw(E$),sX=Mw(E$),$I=C0(E$),wI=j0(E$),UI=x0(E$),JI=r0(E$),vI=y0(E$),zI=d0(E$),gI=m0(E$),VI=n0(E$);var _9=new WeakMap;function PJ($,w,U){let v=Object.getPrototypeOf($),J=_9.get(v);if(!J)J=new Set,_9.set(v,J);if(J.has(w))return;J.add(w);for(let z in U){let g=U[z];Object.defineProperty(v,z,{configurable:!0,enumerable:!1,get(){let V=g.bind(this);return Object.defineProperty(this,z,{configurable:!0,writable:!0,enumerable:!0,value:V}),V},set(V){Object.defineProperty(this,z,{configurable:!0,writable:!0,enumerable:!0,value:V})}})}}var m=B("ZodType",($,w)=>{return d.init($,w),Object.assign($["~standard"],{jsonSchema:{input:cw($,"input"),output:cw($,"output")}}),$.toJSONSchema=VX($,{}),$.def=w,$.type=w.type,Object.defineProperty($,"_def",{value:w}),$.parse=(U,v)=>pX($,U,v,{callee:$.parse}),$.safeParse=(U,v)=>eX($,U,v),$.parseAsync=async(U,v)=>aX($,U,v,{callee:$.parseAsync}),$.safeParseAsync=async(U,v)=>sX($,U,v),$.spa=$.safeParseAsync,$.encode=(U,v)=>$I($,U,v),$.decode=(U,v)=>wI($,U,v),$.encodeAsync=async(U,v)=>UI($,U,v),$.decodeAsync=async(U,v)=>JI($,U,v),$.safeEncode=(U,v)=>vI($,U,v),$.safeDecode=(U,v)=>zI($,U,v),$.safeEncodeAsync=async(U,v)=>gI($,U,v),$.safeDecodeAsync=async(U,v)=>VI($,U,v),PJ($,"ZodType",{check(...U){let v=this.def;return this.clone(T.mergeDefs(v,{checks:[...v.checks??[],...U.map((J)=>typeof J==="function"?{_zod:{check:J,def:{check:"custom"},onattach:[]}}:J)]}),{parent:!0})},with(...U){return this.check(...U)},clone(U,v){return T$(this,U,v)},brand(){return this},register(U,v){return U.add(this,v),this},refine(U,v){return this.check(eI(U,v))},superRefine(U,v){return this.check(sI(U,v))},overwrite(U){return this.check(e$(U))},optional(){return YJ(this)},exactOptional(){return SI(this)},nullable(){return QJ(this)},nullish(){return YJ(QJ(this))},nonoptional(U){return xI(this,U)},array(){return qJ(this)},or(U){return gz([this,U])},and(U){return KI(this,U)},transform(U){return rv(this,Gz(U))},default(U){return kI(this,U)},prefault(U){return jI(this,U)},catch(U){return dI(this,U)},pipe(U){return rv(this,U)},readonly(){return cI(this)},describe(U){let v=this.clone();return P$.add(v,{description:U}),v},meta(...U){if(U.length===0)return P$.get(this);let v=this.clone();return P$.add(v,U[0]),v},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(U){return U(this)}}),Object.defineProperty($,"description",{get(){return P$.get($)?.description},configurable:!0}),$}),yv=B("_ZodString",($,w)=>{i6.init($,w),m.init($,w),$._zod.processJSONSchema=(v,J,z)=>GX($,v,J,z);let U=$._zod.bag;$.format=U.format??null,$.minLength=U.minimum??null,$.maxLength=U.maximum??null,PJ($,"_ZodString",{regex(...v){return this.check(Sw(...v))},includes(...v){return this.check(kw(...v))},startsWith(...v){return this.check(Cw(...v))},endsWith(...v){return this.check(jw(...v))},min(...v){return this.check(D4(...v))},max(...v){return this.check(S6(...v))},length(...v){return this.check(A6(...v))},nonempty(...v){return this.check(D4(1,...v))},lowercase(v){return this.check(Aw(v))},uppercase(v){return this.check(Rw(v))},trim(){return this.check(yw())},normalize(...v){return this.check(rw(...v))},toLowerCase(){return this.check(dw())},toUpperCase(){return this.check(mw())},slugify(){return this.check(nw())}})}),pw=B("ZodString",($,w)=>{i6.init($,w),yv.init($,w),$.email=(U)=>$.check(zv(dv,U)),$.url=(U)=>$.check(XJ(OJ,U)),$.jwt=(U)=>$.check(Dv(Jz,U)),$.emoji=(U)=>$.check(Xv(mv,U)),$.guid=(U)=>$.check(_J(WJ,U)),$.uuid=(U)=>$.check(gv(I4,U)),$.uuidv4=(U)=>$.check(Vv(I4,U)),$.uuidv6=(U)=>$.check(Gv(I4,U)),$.uuidv7=(U)=>$.check(_v(I4,U)),$.nanoid=(U)=>$.check(Iv(nv,U)),$.guid=(U)=>$.check(_J(WJ,U)),$.cuid=(U)=>$.check(Nv(hv,U)),$.cuid2=(U)=>$.check(Wv(cv,U)),$.ulid=(U)=>$.check(Yv(lv,U)),$.base64=(U)=>$.check(Hv($z,U)),$.base64url=(U)=>$.check(uv(wz,U)),$.xid=(U)=>$.check(Qv(tv,U)),$.ksuid=(U)=>$.check(Pv(ov,U)),$.ipv4=(U)=>$.check(Ov(pv,U)),$.ipv6=(U)=>$.check(Bv(av,U)),$.cidrv4=(U)=>$.check(qv(ev,U)),$.cidrv6=(U)=>$.check(Lv(sv,U)),$.e164=(U)=>$.check(Kv(Uz,U)),$.datetime=(U)=>$.check(cX(U)),$.date=(U)=>$.check(lX(U)),$.time=(U)=>$.check(tX(U)),$.duration=(U)=>$.check(oX(U))});function NJ($){return u_(pw,$)}var s=B("ZodStringFormat",($,w)=>{e.init($,w),yv.init($,w)}),dv=B("ZodEmail",($,w)=>{OV.init($,w),s.init($,w)});function X9($){return zv(dv,$)}var WJ=B("ZodGUID",($,w)=>{QV.init($,w),s.init($,w)});function I9($){return _J(WJ,$)}var I4=B("ZodUUID",($,w)=>{PV.init($,w),s.init($,w)});function N9($){return gv(I4,$)}function W9($){return Vv(I4,$)}function Y9($){return Gv(I4,$)}function Q9($){return _v(I4,$)}var OJ=B("ZodURL",($,w)=>{BV.init($,w),s.init($,w)});function P9($){return XJ(OJ,$)}function O9($){return XJ(OJ,{protocol:x$.httpProtocol,hostname:x$.domain,...T.normalizeParams($)})}var mv=B("ZodEmoji",($,w)=>{qV.init($,w),s.init($,w)});function B9($){return Xv(mv,$)}var nv=B("ZodNanoID",($,w)=>{LV.init($,w),s.init($,w)});function q9($){return Iv(nv,$)}var hv=B("ZodCUID",($,w)=>{HV.init($,w),s.init($,w)});function L9($){return Nv(hv,$)}var cv=B("ZodCUID2",($,w)=>{uV.init($,w),s.init($,w)});function H9($){return Wv(cv,$)}var lv=B("ZodULID",($,w)=>{KV.init($,w),s.init($,w)});function u9($){return Yv(lv,$)}var tv=B("ZodXID",($,w)=>{DV.init($,w),s.init($,w)});function K9($){return Qv(tv,$)}var ov=B("ZodKSUID",($,w)=>{fV.init($,w),s.init($,w)});function D9($){return Pv(ov,$)}var pv=B("ZodIPv4",($,w)=>{MV.init($,w),s.init($,w)});function f9($){return Ov(pv,$)}var GI=B("ZodMAC",($,w)=>{EV.init($,w),s.init($,w)});function T9($){return D_(GI,$)}var av=B("ZodIPv6",($,w)=>{iV.init($,w),s.init($,w)});function Z9($){return Bv(av,$)}var ev=B("ZodCIDRv4",($,w)=>{SV.init($,w),s.init($,w)});function b9($){return qv(ev,$)}var sv=B("ZodCIDRv6",($,w)=>{AV.init($,w),s.init($,w)});function F9($){return Lv(sv,$)}var $z=B("ZodBase64",($,w)=>{kV.init($,w),s.init($,w)});function M9($){return Hv($z,$)}var wz=B("ZodBase64URL",($,w)=>{CV.init($,w),s.init($,w)});function i9($){return uv(wz,$)}var Uz=B("ZodE164",($,w)=>{jV.init($,w),s.init($,w)});function E9($){return Kv(Uz,$)}var Jz=B("ZodJWT",($,w)=>{xV.init($,w),s.init($,w)});function S9($){return Dv(Jz,$)}var aw=B("ZodCustomStringFormat",($,w)=>{rV.init($,w),s.init($,w)});function A9($,w,U={}){return hw(aw,$,w,U)}function R9($){return hw(aw,"hostname",x$.hostname,$)}function k9($){return hw(aw,"hex",x$.hex,$)}function C9($,w){let U=w?.enc??"hex",v=`${$}_${U}`,J=x$[v];if(!J)throw Error(`Unrecognized hash format: ${v}`);return hw(aw,v,J,w)}var ew=B("ZodNumber",($,w)=>{s0.init($,w),m.init($,w),$._zod.processJSONSchema=(v,J,z)=>_X($,v,J,z),PJ($,"ZodNumber",{gt(v,J){return this.check(_4(v,J))},gte(v,J){return this.check(b$(v,J))},min(v,J){return this.check(b$(v,J))},lt(v,J){return this.check(G4(v,J))},lte(v,J){return this.check(r$(v,J))},max(v,J){return this.check(r$(v,J))},int(v){return this.check(xv(v))},safe(v){return this.check(xv(v))},positive(v){return this.check(_4(0,v))},nonnegative(v){return this.check(b$(0,v))},negative(v){return this.check(G4(0,v))},nonpositive(v){return this.check(r$(0,v))},multipleOf(v,J){return this.check(h4(v,J))},step(v,J){return this.check(h4(v,J))},finite(){return this}});let U=$._zod.bag;$.minValue=Math.max(U.minimum??Number.NEGATIVE_INFINITY,U.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,$.maxValue=Math.min(U.maximum??Number.POSITIVE_INFINITY,U.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,$.isInt=(U.format??"").includes("int")||Number.isSafeInteger(U.multipleOf??0.5),$.isFinite=!0,$.format=U.format??null});function _I($){return M_(ew,$)}var k6=B("ZodNumberFormat",($,w)=>{yV.init($,w),ew.init($,w)});function xv($){return E_(k6,$)}function j9($){return S_(k6,$)}function x9($){return A_(k6,$)}function r9($){return R_(k6,$)}function y9($){return k_(k6,$)}var sw=B("ZodBoolean",($,w)=>{wJ.init($,w),m.init($,w),$._zod.processJSONSchema=(U,v,J)=>XX($,U,v,J)});function XI($){return C_(sw,$)}var $U=B("ZodBigInt",($,w)=>{$v.init($,w),m.init($,w),$._zod.processJSONSchema=(v,J,z)=>IX($,v,J,z),$.gte=(v,J)=>$.check(b$(v,J)),$.min=(v,J)=>$.check(b$(v,J)),$.gt=(v,J)=>$.check(_4(v,J)),$.gte=(v,J)=>$.check(b$(v,J)),$.min=(v,J)=>$.check(b$(v,J)),$.lt=(v,J)=>$.check(G4(v,J)),$.lte=(v,J)=>$.check(r$(v,J)),$.max=(v,J)=>$.check(r$(v,J)),$.positive=(v)=>$.check(_4(BigInt(0),v)),$.negative=(v)=>$.check(G4(BigInt(0),v)),$.nonpositive=(v)=>$.check(r$(BigInt(0),v)),$.nonnegative=(v)=>$.check(b$(BigInt(0),v)),$.multipleOf=(v,J)=>$.check(h4(v,J));let U=$._zod.bag;$.minValue=U.minimum??null,$.maxValue=U.maximum??null,$.format=U.format??null});function d9($){return x_($U,$)}var vz=B("ZodBigIntFormat",($,w)=>{dV.init($,w),$U.init($,w)});function m9($){return y_(vz,$)}function n9($){return d_(vz,$)}var II=B("ZodSymbol",($,w)=>{mV.init($,w),m.init($,w),$._zod.processJSONSchema=(U,v,J)=>NX($,U,v,J)});function h9($){return m_(II,$)}var NI=B("ZodUndefined",($,w)=>{nV.init($,w),m.init($,w),$._zod.processJSONSchema=(U,v,J)=>YX($,U,v,J)});function c9($){return n_(NI,$)}var WI=B("ZodNull",($,w)=>{hV.init($,w),m.init($,w),$._zod.processJSONSchema=(U,v,J)=>WX($,U,v,J)});function YI($){return h_(WI,$)}var QI=B("ZodAny",($,w)=>{cV.init($,w),m.init($,w),$._zod.processJSONSchema=(U,v,J)=>OX($,U,v,J)});function l9(){return c_(QI)}var PI=B("ZodUnknown",($,w)=>{lV.init($,w),m.init($,w),$._zod.processJSONSchema=(U,v,J)=>BX($,U,v,J)});function R6(){return l_(PI)}var OI=B("ZodNever",($,w)=>{tV.init($,w),m.init($,w),$._zod.processJSONSchema=(U,v,J)=>PX($,U,v,J)});function zz($){return t_(OI,$)}var BI=B("ZodVoid",($,w)=>{oV.init($,w),m.init($,w),$._zod.processJSONSchema=(U,v,J)=>QX($,U,v,J)});function t9($){return o_(BI,$)}var BJ=B("ZodDate",($,w)=>{pV.init($,w),m.init($,w),$._zod.processJSONSchema=(v,J,z)=>qX($,v,J,z),$.min=(v,J)=>$.check(b$(v,J)),$.max=(v,J)=>$.check(r$(v,J));let U=$._zod.bag;$.minDate=U.minimum?new Date(U.minimum):null,$.maxDate=U.maximum?new Date(U.maximum):null});function o9($){return p_(BJ,$)}var qI=B("ZodArray",($,w)=>{aV.init($,w),m.init($,w),$._zod.processJSONSchema=(U,v,J)=>iX($,U,v,J),$.element=w.element,PJ($,"ZodArray",{min(U,v){return this.check(D4(U,v))},nonempty(U){return this.check(D4(1,U))},max(U,v){return this.check(S6(U,v))},length(U,v){return this.check(A6(U,v))},unwrap(){return this.element}})});function qJ($,w){return s_(qI,$,w)}function p9($){let w=$._zod.def.shape;return Vz(Object.keys(w))}var LJ=B("ZodObject",($,w)=>{eV.init($,w),m.init($,w),$._zod.processJSONSchema=(U,v,J)=>EX($,U,v,J),T.defineLazy($,"shape",()=>{return w.shape}),PJ($,"ZodObject",{keyof(){return Vz(Object.keys(this._zod.def.shape))},catchall(U){return this.clone({...this._zod.def,catchall:U})},passthrough(){return this.clone({...this._zod.def,catchall:R6()})},loose(){return this.clone({...this._zod.def,catchall:R6()})},strict(){return this.clone({...this._zod.def,catchall:zz()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(U){return T.extend(this,U)},safeExtend(U){return T.safeExtend(this,U)},merge(U){return T.merge(this,U)},pick(U){return T.pick(this,U)},omit(U){return T.omit(this,U)},partial(...U){return T.partial(_z,this,U[0])},required(...U){return T.required(Xz,this,U[0])}})});function a9($,w){let U={type:"object",shape:$??{},...T.normalizeParams(w)};return new LJ(U)}function e9($,w){return new LJ({type:"object",shape:$,catchall:zz(),...T.normalizeParams(w)})}function s9($,w){return new LJ({type:"object",shape:$,catchall:R6(),...T.normalizeParams(w)})}var HJ=B("ZodUnion",($,w)=>{UJ.init($,w),m.init($,w),$._zod.processJSONSchema=(U,v,J)=>iv($,U,v,J),$.options=w.options});function gz($,w){return new HJ({type:"union",options:$,...T.normalizeParams(w)})}var LI=B("ZodXor",($,w)=>{HJ.init($,w),sV.init($,w),$._zod.processJSONSchema=(U,v,J)=>iv($,U,v,J),$.options=w.options});function $Y($,w){return new LI({type:"union",options:$,inclusive:!1,...T.normalizeParams(w)})}var HI=B("ZodDiscriminatedUnion",($,w)=>{HJ.init($,w),$G.init($,w)});function wY($,w,U){return new HI({type:"union",options:w,discriminator:$,...T.normalizeParams(U)})}var uI=B("ZodIntersection",($,w)=>{wG.init($,w),m.init($,w),$._zod.processJSONSchema=(U,v,J)=>SX($,U,v,J)});function KI($,w){return new uI({type:"intersection",left:$,right:w})}var DI=B("ZodTuple",($,w)=>{wv.init($,w),m.init($,w),$._zod.processJSONSchema=(U,v,J)=>AX($,U,v,J),$.rest=(U)=>$.clone({...$._zod.def,rest:U})});function fI($,w,U){let v=w instanceof d,J=v?U:w;return new DI({type:"tuple",items:$,rest:v?w:null,...T.normalizeParams(J)})}var tw=B("ZodRecord",($,w)=>{UG.init($,w),m.init($,w),$._zod.processJSONSchema=(U,v,J)=>RX($,U,v,J),$.keyType=w.keyType,$.valueType=w.valueType});function TI($,w,U){if(!w||!w._zod)return new tw({type:"record",keyType:NJ(),valueType:$,...T.normalizeParams(w)});return new tw({type:"record",keyType:$,valueType:w,...T.normalizeParams(U)})}function UY($,w,U){let v=T$($);return v._zod.values=void 0,new tw({type:"record",keyType:v,valueType:w,...T.normalizeParams(U)})}function JY($,w,U){return new tw({type:"record",keyType:$,valueType:w,mode:"loose",...T.normalizeParams(U)})}var ZI=B("ZodMap",($,w)=>{JG.init($,w),m.init($,w),$._zod.processJSONSchema=(U,v,J)=>FX($,U,v,J),$.keyType=w.keyType,$.valueType=w.valueType,$.min=(...U)=>$.check(X4(...U)),$.nonempty=(U)=>$.check(X4(1,U)),$.max=(...U)=>$.check(c4(...U)),$.size=(...U)=>$.check(E6(...U))});function vY($,w,U){return new ZI({type:"map",keyType:$,valueType:w,...T.normalizeParams(U)})}var bI=B("ZodSet",($,w)=>{vG.init($,w),m.init($,w),$._zod.processJSONSchema=(U,v,J)=>MX($,U,v,J),$.min=(...U)=>$.check(X4(...U)),$.nonempty=(U)=>$.check(X4(1,U)),$.max=(...U)=>$.check(c4(...U)),$.size=(...U)=>$.check(E6(...U))});function zY($,w){return new bI({type:"set",valueType:$,...T.normalizeParams(w)})}var ow=B("ZodEnum",($,w)=>{zG.init($,w),m.init($,w),$._zod.processJSONSchema=(v,J,z)=>LX($,v,J,z),$.enum=w.entries,$.options=Object.values(w.entries);let U=new Set(Object.keys(w.entries));$.extract=(v,J)=>{let z={};for(let g of v)if(U.has(g))z[g]=w.entries[g];else throw Error(`Key ${g} not found in enum`);return new ow({...w,checks:[],...T.normalizeParams(J),entries:z})},$.exclude=(v,J)=>{let z={...w.entries};for(let g of v)if(U.has(g))delete z[g];else throw Error(`Key ${g} not found in enum`);return new ow({...w,checks:[],...T.normalizeParams(J),entries:z})}});function Vz($,w){let U=Array.isArray($)?Object.fromEntries($.map((v)=>[v,v])):$;return new ow({type:"enum",entries:U,...T.normalizeParams(w)})}function gY($,w){return new ow({type:"enum",entries:$,...T.normalizeParams(w)})}var FI=B("ZodLiteral",($,w)=>{gG.init($,w),m.init($,w),$._zod.processJSONSchema=(U,v,J)=>HX($,U,v,J),$.values=new Set(w.values),Object.defineProperty($,"value",{get(){if(w.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return w.values[0]}})});function VY($,w){return new FI({type:"literal",values:Array.isArray($)?$:[$],...T.normalizeParams(w)})}var MI=B("ZodFile",($,w)=>{VG.init($,w),m.init($,w),$._zod.processJSONSchema=(U,v,J)=>DX($,U,v,J),$.min=(U,v)=>$.check(X4(U,v)),$.max=(U,v)=>$.check(c4(U,v)),$.mime=(U,v)=>$.check(xw(Array.isArray(U)?U:[U],v))});function GY($){return $X(MI,$)}var iI=B("ZodTransform",($,w)=>{GG.init($,w),m.init($,w),$._zod.processJSONSchema=(U,v,J)=>bX($,U,v,J),$._zod.parse=(U,v)=>{if(v.direction==="backward")throw new b6($.constructor.name);U.addIssue=(z)=>{if(typeof z==="string")U.issues.push(T.issue(z,U.value,w));else{let g=z;if(g.fatal)g.continue=!1;g.code??(g.code="custom"),g.input??(g.input=U.value),g.inst??(g.inst=$),U.issues.push(T.issue(g))}};let J=w.transform(U.value,U);if(J instanceof Promise)return J.then((z)=>{return U.value=z,U.fallback=!0,U});return U.value=J,U.fallback=!0,U}});function Gz($){return new iI({type:"transform",transform:$})}var _z=B("ZodOptional",($,w)=>{Uv.init($,w),m.init($,w),$._zod.processJSONSchema=(U,v,J)=>Ev($,U,v,J),$.unwrap=()=>$._zod.def.innerType});function YJ($){return new _z({type:"optional",innerType:$})}var EI=B("ZodExactOptional",($,w)=>{_G.init($,w),m.init($,w),$._zod.processJSONSchema=(U,v,J)=>Ev($,U,v,J),$.unwrap=()=>$._zod.def.innerType});function SI($){return new EI({type:"optional",innerType:$})}var AI=B("ZodNullable",($,w)=>{XG.init($,w),m.init($,w),$._zod.processJSONSchema=(U,v,J)=>kX($,U,v,J),$.unwrap=()=>$._zod.def.innerType});function QJ($){return new AI({type:"nullable",innerType:$})}function _Y($){return YJ(QJ($))}var RI=B("ZodDefault",($,w)=>{IG.init($,w),m.init($,w),$._zod.processJSONSchema=(U,v,J)=>jX($,U,v,J),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});function kI($,w){return new RI({type:"default",innerType:$,get defaultValue(){return typeof w==="function"?w():T.shallowClone(w)}})}var CI=B("ZodPrefault",($,w)=>{NG.init($,w),m.init($,w),$._zod.processJSONSchema=(U,v,J)=>xX($,U,v,J),$.unwrap=()=>$._zod.def.innerType});function jI($,w){return new CI({type:"prefault",innerType:$,get defaultValue(){return typeof w==="function"?w():T.shallowClone(w)}})}var Xz=B("ZodNonOptional",($,w)=>{WG.init($,w),m.init($,w),$._zod.processJSONSchema=(U,v,J)=>CX($,U,v,J),$.unwrap=()=>$._zod.def.innerType});function xI($,w){return new Xz({type:"nonoptional",innerType:$,...T.normalizeParams(w)})}var rI=B("ZodSuccess",($,w)=>{YG.init($,w),m.init($,w),$._zod.processJSONSchema=(U,v,J)=>fX($,U,v,J),$.unwrap=()=>$._zod.def.innerType});function XY($){return new rI({type:"success",innerType:$})}var yI=B("ZodCatch",($,w)=>{QG.init($,w),m.init($,w),$._zod.processJSONSchema=(U,v,J)=>rX($,U,v,J),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});function dI($,w){return new yI({type:"catch",innerType:$,catchValue:typeof w==="function"?w:()=>w})}var mI=B("ZodNaN",($,w)=>{PG.init($,w),m.init($,w),$._zod.processJSONSchema=(U,v,J)=>uX($,U,v,J)});function IY($){return e_(mI,$)}var uJ=B("ZodPipe",($,w)=>{Jv.init($,w),m.init($,w),$._zod.processJSONSchema=(U,v,J)=>yX($,U,v,J),$.in=w.in,$.out=w.out});function rv($,w){return new uJ({type:"pipe",in:$,out:w})}var KJ=B("ZodCodec",($,w)=>{uJ.init($,w),JJ.init($,w)});function NY($,w,U){return new KJ({type:"pipe",in:$,out:w,transform:U.decode,reverseTransform:U.encode})}function WY($){let w=$._zod.def;return new KJ({type:"pipe",in:w.out,out:w.in,transform:w.reverseTransform,reverseTransform:w.transform})}var nI=B("ZodPreprocess",($,w)=>{uJ.init($,w),OG.init($,w)}),hI=B("ZodReadonly",($,w)=>{BG.init($,w),m.init($,w),$._zod.processJSONSchema=(U,v,J)=>dX($,U,v,J),$.unwrap=()=>$._zod.def.innerType});function cI($){return new hI({type:"readonly",innerType:$})}var lI=B("ZodTemplateLiteral",($,w)=>{qG.init($,w),m.init($,w),$._zod.processJSONSchema=(U,v,J)=>KX($,U,v,J)});function YY($,w){return new lI({type:"template_literal",parts:$,...T.normalizeParams(w)})}var tI=B("ZodLazy",($,w)=>{uG.init($,w),m.init($,w),$._zod.processJSONSchema=(U,v,J)=>nX($,U,v,J),$.unwrap=()=>$._zod.def.getter()});function oI($){return new tI({type:"lazy",getter:$})}var pI=B("ZodPromise",($,w)=>{HG.init($,w),m.init($,w),$._zod.processJSONSchema=(U,v,J)=>mX($,U,v,J),$.unwrap=()=>$._zod.def.innerType});function QY($){return new pI({type:"promise",innerType:$})}var aI=B("ZodFunction",($,w)=>{LG.init($,w),m.init($,w),$._zod.processJSONSchema=(U,v,J)=>ZX($,U,v,J)});function PY($){return new aI({type:"function",input:Array.isArray($?.input)?fI($?.input):$?.input??qJ(R6()),output:$?.output??R6()})}var DJ=B("ZodCustom",($,w)=>{KG.init($,w),m.init($,w),$._zod.processJSONSchema=(U,v,J)=>TX($,U,v,J)});function OY($){let w=new $$({check:"custom"});return w._zod.check=$,w}function BY($,w){return wX(DJ,$??(()=>!0),w)}function eI($,w={}){return UX(DJ,$,w)}function sI($,w){return JX($,w)}var qY=vX,LY=zX;function HY($,w={}){let U=new DJ({type:"custom",check:"custom",fn:(v)=>v instanceof $,abort:!0,...T.normalizeParams(w)});return U._zod.bag.Class=$,U._zod.check=(v)=>{if(!(v.value instanceof $))v.issues.push({code:"invalid_type",expected:$.name,input:v.value,inst:U,path:[...U._zod.def.path??[]]})},U}var uY=(...$)=>gX({Codec:KJ,Boolean:sw,String:pw},...$);function KY($){let w=oI(()=>{return gz([NJ($),_I(),XI(),YI(),qJ(w),TI(NJ(),w)])});return w}function DY($,w){return new nI({type:"pipe",in:Gz($),out:w})}var fH={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 TH($){g$({customError:$})}function ZH(){return g$().customError}var $N;(function($){})($N||($N={}));var R={...IJ,...Av,iso:lw},bH=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 FH($,w){let U=$.$schema;if(U==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(U==="http://json-schema.org/draft-07/schema#")return"draft-7";if(U==="http://json-schema.org/draft-04/schema#")return"draft-4";return w??"draft-2020-12"}function MH($,w){if(!$.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let U=$.slice(1).split("/").filter(Boolean);if(U.length===0)return w.rootSchema;let v=w.version==="draft-2020-12"?"$defs":"definitions";if(U[0]===v){let J=U[1];if(!J||!w.defs[J])throw Error(`Reference not found: ${$}`);return w.defs[J]}throw Error(`Reference not found: ${$}`)}function fY($,w){if($.not!==void 0){if(typeof $.not==="object"&&Object.keys($.not).length===0)return R.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 J=$.$ref;if(w.refs.has(J))return w.refs.get(J);if(w.processing.has(J))return R.lazy(()=>{if(!w.refs.has(J))throw Error(`Circular reference not resolved: ${J}`);return w.refs.get(J)});w.processing.add(J);let z=MH(J,w),g=u$(z,w);return w.refs.set(J,g),w.processing.delete(J),g}if($.enum!==void 0){let J=$.enum;if(w.version==="openapi-3.0"&&$.nullable===!0&&J.length===1&&J[0]===null)return R.null();if(J.length===0)return R.never();if(J.length===1)return R.literal(J[0]);if(J.every((g)=>typeof g==="string"))return R.enum(J);let z=J.map((g)=>R.literal(g));if(z.length<2)return z[0];return R.union([z[0],z[1],...z.slice(2)])}if($.const!==void 0)return R.literal($.const);let U=$.type;if(Array.isArray(U)){let J=U.map((z)=>{let g={...$,type:z};return fY(g,w)});if(J.length===0)return R.never();if(J.length===1)return J[0];return R.union(J)}if(!U)return R.any();let v;switch(U){case"string":{let J=R.string();if($.format){let z=$.format;if(z==="email")J=J.check(R.email());else if(z==="uri"||z==="uri-reference")J=J.check(R.url());else if(z==="uuid"||z==="guid")J=J.check(R.uuid());else if(z==="date-time")J=J.check(R.iso.datetime());else if(z==="date")J=J.check(R.iso.date());else if(z==="time")J=J.check(R.iso.time());else if(z==="duration")J=J.check(R.iso.duration());else if(z==="ipv4")J=J.check(R.ipv4());else if(z==="ipv6")J=J.check(R.ipv6());else if(z==="mac")J=J.check(R.mac());else if(z==="cidr")J=J.check(R.cidrv4());else if(z==="cidr-v6")J=J.check(R.cidrv6());else if(z==="base64")J=J.check(R.base64());else if(z==="base64url")J=J.check(R.base64url());else if(z==="e164")J=J.check(R.e164());else if(z==="jwt")J=J.check(R.jwt());else if(z==="emoji")J=J.check(R.emoji());else if(z==="nanoid")J=J.check(R.nanoid());else if(z==="cuid")J=J.check(R.cuid());else if(z==="cuid2")J=J.check(R.cuid2());else if(z==="ulid")J=J.check(R.ulid());else if(z==="xid")J=J.check(R.xid());else if(z==="ksuid")J=J.check(R.ksuid())}if(typeof $.minLength==="number")J=J.min($.minLength);if(typeof $.maxLength==="number")J=J.max($.maxLength);if($.pattern)J=J.regex(new RegExp($.pattern));v=J;break}case"number":case"integer":{let J=U==="integer"?R.number().int():R.number();if(typeof $.minimum==="number")J=J.min($.minimum);if(typeof $.maximum==="number")J=J.max($.maximum);if(typeof $.exclusiveMinimum==="number")J=J.gt($.exclusiveMinimum);else if($.exclusiveMinimum===!0&&typeof $.minimum==="number")J=J.gt($.minimum);if(typeof $.exclusiveMaximum==="number")J=J.lt($.exclusiveMaximum);else if($.exclusiveMaximum===!0&&typeof $.maximum==="number")J=J.lt($.maximum);if(typeof $.multipleOf==="number")J=J.multipleOf($.multipleOf);v=J;break}case"boolean":{v=R.boolean();break}case"null":{v=R.null();break}case"object":{let J={},z=$.properties||{},g=new Set($.required||[]);for(let[_,G]of Object.entries(z)){let X=u$(G,w);J[_]=g.has(_)?X:X.optional()}if($.propertyNames){let _=u$($.propertyNames,w),G=$.additionalProperties&&typeof $.additionalProperties==="object"?u$($.additionalProperties,w):R.any();if(Object.keys(J).length===0){v=R.record(_,G);break}let X=R.object(J).passthrough(),I=R.looseRecord(_,G);v=R.intersection(X,I);break}if($.patternProperties){let _=$.patternProperties,G=Object.keys(_),X=[];for(let N of G){let W=u$(_[N],w),P=R.string().regex(new RegExp(N));X.push(R.looseRecord(P,W))}let I=[];if(Object.keys(J).length>0)I.push(R.object(J).passthrough());if(I.push(...X),I.length===0)v=R.object({}).passthrough();else if(I.length===1)v=I[0];else{let N=R.intersection(I[0],I[1]);for(let W=2;W<I.length;W++)N=R.intersection(N,I[W]);v=N}break}let V=R.object(J);if($.additionalProperties===!1)v=V.strict();else if(typeof $.additionalProperties==="object")v=V.catchall(u$($.additionalProperties,w));else v=V.passthrough();break}case"array":{let{prefixItems:J,items:z}=$;if(J&&Array.isArray(J)){let g=J.map((_)=>u$(_,w)),V=z&&typeof z==="object"&&!Array.isArray(z)?u$(z,w):void 0;if(V)v=R.tuple(g).rest(V);else v=R.tuple(g);if(typeof $.minItems==="number")v=v.check(R.minLength($.minItems));if(typeof $.maxItems==="number")v=v.check(R.maxLength($.maxItems))}else if(Array.isArray(z)){let g=z.map((_)=>u$(_,w)),V=$.additionalItems&&typeof $.additionalItems==="object"?u$($.additionalItems,w):void 0;if(V)v=R.tuple(g).rest(V);else v=R.tuple(g);if(typeof $.minItems==="number")v=v.check(R.minLength($.minItems));if(typeof $.maxItems==="number")v=v.check(R.maxLength($.maxItems))}else if(z!==void 0){let g=u$(z,w),V=R.array(g);if(typeof $.minItems==="number")V=V.min($.minItems);if(typeof $.maxItems==="number")V=V.max($.maxItems);v=V}else v=R.array(R.any());break}default:throw Error(`Unsupported type: ${U}`)}return v}function u$($,w){if(typeof $==="boolean")return $?R.any():R.never();let U=fY($,w),v=$.type||$.enum!==void 0||$.const!==void 0;if($.anyOf&&Array.isArray($.anyOf)){let V=$.anyOf.map((G)=>u$(G,w)),_=R.union(V);U=v?R.intersection(U,_):_}if($.oneOf&&Array.isArray($.oneOf)){let V=$.oneOf.map((G)=>u$(G,w)),_=R.xor(V);U=v?R.intersection(U,_):_}if($.allOf&&Array.isArray($.allOf))if($.allOf.length===0)U=v?U:R.any();else{let V=v?U:u$($.allOf[0],w),_=v?0:1;for(let G=_;G<$.allOf.length;G++)V=R.intersection(V,u$($.allOf[G],w));U=V}if($.nullable===!0&&w.version==="openapi-3.0")U=R.nullable(U);if($.readOnly===!0)U=R.readonly(U);if($.default!==void 0)U=U.default($.default);let J={},z=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let V of z)if(V in $)J[V]=$[V];let g=["contentEncoding","contentMediaType","contentSchema"];for(let V of g)if(V in $)J[V]=$[V];for(let V of Object.keys($))if(!bH.has(V))J[V]=$[V];if(Object.keys(J).length>0)w.registry.add(U,J);if($.description)U=U.describe($.description);return U}function TY($,w){if(typeof $==="boolean")return $?R.any():R.never();let U;try{U=JSON.parse(JSON.stringify($))}catch{throw Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let v=FH(U,w?.defaultTarget),J=U.$defs||U.definitions||{},z={version:v,defs:J,refs:new Map,processing:new Set,rootSchema:U,registry:w?.registry??P$};return u$(U,z)}var wN={};Y4(wN,{string:()=>iH,number:()=>EH,date:()=>RH,boolean:()=>SH,bigint:()=>AH});function iH($){return K_(pw,$)}function EH($){return i_(ew,$)}function SH($){return j_(sw,$)}function AH($){return r_($U,$)}function RH($){return a_(BJ,$)}g$(vJ());import{join as kH}from"node:path";function wU($){if($)return $;if(process.env.PLOOF_HOME)return process.env.PLOOF_HOME;return kH(process.env.HOME??process.cwd(),".ploof")}var nH=C.object({apiKey:C.string().optional(),organization:C.string().optional(),project:C.string().optional(),baseURL:C.string().optional()}),hH=C.object({providers:C.record(C.string(),C.object({defaultProfile:C.string().default("default"),profiles:C.record(C.string(),nH).default({})})).default({})});class T4{credPath;constructor($){this.credPath=mH(wU($),"credentials.json")}login($,w,U,v=!0){if(!U.apiKey)throw Error("API key is required.");let J=this.read(),z=J.providers[$]??{defaultProfile:w,profiles:{}};if(z.profiles[w]=U,v)z.defaultProfile=w;J.providers[$]=z,this.write(J)}logout($,w){let U=this.read(),v=U.providers[$];if(!v)return!1;let J=w??v.defaultProfile;if(!v.profiles[J])return!1;delete v.profiles[J];let z=Object.keys(v.profiles);if(z.length===0)delete U.providers[$];else if(v.defaultProfile===J)v.defaultProfile=z[0];return this.write(U),!0}listProfiles($){let w=this.read(),U={};for(let[v,J]of Object.entries(w.providers)){if($&&v!==$)continue;U[v]=Object.keys(J.profiles)}return U}getDefaultProfile($){return this.read().providers[$]?.defaultProfile??"default"}getCredential($,w){if($==="openai"){let g=process.env.PLOOF_OPENAI_API_KEY??process.env.OPENAI_API_KEY;if(g)return{apiKey:g,organization:process.env.PLOOF_OPENAI_ORG,project:process.env.PLOOF_OPENAI_PROJECT,baseURL:process.env.PLOOF_OPENAI_BASE_URL,source:"env",profile:w??"env"}}let v=this.read().providers[$];if(!v)return null;let J=w??v.defaultProfile,z=v.profiles[J];if(!z?.apiKey)return null;return{...z,source:"stored",profile:J}}status($,w){let U=w??this.getDefaultProfile($),v=this.getCredential($,w);if(!v?.apiKey)return{provider:$,profile:U,authenticated:!1};return{provider:$,profile:v.profile??U,authenticated:!0,source:v.source,keyPrefix:cH(v.apiKey),organization:v.organization,project:v.project,baseURL:v.baseURL}}read(){try{if(!jH(this.credPath))return{providers:{}};let $=rH(this.credPath,"utf-8");return hH.parse(JSON.parse($))}catch{return{providers:{}}}}write($){xH(dH(this.credPath),{recursive:!0}),yH(this.credPath,`${JSON.stringify($,null,2)}
|
|
255
|
+
`,{mode:384});try{CH(this.credPath,384)}catch{}}}function cH($){if($.length<=12)return`${$.slice(0,4)}...`;return`${$.slice(0,8)}...${$.slice(-4)}`}import{existsSync as lH,mkdirSync as tH,readFileSync as oH,writeFileSync as pH}from"node:fs";import{dirname as aH,join as eH}from"node:path";var ZY=C.object({output:C.enum(["auto","table","compact","json","jsonl"]).default("auto"),defaultParallel:C.number().int().positive().default(4),sidecar:C.boolean().default(!0),noColor:C.boolean().default(!1)}),Iz={output:"auto",defaultParallel:4,sidecar:!0,noColor:!1},sH=new Set(["output","defaultParallel","sidecar","noColor"]);class Z4{configPath;values;constructor($){this.configPath=eH(wU($),"config.json"),this.values={...Iz},this.loadSync()}loadSync(){try{if(!lH(this.configPath))return;let $=oH(this.configPath,"utf-8"),w=JSON.parse($);this.values=ZY.parse({...Iz,...w})}catch{this.values={...Iz}}}async load(){this.loadSync()}get($){return this.values[$]}set($,w){if(!sH.has($))throw Error(`Invalid config key: ${String($)}`);let U=ZY.parse({...this.values,[$]:w});this.values=U,this.save()}list(){return{...this.values}}reset(){this.values={...Iz},this.save()}save(){tH(aH(this.configPath),{recursive:!0}),pH(this.configPath,`${JSON.stringify(this.values,null,2)}
|
|
256
|
+
`)}}var bY=($=0)=>(w)=>`\x1B[${w+$}m`,FY=($=0)=>(w)=>`\x1B[${38+$};5;${w}m`,MY=($=0)=>(w,U,v)=>`\x1B[${38+$};2;${w};${U};${v}m`,w$={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},Ac=Object.keys(w$.modifier),$u=Object.keys(w$.color),wu=Object.keys(w$.bgColor),Rc=[...$u,...wu];function Uu(){let $=new Map;for(let[w,U]of Object.entries(w$)){for(let[v,J]of Object.entries(U))w$[v]={open:`\x1B[${J[0]}m`,close:`\x1B[${J[1]}m`},U[v]=w$[v],$.set(J[0],J[1]);Object.defineProperty(w$,w,{value:U,enumerable:!1})}return Object.defineProperty(w$,"codes",{value:$,enumerable:!1}),w$.color.close="\x1B[39m",w$.bgColor.close="\x1B[49m",w$.color.ansi=bY(),w$.color.ansi256=FY(),w$.color.ansi16m=MY(),w$.bgColor.ansi=bY(10),w$.bgColor.ansi256=FY(10),w$.bgColor.ansi16m=MY(10),Object.defineProperties(w$,{rgbToAnsi256:{value(w,U,v){if(w===U&&U===v){if(w<8)return 16;if(w>248)return 231;return Math.round((w-8)/247*24)+232}return 16+36*Math.round(w/255*5)+6*Math.round(U/255*5)+Math.round(v/255*5)},enumerable:!1},hexToRgb:{value(w){let U=/[a-f\d]{6}|[a-f\d]{3}/i.exec(w.toString(16));if(!U)return[0,0,0];let[v]=U;if(v.length===3)v=[...v].map((z)=>z+z).join("");let J=Number.parseInt(v,16);return[J>>16&255,J>>8&255,J&255]},enumerable:!1},hexToAnsi256:{value:(w)=>w$.rgbToAnsi256(...w$.hexToRgb(w)),enumerable:!1},ansi256ToAnsi:{value(w){if(w<8)return 30+w;if(w<16)return 90+(w-8);let U,v,J;if(w>=232)U=((w-232)*10+8)/255,v=U,J=U;else{w-=16;let V=w%36;U=Math.floor(w/36)/5,v=Math.floor(V/6)/5,J=V%6/5}let z=Math.max(U,v,J)*2;if(z===0)return 30;let g=30+(Math.round(J)<<2|Math.round(v)<<1|Math.round(U));if(z===2)g+=60;return g},enumerable:!1},rgbToAnsi:{value:(w,U,v)=>w$.ansi256ToAnsi(w$.rgbToAnsi256(w,U,v)),enumerable:!1},hexToAnsi:{value:(w)=>w$.ansi256ToAnsi(w$.hexToAnsi256(w)),enumerable:!1}}),w$}var Ju=Uu(),s$=Ju;import UN from"node:process";import vu from"node:os";import iY from"node:tty";function h$($,w=globalThis.Deno?globalThis.Deno.args:UN.argv){let U=$.startsWith("-")?"":$.length===1?"-":"--",v=w.indexOf(U+$),J=w.indexOf("--");return v!==-1&&(J===-1||v<J)}var{env:U$}=UN,Nz;if(h$("no-color")||h$("no-colors")||h$("color=false")||h$("color=never"))Nz=0;else if(h$("color")||h$("colors")||h$("color=true")||h$("color=always"))Nz=1;function zu(){if("FORCE_COLOR"in U$){if(U$.FORCE_COLOR==="true")return 1;if(U$.FORCE_COLOR==="false")return 0;return U$.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(U$.FORCE_COLOR,10),3)}}function gu($){if($===0)return!1;return{level:$,hasBasic:!0,has256:$>=2,has16m:$>=3}}function Vu($,{streamIsTTY:w,sniffFlags:U=!0}={}){let v=zu();if(v!==void 0)Nz=v;let J=U?Nz:v;if(J===0)return 0;if(U){if(h$("color=16m")||h$("color=full")||h$("color=truecolor"))return 3;if(h$("color=256"))return 2}if("TF_BUILD"in U$&&"AGENT_NAME"in U$)return 1;if($&&!w&&J===void 0)return 0;let z=J||0;if(U$.TERM==="dumb")return z;if(UN.platform==="win32"){let g=vu.release().split(".");if(Number(g[0])>=10&&Number(g[2])>=10586)return Number(g[2])>=14931?3:2;return 1}if("CI"in U$){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((g)=>(g in U$)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((g)=>(g in U$))||U$.CI_NAME==="codeship")return 1;return z}if("TEAMCITY_VERSION"in U$)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(U$.TEAMCITY_VERSION)?1:0;if(U$.COLORTERM==="truecolor")return 3;if(U$.TERM==="xterm-kitty")return 3;if(U$.TERM==="xterm-ghostty")return 3;if(U$.TERM==="wezterm")return 3;if("TERM_PROGRAM"in U$){let g=Number.parseInt((U$.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(U$.TERM_PROGRAM){case"iTerm.app":return g>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(U$.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(U$.TERM))return 1;if("COLORTERM"in U$)return 1;return z}function EY($,w={}){let U=Vu($,{streamIsTTY:$&&$.isTTY,...w});return gu(U)}var Gu={stdout:EY({isTTY:iY.isatty(1)}),stderr:EY({isTTY:iY.isatty(2)})},SY=Gu;function AY($,w,U){let v=$.indexOf(w);if(v===-1)return $;let J=w.length,z=0,g="";do g+=$.slice(z,v)+w+U,z=v+J,v=$.indexOf(w,z);while(v!==-1);return g+=$.slice(z),g}function RY($,w,U,v){let J=0,z="";do{let g=$[v-1]==="\r";z+=$.slice(J,g?v-1:v)+w+(g?`\r
|
|
257
257
|
`:`
|
|
258
|
-
`)+
|
|
259
|
-
`,
|
|
260
|
-
`);if(
|
|
258
|
+
`)+U,J=v+1,v=$.indexOf(`
|
|
259
|
+
`,J)}while(v!==-1);return z+=$.slice(J),z}var{stdout:kY,stderr:CY}=SY,JN=Symbol("GENERATOR"),UU=Symbol("STYLER"),fJ=Symbol("IS_EMPTY"),jY=["ansi","ansi","ansi256","ansi16m"],JU=Object.create(null),_u=($,w={})=>{if(w.level&&!(Number.isInteger(w.level)&&w.level>=0&&w.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let U=kY?kY.level:0;$.level=w.level===void 0?U:w.level};var Xu=($)=>{let w=(...U)=>U.join(" ");return _u(w,$),Object.setPrototypeOf(w,TJ.prototype),w};function TJ($){return Xu($)}Object.setPrototypeOf(TJ.prototype,Function.prototype);for(let[$,w]of Object.entries(s$))JU[$]={get(){let U=Wz(this,zN(w.open,w.close,this[UU]),this[fJ]);return Object.defineProperty(this,$,{value:U}),U}};JU.visible={get(){let $=Wz(this,this[UU],!0);return Object.defineProperty(this,"visible",{value:$}),$}};var vN=($,w,U,...v)=>{if($==="rgb"){if(w==="ansi16m")return s$[U].ansi16m(...v);if(w==="ansi256")return s$[U].ansi256(s$.rgbToAnsi256(...v));return s$[U].ansi(s$.rgbToAnsi(...v))}if($==="hex")return vN("rgb",w,U,...s$.hexToRgb(...v));return s$[U][$](...v)},Iu=["rgb","hex","ansi256"];for(let $ of Iu){JU[$]={get(){let{level:U}=this;return function(...v){let J=zN(vN($,jY[U],"color",...v),s$.color.close,this[UU]);return Wz(this,J,this[fJ])}}};let w="bg"+$[0].toUpperCase()+$.slice(1);JU[w]={get(){let{level:U}=this;return function(...v){let J=zN(vN($,jY[U],"bgColor",...v),s$.bgColor.close,this[UU]);return Wz(this,J,this[fJ])}}}}var Nu=Object.defineProperties(()=>{},{...JU,level:{enumerable:!0,get(){return this[JN].level},set($){this[JN].level=$}}}),zN=($,w,U)=>{let v,J;if(U===void 0)v=$,J=w;else v=U.openAll+$,J=w+U.closeAll;return{open:$,close:w,openAll:v,closeAll:J,parent:U}},Wz=($,w,U)=>{let v=(...J)=>Wu(v,J.length===1?""+J[0]:J.join(" "));return Object.setPrototypeOf(v,Nu),v[JN]=$,v[UU]=w,v[fJ]=U,v},Wu=($,w)=>{if($.level<=0||!w)return $[fJ]?"":w;let U=$[UU];if(U===void 0)return w;let{openAll:v,closeAll:J}=U;if(w.includes("\x1B"))while(U!==void 0)w=AY(w,U.close,U.open),U=U.parent;let z=w.indexOf(`
|
|
260
|
+
`);if(z!==-1)w=RY(w,J,v,z);return v+w+J};Object.defineProperties(TJ.prototype,JU);var Yu=TJ(),hc=TJ({level:CY?CY.level:0});var Yz=Yu;class O$ extends Error{code;constructor($,w=1){super($);this.code=w;this.name="CliError"}}function xY($,w=!1){let U=$ instanceof Error?$.message:String($);if(w)return`Error: ${U}`;return`${Yz.red("Error:")} ${U}`}function yY($){return`${$.join(`
|
|
261
261
|
`).trim()}
|
|
262
|
-
`}var uO=DV(["# Generate assets with the ploof CLI","","Ploof is an AI asset generation CLI. Use it when a task needs generated or edited images, batch asset creation, provider authentication, image context inputs, or reusable generation manifests.","","Package name: `@miketromba/ploof`. Command name: `ploof`. Supported today: OpenAI image generation, image editing, and image variations.","","## Core workflow","","1. Run `ploof whoami openai`. If unauthenticated, ask the user to run `ploof login openai` or provide `PLOOF_OPENAI_API_KEY` in their shell.","2. For one asset, use `ploof image generate` or `ploof image edit` with an explicit `--out` path.","3. For multiple assets, dependencies, or parallel work, write a YAML manifest and run `ploof run <manifest.yaml>`.","4. Use `--output json` for commands another tool or agent must parse. Use `--output jsonl` for batch streams.","5. After a command completes, verify every path in `outputs` exists before telling the user generation succeeded.","","## Authentication","","```bash","ploof login openai --api-key <key>","ploof whoami openai","ploof profiles openai","```","","There is no `ploof auth` namespace. The authentication commands are top-level: `login`, `whoami`, `profiles`, and `logout`.","","Environment variables override stored credentials:","","```bash","PLOOF_OPENAI_API_KEY=...","OPENAI_API_KEY=...","```","","Use `--profile <name>` on `login`, `whoami`, `image generate`, `image edit`, `image variation`, and manifest tasks when the user has multiple OpenAI credentials. Never print or store secrets in generated project files.","","## Image generation","","```bash","ploof image generate \\"," --provider openai \\",' --prompt "Studio product photo" \\'," --out assets/hero.png \\"," --model gpt-image-2 \\"," --size 1024x1024 \\"," --quality high \\"," --format png \\"," --output json","```","","OpenAI image generation and editing default to `gpt-image-2` when `--model` is omitted.","","Important: `--format png` controls the generated asset format. `--output json` controls CLI output formatting.","","First-class OpenAI image flags:","","- `--model <model>`: for example `gpt-image-2`.","- `--size <size>`: provider size such as `1024x1024`.","- `--quality <quality>`: provider quality such as `low`, `medium`, or `high` when supported.","- `--format <format>` or `--output-format <format>`: provider image format, usually `png`, `jpeg`, or `webp` when supported.","- `--background <value>`, `--moderation <value>`, `--n <count>`, `--output-compression <number>`, `--partial-images <number>`, `--response-format <format>`, `--style <style>`, `--user <id>`, `--stream`.","- `--param key=value`: pass one provider-specific parameter. Nested keys work, such as `--param extra.foo=bar`.","- `--json '{...}'`: merge a provider-specific JSON object into the request. Explicit first-class flags override overlapping JSON keys.","","Use `--quality low` for cheap smoke tests. Use the user's requested quality and size for final assets.","","## Image editing and context images","","```bash","ploof image edit \\"," --provider openai \\"," --image input.png \\"," --image reference.png \\"," --mask mask.png \\",' --prompt "Replace the background" \\'," --out assets/edited.png \\"," --model gpt-image-2 \\"," --format png \\"," --output json","```","","Pass every source image the provider should see with repeated `--image`. Use `--mask` only when the provider/model supports masked edits. Edit also supports `--input-fidelity <value>`.","","Input assets can be local paths, `http://` or `https://` URLs, or `-` for stdin. Ploof infers common image MIME types from file extensions and preserves generated files locally.","","## Image variations","","```bash","ploof image variation \\"," --provider openai \\"," --image input.png \\"," --out assets/variation.png \\"," --size 1024x1024 \\"," --output json","```","","OpenAI variations default to `dall-e-2`, because OpenAI's variations endpoint currently only supports `dall-e-2`. `ploof image variations` is an alias.","","## Outputs and verification","","`--out <path>` can be a file path or directory. When generating multiple images with `--n`, a file path is expanded with `-1`, `-2`, etc. If `--out` is omitted, Ploof writes in the current directory using default names like `image.png` or `edited-image.png`.","","Default sidecar metadata is enabled. For each output file, Ploof writes `<output>.json` with the operation, prompt, params, outputs, provider metadata, and timestamp.","","Parseable result shape:","","```json","{",' "kind": "image.generate",',' "provider": "openai",',' "profile": "default",',' "outputs": ["assets/hero.png"],',' "metadata": { "model": "gpt-image-2" }',"}","```","","Useful global output flags:","","- `--output json|jsonl|compact|table`: choose CLI output format.","- `--fields outputs,metadata.usage.total_tokens`: select fields for parseable outputs.","- `--detail`, `--quiet`, `--no-color`, `--verbose`.","","## Batch manifests","","```yaml","version: 1","parallel: 4","tasks:"," - id: base"," kind: image.generate"," provider: openai"," profile: default",' prompt: "Studio product photo"'," output: assets/base.png"," params:"," model: gpt-image-2"," size: 1024x1024"," quality: high"," output_format: png",""," - id: edit"," kind: image.edit"," provider: openai"," needs: [base]"," inputs:"," images:"," - task: base"," - source: ./reference.png"," mask:"," source: ./mask.png",' prompt: "Add a premium background"'," output: assets/final.png"," params:"," model: gpt-image-2"," size: 1024x1024",""," - id: variation"," kind: image.variation"," provider: openai"," needs: [base]"," inputs:"," images:"," - task: base"," output: assets/variation.png","```","","Run it with:","","```bash","ploof run assets.yaml --parallel 4 --output json","```","","Manifest notes:","","- `version: 1`, `parallel`, and `tasks` are supported.","- Task kinds are `image.generate`, `image.edit`, and `image.variation`.","- Task fields: `id`, `kind`, `provider`, `profile`, `needs`, `prompt`, `output`, `params`, `sidecar`, `inputs`.","- Relative paths are resolved from the manifest file location.","- `inputs.images` accepts strings, `{ source }`, or `{ task }`. `{ task: base }` uses the first output from that completed task.","- Run `ploof run assets.yaml --dry-run --output json` before expensive batches.","","## Configuration","","```bash","ploof config list","ploof config set output json","ploof config set defaultParallel 4","ploof config set sidecar true","ploof config reset","```","","Config is stored at `~/.ploof/config.json`. Credentials are stored separately at `~/.ploof/credentials.json`.","","## Agent guidance","","- Prefer exact user-provided prompts, dimensions, source images, and output paths. Ask only when a missing choice would change the intended asset.","- Keep prompts and params explicit in commands or manifests.","- Use deterministic output paths, usually under the user's requested asset directory or a temp directory for tests.","- Use manifests for parallel generation, dependency chains, or more than one related asset.","- Keep `--parallel` modest unless the user requests volume; generation costs money and provider rate limits may apply.","- Report generated file paths and any relevant metadata such as model and token usage.","- Do not claim assets were generated unless the command completed successfully and output files exist.","- If a command fails, report the command goal, the error, and the next concrete fix. Do not fabricate assets.","- Run `ploof <command> --help` when a detail is unclear; prefer the installed CLI help over memory."]);function ZV(){return DV(["Usage: ploof learn [options]","","Print AI-agent instructions for using the installed ploof CLI.","","Options:"," --help, -h Show this help","","Examples:"," ploof learn"])}function FV($=[]){if($.includes("--help")||$.includes("-h"))return ZV();let U=$.find((w)=>w.trim()!=="");if(U)throw Error(`Unknown learn argument: ${U}
|
|
262
|
+
`}var Qu=yY(["# Generate assets with the ploof CLI","","Ploof is an AI asset generation CLI. Use it when a task needs generated or edited images or videos, batch asset creation, provider authentication, image/video context inputs, or reusable generation manifests.","","Package name: `@miketromba/ploof`. Command name: `ploof`. Supported today: OpenAI image generation/editing and OpenAI video generation/editing/extensions/downloads/characters. OpenAI image variations are implemented through the legacy DALL-E 2 endpoint when the authenticated project has access.","","## Core workflow","","1. Run `ploof whoami openai`. If unauthenticated, ask the user to run `ploof login openai` or provide `PLOOF_OPENAI_API_KEY` in their shell.","2. For one image asset, use `ploof image generate` or `ploof image edit` with an explicit `--out` path.","3. For one video asset, use `ploof video generate --out <path>` so Ploof waits for completion and downloads the MP4.","4. For multiple assets, dependencies, or parallel work, write a YAML manifest and run `ploof run <manifest.yaml>`.","5. Use `--output json` for commands another tool or agent must parse. Use `--output jsonl` for batch streams.","6. After a command completes, verify every path in `outputs` exists before telling the user generation succeeded.","","## Authentication","","```bash","ploof login openai --api-key <key>","ploof whoami openai","ploof profiles openai","```","","There is no `ploof auth` namespace. The authentication commands are top-level: `login`, `whoami`, `profiles`, and `logout`.","","Environment variables override stored credentials:","","```bash","PLOOF_OPENAI_API_KEY=...","OPENAI_API_KEY=...","```","","Use `--profile <name>` on `login`, `whoami`, `image ...`, `video ...`, and manifest tasks when the user has multiple OpenAI credentials. Never print or store secrets in generated project files.","","## Image generation","","```bash","ploof image generate \\"," --provider openai \\",' --prompt "Studio product photo" \\'," --out assets/hero.png \\"," --model gpt-image-2 \\"," --size 1024x1024 \\"," --quality high \\"," --format png \\"," --output json","```","","OpenAI image generation and editing default to `gpt-image-2` when `--model` is omitted.","","Important: `--format png` controls the generated asset format. `--output json` controls CLI output formatting.","","First-class OpenAI image flags:","","- `--model <model>`: for example `gpt-image-2`.","- `--size <size>`: provider size such as `1024x1024`.","- `--quality <quality>`: provider quality such as `low`, `medium`, or `high` when supported.","- `--format <format>` or `--output-format <format>`: provider image format, usually `png`, `jpeg`, or `webp` when supported.","- `--background <value>`, `--moderation <value>`, `--n <count>`, `--output-compression <number>`, `--partial-images <number>`, `--response-format <format>`, `--style <style>`, `--user <id>`, `--stream`.","- `--param key=value`: pass one provider-specific parameter. Nested keys work, such as `--param extra.foo=bar`.","- `--json '{...}'`: merge a provider-specific JSON object into the request. Explicit first-class flags override overlapping JSON keys.","","Use `--quality low` for cheap smoke tests. Use the user's requested quality and size for final assets.","","## Image editing and context images","","```bash","ploof image edit \\"," --provider openai \\"," --image input.png \\"," --image reference.png \\"," --mask mask.png \\",' --prompt "Replace the background" \\'," --out assets/edited.png \\"," --model gpt-image-2 \\"," --format png \\"," --output json","```","","Pass every source image the provider should see with repeated `--image`. Use `--mask` only when the provider/model supports masked edits. Edit also supports `--input-fidelity <value>`.","","Input assets can be local paths, `http://` or `https://` URLs, or `-` for stdin. Ploof infers common image MIME types from file extensions and preserves generated files locally.","","## Image variations","","```bash","ploof image variation \\"," --provider openai \\"," --image input.png \\"," --out assets/variation.png \\"," --size 1024x1024 \\"," --output json","```","","OpenAI variations default to `dall-e-2`, because OpenAI's legacy variations endpoint currently only supports `dall-e-2`. If OpenAI returns a 404, use `ploof image edit` for image-to-image workflows or try a profile/project with DALL-E 2 variation access. `ploof image variations` is an alias.","","## Video generation","","```bash","ploof video generate \\"," --provider openai \\",' --prompt "Wide tracking shot of a paper city at blue hour" \\'," --model sora-2 \\"," --size 1280x720 \\"," --seconds 4 \\"," --out assets/clip.mp4 \\"," --output json","```","","OpenAI video generation defaults to `sora-2` when `--model` is omitted. Video jobs are asynchronous. Passing `--out` or `--download` makes Ploof wait for a terminal status and download the requested asset.","","First-class OpenAI video flags:","","- `--model <model>`: for example `sora-2` or `sora-2-pro`.","- `--size <size>`: provider size such as `1280x720`.","- `--seconds <seconds>`: clip or extension duration.","- `--input-reference <path-or-url-or-file-id>`, `--input-reference-file-id <id>`, or `--input-reference-url <url>`: image reference for the first frame.","- `--character <id>`: reusable character id; repeat for multiple characters and mention the character name in the prompt.","- `--wait`, `--download`, `--variant video|thumbnail|spritesheet`, `--poll-interval <seconds>`, `--timeout <seconds>`.","- `--param key=value` and `--json '{...}'` work for provider-specific video settings.","","## Video editing, extension, and library","","```bash","ploof video edit \\"," --video-id video_abc123 \\",' --prompt "Shift the palette to teal and rust" \\'," --out assets/edit.mp4 \\"," --output json","","ploof video extend \\"," --video-id video_abc123 \\",' --prompt "Continue as the camera rises over the rooftops" \\'," --seconds 4 \\"," --out assets/extended.mp4 \\"," --output json","","ploof video download video_abc123 --variant thumbnail --out assets/thumb.webp --output json","ploof video status video_abc123 --output json","ploof video list --limit 20 --output json","```","","Video edits accept `--video-id <id>` for completed OpenAI videos or `--video <path>` for uploaded source videos when the authenticated project is eligible. Extensions accept `--video-id` or `--video`, plus `--seconds`.","","Reusable characters:","","```bash","ploof video character create --name Mossy --video character.mp4 --output json","ploof video character get char_abc123 --output json","```","","## Outputs and verification","","`--out <path>` can be a file path or directory. When generating multiple images with `--n`, a file path is expanded with `-1`, `-2`, etc. Video downloads use `.mp4`, thumbnails use `.webp`, and spritesheets use `.jpg`. If `--out` is omitted for image generation, Ploof writes in the current directory using default names like `image.png` or `edited-image.png`.","","Default sidecar metadata is enabled. For each output file, Ploof writes `<output>.json` with the operation, prompt, params, outputs, provider metadata, and timestamp.","","Parseable result shape:","","```json","{",' "kind": "video.generate",',' "provider": "openai",',' "profile": "default",',' "outputs": ["assets/clip.mp4"],',' "metadata": { "video": { "id": "video_...", "status": "completed" } }',"}","```","","Useful global output flags:","","- `--output json|jsonl|compact|table`: choose CLI output format.","- `--fields outputs,metadata.usage.total_tokens`: select fields for parseable outputs.","- `--detail`, `--quiet`, `--no-color`, `--verbose`.","","## Batch manifests","","```yaml","version: 1","parallel: 4","tasks:"," - id: base"," kind: image.generate"," provider: openai"," profile: default",' prompt: "Studio product photo"'," output: assets/base.png"," params:"," model: gpt-image-2"," size: 1024x1024"," quality: high"," output_format: png",""," - id: edit"," kind: image.edit"," provider: openai"," needs: [base]"," inputs:"," images:"," - task: base"," - source: ./reference.png"," mask:"," source: ./mask.png",' prompt: "Add a premium background"'," output: assets/final.png"," params:"," model: gpt-image-2"," size: 1024x1024",""," - id: variation"," kind: image.variation"," provider: openai"," needs: [base]"," inputs:"," images:"," - task: base"," output: assets/variation.png",""," - id: clip"," kind: video.generate"," provider: openai",' prompt: "Slow dolly shot through a miniature paper city"'," output: assets/clip.mp4"," wait: true"," download: true"," params:"," model: sora-2"," size: 1280x720"," seconds: '4'","```","","Run it with:","","```bash","ploof run assets.yaml --parallel 4 --output json","```","","Manifest notes:","","- `version: 1`, `parallel`, and `tasks` are supported.","- Task kinds include `image.generate`, `image.edit`, `image.variation`, `video.generate`, `video.edit`, `video.extend`, `video.remix`, `video.status`, `video.download`, `video.list`, `video.delete`, `video.character.create`, and `video.character.get`.","- Task fields: `id`, `kind`, `provider`, `profile`, `needs`, `prompt`, `output`, `params`, `sidecar`, `inputs`, `videoId`, `characterId`, `name`, `wait`, `download`, `variants`, `pollIntervalMs`, and `timeoutMs`.","- Relative paths are resolved from the manifest file location.","- `inputs.images` accepts strings, `{ source }`, or `{ task }`. `{ task: base }` uses the first output from that completed task.","- `inputs.video`, `inputs.videos`, and `inputs.inputReference` use the same input reference shape.","- Run `ploof run assets.yaml --dry-run --output json` before expensive batches.","","## Configuration","","```bash","ploof config list","ploof config set output json","ploof config set defaultParallel 4","ploof config set sidecar true","ploof config reset","```","","Config is stored at `~/.ploof/config.json`. Credentials are stored separately at `~/.ploof/credentials.json`.","","## Agent guidance","","- Prefer exact user-provided prompts, dimensions, source images, and output paths. Ask only when a missing choice would change the intended asset.","- Keep prompts and params explicit in commands or manifests.","- Use deterministic output paths, usually under the user's requested asset directory or a temp directory for tests.","- Use manifests for parallel generation, dependency chains, or more than one related asset.","- Keep `--parallel` modest unless the user requests volume; generation costs money and provider rate limits may apply.","- Report generated file paths and any relevant metadata such as model and token usage.","- Do not claim assets were generated unless the command completed successfully and output files exist.","- If a command fails, report the command goal, the error, and the next concrete fix. Do not fabricate assets.","- Run `ploof <command> --help` when a detail is unclear; prefer the installed CLI help over memory."]);function rY(){return yY(["Usage: ploof learn [options]","","Print AI-agent instructions for using the installed ploof CLI.","","Options:"," --help, -h Show this help","","Examples:"," ploof learn"])}function dY($=[]){if($.includes("--help")||$.includes("-h"))return rY();let w=$.find((U)=>U.trim()!=="");if(w)throw Error(`Unknown learn argument: ${w}
|
|
263
263
|
|
|
264
|
-
${ZV()}`);return uO}import{readFile as iE}from"node:fs/promises";import{dirname as hE,extname as mE,resolve as xB}from"node:path";var pb=cW(),tb=R0(),ab=MW(),UY=k0(),ob=L0(),e4=p(),eb=n4(),sb=_$(),$E=t4(),UE=a4(),Jn=mJ(),wE=eW(),zE=sW(),JE=$Y(),dJ=RB(),kB=I0();var GE=pb.Composer,XE=tb.Document,_E=ab.Schema,NE=UY.YAMLError,WE=UY.YAMLParseError,YE=UY.YAMLWarning,QE=ob.Alias,VE=e4.isAlias,gE=e4.isCollection,BE=e4.isDocument,qE=e4.isMap,HE=e4.isNode,IE=e4.isPair,KE=e4.isScalar,LE=e4.isSeq,PE=eb.Pair,OE=sb.Scalar,TE=$E.YAMLMap,ZE=UE.YAMLSeq;var DE=wE.Lexer,FE=zE.LineCounter,vE=JE.Parser,wY=dJ.parse,ME=dJ.parseAllDocuments,SE=dJ.parseDocument,bE=dJ.stringify,EE=kB.visit,AE=kB.visitAsync;var fE="gpt-image-2",RE="dall-e-2";class QY{id="openai";capabilities=["image.generate","image.edit","image.variation"];async runImageGenerate($,U){let w=XY(U),J=zY("image.generate",{...$.params,prompt:$.prompt});JY("image.generate",J);let z=await _Y(w).generate(J),G=await NY({response:z,output:$.output,format:YY(J),defaultName:$.id??"image"}),X={id:$.id,kind:"image.generate",provider:this.id,profile:U.credential.profile,outputs:G,metadata:WY(z,J)};if($.sidecar??U.sidecar??!0)await Oz(X,{...$,params:GY(J)},"image.generate");return X}async runImageEdit($,U){let w=XY(U),J=$.inputs.filter((V)=>V.role==="image"),z=$.inputs.find((V)=>V.role==="mask");if(J.length===0)throw Error("At least one --image input is required for image edits.");let G=await Promise.all(J.map(Lz)),X=z?await Lz(z):void 0,_=G.length===1?G[0]:G,N=zY("image.edit",{...$.params,prompt:$.prompt,image:_,...X?{mask:X}:{}});JY("image.edit",N);let W=await _Y(w).edit(N),Y=await NY({response:W,output:$.output,format:YY(N),defaultName:$.id??"edited-image"}),Q={id:$.id,kind:"image.edit",provider:this.id,profile:U.credential.profile,outputs:Y,metadata:WY(W,N)};if($.sidecar??U.sidecar??!0)await Oz(Q,{...$,params:GY(N)},"image.edit");return Q}async runImageVariation($,U){let w=XY(U),J=$.inputs.find((W)=>W.role==="image");if(!J)throw Error("An --image input is required for image variations.");let z=await Lz(J),G=zY("image.variation",{...$.params,image:z});JY("image.variation",G);let X=await _Y(w).createVariation(G),_=await NY({response:X,output:$.output,format:YY(G),defaultName:$.id??"variation"}),N={id:$.id,kind:"image.variation",provider:this.id,profile:U.credential.profile,outputs:_,metadata:WY(X,G)};if($.sidecar??U.sidecar??!0)await Oz(N,{...$,params:GY(G)},"image.variation");return N}}function zY($,U){return{...U,model:U.model??($==="image.variation"?RE:fE)}}function JY($,U){let w=typeof U.model==="string"?U.model:void 0;if($==="image.variation"&&w&&w!=="dall-e-2")throw Error("OpenAI image variations currently only support model=dall-e-2.");if(!w)return;if(kE(w)&&U.response_format!==void 0)throw Error("`response_format` is only supported for DALL-E image models. GPT image models return base64 image data.");if(jE(w)){if(U.background==="transparent")throw Error("`background=transparent` is not supported by gpt-image-2. Use `background=auto` or `background=opaque`.");if(U.input_fidelity!==void 0)throw Error("`input_fidelity` is not configurable for gpt-image-2; omit it because gpt-image-2 processes image inputs at high fidelity automatically.")}}function GY($){let{image:U,mask:w,...J}=$;return J}function kE($){return $.startsWith("gpt-image-")||$==="chatgpt-image-latest"}function jE($){return $==="gpt-image-2"||$.startsWith("gpt-image-2-")}function XY($){let U=$.credential;if(!U.apiKey)throw Error("No OpenAI API key found. Run 'ploof login openai --api-key <key>' or set PLOOF_OPENAI_API_KEY.");return new i({apiKey:U.apiKey,organization:U.organization,project:U.project,baseURL:U.baseURL})}function _Y($){return $.images}async function NY($){if(xE($.response))return uE($);let U=jB($.response),w=U.length,J=[];for(let z=0;z<U.length;z++){let G=U[z];if(G.b64_json)J.push(await Pz({data:G.b64_json,output:$.output,index:z,total:w,format:$.format,defaultName:$.defaultName}));else if(G.url)J.push(await G5({url:G.url,output:$.output,index:z,total:w,format:$.format,defaultName:$.defaultName}))}if(J.length===0)throw Error("OpenAI response did not include image data or URLs.");return J}async function uE($){let U=[];for await(let J of $.response)U.push(...CE(J));if(U.length===0)throw Error("OpenAI stream did not include image data.");let w=[];for(let J=0;J<U.length;J++)w.push(await Pz({data:U[J],output:$.output,index:J,total:U.length,format:$.format,defaultName:$.defaultName}));return w}function WY($,U){let w=$&&typeof $==="object"?$:{};return{model:U?.model,created:w.created,usage:w.usage,revisedPrompts:jB($).map((J)=>J.revised_prompt).filter(Boolean)}}function jB($){if(!$||typeof $!=="object")return[];let U=$.data;return Array.isArray(U)?U:[]}function CE($){if(!$||typeof $!=="object")return[];let U=[],w=(J)=>{if(!J||typeof J!=="object")return;for(let[z,G]of Object.entries(J))if(typeof G==="string"&&(z==="b64_json"||z==="partial_image_b64"||z==="image_b64"))U.push(G);else if(typeof G==="object")w(G)};return w($),U}function YY($){return $?.output_format??$?.format}function xE($){return Boolean($&&typeof $==="object"&&Symbol.asyncIterator in $)}var yE=[new QY];function nJ($){let U=yE.find((w)=>w.id===$);if(!U)throw Error(`Unknown provider: ${$}`);return U}var uB=y.union([y.string(),y.object({source:y.string().optional(),task:y.string().optional(),mime:y.string().optional(),name:y.string().optional()})]),cE=y.object({id:y.string(),kind:y.enum(["image.generate","image.edit","image.variation"]),provider:y.string().default("openai"),profile:y.string().optional(),needs:y.array(y.string()).default([]),prompt:y.string().optional(),params:y.record(y.string(),y.unknown()).default({}),output:y.string().optional(),sidecar:y.boolean().optional(),inputs:y.object({images:y.array(uB).optional(),mask:uB.optional()}).optional()}),rE=y.object({version:y.union([y.literal(1),y.string()]).default(1),parallel:y.number().int().positive().optional(),tasks:y.array(cE).min(1)});async function lE($){let U=await iE($,"utf-8"),J=mE($).toLowerCase()===".json"?JSON.parse(U):wY(U),z=rE.parse(J);return dE(z),z}async function yB($,U={}){let w=await lE($),J=U.parallel??w.parallel??4,z=hE(xB($));if(U.dryRun)return w.tasks.map((Q)=>({id:Q.id,kind:Q.kind,provider:Q.provider,profile:Q.profile,outputs:Q.output?[pJ(z,Q.output)]:[],metadata:{dryRun:!0,needs:Q.needs}}));let G=U.auth??new T4,X=new Map,_=new Map,N=new Map(w.tasks.map((Q)=>[Q.id,Q])),W=[],Y;while(N.size>0||_.size>0){if(Y)throw Y;for(let[Q,V]of[...N]){if(_.size>=J)break;if(!V.needs.every((H)=>X.has(H)))continue;N.delete(Q);let g=nE(V,{auth:G,baseDir:z,completed:X,verbose:U.verbose,sidecar:U.config?.get("sidecar")??!0}).then((H)=>{X.set(Q,H),W.push(H)}).catch((H)=>{Y=H}).finally(()=>{_.delete(Q)});_.set(Q,g)}if(_.size===0&&N.size>0)throw Error("Manifest has unresolved dependencies.");if(_.size>0)await Promise.race(_.values())}if(Y)throw Y;return W}function dE($){let U=new Set;for(let w of $.tasks){if(U.has(w.id))throw Error(`Duplicate task id: ${w.id}`);U.add(w.id)}for(let w of $.tasks){if(w.kind!=="image.variation"&&!w.prompt)throw Error(`Task ${w.id} requires a prompt.`);if(w.kind==="image.variation"&&!w.inputs?.images?.length)throw Error(`Task ${w.id} requires inputs.images.`);for(let J of w.needs)if(!U.has(J))throw Error(`Task ${w.id} depends on unknown task ${J}.`)}}async function nE($,U){let w=nJ($.provider),J=U.auth.getCredential($.provider,$.profile);if(!J?.apiKey)throw Error(`No credentials found for ${$.provider}. Run 'ploof login ${$.provider}'.`);let z={id:$.id,kind:$.kind,provider:$.provider,profile:$.profile,prompt:$.prompt??"",params:$.params,output:$.output?pJ(U.baseDir,$.output):void 0,sidecar:$.sidecar??U.sidecar};if($.kind==="image.generate")return w.runImageGenerate({...z,kind:"image.generate"},{credential:J,verbose:U.verbose,sidecar:z.sidecar});let G=pE($,U);if($.kind==="image.variation")return w.runImageVariation({...z,kind:"image.variation",inputs:G},{credential:J,verbose:U.verbose,sidecar:z.sidecar});return w.runImageEdit({...z,kind:"image.edit",inputs:G},{credential:J,verbose:U.verbose,sidecar:z.sidecar})}function pE($,U){let w=[];for(let J of $.inputs?.images??[])w.push({role:"image",source:CB(J,U)});if($.inputs?.mask)w.push({role:"mask",source:CB($.inputs.mask,U)});return w}function CB($,U){if(typeof $==="string")return pJ(U.baseDir,$);if($.task){let J=U.completed.get($.task)?.outputs[0];if(!J)throw Error(`Task output not available: ${$.task}`);return J}if($.source)return pJ(U.baseDir,$.source);throw Error("Input reference must include source or task.")}function pJ($,U){if(U.startsWith("/")||U.startsWith("http://")||U.startsWith("https://")||U==="-")return U;return xB($,U)}function iB($,U,w,J){let z=$??w??U;if(z&&z!=="auto"){if(sE(z))return z;throw Error(`Invalid output format: ${z}`)}return J?"table":"compact"}function hB($,U){let w=Array.isArray($)?$:[$],J=U.fields?.length?w.map((z)=>oE(z,U.fields)):w;switch(U.format){case"json":return JSON.stringify(Array.isArray($)?J:J[0],null,2);case"jsonl":return J.map((z)=>JSON.stringify(z)).join(`
|
|
265
|
-
`);case"table":return
|
|
266
|
-
`)}}function
|
|
267
|
-
`)}function
|
|
264
|
+
${rY()}`);return Qu}import{readFile as di}from"node:fs/promises";import{dirname as mi,extname as ni,resolve as P7}from"node:path";var bM=v8(),FM=mJ(),MM=dN(),P8=nJ(),iM=FJ(),v6=t(),EM=s4(),SM=G$(),AM=w6(),RM=U6(),Wt=sz(),kM=W8(),CM=Y8(),jM=Q8(),J2=p5(),a5=ZJ();var xM=bM.Composer,rM=FM.Document,yM=MM.Schema,dM=P8.YAMLError,mM=P8.YAMLParseError,nM=P8.YAMLWarning,hM=iM.Alias,cM=v6.isAlias,lM=v6.isCollection,tM=v6.isDocument,oM=v6.isMap,pM=v6.isNode,aM=v6.isPair,eM=v6.isScalar,sM=v6.isSeq,$i=EM.Pair,wi=SM.Scalar,Ui=AM.YAMLMap,Ji=RM.YAMLSeq;var vi=kM.Lexer,zi=CM.LineCounter,gi=jM.Parser,O8=J2.parse,Vi=J2.parseAllDocuments,Gi=J2.parseDocument,_i=J2.stringify,Xi=a5.visit,Ii=a5.visitAsync;function e5($){let w=$.credential;if(!w.apiKey)throw Error("No OpenAI API key found. Run 'ploof login openai --api-key <key>' or set PLOOF_OPENAI_API_KEY.");return new r({apiKey:w.apiKey,organization:w.organization,project:w.project,baseURL:w.baseURL})}var $7="sora-2",Ni=1e4,Wi=900000,Yi=new Set(["completed","failed","expired"]);async function w7($,w,U){let v=await Qi(w),J=await t$("video.generate",()=>o$($).create(v));return z2($,w,U,J,v)}async function U7($,w,U){let v=await I7(w),J=await t$("video.edit",()=>o$($).edit(v));return z2($,w,U,J,v)}async function J7($,w,U){let v=await I7(w),J=await t$("video.extend",()=>o$($).extend(v));return z2($,w,U,J,v)}async function v7($,w,U){let v=L8({...w.params,prompt:w.prompt}),J=await t$("video.remix",()=>o$($).remix(w.videoId,v));return z2($,w,U,J,v)}async function z7($,w,U){let v=await t$("video.status",()=>o$($).retrieve(w.videoId));return{id:w.id,kind:"video.status",provider:"openai",profile:U.credential.profile,outputs:[],metadata:{video:v}}}async function g7($,w,U){let v=await N7({client:$,videoId:w.videoId,output:w.output,variants:w.variants}),J={id:w.id,kind:"video.download",provider:"openai",profile:U.credential.profile,outputs:v,metadata:{videoId:w.videoId,variants:w.variants}};if(w.sidecar??U.sidecar??!0)await T6(J,{...w,params:w.params},"video.download");return J}async function V7($,w,U){let v=await t$("video.list",()=>o$($).list(w.params??{}));return{id:w.id,kind:"video.list",provider:"openai",profile:U.credential.profile,outputs:[],metadata:fi(v)}}async function G7($,w,U){let v=await t$("video.delete",()=>o$($).delete(w.videoId));return{id:w.id,kind:"video.delete",provider:"openai",profile:U.credential.profile,outputs:[],metadata:{deleted:v}}}async function _7($,w,U){let v=q8(w.inputs,"video");if(!v)throw Error("A --video input is required to create a character.");let J={...w.params,name:w.name,video:await r4(v)},z=await t$("video.character.create",()=>o$($).createCharacter(J));return{id:w.id,kind:"video.character.create",provider:"openai",profile:U.credential.profile,outputs:[],metadata:{character:z}}}async function X7($,w,U){let v=await t$("video.character.get",()=>o$($).getCharacter(w.characterId));return{id:w.id,kind:"video.character.get",provider:"openai",profile:U.credential.profile,outputs:[],metadata:{character:v}}}async function Qi($){let w=L8({...$.params,model:$.params?.model??$7,prompt:$.prompt}),U=q8($.inputs,"reference");if(U)w.input_reference=await Pi(U);return w}async function I7($){let w=await Oi($),U=L8({...$.params,prompt:$.prompt,video:w});if(!w)throw Error("Provide --video-id or --video.");if(bi(w)&&U.model===void 0)U.model=$7;return U}async function Pi($){if($.source.startsWith("file:"))return{file_id:$.source.slice(5)};if(Mi($.source))return{file_id:$.source};if(Fi($.source)||$.source.startsWith("data:"))return{image_url:$.source};return r4($)}async function Oi($){if($.videoId)return{id:$.videoId};let w=q8($.inputs,"video");return w?r4(w):void 0}async function z2($,w,U,v,J){let z=v,g=s5(v),V=ui(w);if(V){if(!g)throw Error("OpenAI video response did not include a video id.");z=await Bi($,g,w),qi(z)}let _=s5(z)??g,G=Ki(w)&&_?await N7({client:$,videoId:_,output:w.output,variants:w.variants??["video"]}):[],X={id:w.id,kind:w.kind,provider:"openai",profile:U.credential.profile,outputs:G,metadata:{video:z,submitted:v,waited:V,downloaded:G.length>0}};if(G.length>0&&(w.sidecar??U.sidecar??!0))await T6(X,{...w,params:Ti(J)},w.kind);return X}async function Bi($,w,U){let v=Date.now(),J=U.pollIntervalMs??Ni,z=U.timeoutMs??Wi,g=await t$("video.status",()=>o$($).retrieve(w));while(!Yi.has(W7(g))){if(Date.now()-v>z)throw Error(`Timed out waiting for OpenAI video ${w} after ${z}ms.`);await ii(J),g=await t$("video.status",()=>o$($).retrieve(w))}return g}function qi($){let w=W7($);if(w==="completed")return;let U=Di($);throw Error(U?`OpenAI video generation failed: ${U}`:`OpenAI video generation ended with status=${w||"unknown"}.`)}async function N7($){let w=[];for(let U=0;U<$.variants.length;U++){let v=$.variants[U],J=await t$("video.download",()=>o$($.client).downloadContent($.videoId,{variant:v}));w.push(await u3({response:J,output:Li($.output,v,$.variants.length),index:0,total:1,format:B8(v),defaultName:Hi($.videoId,v)}))}return w}function Li($,w,U){if(!$||U<=1||$.endsWith("/"))return $;let v=$.lastIndexOf("."),J=Math.max($.lastIndexOf("/"),$.lastIndexOf("\\"));if(v<=J)return`${$}-${w}.${B8(w)}`;return`${$.slice(0,v)}-${w}.${B8(w)}`}function Hi($,w){return w==="video"?$:`${$}-${w}`}function B8($){switch($){case"thumbnail":return"webp";case"spritesheet":return"jpg";case"video":return"mp4"}}function ui($){return $.wait===!0||Boolean($.output)||$.download===!0}function Ki($){return $.download===!0||Boolean($.output)}function s5($){return v2($,"id")}function W7($){return v2($,"status")??""}function Di($){if(!$||typeof $!=="object")return;let w=$.error;if(!w||typeof w!=="object")return;return v2(w,"message")??v2(w,"code")}function v2($,w){if(!$||typeof $!=="object")return;let U=$[w];return typeof U==="string"?U:void 0}function fi($){let w=$&&typeof $==="object"?$:{};return{data:w.data,has_more:w.has_more,first_id:w.first_id,last_id:w.last_id}}function Ti($){let{input_reference:w,video:U,...v}=$;return v}async function t$($,w){try{return await w()}catch(U){throw Zi($,U)}}function Zi($,w){if(w instanceof Error)return w;return Error(`OpenAI ${$} failed: ${String(w)}`)}function o$($){return $.videos}function q8($,w){return $.find((U)=>U.role===w)}function bi($){return Boolean($&&typeof $==="object"&&"name"in $)}function Fi($){return $.startsWith("http://")||$.startsWith("https://")}function Mi($){return $.startsWith("file-")||$.startsWith("file_")}function ii($){return new Promise((w)=>setTimeout(w,$))}function L8($){let w={};for(let[U,v]of Object.entries($))if(v!==void 0)w[U]=v;return w}var Ei="gpt-image-2",Si="dall-e-2";class F8{id="openai";capabilities=["image.generate","image.edit","image.variation","video.generate","video.edit","video.extend","video.remix","video.status","video.download","video.list","video.delete","video.character.create","video.character.get"];async runImageGenerate($,w){let U=y$(w),v=H8("image.generate",{...$.params,prompt:$.prompt});u8("image.generate",v);let J=await K8("image.generate",()=>f8(U).generate(v)),z=await T8({response:J,output:$.output,format:b8(v),defaultName:$.id??"image"}),g={id:$.id,kind:"image.generate",provider:this.id,profile:w.credential.profile,outputs:z,metadata:Z8(J,v)};if($.sidecar??w.sidecar??!0)await T6(g,{...$,params:D8(v)},"image.generate");return g}async runImageEdit($,w){let U=y$(w),v=$.inputs.filter((N)=>N.role==="image"),J=$.inputs.find((N)=>N.role==="mask");if(v.length===0)throw Error("At least one --image input is required for image edits.");let z=await Promise.all(v.map(r4)),g=J?await r4(J):void 0,V=z.length===1?z[0]:z,_=H8("image.edit",{...$.params,prompt:$.prompt,image:V,...g?{mask:g}:{}});u8("image.edit",_);let G=await K8("image.edit",()=>f8(U).edit(_)),X=await T8({response:G,output:$.output,format:b8(_),defaultName:$.id??"edited-image"}),I={id:$.id,kind:"image.edit",provider:this.id,profile:w.credential.profile,outputs:X,metadata:Z8(G,_)};if($.sidecar??w.sidecar??!0)await T6(I,{...$,params:D8(_)},"image.edit");return I}async runImageVariation($,w){let U=y$(w),v=$.inputs.find((G)=>G.role==="image");if(!v)throw Error("An --image input is required for image variations.");let J=await r4(v),z=H8("image.variation",{...$.params,image:J});u8("image.variation",z);let g=await K8("image.variation",()=>f8(U).createVariation(z)),V=await T8({response:g,output:$.output,format:b8(z),defaultName:$.id??"variation"}),_={id:$.id,kind:"image.variation",provider:this.id,profile:w.credential.profile,outputs:V,metadata:Z8(g,z)};if($.sidecar??w.sidecar??!0)await T6(_,{...$,params:D8(z)},"image.variation");return _}async runVideoGenerate($,w){return w7(y$(w),$,w)}async runVideoEdit($,w){return U7(y$(w),$,w)}async runVideoExtend($,w){return J7(y$(w),$,w)}async runVideoRemix($,w){return v7(y$(w),$,w)}async runVideoStatus($,w){return z7(y$(w),$,w)}async runVideoDownload($,w){return g7(y$(w),$,w)}async runVideoList($,w){return V7(y$(w),$,w)}async runVideoDelete($,w){return G7(y$(w),$,w)}async runVideoCharacterCreate($,w){return _7(y$(w),$,w)}async runVideoCharacterGet($,w){return X7(y$(w),$,w)}}function H8($,w){return{...w,model:w.model??($==="image.variation"?Si:Ei)}}function u8($,w){let U=typeof w.model==="string"?w.model:void 0;if($==="image.variation"&&U&&U!=="dall-e-2")throw Error("OpenAI image variations currently only support model=dall-e-2.");if(!U)return;if(ki(U)&&w.response_format!==void 0)throw Error("`response_format` is only supported for DALL-E image models. GPT image models return base64 image data.");if(Ci(U)){if(w.background==="transparent")throw Error("`background=transparent` is not supported by gpt-image-2. Use `background=auto` or `background=opaque`.");if(w.input_fidelity!==void 0)throw Error("`input_fidelity` is not configurable for gpt-image-2; omit it because gpt-image-2 processes image inputs at high fidelity automatically.")}}async function K8($,w){try{return await w()}catch(U){throw Ai($,U)}}function Ai($,w){let U=Ri(w);if($==="image.variation"&&U===404){let v=Error("OpenAI image variations returned 404. The variations endpoint is legacy and only supports dall-e-2; this usually means the current API key or project cannot access that endpoint. Use `ploof image edit` for image-to-image workflows, or try a profile/project with DALL-E 2 variation access.");return v.cause=w,v}if(w instanceof Error)return w;return Error(String(w))}function Ri($){if(!$||typeof $!=="object")return;let w=$,U=w.status??w.statusCode;return typeof U==="number"?U:void 0}function D8($){let{image:w,mask:U,...v}=$;return v}function ki($){return $.startsWith("gpt-image-")||$==="chatgpt-image-latest"}function Ci($){return $==="gpt-image-2"||$.startsWith("gpt-image-2-")}function y$($){return e5($)}function f8($){return $.images}async function T8($){if(ri($.response))return ji($);let w=Y7($.response),U=w.length,v=[];for(let J=0;J<w.length;J++){let z=w[J];if(z.b64_json)v.push(await E0({data:z.b64_json,output:$.output,index:J,total:U,format:$.format,defaultName:$.defaultName}));else if(z.url)v.push(await H3({url:z.url,output:$.output,index:J,total:U,format:$.format,defaultName:$.defaultName}))}if(v.length===0)throw Error("OpenAI response did not include image data or URLs.");return v}async function ji($){let w=[];for await(let v of $.response)w.push(...xi(v));if(w.length===0)throw Error("OpenAI stream did not include image data.");let U=[];for(let v=0;v<w.length;v++)U.push(await E0({data:w[v],output:$.output,index:v,total:w.length,format:$.format,defaultName:$.defaultName}));return U}function Z8($,w){let U=$&&typeof $==="object"?$:{};return{model:w?.model,created:U.created,usage:U.usage,revisedPrompts:Y7($).map((v)=>v.revised_prompt).filter(Boolean)}}function Y7($){if(!$||typeof $!=="object")return[];let w=$.data;return Array.isArray(w)?w:[]}function xi($){if(!$||typeof $!=="object")return[];let w=[],U=(v)=>{if(!v||typeof v!=="object")return;for(let[J,z]of Object.entries(v))if(typeof z==="string"&&(J==="b64_json"||J==="partial_image_b64"||J==="image_b64"))w.push(z);else if(typeof z==="object")U(z)};return U($),w}function b8($){return $?.output_format??$?.format}function ri($){return Boolean($&&typeof $==="object"&&Symbol.asyncIterator in $)}var yi=[new F8];function g2($){let w=yi.find((U)=>U.id===$);if(!w)throw Error(`Unknown provider: ${$}`);return w}var pJ=C.union([C.string(),C.object({source:C.string().optional(),task:C.string().optional(),mime:C.string().optional(),name:C.string().optional()})]),hi=C.object({id:C.string(),kind:C.enum(["image.generate","image.edit","image.variation","video.generate","video.edit","video.extend","video.remix","video.status","video.download","video.list","video.delete","video.character.create","video.character.get"]),provider:C.string().default("openai"),profile:C.string().optional(),needs:C.array(C.string()).default([]),prompt:C.string().optional(),params:C.record(C.string(),C.unknown()).default({}),output:C.string().optional(),sidecar:C.boolean().optional(),videoId:C.string().optional(),characterId:C.string().optional(),name:C.string().optional(),wait:C.boolean().optional(),download:C.boolean().optional(),variants:C.array(C.enum(["video","thumbnail","spritesheet"])).optional(),pollIntervalMs:C.number().int().nonnegative().optional(),timeoutMs:C.number().int().nonnegative().optional(),inputs:C.object({images:C.array(pJ).optional(),mask:pJ.optional(),video:pJ.optional(),videos:C.array(pJ).optional(),inputReference:pJ.optional()}).optional()}),ci=C.object({version:C.union([C.literal(1),C.string()]).default(1),parallel:C.number().int().positive().optional(),tasks:C.array(hi).min(1)});async function li($){let w=await di($,"utf-8"),v=ni($).toLowerCase()===".json"?JSON.parse(w):O8(w),J=ci.parse(v);return ti(J),J}async function O7($,w={}){let U=await li($),v=w.parallel??U.parallel??4,J=mi(P7($));if(w.dryRun)return U.tasks.map((I)=>({id:I.id,kind:I.kind,provider:I.provider,profile:I.profile,outputs:I.output?[V2(J,I.output)]:[],metadata:{dryRun:!0,needs:I.needs}}));let z=w.auth??new T4,g=new Map,V=new Map,_=new Map(U.tasks.map((I)=>[I.id,I])),G=[],X;while(_.size>0||V.size>0){if(X)throw X;for(let[I,N]of[..._]){if(V.size>=v)break;if(!N.needs.every((P)=>g.has(P)))continue;_.delete(I);let W=pi(N,{auth:z,baseDir:J,completed:g,verbose:w.verbose,sidecar:w.config?.get("sidecar")??!0}).then((P)=>{g.set(I,P),G.push(P)}).catch((P)=>{X=P}).finally(()=>{V.delete(I)});V.set(I,W)}if(V.size===0&&_.size>0)throw Error("Manifest has unresolved dependencies.");if(V.size>0)await Promise.race(V.values())}if(X)throw X;return G}function ti($){let w=new Set;for(let U of $.tasks){if(w.has(U.id))throw Error(`Duplicate task id: ${U.id}`);w.add(U.id)}for(let U of $.tasks){if(oi(U.kind)&&!U.prompt)throw Error(`Task ${U.id} requires a prompt.`);if(U.kind==="image.variation"&&!U.inputs?.images?.length)throw Error(`Task ${U.id} requires inputs.images.`);if(["video.edit","video.extend"].includes(U.kind)&&!U.videoId&&!U.inputs?.video&&!U.inputs?.videos?.length)throw Error(`Task ${U.id} requires videoId or inputs.video.`);if(["video.status","video.download","video.delete","video.remix"].includes(U.kind)&&!U.videoId)throw Error(`Task ${U.id} requires videoId.`);if(U.kind==="video.character.create"){if(!U.name)throw Error(`Task ${U.id} requires name.`);if(!U.inputs?.video&&!U.inputs?.videos?.length)throw Error(`Task ${U.id} requires inputs.video.`)}if(U.kind==="video.character.get"&&!U.characterId)throw Error(`Task ${U.id} requires characterId.`);for(let v of U.needs)if(!w.has(v))throw Error(`Task ${U.id} depends on unknown task ${v}.`)}}function oi($){return["image.generate","image.edit","video.generate","video.edit","video.extend","video.remix"].includes($)}async function pi($,w){let U=g2($.provider),v=w.auth.getCredential($.provider,$.profile);if(!v?.apiKey)throw Error(`No credentials found for ${$.provider}. Run 'ploof login ${$.provider}'.`);let J={id:$.id,kind:$.kind,provider:$.provider,profile:$.profile,prompt:$.prompt??"",params:$.params,output:$.output?V2(w.baseDir,$.output):void 0,sidecar:$.sidecar??w.sidecar};if($.kind==="image.generate")return U.runImageGenerate({...J,kind:"image.generate"},{credential:v,verbose:w.verbose,sidecar:J.sidecar});let z=ai($,w);if($.kind==="image.variation")return U.runImageVariation({...J,kind:"image.variation",inputs:z},{credential:v,verbose:w.verbose,sidecar:J.sidecar});if($.kind==="image.edit")return U.runImageEdit({...J,kind:"image.edit",inputs:z},{credential:v,verbose:w.verbose,sidecar:J.sidecar});let g={wait:$.wait,download:$.download,variants:$.variants,pollIntervalMs:$.pollIntervalMs,timeoutMs:$.timeoutMs},V={credential:v,verbose:w.verbose,sidecar:J.sidecar};switch($.kind){case"video.generate":return U.runVideoGenerate({...J,kind:"video.generate",inputs:z,...g},V);case"video.edit":return U.runVideoEdit({...J,kind:"video.edit",inputs:z,videoId:$.videoId,...g},V);case"video.extend":return U.runVideoExtend({...J,kind:"video.extend",inputs:z,videoId:$.videoId,...g},V);case"video.remix":return U.runVideoRemix({...J,kind:"video.remix",videoId:$.videoId??"",...g},V);case"video.status":return U.runVideoStatus({...J,kind:"video.status",videoId:$.videoId??""},V);case"video.download":return U.runVideoDownload({...J,kind:"video.download",videoId:$.videoId??"",variants:$.variants??["video"]},V);case"video.list":return U.runVideoList({...J,kind:"video.list"},V);case"video.delete":return U.runVideoDelete({...J,kind:"video.delete",videoId:$.videoId??""},V);case"video.character.create":return U.runVideoCharacterCreate({...J,kind:"video.character.create",name:$.name??"",inputs:z},V);case"video.character.get":return U.runVideoCharacterGet({...J,kind:"video.character.get",characterId:$.characterId??""},V)}}function ai($,w){let U=[];for(let v of $.inputs?.images??[])U.push(aJ("image",v,w));if($.inputs?.mask)U.push(aJ("mask",$.inputs.mask,w));if($.inputs?.inputReference)U.push(aJ("reference",$.inputs.inputReference,w));if($.inputs?.video)U.push(aJ("video",$.inputs.video,w));for(let v of $.inputs?.videos??[])U.push(aJ("video",v,w));return U}function aJ($,w,U){if(typeof w==="string")return{role:$,source:Q7(w,U)};return{role:$,source:Q7(w,U),mime:w.mime,name:w.name}}function Q7($,w){if(typeof $==="string")return V2(w.baseDir,$);if($.task){let v=w.completed.get($.task)?.outputs[0];if(!v)throw Error(`Task output not available: ${$.task}`);return v}if($.source)return V2(w.baseDir,$.source);throw Error("Input reference must include source or task.")}function V2($,w){if(w.startsWith("/")||w.startsWith("http://")||w.startsWith("https://")||w==="-")return w;return P7($,w)}function B7($,w,U,v){let J=$??U??w;if(J&&J!=="auto"){if(UE(J))return J;throw Error(`Invalid output format: ${J}`)}return v?"table":"compact"}function q7($,w){let U=Array.isArray($)?$:[$],v=w.fields?.length?U.map((J)=>$E(J,w.fields)):U;switch(w.format){case"json":return JSON.stringify(Array.isArray($)?v:v[0],null,2);case"jsonl":return v.map((J)=>JSON.stringify(J)).join(`
|
|
265
|
+
`);case"table":return si(U,w);case"compact":return U.map(ei).join(`
|
|
266
|
+
`)}}function ei($){return`asset ${[$.id?`id=${$.id}`:void 0,`kind=${$.kind}`,`provider=${$.provider}`,$.profile?`profile=${$.profile}`:void 0,`outputs=${$.outputs.join(",")}`].filter(Boolean).join(" ")}`}function si($,w){if($.length===0)return"No results.";let U=$.map((V)=>({id:V.id??"-",kind:V.kind,provider:V.provider,outputs:V.outputs.join(", ")})),v=["ID","Kind","Provider","Outputs"],J=[Math.max(v[0].length,...U.map((V)=>V.id.length)),Math.max(v[1].length,...U.map((V)=>V.kind.length)),Math.max(v[2].length,...U.map((V)=>V.provider.length)),Math.max(v[3].length,...U.map((V)=>V.outputs.length))],z=w.noColor?(V)=>V:Yz.bold,g=[v.map((V,_)=>z(V.padEnd(J[_]))).join(" "),J.map((V)=>"-".repeat(V)).join(" ")];for(let V of U)g.push([V.id.padEnd(J[0]),V.kind.padEnd(J[1]),V.provider.padEnd(J[2]),V.outputs.padEnd(J[3])].join(" "));return g.join(`
|
|
267
|
+
`)}function $E($,w){let U={};for(let v of w)U[v]=wE($,v);return U}function wE($,w){let U=$;for(let v of w.split(".")){if(!U||typeof U!=="object")return;U=U[v]}return U}function UE($){return["table","compact","json","jsonl"].includes($)}function n6($){let w={},U=$===void 0?[]:Array.isArray($)?$:[$];for(let v of U){let J=v.indexOf("=");if(J===-1)throw Error(`Invalid --param value "${v}". Use key=value.`);let z=v.slice(0,J).trim(),g=v.slice(J+1).trim();if(!z)throw Error(`Invalid --param value "${v}". Key is empty.`);JE(w,z,vE(g))}return w}function h6($){if(!$)return{};try{let w=JSON.parse($);if(!w||typeof w!=="object"||Array.isArray(w))throw Error("JSON override must be an object.");return w}catch(w){if(w instanceof Error)throw Error(`Invalid --json value: ${w.message}`);throw w}}function z6(...$){let w={};for(let U of $){if(!U)continue;for(let[v,J]of Object.entries(U))if(M8(J)&&M8(w[v]))w[v]=z6(w[v],J);else w[v]=J}return w}function JE($,w,U){let v=w.split(".").filter(Boolean),J=$;for(let z=0;z<v.length;z++){let g=v[z];if(z===v.length-1){J[g]=U;return}if(!M8(J[g]))J[g]={};J=J[g]}}function vE($){if($==="true")return!0;if($==="false")return!1;if($==="null")return null;if(/^-?\d+(\.\d+)?$/.test($))return Number($);if($.startsWith("{")&&$.endsWith("}")||$.startsWith("[")&&$.endsWith("]"))try{return JSON.parse($)}catch{return $}return $}function M8($){return Boolean($&&typeof $==="object"&&!Array.isArray($))}import{existsSync as zE,mkdirSync as gE,writeFileSync as VE}from"node:fs";import{dirname as L7,join as H7}from"node:path";var GE=`---
|
|
268
268
|
name: asset-generation
|
|
269
269
|
description: Generate, edit, or batch-create AI assets with the ploof CLI. Use when working with generated images, provider auth, asset manifests, image context inputs, masks, or agent-driven creative asset workflows.
|
|
270
270
|
---
|
|
@@ -282,32 +282,32 @@ Follow the instructions printed by \`ploof learn\`. That output is the canonical
|
|
|
282
282
|
If \`ploof learn\` is unavailable because the CLI is not installed, ask the user to install \`@miketromba/ploof\` first, then rerun \`ploof learn\`.
|
|
283
283
|
|
|
284
284
|
Do not rely on this skill file for operational details. It is only a bootstrap adapter that points agents to \`ploof learn\`.
|
|
285
|
-
`;function
|
|
285
|
+
`;function u7($){let w=$??H7(wU(),"skills","asset-generation"),U=H7(w,"SKILL.md");if(!zE(L7(U)))gE(L7(U),{recursive:!0});return VE(U,GE),U}var _E="0.2.0";function Z7(){let $=new a8().name("ploof").description("AI asset generation CLI for images, audio, video, and provider-backed creative workflows").version(_E).showSuggestionAfterError().addHelpText("after",`
|
|
286
286
|
Getting started:
|
|
287
287
|
$ ploof login openai --api-key <your-api-key>
|
|
288
288
|
$ ploof image generate --prompt "Studio product photo" --out assets/hero.png
|
|
289
289
|
$ ploof learn
|
|
290
290
|
|
|
291
|
-
Use "ploof <command> --help" for more information about a command.`);return $.option("-o, --output <format>","Output format: auto|table|compact|json|jsonl").option("-f, --fields <list>","Comma-separated field list").option("-d, --detail","Full detail view").option("--no-color","Disable color").option("--verbose","Debug output to stderr").option("-q, --quiet","Data only, no hints").option("-y, --yes","Skip confirmation prompts"),
|
|
291
|
+
Use "ploof <command> --help" for more information about a command.`);return $.option("-o, --output <format>","Output format: auto|table|compact|json|jsonl").option("-f, --fields <list>","Comma-separated field list").option("-d, --detail","Full detail view").option("--no-color","Disable color").option("--verbose","Debug output to stderr").option("-q, --quiet","Data only, no hints").option("-y, --yes","Skip confirmation prompts"),XE($),IE($),LE($),HE($),uE($),KE($),DE($),$.configureOutput({writeErr:(w)=>process.stderr.write(w),writeOut:(w)=>process.stdout.write(w)}),$.exitOverride((w)=>{if(w.code==="commander.helpDisplayed"||w.code==="commander.version")process.exit(0);throw w}),$}function XE($){let w=$.command("config").description("CLI configuration management").addHelpText("after",`
|
|
292
292
|
Examples:
|
|
293
293
|
$ ploof config list
|
|
294
294
|
$ ploof config get output
|
|
295
295
|
$ ploof config set output compact
|
|
296
|
-
$ ploof config reset`);
|
|
297
|
-
`)})),
|
|
298
|
-
`)})),
|
|
299
|
-
`)})),
|
|
300
|
-
`)}))}function
|
|
301
|
-
`)}))}function
|
|
302
|
-
`:`No stored credentials found for ${
|
|
303
|
-
`)}))}function
|
|
304
|
-
`);return}process.stdout.write(`${[`Authenticated: provider=${
|
|
305
|
-
`)}))}function
|
|
306
|
-
`);return}for(let[J
|
|
307
|
-
`)}))}async function
|
|
308
|
-
`)},
|
|
309
|
-
`||
|
|
310
|
-
`)}))}function
|
|
311
|
-
`)}function
|
|
312
|
-
`),process.exit(
|
|
296
|
+
$ ploof config reset`);w.command("list").description("List all config values").action(J$(()=>{let U=new Z4().list();for(let[v,J]of Object.entries(U))process.stdout.write(`${v}=${JSON.stringify(J)}
|
|
297
|
+
`)})),w.command("get <key>").description("Get a config value").action(J$((U)=>{let v=new Z4;process.stdout.write(`${JSON.stringify(T7(v,U))}
|
|
298
|
+
`)})),w.command("set <key> <value>").description("Set a config value").action(J$((U,v)=>{let J=new Z4;RE(J,U,AE(v)),process.stdout.write(`Set ${U}=${JSON.stringify(T7(J,U))}
|
|
299
|
+
`)})),w.command("reset").description("Reset to defaults").action(J$(()=>{new Z4().reset(),process.stdout.write(`Config reset to defaults.
|
|
300
|
+
`)}))}function IE($){NE($),WE($),YE($),QE($)}function NE($){$.command("login <provider>").description("Store provider credentials").option("--api-key <key>","Provider API key").option("--profile <name>","Profile name","default").option("--organization <id>","OpenAI organization id").option("--project <id>","OpenAI project id").option("--base-url <url>","Provider base URL").option("--no-default","Do not set this profile as default").action(J$(async(w,U)=>{if(w!=="openai")throw new O$(`Unsupported provider for auth: ${w}`,2);let v=U.profile??"default",J=await PE(w,U.apiKey);new T4().login(w,v,{apiKey:J,organization:U.organization??process.env.PLOOF_OPENAI_ORG,project:U.project??process.env.PLOOF_OPENAI_PROJECT,baseURL:U.baseUrl??process.env.PLOOF_OPENAI_BASE_URL},U.default??!0),process.stdout.write(`Authenticated ${w} profile=${v}.
|
|
301
|
+
`)}))}function WE($){$.command("logout <provider>").description("Remove stored credentials").option("--profile <name>","Profile name").action(J$((w,U)=>{let v=new T4().logout(w,U.profile);process.stdout.write(v?`Logged out ${w}${U.profile?` profile=${U.profile}`:""}.
|
|
302
|
+
`:`No stored credentials found for ${w}.
|
|
303
|
+
`)}))}function YE($){$.command("whoami [provider]").description("Show current auth state").option("--profile <name>","Profile name").action(J$((w="openai",U)=>{let v=new T4().status(w,U.profile);if(!v.authenticated){process.stdout.write(`Not authenticated: provider=${w} profile=${v.profile}. Run 'ploof login ${w}'.
|
|
304
|
+
`);return}process.stdout.write(`${[`Authenticated: provider=${v.provider}`,`profile=${v.profile}`,`source=${v.source}`,`key=${v.keyPrefix}`,v.organization?`organization=${v.organization}`:void 0,v.project?`project=${v.project}`:void 0,v.baseURL?`baseURL=${v.baseURL}`:void 0].filter(Boolean).join(" ")}
|
|
305
|
+
`)}))}function QE($){$.command("profiles [provider]").description("List stored auth profiles").action(J$((w)=>{let U=new T4().listProfiles(w);if(Object.keys(U).length===0){process.stdout.write(`No stored profiles.
|
|
306
|
+
`);return}for(let[v,J]of Object.entries(U))process.stdout.write(`${v}: ${J.join(", ")}
|
|
307
|
+
`)}))}async function PE($,w){let U=w?.trim();if(U)return U;let v=OE($)?.trim();if(v)return v;let J=await qE(`${$} API key`);if(J)return J;throw new O$(`API key is required. Pass --api-key <key>, set ${BE($)}, or run this command in an interactive terminal.`,2)}function OE($){if($==="openai")return process.env.PLOOF_OPENAI_API_KEY??process.env.OPENAI_API_KEY;return}function BE($){if($==="openai")return"PLOOF_OPENAI_API_KEY";return"the provider API key environment variable"}async function qE($){if(!process.stdin.isTTY||!process.stdout.isTTY)return;if(typeof process.stdin.setRawMode!=="function")return;return new Promise((w,U)=>{let v="",J=process.stdin,z=J.isRaw,g=()=>{J.off("data",V),J.setRawMode(z),J.pause(),process.stdout.write(`
|
|
308
|
+
`)},V=(_)=>{for(let G of String(_)){if(G==="\r"||G===`
|
|
309
|
+
`||G==="\x04"){g(),w(v.trim());return}if(G==="\x03"){g(),U(new O$("Login cancelled.",130));return}if(G===""||G==="\b"){v=v.slice(0,-1);continue}if(G>=" ")v+=G}};process.stdout.write(`${$}: `),J.setEncoding("utf8"),J.resume(),J.setRawMode(!0),J.on("data",V)})}function LE($){let w=$.command("image").description("Generate and edit image assets"),U=w.command("generate").description("Generate images").requiredOption("--prompt <prompt>","Image prompt").option("--provider <provider>","Provider id","openai").option("--profile <name>","Auth profile").option("--out <path>","Output file or directory");K7(U),U.action(J$(async(z,g)=>{let V={...g.optsWithGlobals(),...z},_=D7(V),G={kind:"image.generate",provider:V.provider??"openai",profile:V.profile,prompt:V.prompt??"",output:V.out,params:_};await d$(G,V)}));let v=w.command("edit").description("Edit images with optional context images and masks").requiredOption("--prompt <prompt>","Edit prompt").option("--provider <provider>","Provider id","openai").option("--profile <name>","Auth profile").option("--image <path>","Input/context image path or URL",M4,[]).option("--mask <path>","Mask image path or URL").option("--out <path>","Output file or directory");K7(v),v.option("--input-fidelity <value>","OpenAI input fidelity"),v.action(J$(async(z,g)=>{let V={...g.optsWithGlobals(),...z};if(!V.image||V.image.length===0)throw new O$("At least one --image is required.",2);let _=D7(V),G={kind:"image.edit",provider:V.provider??"openai",profile:V.profile,prompt:V.prompt??"",output:V.out,params:_,inputs:Jg(V.image,V.mask)};await d$(G,V)}));let J=w.command("variation").alias("variations").description("Create image variations").requiredOption("--image <path>","Input image path or URL").option("--provider <provider>","Provider id","openai").option("--profile <name>","Auth profile").option("--out <path>","Output file or directory");fE(J),J.action(J$(async(z,g)=>{let V={...g.optsWithGlobals(),...z},_=TE(V),G=typeof V.image==="string"?V.image:"",X={kind:"image.variation",provider:V.provider??"openai",profile:V.profile,output:V.out,params:_,inputs:Jg(G,void 0)};await d$(X,V)}))}function HE($){let w=$.command("video").description("Generate, edit, extend, inspect, and download video assets"),U=w.command("generate").alias("create").description("Create an OpenAI video generation job").requiredOption("--prompt <prompt>","Video prompt").option("--provider <provider>","Provider id","openai").option("--profile <name>","Auth profile").option("--out <path>","Output file or directory").option("--input-reference <path-or-url-or-file-id>","Image reference path, URL, data URL, or file id").option("--input-reference-file-id <id>","Uploaded image file id").option("--input-reference-url <url>","Image URL or data URL reference").option("--character <id>","Reusable character id",M4,[]);i8(U),U.action(J$(async(V,_)=>{let G={..._.optsWithGlobals(),...V},X={kind:"video.generate",provider:G.provider??"openai",profile:G.profile,prompt:G.prompt??"",output:G.out,params:ZE(G),inputs:ME(G),...G2(G)};await d$(X,G)}));let v=w.command("edit").description("Create a video edit job from a completed video id or upload").requiredOption("--prompt <prompt>","Edit prompt").option("--provider <provider>","Provider id","openai").option("--profile <name>","Auth profile").option("--video-id <id>","Completed OpenAI video id").option("--video <path>","Source video path or URL").option("--out <path>","Output file or directory");i8(v),v.action(J$(async(V,_)=>{let G={..._.optsWithGlobals(),...V};if(!G.videoId&&!G.video)throw new O$("Provide --video-id or --video.",2);let X={kind:"video.edit",provider:G.provider??"openai",profile:G.profile,prompt:G.prompt??"",output:G.out,params:f7(G),videoId:G.videoId,inputs:E8(G.video),...G2(G)};await d$(X,G)}));let J=w.command("extend").description("Create a video extension job").requiredOption("--prompt <prompt>","Extension prompt").requiredOption("--seconds <seconds>","New segment duration").option("--provider <provider>","Provider id","openai").option("--profile <name>","Auth profile").option("--video-id <id>","Completed OpenAI video id").option("--video <path>","Source video path or URL").option("--out <path>","Output file or directory");i8(J,{includeSeconds:!1}),J.action(J$(async(V,_)=>{let G={..._.optsWithGlobals(),...V};if(!G.videoId&&!G.video)throw new O$("Provide --video-id or --video.",2);let X={kind:"video.extend",provider:G.provider??"openai",profile:G.profile,prompt:G.prompt??"",output:G.out,params:f7(G),videoId:G.videoId,inputs:E8(G.video),...G2(G)};await d$(X,G)}));let z=w.command("remix").description("Create a deprecated OpenAI video remix job").requiredOption("--video-id <id>","Completed OpenAI video id").requiredOption("--prompt <prompt>","Remix prompt").option("--provider <provider>","Provider id","openai").option("--profile <name>","Auth profile").option("--out <path>","Output file or directory");b7(z),z.option("--param <key=value>","Provider-specific parameter",M4,[]).option("--json <object>","Provider-specific JSON object"),z.action(J$(async(V,_)=>{let G={..._.optsWithGlobals(),...V},X={kind:"video.remix",provider:G.provider??"openai",profile:G.profile,prompt:G.prompt??"",output:G.out,params:z6(h6(G.json),n6(G.param)),videoId:G.videoId??"",...G2(G)};await d$(X,G)})),w.command("status <video-id>").alias("get").alias("retrieve").description("Fetch video job metadata").option("--provider <provider>","Provider id","openai").option("--profile <name>","Auth profile").action(J$(async(V,_,G)=>{let X={...G.optsWithGlobals(),..._},I={kind:"video.status",provider:X.provider??"openai",profile:X.profile,videoId:V};await d$(I,X)})),w.command("download <video-id>").description("Download a completed video or supporting asset").option("--provider <provider>","Provider id","openai").option("--profile <name>","Auth profile").option("--out <path>","Output file or directory").option("--variant <variant>","video, thumbnail, or spritesheet",M4,[]).action(J$(async(V,_,G)=>{let X={...G.optsWithGlobals(),..._},I={kind:"video.download",provider:X.provider??"openai",profile:X.profile,output:X.out,videoId:V,variants:F7(X.variant)};await d$(I,X)})),w.command("list").description("List recently generated videos").option("--provider <provider>","Provider id","openai").option("--profile <name>","Auth profile").option("--limit <count>","Maximum videos to return",X2).option("--after <id>","Pagination cursor").option("--order <order>","asc or desc").action(J$(async(V,_)=>{let G={..._.optsWithGlobals(),...V},X={kind:"video.list",provider:G.provider??"openai",profile:G.profile,params:bE(G)};await d$(X,G)})),w.command("delete <video-id>").description("Delete a completed or failed video").option("--provider <provider>","Provider id","openai").option("--profile <name>","Auth profile").action(J$(async(V,_,G)=>{let X={...G.optsWithGlobals(),..._},I={kind:"video.delete",provider:X.provider??"openai",profile:X.profile,videoId:V};await d$(I,X)}));let g=w.command("character").description("Manage reusable OpenAI video characters");g.command("create").description("Create a reusable character from an uploaded video").requiredOption("--name <name>","Character display name").requiredOption("--video <path>","Character video path or URL").option("--provider <provider>","Provider id","openai").option("--profile <name>","Auth profile").option("--param <key=value>","Provider-specific parameter",M4,[]).option("--json <object>","Provider-specific JSON object").action(J$(async(V,_)=>{let G={..._.optsWithGlobals(),...V},X={kind:"video.character.create",provider:G.provider??"openai",profile:G.profile,name:G.name??"",inputs:E8(G.video),params:z6(h6(G.json),n6(G.param))};await d$(X,G)})),g.command("get <character-id>").description("Fetch a reusable character").option("--provider <provider>","Provider id","openai").option("--profile <name>","Auth profile").action(J$(async(V,_,G)=>{let X={...G.optsWithGlobals(),..._},I={kind:"video.character.get",provider:X.provider??"openai",profile:X.profile,characterId:V};await d$(I,X)}))}function uE($){$.command("run <manifest>").description("Run a YAML or JSON asset generation manifest").option("--parallel <count>","Maximum concurrent tasks",X2).option("--dry-run","Validate and print planned tasks without API calls").action(J$(async(w,U,v)=>{let J={...v.optsWithGlobals(),...U},z=new Z4,g=await O7(w,{parallel:J.parallel??z.get("defaultParallel"),dryRun:J.dryRun,config:z,verbose:J.verbose});M7(g,J)}))}function KE($){$.command("learn").description("Print AI-agent instructions for this ploof version").allowUnknownOption(!1).action(J$(()=>{process.stdout.write(dY([]))}))}function DE($){$.command("skill").description("Agent skill helpers").command("install").description("Install the ploof bootstrap skill").option("--target <dir>","Skill directory target").action(J$((U)=>{let v=u7(U.target);process.stdout.write(`Installed ploof bootstrap skill: ${v}
|
|
310
|
+
`)}))}function K7($){$.option("--model <model>","Image model").option("--size <size>","Image size").option("--quality <quality>","Image quality").option("--format <format>","Output image format").option("--output-format <format>","Provider output_format value").option("--background <background>","Background setting").option("--moderation <moderation>","Moderation setting").option("--n <count>","Number of images",X2).option("--output-compression <number>","Output compression",_2).option("--partial-images <number>","Number of partial images",_2).option("--response-format <format>","Provider response format").option("--style <style>","Image style").option("--user <user>","End-user identifier").option("--stream","Request streamed image events").option("--param <key=value>","Provider-specific parameter",M4,[]).option("--json <object>","Provider-specific JSON object")}function fE($){$.option("--model <model>","Image model").option("--size <size>","Image size").option("--n <count>","Number of images",X2).option("--response-format <format>","Provider response format").option("--user <user>","End-user identifier").option("--param <key=value>","Provider-specific parameter",M4,[]).option("--json <object>","Provider-specific JSON object")}function i8($,w={}){if($.option("--model <model>","Video model").option("--size <size>","Video size").option("--param <key=value>","Provider-specific parameter",M4,[]).option("--json <object>","Provider-specific JSON object"),w.includeSeconds??!0)$.option("--seconds <seconds>","Video duration in seconds");b7($)}function b7($){$.option("--wait","Poll until the video reaches a terminal status").option("--download","Download the video after waiting").option("--variant <variant>","Download variant: video, thumbnail, or spritesheet",M4,[]).option("--poll-interval <seconds>","Polling interval while waiting",_2).option("--timeout <seconds>","Maximum wait time before timing out",_2)}function D7($){let w=eJ({model:$.model,size:$.size,quality:$.quality,output_format:$.outputFormat??$.format,background:$.background,moderation:$.moderation,n:$.n,output_compression:$.outputCompression,partial_images:$.partialImages,response_format:$.responseFormat,style:$.style,user:$.user,stream:$.stream,input_fidelity:$.inputFidelity});return z6(h6($.json),w,n6($.param))}function TE($){let w=eJ({model:$.model,size:$.size,n:$.n,response_format:$.responseFormat,user:$.user});return z6(h6($.json),w,n6($.param))}function ZE($){let w=eJ({model:$.model,size:$.size,seconds:$.seconds,characters:FE($.character)});return z6(h6($.json),w,n6($.param))}function f7($){let w=eJ({model:$.model,size:$.size,seconds:$.seconds});return z6(h6($.json),w,n6($.param))}function bE($){if($.order&&!["asc","desc"].includes($.order))throw new O$("Video list --order must be asc or desc.",2);return eJ({limit:$.limit,after:$.after,order:$.order})}function FE($){let U=($===void 0?[]:Array.isArray($)?$:[$]).map((v)=>v.trim()).filter(Boolean);return U.length>0?U.map((v)=>({id:v})):void 0}function ME($){let w=$.inputReferenceFileId!==void 0?`file:${$.inputReferenceFileId}`:$.inputReferenceUrl??$.inputReference;if(!w)return[];return[{role:"reference",source:w}]}function E8($){if(!$)return[];return[{role:"video",source:$}]}function G2($){return{wait:$.wait,download:$.download,variants:F7($.variant),pollIntervalMs:$.pollInterval===void 0?void 0:Math.max(0,$.pollInterval*1000),timeoutMs:$.timeout===void 0?void 0:Math.max(0,$.timeout*1000)}}function F7($){let w=$===void 0?[]:Array.isArray($)?$:[$];return(w.length>0?w:["video"]).map((v)=>{if(v==="video"||v==="thumbnail"||v==="spritesheet")return v;throw new O$(`Invalid video variant: ${v}. Expected video, thumbnail, or spritesheet.`,2)})}async function d$($,w){let U=new Z4,v=new T4,J=g2($.provider),z=v.getCredential($.provider,$.profile);if(!z?.apiKey)throw new O$(`No credentials found for ${$.provider}. Run 'ploof login ${$.provider} --api-key <key>' or set PLOOF_OPENAI_API_KEY.`,1);let g=U.get("sidecar"),V={credential:z,verbose:w.verbose,sidecar:g},_=await iE(J,$,V);M7(_,w)}async function iE($,w,U){switch(w.kind){case"image.generate":return $.runImageGenerate(w,U);case"image.edit":return $.runImageEdit(w,U);case"image.variation":return $.runImageVariation(w,U);case"video.generate":return $.runVideoGenerate(w,U);case"video.edit":return $.runVideoEdit(w,U);case"video.extend":return $.runVideoExtend(w,U);case"video.remix":return $.runVideoRemix(w,U);case"video.status":return $.runVideoStatus(w,U);case"video.download":return $.runVideoDownload(w,U);case"video.list":return $.runVideoList(w,U);case"video.delete":return $.runVideoDelete(w,U);case"video.character.create":return $.runVideoCharacterCreate(w,U);case"video.character.get":return $.runVideoCharacterGet(w,U)}}function M7($,w){let U=new Z4,v=EE(w,U),J=q7($,v);if(J)process.stdout.write(`${J}
|
|
311
|
+
`)}function EE($,w){return{format:B7($.output,w.get("output"),process.env.PLOOF_OUTPUT,process.stdout.isTTY??!1),fields:typeof $.fields==="string"?$.fields.split(",").map((v)=>v.trim()):void 0,detail:$.detail,quiet:$.quiet,noColor:$.noColor??w.get("noColor")}}function J$($){return async(...w)=>{try{await $(...w)}catch(U){let v=SE(w);process.stderr.write(`${xY(U,v.noColor===!0)}
|
|
312
|
+
`),process.exit(U instanceof O$?U.code:1)}}}function SE($){for(let w of $)if(w&&typeof w==="object"&&"parent"in w)return w.optsWithGlobals();return{}}function M4($,w){return[...w,$]}function X2($){let w=Number.parseInt($,10);if(!Number.isFinite(w)||w<=0)throw Error(`Expected positive integer, received ${$}`);return w}function _2($){let w=Number($);if(!Number.isFinite(w))throw Error(`Expected number, received ${$}`);return w}function AE($){if($==="true")return!0;if($==="false")return!1;if(/^-?\d+$/.test($))return Number.parseInt($,10);return $}function i7($){return["output","defaultParallel","sidecar","noColor"].includes($)}function T7($,w){if(!i7(w))throw new O$(`Invalid config key: ${w}`,2);return $.get(w)}function RE($,w,U){if(!i7(w))throw new O$(`Invalid config key: ${w}`,2);switch(w){case"output":if(!["auto","table","compact","json","jsonl"].includes(String(U)))throw new O$(`Invalid output format: ${String(U)}`,2);$.set("output",String(U));return;case"defaultParallel":if(typeof U!=="number"||U<=0)throw new O$("defaultParallel must be a positive number.",2);$.set("defaultParallel",U);return;case"sidecar":case"noColor":if(typeof U!=="boolean")throw new O$(`${w} must be true or false.`,2);$.set(w,U)}}function eJ($){let w={};for(let[U,v]of Object.entries($))if(v!==void 0)w[U]=v;return w}var kE=Z7();kE.parseAsync(process.argv).catch(($)=>{process.stderr.write(`${$ instanceof Error?$.message:String($)}
|
|
313
313
|
`),process.exit(1)});
|