@babylonjs/mcp-servers 9.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/babylonjs-mcp-servers.js +66 -0
- package/dist/flow-graph-mcp-server.js +159 -0
- package/dist/flow-graph-mcp-server.js.map +1 -0
- package/dist/gui-mcp-server.js +149 -0
- package/dist/gui-mcp-server.js.map +1 -0
- package/dist/nge-mcp-server.js +147 -0
- package/dist/nge-mcp-server.js.map +1 -0
- package/dist/nme-mcp-server.js +151 -0
- package/dist/nme-mcp-server.js.map +1 -0
- package/dist/npe-mcp-server.js +150 -0
- package/dist/npe-mcp-server.js.map +1 -0
- package/dist/nrge-mcp-server.js +145 -0
- package/dist/nrge-mcp-server.js.map +1 -0
- package/dist/smart-filters-mcp-server.js +132 -0
- package/dist/smart-filters-mcp-server.js.map +1 -0
- package/package.json +48 -0
- package/readme.md +73 -0
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import mu from"node:process";import{mkdirSync as pu,writeFileSync as fu,readFileSync as Kv}from"node:fs";import{dirname as hu}from"node:path";import*as Si from"node:crypto";import*as Gv from"node:http";var gu;const vu=Object.freeze({status:"aborted"});function S(e,t,r){function o(s,c){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:c,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),t(s,c);const u=a.prototype,l=Object.keys(u);for(let d=0;d<l.length;d++){const p=l[d];p in s||(s[p]=u[p].bind(s))}}const n=r?.Parent??Object;class i extends n{}Object.defineProperty(i,"name",{value:e});function a(s){var c;const u=r?.Parent?new i:this;o(u,s),(c=u._zod).deferred??(c.deferred=[]);for(const l of u._zod.deferred)l();return u}return Object.defineProperty(a,"init",{value:o}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>r?.Parent&&s instanceof r.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}const yu=Symbol("zod_brand");class Bt extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Nr extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(gu=globalThis).__zod_globalConfig??(gu.__zod_globalConfig={});const En=globalThis.__zod_globalConfig;function Ce(e){return e&&Object.assign(En,e),En}function Wv(e){return e}function Yv(e){return e}function Xv(e){}function Qv(e){throw new Error("Unexpected value in exhaustive check")}function ey(e){}function wi(e){const t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function D(e,t="|"){return e.map(r=>G(r)).join(t)}function Er(e,t){return typeof t=="bigint"?t.toString():t}function zn(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Zt(e){return e==null}function zr(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function _u(e,t){const r=e/t,o=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-o)<n?0:r-o}const $u=Symbol("evaluating");function oe(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==$u)return o===void 0&&(o=$u,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function ty(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Et(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function bt(...e){const t={};for(const r of e){const o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function ny(e){return bt(e._zod.def)}function ry(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function oy(e){const t=Object.keys(e),r=t.map(o=>e[o]);return Promise.all(r).then(o=>{const n={};for(let i=0;i<t.length;i++)n[t[i]]=o[i];return n})}function iy(e=10){const t="abcdefghijklmnopqrstuvwxyz";let r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function Ii(e){return JSON.stringify(e)}function bu(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Oi="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function rn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const ku=zn(()=>{if(En.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Ft(e){if(rn(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const r=t.prototype;return!(rn(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function jr(e){return Ft(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function ay(e){let t=0;for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}const sy=e=>{const t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Dr=new Set(["string","number","symbol"]),Su=new Set(["string","number","bigint","boolean","symbol","undefined"]);function It(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Qe(e,t,r){const o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function E(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function cy(e){let t;return new Proxy({},{get(r,o,n){return t??(t=e()),Reflect.get(t,o,n)},set(r,o,n,i){return t??(t=e()),Reflect.set(t,o,n,i)},has(r,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(r,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(r,o,n){return t??(t=e()),Reflect.defineProperty(t,o,n)}})}function G(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function wu(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Iu={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Ou={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Tu(e,t){const r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const i=bt(e._zod.def,{get shape(){const a={};for(const s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(a[s]=r.shape[s])}return Et(this,"shape",a),a},checks:[]});return Qe(e,i)}function Pu(e,t){const r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const i=bt(e._zod.def,{get shape(){const a={...e._zod.def.shape};for(const s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&delete a[s]}return Et(this,"shape",a),a},checks:[]});return Qe(e,i)}function xu(e,t){if(!Ft(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0){const i=e._zod.def.shape;for(const a in t)if(Object.getOwnPropertyDescriptor(i,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const n=bt(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return Et(this,"shape",i),i}});return Qe(e,n)}function Nu(e,t){if(!Ft(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r=bt(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return Et(this,"shape",o),o}});return Qe(e,r)}function Eu(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const r=bt(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t._zod.def.shape};return Et(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Qe(e,r)}function zu(e,t,r){const n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const a=bt(t._zod.def,{get shape(){const s=t._zod.def.shape,c={...s};if(r)for(const u in r){if(!(u in s))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(c[u]=e?new e({type:"optional",innerType:s[u]}):s[u])}else for(const u in s)c[u]=e?new e({type:"optional",innerType:s[u]}):s[u];return Et(this,"shape",c),c},checks:[]});return Qe(t,a)}function ju(e,t,r){const o=bt(t._zod.def,{get shape(){const n=t._zod.def.shape,i={...n};if(r)for(const a in r){if(!(a in i))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(i[a]=new e({type:"nonoptional",innerType:n[a]}))}else for(const a in n)i[a]=new e({type:"nonoptional",innerType:n[a]});return Et(this,"shape",i),i}});return Qe(t,o)}function Vt(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function Du(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function st(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function jn(e){return typeof e=="string"?e:e?.message}function et(e,t,r){const o=e.message?e.message:jn(e.inst?._zod.def?.error?.(e))??jn(t?.error?.(e))??jn(r.customError?.(e))??jn(r.localeError?.(e))??"Invalid input",{inst:n,continue:i,input:a,...s}=e;return s.path??(s.path=[]),s.message=o,t?.reportInput&&(s.input=a),s}function Ar(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Cr(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function X(e){const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";const r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function on(...e){const[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function uy(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function Au(e){const t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}function Cu(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function ly(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return Au(t+r)}function dy(e){return Cu(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function my(e){const t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");const r=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)r[o/2]=Number.parseInt(t.slice(o,o+2),16);return r}function py(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}class fy{constructor(...t){}}var Ru=Object.freeze({__proto__:null,BIGINT_FORMAT_RANGES:Ou,Class:fy,NUMBER_FORMAT_RANGES:Iu,aborted:Vt,allowsEval:ku,assert:ey,assertEqual:Wv,assertIs:Xv,assertNever:Qv,assertNotEqual:Yv,assignProp:Et,base64ToUint8Array:Au,base64urlToUint8Array:ly,cached:zn,captureStackTrace:Oi,cleanEnum:uy,cleanRegex:zr,clone:Qe,cloneDef:ny,createTransparentProxy:cy,defineLazy:oe,esc:Ii,escapeRegex:It,explicitlyAborted:Du,extend:xu,finalizeIssue:et,floatSafeRemainder:_u,getElementAtPath:ry,getEnumValues:wi,getLengthableOrigin:Cr,getParsedType:sy,getSizableOrigin:Ar,hexToUint8Array:my,isObject:rn,isPlainObject:Ft,issue:on,joinValues:D,jsonStringifyReplacer:Er,merge:Eu,mergeDefs:bt,normalizeParams:E,nullish:Zt,numKeys:ay,objectClone:ty,omit:Pu,optionalKeys:wu,parsedType:X,partial:zu,pick:Tu,prefixIssues:st,primitiveTypes:Su,promiseAllObject:oy,propertyKeyTypes:Dr,randomString:iy,required:ju,safeExtend:Nu,shallowClone:jr,slugify:bu,stringifyPrimitive:G,uint8ArrayToBase64:Cu,uint8ArrayToBase64url:dy,uint8ArrayToHex:py,unwrapMessage:jn});const Uu=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Er,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ti=S("$ZodError",Uu),tt=S("$ZodError",Uu,{Parent:Error});function Pi(e,t=r=>r.message){const r={},o=[];for(const n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):o.push(t(n));return{formErrors:o,fieldErrors:r}}function xi(e,t=r=>r.message){const r={_errors:[]},o=(n,i=[])=>{for(const a of n.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(s=>o({issues:s},[...i,...a.path]));else if(a.code==="invalid_key")o({issues:a.issues},[...i,...a.path]);else if(a.code==="invalid_element")o({issues:a.issues},[...i,...a.path]);else{const s=[...i,...a.path];if(s.length===0)r._errors.push(t(a));else{let c=r,u=0;for(;u<s.length;){const l=s[u];u===s.length-1?(c[l]=c[l]||{_errors:[]},c[l]._errors.push(t(a))):c[l]=c[l]||{_errors:[]},c=c[l],u++}}}};return o(e),r}function Mu(e,t=r=>r.message){const r={errors:[]},o=(n,i=[])=>{var a,s;for(const c of n.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(u=>o({issues:u},[...i,...c.path]));else if(c.code==="invalid_key")o({issues:c.issues},[...i,...c.path]);else if(c.code==="invalid_element")o({issues:c.issues},[...i,...c.path]);else{const u=[...i,...c.path];if(u.length===0){r.errors.push(t(c));continue}let l=r,d=0;for(;d<u.length;){const p=u[d],m=d===u.length-1;typeof p=="string"?(l.properties??(l.properties={}),(a=l.properties)[p]??(a[p]={errors:[]}),l=l.properties[p]):(l.items??(l.items=[]),(s=l.items)[p]??(s[p]={errors:[]}),l=l.items[p]),m&&l.errors.push(t(c)),d++}}};return o(e),r}function Bu(e){const t=[],r=e.map(o=>typeof o=="object"?o.key:o);for(const o of r)typeof o=="number"?t.push(`[${o}]`):typeof o=="symbol"?t.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?t.push(`[${JSON.stringify(o)}]`):(t.length&&t.push("."),t.push(o));return t.join("")}function Zu(e){const t=[],r=[...e.issues].sort((o,n)=>(o.path??[]).length-(n.path??[]).length);for(const o of r)t.push(`\u2716 ${o.message}`),o.path?.length&&t.push(` \u2192 at ${Bu(o.path)}`);return t.join(`
|
|
3
|
+
`)}const Dn=e=>(t,r,o,n)=>{const i=o?{...o,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new Bt;if(a.issues.length){const s=new(n?.Err??e)(a.issues.map(c=>et(c,i,Ce())));throw Oi(s,n?.callee),s}return a.value},Rr=Dn(tt),An=e=>async(t,r,o,n)=>{const i=o?{...o,async:!0}:{async:!0};let a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){const s=new(n?.Err??e)(a.issues.map(c=>et(c,i,Ce())));throw Oi(s,n?.callee),s}return a.value},Ur=An(tt),Cn=e=>(t,r,o)=>{const n=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},n);if(i instanceof Promise)throw new Bt;return i.issues.length?{success:!1,error:new(e??Ti)(i.issues.map(a=>et(a,n,Ce())))}:{success:!0,data:i.value}},Mr=Cn(tt),Rn=e=>async(t,r,o)=>{const n=o?{...o,async:!0}:{async:!0};let i=t._zod.run({value:r,issues:[]},n);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(a=>et(a,n,Ce())))}:{success:!0,data:i.value}},Br=Rn(tt),Ni=e=>(t,r,o)=>{const n=o?{...o,direction:"backward"}:{direction:"backward"};return Dn(e)(t,r,n)},hy=Ni(tt),Ei=e=>(t,r,o)=>Dn(e)(t,r,o),gy=Ei(tt),zi=e=>async(t,r,o)=>{const n=o?{...o,direction:"backward"}:{direction:"backward"};return An(e)(t,r,n)},vy=zi(tt),ji=e=>async(t,r,o)=>An(e)(t,r,o),yy=ji(tt),Di=e=>(t,r,o)=>{const n=o?{...o,direction:"backward"}:{direction:"backward"};return Cn(e)(t,r,n)},_y=Di(tt),Ai=e=>(t,r,o)=>Cn(e)(t,r,o),$y=Ai(tt),Ci=e=>async(t,r,o)=>{const n=o?{...o,direction:"backward"}:{direction:"backward"};return Rn(e)(t,r,n)},by=Ci(tt),Ri=e=>async(t,r,o)=>Rn(e)(t,r,o),ky=Ri(tt),Fu=/^[cC][0-9a-z]{6,}$/,Vu=/^[0-9a-z]+$/,Lu=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,qu=/^[0-9a-vA-V]{20}$/,Ju=/^[A-Za-z0-9]{27}$/,Hu=/^[a-zA-Z0-9_-]{21}$/,Ku=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Sy=/^[-+]?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)?)??$/,Gu=/^([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})$/,an=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([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)$/,wy=an(4),Iy=an(6),Oy=an(7),Wu=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Ty=/^[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])?)*$/,Py=/^(([^<>()\[\]\\.,;:\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,}))$/,Yu=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,xy=Yu,Ny=/^[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])?)*$/,Ey="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Xu(){return new RegExp(Ey,"u")}const Qu=/^(?:(?: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])$/,el=/^(([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}|:))$/,tl=e=>{const t=It(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},nl=/^((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])$/,rl=/^(([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])$/,ol=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ui=/^[A-Za-z0-9_-]*$/,il=/^(?=.{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])?)*\.?$/,al=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Mi=/^https?$/,sl=/^\+[1-9]\d{6,14}$/,cl="(?:(?:\\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])))",ul=new RegExp(`^${cl}$`);function ll(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function dl(e){return new RegExp(`^${ll(e)}$`)}function ml(e){const t=ll({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const o=`${t}(?:${r.join("|")})`;return new RegExp(`^${cl}T(?:${o})$`)}const pl=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},fl=/^-?\d+n?$/,hl=/^-?\d+$/,Bi=/^-?\d+(?:\.\d+)?$/,gl=/^(?:true|false)$/i,vl=/^null$/i,yl=/^undefined$/i,_l=/^[^A-Z]*$/,$l=/^[^a-z]*$/,bl=/^[0-9a-fA-F]*$/;function Un(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Mn(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}const zy=/^[0-9a-fA-F]{32}$/,jy=Un(22,"=="),Dy=Mn(22),Ay=/^[0-9a-fA-F]{40}$/,Cy=Un(27,"="),Ry=Mn(27),Uy=/^[0-9a-fA-F]{64}$/,My=Un(43,"="),By=Mn(43),Zy=/^[0-9a-fA-F]{96}$/,Fy=Un(64,""),Vy=Mn(64),Ly=/^[0-9a-fA-F]{128}$/,qy=Un(86,"=="),Jy=Mn(86);var Zi=Object.freeze({__proto__:null,base64:ol,base64url:Ui,bigint:fl,boolean:gl,browserEmail:Ny,cidrv4:nl,cidrv6:rl,cuid:Fu,cuid2:Vu,date:ul,datetime:ml,domain:al,duration:Ku,e164:sl,email:Wu,emoji:Xu,extendedDuration:Sy,guid:Gu,hex:bl,hostname:il,html5Email:Ty,httpProtocol:Mi,idnEmail:xy,integer:hl,ipv4:Qu,ipv6:el,ksuid:Ju,lowercase:_l,mac:tl,md5_base64:jy,md5_base64url:Dy,md5_hex:zy,nanoid:Hu,null:vl,number:Bi,rfc5322Email:Py,sha1_base64:Cy,sha1_base64url:Ry,sha1_hex:Ay,sha256_base64:My,sha256_base64url:By,sha256_hex:Uy,sha384_base64:Fy,sha384_base64url:Vy,sha384_hex:Zy,sha512_base64:qy,sha512_base64url:Jy,sha512_hex:Ly,string:pl,time:dl,ulid:Lu,undefined:yl,unicodeEmail:Yu,uppercase:$l,uuid:an,uuid4:wy,uuid6:Iy,uuid7:Oy,xid:qu});const Oe=S("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),kl={number:"number",bigint:"bigint",object:"date"},Fi=S("$ZodCheckLessThan",(e,t)=>{Oe.init(e,t);const r=kl[typeof t.value];e._zod.onattach.push(o=>{const n=o._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Vi=S("$ZodCheckGreaterThan",(e,t)=>{Oe.init(e,t);const r=kl[typeof t.value];e._zod.onattach.push(o=>{const n=o._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Sl=S("$ZodCheckMultipleOf",(e,t)=>{Oe.init(e,t),e._zod.onattach.push(r=>{var o;(o=r._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):_u(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),wl=S("$ZodCheckNumberFormat",(e,t)=>{Oe.init(e,t),t.format=t.format||"float64";const r=t.format?.includes("int"),o=r?"int":"number",[n,i]=Iu[t.format];e._zod.onattach.push(a=>{const s=a._zod.bag;s.format=t.format,s.minimum=n,s.maximum=i,r&&(s.pattern=hl)}),e._zod.check=a=>{const s=a.value;if(r){if(!Number.isInteger(s)){a.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}s<n&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),s>i&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),Il=S("$ZodCheckBigIntFormat",(e,t)=>{Oe.init(e,t);const[r,o]=Ou[t.format];e._zod.onattach.push(n=>{const i=n._zod.bag;i.format=t.format,i.minimum=r,i.maximum=o}),e._zod.check=n=>{const i=n.value;i<r&&n.issues.push({origin:"bigint",input:i,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),i>o&&n.issues.push({origin:"bigint",input:i,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),Ol=S("$ZodCheckMaxSize",(e,t)=>{var r;Oe.init(e,t),(r=e._zod.def).when??(r.when=o=>{const n=o.value;return!Zt(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{const n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{const n=o.value;n.size<=t.maximum||o.issues.push({origin:Ar(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Tl=S("$ZodCheckMinSize",(e,t)=>{var r;Oe.init(e,t),(r=e._zod.def).when??(r.when=o=>{const n=o.value;return!Zt(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{const n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{const n=o.value;n.size>=t.minimum||o.issues.push({origin:Ar(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Pl=S("$ZodCheckSizeEquals",(e,t)=>{var r;Oe.init(e,t),(r=e._zod.def).when??(r.when=o=>{const n=o.value;return!Zt(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{const n=o._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=o=>{const n=o.value,i=n.size;if(i===t.size)return;const a=i>t.size;o.issues.push({origin:Ar(n),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),xl=S("$ZodCheckMaxLength",(e,t)=>{var r;Oe.init(e,t),(r=e._zod.def).when??(r.when=o=>{const n=o.value;return!Zt(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{const n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{const n=o.value;if(n.length<=t.maximum)return;const a=Cr(n);o.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Nl=S("$ZodCheckMinLength",(e,t)=>{var r;Oe.init(e,t),(r=e._zod.def).when??(r.when=o=>{const n=o.value;return!Zt(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{const n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{const n=o.value;if(n.length>=t.minimum)return;const a=Cr(n);o.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),El=S("$ZodCheckLengthEquals",(e,t)=>{var r;Oe.init(e,t),(r=e._zod.def).when??(r.when=o=>{const n=o.value;return!Zt(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{const n=o._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=o=>{const n=o.value,i=n.length;if(i===t.length)return;const a=Cr(n),s=i>t.length;o.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Bn=S("$ZodCheckStringFormat",(e,t)=>{var r,o;Oe.init(e,t),e._zod.onattach.push(n=>{const i=n._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),zl=S("$ZodCheckRegex",(e,t)=>{Bn.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),jl=S("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=_l),Bn.init(e,t)}),Dl=S("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=$l),Bn.init(e,t)}),Al=S("$ZodCheckIncludes",(e,t)=>{Oe.init(e,t);const r=It(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=o,e._zod.onattach.push(n=>{const i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Cl=S("$ZodCheckStartsWith",(e,t)=>{Oe.init(e,t);const r=new RegExp(`^${It(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{const n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),Rl=S("$ZodCheckEndsWith",(e,t)=>{Oe.init(e,t);const r=new RegExp(`.*${It(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{const n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});function Ul(e,t,r){e.issues.length&&t.issues.push(...st(r,e.issues))}const Ml=S("$ZodCheckProperty",(e,t)=>{Oe.init(e,t),e._zod.check=r=>{const o=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(o instanceof Promise)return o.then(n=>Ul(n,r,t.property));Ul(o,r,t.property)}}),Bl=S("$ZodCheckMimeType",(e,t)=>{Oe.init(e,t);const r=new Set(t.mime);e._zod.onattach.push(o=>{o._zod.bag.mime=t.mime}),e._zod.check=o=>{r.has(o.value.type)||o.issues.push({code:"invalid_value",values:t.mime,input:o.value.type,inst:e,continue:!t.abort})}}),Zl=S("$ZodCheckOverwrite",(e,t)=>{Oe.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class Fl{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const o=t.split(`
|
|
4
|
+
`).filter(a=>a),n=Math.min(...o.map(a=>a.length-a.trimStart().length)),i=o.map(a=>a.slice(n)).map(a=>" ".repeat(this.indent*2)+a);for(const a of i)this.content.push(a)}compile(){const t=Function,r=this?.args,n=[...(this?.content??[""]).map(i=>` ${i}`)];return new t(...r,n.join(`
|
|
5
|
+
`))}}const Vl={major:4,minor:4,patch:3},ee=S("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Vl;const o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(const n of o)for(const i of n._zod.onattach)i(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const n=(a,s,c)=>{let u=Vt(a),l;for(const d of s){if(d._zod.def.when){if(Du(a)||!d._zod.def.when(a))continue}else if(u)continue;const p=a.issues.length,m=d._zod.check(a);if(m instanceof Promise&&c?.async===!1)throw new Bt;if(l||m instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await m,a.issues.length!==p&&(u||(u=Vt(a,p)))});else{if(a.issues.length===p)continue;u||(u=Vt(a,p))}}return l?l.then(()=>a):a},i=(a,s,c)=>{if(Vt(a))return a.aborted=!0,a;const u=n(s,o,c);if(u instanceof Promise){if(c.async===!1)throw new Bt;return u.then(l=>e._zod.parse(l,c))}return e._zod.parse(u,c)};e._zod.run=(a,s)=>{if(s.skipChecks)return e._zod.parse(a,s);if(s.direction==="backward"){const u=e._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return u instanceof Promise?u.then(l=>i(l,a,s)):i(u,a,s)}const c=e._zod.parse(a,s);if(c instanceof Promise){if(s.async===!1)throw new Bt;return c.then(u=>n(u,o,s))}return n(c,o,s)}}oe(e,"~standard",()=>({validate:n=>{try{const i=Mr(e,n);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return Br(e,n).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),Zn=S("$ZodString",(e,t)=>{ee.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??pl(e._zod.bag),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),$e=S("$ZodStringFormat",(e,t)=>{Bn.init(e,t),Zn.init(e,t)}),Ll=S("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Gu),$e.init(e,t)}),ql=S("$ZodUUID",(e,t)=>{if(t.version){const o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=an(o))}else t.pattern??(t.pattern=an());$e.init(e,t)}),Jl=S("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Wu),$e.init(e,t)}),Hl=S("$ZodURL",(e,t)=>{$e.init(e,t),e._zod.check=r=>{try{const o=r.value.trim();if(!t.normalize&&t.protocol?.source===Mi.source&&!/^https?:\/\//i.test(o)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}const n=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=n.href:r.value=o;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Kl=S("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Xu()),$e.init(e,t)}),Gl=S("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Hu),$e.init(e,t)}),Wl=S("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Fu),$e.init(e,t)}),Yl=S("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Vu),$e.init(e,t)}),Xl=S("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Lu),$e.init(e,t)}),Ql=S("$ZodXID",(e,t)=>{t.pattern??(t.pattern=qu),$e.init(e,t)}),ed=S("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Ju),$e.init(e,t)}),td=S("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=ml(t)),$e.init(e,t)}),nd=S("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=ul),$e.init(e,t)}),rd=S("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=dl(t)),$e.init(e,t)}),od=S("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Ku),$e.init(e,t)}),id=S("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Qu),$e.init(e,t),e._zod.bag.format="ipv4"}),ad=S("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=el),$e.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),sd=S("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=tl(t.delimiter)),$e.init(e,t),e._zod.bag.format="mac"}),cd=S("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=nl),$e.init(e,t)}),ud=S("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=rl),$e.init(e,t),e._zod.check=r=>{const o=r.value.split("/");try{if(o.length!==2)throw new Error;const[n,i]=o;if(!i)throw new Error;const a=Number(i);if(`${a}`!==i)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function Li(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const ld=S("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=ol),$e.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{Li(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function dd(e){if(!Ui.test(e))return!1;const t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Li(r)}const md=S("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Ui),$e.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{dd(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),pd=S("$ZodE164",(e,t)=>{t.pattern??(t.pattern=sl),$e.init(e,t)});function fd(e,t=null){try{const r=e.split(".");if(r.length!==3)return!1;const[o]=r;if(!o)return!1;const n=JSON.parse(atob(o));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}const hd=S("$ZodJWT",(e,t)=>{$e.init(e,t),e._zod.check=r=>{fd(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),gd=S("$ZodCustomStringFormat",(e,t)=>{$e.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),qi=S("$ZodNumber",(e,t)=>{ee.init(e,t),e._zod.pattern=e._zod.bag.pattern??Bi,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}const n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;const i=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...i?{received:i}:{}}),r}}),vd=S("$ZodNumberFormat",(e,t)=>{wl.init(e,t),qi.init(e,t)}),Ji=S("$ZodBoolean",(e,t)=>{ee.init(e,t),e._zod.pattern=gl,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=!!r.value}catch{}const n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),Hi=S("$ZodBigInt",(e,t)=>{ee.init(e,t),e._zod.pattern=fl,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),yd=S("$ZodBigIntFormat",(e,t)=>{Il.init(e,t),Hi.init(e,t)}),_d=S("$ZodSymbol",(e,t)=>{ee.init(e,t),e._zod.parse=(r,o)=>{const n=r.value;return typeof n=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),r}}),$d=S("$ZodUndefined",(e,t)=>{ee.init(e,t),e._zod.pattern=yl,e._zod.values=new Set([void 0]),e._zod.parse=(r,o)=>{const n=r.value;return typeof n>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),r}}),bd=S("$ZodNull",(e,t)=>{ee.init(e,t),e._zod.pattern=vl,e._zod.values=new Set([null]),e._zod.parse=(r,o)=>{const n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),kd=S("$ZodAny",(e,t)=>{ee.init(e,t),e._zod.parse=r=>r}),Sd=S("$ZodUnknown",(e,t)=>{ee.init(e,t),e._zod.parse=r=>r}),wd=S("$ZodNever",(e,t)=>{ee.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),Id=S("$ZodVoid",(e,t)=>{ee.init(e,t),e._zod.parse=(r,o)=>{const n=r.value;return typeof n>"u"||r.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),r}}),Od=S("$ZodDate",(e,t)=>{ee.init(e,t),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}const n=r.value,i=n instanceof Date;return i&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...i?{received:"Invalid Date"}:{},inst:e}),r}});function Td(e,t,r){e.issues.length&&t.issues.push(...st(r,e.issues)),t.value[r]=e.value}const Pd=S("$ZodArray",(e,t)=>{ee.init(e,t),e._zod.parse=(r,o)=>{const n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);const i=[];for(let a=0;a<n.length;a++){const s=n[a],c=t.element._zod.run({value:s,issues:[]},o);c instanceof Promise?i.push(c.then(u=>Td(u,r,a))):Td(c,r,a)}return i.length?Promise.all(i).then(()=>r):r}});function Zr(e,t,r,o,n,i){const a=r in o;if(e.issues.length){if(n&&i&&!a)return;t.issues.push(...st(r,e.issues))}if(!a&&!n){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?a&&(t.value[r]=void 0):t.value[r]=e.value}function xd(e){const t=Object.keys(e.shape);for(const o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);const r=wu(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function Nd(e,t,r,o,n,i){const a=[],s=n.keySet,c=n.catchall._zod,u=c.def.type,l=c.optin==="optional",d=c.optout==="optional";for(const p in t){if(p==="__proto__"||s.has(p))continue;if(u==="never"){a.push(p);continue}const m=c.run({value:t[p],issues:[]},o);m instanceof Promise?e.push(m.then(f=>Zr(f,r,p,t,l,d))):Zr(m,r,p,t,l,d)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i}),e.length?Promise.all(e).then(()=>r):r}const Ki=S("$ZodObject",(e,t)=>{if(ee.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const s=t.shape;Object.defineProperty(t,"shape",{get:()=>{const c={...s};return Object.defineProperty(t,"shape",{value:c}),c}})}const o=zn(()=>xd(t));oe(e._zod,"propValues",()=>{const s=t.shape,c={};for(const u in s){const l=s[u]._zod;if(l.values){c[u]??(c[u]=new Set);for(const d of l.values)c[u].add(d)}}return c});const n=rn,i=t.catchall;let a;e._zod.parse=(s,c)=>{a??(a=o.value);const u=s.value;if(!n(u))return s.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),s;s.value={};const l=[],d=a.shape;for(const p of a.keys){const m=d[p],f=m._zod.optin==="optional",_=m._zod.optout==="optional",g=m._zod.run({value:u[p],issues:[]},c);g instanceof Promise?l.push(g.then(v=>Zr(v,s,p,u,f,_))):Zr(g,s,p,u,f,_)}return i?Nd(l,u,s,c,o.value,e):l.length?Promise.all(l).then(()=>s):s}}),Ed=S("$ZodObjectJIT",(e,t)=>{Ki.init(e,t);const r=e._zod.parse,o=zn(()=>xd(t)),n=p=>{const m=new Fl(["shape","payload","ctx"]),f=o.value,_=b=>{const I=Ii(b);return`shape[${I}]._zod.run({ value: input[${I}], issues: [] }, ctx)`};m.write("const input = payload.value;");const g=Object.create(null);let v=0;for(const b of f.keys)g[b]=`key_${v++}`;m.write("const newResult = {};");for(const b of f.keys){const I=g[b],x=Ii(b),B=p[b],L=B?._zod?.optin==="optional",ue=B?._zod?.optout==="optional";m.write(`const ${I} = ${_(b)};`),L&&ue?m.write(`
|
|
6
|
+
if (${I}.issues.length) {
|
|
7
|
+
if (${x} in input) {
|
|
8
|
+
payload.issues = payload.issues.concat(${I}.issues.map(iss => ({
|
|
9
|
+
...iss,
|
|
10
|
+
path: iss.path ? [${x}, ...iss.path] : [${x}]
|
|
11
|
+
})));
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if (${I}.value === undefined) {
|
|
16
|
+
if (${x} in input) {
|
|
17
|
+
newResult[${x}] = undefined;
|
|
18
|
+
}
|
|
19
|
+
} else {
|
|
20
|
+
newResult[${x}] = ${I}.value;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
`):L?m.write(`
|
|
24
|
+
if (${I}.issues.length) {
|
|
25
|
+
payload.issues = payload.issues.concat(${I}.issues.map(iss => ({
|
|
26
|
+
...iss,
|
|
27
|
+
path: iss.path ? [${x}, ...iss.path] : [${x}]
|
|
28
|
+
})));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (${I}.value === undefined) {
|
|
32
|
+
if (${x} in input) {
|
|
33
|
+
newResult[${x}] = undefined;
|
|
34
|
+
}
|
|
35
|
+
} else {
|
|
36
|
+
newResult[${x}] = ${I}.value;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
`):m.write(`
|
|
40
|
+
const ${I}_present = ${x} in input;
|
|
41
|
+
if (${I}.issues.length) {
|
|
42
|
+
payload.issues = payload.issues.concat(${I}.issues.map(iss => ({
|
|
43
|
+
...iss,
|
|
44
|
+
path: iss.path ? [${x}, ...iss.path] : [${x}]
|
|
45
|
+
})));
|
|
46
|
+
}
|
|
47
|
+
if (!${I}_present && !${I}.issues.length) {
|
|
48
|
+
payload.issues.push({
|
|
49
|
+
code: "invalid_type",
|
|
50
|
+
expected: "nonoptional",
|
|
51
|
+
input: undefined,
|
|
52
|
+
path: [${x}]
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (${I}_present) {
|
|
57
|
+
if (${I}.value === undefined) {
|
|
58
|
+
newResult[${x}] = undefined;
|
|
59
|
+
} else {
|
|
60
|
+
newResult[${x}] = ${I}.value;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
`)}m.write("payload.value = newResult;"),m.write("return payload;");const y=m.compile();return(b,I)=>y(p,b,I)};let i;const a=rn,s=!En.jitless,u=s&&ku.value,l=t.catchall;let d;e._zod.parse=(p,m)=>{d??(d=o.value);const f=p.value;return a(f)?s&&u&&m?.async===!1&&m.jitless!==!0?(i||(i=n(t.shape)),p=i(p,m),l?Nd([],f,p,m,d,e):p):r(p,m):(p.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),p)}});function zd(e,t,r,o){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;const n=e.filter(i=>!Vt(i));return n.length===1?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(a=>et(a,o,Ce())))}),t)}const Fr=S("$ZodUnion",(e,t)=>{ee.init(e,t),oe(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),oe(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),oe(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),oe(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(n=>n._zod.pattern);return new RegExp(`^(${o.map(n=>zr(n.source)).join("|")})$`)}});const r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let i=!1;const a=[];for(const s of t.options){const c=s._zod.run({value:o.value,issues:[]},n);if(c instanceof Promise)a.push(c),i=!0;else{if(c.issues.length===0)return c;a.push(c)}}return i?Promise.all(a).then(s=>zd(s,o,e,n)):zd(a,o,e,n)}});function jd(e,t,r,o){const n=e.filter(i=>i.issues.length===0);return n.length===1?(t.value=n[0].value,t):(n.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(a=>et(a,o,Ce())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t)}const Dd=S("$ZodXor",(e,t)=>{Fr.init(e,t),t.inclusive=!1;const r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let i=!1;const a=[];for(const s of t.options){const c=s._zod.run({value:o.value,issues:[]},n);c instanceof Promise?(a.push(c),i=!0):a.push(c)}return i?Promise.all(a).then(s=>jd(s,o,e,n)):jd(a,o,e,n)}}),Ad=S("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Fr.init(e,t);const r=e._zod.parse;oe(e._zod,"propValues",()=>{const n={};for(const i of t.options){const a=i._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(const[s,c]of Object.entries(a)){n[s]||(n[s]=new Set);for(const u of c)n[s].add(u)}}return n});const o=zn(()=>{const n=t.options,i=new Map;for(const a of n){const s=a._zod.propValues?.[t.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(const c of s){if(i.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);i.set(c,a)}}return i});e._zod.parse=(n,i)=>{const a=n.value;if(!rn(a))return n.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),n;const s=o.value.get(a?.[t.discriminator]);return s?s._zod.run(n,i):t.unionFallback||i.direction==="backward"?r(n,i):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(o.value.keys()),input:a,path:[t.discriminator],inst:e}),n)}}),Cd=S("$ZodIntersection",(e,t)=>{ee.init(e,t),e._zod.parse=(r,o)=>{const n=r.value,i=t.left._zod.run({value:n,issues:[]},o),a=t.right._zod.run({value:n,issues:[]},o);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([c,u])=>Rd(r,c,u)):Rd(r,i,a)}});function Gi(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Ft(e)&&Ft(t)){const r=Object.keys(t),o=Object.keys(e).filter(i=>r.indexOf(i)!==-1),n={...e,...t};for(const i of o){const a=Gi(e[i],t[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};n[i]=a.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let o=0;o<e.length;o++){const n=e[o],i=t[o],a=Gi(n,i);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Rd(e,t,r){const o=new Map;let n;for(const s of t.issues)if(s.code==="unrecognized_keys"){n??(n=s);for(const c of s.keys)o.has(c)||o.set(c,{}),o.get(c).l=!0}else e.issues.push(s);for(const s of r.issues)if(s.code==="unrecognized_keys")for(const c of s.keys)o.has(c)||o.set(c,{}),o.get(c).r=!0;else e.issues.push(s);const i=[...o].filter(([,s])=>s.l&&s.r).map(([s])=>s);if(i.length&&n&&e.issues.push({...n,keys:i}),Vt(e))return e;const a=Gi(t.value,r.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}const Wi=S("$ZodTuple",(e,t)=>{ee.init(e,t);const r=t.items;e._zod.parse=(o,n)=>{const i=o.value;if(!Array.isArray(i))return o.issues.push({input:i,inst:e,expected:"tuple",code:"invalid_type"}),o;o.value=[];const a=[],s=Ud(r,"optin"),c=Ud(r,"optout");if(!t.rest){if(i.length<s)return o.issues.push({code:"too_small",minimum:s,inclusive:!0,input:i,inst:e,origin:"array"}),o;i.length>r.length&&o.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:i,inst:e,origin:"array"})}const u=new Array(r.length);for(let l=0;l<r.length;l++){const d=r[l]._zod.run({value:i[l],issues:[]},n);d instanceof Promise?a.push(d.then(p=>{u[l]=p})):u[l]=d}if(t.rest){let l=r.length-1;const d=i.slice(r.length);for(const p of d){l++;const m=t.rest._zod.run({value:p,issues:[]},n);m instanceof Promise?a.push(m.then(f=>Md(f,o,l))):Md(m,o,l)}}return a.length?Promise.all(a).then(()=>Bd(u,o,r,i,c)):Bd(u,o,r,i,c)}});function Ud(e,t){for(let r=e.length-1;r>=0;r--)if(e[r]._zod[t]!=="optional")return r+1;return 0}function Md(e,t,r){e.issues.length&&t.issues.push(...st(r,e.issues)),t.value[r]=e.value}function Bd(e,t,r,o,n){for(let i=0;i<r.length;i++){const a=e[i],s=i<o.length;if(a.issues.length){if(!s&&i>=n){t.value.length=i;break}t.issues.push(...st(i,a.issues))}t.value[i]=a.value}for(let i=t.value.length-1;i>=o.length&&(r[i]._zod.optout==="optional"&&t.value[i]===void 0);i--)t.value.length=i;return t}const Zd=S("$ZodRecord",(e,t)=>{ee.init(e,t),e._zod.parse=(r,o)=>{const n=r.value;if(!Ft(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),r;const i=[],a=t.keyType._zod.values;if(a){r.value={};const s=new Set;for(const u of a)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){s.add(typeof u=="number"?u.toString():u);const l=t.keyType._zod.run({value:u,issues:[]},o);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(l.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(m=>et(m,o,Ce())),input:u,path:[u],inst:e});continue}const d=l.value,p=t.valueType._zod.run({value:n[u],issues:[]},o);p instanceof Promise?i.push(p.then(m=>{m.issues.length&&r.issues.push(...st(u,m.issues)),r.value[d]=m.value})):(p.issues.length&&r.issues.push(...st(u,p.issues)),r.value[d]=p.value)}let c;for(const u in n)s.has(u)||(c=c??[],c.push(u));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:c})}else{r.value={};for(const s of Reflect.ownKeys(n)){if(s==="__proto__"||!Object.prototype.propertyIsEnumerable.call(n,s))continue;let c=t.keyType._zod.run({value:s,issues:[]},o);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof s=="string"&&Bi.test(s)&&c.issues.length){const d=t.keyType._zod.run({value:Number(s),issues:[]},o);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(c=d)}if(c.issues.length){t.mode==="loose"?r.value[s]=n[s]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(d=>et(d,o,Ce())),input:s,path:[s],inst:e});continue}const l=t.valueType._zod.run({value:n[s],issues:[]},o);l instanceof Promise?i.push(l.then(d=>{d.issues.length&&r.issues.push(...st(s,d.issues)),r.value[c.value]=d.value})):(l.issues.length&&r.issues.push(...st(s,l.issues)),r.value[c.value]=l.value)}}return i.length?Promise.all(i).then(()=>r):r}}),Fd=S("$ZodMap",(e,t)=>{ee.init(e,t),e._zod.parse=(r,o)=>{const n=r.value;if(!(n instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:n,inst:e}),r;const i=[];r.value=new Map;for(const[a,s]of n){const c=t.keyType._zod.run({value:a,issues:[]},o),u=t.valueType._zod.run({value:s,issues:[]},o);c instanceof Promise||u instanceof Promise?i.push(Promise.all([c,u]).then(([l,d])=>{Vd(l,d,r,a,n,e,o)})):Vd(c,u,r,a,n,e,o)}return i.length?Promise.all(i).then(()=>r):r}});function Vd(e,t,r,o,n,i,a){e.issues.length&&(Dr.has(typeof o)?r.issues.push(...st(o,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:n,inst:i,issues:e.issues.map(s=>et(s,a,Ce()))})),t.issues.length&&(Dr.has(typeof o)?r.issues.push(...st(o,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:i,key:o,issues:t.issues.map(s=>et(s,a,Ce()))})),r.value.set(e.value,t.value)}const Ld=S("$ZodSet",(e,t)=>{ee.init(e,t),e._zod.parse=(r,o)=>{const n=r.value;if(!(n instanceof Set))return r.issues.push({input:n,inst:e,expected:"set",code:"invalid_type"}),r;const i=[];r.value=new Set;for(const a of n){const s=t.valueType._zod.run({value:a,issues:[]},o);s instanceof Promise?i.push(s.then(c=>qd(c,r))):qd(s,r)}return i.length?Promise.all(i).then(()=>r):r}});function qd(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}const Jd=S("$ZodEnum",(e,t)=>{ee.init(e,t);const r=wi(t.entries),o=new Set(r);e._zod.values=o,e._zod.pattern=new RegExp(`^(${r.filter(n=>Dr.has(typeof n)).map(n=>typeof n=="string"?It(n):n.toString()).join("|")})$`),e._zod.parse=(n,i)=>{const a=n.value;return o.has(a)||n.issues.push({code:"invalid_value",values:r,input:a,inst:e}),n}}),Hd=S("$ZodLiteral",(e,t)=>{if(ee.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(o=>typeof o=="string"?It(o):o?It(o.toString()):String(o)).join("|")})$`),e._zod.parse=(o,n)=>{const i=o.value;return r.has(i)||o.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),o}}),Kd=S("$ZodFile",(e,t)=>{ee.init(e,t),e._zod.parse=(r,o)=>{const n=r.value;return n instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),r}}),Gd=S("$ZodTransform",(e,t)=>{ee.init(e,t),e._zod.optin="optional",e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Nr(e.constructor.name);const n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then(a=>(r.value=a,r.fallback=!0,r));if(n instanceof Promise)throw new Bt;return r.value=n,r.fallback=!0,r}});function Wd(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const Yi=S("$ZodOptional",(e,t)=>{ee.init(e,t),e._zod.optin="optional",e._zod.optout="optional",oe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),oe(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${zr(r.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(t.innerType._zod.optin==="optional"){const n=r.value,i=t.innerType._zod.run(r,o);return i instanceof Promise?i.then(a=>Wd(a,n)):Wd(i,n)}return r.value===void 0?r:t.innerType._zod.run(r,o)}}),Yd=S("$ZodExactOptional",(e,t)=>{Yi.init(e,t),oe(e._zod,"values",()=>t.innerType._zod.values),oe(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),Xd=S("$ZodNullable",(e,t)=>{ee.init(e,t),oe(e._zod,"optin",()=>t.innerType._zod.optin),oe(e._zod,"optout",()=>t.innerType._zod.optout),oe(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${zr(r.source)}|null)$`):void 0}),oe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>r.value===null?r:t.innerType._zod.run(r,o)}),Qd=S("$ZodDefault",(e,t)=>{ee.init(e,t),e._zod.optin="optional",oe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)return r.value=t.defaultValue,r;const n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>em(i,t)):em(n,t)}});function em(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const tm=S("$ZodPrefault",(e,t)=>{ee.init(e,t),e._zod.optin="optional",oe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>(o.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,o))}),nm=S("$ZodNonOptional",(e,t)=>{ee.init(e,t),oe(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,o)=>{const n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>rm(i,e)):rm(n,e)}});function rm(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const om=S("$ZodSuccess",(e,t)=>{ee.init(e,t),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Nr("ZodSuccess");const n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.issues.length===0,r)):(r.value=n.issues.length===0,r)}}),im=S("$ZodCatch",(e,t)=>{ee.init(e,t),e._zod.optin="optional",oe(e._zod,"optout",()=>t.innerType._zod.optout),oe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);const n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(a=>et(a,o,Ce()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=n.value,n.issues.length&&(r.value=t.catchValue({...r,error:{issues:n.issues.map(i=>et(i,o,Ce()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),am=S("$ZodNaN",(e,t)=>{ee.init(e,t),e._zod.parse=(r,o)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),Xi=S("$ZodPipe",(e,t)=>{ee.init(e,t),oe(e._zod,"values",()=>t.in._zod.values),oe(e._zod,"optin",()=>t.in._zod.optin),oe(e._zod,"optout",()=>t.out._zod.optout),oe(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){const i=t.out._zod.run(r,o);return i instanceof Promise?i.then(a=>Vr(a,t.in,o)):Vr(i,t.in,o)}const n=t.in._zod.run(r,o);return n instanceof Promise?n.then(i=>Vr(i,t.out,o)):Vr(n,t.out,o)}});function Vr(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}const Qi=S("$ZodCodec",(e,t)=>{ee.init(e,t),oe(e._zod,"values",()=>t.in._zod.values),oe(e._zod,"optin",()=>t.in._zod.optin),oe(e._zod,"optout",()=>t.out._zod.optout),oe(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if((o.direction||"forward")==="forward"){const i=t.in._zod.run(r,o);return i instanceof Promise?i.then(a=>Lr(a,t,o)):Lr(i,t,o)}else{const i=t.out._zod.run(r,o);return i instanceof Promise?i.then(a=>Lr(a,t,o)):Lr(i,t,o)}}});function Lr(e,t,r){if(e.issues.length)return e.aborted=!0,e;if((r.direction||"forward")==="forward"){const n=t.transform(e.value,e);return n instanceof Promise?n.then(i=>qr(e,i,t.out,r)):qr(e,n,t.out,r)}else{const n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(i=>qr(e,i,t.in,r)):qr(e,n,t.in,r)}}function qr(e,t,r,o){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},o)}const sm=S("$ZodPreprocess",(e,t)=>{Xi.init(e,t)}),cm=S("$ZodReadonly",(e,t)=>{ee.init(e,t),oe(e._zod,"propValues",()=>t.innerType._zod.propValues),oe(e._zod,"values",()=>t.innerType._zod.values),oe(e._zod,"optin",()=>t.innerType?._zod?.optin),oe(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);const n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(um):um(n)}});function um(e){return e.value=Object.freeze(e.value),e}const lm=S("$ZodTemplateLiteral",(e,t)=>{ee.init(e,t);const r=[];for(const o of t.parts)if(typeof o=="object"&&o!==null){if(!o._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);const n=o._zod.pattern instanceof RegExp?o._zod.pattern.source:o._zod.pattern;if(!n)throw new Error(`Invalid template literal part: ${o._zod.traits}`);const i=n.startsWith("^")?1:0,a=n.endsWith("$")?n.length-1:n.length;r.push(n.slice(i,a))}else if(o===null||Su.has(typeof o))r.push(It(`${o}`));else throw new Error(`Invalid template literal part: ${o}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(o,n)=>typeof o.value!="string"?(o.issues.push({input:o.value,inst:e,expected:"string",code:"invalid_type"}),o):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(o.value)||o.issues.push({input:o.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),o)}),dm=S("$ZodFunction",(e,t)=>(ee.init(e,t),e._def=t,e._zod.def=t,e.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...o){const n=e._def.input?Rr(e._def.input,o):o,i=Reflect.apply(r,this,n);return e._def.output?Rr(e._def.output,i):i}},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...o){const n=e._def.input?await Ur(e._def.input,o):o,i=await Reflect.apply(r,this,n);return e._def.output?await Ur(e._def.output,i):i}},e._zod.parse=(r,o)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r):(e._def.output&&e._def.output._zod.def.type==="promise"?r.value=e.implementAsync(r.value):r.value=e.implement(r.value),r),e.input=(...r)=>{const o=e.constructor;return Array.isArray(r[0])?new o({type:"function",input:new Wi({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new o({type:"function",input:r[0],output:e._def.output})},e.output=r=>{const o=e.constructor;return new o({type:"function",input:e._def.input,output:r})},e)),mm=S("$ZodPromise",(e,t)=>{ee.init(e,t),e._zod.parse=(r,o)=>Promise.resolve(r.value).then(n=>t.innerType._zod.run({value:n,issues:[]},o))}),pm=S("$ZodLazy",(e,t)=>{ee.init(e,t),oe(e._zod,"innerType",()=>{const r=t;return r._cachedInner||(r._cachedInner=t.getter()),r._cachedInner}),oe(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),oe(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),oe(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),oe(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,o)=>e._zod.innerType._zod.run(r,o)}),fm=S("$ZodCustom",(e,t)=>{Oe.init(e,t),ee.init(e,t),e._zod.parse=(r,o)=>r,e._zod.check=r=>{const o=r.value,n=t.fn(o);if(n instanceof Promise)return n.then(i=>hm(i,r,o,e));hm(n,r,o,e)}});function hm(e,t,r,o){if(!e){const n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(n.params=o._zod.def.params),t.issues.push(on(n))}}const Hy=()=>{const e={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function t(n){return e[n]??null}const r={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${n.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${i}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`}case"invalid_value":return n.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${G(n.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${D(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${n.minimum.toString()} ${a.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${n.prefix}"`:i.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${i.suffix}"`:i.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${i.includes}"`:i.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${i.pattern}`:`${r[i.format]??n.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${n.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${n.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${n.keys.length>1?"\u0629":""}: ${D(n.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function Ky(){return{localeError:Hy()}}const Gy=()=>{const e={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function t(n){return e[n]??null}const r={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"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${n.expected}, daxil olan ${s}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${i}, daxil olan ${s}`}case"invalid_value":return n.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${G(n.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${D(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${i}${n.maximum.toString()} ${a.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${i}${n.minimum.toString()} ${a.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${i.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:i.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${i.suffix}" il\u0259 bitm\u0259lidir`:i.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${i.includes}" daxil olmal\u0131d\u0131r`:i.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${i.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[i.format]??n.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${n.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${n.keys.length>1?"lar":""}: ${D(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${n.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function Wy(){return{localeError:Gy()}}function gm(e,t,r,o){const n=Math.abs(e),i=n%10,a=n%100;return a>=11&&a<=19?o:i===1?t:i>=2&&i<=4?r:o}const Yy=()=>{const e={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function t(n){return e[n]??null}const r={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},o={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${n.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${i}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${G(n.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${D(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);if(a){const s=Number(n.maximum),c=gm(s,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${i}${n.maximum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);if(a){const s=Number(n.minimum),c=gm(s,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${i}${n.minimum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${n.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${D(n.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${n.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function Xy(){return{localeError:Yy()}}const Qy=()=>{const e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function t(n){return e[n]??null}const r={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${G(n.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${D(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.minimum.toString()} ${a.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;if(i.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${i.prefix}"`;if(i.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${i.suffix}"`;if(i.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${i.includes}"`;if(i.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${i.pattern}`;let a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return i.format==="emoji"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="datetime"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="date"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),i.format==="time"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="duration"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${a} ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${n.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u043E\u0432\u0435":""}: ${D(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}};function e_(){return{localeError:Qy()}}const t_=()=>{const e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(n){return e[n]??null}const r={regex:"entrada",email:"adre\xE7a electr\xF2nica",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\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${n.expected}, s'ha rebut ${s}`:`Tipus inv\xE0lid: s'esperava ${i}, s'ha rebut ${s}`}case"invalid_value":return n.values.length===1?`Valor inv\xE0lid: s'esperava ${G(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${D(n.values," o ")}`;case"too_big":{const i=n.inclusive?"com a m\xE0xim":"menys de",a=t(n.origin);return a?`Massa gran: s'esperava que ${n.origin??"el valor"} contingu\xE9s ${i} ${n.maximum.toString()} ${a.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${i} ${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?"com a m\xEDnim":"m\xE9s de",a=t(n.origin);return a?`Massa petit: s'esperava que ${n.origin} contingu\xE9s ${i} ${n.minimum.toString()} ${a.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${i} ${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${i.prefix}"`:i.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${i.suffix}"`:i.format==="includes"?`Format inv\xE0lid: ha d'incloure "${i.includes}"`:i.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${i.pattern}`:`Format inv\xE0lid per a ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${D(n.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${n.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${n.origin}`;default:return"Entrada inv\xE0lida"}}};function n_(){return{localeError:t_()}}const r_=()=>{const e={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function t(n){return e[n]??null}const r={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 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 \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},o={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${n.expected}, obdr\u017Eeno ${s}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${i}, obdr\u017Eeno ${s}`}case"invalid_value":return n.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${G(n.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${D(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${i}${n.maximum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${i}${n.minimum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${i.prefix}"`:i.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${i.suffix}"`:i.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${i.includes}"`:i.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${i.pattern}`:`Neplatn\xFD form\xE1t ${r[i.format]??n.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${n.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${D(n.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${n.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${n.origin}`;default:return"Neplatn\xFD vstup"}}};function o_(){return{localeError:r_()}}const i_=()=>{const e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function t(n){return e[n]??null}const r={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\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",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"},o={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ugyldigt input: forventede instanceof ${n.expected}, fik ${s}`:`Ugyldigt input: forventede ${i}, fik ${s}`}case"invalid_value":return n.values.length===1?`Ugyldig v\xE6rdi: forventede ${G(n.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${D(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin),s=o[n.origin]??n.origin;return a?`For stor: forventede ${s??"value"} ${a.verb} ${i} ${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor: forventede ${s??"value"} havde ${i} ${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin),s=o[n.origin]??n.origin;return a?`For lille: forventede ${s} ${a.verb} ${i} ${n.minimum.toString()} ${a.unit}`:`For lille: forventede ${s} havde ${i} ${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`Ugyldig streng: skal starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: skal ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: skal indeholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${r[i.format]??n.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${D(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${n.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${n.origin}`;default:return"Ugyldigt input"}}};function a_(){return{localeError:i_()}}const s_=()=>{const e={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 t(n){return e[n]??null}const r={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"},o={nan:"NaN",number:"Zahl",array:"Array"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${n.expected}, erhalten ${s}`:`Ung\xFCltige Eingabe: erwartet ${i}, erhalten ${s}`}case"invalid_value":return n.values.length===1?`Ung\xFCltige Eingabe: erwartet ${G(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${D(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ist`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ${a.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ist`}case"invalid_format":{const i=n;return i.format==="starts_with"?`Ung\xFCltiger String: muss mit "${i.prefix}" beginnen`:i.format==="ends_with"?`Ung\xFCltiger String: muss mit "${i.suffix}" enden`:i.format==="includes"?`Ung\xFCltiger String: muss "${i.includes}" enthalten`:i.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${i.pattern} entsprechen`:`Ung\xFCltig: ${r[i.format]??n.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${D(n.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${n.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${n.origin}`;default:return"Ung\xFCltige Eingabe"}}};function c_(){return{localeError:s_()}}const u_=()=>{const e={string:{unit:"\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},file:{unit:"bytes",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},array:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},set:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},map:{unit:"\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"}};function t(n){return e[n]??null}const r={regex:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",email:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 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 \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",date:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",time:"ISO \u03CE\u03C1\u03B1",duration:"ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",ipv4:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",ipv6:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",mac:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",cidrv4:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",cidrv6:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",base64:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",base64url:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",json_string:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",e164:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return typeof n.expected=="string"&&/^[A-Z]/.test(n.expected)?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${n.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${s}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${s}`}case"invalid_value":return n.values.length===1?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${G(n.values[0])}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${D(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${i}${n.maximum.toString()} ${a.unit??"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${i}${n.minimum.toString()} ${a.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${i.prefix}"`:i.format==="ends_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${i.suffix}"`:i.format==="includes"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${i.includes}"`:i.format==="regex"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${i.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${r[i.format]??n.format}`}case"not_multiple_of":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${n.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${n.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${n.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${D(n.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${n.origin}`;case"invalid_union":return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";case"invalid_element":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${n.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}};function l_(){return{localeError:u_()}}const d_=()=>{const e={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 t(n){return e[n]??null}const r={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"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return`Invalid input: expected ${i}, received ${s}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${G(n.values[0])}`:`Invalid option: expected one of ${D(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Too big: expected ${n.origin??"value"} to have ${i}${n.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`Too small: expected ${n.origin} to have ${i}${n.minimum.toString()} ${a.unit}`:`Too small: expected ${n.origin} to be ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`Invalid string: must start with "${i.prefix}"`:i.format==="ends_with"?`Invalid string: must end with "${i.suffix}"`:i.format==="includes"?`Invalid string: must include "${i.includes}"`:i.format==="regex"?`Invalid string: must match pattern ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${D(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`Invalid discriminator value. Expected ${n.options.map(a=>`'${a}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};function vm(){return{localeError:d_()}}const m_=()=>{const e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(n){return e[n]??null}const r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",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\u016Dro",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"},o={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${n.expected}, ricevi\u011Dis ${s}`:`Nevalida enigo: atendi\u011Dis ${i}, ricevi\u011Dis ${s}`}case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${G(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${D(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()} ${a.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${i}${n.minimum.toString()} ${a.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${i.prefix}"`:i.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${i.suffix}"`:i.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${i.includes}"`:i.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${i.pattern}`:`Nevalida ${r[i.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} \u015Dlosilo${n.keys.length>1?"j":""}: ${D(n.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}};function p_(){return{localeError:m_()}}const f_=()=>{const e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(n){return e[n]??null}const r={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",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\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${n.expected}, recibido ${s}`:`Entrada inv\xE1lida: se esperaba ${i}, recibido ${s}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: se esperaba ${G(n.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${D(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Demasiado grande: se esperaba que ${s??"valor"} tuviera ${i}${n.maximum.toString()} ${a.unit??"elementos"}`:`Demasiado grande: se esperaba que ${s??"valor"} fuera ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Demasiado peque\xF1o: se esperaba que ${s} tuviera ${i}${n.minimum.toString()} ${a.unit}`:`Demasiado peque\xF1o: se esperaba que ${s} fuera ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${i.prefix}"`:i.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${i.suffix}"`:i.format==="includes"?`Cadena inv\xE1lida: debe incluir "${i.includes}"`:i.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${i.pattern}`:`Inv\xE1lido ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${D(n.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${o[n.origin]??n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${o[n.origin]??n.origin}`;default:return"Entrada inv\xE1lida"}}};function h_(){return{localeError:f_()}}const g_=()=>{const e={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function t(n){return e[n]??null}const r={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${n.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${i} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return n.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${G(n.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${D(n.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} ${a.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{const i=n;return i.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:i.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:i.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${i.includes}" \u0628\u0627\u0634\u062F`:i.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${i.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[i.format]??n.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${n.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${n.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${D(n.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${n.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${n.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function v_(){return{localeError:g_()}}const y_=()=>{const e={string:{unit:"merkki\xE4",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\xE4iv\xE4m\xE4\xE4r\xE4n"}};function t(n){return e[n]??null}const r={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",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\xE4iv\xE4m\xE4\xE4r\xE4",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"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${s}`:`Virheellinen tyyppi: odotettiin ${i}, oli ${s}`}case"invalid_value":return n.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${G(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${D(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Liian suuri: ${a.subject} t\xE4ytyy olla ${i}${n.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`Liian pieni: ${a.subject} t\xE4ytyy olla ${i}${n.minimum.toString()} ${a.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${i.prefix}"`:i.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${i.suffix}"`:i.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${i.includes}"`:i.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${i.pattern}`:`Virheellinen ${r[i.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${D(n.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\xF6te"}}};function __(){return{localeError:y_()}}const $_=()=>{const e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}const r={regex:"entr\xE9e",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\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},o={string:"cha\xEEne",number:"nombre",int:"entier",boolean:"bool\xE9en",bigint:"grand entier",symbol:"symbole",undefined:"ind\xE9fini",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 n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : instanceof ${n.expected} attendu, ${s} re\xE7u`:`Entr\xE9e invalide : ${i} attendu, ${s} re\xE7u`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : ${G(n.values[0])} attendu`:`Option invalide : une valeur parmi ${D(n.values,"|")} attendue`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Trop grand : ${o[n.origin]??"valeur"} doit ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${o[n.origin]??"valeur"} doit \xEAtre ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`Trop petit : ${o[n.origin]??"valeur"} doit ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Trop petit : ${o[n.origin]??"valeur"} doit \xEAtre ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${i.pattern}`:`${r[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${D(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}};function b_(){return{localeError:$_()}}const k_=()=>{const e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}const r={regex:"entr\xE9e",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\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : attendu instanceof ${n.expected}, re\xE7u ${s}`:`Entr\xE9e invalide : attendu ${i}, re\xE7u ${s}`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : attendu ${G(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${D(n.values,"|")}`;case"too_big":{const i=n.inclusive?"\u2264":"<",a=t(n.origin);return a?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${i}${n.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?"\u2265":">",a=t(n.origin);return a?`Trop petit : attendu que ${n.origin} ait ${i}${n.minimum.toString()} ${a.unit}`:`Trop petit : attendu que ${n.origin} soit ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${i.pattern}`:`${r[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${D(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}};function S_(){return{localeError:k_()}}const w_=()=>{const e={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},t={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},r=u=>u?e[u]:void 0,o=u=>{const l=r(u);return l?l.label:u??e.unknown.label},n=u=>`\u05D4${o(u)}`,i=u=>(r(u)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",a=u=>u?t[u]??null:null,s={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",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:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},c={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{const l=u.expected,d=c[l??""]??o(l),p=X(u.input),m=c[p]??e[p]?.label??p;return/^[A-Z]/.test(u.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${u.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${m}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${d}, \u05D4\u05EA\u05E7\u05D1\u05DC ${m}`}case"invalid_value":{if(u.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${G(u.values[0])}`;const l=u.values.map(m=>G(m));if(u.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${l[0]} \u05D0\u05D5 ${l[1]}`;const d=l[l.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${l.slice(0,-1).join(", ")} \u05D0\u05D5 ${d}`}case"too_big":{const l=a(u.origin),d=n(u.origin??"value");if(u.origin==="string")return`${l?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${u.maximum.toString()} ${l?.unit??""} ${u.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(u.origin==="number"){const f=u.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${u.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${u.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${f}`}if(u.origin==="array"||u.origin==="set"){const f=u.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",_=u.inclusive?`${u.maximum} ${l?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${u.maximum} ${l?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} ${f} \u05DC\u05D4\u05DB\u05D9\u05DC ${_}`.trim()}const p=u.inclusive?"<=":"<",m=i(u.origin??"value");return l?.unit?`${l.longLabel} \u05DE\u05D3\u05D9: ${d} ${m} ${p}${u.maximum.toString()} ${l.unit}`:`${l?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${d} ${m} ${p}${u.maximum.toString()}`}case"too_small":{const l=a(u.origin),d=n(u.origin??"value");if(u.origin==="string")return`${l?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${u.minimum.toString()} ${l?.unit??""} ${u.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(u.origin==="number"){const f=u.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${u.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${u.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${f}`}if(u.origin==="array"||u.origin==="set"){const f=u.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(u.minimum===1&&u.inclusive){const g=(u.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${f} \u05DC\u05D4\u05DB\u05D9\u05DC ${g}`}const _=u.inclusive?`${u.minimum} ${l?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${u.minimum} ${l?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${f} \u05DC\u05D4\u05DB\u05D9\u05DC ${_}`.trim()}const p=u.inclusive?">=":">",m=i(u.origin??"value");return l?.unit?`${l.shortLabel} \u05DE\u05D3\u05D9: ${d} ${m} ${p}${u.minimum.toString()} ${l.unit}`:`${l?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${d} ${m} ${p}${u.minimum.toString()}`}case"invalid_format":{const l=u;if(l.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${l.prefix}"`;if(l.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${l.suffix}"`;if(l.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${l.includes}"`;if(l.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${l.pattern}`;const d=s[l.format],p=d?.label??l.format,f=(d?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${p} \u05DC\u05D0 ${f}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${u.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${u.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${u.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${D(u.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${n(u.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function I_(){return{localeError:w_()}}const O_=()=>{const e={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function t(n){return e[n]??null}const r={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"},o={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 n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${n.expected}, a primljeno je ${s}`:`Neispravan unos: o\u010Dekuje se ${i}, a primljeno je ${s}`}case"invalid_value":return n.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${G(n.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${D(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Preveliko: o\u010Dekivano da ${s??"vrijednost"} ima ${i}${n.maximum.toString()} ${a.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${s??"vrijednost"} bude ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Premalo: o\u010Dekivano da ${s} ima ${i}${n.minimum.toString()} ${a.unit}`:`Premalo: o\u010Dekivano da ${s} bude ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${i.prefix}"`:i.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${i.suffix}"`:i.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${i.includes}"`:i.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${i.pattern}`:`Neispravna ${r[i.format]??n.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${n.divisor}`;case"unrecognized_keys":return`Neprepoznat${n.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${D(n.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${o[n.origin]??n.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${o[n.origin]??n.origin}`;default:return"Neispravan unos"}}};function T_(){return{localeError:O_()}}const P_=()=>{const e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(n){return e[n]??null}const r={regex:"bemenet",email:"email c\xEDm",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\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},o={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${n.expected}, a kapott \xE9rt\xE9k ${s}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${i}, a kapott \xE9rt\xE9k ${s}`}case"invalid_value":return n.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${G(n.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${D(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`T\xFAl nagy: ${n.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${i}${n.maximum.toString()} ${a.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${n.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} m\xE9rete t\xFAl kicsi ${i}${n.minimum.toString()} ${a.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} t\xFAl kicsi ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`\xC9rv\xE9nytelen string: "${i.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:i.format==="ends_with"?`\xC9rv\xE9nytelen string: "${i.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:i.format==="includes"?`\xC9rv\xE9nytelen string: "${i.includes}" \xE9rt\xE9ket kell tartalmaznia`:i.format==="regex"?`\xC9rv\xE9nytelen string: ${i.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[i.format]??n.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${n.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${D(n.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${n.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${n.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function x_(){return{localeError:P_()}}function ym(e,t,r){return Math.abs(e)===1?t:r}function sn(e){if(!e)return"";const t=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=e[e.length-1];return e+(t.includes(r)?"\u0576":"\u0568")}const N_=()=>{const e={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function t(n){return e[n]??null}const r={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},o={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${n.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${i}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`}case"invalid_value":return n.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${G(n.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${D(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);if(a){const s=Number(n.maximum),c=ym(s,a.unit.one,a.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${sn(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.maximum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${sn(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);if(a){const s=Number(n.minimum),c=ym(s,a.unit.one,a.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${sn(n.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.minimum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${sn(n.origin)} \u056C\u056B\u0576\u056B ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${i.prefix}"-\u0578\u057E`:i.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${i.suffix}"-\u0578\u057E`:i.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${i.includes}"`:i.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${i.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[i.format]??n.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${n.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${n.keys.length>1?"\u0576\u0565\u0580":""}. ${D(n.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${sn(n.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${sn(n.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function E_(){return{localeError:N_()}}const z_=()=>{const e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(n){return e[n]??null}const r={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"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${s}`:`Input tidak valid: diharapkan ${i}, diterima ${s}`}case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${G(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${D(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${i}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`Terlalu kecil: diharapkan ${n.origin} memiliki ${i}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`String tidak valid: harus dimulai dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak valid: harus berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak valid: harus menyertakan "${i.includes}"`:i.format==="regex"?`String tidak valid: harus sesuai pola ${i.pattern}`:`${r[i.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${D(n.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${n.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${n.origin}`;default:return"Input tidak valid"}}};function j_(){return{localeError:z_()}}const D_=()=>{const e={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function t(n){return e[n]??null}const r={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",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\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",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\xF6lugildi",jwt:"JWT",template_literal:"gildi"},o={nan:"NaN",number:"n\xFAmer",array:"fylki"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera instanceof ${n.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera ${i}`}case"invalid_value":return n.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${G(n.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${D(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} hafi ${i}${n.maximum.toString()} ${a.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} s\xE9 ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} hafi ${i}${n.minimum.toString()} ${a.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} s\xE9 ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${i.prefix}"`:i.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${i.suffix}"`:i.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${i.includes}"`:i.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${i.pattern}`:`Rangt ${r[i.format]??n.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${n.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${n.keys.length>1?"ir lyklar":"ur lykill"}: ${D(n.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${n.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${n.origin}`;default:return"Rangt gildi"}}};function A_(){return{localeError:D_()}}const C_=()=>{const e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(n){return e[n]??null}const r={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"},o={nan:"NaN",number:"numero",array:"vettore"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Input non valido: atteso instanceof ${n.expected}, ricevuto ${s}`:`Input non valido: atteso ${i}, ricevuto ${s}`}case"invalid_value":return n.values.length===1?`Input non valido: atteso ${G(n.values[0])}`:`Opzione non valida: atteso uno tra ${D(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Troppo grande: ${n.origin??"valore"} deve avere ${i}${n.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`Troppo piccolo: ${n.origin} deve avere ${i}${n.minimum.toString()} ${a.unit}`:`Troppo piccolo: ${n.origin} deve essere ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`Stringa non valida: deve iniziare con "${i.prefix}"`:i.format==="ends_with"?`Stringa non valida: deve terminare con "${i.suffix}"`:i.format==="includes"?`Stringa non valida: deve includere "${i.includes}"`:i.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${i.pattern}`:`Input non valido: ${r[i.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${D(n.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${n.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${n.origin}`;default:return"Input non valido"}}};function R_(){return{localeError:C_()}}const U_=()=>{const e={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function t(n){return e[n]??null}const r={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},o={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${n.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${i}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return n.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${G(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${D(n.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{const i=n.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",a=t(n.origin);return a?`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${a.unit??"\u8981\u7D20"}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{const i=n.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",a=t(n.origin);return a?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${a.unit}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{const i=n;return i.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${i.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[i.format]??n.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${n.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${n.keys.length>1?"\u7FA4":""}: ${D(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function M_(){return{localeError:U_()}}const B_=()=>{const e={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function t(n){return e[n]??null}const r={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},o={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10D5\u10D4\u10DA\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${n.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`}case"invalid_value":return n.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${G(n.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${D(n.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} \u10D8\u10E7\u10DD\u10E1 ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.prefix}"-\u10D8\u10D7`:i.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.suffix}"-\u10D8\u10D7`:i.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${i.includes}"-\u10E1`:i.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${i.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${n.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${n.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${D(n.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${n.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${n.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};function Z_(){return{localeError:B_()}}const F_=()=>{const e={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function t(n){return e[n]??null}const r={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},o={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${n.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`}case"invalid_value":return n.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${G(n.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${D(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${n.maximum.toString()} ${a.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${i} ${n.minimum.toString()} ${a.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${i} ${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${i.prefix}"`:i.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${i.suffix}"`:i.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${i.includes}"`:i.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${i.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${n.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${D(n.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};function _m(){return{localeError:F_()}}function V_(){return _m()}const L_=()=>{const e={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function t(n){return e[n]??null}const r={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${n.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${i}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`}case"invalid_value":return n.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${G(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${D(n.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{const i=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",a=i==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=t(n.origin),c=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${c} ${i}${a}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()} ${i}${a}`}case"too_small":{const i=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",a=i==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=t(n.origin),c=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${c} ${i}${a}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()} ${i}${a}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:i.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${i.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[i.format]??n.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${n.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${D(n.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${n.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${n.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function q_(){return{localeError:L_()}}const Fn=e=>e.charAt(0).toUpperCase()+e.slice(1);function $m(e){const t=Math.abs(e),r=t%10,o=t%100;return o>=11&&o<=19||r===0?"many":r===1?"one":"few"}const J_=()=>{const e={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function t(n,i,a,s){const c=e[n]??null;return c===null?c:{unit:c.unit[i],verb:c.verb[s][a?"inclusive":"notInclusive"]}}const r={regex:"\u012Fvestis",email:"el. pa\u0161to 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\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},o={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Gautas tipas ${s}, o tik\u0117tasi - instanceof ${n.expected}`:`Gautas tipas ${s}, o tik\u0117tasi - ${i}`}case"invalid_value":return n.values.length===1?`Privalo b\u016Bti ${G(n.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${D(n.values,"|")} pasirinkim\u0173`;case"too_big":{const i=o[n.origin]??n.origin,a=t(n.origin,$m(Number(n.maximum)),n.inclusive??!1,"smaller");if(a?.verb)return`${Fn(i??n.origin??"reik\u0161m\u0117")} ${a.verb} ${n.maximum.toString()} ${a.unit??"element\u0173"}`;const s=n.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${Fn(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${n.maximum.toString()} ${a?.unit}`}case"too_small":{const i=o[n.origin]??n.origin,a=t(n.origin,$m(Number(n.minimum)),n.inclusive??!1,"bigger");if(a?.verb)return`${Fn(i??n.origin??"reik\u0161m\u0117")} ${a.verb} ${n.minimum.toString()} ${a.unit??"element\u0173"}`;const s=n.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${Fn(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${n.minimum.toString()} ${a?.unit}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${i.prefix}"`:i.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${i.suffix}"`:i.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${i.includes}"`:i.format==="regex"?`Eilut\u0117 privalo atitikti ${i.pattern}`:`Neteisingas ${r[i.format]??n.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${n.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${n.keys.length>1?"i":"as"} rakt${n.keys.length>1?"ai":"as"}: ${D(n.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{const i=o[n.origin]??n.origin;return`${Fn(i??n.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function H_(){return{localeError:J_()}}const K_=()=>{const e={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function t(n){return e[n]??null}const r={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},o={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${n.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${G(n.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${D(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${i}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0438\u043C\u0430 ${i}${n.minimum.toString()} ${a.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${D(n.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${n.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${n.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function G_(){return{localeError:K_()}}const W_=()=>{const e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(n){return e[n]??null}const r={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"},o={nan:"NaN",number:"nombor"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${s}`:`Input tidak sah: dijangka ${i}, diterima ${s}`}case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${G(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${D(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Terlalu besar: dijangka ${n.origin??"nilai"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`Terlalu kecil: dijangka ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`String tidak sah: mesti bermula dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak sah: mesti mengandungi "${i.includes}"`:i.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${i.pattern}`:`${r[i.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${D(n.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${n.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${n.origin}`;default:return"Input tidak sah"}}};function Y_(){return{localeError:W_()}}const X_=()=>{const e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function t(n){return e[n]??null}const r={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"},o={nan:"NaN",number:"getal"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${s}`:`Ongeldige invoer: verwacht ${i}, ontving ${s}`}case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${G(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${D(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin),s=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";return a?`Te ${s}: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} ${a.unit??"elementen"} ${a.verb}`:`Te ${s}: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} is`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin),s=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";return a?`Te ${s}: verwacht dat ${n.origin} ${i}${n.minimum.toString()} ${a.unit} ${a.verb}`:`Te ${s}: verwacht dat ${n.origin} ${i}${n.minimum.toString()} is`}case"invalid_format":{const i=n;return i.format==="starts_with"?`Ongeldige tekst: moet met "${i.prefix}" beginnen`:i.format==="ends_with"?`Ongeldige tekst: moet op "${i.suffix}" eindigen`:i.format==="includes"?`Ongeldige tekst: moet "${i.includes}" bevatten`:i.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`:`Ongeldig: ${r[i.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${D(n.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${n.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${n.origin}`;default:return"Ongeldige invoer"}}};function Q_(){return{localeError:X_()}}const e$=()=>{const e={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function t(n){return e[n]??null}const r={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\xE5de",ipv6:"IPv6-omr\xE5de",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"},o={nan:"NaN",number:"tall",array:"liste"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ugyldig input: forventet instanceof ${n.expected}, fikk ${s}`:`Ugyldig input: forventet ${i}, fikk ${s}`}case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${G(n.values[0])}`:`Ugyldig valg: forventet en av ${D(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`For lite(n): forventet ${n.origin} til \xE5 ha ${i}${n.minimum.toString()} ${a.unit}`:`For lite(n): forventet ${n.origin} til \xE5 ha ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${r[i.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${D(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}};function t$(){return{localeError:e$()}}const n$=()=>{const e={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function t(n){return e[n]??null}const r={regex:"giren",email:"epostag\xE2h",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\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},o={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`F\xE2sit giren: umulan instanceof ${n.expected}, al\u0131nan ${s}`:`F\xE2sit giren: umulan ${i}, al\u0131nan ${s}`}case"invalid_value":return n.values.length===1?`F\xE2sit giren: umulan ${G(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${D(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${i}${n.maximum.toString()} ${a.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${i}${n.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${i}${n.minimum.toString()} ${a.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${i}${n.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{const i=n;return i.format==="starts_with"?`F\xE2sit metin: "${i.prefix}" ile ba\u015Flamal\u0131.`:i.format==="ends_with"?`F\xE2sit metin: "${i.suffix}" ile bitmeli.`:i.format==="includes"?`F\xE2sit metin: "${i.includes}" ihtiv\xE2 etmeli.`:i.format==="regex"?`F\xE2sit metin: ${i.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[i.format]??n.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${n.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${n.keys.length>1?"s":""}: ${D(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${n.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function r$(){return{localeError:n$()}}const o$=()=>{const e={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function t(n){return e[n]??null}const r={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${n.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${i} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return n.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${G(n.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${D(n.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} \u0648\u064A`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} ${a.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} \u0648\u064A`}case"invalid_format":{const i=n;return i.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:i.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:i.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${i.includes}" \u0648\u0644\u0631\u064A`:i.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${i.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[i.format]??n.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${n.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${n.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${D(n.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${n.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${n.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function i$(){return{localeError:o$()}}const a$=()=>{const e={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function t(n){return e[n]??null}const r={regex:"wyra\u017Cenie",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\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},o={nan:"NaN",number:"liczba",array:"tablica"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${n.expected}, otrzymano ${s}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${i}, otrzymano ${s}`}case"invalid_value":return n.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${G(n.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${D(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${n.maximum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${n.minimum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${i.prefix}"`:i.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${i.suffix}"`:i.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${i.includes}"`:i.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${i.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[i.format]??n.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${D(n.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${n.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${n.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function s$(){return{localeError:a$()}}const c$=()=>{const e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(n){return e[n]??null}const r={regex:"padr\xE3o",email:"endere\xE7o 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\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o 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\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",number:"n\xFAmero",null:"nulo"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Tipo inv\xE1lido: esperado instanceof ${n.expected}, recebido ${s}`:`Tipo inv\xE1lido: esperado ${i}, recebido ${s}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: esperado ${G(n.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${D(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${i}${n.maximum.toString()} ${a.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`Muito pequeno: esperado que ${n.origin} tivesse ${i}${n.minimum.toString()} ${a.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${i.prefix}"`:i.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${i.suffix}"`:i.format==="includes"?`Texto inv\xE1lido: deve incluir "${i.includes}"`:i.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${i.pattern}`:`${r[i.format]??n.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${D(n.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${n.origin}`;default:return"Campo inv\xE1lido"}}};function u$(){return{localeError:c$()}}const l$=()=>{const e={string:{unit:"caractere",verb:"s\u0103 aib\u0103"},file:{unit:"octe\u021Bi",verb:"s\u0103 aib\u0103"},array:{unit:"elemente",verb:"s\u0103 aib\u0103"},set:{unit:"elemente",verb:"s\u0103 aib\u0103"},map:{unit:"intr\u0103ri",verb:"s\u0103 aib\u0103"}};function t(n){return e[n]??null}const r={regex:"intrare",email:"adres\u0103 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\u0103 \u0219i or\u0103 ISO",date:"dat\u0103 ISO",time:"or\u0103 ISO",duration:"durat\u0103 ISO",ipv4:"adres\u0103 IPv4",ipv6:"adres\u0103 IPv6",mac:"adres\u0103 MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"\u0219ir codat base64",base64url:"\u0219ir codat base64url",json_string:"\u0219ir JSON",e164:"num\u0103r E.164",jwt:"JWT",template_literal:"intrare"},o={nan:"NaN",string:"\u0219ir",number:"num\u0103r",boolean:"boolean",function:"func\u021Bie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"num\u0103r mare",void:"void",never:"never",map:"hart\u0103",set:"set"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return`Intrare invalid\u0103: a\u0219teptat ${i}, primit ${s}`}case"invalid_value":return n.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${G(n.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${D(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} s\u0103 fie ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`Prea mic: a\u0219teptat ca ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Prea mic: a\u0219teptat ca ${n.origin} s\u0103 fie ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${i.prefix}"`:i.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${i.suffix}"`:i.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${i.includes}"`:i.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${i.pattern}`:`Format invalid: ${r[i.format]??n.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${n.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${D(n.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${n.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${n.origin}`;default:return"Intrare invalid\u0103"}}};function d$(){return{localeError:l$()}}function bm(e,t,r,o){const n=Math.abs(e),i=n%10,a=n%100;return a>=11&&a<=19?o:i===1?t:i>=2&&i<=4?r:o}const m$=()=>{const e={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function t(n){return e[n]??null}const r={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${G(n.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${D(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);if(a){const s=Number(n.maximum),c=bm(s,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${n.maximum.toString()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);if(a){const s=Number(n.minimum),c=bm(s,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${n.minimum.toString()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${n.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0438":""}: ${D(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};function p$(){return{localeError:m$()}}const f$=()=>{const e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(n){return e[n]??null}const r={regex:"vnos",email:"e-po\u0161tni 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 \u010Das",date:"ISO datum",time:"ISO \u010Das",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 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},o={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${n.expected}, prejeto ${s}`:`Neveljaven vnos: pri\u010Dakovano ${i}, prejeto ${s}`}case"invalid_value":return n.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${G(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${D(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} imelo ${i}${n.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`Premajhno: pri\u010Dakovano, da bo ${n.origin} imelo ${i}${n.minimum.toString()} ${a.unit}`:`Premajhno: pri\u010Dakovano, da bo ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${i.prefix}"`:i.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${i.suffix}"`:i.format==="includes"?`Neveljaven niz: mora vsebovati "${i.includes}"`:i.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`:`Neveljaven ${r[i.format]??n.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${D(n.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}};function h$(){return{localeError:f$()}}const g$=()=>{const e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function t(n){return e[n]??null}const r={regex:"regulj\xE4rt 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\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},o={nan:"NaN",number:"antal",array:"lista"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${n.expected}, fick ${s}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${i}, fick ${s}`}case"invalid_value":return n.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${G(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${D(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`F\xF6r stor(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.maximum.toString()} ${a.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${n.origin??"v\xE4rdet"} att ha ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.minimum.toString()} ${a.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${i.prefix}"`:i.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${i.suffix}"`:i.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${i.includes}"`:i.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${i.pattern}"`:`Ogiltig(t) ${r[i.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${D(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${n.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function v$(){return{localeError:g$()}}const y$=()=>{const e={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function t(n){return e[n]??null}const r={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",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 \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${n.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`}case"invalid_value":return n.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${G(n.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${D(n.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${n.maximum.toString()} ${a.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${n.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${i}${n.minimum.toString()} ${a.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${i}${n.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{const i=n;return i.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${i.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${n.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${n.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${D(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};function _$(){return{localeError:y$()}}const $$=()=>{const e={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function t(n){return e[n]??null}const r={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},o={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${n.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${i} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`}case"invalid_value":return n.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${G(n.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${D(n.values,"|")}`;case"too_big":{const i=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",a=t(n.origin);return a?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.maximum.toString()} ${a.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",a=t(n.origin);return a?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.minimum.toString()} ${a.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${i.prefix}"`:i.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${i.suffix}"`:i.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${i.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:i.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${i.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${n.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${D(n.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function b$(){return{localeError:$$()}}const k$=()=>{const e={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function t(n){return e[n]??null}const r={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\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${n.expected}, al\u0131nan ${s}`:`Ge\xE7ersiz de\u011Fer: beklenen ${i}, al\u0131nan ${s}`}case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${G(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${D(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()} ${a.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()} ${a.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`Ge\xE7ersiz metin: "${i.prefix}" ile ba\u015Flamal\u0131`:i.format==="ends_with"?`Ge\xE7ersiz metin: "${i.suffix}" ile bitmeli`:i.format==="includes"?`Ge\xE7ersiz metin: "${i.includes}" i\xE7ermeli`:i.format==="regex"?`Ge\xE7ersiz metin: ${i.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[i.format]??n.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${n.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${n.keys.length>1?"lar":""}: ${D(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${n.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function S$(){return{localeError:k$()}}const w$=()=>{const e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function t(n){return e[n]??null}const r={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${n.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${i}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${G(n.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${D(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} \u0431\u0443\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0456":""}: ${D(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${n.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};function km(){return{localeError:w$()}}function I$(){return km()}const O$=()=>{const e={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function t(n){return e[n]??null}const r={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},o={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${n.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${i} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return n.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${G(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${D(n.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${i}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${i}${n.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u06D2 ${i}${n.minimum.toString()} ${a.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u0627 ${i}${n.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{const i=n;return i.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${i.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${n.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${n.keys.length>1?"\u0632":""}: ${D(n.keys,"\u060C ")}`;case"invalid_key":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function T$(){return{localeError:O$()}}const P$=()=>{const e={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"},map:{unit:"yozuv",verb:"bo\u2018lishi kerak"}};function t(n){return e[n]??null}const r={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"},o={nan:"NaN",number:"raqam",array:"massiv"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${s}`:`Noto\u2018g\u2018ri kirish: kutilgan ${i}, qabul qilingan ${s}`}case"invalid_value":return n.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${G(n.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${D(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Juda katta: kutilgan ${n.origin??"qiymat"} ${i}${n.maximum.toString()} ${a.unit} ${a.verb}`:`Juda katta: kutilgan ${n.origin??"qiymat"} ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`Juda kichik: kutilgan ${n.origin} ${i}${n.minimum.toString()} ${a.unit} ${a.verb}`:`Juda kichik: kutilgan ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${i.prefix}" bilan boshlanishi kerak`:i.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${i.suffix}" bilan tugashi kerak`:i.format==="includes"?`Noto\u2018g\u2018ri satr: "${i.includes}" ni o\u2018z ichiga olishi kerak`:i.format==="regex"?`Noto\u2018g\u2018ri satr: ${i.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[i.format]??n.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${n.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${n.keys.length>1?"lar":""}: ${D(n.keys,", ")}`;case"invalid_key":return`${n.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${n.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}};function x$(){return{localeError:P$()}}const N$=()=>{const e={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function t(n){return e[n]??null}const r={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 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\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},o={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${n.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${i}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`}case"invalid_value":return n.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${G(n.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${D(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${i.prefix}"`:i.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${i.suffix}"`:i.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${i.includes}"`:i.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${i.pattern}`:`${r[i.format]??n.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${n.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${D(n.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function E$(){return{localeError:N$()}}const z$=()=>{const e={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function t(n){return e[n]??null}const r={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},o={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${n.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${i}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`}case"invalid_value":return n.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${G(n.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${D(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${i}${n.maximum.toString()} ${a.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${i}${n.minimum.toString()} ${a.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.prefix}" \u5F00\u5934`:i.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.suffix}" \u7ED3\u5C3E`:i.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${i.pattern}`:`\u65E0\u6548${r[i.format]??n.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${n.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${D(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${n.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function j$(){return{localeError:z$()}}const D$=()=>{const e={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function t(n){return e[n]??null}const r={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",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 \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${n.expected}\uFF0C\u4F46\u6536\u5230 ${s}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${i}\uFF0C\u4F46\u6536\u5230 ${s}`}case"invalid_value":return n.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${G(n.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${D(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${i}${n.maximum.toString()} ${a.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${i}${n.minimum.toString()} ${a.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.prefix}" \u958B\u982D`:i.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.suffix}" \u7D50\u5C3E`:i.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${i.pattern}`:`\u7121\u6548\u7684 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${n.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${n.keys.length>1?"\u5011":""}\uFF1A${D(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function A$(){return{localeError:D$()}}const C$=()=>{const e={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function t(n){return e[n]??null}const r={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",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:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},o={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return n=>{switch(n.code){case"invalid_type":{const i=o[n.expected]??n.expected,a=X(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${n.expected}, \xE0m\u1ECD\u0300 a r\xED ${s}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${i}, \xE0m\u1ECD\u0300 a r\xED ${s}`}case"invalid_value":return n.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${G(n.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${D(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin??"iye"} ${a.verb} ${i}${n.maximum} ${a.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${n.maximum}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin} ${a.verb} ${i}${n.minimum} ${a.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${n.minimum}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${i.prefix}"`:i.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${i.suffix}"`:i.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${i.includes}"`:i.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${i.pattern}`:`A\u1E63\xEC\u1E63e: ${r[i.format]??n.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${n.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${D(n.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};function R$(){return{localeError:C$()}}var Sm=Object.freeze({__proto__:null,ar:Ky,az:Wy,be:Xy,bg:e_,ca:n_,cs:o_,da:a_,de:c_,el:l_,en:vm,eo:p_,es:h_,fa:v_,fi:__,fr:b_,frCA:S_,he:I_,hr:T_,hu:x_,hy:E_,id:j_,is:A_,it:R_,ja:M_,ka:Z_,kh:V_,km:_m,ko:q_,lt:H_,mk:G_,ms:Y_,nl:Q_,no:t$,ota:r$,pl:s$,ps:i$,pt:u$,ro:d$,ru:p$,sl:h$,sv:v$,ta:_$,th:b$,tr:S$,ua:I$,uk:km,ur:T$,uz:x$,vi:E$,yo:R$,zhCN:j$,zhTW:A$}),wm;const Im=Symbol("ZodOutput"),Om=Symbol("ZodInput");class Tm{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const o=r[0];return this._map.set(t,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const o={...this.get(r)??{}};delete o.id;const n={...o,...this._map.get(t)};return Object.keys(n).length?n:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function ea(){return new Tm}(wm=globalThis).__zod_globalRegistry??(wm.__zod_globalRegistry=ea());const ct=globalThis.__zod_globalRegistry;function Pm(e,t){return new e({type:"string",...E(t)})}function xm(e,t){return new e({type:"string",coerce:!0,...E(t)})}function ta(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...E(t)})}function Jr(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...E(t)})}function na(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...E(t)})}function ra(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...E(t)})}function oa(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...E(t)})}function ia(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...E(t)})}function Hr(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...E(t)})}function aa(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...E(t)})}function sa(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...E(t)})}function ca(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...E(t)})}function ua(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...E(t)})}function la(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...E(t)})}function da(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...E(t)})}function ma(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...E(t)})}function pa(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...E(t)})}function fa(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...E(t)})}function Nm(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...E(t)})}function ha(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...E(t)})}function ga(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...E(t)})}function va(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...E(t)})}function ya(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...E(t)})}function _a(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...E(t)})}function $a(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...E(t)})}const Em={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function zm(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...E(t)})}function jm(e,t){return new e({type:"string",format:"date",check:"string_format",...E(t)})}function Dm(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...E(t)})}function Am(e,t){return new e({type:"string",format:"duration",check:"string_format",...E(t)})}function Cm(e,t){return new e({type:"number",checks:[],...E(t)})}function Rm(e,t){return new e({type:"number",coerce:!0,checks:[],...E(t)})}function Um(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...E(t)})}function Mm(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...E(t)})}function Bm(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...E(t)})}function Zm(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...E(t)})}function Fm(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...E(t)})}function Vm(e,t){return new e({type:"boolean",...E(t)})}function Lm(e,t){return new e({type:"boolean",coerce:!0,...E(t)})}function qm(e,t){return new e({type:"bigint",...E(t)})}function Jm(e,t){return new e({type:"bigint",coerce:!0,...E(t)})}function Hm(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...E(t)})}function Km(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...E(t)})}function Gm(e,t){return new e({type:"symbol",...E(t)})}function Wm(e,t){return new e({type:"undefined",...E(t)})}function Ym(e,t){return new e({type:"null",...E(t)})}function Xm(e){return new e({type:"any"})}function Qm(e){return new e({type:"unknown"})}function ep(e,t){return new e({type:"never",...E(t)})}function tp(e,t){return new e({type:"void",...E(t)})}function np(e,t){return new e({type:"date",...E(t)})}function rp(e,t){return new e({type:"date",coerce:!0,...E(t)})}function op(e,t){return new e({type:"nan",...E(t)})}function zt(e,t){return new Fi({check:"less_than",...E(t),value:e,inclusive:!1})}function ut(e,t){return new Fi({check:"less_than",...E(t),value:e,inclusive:!0})}function jt(e,t){return new Vi({check:"greater_than",...E(t),value:e,inclusive:!1})}function Ge(e,t){return new Vi({check:"greater_than",...E(t),value:e,inclusive:!0})}function ba(e){return jt(0,e)}function ka(e){return zt(0,e)}function Sa(e){return ut(0,e)}function wa(e){return Ge(0,e)}function cn(e,t){return new Sl({check:"multiple_of",...E(t),value:e})}function un(e,t){return new Ol({check:"max_size",...E(t),maximum:e})}function Dt(e,t){return new Tl({check:"min_size",...E(t),minimum:e})}function Vn(e,t){return new Pl({check:"size_equals",...E(t),size:e})}function Ln(e,t){return new xl({check:"max_length",...E(t),maximum:e})}function Lt(e,t){return new Nl({check:"min_length",...E(t),minimum:e})}function qn(e,t){return new El({check:"length_equals",...E(t),length:e})}function Kr(e,t){return new zl({check:"string_format",format:"regex",...E(t),pattern:e})}function Gr(e){return new jl({check:"string_format",format:"lowercase",...E(e)})}function Wr(e){return new Dl({check:"string_format",format:"uppercase",...E(e)})}function Yr(e,t){return new Al({check:"string_format",format:"includes",...E(t),includes:e})}function Xr(e,t){return new Cl({check:"string_format",format:"starts_with",...E(t),prefix:e})}function Qr(e,t){return new Rl({check:"string_format",format:"ends_with",...E(t),suffix:e})}function Ia(e,t,r){return new Ml({check:"property",property:e,schema:t,...E(r)})}function eo(e,t){return new Bl({check:"mime_type",mime:e,...E(t)})}function Ot(e){return new Zl({check:"overwrite",tx:e})}function to(e){return Ot(t=>t.normalize(e))}function no(){return Ot(e=>e.trim())}function ro(){return Ot(e=>e.toLowerCase())}function oo(){return Ot(e=>e.toUpperCase())}function io(){return Ot(e=>bu(e))}function ip(e,t,r){return new e({type:"array",element:t,...E(r)})}function U$(e,t,r){return new e({type:"union",options:t,...E(r)})}function M$(e,t,r){return new e({type:"union",options:t,inclusive:!1,...E(r)})}function B$(e,t,r,o){return new e({type:"union",options:r,discriminator:t,...E(o)})}function Z$(e,t,r){return new e({type:"intersection",left:t,right:r})}function F$(e,t,r,o){const n=r instanceof ee,i=n?o:r,a=n?r:null;return new e({type:"tuple",items:t,rest:a,...E(i)})}function V$(e,t,r,o){return new e({type:"record",keyType:t,valueType:r,...E(o)})}function L$(e,t,r,o){return new e({type:"map",keyType:t,valueType:r,...E(o)})}function q$(e,t,r){return new e({type:"set",valueType:t,...E(r)})}function J$(e,t,r){const o=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new e({type:"enum",entries:o,...E(r)})}function H$(e,t,r){return new e({type:"enum",entries:t,...E(r)})}function K$(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...E(r)})}function ap(e,t){return new e({type:"file",...E(t)})}function G$(e,t){return new e({type:"transform",transform:t})}function W$(e,t){return new e({type:"optional",innerType:t})}function Y$(e,t){return new e({type:"nullable",innerType:t})}function X$(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():jr(r)}})}function Q$(e,t,r){return new e({type:"nonoptional",innerType:t,...E(r)})}function eb(e,t){return new e({type:"success",innerType:t})}function tb(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:()=>r})}function nb(e,t,r){return new e({type:"pipe",in:t,out:r})}function rb(e,t){return new e({type:"readonly",innerType:t})}function ob(e,t,r){return new e({type:"template_literal",parts:t,...E(r)})}function ib(e,t){return new e({type:"lazy",getter:t})}function ab(e,t){return new e({type:"promise",innerType:t})}function sp(e,t,r){const o=E(r);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:t,...o})}function cp(e,t,r){return new e({type:"custom",check:"custom",fn:t,...E(r)})}function up(e,t){const r=lp(o=>(o.addIssue=n=>{if(typeof n=="string")o.issues.push(on(n,o.value,r._zod.def));else{const i=n;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=o.value),i.inst??(i.inst=r),i.continue??(i.continue=!r._zod.def.abort),o.issues.push(on(i))}},e(o.value,o)),t);return r}function lp(e,t){const r=new Oe({check:"custom",...E(t)});return r._zod.check=e,r}function dp(e){const t=new Oe({check:"describe"});return t._zod.onattach=[r=>{const o=ct.get(r)??{};ct.add(r,{...o,description:e})}],t._zod.check=()=>{},t}function mp(e){const t=new Oe({check:"meta"});return t._zod.onattach=[r=>{const o=ct.get(r)??{};ct.add(r,{...o,...e})}],t._zod.check=()=>{},t}function pp(e,t){const r=E(t);let o=r.truthy??["true","1","yes","on","y","enabled"],n=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(o=o.map(m=>typeof m=="string"?m.toLowerCase():m),n=n.map(m=>typeof m=="string"?m.toLowerCase():m));const i=new Set(o),a=new Set(n),s=e.Codec??Qi,c=e.Boolean??Ji,u=e.String??Zn,l=new u({type:"string",error:r.error}),d=new c({type:"boolean",error:r.error}),p=new s({type:"pipe",in:l,out:d,transform:((m,f)=>{let _=m;return r.case!=="sensitive"&&(_=_.toLowerCase()),i.has(_)?!0:a.has(_)?!1:(f.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...a],input:f.value,inst:p,continue:!1}),{})}),reverseTransform:((m,f)=>m===!0?o[0]||"true":n[0]||"false"),error:r.error});return p}function Jn(e,t,r,o={}){const n=E(o),i={...E(o),check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:s=>r.test(s),...n};return r instanceof RegExp&&(i.pattern=r),new e(i)}function ln(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??ct,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function _e(e,t,r={path:[],schemaPath:[]}){var o;const n=e._zod.def,i=t.seen.get(e);if(i)return i.count++,r.schemaPath.includes(e)&&(i.cycle=r.path),i.schema;const a={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,a);const s=e._zod.toJSONSchema?.();if(s)a.schema=s;else{const l={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,l);else{const p=a.schema,m=t.processors[n.type];if(!m)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);m(e,t,p,l)}const d=e._zod.parent;d&&(a.ref||(a.ref=d),_e(d,t,l),t.seen.get(d).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(a.schema,c),t.io==="input"&&qe(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&"_prefault"in a.schema&&((o=a.schema).default??(o.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function dn(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=new Map;for(const a of e.seen.entries()){const s=e.metadataRegistry.get(a[0])?.id;if(s){const c=o.get(s);if(c&&c!==a[0])throw new Error(`Duplicate schema id "${s}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(s,a[0])}}const n=a=>{const s=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const d=e.external.registry.get(a[0])?.id,p=e.external.uri??(f=>f);if(d)return{ref:p(d)};const m=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=m,{defId:m,ref:`${p("__shared")}#/${s}/${m}`}}if(a[1]===r)return{ref:"#"};const u=`#/${s}/`,l=a[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:u+l}},i=a=>{if(a[1].schema.$ref)return;const s=a[1],{ref:c,defId:u}=n(a);s.def={...s.schema},u&&(s.defId=u);const l=s.schema;for(const d in l)delete l[d];l.$ref=c};if(e.cycles==="throw")for(const a of e.seen.entries()){const s=a[1];if(s.cycle)throw new Error(`Cycle detected: #/${s.cycle?.join("/")}/<root>
|
|
65
|
+
|
|
66
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const a of e.seen.entries()){const s=a[1];if(t===a[0]){i(a);continue}if(e.external){const u=e.external.registry.get(a[0])?.id;if(t!==a[0]&&u){i(a);continue}}if(e.metadataRegistry.get(a[0])?.id){i(a);continue}if(s.cycle){i(a);continue}if(s.count>1&&e.reused==="ref"){i(a);continue}}}function mn(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=s=>{const c=e.seen.get(s);if(c.ref===null)return;const u=c.def??c.schema,l={...u},d=c.ref;if(c.ref=null,d){o(d);const m=e.seen.get(d),f=m.schema;if(f.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(f)):Object.assign(u,f),Object.assign(u,l),s._zod.parent===d)for(const g in u)g==="$ref"||g==="allOf"||g in l||delete u[g];if(f.$ref&&m.def)for(const g in u)g==="$ref"||g==="allOf"||g in m.def&&JSON.stringify(u[g])===JSON.stringify(m.def[g])&&delete u[g]}const p=s._zod.parent;if(p&&p!==d){o(p);const m=e.seen.get(p);if(m?.schema.$ref&&(u.$ref=m.schema.$ref,m.def))for(const f in u)f==="$ref"||f==="allOf"||f in m.def&&JSON.stringify(u[f])===JSON.stringify(m.def[f])&&delete u[f]}e.override({zodSchema:s,jsonSchema:u,path:c.path??[]})};for(const s of[...e.seen.entries()].reverse())o(s[0]);const n={};if(e.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const s=e.external.registry.get(t)?.id;if(!s)throw new Error("Schema is missing an `id` property");n.$id=e.external.uri(s)}Object.assign(n,r.def??r.schema);const i=e.metadataRegistry.get(t)?.id;i!==void 0&&n.id===i&&delete n.id;const a=e.external?.defs??{};for(const s of e.seen.entries()){const c=s[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,a[c.defId]=c.def)}e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?n.$defs=a:n.definitions=a);try{const s=JSON.parse(JSON.stringify(n));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:Hn(t,"input",e.processors),output:Hn(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function qe(e,t){const r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return qe(o.element,r);if(o.type==="set")return qe(o.valueType,r);if(o.type==="lazy")return qe(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return qe(o.innerType,r);if(o.type==="intersection")return qe(o.left,r)||qe(o.right,r);if(o.type==="record"||o.type==="map")return qe(o.keyType,r)||qe(o.valueType,r);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:qe(o.in,r)||qe(o.out,r);if(o.type==="object"){for(const n in o.shape)if(qe(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(const n of o.options)if(qe(n,r))return!0;return!1}if(o.type==="tuple"){for(const n of o.items)if(qe(n,r))return!0;return!!(o.rest&&qe(o.rest,r))}return!1}const fp=(e,t={})=>r=>{const o=ln({...r,processors:t});return _e(e,o),dn(o,e),mn(o,e)},Hn=(e,t,r={})=>o=>{const{libraryOptions:n,target:i}=o??{},a=ln({...n??{},target:i,io:t,processors:r});return _e(e,a),dn(a,e),mn(a,e)},sb={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},hp=(e,t,r,o)=>{const n=r;n.type="string";const{minimum:i,maximum:a,format:s,patterns:c,contentEncoding:u}=e._zod.bag;if(typeof i=="number"&&(n.minLength=i),typeof a=="number"&&(n.maxLength=a),s&&(n.format=sb[s]??s,n.format===""&&delete n.format,s==="time"&&delete n.format),u&&(n.contentEncoding=u),c&&c.size>0){const l=[...c];l.length===1?n.pattern=l[0].source:l.length>1&&(n.allOf=[...l.map(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},gp=(e,t,r,o)=>{const n=r,{minimum:i,maximum:a,format:s,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:l}=e._zod.bag;typeof s=="string"&&s.includes("int")?n.type="integer":n.type="number";const d=typeof l=="number"&&l>=(i??Number.NEGATIVE_INFINITY),p=typeof u=="number"&&u<=(a??Number.POSITIVE_INFINITY),m=t.target==="draft-04"||t.target==="openapi-3.0";d?m?(n.minimum=l,n.exclusiveMinimum=!0):n.exclusiveMinimum=l:typeof i=="number"&&(n.minimum=i),p?m?(n.maximum=u,n.exclusiveMaximum=!0):n.exclusiveMaximum=u:typeof a=="number"&&(n.maximum=a),typeof c=="number"&&(n.multipleOf=c)},vp=(e,t,r,o)=>{r.type="boolean"},yp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},_p=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},$p=(e,t,r,o)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},bp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},kp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},Sp=(e,t,r,o)=>{r.not={}},wp=(e,t,r,o)=>{},Ip=(e,t,r,o)=>{},Op=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},Tp=(e,t,r,o)=>{const n=e._zod.def,i=wi(n.entries);i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),r.enum=i},Pp=(e,t,r,o)=>{const n=e._zod.def,i=[];for(const a of n.values)if(a===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(a))}else i.push(a);if(i.length!==0)if(i.length===1){const a=i[0];r.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[a]:r.const=a}else i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),i.every(a=>typeof a=="boolean")&&(r.type="boolean"),i.every(a=>a===null)&&(r.type="null"),r.enum=i},xp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},Np=(e,t,r,o)=>{const n=r,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=i.source},Ep=(e,t,r,o)=>{const n=r,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:s,mime:c}=e._zod.bag;a!==void 0&&(i.minLength=a),s!==void 0&&(i.maxLength=s),c?c.length===1?(i.contentMediaType=c[0],Object.assign(n,i)):(Object.assign(n,i),n.anyOf=c.map(u=>({contentMediaType:u}))):Object.assign(n,i)},zp=(e,t,r,o)=>{r.type="boolean"},jp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Dp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Ap=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Cp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Rp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Up=(e,t,r,o)=>{const n=r,i=e._zod.def,{minimum:a,maximum:s}=e._zod.bag;typeof a=="number"&&(n.minItems=a),typeof s=="number"&&(n.maxItems=s),n.type="array",n.items=_e(i.element,t,{...o,path:[...o.path,"items"]})},Mp=(e,t,r,o)=>{const n=r,i=e._zod.def;n.type="object",n.properties={};const a=i.shape;for(const u in a)n.properties[u]=_e(a[u],t,{...o,path:[...o.path,"properties",u]});const s=new Set(Object.keys(a)),c=new Set([...s].filter(u=>{const l=i.shape[u]._zod;return t.io==="input"?l.optin===void 0:l.optout===void 0}));c.size>0&&(n.required=Array.from(c)),i.catchall?._zod.def.type==="never"?n.additionalProperties=!1:i.catchall?i.catchall&&(n.additionalProperties=_e(i.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},Oa=(e,t,r,o)=>{const n=e._zod.def,i=n.inclusive===!1,a=n.options.map((s,c)=>_e(s,t,{...o,path:[...o.path,i?"oneOf":"anyOf",c]}));i?r.oneOf=a:r.anyOf=a},Bp=(e,t,r,o)=>{const n=e._zod.def,i=_e(n.left,t,{...o,path:[...o.path,"allOf",0]}),a=_e(n.right,t,{...o,path:[...o.path,"allOf",1]}),s=u=>"allOf"in u&&Object.keys(u).length===1,c=[...s(i)?i.allOf:[i],...s(a)?a.allOf:[a]];r.allOf=c},Zp=(e,t,r,o)=>{const n=r,i=e._zod.def;n.type="array";const a=t.target==="draft-2020-12"?"prefixItems":"items",s=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",c=i.items.map((p,m)=>_e(p,t,{...o,path:[...o.path,a,m]})),u=i.rest?_e(i.rest,t,{...o,path:[...o.path,s,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null;t.target==="draft-2020-12"?(n.prefixItems=c,u&&(n.items=u)):t.target==="openapi-3.0"?(n.items={anyOf:c},u&&n.items.anyOf.push(u),n.minItems=c.length,u||(n.maxItems=c.length)):(n.items=c,u&&(n.additionalItems=u));const{minimum:l,maximum:d}=e._zod.bag;typeof l=="number"&&(n.minItems=l),typeof d=="number"&&(n.maxItems=d)},Fp=(e,t,r,o)=>{const n=r,i=e._zod.def;n.type="object";const a=i.keyType,c=a._zod.bag?.patterns;if(i.mode==="loose"&&c&&c.size>0){const l=_e(i.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(const d of c)n.patternProperties[d.source]=l}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(n.propertyNames=_e(i.keyType,t,{...o,path:[...o.path,"propertyNames"]})),n.additionalProperties=_e(i.valueType,t,{...o,path:[...o.path,"additionalProperties"]});const u=a._zod.values;if(u){const l=[...u].filter(d=>typeof d=="string"||typeof d=="number");l.length>0&&(n.required=l)}},Vp=(e,t,r,o)=>{const n=e._zod.def,i=_e(n.innerType,t,o),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=n.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]},Lp=(e,t,r,o)=>{const n=e._zod.def;_e(n.innerType,t,o);const i=t.seen.get(e);i.ref=n.innerType},qp=(e,t,r,o)=>{const n=e._zod.def;_e(n.innerType,t,o);const i=t.seen.get(e);i.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},Jp=(e,t,r,o)=>{const n=e._zod.def;_e(n.innerType,t,o);const i=t.seen.get(e);i.ref=n.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},Hp=(e,t,r,o)=>{const n=e._zod.def;_e(n.innerType,t,o);const i=t.seen.get(e);i.ref=n.innerType;let a;try{a=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},Kp=(e,t,r,o)=>{const n=e._zod.def,i=n.in._zod.traits.has("$ZodTransform"),a=t.io==="input"?i?n.out:n.in:n.out;_e(a,t,o);const s=t.seen.get(e);s.ref=a},Gp=(e,t,r,o)=>{const n=e._zod.def;_e(n.innerType,t,o);const i=t.seen.get(e);i.ref=n.innerType,r.readOnly=!0},Wp=(e,t,r,o)=>{const n=e._zod.def;_e(n.innerType,t,o);const i=t.seen.get(e);i.ref=n.innerType},Ta=(e,t,r,o)=>{const n=e._zod.def;_e(n.innerType,t,o);const i=t.seen.get(e);i.ref=n.innerType},Yp=(e,t,r,o)=>{const n=e._zod.innerType;_e(n,t,o);const i=t.seen.get(e);i.ref=n},Pa={string:hp,number:gp,boolean:vp,bigint:yp,symbol:_p,null:$p,undefined:bp,void:kp,never:Sp,any:wp,unknown:Ip,date:Op,enum:Tp,literal:Pp,nan:xp,template_literal:Np,file:Ep,success:zp,custom:jp,function:Dp,transform:Ap,map:Cp,set:Rp,array:Up,object:Mp,union:Oa,intersection:Bp,tuple:Zp,record:Fp,nullable:Vp,nonoptional:Lp,default:qp,prefault:Jp,catch:Hp,pipe:Kp,readonly:Gp,promise:Wp,optional:Ta,lazy:Yp};function xa(e,t){if("_idmap"in e){const o=e,n=ln({...t,processors:Pa}),i={};for(const c of o._idmap.entries()){const[u,l]=c;_e(l,n)}const a={},s={registry:o,uri:t?.uri,defs:i};n.external=s;for(const c of o._idmap.entries()){const[u,l]=c;dn(n,l),a[u]=mn(n,l)}if(Object.keys(i).length>0){const c=n.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[c]:i}}return{schemas:a}}const r=ln({...t,processors:Pa});return _e(e,r),dn(r,e),mn(r,e)}class cb{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(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let r=t?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=ln({processors:Pa,target:r,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,r={path:[],schemaPath:[]}){return _e(t,this.ctx,r)}emit(t,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),dn(this.ctx,t);const o=mn(this.ctx,t),{"~standard":n,...i}=o;return i}}var ub=Object.freeze({__proto__:null}),lb=Object.freeze({__proto__:null,$ZodAny:kd,$ZodArray:Pd,$ZodAsyncError:Bt,$ZodBase64:ld,$ZodBase64URL:md,$ZodBigInt:Hi,$ZodBigIntFormat:yd,$ZodBoolean:Ji,$ZodCIDRv4:cd,$ZodCIDRv6:ud,$ZodCUID:Wl,$ZodCUID2:Yl,$ZodCatch:im,$ZodCheck:Oe,$ZodCheckBigIntFormat:Il,$ZodCheckEndsWith:Rl,$ZodCheckGreaterThan:Vi,$ZodCheckIncludes:Al,$ZodCheckLengthEquals:El,$ZodCheckLessThan:Fi,$ZodCheckLowerCase:jl,$ZodCheckMaxLength:xl,$ZodCheckMaxSize:Ol,$ZodCheckMimeType:Bl,$ZodCheckMinLength:Nl,$ZodCheckMinSize:Tl,$ZodCheckMultipleOf:Sl,$ZodCheckNumberFormat:wl,$ZodCheckOverwrite:Zl,$ZodCheckProperty:Ml,$ZodCheckRegex:zl,$ZodCheckSizeEquals:Pl,$ZodCheckStartsWith:Cl,$ZodCheckStringFormat:Bn,$ZodCheckUpperCase:Dl,$ZodCodec:Qi,$ZodCustom:fm,$ZodCustomStringFormat:gd,$ZodDate:Od,$ZodDefault:Qd,$ZodDiscriminatedUnion:Ad,$ZodE164:pd,$ZodEmail:Jl,$ZodEmoji:Kl,$ZodEncodeError:Nr,$ZodEnum:Jd,$ZodError:Ti,$ZodExactOptional:Yd,$ZodFile:Kd,$ZodFunction:dm,$ZodGUID:Ll,$ZodIPv4:id,$ZodIPv6:ad,$ZodISODate:nd,$ZodISODateTime:td,$ZodISODuration:od,$ZodISOTime:rd,$ZodIntersection:Cd,$ZodJWT:hd,$ZodKSUID:ed,$ZodLazy:pm,$ZodLiteral:Hd,$ZodMAC:sd,$ZodMap:Fd,$ZodNaN:am,$ZodNanoID:Gl,$ZodNever:wd,$ZodNonOptional:nm,$ZodNull:bd,$ZodNullable:Xd,$ZodNumber:qi,$ZodNumberFormat:vd,$ZodObject:Ki,$ZodObjectJIT:Ed,$ZodOptional:Yi,$ZodPipe:Xi,$ZodPrefault:tm,$ZodPreprocess:sm,$ZodPromise:mm,$ZodReadonly:cm,$ZodRealError:tt,$ZodRecord:Zd,$ZodRegistry:Tm,$ZodSet:Ld,$ZodString:Zn,$ZodStringFormat:$e,$ZodSuccess:om,$ZodSymbol:_d,$ZodTemplateLiteral:lm,$ZodTransform:Gd,$ZodTuple:Wi,$ZodType:ee,$ZodULID:Xl,$ZodURL:Hl,$ZodUUID:ql,$ZodUndefined:$d,$ZodUnion:Fr,$ZodUnknown:Sd,$ZodVoid:Id,$ZodXID:Ql,$ZodXor:Dd,$brand:yu,$constructor:S,$input:Om,$output:Im,Doc:Fl,JSONSchema:ub,JSONSchemaGenerator:cb,NEVER:vu,TimePrecision:Em,_any:Xm,_array:ip,_base64:va,_base64url:ya,_bigint:qm,_boolean:Vm,_catch:tb,_check:lp,_cidrv4:ha,_cidrv6:ga,_coercedBigint:Jm,_coercedBoolean:Lm,_coercedDate:rp,_coercedNumber:Rm,_coercedString:xm,_cuid:ca,_cuid2:ua,_custom:sp,_date:np,_decode:Ei,_decodeAsync:ji,_default:X$,_discriminatedUnion:B$,_e164:_a,_email:ta,_emoji:aa,_encode:Ni,_encodeAsync:zi,_endsWith:Qr,_enum:J$,_file:ap,_float32:Mm,_float64:Bm,_gt:jt,_gte:Ge,_guid:Jr,_includes:Yr,_int:Um,_int32:Zm,_int64:Hm,_intersection:Z$,_ipv4:pa,_ipv6:fa,_isoDate:jm,_isoDateTime:zm,_isoDuration:Am,_isoTime:Dm,_jwt:$a,_ksuid:ma,_lazy:ib,_length:qn,_literal:K$,_lowercase:Gr,_lt:zt,_lte:ut,_mac:Nm,_map:L$,_max:ut,_maxLength:Ln,_maxSize:un,_mime:eo,_min:Ge,_minLength:Lt,_minSize:Dt,_multipleOf:cn,_nan:op,_nanoid:sa,_nativeEnum:H$,_negative:ka,_never:ep,_nonnegative:wa,_nonoptional:Q$,_nonpositive:Sa,_normalize:to,_null:Ym,_nullable:Y$,_number:Cm,_optional:W$,_overwrite:Ot,_parse:Dn,_parseAsync:An,_pipe:nb,_positive:ba,_promise:ab,_property:Ia,_readonly:rb,_record:V$,_refine:cp,_regex:Kr,_safeDecode:Ai,_safeDecodeAsync:Ri,_safeEncode:Di,_safeEncodeAsync:Ci,_safeParse:Cn,_safeParseAsync:Rn,_set:q$,_size:Vn,_slugify:io,_startsWith:Xr,_string:Pm,_stringFormat:Jn,_stringbool:pp,_success:eb,_superRefine:up,_symbol:Gm,_templateLiteral:ob,_toLowerCase:ro,_toUpperCase:oo,_transform:G$,_trim:no,_tuple:F$,_uint32:Fm,_uint64:Km,_ulid:la,_undefined:Wm,_union:U$,_unknown:Qm,_uppercase:Wr,_url:Hr,_uuid:na,_uuidv4:ra,_uuidv6:oa,_uuidv7:ia,_void:tp,_xid:da,_xor:M$,clone:Qe,config:Ce,createStandardJSONSchemaMethod:Hn,createToJSONSchemaMethod:fp,decode:gy,decodeAsync:yy,describe:dp,encode:hy,encodeAsync:vy,extractDefs:dn,finalize:mn,flattenError:Pi,formatError:xi,globalConfig:En,globalRegistry:ct,initializeContext:ln,isValidBase64:Li,isValidBase64URL:dd,isValidJWT:fd,locales:Sm,meta:mp,parse:Rr,parseAsync:Ur,prettifyError:Zu,process:_e,regexes:Zi,registry:ea,safeDecode:$y,safeDecodeAsync:ky,safeEncode:_y,safeEncodeAsync:by,safeParse:Mr,safeParseAsync:Br,toDotPath:Bu,toJSONSchema:xa,treeifyError:Mu,util:Ru,version:Vl}),db=Object.freeze({__proto__:null,endsWith:Qr,gt:jt,gte:Ge,includes:Yr,length:qn,lowercase:Gr,lt:zt,lte:ut,maxLength:Ln,maxSize:un,mime:eo,minLength:Lt,minSize:Dt,multipleOf:cn,negative:ka,nonnegative:wa,nonpositive:Sa,normalize:to,overwrite:Ot,positive:ba,property:Ia,regex:Kr,size:Vn,slugify:io,startsWith:Xr,toLowerCase:ro,toUpperCase:oo,trim:no,uppercase:Wr});const Na=S("ZodISODateTime",(e,t)=>{td.init(e,t),be.init(e,t)});function Ea(e){return zm(Na,e)}const za=S("ZodISODate",(e,t)=>{nd.init(e,t),be.init(e,t)});function Xp(e){return jm(za,e)}const ja=S("ZodISOTime",(e,t)=>{rd.init(e,t),be.init(e,t)});function Qp(e){return Dm(ja,e)}const Da=S("ZodISODuration",(e,t)=>{od.init(e,t),be.init(e,t)});function ef(e){return Am(Da,e)}var tf=Object.freeze({__proto__:null,ZodISODate:za,ZodISODateTime:Na,ZodISODuration:Da,ZodISOTime:ja,date:Xp,datetime:Ea,duration:ef,time:Qp});const nf=(e,t)=>{Ti.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>xi(e,r)},flatten:{value:r=>Pi(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Er,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Er,2)}},isEmpty:{get(){return e.issues.length===0}}})},mb=S("ZodError",nf),nt=S("ZodError",nf,{Parent:Error}),rf=Dn(nt),of=An(nt),af=Cn(nt),sf=Rn(nt),cf=Ni(nt),uf=Ei(nt),lf=zi(nt),df=ji(nt),mf=Di(nt),pf=Ai(nt),ff=Ci(nt),hf=Ri(nt),gf=new WeakMap;function Kn(e,t,r){const o=Object.getPrototypeOf(e);let n=gf.get(o);if(n||(n=new Set,gf.set(o,n)),!n.has(t)){n.add(t);for(const i in r){const a=r[i];Object.defineProperty(o,i,{configurable:!0,enumerable:!1,get(){const s=a.bind(this);return Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:s}),s},set(s){Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:s})}})}}}const ne=S("ZodType",(e,t)=>(ee.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Hn(e,"input"),output:Hn(e,"output")}}),e.toJSONSchema=fp(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,o)=>rf(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>af(e,r,o),e.parseAsync=async(r,o)=>of(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>sf(e,r,o),e.spa=e.safeParseAsync,e.encode=(r,o)=>cf(e,r,o),e.decode=(r,o)=>uf(e,r,o),e.encodeAsync=async(r,o)=>lf(e,r,o),e.decodeAsync=async(r,o)=>df(e,r,o),e.safeEncode=(r,o)=>mf(e,r,o),e.safeDecode=(r,o)=>pf(e,r,o),e.safeEncodeAsync=async(r,o)=>ff(e,r,o),e.safeDecodeAsync=async(r,o)=>hf(e,r,o),Kn(e,"ZodType",{check(...r){const o=this.def;return this.clone(bt(o,{checks:[...o.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,o){return Qe(this,r,o)},brand(){return this},register(r,o){return r.add(this,o),this},refine(r,o){return this.check(bs(r,o))},superRefine(r,o){return this.check(ks(r,o))},overwrite(r){return this.check(Ot(r))},optional(){return Ie(this)},exactOptional(){return ts(this)},nullable(){return ir(this)},nullish(){return Ie(ir(this))},nonoptional(r){return ss(this,r)},array(){return ae(this)},or(r){return ke([this,r])},and(r){return rr(this,r)},transform(r){return zo(this,No(r))},default(r){return os(this,r)},prefault(r){return as(this,r)},catch(r){return ls(this,r)},pipe(r){return zo(this,r)},readonly(){return fs(this)},describe(r){const o=this.clone();return ct.add(o,{description:r}),o},meta(...r){if(r.length===0)return ct.get(this);const o=this.clone();return ct.add(o,r[0]),o},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(e,"description",{get(){return ct.get(e)?.description},configurable:!0}),e)),ao=S("_ZodString",(e,t)=>{Zn.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(o,n,i)=>hp(e,o,n);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,Kn(e,"_ZodString",{regex(...o){return this.check(Kr(...o))},includes(...o){return this.check(Yr(...o))},startsWith(...o){return this.check(Xr(...o))},endsWith(...o){return this.check(Qr(...o))},min(...o){return this.check(Lt(...o))},max(...o){return this.check(Ln(...o))},length(...o){return this.check(qn(...o))},nonempty(...o){return this.check(Lt(1,...o))},lowercase(o){return this.check(Gr(o))},uppercase(o){return this.check(Wr(o))},trim(){return this.check(no())},normalize(...o){return this.check(to(...o))},toLowerCase(){return this.check(ro())},toUpperCase(){return this.check(oo())},slugify(){return this.check(io())}})}),Gn=S("ZodString",(e,t)=>{Zn.init(e,t),ao.init(e,t),e.email=r=>e.check(ta(so,r)),e.url=r=>e.check(Hr(Yn,r)),e.jwt=r=>e.check($a(So,r)),e.emoji=r=>e.check(aa(co,r)),e.guid=r=>e.check(Jr(Wn,r)),e.uuid=r=>e.check(na(kt,r)),e.uuidv4=r=>e.check(ra(kt,r)),e.uuidv6=r=>e.check(oa(kt,r)),e.uuidv7=r=>e.check(ia(kt,r)),e.nanoid=r=>e.check(sa(uo,r)),e.guid=r=>e.check(Jr(Wn,r)),e.cuid=r=>e.check(ca(lo,r)),e.cuid2=r=>e.check(ua(mo,r)),e.ulid=r=>e.check(la(po,r)),e.base64=r=>e.check(va($o,r)),e.base64url=r=>e.check(ya(bo,r)),e.xid=r=>e.check(da(fo,r)),e.ksuid=r=>e.check(ma(ho,r)),e.ipv4=r=>e.check(pa(go,r)),e.ipv6=r=>e.check(fa(vo,r)),e.cidrv4=r=>e.check(ha(yo,r)),e.cidrv6=r=>e.check(ga(_o,r)),e.e164=r=>e.check(_a(ko,r)),e.datetime=r=>e.check(Ea(r)),e.date=r=>e.check(Xp(r)),e.time=r=>e.check(Qp(r)),e.duration=r=>e.check(ef(r))});function k(e){return Pm(Gn,e)}const be=S("ZodStringFormat",(e,t)=>{$e.init(e,t),ao.init(e,t)}),so=S("ZodEmail",(e,t)=>{Jl.init(e,t),be.init(e,t)});function vf(e){return ta(so,e)}const Wn=S("ZodGUID",(e,t)=>{Ll.init(e,t),be.init(e,t)});function yf(e){return Jr(Wn,e)}const kt=S("ZodUUID",(e,t)=>{ql.init(e,t),be.init(e,t)});function _f(e){return na(kt,e)}function $f(e){return ra(kt,e)}function bf(e){return oa(kt,e)}function kf(e){return ia(kt,e)}const Yn=S("ZodURL",(e,t)=>{Hl.init(e,t),be.init(e,t)});function Sf(e){return Hr(Yn,e)}function wf(e){return Hr(Yn,{protocol:Mi,hostname:al,...E(e)})}const co=S("ZodEmoji",(e,t)=>{Kl.init(e,t),be.init(e,t)});function If(e){return aa(co,e)}const uo=S("ZodNanoID",(e,t)=>{Gl.init(e,t),be.init(e,t)});function Of(e){return sa(uo,e)}const lo=S("ZodCUID",(e,t)=>{Wl.init(e,t),be.init(e,t)});function Tf(e){return ca(lo,e)}const mo=S("ZodCUID2",(e,t)=>{Yl.init(e,t),be.init(e,t)});function Pf(e){return ua(mo,e)}const po=S("ZodULID",(e,t)=>{Xl.init(e,t),be.init(e,t)});function xf(e){return la(po,e)}const fo=S("ZodXID",(e,t)=>{Ql.init(e,t),be.init(e,t)});function Nf(e){return da(fo,e)}const ho=S("ZodKSUID",(e,t)=>{ed.init(e,t),be.init(e,t)});function Ef(e){return ma(ho,e)}const go=S("ZodIPv4",(e,t)=>{id.init(e,t),be.init(e,t)});function zf(e){return pa(go,e)}const Aa=S("ZodMAC",(e,t)=>{sd.init(e,t),be.init(e,t)});function jf(e){return Nm(Aa,e)}const vo=S("ZodIPv6",(e,t)=>{ad.init(e,t),be.init(e,t)});function Df(e){return fa(vo,e)}const yo=S("ZodCIDRv4",(e,t)=>{cd.init(e,t),be.init(e,t)});function Af(e){return ha(yo,e)}const _o=S("ZodCIDRv6",(e,t)=>{ud.init(e,t),be.init(e,t)});function Cf(e){return ga(_o,e)}const $o=S("ZodBase64",(e,t)=>{ld.init(e,t),be.init(e,t)});function Rf(e){return va($o,e)}const bo=S("ZodBase64URL",(e,t)=>{md.init(e,t),be.init(e,t)});function Uf(e){return ya(bo,e)}const ko=S("ZodE164",(e,t)=>{pd.init(e,t),be.init(e,t)});function Mf(e){return _a(ko,e)}const So=S("ZodJWT",(e,t)=>{hd.init(e,t),be.init(e,t)});function Bf(e){return $a(So,e)}const pn=S("ZodCustomStringFormat",(e,t)=>{gd.init(e,t),be.init(e,t)});function Zf(e,t,r={}){return Jn(pn,e,t,r)}function Ff(e){return Jn(pn,"hostname",il,e)}function Vf(e){return Jn(pn,"hex",bl,e)}function Lf(e,t){const r=t?.enc??"hex",o=`${e}_${r}`,n=Zi[o];if(!n)throw new Error(`Unrecognized hash format: ${o}`);return Jn(pn,o,n,t)}const Xn=S("ZodNumber",(e,t)=>{qi.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(o,n,i)=>gp(e,o,n),Kn(e,"ZodNumber",{gt(o,n){return this.check(jt(o,n))},gte(o,n){return this.check(Ge(o,n))},min(o,n){return this.check(Ge(o,n))},lt(o,n){return this.check(zt(o,n))},lte(o,n){return this.check(ut(o,n))},max(o,n){return this.check(ut(o,n))},int(o){return this.check(wo(o))},safe(o){return this.check(wo(o))},positive(o){return this.check(jt(0,o))},nonnegative(o){return this.check(Ge(0,o))},negative(o){return this.check(zt(0,o))},nonpositive(o){return this.check(ut(0,o))},multipleOf(o,n){return this.check(cn(o,n))},step(o,n){return this.check(cn(o,n))},finite(){return this}});const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function ie(e){return Cm(Xn,e)}const qt=S("ZodNumberFormat",(e,t)=>{vd.init(e,t),Xn.init(e,t)});function wo(e){return Um(qt,e)}function qf(e){return Mm(qt,e)}function Jf(e){return Bm(qt,e)}function Hf(e){return Zm(qt,e)}function Kf(e){return Fm(qt,e)}const Qn=S("ZodBoolean",(e,t)=>{Ji.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>vp(e,r,o)});function Ne(e){return Vm(Qn,e)}const er=S("ZodBigInt",(e,t)=>{Hi.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(o,n,i)=>yp(e,o),e.gte=(o,n)=>e.check(Ge(o,n)),e.min=(o,n)=>e.check(Ge(o,n)),e.gt=(o,n)=>e.check(jt(o,n)),e.gte=(o,n)=>e.check(Ge(o,n)),e.min=(o,n)=>e.check(Ge(o,n)),e.lt=(o,n)=>e.check(zt(o,n)),e.lte=(o,n)=>e.check(ut(o,n)),e.max=(o,n)=>e.check(ut(o,n)),e.positive=o=>e.check(jt(BigInt(0),o)),e.negative=o=>e.check(zt(BigInt(0),o)),e.nonpositive=o=>e.check(ut(BigInt(0),o)),e.nonnegative=o=>e.check(Ge(BigInt(0),o)),e.multipleOf=(o,n)=>e.check(cn(o,n));const r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});function Gf(e){return qm(er,e)}const Io=S("ZodBigIntFormat",(e,t)=>{yd.init(e,t),er.init(e,t)});function Wf(e){return Hm(Io,e)}function Yf(e){return Km(Io,e)}const Ca=S("ZodSymbol",(e,t)=>{_d.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>_p(e,r)});function Xf(e){return Gm(Ca,e)}const Ra=S("ZodUndefined",(e,t)=>{$d.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>bp(e,r)});function Qf(e){return Wm(Ra,e)}const Ua=S("ZodNull",(e,t)=>{bd.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>$p(e,r,o)});function Oo(e){return Ym(Ua,e)}const Ma=S("ZodAny",(e,t)=>{kd.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>wp()});function eh(){return Xm(Ma)}const Ba=S("ZodUnknown",(e,t)=>{Sd.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ip()});function ge(){return Qm(Ba)}const Za=S("ZodNever",(e,t)=>{wd.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Sp(e,r,o)});function To(e){return ep(Za,e)}const Fa=S("ZodVoid",(e,t)=>{Id.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>kp(e,r)});function th(e){return tp(Fa,e)}const Po=S("ZodDate",(e,t)=>{Od.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Op(e,o),e.min=(o,n)=>e.check(Ge(o,n)),e.max=(o,n)=>e.check(ut(o,n));const r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function nh(e){return np(Po,e)}const Va=S("ZodArray",(e,t)=>{Pd.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Up(e,r,o,n),e.element=t.element,Kn(e,"ZodArray",{min(r,o){return this.check(Lt(r,o))},nonempty(r){return this.check(Lt(1,r))},max(r,o){return this.check(Ln(r,o))},length(r,o){return this.check(qn(r,o))},unwrap(){return this.element}})});function ae(e,t){return ip(Va,e,t)}function rh(e){const t=e._zod.def.shape;return Re(Object.keys(t))}const tr=S("ZodObject",(e,t)=>{Ed.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Mp(e,r,o,n),oe(e,"shape",()=>t.shape),Kn(e,"ZodObject",{keyof(){return Re(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:ge()})},loose(){return this.clone({...this._zod.def,catchall:ge()})},strict(){return this.clone({...this._zod.def,catchall:To()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return xu(this,r)},safeExtend(r){return Nu(this,r)},merge(r){return Eu(this,r)},pick(r){return Tu(this,r)},omit(r){return Pu(this,r)},partial(...r){return zu(or,this,r[0])},required(...r){return ju(Eo,this,r[0])}})});function U(e,t){const r={type:"object",shape:e??{},...E(t)};return new tr(r)}function oh(e,t){return new tr({type:"object",shape:e,catchall:To(),...E(t)})}function Fe(e,t){return new tr({type:"object",shape:e,catchall:ge(),...E(t)})}const nr=S("ZodUnion",(e,t)=>{Fr.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Oa(e,r,o,n),e.options=t.options});function ke(e,t){return new nr({type:"union",options:e,...E(t)})}const La=S("ZodXor",(e,t)=>{nr.init(e,t),Dd.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Oa(e,r,o,n),e.options=t.options});function ih(e,t){return new La({type:"union",options:e,inclusive:!1,...E(t)})}const qa=S("ZodDiscriminatedUnion",(e,t)=>{nr.init(e,t),Ad.init(e,t)});function xo(e,t,r){return new qa({type:"union",options:t,discriminator:e,...E(r)})}const Ja=S("ZodIntersection",(e,t)=>{Cd.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Bp(e,r,o,n)});function rr(e,t){return new Ja({type:"intersection",left:e,right:t})}const Ha=S("ZodTuple",(e,t)=>{Wi.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Zp(e,r,o,n),e.rest=r=>e.clone({...e._zod.def,rest:r})});function Ka(e,t,r){const o=t instanceof ee,n=o?r:t,i=o?t:null;return new Ha({type:"tuple",items:e,rest:i,...E(n)})}const fn=S("ZodRecord",(e,t)=>{Zd.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Fp(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});function fe(e,t,r){return!t||!t._zod?new fn({type:"record",keyType:k(),valueType:e,...E(t)}):new fn({type:"record",keyType:e,valueType:t,...E(r)})}function ah(e,t,r){const o=Qe(e);return o._zod.values=void 0,new fn({type:"record",keyType:o,valueType:t,...E(r)})}function sh(e,t,r){return new fn({type:"record",keyType:e,valueType:t,mode:"loose",...E(r)})}const Ga=S("ZodMap",(e,t)=>{Fd.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Cp(e,r),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(Dt(...r)),e.nonempty=r=>e.check(Dt(1,r)),e.max=(...r)=>e.check(un(...r)),e.size=(...r)=>e.check(Vn(...r))});function ch(e,t,r){return new Ga({type:"map",keyType:e,valueType:t,...E(r)})}const Wa=S("ZodSet",(e,t)=>{Ld.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Rp(e,r),e.min=(...r)=>e.check(Dt(...r)),e.nonempty=r=>e.check(Dt(1,r)),e.max=(...r)=>e.check(un(...r)),e.size=(...r)=>e.check(Vn(...r))});function uh(e,t){return new Wa({type:"set",valueType:e,...E(t)})}const hn=S("ZodEnum",(e,t)=>{Jd.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Tp(e,o,n),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{const i={};for(const a of o)if(r.has(a))i[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new hn({...t,checks:[],...E(n),entries:i})},e.exclude=(o,n)=>{const i={...t.entries};for(const a of o)if(r.has(a))delete i[a];else throw new Error(`Key ${a} not found in enum`);return new hn({...t,checks:[],...E(n),entries:i})}});function Re(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new hn({type:"enum",entries:r,...E(t)})}function lh(e,t){return new hn({type:"enum",entries:e,...E(t)})}const Ya=S("ZodLiteral",(e,t)=>{Hd.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Pp(e,r,o),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function V(e,t){return new Ya({type:"literal",values:Array.isArray(e)?e:[e],...E(t)})}const Xa=S("ZodFile",(e,t)=>{Kd.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ep(e,r,o),e.min=(r,o)=>e.check(Dt(r,o)),e.max=(r,o)=>e.check(un(r,o)),e.mime=(r,o)=>e.check(eo(Array.isArray(r)?r:[r],o))});function dh(e){return ap(Xa,e)}const Qa=S("ZodTransform",(e,t)=>{Gd.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ap(e,r),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Nr(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(on(i,r.value,t));else{const a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),r.issues.push(on(a))}};const n=t.transform(r.value,r);return n instanceof Promise?n.then(i=>(r.value=i,r.fallback=!0,r)):(r.value=n,r.fallback=!0,r)}});function No(e){return new Qa({type:"transform",transform:e})}const or=S("ZodOptional",(e,t)=>{Yi.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ta(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Ie(e){return new or({type:"optional",innerType:e})}const es=S("ZodExactOptional",(e,t)=>{Yd.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ta(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function ts(e){return new es({type:"optional",innerType:e})}const ns=S("ZodNullable",(e,t)=>{Xd.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Vp(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function ir(e){return new ns({type:"nullable",innerType:e})}function mh(e){return Ie(ir(e))}const rs=S("ZodDefault",(e,t)=>{Qd.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>qp(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function os(e,t){return new rs({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():jr(t)}})}const is=S("ZodPrefault",(e,t)=>{tm.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Jp(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function as(e,t){return new is({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():jr(t)}})}const Eo=S("ZodNonOptional",(e,t)=>{nm.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Lp(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function ss(e,t){return new Eo({type:"nonoptional",innerType:e,...E(t)})}const cs=S("ZodSuccess",(e,t)=>{om.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>zp(e,r,o),e.unwrap=()=>e._zod.def.innerType});function ph(e){return new cs({type:"success",innerType:e})}const us=S("ZodCatch",(e,t)=>{im.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Hp(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function ls(e,t){return new us({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const ds=S("ZodNaN",(e,t)=>{am.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>xp(e,r)});function fh(e){return op(ds,e)}const ar=S("ZodPipe",(e,t)=>{Xi.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Kp(e,r,o,n),e.in=t.in,e.out=t.out});function zo(e,t){return new ar({type:"pipe",in:e,out:t})}const sr=S("ZodCodec",(e,t)=>{ar.init(e,t),Qi.init(e,t)});function hh(e,t,r){return new sr({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}function gh(e){const t=e._zod.def;return new sr({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}const ms=S("ZodPreprocess",(e,t)=>{ar.init(e,t),sm.init(e,t)}),ps=S("ZodReadonly",(e,t)=>{cm.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Gp(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function fs(e){return new ps({type:"readonly",innerType:e})}const hs=S("ZodTemplateLiteral",(e,t)=>{lm.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Np(e,r,o)});function vh(e,t){return new hs({type:"template_literal",parts:e,...E(t)})}const gs=S("ZodLazy",(e,t)=>{pm.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Yp(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});function vs(e){return new gs({type:"lazy",getter:e})}const ys=S("ZodPromise",(e,t)=>{mm.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Wp(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function yh(e){return new ys({type:"promise",innerType:e})}const _s=S("ZodFunction",(e,t)=>{dm.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Dp(e,r)});function jo(e){return new _s({type:"function",input:Array.isArray(e?.input)?Ka(e?.input):e?.input??ae(ge()),output:e?.output??ge()})}const cr=S("ZodCustom",(e,t)=>{fm.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>jp(e,r)});function _h(e){const t=new Oe({check:"custom"});return t._zod.check=e,t}function $s(e,t){return sp(cr,e??(()=>!0),t)}function bs(e,t={}){return cp(cr,e,t)}function ks(e,t){return up(e,t)}const $h=dp,bh=mp;function kh(e,t={}){const r=new cr({type:"custom",check:"custom",fn:o=>o instanceof e,abort:!0,...E(t)});return r._zod.bag.Class=e,r._zod.check=o=>{o.value instanceof e||o.issues.push({code:"invalid_type",expected:e.name,input:o.value,inst:r,path:[...r._zod.def.path??[]]})},r}const Sh=(...e)=>pp({Codec:sr,Boolean:Qn,String:Gn},...e);function wh(e){const t=vs(()=>ke([k(e),ie(),Ne(),Oo(),ae(t),fe(k(),t)]));return t}function Do(e,t){return new ms({type:"pipe",in:No(e),out:t})}var pb=Object.freeze({__proto__:null,ZodAny:Ma,ZodArray:Va,ZodBase64:$o,ZodBase64URL:bo,ZodBigInt:er,ZodBigIntFormat:Io,ZodBoolean:Qn,ZodCIDRv4:yo,ZodCIDRv6:_o,ZodCUID:lo,ZodCUID2:mo,ZodCatch:us,ZodCodec:sr,ZodCustom:cr,ZodCustomStringFormat:pn,ZodDate:Po,ZodDefault:rs,ZodDiscriminatedUnion:qa,ZodE164:ko,ZodEmail:so,ZodEmoji:co,ZodEnum:hn,ZodExactOptional:es,ZodFile:Xa,ZodFunction:_s,ZodGUID:Wn,ZodIPv4:go,ZodIPv6:vo,ZodIntersection:Ja,ZodJWT:So,ZodKSUID:ho,ZodLazy:gs,ZodLiteral:Ya,ZodMAC:Aa,ZodMap:Ga,ZodNaN:ds,ZodNanoID:uo,ZodNever:Za,ZodNonOptional:Eo,ZodNull:Ua,ZodNullable:ns,ZodNumber:Xn,ZodNumberFormat:qt,ZodObject:tr,ZodOptional:or,ZodPipe:ar,ZodPrefault:is,ZodPreprocess:ms,ZodPromise:ys,ZodReadonly:ps,ZodRecord:fn,ZodSet:Wa,ZodString:Gn,ZodStringFormat:be,ZodSuccess:cs,ZodSymbol:Ca,ZodTemplateLiteral:hs,ZodTransform:Qa,ZodTuple:Ha,ZodType:ne,ZodULID:po,ZodURL:Yn,ZodUUID:kt,ZodUndefined:Ra,ZodUnion:nr,ZodUnknown:Ba,ZodVoid:Fa,ZodXID:fo,ZodXor:La,_ZodString:ao,_default:os,_function:jo,any:eh,array:ae,base64:Rf,base64url:Uf,bigint:Gf,boolean:Ne,catch:ls,check:_h,cidrv4:Af,cidrv6:Cf,codec:hh,cuid:Tf,cuid2:Pf,custom:$s,date:nh,describe:$h,discriminatedUnion:xo,e164:Mf,email:vf,emoji:If,enum:Re,exactOptional:ts,file:dh,float32:qf,float64:Jf,function:jo,guid:yf,hash:Lf,hex:Vf,hostname:Ff,httpUrl:wf,instanceof:kh,int:wo,int32:Hf,int64:Wf,intersection:rr,invertCodec:gh,ipv4:zf,ipv6:Df,json:wh,jwt:Bf,keyof:rh,ksuid:Ef,lazy:vs,literal:V,looseObject:Fe,looseRecord:sh,mac:jf,map:ch,meta:bh,nan:fh,nanoid:Of,nativeEnum:lh,never:To,nonoptional:ss,null:Oo,nullable:ir,nullish:mh,number:ie,object:U,optional:Ie,partialRecord:ah,pipe:zo,prefault:as,preprocess:Do,promise:yh,readonly:fs,record:fe,refine:bs,set:uh,strictObject:oh,string:k,stringFormat:Zf,stringbool:Sh,success:ph,superRefine:ks,symbol:Xf,templateLiteral:vh,transform:No,tuple:Ka,uint32:Kf,uint64:Yf,ulid:xf,undefined:Qf,union:ke,unknown:ge,url:Sf,uuid:_f,uuidv4:$f,uuidv6:bf,uuidv7:kf,void:th,xid:Nf,xor:ih});const fb={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 hb(e){Ce({customError:e})}function gb(){return Ce().customError}var te;te||(te={});const R={...pb,...db,iso:tf},vb=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 yb(e,t){const r=e.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function _b(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");const r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;const o=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===o){const n=r[1];if(!n||!t.defs[n])throw new Error(`Reference not found: ${e}`);return t.defs[n]}throw new Error(`Reference not found: ${e}`)}function Ih(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return R.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){const n=e.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return R.lazy(()=>{if(!t.refs.has(n))throw new Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);const i=_b(n,t),a=Ve(i,t);return t.refs.set(n,a),t.processing.delete(n),a}if(e.enum!==void 0){const n=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&n.length===1&&n[0]===null)return R.null();if(n.length===0)return R.never();if(n.length===1)return R.literal(n[0]);if(n.every(a=>typeof a=="string"))return R.enum(n);const i=n.map(a=>R.literal(a));return i.length<2?i[0]:R.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return R.literal(e.const);const r=e.type;if(Array.isArray(r)){const n=r.map(i=>{const a={...e,type:i};return Ih(a,t)});return n.length===0?R.never():n.length===1?n[0]:R.union(n)}if(!r)return R.any();let o;switch(r){case"string":{let n=R.string();if(e.format){const i=e.format;i==="email"?n=n.check(R.email()):i==="uri"||i==="uri-reference"?n=n.check(R.url()):i==="uuid"||i==="guid"?n=n.check(R.uuid()):i==="date-time"?n=n.check(R.iso.datetime()):i==="date"?n=n.check(R.iso.date()):i==="time"?n=n.check(R.iso.time()):i==="duration"?n=n.check(R.iso.duration()):i==="ipv4"?n=n.check(R.ipv4()):i==="ipv6"?n=n.check(R.ipv6()):i==="mac"?n=n.check(R.mac()):i==="cidr"?n=n.check(R.cidrv4()):i==="cidr-v6"?n=n.check(R.cidrv6()):i==="base64"?n=n.check(R.base64()):i==="base64url"?n=n.check(R.base64url()):i==="e164"?n=n.check(R.e164()):i==="jwt"?n=n.check(R.jwt()):i==="emoji"?n=n.check(R.emoji()):i==="nanoid"?n=n.check(R.nanoid()):i==="cuid"?n=n.check(R.cuid()):i==="cuid2"?n=n.check(R.cuid2()):i==="ulid"?n=n.check(R.ulid()):i==="xid"?n=n.check(R.xid()):i==="ksuid"&&(n=n.check(R.ksuid()))}typeof e.minLength=="number"&&(n=n.min(e.minLength)),typeof e.maxLength=="number"&&(n=n.max(e.maxLength)),e.pattern&&(n=n.regex(new RegExp(e.pattern))),o=n;break}case"number":case"integer":{let n=r==="integer"?R.number().int():R.number();typeof e.minimum=="number"&&(n=n.min(e.minimum)),typeof e.maximum=="number"&&(n=n.max(e.maximum)),typeof e.exclusiveMinimum=="number"?n=n.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(n=n.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?n=n.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(n=n.lt(e.maximum)),typeof e.multipleOf=="number"&&(n=n.multipleOf(e.multipleOf)),o=n;break}case"boolean":{o=R.boolean();break}case"null":{o=R.null();break}case"object":{const n={},i=e.properties||{},a=new Set(e.required||[]);for(const[c,u]of Object.entries(i)){const l=Ve(u,t);n[c]=a.has(c)?l:l.optional()}if(e.propertyNames){const c=Ve(e.propertyNames,t),u=e.additionalProperties&&typeof e.additionalProperties=="object"?Ve(e.additionalProperties,t):R.any();if(Object.keys(n).length===0){o=R.record(c,u);break}const l=R.object(n).passthrough(),d=R.looseRecord(c,u);o=R.intersection(l,d);break}if(e.patternProperties){const c=e.patternProperties,u=Object.keys(c),l=[];for(const p of u){const m=Ve(c[p],t),f=R.string().regex(new RegExp(p));l.push(R.looseRecord(f,m))}const d=[];if(Object.keys(n).length>0&&d.push(R.object(n).passthrough()),d.push(...l),d.length===0)o=R.object({}).passthrough();else if(d.length===1)o=d[0];else{let p=R.intersection(d[0],d[1]);for(let m=2;m<d.length;m++)p=R.intersection(p,d[m]);o=p}break}const s=R.object(n);e.additionalProperties===!1?o=s.strict():typeof e.additionalProperties=="object"?o=s.catchall(Ve(e.additionalProperties,t)):o=s.passthrough();break}case"array":{const n=e.prefixItems,i=e.items;if(n&&Array.isArray(n)){const a=n.map(c=>Ve(c,t)),s=i&&typeof i=="object"&&!Array.isArray(i)?Ve(i,t):void 0;s?o=R.tuple(a).rest(s):o=R.tuple(a),typeof e.minItems=="number"&&(o=o.check(R.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(R.maxLength(e.maxItems)))}else if(Array.isArray(i)){const a=i.map(c=>Ve(c,t)),s=e.additionalItems&&typeof e.additionalItems=="object"?Ve(e.additionalItems,t):void 0;s?o=R.tuple(a).rest(s):o=R.tuple(a),typeof e.minItems=="number"&&(o=o.check(R.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(R.maxLength(e.maxItems)))}else if(i!==void 0){const a=Ve(i,t);let s=R.array(a);typeof e.minItems=="number"&&(s=s.min(e.minItems)),typeof e.maxItems=="number"&&(s=s.max(e.maxItems)),o=s}else o=R.array(R.any());break}default:throw new Error(`Unsupported type: ${r}`)}return o}function Ve(e,t){if(typeof e=="boolean")return e?R.any():R.never();let r=Ih(e,t);const o=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){const s=e.anyOf.map(u=>Ve(u,t)),c=R.union(s);r=o?R.intersection(r,c):c}if(e.oneOf&&Array.isArray(e.oneOf)){const s=e.oneOf.map(u=>Ve(u,t)),c=R.xor(s);r=o?R.intersection(r,c):c}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=o?r:R.any();else{let s=o?r:Ve(e.allOf[0],t);const c=o?0:1;for(let u=c;u<e.allOf.length;u++)s=R.intersection(s,Ve(e.allOf[u],t));r=s}e.nullable===!0&&t.version==="openapi-3.0"&&(r=R.nullable(r)),e.readOnly===!0&&(r=R.readonly(r)),e.default!==void 0&&(r=r.default(e.default));const n={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(const s of i)s in e&&(n[s]=e[s]);const a=["contentEncoding","contentMediaType","contentSchema"];for(const s of a)s in e&&(n[s]=e[s]);for(const s of Object.keys(e))vb.has(s)||(n[s]=e[s]);return Object.keys(n).length>0&&t.registry.add(r,n),e.description&&(r=r.describe(e.description)),r}function $b(e,t){if(typeof e=="boolean")return e?R.any():R.never();let r;try{r=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}const o=yb(r,t?.defaultTarget),n=r.$defs||r.definitions||{},i={version:o,defs:n,refs:new Map,processing:new Set,rootSchema:r,registry:t?.registry??ct};return Ve(r,i)}function bb(e){return xm(Gn,e)}function kb(e){return Rm(Xn,e)}function Sb(e){return Lm(Qn,e)}function wb(e){return Jm(er,e)}function Ib(e){return rp(Po,e)}var Ob=Object.freeze({__proto__:null,bigint:wb,boolean:Sb,date:Ib,number:kb,string:bb});Ce(vm());var Ao=Object.freeze({__proto__:null,$brand:yu,$input:Om,$output:Im,NEVER:vu,TimePrecision:Em,ZodAny:Ma,ZodArray:Va,ZodBase64:$o,ZodBase64URL:bo,ZodBigInt:er,ZodBigIntFormat:Io,ZodBoolean:Qn,ZodCIDRv4:yo,ZodCIDRv6:_o,ZodCUID:lo,ZodCUID2:mo,ZodCatch:us,ZodCodec:sr,ZodCustom:cr,ZodCustomStringFormat:pn,ZodDate:Po,ZodDefault:rs,ZodDiscriminatedUnion:qa,ZodE164:ko,ZodEmail:so,ZodEmoji:co,ZodEnum:hn,ZodError:mb,ZodExactOptional:es,ZodFile:Xa,get ZodFirstPartyTypeKind(){return te},ZodFunction:_s,ZodGUID:Wn,ZodIPv4:go,ZodIPv6:vo,ZodISODate:za,ZodISODateTime:Na,ZodISODuration:Da,ZodISOTime:ja,ZodIntersection:Ja,ZodIssueCode:fb,ZodJWT:So,ZodKSUID:ho,ZodLazy:gs,ZodLiteral:Ya,ZodMAC:Aa,ZodMap:Ga,ZodNaN:ds,ZodNanoID:uo,ZodNever:Za,ZodNonOptional:Eo,ZodNull:Ua,ZodNullable:ns,ZodNumber:Xn,ZodNumberFormat:qt,ZodObject:tr,ZodOptional:or,ZodPipe:ar,ZodPrefault:is,ZodPreprocess:ms,ZodPromise:ys,ZodReadonly:ps,ZodRealError:nt,ZodRecord:fn,ZodSet:Wa,ZodString:Gn,ZodStringFormat:be,ZodSuccess:cs,ZodSymbol:Ca,ZodTemplateLiteral:hs,ZodTransform:Qa,ZodTuple:Ha,ZodType:ne,ZodULID:po,ZodURL:Yn,ZodUUID:kt,ZodUndefined:Ra,ZodUnion:nr,ZodUnknown:Ba,ZodVoid:Fa,ZodXID:fo,ZodXor:La,_ZodString:ao,_default:os,_function:jo,any:eh,array:ae,base64:Rf,base64url:Uf,bigint:Gf,boolean:Ne,catch:ls,check:_h,cidrv4:Af,cidrv6:Cf,clone:Qe,codec:hh,coerce:Ob,config:Ce,core:lb,cuid:Tf,cuid2:Pf,custom:$s,date:nh,decode:uf,decodeAsync:df,describe:$h,discriminatedUnion:xo,e164:Mf,email:vf,emoji:If,encode:cf,encodeAsync:lf,endsWith:Qr,enum:Re,exactOptional:ts,file:dh,flattenError:Pi,float32:qf,float64:Jf,formatError:xi,fromJSONSchema:$b,function:jo,getErrorMap:gb,globalRegistry:ct,gt:jt,gte:Ge,guid:yf,hash:Lf,hex:Vf,hostname:Ff,httpUrl:wf,includes:Yr,instanceof:kh,int:wo,int32:Hf,int64:Wf,intersection:rr,invertCodec:gh,ipv4:zf,ipv6:Df,iso:tf,json:wh,jwt:Bf,keyof:rh,ksuid:Ef,lazy:vs,length:qn,literal:V,locales:Sm,looseObject:Fe,looseRecord:sh,lowercase:Gr,lt:zt,lte:ut,mac:jf,map:ch,maxLength:Ln,maxSize:un,meta:bh,mime:eo,minLength:Lt,minSize:Dt,multipleOf:cn,nan:fh,nanoid:Of,nativeEnum:lh,negative:ka,never:To,nonnegative:wa,nonoptional:ss,nonpositive:Sa,normalize:to,null:Oo,nullable:ir,nullish:mh,number:ie,object:U,optional:Ie,overwrite:Ot,parse:rf,parseAsync:of,partialRecord:ah,pipe:zo,positive:ba,prefault:as,preprocess:Do,prettifyError:Zu,promise:yh,property:Ia,readonly:fs,record:fe,refine:bs,regex:Kr,regexes:Zi,registry:ea,safeDecode:pf,safeDecodeAsync:hf,safeEncode:mf,safeEncodeAsync:ff,safeParse:af,safeParseAsync:sf,set:uh,setErrorMap:hb,size:Vn,slugify:io,startsWith:Xr,strictObject:oh,string:k,stringFormat:Zf,stringbool:Sh,success:ph,superRefine:ks,symbol:Xf,templateLiteral:vh,toJSONSchema:xa,toLowerCase:ro,toUpperCase:oo,transform:No,treeifyError:Mu,trim:no,tuple:Ka,uint32:Kf,uint64:Yf,ulid:xf,undefined:Qf,union:ke,unknown:ge,uppercase:Wr,url:Sf,util:Ru,uuid:_f,uuidv4:$f,uuidv6:bf,uuidv7:kf,void:th,xid:Nf,xor:ih});const Tb=S("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");ee.init(e,t),e.def=t,e.type=t.type,e.parse=(r,o)=>Rr(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>Mr(e,r,o),e.parseAsync=async(r,o)=>Ur(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>Br(e,r,o),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]},{parent:!0}),e.with=e.check,e.clone=(r,o)=>Qe(e,r,o),e.brand=()=>e,e.register=((r,o)=>(r.add(e,o),e)),e.apply=r=>r(e)}),Pb=S("ZodMiniObject",(e,t)=>{Ki.init(e,t),Tb.init(e,t),oe(e,"shape",()=>t.shape)});function Oh(e,t){const r={type:"object",shape:e??{},...E(t)};return new Pb(r)}function St(e){return!!e._zod}function gn(e){const t=Object.values(e);if(t.length===0)return Oh({});const r=t.every(St),o=t.every(n=>!St(n));if(r)return Oh(e);if(o)return U(e);throw new Error("Mixed Zod versions detected in object shape.")}function ur(e,t){return St(e)?Mr(e,t):e.safeParse(t)}async function Ss(e,t){return St(e)?await Br(e,t):await e.safeParseAsync(t)}function lr(e){if(!e)return;let t;if(St(e)?t=e._zod?.def?.shape:t=e.shape,!!t){if(typeof t=="function")try{return t()}catch{return}return t}}function dr(e){if(e){if(typeof e=="object"){const t=e,r=e;if(!t._def&&!r._zod){const o=Object.values(e);if(o.length>0&&o.every(n=>typeof n=="object"&&n!==null&&(n._def!==void 0||n._zod!==void 0||typeof n.parse=="function")))return gn(e)}}if(St(e)){const r=e._zod?.def;if(r&&(r.type==="object"||r.shape!==void 0))return e}else if(e.shape!==void 0)return e}}function ws(e){if(e&&typeof e=="object"){if("message"in e&&typeof e.message=="string")return e.message;if("issues"in e&&Array.isArray(e.issues)&&e.issues.length>0){const t=e.issues[0];if(t&&typeof t=="object"&&"message"in t)return String(t.message)}try{return JSON.stringify(e)}catch{return String(e)}}return String(e)}function xb(e){return e.description}function Nb(e){if(St(e))return e._zod?.def?.type==="optional";const t=e;return typeof e.isOptional=="function"?e.isOptional():t._def?.typeName==="ZodOptional"}function Th(e){if(St(e)){const i=e._zod?.def;if(i){if(i.value!==void 0)return i.value;if(Array.isArray(i.values)&&i.values.length>0)return i.values[0]}}const r=e._def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}const o=e.value;if(o!==void 0)return o}const Ph="2025-11-25",Eb=[Ph,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Jt="io.modelcontextprotocol/related-task",Co="2.0",Ee=$s(e=>e!==null&&(typeof e=="object"||typeof e=="function")),xh=ke([k(),ie().int()]),Nh=k();Fe({ttl:ie().optional(),pollInterval:ie().optional()});const zb=U({ttl:ie().optional()}),jb=U({taskId:k()}),Is=Fe({progressToken:xh.optional(),[Jt]:jb.optional()}),rt=U({_meta:Is.optional()}),mr=rt.extend({task:zb.optional()}),Db=e=>mr.safeParse(e).success,Ue=U({method:k(),params:rt.loose().optional()}),lt=U({_meta:Is.optional()}),dt=U({method:k(),params:lt.loose().optional()}),Me=Fe({_meta:Is.optional()}),Ro=ke([k(),ie().int()]),Eh=U({jsonrpc:V(Co),id:Ro,...Ue.shape}).strict(),zh=e=>Eh.safeParse(e).success,jh=U({jsonrpc:V(Co),...dt.shape}).strict(),Ab=e=>jh.safeParse(e).success,Os=U({jsonrpc:V(Co),id:Ro,result:Me}).strict(),Uo=e=>Os.safeParse(e).success;var W;(function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(W||(W={}));const Ts=U({jsonrpc:V(Co),id:Ro.optional(),error:U({code:ie().int(),message:k(),data:ge().optional()})}).strict(),Cb=e=>Ts.safeParse(e).success,Rb=ke([Eh,jh,Os,Ts]);ke([Os,Ts]);const Ps=Me.strict(),Ub=lt.extend({requestId:Ro.optional(),reason:k().optional()}),xs=dt.extend({method:V("notifications/cancelled"),params:Ub}),Mb=U({src:k(),mimeType:k().optional(),sizes:ae(k()).optional(),theme:Re(["light","dark"]).optional()}),pr=U({icons:ae(Mb).optional()}),vn=U({name:k(),title:k().optional()}),Dh=vn.extend({...vn.shape,...pr.shape,version:k(),websiteUrl:k().optional(),description:k().optional()}),Bb=rr(U({applyDefaults:Ne().optional()}),fe(k(),ge())),Zb=Do(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,rr(U({form:Bb.optional(),url:Ee.optional()}),fe(k(),ge()).optional())),Fb=Fe({list:Ee.optional(),cancel:Ee.optional(),requests:Fe({sampling:Fe({createMessage:Ee.optional()}).optional(),elicitation:Fe({create:Ee.optional()}).optional()}).optional()}),Vb=Fe({list:Ee.optional(),cancel:Ee.optional(),requests:Fe({tools:Fe({call:Ee.optional()}).optional()}).optional()}),Lb=U({experimental:fe(k(),Ee).optional(),sampling:U({context:Ee.optional(),tools:Ee.optional()}).optional(),elicitation:Zb.optional(),roots:U({listChanged:Ne().optional()}).optional(),tasks:Fb.optional(),extensions:fe(k(),Ee).optional()}),qb=rt.extend({protocolVersion:k(),capabilities:Lb,clientInfo:Dh}),Ah=Ue.extend({method:V("initialize"),params:qb}),Jb=U({experimental:fe(k(),Ee).optional(),logging:Ee.optional(),completions:Ee.optional(),prompts:U({listChanged:Ne().optional()}).optional(),resources:U({subscribe:Ne().optional(),listChanged:Ne().optional()}).optional(),tools:U({listChanged:Ne().optional()}).optional(),tasks:Vb.optional(),extensions:fe(k(),Ee).optional()}),Hb=Me.extend({protocolVersion:k(),capabilities:Jb,serverInfo:Dh,instructions:k().optional()}),Ch=dt.extend({method:V("notifications/initialized"),params:lt.optional()}),Ns=Ue.extend({method:V("ping"),params:rt.optional()}),Kb=U({progress:ie(),total:Ie(ie()),message:Ie(k())}),Gb=U({...lt.shape,...Kb.shape,progressToken:xh}),Es=dt.extend({method:V("notifications/progress"),params:Gb}),Wb=rt.extend({cursor:Nh.optional()}),fr=Ue.extend({params:Wb.optional()}),hr=Me.extend({nextCursor:Nh.optional()}),Yb=Re(["working","input_required","completed","failed","cancelled"]),gr=U({taskId:k(),status:Yb,ttl:ke([ie(),Oo()]),createdAt:k(),lastUpdatedAt:k(),pollInterval:Ie(ie()),statusMessage:Ie(k())}),Mo=Me.extend({task:gr}),Xb=lt.merge(gr),Bo=dt.extend({method:V("notifications/tasks/status"),params:Xb}),zs=Ue.extend({method:V("tasks/get"),params:rt.extend({taskId:k()})}),js=Me.merge(gr),Ds=Ue.extend({method:V("tasks/result"),params:rt.extend({taskId:k()})});Me.loose();const As=fr.extend({method:V("tasks/list")}),Cs=hr.extend({tasks:ae(gr)}),Rs=Ue.extend({method:V("tasks/cancel"),params:rt.extend({taskId:k()})}),Qb=Me.merge(gr),Rh=U({uri:k(),mimeType:Ie(k()),_meta:fe(k(),ge()).optional()}),Uh=Rh.extend({text:k()}),Us=k().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),Mh=Rh.extend({blob:Us}),vr=Re(["user","assistant"]),yn=U({audience:ae(vr).optional(),priority:ie().min(0).max(1).optional(),lastModified:Ea({offset:!0}).optional()}),Bh=U({...vn.shape,...pr.shape,uri:k(),description:Ie(k()),mimeType:Ie(k()),size:Ie(ie()),annotations:yn.optional(),_meta:Ie(Fe({}))}),ek=U({...vn.shape,...pr.shape,uriTemplate:k(),description:Ie(k()),mimeType:Ie(k()),annotations:yn.optional(),_meta:Ie(Fe({}))}),Ms=fr.extend({method:V("resources/list")}),tk=hr.extend({resources:ae(Bh)}),Bs=fr.extend({method:V("resources/templates/list")}),nk=hr.extend({resourceTemplates:ae(ek)}),Zs=rt.extend({uri:k()}),rk=Zs,Fs=Ue.extend({method:V("resources/read"),params:rk}),ok=Me.extend({contents:ae(ke([Uh,Mh]))}),ik=dt.extend({method:V("notifications/resources/list_changed"),params:lt.optional()}),ak=Zs,sk=Ue.extend({method:V("resources/subscribe"),params:ak}),ck=Zs,uk=Ue.extend({method:V("resources/unsubscribe"),params:ck}),lk=lt.extend({uri:k()}),dk=dt.extend({method:V("notifications/resources/updated"),params:lk}),mk=U({name:k(),description:Ie(k()),required:Ie(Ne())}),pk=U({...vn.shape,...pr.shape,description:Ie(k()),arguments:Ie(ae(mk)),_meta:Ie(Fe({}))}),Vs=fr.extend({method:V("prompts/list")}),fk=hr.extend({prompts:ae(pk)}),hk=rt.extend({name:k(),arguments:fe(k(),k()).optional()}),Ls=Ue.extend({method:V("prompts/get"),params:hk}),qs=U({type:V("text"),text:k(),annotations:yn.optional(),_meta:fe(k(),ge()).optional()}),Js=U({type:V("image"),data:Us,mimeType:k(),annotations:yn.optional(),_meta:fe(k(),ge()).optional()}),Hs=U({type:V("audio"),data:Us,mimeType:k(),annotations:yn.optional(),_meta:fe(k(),ge()).optional()}),gk=U({type:V("tool_use"),name:k(),id:k(),input:fe(k(),ge()),_meta:fe(k(),ge()).optional()}),vk=U({type:V("resource"),resource:ke([Uh,Mh]),annotations:yn.optional(),_meta:fe(k(),ge()).optional()}),yk=Bh.extend({type:V("resource_link")}),Ks=ke([qs,Js,Hs,yk,vk]),_k=U({role:vr,content:Ks}),$k=Me.extend({description:k().optional(),messages:ae(_k)}),bk=dt.extend({method:V("notifications/prompts/list_changed"),params:lt.optional()}),kk=U({title:k().optional(),readOnlyHint:Ne().optional(),destructiveHint:Ne().optional(),idempotentHint:Ne().optional(),openWorldHint:Ne().optional()}),Sk=U({taskSupport:Re(["required","optional","forbidden"]).optional()}),Zh=U({...vn.shape,...pr.shape,description:k().optional(),inputSchema:U({type:V("object"),properties:fe(k(),Ee).optional(),required:ae(k()).optional()}).catchall(ge()),outputSchema:U({type:V("object"),properties:fe(k(),Ee).optional(),required:ae(k()).optional()}).catchall(ge()).optional(),annotations:kk.optional(),execution:Sk.optional(),_meta:fe(k(),ge()).optional()}),Gs=fr.extend({method:V("tools/list")}),wk=hr.extend({tools:ae(Zh)}),Ws=Me.extend({content:ae(Ks).default([]),structuredContent:fe(k(),ge()).optional(),isError:Ne().optional()});Ws.or(Me.extend({toolResult:ge()}));const Ik=mr.extend({name:k(),arguments:fe(k(),ge()).optional()}),Zo=Ue.extend({method:V("tools/call"),params:Ik}),Ok=dt.extend({method:V("notifications/tools/list_changed"),params:lt.optional()});U({autoRefresh:Ne().default(!0),debounceMs:ie().int().nonnegative().default(300)});const Fo=Re(["debug","info","notice","warning","error","critical","alert","emergency"]),Tk=rt.extend({level:Fo}),Fh=Ue.extend({method:V("logging/setLevel"),params:Tk}),Pk=lt.extend({level:Fo,logger:k().optional(),data:ge()}),xk=dt.extend({method:V("notifications/message"),params:Pk}),Nk=U({name:k().optional()}),Ek=U({hints:ae(Nk).optional(),costPriority:ie().min(0).max(1).optional(),speedPriority:ie().min(0).max(1).optional(),intelligencePriority:ie().min(0).max(1).optional()}),zk=U({mode:Re(["auto","required","none"]).optional()}),jk=U({type:V("tool_result"),toolUseId:k().describe("The unique identifier for the corresponding tool call."),content:ae(Ks).default([]),structuredContent:U({}).loose().optional(),isError:Ne().optional(),_meta:fe(k(),ge()).optional()}),Dk=xo("type",[qs,Js,Hs]),Vo=xo("type",[qs,Js,Hs,gk,jk]),Ak=U({role:vr,content:ke([Vo,ae(Vo)]),_meta:fe(k(),ge()).optional()}),Ck=mr.extend({messages:ae(Ak),modelPreferences:Ek.optional(),systemPrompt:k().optional(),includeContext:Re(["none","thisServer","allServers"]).optional(),temperature:ie().optional(),maxTokens:ie().int(),stopSequences:ae(k()).optional(),metadata:Ee.optional(),tools:ae(Zh).optional(),toolChoice:zk.optional()}),Rk=Ue.extend({method:V("sampling/createMessage"),params:Ck}),Ys=Me.extend({model:k(),stopReason:Ie(Re(["endTurn","stopSequence","maxTokens"]).or(k())),role:vr,content:Dk}),Vh=Me.extend({model:k(),stopReason:Ie(Re(["endTurn","stopSequence","maxTokens","toolUse"]).or(k())),role:vr,content:ke([Vo,ae(Vo)])}),Uk=U({type:V("boolean"),title:k().optional(),description:k().optional(),default:Ne().optional()}),Mk=U({type:V("string"),title:k().optional(),description:k().optional(),minLength:ie().optional(),maxLength:ie().optional(),format:Re(["email","uri","date","date-time"]).optional(),default:k().optional()}),Bk=U({type:Re(["number","integer"]),title:k().optional(),description:k().optional(),minimum:ie().optional(),maximum:ie().optional(),default:ie().optional()}),Zk=U({type:V("string"),title:k().optional(),description:k().optional(),enum:ae(k()),default:k().optional()}),Fk=U({type:V("string"),title:k().optional(),description:k().optional(),oneOf:ae(U({const:k(),title:k()})),default:k().optional()}),Vk=U({type:V("string"),title:k().optional(),description:k().optional(),enum:ae(k()),enumNames:ae(k()).optional(),default:k().optional()}),Lk=ke([Zk,Fk]),qk=U({type:V("array"),title:k().optional(),description:k().optional(),minItems:ie().optional(),maxItems:ie().optional(),items:U({type:V("string"),enum:ae(k())}),default:ae(k()).optional()}),Jk=U({type:V("array"),title:k().optional(),description:k().optional(),minItems:ie().optional(),maxItems:ie().optional(),items:U({anyOf:ae(U({const:k(),title:k()}))}),default:ae(k()).optional()}),Hk=ke([qk,Jk]),Kk=ke([Vk,Lk,Hk]),Gk=ke([Kk,Uk,Mk,Bk]),Wk=mr.extend({mode:V("form").optional(),message:k(),requestedSchema:U({type:V("object"),properties:fe(k(),Gk),required:ae(k()).optional()})}),Yk=mr.extend({mode:V("url"),message:k(),elicitationId:k(),url:k().url()}),Xk=ke([Wk,Yk]),Qk=Ue.extend({method:V("elicitation/create"),params:Xk}),eS=lt.extend({elicitationId:k()}),tS=dt.extend({method:V("notifications/elicitation/complete"),params:eS}),Lo=Me.extend({action:Re(["accept","decline","cancel"]),content:Do(e=>e===null?void 0:e,fe(k(),ke([k(),ie(),Ne(),ae(k())])).optional())}),nS=U({type:V("ref/resource"),uri:k()}),rS=U({type:V("ref/prompt"),name:k()}),oS=rt.extend({ref:ke([rS,nS]),argument:U({name:k(),value:k()}),context:U({arguments:fe(k(),k()).optional()}).optional()}),Xs=Ue.extend({method:V("completion/complete"),params:oS});function iS(e){if(e.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${e.params.ref.type}`)}function aS(e){if(e.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${e.params.ref.type}`)}const sS=Me.extend({completion:Fe({values:ae(k()).max(100),total:Ie(ie().int()),hasMore:Ie(Ne())})}),cS=U({uri:k().startsWith("file://"),name:k().optional(),_meta:fe(k(),ge()).optional()}),uS=Ue.extend({method:V("roots/list"),params:rt.optional()}),Lh=Me.extend({roots:ae(cS)}),lS=dt.extend({method:V("notifications/roots/list_changed"),params:lt.optional()});ke([Ns,Ah,Xs,Fh,Ls,Vs,Ms,Bs,Fs,sk,uk,Zo,Gs,zs,Ds,As,Rs]),ke([xs,Es,Ch,lS,Bo]),ke([Ps,Ys,Vh,Lo,Lh,js,Cs,Mo]),ke([Ns,Rk,Qk,uS,zs,Ds,As,Rs]),ke([xs,Es,xk,dk,ik,Ok,bk,Bo,tS]),ke([Ps,Hb,sS,$k,fk,tk,nk,ok,Ws,wk,js,Cs,Mo]);class J extends Error{constructor(t,r,o){super(`MCP error ${t}: ${r}`),this.code=t,this.data=o,this.name="McpError"}static fromError(t,r,o){if(t===W.UrlElicitationRequired&&o){const n=o;if(n.elicitations)return new dS(n.elicitations,r)}return new J(t,r,o)}}class dS extends J{constructor(t,r=`URL elicitation${t.length>1?"s":""} required`){super(W.UrlElicitationRequired,r,{elicitations:t})}get elicitations(){return this.data?.elicitations??[]}}function Ht(e){return e==="completed"||e==="failed"||e==="cancelled"}const mS=Symbol("Let zodToJsonSchema decide on which parser to use"),qh={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},pS=e=>typeof e=="string"?{...qh,name:e}:{...qh,...e},fS=e=>{const t=pS(e),r=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,flags:{hasReferencedOpenAiAnyType:!1},currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([o,n])=>[n._def,{def:n._def,path:[...t.basePath,t.definitionPath,o],jsonSchema:void 0}]))}};function Jh(e,t,r,o){o?.errorMessages&&r&&(e.errorMessage={...e.errorMessage,[t]:r})}function ve(e,t,r,o,n){e[t]=r,Jh(e,t,o,n)}const Hh=(e,t)=>{let r=0;for(;r<e.length&&r<t.length&&e[r]===t[r];r++);return[(e.length-r).toString(),...t.slice(r)].join("/")};function We(e){if(e.target!=="openAi")return{};const t=[...e.basePath,e.definitionPath,e.openAiAnyTypeName];return e.flags.hasReferencedOpenAiAnyType=!0,{$ref:e.$refStrategy==="relative"?Hh(t,e.currentPath):t.join("/")}}function hS(e,t){const r={type:"array"};return e.type?._def&&e.type?._def?.typeName!==te.ZodAny&&(r.items=he(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&ve(r,"minItems",e.minLength.value,e.minLength.message,t),e.maxLength&&ve(r,"maxItems",e.maxLength.value,e.maxLength.message,t),e.exactLength&&(ve(r,"minItems",e.exactLength.value,e.exactLength.message,t),ve(r,"maxItems",e.exactLength.value,e.exactLength.message,t)),r}function gS(e,t){const r={type:"integer",format:"int64"};if(!e.checks)return r;for(const o of e.checks)switch(o.kind){case"min":t.target==="jsonSchema7"?o.inclusive?ve(r,"minimum",o.value,o.message,t):ve(r,"exclusiveMinimum",o.value,o.message,t):(o.inclusive||(r.exclusiveMinimum=!0),ve(r,"minimum",o.value,o.message,t));break;case"max":t.target==="jsonSchema7"?o.inclusive?ve(r,"maximum",o.value,o.message,t):ve(r,"exclusiveMaximum",o.value,o.message,t):(o.inclusive||(r.exclusiveMaximum=!0),ve(r,"maximum",o.value,o.message,t));break;case"multipleOf":ve(r,"multipleOf",o.value,o.message,t);break}return r}function vS(){return{type:"boolean"}}function Kh(e,t){return he(e.type._def,t)}const yS=(e,t)=>he(e.innerType._def,t);function Gh(e,t,r){const o=r??t.dateStrategy;if(Array.isArray(o))return{anyOf:o.map((n,i)=>Gh(e,t,n))};switch(o){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return _S(e,t)}}const _S=(e,t)=>{const r={type:"integer",format:"unix-time"};if(t.target==="openApi3")return r;for(const o of e.checks)switch(o.kind){case"min":ve(r,"minimum",o.value,o.message,t);break;case"max":ve(r,"maximum",o.value,o.message,t);break}return r};function $S(e,t){return{...he(e.innerType._def,t),default:e.defaultValue()}}function bS(e,t){return t.effectStrategy==="input"?he(e.schema._def,t):We(t)}function kS(e){return{type:"string",enum:Array.from(e.values)}}const SS=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function wS(e,t){const r=[he(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),he(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(i=>!!i);let o=t.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0;const n=[];return r.forEach(i=>{if(SS(i))n.push(...i.allOf),i.unevaluatedProperties===void 0&&(o=void 0);else{let a=i;if("additionalProperties"in i&&i.additionalProperties===!1){const{additionalProperties:s,...c}=i;a=c}else o=void 0;n.push(a)}}),n.length?{allOf:n,...o}:void 0}function IS(e,t){const r=typeof e.value;return r!=="bigint"&&r!=="number"&&r!=="boolean"&&r!=="string"?{type:Array.isArray(e.value)?"array":"object"}:t.target==="openApi3"?{type:r==="bigint"?"integer":r,enum:[e.value]}:{type:r==="bigint"?"integer":r,const:e.value}}let Qs;const ft={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(Qs===void 0&&(Qs=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Qs),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?: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])$/,ipv4Cidr:/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function Wh(e,t){const r={type:"string"};if(e.checks)for(const o of e.checks)switch(o.kind){case"min":ve(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,o.value):o.value,o.message,t);break;case"max":ve(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,o.value):o.value,o.message,t);break;case"email":switch(t.emailStrategy){case"format:email":ht(r,"email",o.message,t);break;case"format:idn-email":ht(r,"idn-email",o.message,t);break;case"pattern:zod":Je(r,ft.email,o.message,t);break}break;case"url":ht(r,"uri",o.message,t);break;case"uuid":ht(r,"uuid",o.message,t);break;case"regex":Je(r,o.regex,o.message,t);break;case"cuid":Je(r,ft.cuid,o.message,t);break;case"cuid2":Je(r,ft.cuid2,o.message,t);break;case"startsWith":Je(r,RegExp(`^${ec(o.value,t)}`),o.message,t);break;case"endsWith":Je(r,RegExp(`${ec(o.value,t)}$`),o.message,t);break;case"datetime":ht(r,"date-time",o.message,t);break;case"date":ht(r,"date",o.message,t);break;case"time":ht(r,"time",o.message,t);break;case"duration":ht(r,"duration",o.message,t);break;case"length":ve(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,o.value):o.value,o.message,t),ve(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,o.value):o.value,o.message,t);break;case"includes":{Je(r,RegExp(ec(o.value,t)),o.message,t);break}case"ip":{o.version!=="v6"&&ht(r,"ipv4",o.message,t),o.version!=="v4"&&ht(r,"ipv6",o.message,t);break}case"base64url":Je(r,ft.base64url,o.message,t);break;case"jwt":Je(r,ft.jwt,o.message,t);break;case"cidr":{o.version!=="v6"&&Je(r,ft.ipv4Cidr,o.message,t),o.version!=="v4"&&Je(r,ft.ipv6Cidr,o.message,t);break}case"emoji":Je(r,ft.emoji(),o.message,t);break;case"ulid":{Je(r,ft.ulid,o.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{ht(r,"binary",o.message,t);break}case"contentEncoding:base64":{ve(r,"contentEncoding","base64",o.message,t);break}case"pattern:zod":{Je(r,ft.base64,o.message,t);break}}break}case"nanoid":Je(r,ft.nanoid,o.message,t)}return r}function ec(e,t){return t.patternStrategy==="escape"?TS(e):e}const OS=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function TS(e){let t="";for(let r=0;r<e.length;r++)OS.has(e[r])||(t+="\\"),t+=e[r];return t}function ht(e,t,r,o){e.format||e.anyOf?.some(n=>n.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&o.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.anyOf.push({format:t,...r&&o.errorMessages&&{errorMessage:{format:r}}})):ve(e,"format",t,r,o)}function Je(e,t,r,o){e.pattern||e.allOf?.some(n=>n.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&o.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.allOf.push({pattern:Yh(t,o),...r&&o.errorMessages&&{errorMessage:{pattern:r}}})):ve(e,"pattern",Yh(t,o),r,o)}function Yh(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;const r={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},o=r.i?e.source.toLowerCase():e.source;let n="",i=!1,a=!1,s=!1;for(let c=0;c<o.length;c++){if(i){n+=o[c],i=!1;continue}if(r.i){if(a){if(o[c].match(/[a-z]/)){s?(n+=o[c],n+=`${o[c-2]}-${o[c]}`.toUpperCase(),s=!1):o[c+1]==="-"&&o[c+2]?.match(/[a-z]/)?(n+=o[c],s=!0):n+=`${o[c]}${o[c].toUpperCase()}`;continue}}else if(o[c].match(/[a-z]/)){n+=`[${o[c]}${o[c].toUpperCase()}]`;continue}}if(r.m){if(o[c]==="^"){n+=`(^|(?<=[\r
|
|
67
|
+
]))`;continue}else if(o[c]==="$"){n+=`($|(?=[\r
|
|
68
|
+
]))`;continue}}if(r.s&&o[c]==="."){n+=a?`${o[c]}\r
|
|
69
|
+
`:`[${o[c]}\r
|
|
70
|
+
]`;continue}n+=o[c],o[c]==="\\"?i=!0:a&&o[c]==="]"?a=!1:!a&&o[c]==="["&&(a=!0)}try{new RegExp(n)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return n}function Xh(e,t){if(t.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),t.target==="openApi3"&&e.keyType?._def.typeName===te.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((o,n)=>({...o,[n]:he(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",n]})??We(t)}),{}),additionalProperties:t.rejectedAdditionalProperties};const r={type:"object",additionalProperties:he(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??t.allowedAdditionalProperties};if(t.target==="openApi3")return r;if(e.keyType?._def.typeName===te.ZodString&&e.keyType._def.checks?.length){const{type:o,...n}=Wh(e.keyType._def,t);return{...r,propertyNames:n}}else{if(e.keyType?._def.typeName===te.ZodEnum)return{...r,propertyNames:{enum:e.keyType._def.values}};if(e.keyType?._def.typeName===te.ZodBranded&&e.keyType._def.type._def.typeName===te.ZodString&&e.keyType._def.type._def.checks?.length){const{type:o,...n}=Kh(e.keyType._def,t);return{...r,propertyNames:n}}}return r}function PS(e,t){if(t.mapStrategy==="record")return Xh(e,t);const r=he(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||We(t),o=he(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||We(t);return{type:"array",maxItems:125,items:{type:"array",items:[r,o],minItems:2,maxItems:2}}}function xS(e){const t=e.values,o=Object.keys(e.values).filter(i=>typeof t[t[i]]!="number").map(i=>t[i]),n=Array.from(new Set(o.map(i=>typeof i)));return{type:n.length===1?n[0]==="string"?"string":"number":["string","number"],enum:o}}function NS(e){return e.target==="openAi"?void 0:{not:We({...e,currentPath:[...e.currentPath,"not"]})}}function ES(e){return e.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}const qo={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function zS(e,t){if(t.target==="openApi3")return Qh(e,t);const r=e.options instanceof Map?Array.from(e.options.values()):e.options;if(r.every(o=>o._def.typeName in qo&&(!o._def.checks||!o._def.checks.length))){const o=r.reduce((n,i)=>{const a=qo[i._def.typeName];return a&&!n.includes(a)?[...n,a]:n},[]);return{type:o.length>1?o:o[0]}}else if(r.every(o=>o._def.typeName==="ZodLiteral"&&!o.description)){const o=r.reduce((n,i)=>{const a=typeof i._def.value;switch(a){case"string":case"number":case"boolean":return[...n,a];case"bigint":return[...n,"integer"];case"object":if(i._def.value===null)return[...n,"null"];case"symbol":case"undefined":case"function":default:return n}},[]);if(o.length===r.length){const n=o.filter((i,a,s)=>s.indexOf(i)===a);return{type:n.length>1?n:n[0],enum:r.reduce((i,a)=>i.includes(a._def.value)?i:[...i,a._def.value],[])}}}else if(r.every(o=>o._def.typeName==="ZodEnum"))return{type:"string",enum:r.reduce((o,n)=>[...o,...n._def.values.filter(i=>!o.includes(i))],[])};return Qh(e,t)}const Qh=(e,t)=>{const r=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((o,n)=>he(o._def,{...t,currentPath:[...t.currentPath,"anyOf",`${n}`]})).filter(o=>!!o&&(!t.strictUnions||typeof o=="object"&&Object.keys(o).length>0));return r.length?{anyOf:r}:void 0};function jS(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return t.target==="openApi3"?{type:qo[e.innerType._def.typeName],nullable:!0}:{type:[qo[e.innerType._def.typeName],"null"]};if(t.target==="openApi3"){const o=he(e.innerType._def,{...t,currentPath:[...t.currentPath]});return o&&"$ref"in o?{allOf:[o],nullable:!0}:o&&{...o,nullable:!0}}const r=he(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}function DS(e,t){const r={type:"number"};if(!e.checks)return r;for(const o of e.checks)switch(o.kind){case"int":r.type="integer",Jh(r,"type",o.message,t);break;case"min":t.target==="jsonSchema7"?o.inclusive?ve(r,"minimum",o.value,o.message,t):ve(r,"exclusiveMinimum",o.value,o.message,t):(o.inclusive||(r.exclusiveMinimum=!0),ve(r,"minimum",o.value,o.message,t));break;case"max":t.target==="jsonSchema7"?o.inclusive?ve(r,"maximum",o.value,o.message,t):ve(r,"exclusiveMaximum",o.value,o.message,t):(o.inclusive||(r.exclusiveMaximum=!0),ve(r,"maximum",o.value,o.message,t));break;case"multipleOf":ve(r,"multipleOf",o.value,o.message,t);break}return r}function AS(e,t){const r=t.target==="openAi",o={type:"object",properties:{}},n=[],i=e.shape();for(const s in i){let c=i[s];if(c===void 0||c._def===void 0)continue;let u=RS(c);u&&r&&(c._def.typeName==="ZodOptional"&&(c=c._def.innerType),c.isNullable()||(c=c.nullable()),u=!1);const l=he(c._def,{...t,currentPath:[...t.currentPath,"properties",s],propertyPath:[...t.currentPath,"properties",s]});l!==void 0&&(o.properties[s]=l,u||n.push(s))}n.length&&(o.required=n);const a=CS(e,t);return a!==void 0&&(o.additionalProperties=a),o}function CS(e,t){if(e.catchall._def.typeName!=="ZodNever")return he(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function RS(e){try{return e.isOptional()}catch{return!0}}const US=(e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return he(e.innerType._def,t);const r=he(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return r?{anyOf:[{not:We(t)},r]}:We(t)},MS=(e,t)=>{if(t.pipeStrategy==="input")return he(e.in._def,t);if(t.pipeStrategy==="output")return he(e.out._def,t);const r=he(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),o=he(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,o].filter(n=>n!==void 0)}};function BS(e,t){return he(e.type._def,t)}function ZS(e,t){const o={type:"array",uniqueItems:!0,items:he(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&ve(o,"minItems",e.minSize.value,e.minSize.message,t),e.maxSize&&ve(o,"maxItems",e.maxSize.value,e.maxSize.message,t),o}function FS(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((r,o)=>he(r._def,{...t,currentPath:[...t.currentPath,"items",`${o}`]})).reduce((r,o)=>o===void 0?r:[...r,o],[]),additionalItems:he(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((r,o)=>he(r._def,{...t,currentPath:[...t.currentPath,"items",`${o}`]})).reduce((r,o)=>o===void 0?r:[...r,o],[])}}function VS(e){return{not:We(e)}}function LS(e){return We(e)}const qS=(e,t)=>he(e.innerType._def,t),JS=(e,t,r)=>{switch(t){case te.ZodString:return Wh(e,r);case te.ZodNumber:return DS(e,r);case te.ZodObject:return AS(e,r);case te.ZodBigInt:return gS(e,r);case te.ZodBoolean:return vS();case te.ZodDate:return Gh(e,r);case te.ZodUndefined:return VS(r);case te.ZodNull:return ES(r);case te.ZodArray:return hS(e,r);case te.ZodUnion:case te.ZodDiscriminatedUnion:return zS(e,r);case te.ZodIntersection:return wS(e,r);case te.ZodTuple:return FS(e,r);case te.ZodRecord:return Xh(e,r);case te.ZodLiteral:return IS(e,r);case te.ZodEnum:return kS(e);case te.ZodNativeEnum:return xS(e);case te.ZodNullable:return jS(e,r);case te.ZodOptional:return US(e,r);case te.ZodMap:return PS(e,r);case te.ZodSet:return ZS(e,r);case te.ZodLazy:return()=>e.getter()._def;case te.ZodPromise:return BS(e,r);case te.ZodNaN:case te.ZodNever:return NS(r);case te.ZodEffects:return bS(e,r);case te.ZodAny:return We(r);case te.ZodUnknown:return LS(r);case te.ZodDefault:return $S(e,r);case te.ZodBranded:return Kh(e,r);case te.ZodReadonly:return qS(e,r);case te.ZodCatch:return yS(e,r);case te.ZodPipeline:return MS(e,r);case te.ZodFunction:case te.ZodVoid:case te.ZodSymbol:return;default:return(o=>{})()}};function he(e,t,r=!1){const o=t.seen.get(e);if(t.override){const s=t.override?.(e,t,o,r);if(s!==mS)return s}if(o&&!r){const s=HS(o,t);if(s!==void 0)return s}const n={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,n);const i=JS(e,e.typeName,t),a=typeof i=="function"?he(i(),t):i;if(a&&KS(e,t,a),t.postProcess){const s=t.postProcess(a,e,t);return n.jsonSchema=a,s}return n.jsonSchema=a,a}const HS=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:Hh(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((r,o)=>t.currentPath[o]===r)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),We(t)):t.$refStrategy==="seen"?We(t):void 0}},KS=(e,t,r)=>(e.description&&(r.description=e.description,t.markdownDescription&&(r.markdownDescription=e.description)),r),GS=(e,t)=>{const r=fS(t);let o=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((c,[u,l])=>({...c,[u]:he(l._def,{...r,currentPath:[...r.basePath,r.definitionPath,u]},!0)??We(r)}),{}):void 0;const n=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,i=he(e._def,n===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,n]},!1)??We(r),a=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;a!==void 0&&(i.title=a),r.flags.hasReferencedOpenAiAnyType&&(o||(o={}),o[r.openAiAnyTypeName]||(o[r.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:r.$refStrategy==="relative"?"1":[...r.basePath,r.definitionPath,r.openAiAnyTypeName].join("/")}}));const s=n===void 0?o?{...i,[r.definitionPath]:o}:i:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,n].join("/"),[r.definitionPath]:{...o,[n]:i}};return r.target==="jsonSchema7"?s.$schema="http://json-schema.org/draft-07/schema#":(r.target==="jsonSchema2019-09"||r.target==="openAi")&&(s.$schema="https://json-schema.org/draft/2019-09/schema#"),r.target==="openAi"&&("anyOf"in s||"oneOf"in s||"allOf"in s||"type"in s&&Array.isArray(s.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),s};function WS(e){return!e||e==="jsonSchema7"||e==="draft-7"?"draft-7":e==="jsonSchema2019-09"||e==="draft-2020-12"?"draft-2020-12":"draft-7"}function eg(e,t){return St(e)?xa(e,{target:WS(t?.target),io:t?.pipeStrategy??"input"}):GS(e,{strictUnions:t?.strictUnions??!0,pipeStrategy:t?.pipeStrategy??"input"})}function tg(e){const r=lr(e)?.method;if(!r)throw new Error("Schema is missing a method literal");const o=Th(r);if(typeof o!="string")throw new Error("Schema method literal must be a string");return o}function ng(e,t){const r=ur(e,t);if(!r.success)throw r.error;return r.data}const YS=6e4;class XS{constructor(t){this._options=t,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(xs,r=>{this._oncancel(r)}),this.setNotificationHandler(Es,r=>{this._onprogress(r)}),this.setRequestHandler(Ns,r=>({})),this._taskStore=t?.taskStore,this._taskMessageQueue=t?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(zs,async(r,o)=>{const n=await this._taskStore.getTask(r.params.taskId,o.sessionId);if(!n)throw new J(W.InvalidParams,"Failed to retrieve task: Task not found");return{...n}}),this.setRequestHandler(Ds,async(r,o)=>{const n=async()=>{const i=r.params.taskId;if(this._taskMessageQueue){let s;for(;s=await this._taskMessageQueue.dequeue(i,o.sessionId);){if(s.type==="response"||s.type==="error"){const c=s.message,u=c.id,l=this._requestResolvers.get(u);if(l)if(this._requestResolvers.delete(u),s.type==="response")l(c);else{const d=c,p=new J(d.error.code,d.error.message,d.error.data);l(p)}else{const d=s.type==="response"?"Response":"Error";this._onerror(new Error(`${d} handler missing for request ${u}`))}continue}await this._transport?.send(s.message,{relatedRequestId:o.requestId})}}const a=await this._taskStore.getTask(i,o.sessionId);if(!a)throw new J(W.InvalidParams,`Task not found: ${i}`);if(!Ht(a.status))return await this._waitForTaskUpdate(i,o.signal),await n();if(Ht(a.status)){const s=await this._taskStore.getTaskResult(i,o.sessionId);return this._clearTaskQueue(i),{...s,_meta:{...s._meta,[Jt]:{taskId:i}}}}return await n()};return await n()}),this.setRequestHandler(As,async(r,o)=>{try{const{tasks:n,nextCursor:i}=await this._taskStore.listTasks(r.params?.cursor,o.sessionId);return{tasks:n,nextCursor:i,_meta:{}}}catch(n){throw new J(W.InvalidParams,`Failed to list tasks: ${n instanceof Error?n.message:String(n)}`)}}),this.setRequestHandler(Rs,async(r,o)=>{try{const n=await this._taskStore.getTask(r.params.taskId,o.sessionId);if(!n)throw new J(W.InvalidParams,`Task not found: ${r.params.taskId}`);if(Ht(n.status))throw new J(W.InvalidParams,`Cannot cancel task in terminal status: ${n.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",o.sessionId),this._clearTaskQueue(r.params.taskId);const i=await this._taskStore.getTask(r.params.taskId,o.sessionId);if(!i)throw new J(W.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...i}}catch(n){throw n instanceof J?n:new J(W.InvalidRequest,`Failed to cancel task: ${n instanceof Error?n.message:String(n)}`)}}))}async _oncancel(t){if(!t.params.requestId)return;this._requestHandlerAbortControllers.get(t.params.requestId)?.abort(t.params.reason)}_setupTimeout(t,r,o,n,i=!1){this._timeoutInfo.set(t,{timeoutId:setTimeout(n,r),startTime:Date.now(),timeout:r,maxTotalTimeout:o,resetTimeoutOnProgress:i,onTimeout:n})}_resetTimeout(t){const r=this._timeoutInfo.get(t);if(!r)return!1;const o=Date.now()-r.startTime;if(r.maxTotalTimeout&&o>=r.maxTotalTimeout)throw this._timeoutInfo.delete(t),J.fromError(W.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:o});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(t){const r=this._timeoutInfo.get(t);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(t))}async connect(t){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=t;const r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};const o=this.transport?.onerror;this._transport.onerror=i=>{o?.(i),this._onerror(i)};const n=this._transport?.onmessage;this._transport.onmessage=(i,a)=>{n?.(i,a),Uo(i)||Cb(i)?this._onresponse(i):zh(i)?this._onrequest(i,a):Ab(i)?this._onnotification(i):this._onerror(new Error(`Unknown message type: ${JSON.stringify(i)}`))},await this._transport.start()}_onclose(){const t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const o of this._timeoutInfo.values())clearTimeout(o.timeoutId);this._timeoutInfo.clear();for(const o of this._requestHandlerAbortControllers.values())o.abort();this._requestHandlerAbortControllers.clear();const r=J.fromError(W.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(const o of t.values())o(r)}_onerror(t){this.onerror?.(t)}_onnotification(t){const r=this._notificationHandlers.get(t.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(t)).catch(o=>this._onerror(new Error(`Uncaught error in notification handler: ${o}`)))}_onrequest(t,r){const o=this._requestHandlers.get(t.method)??this.fallbackRequestHandler,n=this._transport,i=t.params?._meta?.[Jt]?.taskId;if(o===void 0){const l={jsonrpc:"2.0",id:t.id,error:{code:W.MethodNotFound,message:"Method not found"}};i&&this._taskMessageQueue?this._enqueueTaskMessage(i,{type:"error",message:l,timestamp:Date.now()},n?.sessionId).catch(d=>this._onerror(new Error(`Failed to enqueue error response: ${d}`))):n?.send(l).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}const a=new AbortController;this._requestHandlerAbortControllers.set(t.id,a);const s=Db(t.params)?t.params.task:void 0,c=this._taskStore?this.requestTaskStore(t,n?.sessionId):void 0,u={signal:a.signal,sessionId:n?.sessionId,_meta:t.params?._meta,sendNotification:async l=>{if(a.signal.aborted)return;const d={relatedRequestId:t.id};i&&(d.relatedTask={taskId:i}),await this.notification(l,d)},sendRequest:async(l,d,p)=>{if(a.signal.aborted)throw new J(W.ConnectionClosed,"Request was cancelled");const m={...p,relatedRequestId:t.id};i&&!m.relatedTask&&(m.relatedTask={taskId:i});const f=m.relatedTask?.taskId??i;return f&&c&&await c.updateTaskStatus(f,"input_required"),await this.request(l,d,m)},authInfo:r?.authInfo,requestId:t.id,requestInfo:r?.requestInfo,taskId:i,taskStore:c,taskRequestedTtl:s?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{s&&this.assertTaskHandlerCapability(t.method)}).then(()=>o(t,u)).then(async l=>{if(a.signal.aborted)return;const d={result:l,jsonrpc:"2.0",id:t.id};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:"response",message:d,timestamp:Date.now()},n?.sessionId):await n?.send(d)},async l=>{if(a.signal.aborted)return;const d={jsonrpc:"2.0",id:t.id,error:{code:Number.isSafeInteger(l.code)?l.code:W.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:"error",message:d,timestamp:Date.now()},n?.sessionId):await n?.send(d)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(t.id)===a&&this._requestHandlerAbortControllers.delete(t.id)})}_onprogress(t){const{progressToken:r,...o}=t.params,n=Number(r),i=this._progressHandlers.get(n);if(!i){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(t)}`));return}const a=this._responseHandlers.get(n),s=this._timeoutInfo.get(n);if(s&&a&&s.resetTimeoutOnProgress)try{this._resetTimeout(n)}catch(c){this._responseHandlers.delete(n),this._progressHandlers.delete(n),this._cleanupTimeout(n),a(c);return}i(o)}_onresponse(t){const r=Number(t.id),o=this._requestResolvers.get(r);if(o){if(this._requestResolvers.delete(r),Uo(t))o(t);else{const a=new J(t.error.code,t.error.message,t.error.data);o(a)}return}const n=this._responseHandlers.get(r);if(n===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(t)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let i=!1;if(Uo(t)&&t.result&&typeof t.result=="object"){const a=t.result;if(a.task&&typeof a.task=="object"){const s=a.task;typeof s.taskId=="string"&&(i=!0,this._taskProgressTokens.set(s.taskId,r))}}if(i||this._progressHandlers.delete(r),Uo(t))n(t);else{const a=J.fromError(t.error.code,t.error.message,t.error.data);n(a)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(t,r,o){const{task:n}=o??{};if(!n){try{yield{type:"result",result:await this.request(t,r,o)}}catch(a){yield{type:"error",error:a instanceof J?a:new J(W.InternalError,String(a))}}return}let i;try{const a=await this.request(t,Mo,o);if(a.task)i=a.task.taskId,yield{type:"taskCreated",task:a.task};else throw new J(W.InternalError,"Task creation did not return a task");for(;;){const s=await this.getTask({taskId:i},o);if(yield{type:"taskStatus",task:s},Ht(s.status)){s.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:i},r,o)}:s.status==="failed"?yield{type:"error",error:new J(W.InternalError,`Task ${i} failed`)}:s.status==="cancelled"&&(yield{type:"error",error:new J(W.InternalError,`Task ${i} was cancelled`)});return}if(s.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:i},r,o)};return}const c=s.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(u=>setTimeout(u,c)),o?.signal?.throwIfAborted()}}catch(a){yield{type:"error",error:a instanceof J?a:new J(W.InternalError,String(a))}}}request(t,r,o){const{relatedRequestId:n,resumptionToken:i,onresumptiontoken:a,task:s,relatedTask:c}=o??{};return new Promise((u,l)=>{const d=y=>{l(y)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method),s&&this.assertTaskCapability(t.method)}catch(y){d(y);return}o?.signal?.throwIfAborted();const p=this._requestMessageId++,m={...t,jsonrpc:"2.0",id:p};o?.onprogress&&(this._progressHandlers.set(p,o.onprogress),m.params={...t.params,_meta:{...t.params?._meta||{},progressToken:p}}),s&&(m.params={...m.params,task:s}),c&&(m.params={...m.params,_meta:{...m.params?._meta||{},[Jt]:c}});const f=y=>{this._responseHandlers.delete(p),this._progressHandlers.delete(p),this._cleanupTimeout(p),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:p,reason:String(y)}},{relatedRequestId:n,resumptionToken:i,onresumptiontoken:a}).catch(I=>this._onerror(new Error(`Failed to send cancellation: ${I}`)));const b=y instanceof J?y:new J(W.RequestTimeout,String(y));l(b)};this._responseHandlers.set(p,y=>{if(!o?.signal?.aborted){if(y instanceof Error)return l(y);try{const b=ur(r,y.result);b.success?u(b.data):l(b.error)}catch(b){l(b)}}}),o?.signal?.addEventListener("abort",()=>{f(o?.signal?.reason)});const _=o?.timeout??YS,g=()=>f(J.fromError(W.RequestTimeout,"Request timed out",{timeout:_}));this._setupTimeout(p,_,o?.maxTotalTimeout,g,o?.resetTimeoutOnProgress??!1);const v=c?.taskId;if(v){const y=b=>{const I=this._responseHandlers.get(p);I?I(b):this._onerror(new Error(`Response handler missing for side-channeled request ${p}`))};this._requestResolvers.set(p,y),this._enqueueTaskMessage(v,{type:"request",message:m,timestamp:Date.now()}).catch(b=>{this._cleanupTimeout(p),l(b)})}else this._transport.send(m,{relatedRequestId:n,resumptionToken:i,onresumptiontoken:a}).catch(y=>{this._cleanupTimeout(p),l(y)})})}async getTask(t,r){return this.request({method:"tasks/get",params:t},js,r)}async getTaskResult(t,r,o){return this.request({method:"tasks/result",params:t},r,o)}async listTasks(t,r){return this.request({method:"tasks/list",params:t},Cs,r)}async cancelTask(t,r){return this.request({method:"tasks/cancel",params:t},Qb,r)}async notification(t,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(t.method);const o=r?.relatedTask?.taskId;if(o){const s={...t,jsonrpc:"2.0",params:{...t.params,_meta:{...t.params?._meta||{},[Jt]:r.relatedTask}}};await this._enqueueTaskMessage(o,{type:"notification",message:s,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(t.method),!this._transport)return;let s={...t,jsonrpc:"2.0"};r?.relatedTask&&(s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[Jt]:r.relatedTask}}}),this._transport?.send(s,r).catch(c=>this._onerror(c))});return}let a={...t,jsonrpc:"2.0"};r?.relatedTask&&(a={...a,params:{...a.params,_meta:{...a.params?._meta||{},[Jt]:r.relatedTask}}}),await this._transport.send(a,r)}setRequestHandler(t,r){const o=tg(t);this.assertRequestHandlerCapability(o),this._requestHandlers.set(o,(n,i)=>{const a=ng(t,n);return Promise.resolve(r(a,i))})}removeRequestHandler(t){this._requestHandlers.delete(t)}assertCanSetRequestHandler(t){if(this._requestHandlers.has(t))throw new Error(`A request handler for ${t} already exists, which would be overridden`)}setNotificationHandler(t,r){const o=tg(t);this._notificationHandlers.set(o,n=>{const i=ng(t,n);return Promise.resolve(r(i))})}removeNotificationHandler(t){this._notificationHandlers.delete(t)}_cleanupTaskProgressHandler(t){const r=this._taskProgressTokens.get(t);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(t))}async _enqueueTaskMessage(t,r,o){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const n=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(t,r,o,n)}async _clearTaskQueue(t,r){if(this._taskMessageQueue){const o=await this._taskMessageQueue.dequeueAll(t,r);for(const n of o)if(n.type==="request"&&zh(n.message)){const i=n.message.id,a=this._requestResolvers.get(i);a?(a(new J(W.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(i)):this._onerror(new Error(`Resolver missing for request ${i} during task ${t} cleanup`))}}}async _waitForTaskUpdate(t,r){let o=this._options?.defaultTaskPollInterval??1e3;try{const n=await this._taskStore?.getTask(t);n?.pollInterval&&(o=n.pollInterval)}catch{}return new Promise((n,i)=>{if(r.aborted){i(new J(W.InvalidRequest,"Request cancelled"));return}const a=setTimeout(n,o);r.addEventListener("abort",()=>{clearTimeout(a),i(new J(W.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(t,r){const o=this._taskStore;if(!o)throw new Error("No task store configured");return{createTask:async n=>{if(!t)throw new Error("No request provided");return await o.createTask(n,t.id,{method:t.method,params:t.params},r)},getTask:async n=>{const i=await o.getTask(n,r);if(!i)throw new J(W.InvalidParams,"Failed to retrieve task: Task not found");return i},storeTaskResult:async(n,i,a)=>{await o.storeTaskResult(n,i,a,r);const s=await o.getTask(n,r);if(s){const c=Bo.parse({method:"notifications/tasks/status",params:s});await this.notification(c),Ht(s.status)&&this._cleanupTaskProgressHandler(n)}},getTaskResult:n=>o.getTaskResult(n,r),updateTaskStatus:async(n,i,a)=>{const s=await o.getTask(n,r);if(!s)throw new J(W.InvalidParams,`Task "${n}" not found - it may have been cleaned up`);if(Ht(s.status))throw new J(W.InvalidParams,`Cannot update task "${n}" from terminal status "${s.status}" to "${i}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await o.updateTaskStatus(n,i,a,r);const c=await o.getTask(n,r);if(c){const u=Bo.parse({method:"notifications/tasks/status",params:c});await this.notification(u),Ht(c.status)&&this._cleanupTaskProgressHandler(n)}},listTasks:n=>o.listTasks(n,r)}}}function rg(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function QS(e,t){const r={...e};for(const o in t){const n=o,i=t[n];if(i===void 0)continue;const a=r[n];rg(a)&&rg(i)?r[n]={...a,...i}:r[n]=i}return r}function og(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var tc={exports:{}},ig={},Tt={},Kt={},nc={},se={},yr={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends t{constructor(y){if(super(),!e.IDENTIFIER.test(y))throw new Error("CodeGen: name must be a valid identifier");this.str=y}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class o extends t{constructor(y){super(),this._items=typeof y=="string"?[y]:y}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const y=this._items[0];return y===""||y==='""'}get str(){var y;return(y=this._str)!==null&&y!==void 0?y:this._str=this._items.reduce((b,I)=>`${b}${I}`,"")}get names(){var y;return(y=this._names)!==null&&y!==void 0?y:this._names=this._items.reduce((b,I)=>(I instanceof r&&(b[I.str]=(b[I.str]||0)+1),b),{})}}e._Code=o,e.nil=new o("");function n(v,...y){const b=[v[0]];let I=0;for(;I<y.length;)s(b,y[I]),b.push(v[++I]);return new o(b)}e._=n;const i=new o("+");function a(v,...y){const b=[m(v[0])];let I=0;for(;I<y.length;)b.push(i),s(b,y[I]),b.push(i,m(v[++I]));return c(b),new o(b)}e.str=a;function s(v,y){y instanceof o?v.push(...y._items):y instanceof r?v.push(y):v.push(d(y))}e.addCodeArg=s;function c(v){let y=1;for(;y<v.length-1;){if(v[y]===i){const b=u(v[y-1],v[y+1]);if(b!==void 0){v.splice(y-1,3,b);continue}v[y++]="+"}y++}}function u(v,y){if(y==='""')return v;if(v==='""')return y;if(typeof v=="string")return y instanceof r||v[v.length-1]!=='"'?void 0:typeof y!="string"?`${v.slice(0,-1)}${y}"`:y[0]==='"'?v.slice(0,-1)+y.slice(1):void 0;if(typeof y=="string"&&y[0]==='"'&&!(v instanceof r))return`"${v}${y.slice(1)}`}function l(v,y){return y.emptyStr()?v:v.emptyStr()?y:a`${v}${y}`}e.strConcat=l;function d(v){return typeof v=="number"||typeof v=="boolean"||v===null?v:m(Array.isArray(v)?v.join(","):v)}function p(v){return new o(m(v))}e.stringify=p;function m(v){return JSON.stringify(v).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=m;function f(v){return typeof v=="string"&&e.IDENTIFIER.test(v)?new o(`.${v}`):n`[${v}]`}e.getProperty=f;function _(v){if(typeof v=="string"&&e.IDENTIFIER.test(v))return new o(`${v}`);throw new Error(`CodeGen: invalid export name: ${v}, use explicit $id name mapping`)}e.getEsmExportName=_;function g(v){return new o(v.toString())}e.regexpCode=g})(yr);var rc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=yr;class r extends Error{constructor(u){super(`CodeGen: "code" for ${u} not defined`),this.value=u.value}}var o;(function(c){c[c.Started=0]="Started",c[c.Completed=1]="Completed"})(o||(e.UsedValueState=o={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class n{constructor({prefixes:u,parent:l}={}){this._names={},this._prefixes=u,this._parent=l}toName(u){return u instanceof t.Name?u:this.name(u)}name(u){return new t.Name(this._newName(u))}_newName(u){const l=this._names[u]||this._nameGroup(u);return`${u}${l.index++}`}_nameGroup(u){var l,d;if(!((d=(l=this._parent)===null||l===void 0?void 0:l._prefixes)===null||d===void 0)&&d.has(u)||this._prefixes&&!this._prefixes.has(u))throw new Error(`CodeGen: prefix "${u}" is not allowed in this scope`);return this._names[u]={prefix:u,index:0}}}e.Scope=n;class i extends t.Name{constructor(u,l){super(l),this.prefix=u}setValue(u,{property:l,itemIndex:d}){this.value=u,this.scopePath=(0,t._)`.${new t.Name(l)}[${d}]`}}e.ValueScopeName=i;const a=(0,t._)`\n`;class s extends n{constructor(u){super(u),this._values={},this._scope=u.scope,this.opts={...u,_n:u.lines?a:t.nil}}get(){return this._scope}name(u){return new i(u,this._newName(u))}value(u,l){var d;if(l.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const p=this.toName(u),{prefix:m}=p,f=(d=l.key)!==null&&d!==void 0?d:l.ref;let _=this._values[m];if(_){const y=_.get(f);if(y)return y}else _=this._values[m]=new Map;_.set(f,p);const g=this._scope[m]||(this._scope[m]=[]),v=g.length;return g[v]=l.ref,p.setValue(l,{property:m,itemIndex:v}),p}getValue(u,l){const d=this._values[u];if(d)return d.get(l)}scopeRefs(u,l=this._values){return this._reduceValues(l,d=>{if(d.scopePath===void 0)throw new Error(`CodeGen: name "${d}" has no value`);return(0,t._)`${u}${d.scopePath}`})}scopeCode(u=this._values,l,d){return this._reduceValues(u,p=>{if(p.value===void 0)throw new Error(`CodeGen: name "${p}" has no value`);return p.value.code},l,d)}_reduceValues(u,l,d={},p){let m=t.nil;for(const f in u){const _=u[f];if(!_)continue;const g=d[f]=d[f]||new Map;_.forEach(v=>{if(g.has(v))return;g.set(v,o.Started);let y=l(v);if(y){const b=this.opts.es5?e.varKinds.var:e.varKinds.const;m=(0,t._)`${m}${b} ${v} = ${y};${this.opts._n}`}else if(y=p?.(v))m=(0,t._)`${m}${y}${this.opts._n}`;else throw new r(v);g.set(v,o.Completed)})}return m}}e.ValueScope=s})(rc),(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=yr,r=rc;var o=yr;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return o.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return o.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return o.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return o.Name}});var n=rc;Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return n.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return n.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return n.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return n.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class i{optimizeNodes(){return this}optimizeNames(h,$){return this}}class a extends i{constructor(h,$,N){super(),this.varKind=h,this.name=$,this.rhs=N}render({es5:h,_n:$}){const N=h?r.varKinds.var:this.varKind,F=this.rhs===void 0?"":` = ${this.rhs}`;return`${N} ${this.name}${F};`+$}optimizeNames(h,$){if(h[this.name.str])return this.rhs&&(this.rhs=K(this.rhs,h,$)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class s extends i{constructor(h,$,N){super(),this.lhs=h,this.rhs=$,this.sideEffects=N}render({_n:h}){return`${this.lhs} = ${this.rhs};`+h}optimizeNames(h,$){if(!(this.lhs instanceof t.Name&&!h[this.lhs.str]&&!this.sideEffects))return this.rhs=K(this.rhs,h,$),this}get names(){const h=this.lhs instanceof t.Name?{}:{...this.lhs.names};return Y(h,this.rhs)}}class c extends s{constructor(h,$,N,F){super(h,N,F),this.op=$}render({_n:h}){return`${this.lhs} ${this.op}= ${this.rhs};`+h}}class u extends i{constructor(h){super(),this.label=h,this.names={}}render({_n:h}){return`${this.label}:`+h}}class l extends i{constructor(h){super(),this.label=h,this.names={}}render({_n:h}){return`break${this.label?` ${this.label}`:""};`+h}}class d extends i{constructor(h){super(),this.error=h}render({_n:h}){return`throw ${this.error};`+h}get names(){return this.error.names}}class p extends i{constructor(h){super(),this.code=h}render({_n:h}){return`${this.code};`+h}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(h,$){return this.code=K(this.code,h,$),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class m extends i{constructor(h=[]){super(),this.nodes=h}render(h){return this.nodes.reduce(($,N)=>$+N.render(h),"")}optimizeNodes(){const{nodes:h}=this;let $=h.length;for(;$--;){const N=h[$].optimizeNodes();Array.isArray(N)?h.splice($,1,...N):N?h[$]=N:h.splice($,1)}return h.length>0?this:void 0}optimizeNames(h,$){const{nodes:N}=this;let F=N.length;for(;F--;){const H=N[F];H.optimizeNames(h,$)||(Pe(h,H.names),N.splice(F,1))}return N.length>0?this:void 0}get names(){return this.nodes.reduce((h,$)=>Q(h,$.names),{})}}class f extends m{render(h){return"{"+h._n+super.render(h)+"}"+h._n}}class _ extends m{}class g extends f{}g.kind="else";class v extends f{constructor(h,$){super($),this.condition=h}render(h){let $=`if(${this.condition})`+super.render(h);return this.else&&($+="else "+this.else.render(h)),$}optimizeNodes(){super.optimizeNodes();const h=this.condition;if(h===!0)return this.nodes;let $=this.else;if($){const N=$.optimizeNodes();$=this.else=Array.isArray(N)?new g(N):N}if($)return h===!1?$ instanceof v?$:$.nodes:this.nodes.length?this:new v(ot(h),$ instanceof v?[$]:$.nodes);if(!(h===!1||!this.nodes.length))return this}optimizeNames(h,$){var N;if(this.else=(N=this.else)===null||N===void 0?void 0:N.optimizeNames(h,$),!!(super.optimizeNames(h,$)||this.else))return this.condition=K(this.condition,h,$),this}get names(){const h=super.names;return Y(h,this.condition),this.else&&Q(h,this.else.names),h}}v.kind="if";class y extends f{}y.kind="for";class b extends y{constructor(h){super(),this.iteration=h}render(h){return`for(${this.iteration})`+super.render(h)}optimizeNames(h,$){if(super.optimizeNames(h,$))return this.iteration=K(this.iteration,h,$),this}get names(){return Q(super.names,this.iteration.names)}}class I extends y{constructor(h,$,N,F){super(),this.varKind=h,this.name=$,this.from=N,this.to=F}render(h){const $=h.es5?r.varKinds.var:this.varKind,{name:N,from:F,to:H}=this;return`for(${$} ${N}=${F}; ${N}<${H}; ${N}++)`+super.render(h)}get names(){const h=Y(super.names,this.from);return Y(h,this.to)}}class x extends y{constructor(h,$,N,F){super(),this.loop=h,this.varKind=$,this.name=N,this.iterable=F}render(h){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(h)}optimizeNames(h,$){if(super.optimizeNames(h,$))return this.iterable=K(this.iterable,h,$),this}get names(){return Q(super.names,this.iterable.names)}}class B extends f{constructor(h,$,N){super(),this.name=h,this.args=$,this.async=N}render(h){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(h)}}B.kind="func";class L extends m{render(h){return"return "+super.render(h)}}L.kind="return";class ue extends f{render(h){let $="try"+super.render(h);return this.catch&&($+=this.catch.render(h)),this.finally&&($+=this.finally.render(h)),$}optimizeNodes(){var h,$;return super.optimizeNodes(),(h=this.catch)===null||h===void 0||h.optimizeNodes(),($=this.finally)===null||$===void 0||$.optimizeNodes(),this}optimizeNames(h,$){var N,F;return super.optimizeNames(h,$),(N=this.catch)===null||N===void 0||N.optimizeNames(h,$),(F=this.finally)===null||F===void 0||F.optimizeNames(h,$),this}get names(){const h=super.names;return this.catch&&Q(h,this.catch.names),this.finally&&Q(h,this.finally.names),h}}class me extends f{constructor(h){super(),this.error=h}render(h){return`catch(${this.error})`+super.render(h)}}me.kind="catch";class Te extends f{render(h){return"finally"+super.render(h)}}Te.kind="finally";class Z{constructor(h,$={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...$,_n:$.lines?`
|
|
71
|
+
`:""},this._extScope=h,this._scope=new r.Scope({parent:h}),this._nodes=[new _]}toString(){return this._root.render(this.opts)}name(h){return this._scope.name(h)}scopeName(h){return this._extScope.name(h)}scopeValue(h,$){const N=this._extScope.value(h,$);return(this._values[N.prefix]||(this._values[N.prefix]=new Set)).add(N),N}getScopeValue(h,$){return this._extScope.getValue(h,$)}scopeRefs(h){return this._extScope.scopeRefs(h,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(h,$,N,F){const H=this._scope.toName($);return N!==void 0&&F&&(this._constants[H.str]=N),this._leafNode(new a(h,H,N)),H}const(h,$,N){return this._def(r.varKinds.const,h,$,N)}let(h,$,N){return this._def(r.varKinds.let,h,$,N)}var(h,$,N){return this._def(r.varKinds.var,h,$,N)}assign(h,$,N){return this._leafNode(new s(h,$,N))}add(h,$){return this._leafNode(new c(h,e.operators.ADD,$))}code(h){return typeof h=="function"?h():h!==t.nil&&this._leafNode(new p(h)),this}object(...h){const $=["{"];for(const[N,F]of h)$.length>1&&$.push(","),$.push(N),(N!==F||this.opts.es5)&&($.push(":"),(0,t.addCodeArg)($,F));return $.push("}"),new t._Code($)}if(h,$,N){if(this._blockNode(new v(h)),$&&N)this.code($).else().code(N).endIf();else if($)this.code($).endIf();else if(N)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(h){return this._elseNode(new v(h))}else(){return this._elseNode(new g)}endIf(){return this._endBlockNode(v,g)}_for(h,$){return this._blockNode(h),$&&this.code($).endFor(),this}for(h,$){return this._for(new b(h),$)}forRange(h,$,N,F,H=this.opts.es5?r.varKinds.var:r.varKinds.let){const pe=this._scope.toName(h);return this._for(new I(H,pe,$,N),()=>F(pe))}forOf(h,$,N,F=r.varKinds.const){const H=this._scope.toName(h);if(this.opts.es5){const pe=$ instanceof t.Name?$:this.var("_arr",$);return this.forRange("_i",0,(0,t._)`${pe}.length`,le=>{this.var(H,(0,t._)`${pe}[${le}]`),N(H)})}return this._for(new x("of",F,H,$),()=>N(H))}forIn(h,$,N,F=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(h,(0,t._)`Object.keys(${$})`,N);const H=this._scope.toName(h);return this._for(new x("in",F,H,$),()=>N(H))}endFor(){return this._endBlockNode(y)}label(h){return this._leafNode(new u(h))}break(h){return this._leafNode(new l(h))}return(h){const $=new L;if(this._blockNode($),this.code(h),$.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(L)}try(h,$,N){if(!$&&!N)throw new Error('CodeGen: "try" without "catch" and "finally"');const F=new ue;if(this._blockNode(F),this.code(h),$){const H=this.name("e");this._currNode=F.catch=new me(H),$(H)}return N&&(this._currNode=F.finally=new Te,this.code(N)),this._endBlockNode(me,Te)}throw(h){return this._leafNode(new d(h))}block(h,$){return this._blockStarts.push(this._nodes.length),h&&this.code(h).endBlock($),this}endBlock(h){const $=this._blockStarts.pop();if($===void 0)throw new Error("CodeGen: not in self-balancing block");const N=this._nodes.length-$;if(N<0||h!==void 0&&N!==h)throw new Error(`CodeGen: wrong number of nodes: ${N} vs ${h} expected`);return this._nodes.length=$,this}func(h,$=t.nil,N,F){return this._blockNode(new B(h,$,N)),F&&this.code(F).endFunc(),this}endFunc(){return this._endBlockNode(B)}optimize(h=1){for(;h-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(h){return this._currNode.nodes.push(h),this}_blockNode(h){this._currNode.nodes.push(h),this._nodes.push(h)}_endBlockNode(h,$){const N=this._currNode;if(N instanceof h||$&&N instanceof $)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${$?`${h.kind}/${$.kind}`:h.kind}"`)}_elseNode(h){const $=this._currNode;if(!($ instanceof v))throw new Error('CodeGen: "else" without "if"');return this._currNode=$.else=h,this}get _root(){return this._nodes[0]}get _currNode(){const h=this._nodes;return h[h.length-1]}set _currNode(h){const $=this._nodes;$[$.length-1]=h}}e.CodeGen=Z;function Q(P,h){for(const $ in h)P[$]=(P[$]||0)+(h[$]||0);return P}function Y(P,h){return h instanceof t._CodeOrName?Q(P,h.names):P}function K(P,h,$){if(P instanceof t.Name)return N(P);if(!F(P))return P;return new t._Code(P._items.reduce((H,pe)=>(pe instanceof t.Name&&(pe=N(pe)),pe instanceof t._Code?H.push(...pe._items):H.push(pe),H),[]));function N(H){const pe=$[H.str];return pe===void 0||h[H.str]!==1?H:(delete h[H.str],pe)}function F(H){return H instanceof t._Code&&H._items.some(pe=>pe instanceof t.Name&&h[pe.str]===1&&$[pe.str]!==void 0)}}function Pe(P,h){for(const $ in h)P[$]=(P[$]||0)-(h[$]||0)}function ot(P){return typeof P=="boolean"||typeof P=="number"||P===null?!P:(0,t._)`!${j(P)}`}e.not=ot;const it=O(e.operators.AND);function Mt(...P){return P.reduce(it)}e.and=Mt;const wt=O(e.operators.OR);function C(...P){return P.reduce(wt)}e.or=C;function O(P){return(h,$)=>h===t.nil?$:$===t.nil?h:(0,t._)`${j(h)} ${P} ${j($)}`}function j(P){return P instanceof t.Name?P:(0,t._)`(${P})`}})(se);var M={};Object.defineProperty(M,"__esModule",{value:!0}),M.checkStrictMode=M.getErrorPath=M.Type=M.useFunc=M.setEvaluated=M.evaluatedPropsToName=M.mergeEvaluated=M.eachItem=M.unescapeJsonPointer=M.escapeJsonPointer=M.escapeFragment=M.unescapeFragment=M.schemaRefOrVal=M.schemaHasRulesButRef=M.schemaHasRules=M.checkUnknownRules=M.alwaysValidSchema=M.toHash=void 0;const Se=se,ew=yr;function tw(e){const t={};for(const r of e)t[r]=!0;return t}M.toHash=tw;function nw(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(ag(e,t),!sg(t,e.self.RULES.all))}M.alwaysValidSchema=nw;function ag(e,t=e.schema){const{opts:r,self:o}=e;if(!r.strictSchema||typeof t=="boolean")return;const n=o.RULES.keywords;for(const i in t)n[i]||mg(e,`unknown keyword: "${i}"`)}M.checkUnknownRules=ag;function sg(e,t){if(typeof e=="boolean")return!e;for(const r in e)if(t[r])return!0;return!1}M.schemaHasRules=sg;function rw(e,t){if(typeof e=="boolean")return!e;for(const r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}M.schemaHasRulesButRef=rw;function ow({topSchemaRef:e,schemaPath:t},r,o,n){if(!n){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,Se._)`${r}`}return(0,Se._)`${e}${t}${(0,Se.getProperty)(o)}`}M.schemaRefOrVal=ow;function iw(e){return cg(decodeURIComponent(e))}M.unescapeFragment=iw;function aw(e){return encodeURIComponent(oc(e))}M.escapeFragment=aw;function oc(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}M.escapeJsonPointer=oc;function cg(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}M.unescapeJsonPointer=cg;function sw(e,t){if(Array.isArray(e))for(const r of e)t(r);else t(e)}M.eachItem=sw;function ug({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:o}){return(n,i,a,s)=>{const c=a===void 0?i:a instanceof Se.Name?(i instanceof Se.Name?e(n,i,a):t(n,i,a),a):i instanceof Se.Name?(t(n,a,i),i):r(i,a);return s===Se.Name&&!(c instanceof Se.Name)?o(n,c):c}}M.mergeEvaluated={props:ug({mergeNames:(e,t,r)=>e.if((0,Se._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,Se._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,Se._)`${r} || {}`).code((0,Se._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,Se._)`${r} !== true`,()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,Se._)`${r} || {}`),ic(e,r,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:lg}),items:ug({mergeNames:(e,t,r)=>e.if((0,Se._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,Se._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,Se._)`${r} !== true`,()=>e.assign(r,t===!0?!0:(0,Se._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function lg(e,t){if(t===!0)return e.var("props",!0);const r=e.var("props",(0,Se._)`{}`);return t!==void 0&&ic(e,r,t),r}M.evaluatedPropsToName=lg;function ic(e,t,r){Object.keys(r).forEach(o=>e.assign((0,Se._)`${t}${(0,Se.getProperty)(o)}`,!0))}M.setEvaluated=ic;const dg={};function cw(e,t){return e.scopeValue("func",{ref:t,code:dg[t.code]||(dg[t.code]=new ew._Code(t.code))})}M.useFunc=cw;var ac;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(ac||(M.Type=ac={}));function uw(e,t,r){if(e instanceof Se.Name){const o=t===ac.Num;return r?o?(0,Se._)`"[" + ${e} + "]"`:(0,Se._)`"['" + ${e} + "']"`:o?(0,Se._)`"/" + ${e}`:(0,Se._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,Se.getProperty)(e).toString():"/"+oc(e)}M.getErrorPath=uw;function mg(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,r===!0)throw new Error(t);e.self.logger.warn(t)}}M.checkStrictMode=mg;var Jo={},pg;function At(){if(pg)return Jo;pg=1,Object.defineProperty(Jo,"__esModule",{value:!0});const e=se,t={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};return Jo.default=t,Jo}var fg;function Ho(){return fg||(fg=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=se,r=M,o=At();e.keywordError={message:({keyword:g})=>(0,t.str)`must pass "${g}" keyword validation`},e.keyword$DataError={message:({keyword:g,schemaType:v})=>v?(0,t.str)`"${g}" keyword must be ${v} ($data)`:(0,t.str)`"${g}" keyword is invalid ($data)`};function n(g,v=e.keywordError,y,b){const{it:I}=g,{gen:x,compositeRule:B,allErrors:L}=I,ue=d(g,v,y);b??(B||L)?c(x,ue):u(I,(0,t._)`[${ue}]`)}e.reportError=n;function i(g,v=e.keywordError,y){const{it:b}=g,{gen:I,compositeRule:x,allErrors:B}=b,L=d(g,v,y);c(I,L),x||B||u(b,o.default.vErrors)}e.reportExtraError=i;function a(g,v){g.assign(o.default.errors,v),g.if((0,t._)`${o.default.vErrors} !== null`,()=>g.if(v,()=>g.assign((0,t._)`${o.default.vErrors}.length`,v),()=>g.assign(o.default.vErrors,null)))}e.resetErrorsCount=a;function s({gen:g,keyword:v,schemaValue:y,data:b,errsCount:I,it:x}){if(I===void 0)throw new Error("ajv implementation error");const B=g.name("err");g.forRange("i",I,o.default.errors,L=>{g.const(B,(0,t._)`${o.default.vErrors}[${L}]`),g.if((0,t._)`${B}.instancePath === undefined`,()=>g.assign((0,t._)`${B}.instancePath`,(0,t.strConcat)(o.default.instancePath,x.errorPath))),g.assign((0,t._)`${B}.schemaPath`,(0,t.str)`${x.errSchemaPath}/${v}`),x.opts.verbose&&(g.assign((0,t._)`${B}.schema`,y),g.assign((0,t._)`${B}.data`,b))})}e.extendErrors=s;function c(g,v){const y=g.const("err",v);g.if((0,t._)`${o.default.vErrors} === null`,()=>g.assign(o.default.vErrors,(0,t._)`[${y}]`),(0,t._)`${o.default.vErrors}.push(${y})`),g.code((0,t._)`${o.default.errors}++`)}function u(g,v){const{gen:y,validateName:b,schemaEnv:I}=g;I.$async?y.throw((0,t._)`new ${g.ValidationError}(${v})`):(y.assign((0,t._)`${b}.errors`,v),y.return(!1))}const l={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function d(g,v,y){const{createErrors:b}=g.it;return b===!1?(0,t._)`{}`:p(g,v,y)}function p(g,v,y={}){const{gen:b,it:I}=g,x=[m(I,y),f(g,y)];return _(g,v,x),b.object(...x)}function m({errorPath:g},{instancePath:v}){const y=v?(0,t.str)`${g}${(0,r.getErrorPath)(v,r.Type.Str)}`:g;return[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,y)]}function f({keyword:g,it:{errSchemaPath:v}},{schemaPath:y,parentSchema:b}){let I=b?v:(0,t.str)`${v}/${g}`;return y&&(I=(0,t.str)`${I}${(0,r.getErrorPath)(y,r.Type.Str)}`),[l.schemaPath,I]}function _(g,{params:v,message:y},b){const{keyword:I,data:x,schemaValue:B,it:L}=g,{opts:ue,propertyName:me,topSchemaRef:Te,schemaPath:Z}=L;b.push([l.keyword,I],[l.params,typeof v=="function"?v(g):v||(0,t._)`{}`]),ue.messages&&b.push([l.message,typeof y=="function"?y(g):y]),ue.verbose&&b.push([l.schema,B],[l.parentSchema,(0,t._)`${Te}${Z}`],[o.default.data,x]),me&&b.push([l.propertyName,me])}})(nc)),nc}var hg;function lw(){if(hg)return Kt;hg=1,Object.defineProperty(Kt,"__esModule",{value:!0}),Kt.boolOrEmptySchema=Kt.topBoolOrEmptySchema=void 0;const e=Ho(),t=se,r=At(),o={message:"boolean schema is false"};function n(s){const{gen:c,schema:u,validateName:l}=s;u===!1?a(s,!1):typeof u=="object"&&u.$async===!0?c.return(r.default.data):(c.assign((0,t._)`${l}.errors`,null),c.return(!0))}Kt.topBoolOrEmptySchema=n;function i(s,c){const{gen:u,schema:l}=s;l===!1?(u.var(c,!1),a(s)):u.var(c,!0)}Kt.boolOrEmptySchema=i;function a(s,c){const{gen:u,data:l}=s,d={gen:u,keyword:"false schema",data:l,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:s};(0,e.reportError)(d,o,void 0,c)}return Kt}var ze={},Gt={};Object.defineProperty(Gt,"__esModule",{value:!0}),Gt.getRules=Gt.isJSONType=void 0;const dw=["string","number","integer","boolean","null","object","array"],mw=new Set(dw);function pw(e){return typeof e=="string"&&mw.has(e)}Gt.isJSONType=pw;function fw(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}Gt.getRules=fw;var Pt={},gg;function vg(){if(gg)return Pt;gg=1,Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.shouldUseRule=Pt.shouldUseGroup=Pt.schemaHasRulesForType=void 0;function e({schema:o,self:n},i){const a=n.RULES.types[i];return a&&a!==!0&&t(o,a)}Pt.schemaHasRulesForType=e;function t(o,n){return n.rules.some(i=>r(o,i))}Pt.shouldUseGroup=t;function r(o,n){var i;return o[n.keyword]!==void 0||((i=n.definition.implements)===null||i===void 0?void 0:i.some(a=>o[a]!==void 0))}return Pt.shouldUseRule=r,Pt}Object.defineProperty(ze,"__esModule",{value:!0}),ze.reportTypeError=ze.checkDataTypes=ze.checkDataType=ze.coerceAndCheckDataType=ze.getJSONTypes=ze.getSchemaTypes=ze.DataType=void 0;const hw=Gt,gw=vg(),vw=Ho(),re=se,yg=M;var _n;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(_n||(ze.DataType=_n={}));function yw(e){const t=_g(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}ze.getSchemaTypes=yw;function _g(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(hw.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}ze.getJSONTypes=_g;function _w(e,t){const{gen:r,data:o,opts:n}=e,i=$w(t,n.coerceTypes),a=t.length>0&&!(i.length===0&&t.length===1&&(0,gw.schemaHasRulesForType)(e,t[0]));if(a){const s=cc(t,o,n.strictNumbers,_n.Wrong);r.if(s,()=>{i.length?bw(e,t,i):uc(e)})}return a}ze.coerceAndCheckDataType=_w;const $g=new Set(["string","number","integer","boolean","null"]);function $w(e,t){return t?e.filter(r=>$g.has(r)||t==="array"&&r==="array"):[]}function bw(e,t,r){const{gen:o,data:n,opts:i}=e,a=o.let("dataType",(0,re._)`typeof ${n}`),s=o.let("coerced",(0,re._)`undefined`);i.coerceTypes==="array"&&o.if((0,re._)`${a} == 'object' && Array.isArray(${n}) && ${n}.length == 1`,()=>o.assign(n,(0,re._)`${n}[0]`).assign(a,(0,re._)`typeof ${n}`).if(cc(t,n,i.strictNumbers),()=>o.assign(s,n))),o.if((0,re._)`${s} !== undefined`);for(const u of r)($g.has(u)||u==="array"&&i.coerceTypes==="array")&&c(u);o.else(),uc(e),o.endIf(),o.if((0,re._)`${s} !== undefined`,()=>{o.assign(n,s),kw(e,s)});function c(u){switch(u){case"string":o.elseIf((0,re._)`${a} == "number" || ${a} == "boolean"`).assign(s,(0,re._)`"" + ${n}`).elseIf((0,re._)`${n} === null`).assign(s,(0,re._)`""`);return;case"number":o.elseIf((0,re._)`${a} == "boolean" || ${n} === null
|
|
72
|
+
|| (${a} == "string" && ${n} && ${n} == +${n})`).assign(s,(0,re._)`+${n}`);return;case"integer":o.elseIf((0,re._)`${a} === "boolean" || ${n} === null
|
|
73
|
+
|| (${a} === "string" && ${n} && ${n} == +${n} && !(${n} % 1))`).assign(s,(0,re._)`+${n}`);return;case"boolean":o.elseIf((0,re._)`${n} === "false" || ${n} === 0 || ${n} === null`).assign(s,!1).elseIf((0,re._)`${n} === "true" || ${n} === 1`).assign(s,!0);return;case"null":o.elseIf((0,re._)`${n} === "" || ${n} === 0 || ${n} === false`),o.assign(s,null);return;case"array":o.elseIf((0,re._)`${a} === "string" || ${a} === "number"
|
|
74
|
+
|| ${a} === "boolean" || ${n} === null`).assign(s,(0,re._)`[${n}]`)}}}function kw({gen:e,parentData:t,parentDataProperty:r},o){e.if((0,re._)`${t} !== undefined`,()=>e.assign((0,re._)`${t}[${r}]`,o))}function sc(e,t,r,o=_n.Correct){const n=o===_n.Correct?re.operators.EQ:re.operators.NEQ;let i;switch(e){case"null":return(0,re._)`${t} ${n} null`;case"array":i=(0,re._)`Array.isArray(${t})`;break;case"object":i=(0,re._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=a((0,re._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=a();break;default:return(0,re._)`typeof ${t} ${n} ${e}`}return o===_n.Correct?i:(0,re.not)(i);function a(s=re.nil){return(0,re.and)((0,re._)`typeof ${t} == "number"`,s,r?(0,re._)`isFinite(${t})`:re.nil)}}ze.checkDataType=sc;function cc(e,t,r,o){if(e.length===1)return sc(e[0],t,r,o);let n;const i=(0,yg.toHash)(e);if(i.array&&i.object){const a=(0,re._)`typeof ${t} != "object"`;n=i.null?a:(0,re._)`!${t} || ${a}`,delete i.null,delete i.array,delete i.object}else n=re.nil;i.number&&delete i.integer;for(const a in i)n=(0,re.and)(n,sc(a,t,r,o));return n}ze.checkDataTypes=cc;const Sw={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,re._)`{type: ${e}}`:(0,re._)`{type: ${t}}`};function uc(e){const t=ww(e);(0,vw.reportError)(t,Sw)}ze.reportTypeError=uc;function ww(e){const{gen:t,data:r,schema:o}=e,n=(0,yg.schemaRefOrVal)(e,o,"type");return{gen:t,keyword:"type",data:r,schema:o.type,schemaCode:n,schemaValue:n,parentSchema:o,params:{},it:e}}var _r={},bg;function Iw(){if(bg)return _r;bg=1,Object.defineProperty(_r,"__esModule",{value:!0}),_r.assignDefaults=void 0;const e=se,t=M;function r(n,i){const{properties:a,items:s}=n.schema;if(i==="object"&&a)for(const c in a)o(n,c,a[c].default);else i==="array"&&Array.isArray(s)&&s.forEach((c,u)=>o(n,u,c.default))}_r.assignDefaults=r;function o(n,i,a){const{gen:s,compositeRule:c,data:u,opts:l}=n;if(a===void 0)return;const d=(0,e._)`${u}${(0,e.getProperty)(i)}`;if(c){(0,t.checkStrictMode)(n,`default is ignored for: ${d}`);return}let p=(0,e._)`${d} === undefined`;l.useDefaults==="empty"&&(p=(0,e._)`${p} || ${d} === null || ${d} === ""`),s.if(p,(0,e._)`${d} = ${(0,e.stringify)(a)}`)}return _r}var gt={},ye={},kg;function vt(){if(kg)return ye;kg=1,Object.defineProperty(ye,"__esModule",{value:!0}),ye.validateUnion=ye.validateArray=ye.usePattern=ye.callValidateCode=ye.schemaProperties=ye.allSchemaProperties=ye.noPropertyInData=ye.propertyInData=ye.isOwnProperty=ye.hasPropFunc=ye.reportMissingProp=ye.checkMissingProp=ye.checkReportMissingProp=void 0;const e=se,t=M,r=At(),o=M;function n(y,b){const{gen:I,data:x,it:B}=y;I.if(l(I,x,b,B.opts.ownProperties),()=>{y.setParams({missingProperty:(0,e._)`${b}`},!0),y.error()})}ye.checkReportMissingProp=n;function i({gen:y,data:b,it:{opts:I}},x,B){return(0,e.or)(...x.map(L=>(0,e.and)(l(y,b,L,I.ownProperties),(0,e._)`${B} = ${L}`)))}ye.checkMissingProp=i;function a(y,b){y.setParams({missingProperty:b},!0),y.error()}ye.reportMissingProp=a;function s(y){return y.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}ye.hasPropFunc=s;function c(y,b,I){return(0,e._)`${s(y)}.call(${b}, ${I})`}ye.isOwnProperty=c;function u(y,b,I,x){const B=(0,e._)`${b}${(0,e.getProperty)(I)} !== undefined`;return x?(0,e._)`${B} && ${c(y,b,I)}`:B}ye.propertyInData=u;function l(y,b,I,x){const B=(0,e._)`${b}${(0,e.getProperty)(I)} === undefined`;return x?(0,e.or)(B,(0,e.not)(c(y,b,I))):B}ye.noPropertyInData=l;function d(y){return y?Object.keys(y).filter(b=>b!=="__proto__"):[]}ye.allSchemaProperties=d;function p(y,b){return d(b).filter(I=>!(0,t.alwaysValidSchema)(y,b[I]))}ye.schemaProperties=p;function m({schemaCode:y,data:b,it:{gen:I,topSchemaRef:x,schemaPath:B,errorPath:L},it:ue},me,Te,Z){const Q=Z?(0,e._)`${y}, ${b}, ${x}${B}`:b,Y=[[r.default.instancePath,(0,e.strConcat)(r.default.instancePath,L)],[r.default.parentData,ue.parentData],[r.default.parentDataProperty,ue.parentDataProperty],[r.default.rootData,r.default.rootData]];ue.opts.dynamicRef&&Y.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const K=(0,e._)`${Q}, ${I.object(...Y)}`;return Te!==e.nil?(0,e._)`${me}.call(${Te}, ${K})`:(0,e._)`${me}(${K})`}ye.callValidateCode=m;const f=(0,e._)`new RegExp`;function _({gen:y,it:{opts:b}},I){const x=b.unicodeRegExp?"u":"",{regExp:B}=b.code,L=B(I,x);return y.scopeValue("pattern",{key:L.toString(),ref:L,code:(0,e._)`${B.code==="new RegExp"?f:(0,o.useFunc)(y,B)}(${I}, ${x})`})}ye.usePattern=_;function g(y){const{gen:b,data:I,keyword:x,it:B}=y,L=b.name("valid");if(B.allErrors){const me=b.let("valid",!0);return ue(()=>b.assign(me,!1)),me}return b.var(L,!0),ue(()=>b.break()),L;function ue(me){const Te=b.const("len",(0,e._)`${I}.length`);b.forRange("i",0,Te,Z=>{y.subschema({keyword:x,dataProp:Z,dataPropType:t.Type.Num},L),b.if((0,e.not)(L),me)})}}ye.validateArray=g;function v(y){const{gen:b,schema:I,keyword:x,it:B}=y;if(!Array.isArray(I))throw new Error("ajv implementation error");if(I.some(Te=>(0,t.alwaysValidSchema)(B,Te))&&!B.opts.unevaluated)return;const ue=b.let("valid",!1),me=b.name("_valid");b.block(()=>I.forEach((Te,Z)=>{const Q=y.subschema({keyword:x,schemaProp:Z,compositeRule:!0},me);b.assign(ue,(0,e._)`${ue} || ${me}`),y.mergeValidEvaluated(Q,me)||b.if((0,e.not)(ue))})),y.result(ue,()=>y.reset(),()=>y.error(!0))}return ye.validateUnion=v,ye}var Sg;function Ow(){if(Sg)return gt;Sg=1,Object.defineProperty(gt,"__esModule",{value:!0}),gt.validateKeywordUsage=gt.validSchemaType=gt.funcKeywordCode=gt.macroKeywordCode=void 0;const e=se,t=At(),r=vt(),o=Ho();function n(p,m){const{gen:f,keyword:_,schema:g,parentSchema:v,it:y}=p,b=m.macro.call(y.self,g,v,y),I=u(f,_,b);y.opts.validateSchema!==!1&&y.self.validateSchema(b,!0);const x=f.name("valid");p.subschema({schema:b,schemaPath:e.nil,errSchemaPath:`${y.errSchemaPath}/${_}`,topSchemaRef:I,compositeRule:!0},x),p.pass(x,()=>p.error(!0))}gt.macroKeywordCode=n;function i(p,m){var f;const{gen:_,keyword:g,schema:v,parentSchema:y,$data:b,it:I}=p;c(I,m);const x=!b&&m.compile?m.compile.call(I.self,v,y,I):m.validate,B=u(_,g,x),L=_.let("valid");p.block$data(L,ue),p.ok((f=m.valid)!==null&&f!==void 0?f:L);function ue(){if(m.errors===!1)Z(),m.modifying&&a(p),Q(()=>p.error());else{const Y=m.async?me():Te();m.modifying&&a(p),Q(()=>s(p,Y))}}function me(){const Y=_.let("ruleErrs",null);return _.try(()=>Z((0,e._)`await `),K=>_.assign(L,!1).if((0,e._)`${K} instanceof ${I.ValidationError}`,()=>_.assign(Y,(0,e._)`${K}.errors`),()=>_.throw(K))),Y}function Te(){const Y=(0,e._)`${B}.errors`;return _.assign(Y,null),Z(e.nil),Y}function Z(Y=m.async?(0,e._)`await `:e.nil){const K=I.opts.passContext?t.default.this:t.default.self,Pe=!("compile"in m&&!b||m.schema===!1);_.assign(L,(0,e._)`${Y}${(0,r.callValidateCode)(p,B,K,Pe)}`,m.modifying)}function Q(Y){var K;_.if((0,e.not)((K=m.valid)!==null&&K!==void 0?K:L),Y)}}gt.funcKeywordCode=i;function a(p){const{gen:m,data:f,it:_}=p;m.if(_.parentData,()=>m.assign(f,(0,e._)`${_.parentData}[${_.parentDataProperty}]`))}function s(p,m){const{gen:f}=p;f.if((0,e._)`Array.isArray(${m})`,()=>{f.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${m} : ${t.default.vErrors}.concat(${m})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,o.extendErrors)(p)},()=>p.error())}function c({schemaEnv:p},m){if(m.async&&!p.$async)throw new Error("async keyword in sync schema")}function u(p,m,f){if(f===void 0)throw new Error(`keyword "${m}" failed to compile`);return p.scopeValue("keyword",typeof f=="function"?{ref:f}:{ref:f,code:(0,e.stringify)(f)})}function l(p,m,f=!1){return!m.length||m.some(_=>_==="array"?Array.isArray(p):_==="object"?p&&typeof p=="object"&&!Array.isArray(p):typeof p==_||f&&typeof p>"u")}gt.validSchemaType=l;function d({schema:p,opts:m,self:f,errSchemaPath:_},g,v){if(Array.isArray(g.keyword)?!g.keyword.includes(v):g.keyword!==v)throw new Error("ajv implementation error");const y=g.dependencies;if(y?.some(b=>!Object.prototype.hasOwnProperty.call(p,b)))throw new Error(`parent schema must have dependencies of ${v}: ${y.join(",")}`);if(g.validateSchema&&!g.validateSchema(p[v])){const I=`keyword "${v}" value is invalid at path "${_}": `+f.errorsText(g.validateSchema.errors);if(m.validateSchema==="log")f.logger.error(I);else throw new Error(I)}}return gt.validateKeywordUsage=d,gt}var xt={},wg;function Tw(){if(wg)return xt;wg=1,Object.defineProperty(xt,"__esModule",{value:!0}),xt.extendSubschemaMode=xt.extendSubschemaData=xt.getSubschema=void 0;const e=se,t=M;function r(i,{keyword:a,schemaProp:s,schema:c,schemaPath:u,errSchemaPath:l,topSchemaRef:d}){if(a!==void 0&&c!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(a!==void 0){const p=i.schema[a];return s===void 0?{schema:p,schemaPath:(0,e._)`${i.schemaPath}${(0,e.getProperty)(a)}`,errSchemaPath:`${i.errSchemaPath}/${a}`}:{schema:p[s],schemaPath:(0,e._)`${i.schemaPath}${(0,e.getProperty)(a)}${(0,e.getProperty)(s)}`,errSchemaPath:`${i.errSchemaPath}/${a}/${(0,t.escapeFragment)(s)}`}}if(c!==void 0){if(u===void 0||l===void 0||d===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:c,schemaPath:u,topSchemaRef:d,errSchemaPath:l}}throw new Error('either "keyword" or "schema" must be passed')}xt.getSubschema=r;function o(i,a,{dataProp:s,dataPropType:c,data:u,dataTypes:l,propertyName:d}){if(u!==void 0&&s!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:p}=a;if(s!==void 0){const{errorPath:f,dataPathArr:_,opts:g}=a,v=p.let("data",(0,e._)`${a.data}${(0,e.getProperty)(s)}`,!0);m(v),i.errorPath=(0,e.str)`${f}${(0,t.getErrorPath)(s,c,g.jsPropertySyntax)}`,i.parentDataProperty=(0,e._)`${s}`,i.dataPathArr=[..._,i.parentDataProperty]}if(u!==void 0){const f=u instanceof e.Name?u:p.let("data",u,!0);m(f),d!==void 0&&(i.propertyName=d)}l&&(i.dataTypes=l);function m(f){i.data=f,i.dataLevel=a.dataLevel+1,i.dataTypes=[],a.definedProperties=new Set,i.parentData=a.data,i.dataNames=[...a.dataNames,f]}}xt.extendSubschemaData=o;function n(i,{jtdDiscriminator:a,jtdMetadata:s,compositeRule:c,createErrors:u,allErrors:l}){c!==void 0&&(i.compositeRule=c),u!==void 0&&(i.createErrors=u),l!==void 0&&(i.allErrors=l),i.jtdDiscriminator=a,i.jtdMetadata=s}return xt.extendSubschemaMode=n,xt}var Be={},Ig=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var o,n,i;if(Array.isArray(t)){if(o=t.length,o!=r.length)return!1;for(n=o;n--!==0;)if(!e(t[n],r[n]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),o=i.length,o!==Object.keys(r).length)return!1;for(n=o;n--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[n]))return!1;for(n=o;n--!==0;){var a=i[n];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r},Og={exports:{}},Ct=Og.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var o=typeof r=="function"?r:r.pre||function(){},n=r.post||function(){};Ko(t,o,n,e,"",e)};Ct.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},Ct.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},Ct.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},Ct.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Ko(e,t,r,o,n,i,a,s,c,u){if(o&&typeof o=="object"&&!Array.isArray(o)){t(o,n,i,a,s,c,u);for(var l in o){var d=o[l];if(Array.isArray(d)){if(l in Ct.arrayKeywords)for(var p=0;p<d.length;p++)Ko(e,t,r,d[p],n+"/"+l+"/"+p,i,n,l,o,p)}else if(l in Ct.propsKeywords){if(d&&typeof d=="object")for(var m in d)Ko(e,t,r,d[m],n+"/"+l+"/"+Pw(m),i,n,l,o,m)}else(l in Ct.keywords||e.allKeys&&!(l in Ct.skipKeywords))&&Ko(e,t,r,d,n+"/"+l,i,n,l,o)}r(o,n,i,a,s,c,u)}}function Pw(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}var xw=Og.exports;Object.defineProperty(Be,"__esModule",{value:!0}),Be.getSchemaRefs=Be.resolveUrl=Be.normalizeId=Be._getFullPath=Be.getFullPath=Be.inlineRef=void 0;const Nw=M,Ew=Ig,zw=xw,jw=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Dw(e,t=!0){return typeof e=="boolean"?!0:t===!0?!lc(e):t?Tg(e)<=t:!1}Be.inlineRef=Dw;const Aw=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function lc(e){for(const t in e){if(Aw.has(t))return!0;const r=e[t];if(Array.isArray(r)&&r.some(lc)||typeof r=="object"&&lc(r))return!0}return!1}function Tg(e){let t=0;for(const r in e){if(r==="$ref")return 1/0;if(t++,!jw.has(r)&&(typeof e[r]=="object"&&(0,Nw.eachItem)(e[r],o=>t+=Tg(o)),t===1/0))return 1/0}return t}function Pg(e,t="",r){r!==!1&&(t=$n(t));const o=e.parse(t);return xg(e,o)}Be.getFullPath=Pg;function xg(e,t){return e.serialize(t).split("#")[0]+"#"}Be._getFullPath=xg;const Cw=/#\/?$/;function $n(e){return e?e.replace(Cw,""):""}Be.normalizeId=$n;function Rw(e,t,r){return r=$n(r),e.resolve(t,r)}Be.resolveUrl=Rw;const Uw=/^[a-z_][-a-z0-9._]*$/i;function Mw(e,t){if(typeof e=="boolean")return{};const{schemaId:r,uriResolver:o}=this.opts,n=$n(e[r]||t),i={"":n},a=Pg(o,n,!1),s={},c=new Set;return zw(e,{allKeys:!0},(d,p,m,f)=>{if(f===void 0)return;const _=a+p;let g=i[f];typeof d[r]=="string"&&(g=v.call(this,d[r])),y.call(this,d.$anchor),y.call(this,d.$dynamicAnchor),i[p]=g;function v(b){const I=this.opts.uriResolver.resolve;if(b=$n(g?I(g,b):b),c.has(b))throw l(b);c.add(b);let x=this.refs[b];return typeof x=="string"&&(x=this.refs[x]),typeof x=="object"?u(d,x.schema,b):b!==$n(_)&&(b[0]==="#"?(u(d,s[b],b),s[b]=d):this.refs[b]=_),b}function y(b){if(typeof b=="string"){if(!Uw.test(b))throw new Error(`invalid anchor "${b}"`);v.call(this,`#${b}`)}}}),s;function u(d,p,m){if(p!==void 0&&!Ew(d,p))throw l(m)}function l(d){return new Error(`reference "${d}" resolves to more than one schema`)}}Be.getSchemaRefs=Mw;var Ng;function Go(){if(Ng)return Tt;Ng=1,Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.getData=Tt.KeywordCxt=Tt.validateFunctionCode=void 0;const e=lw(),t=ze,r=vg(),o=ze,n=Iw(),i=Ow(),a=Tw(),s=se,c=At(),u=Be,l=M,d=Ho();function p(w){if(x(w)&&(L(w),I(w))){g(w);return}m(w,()=>(0,e.topBoolOrEmptySchema)(w))}Tt.validateFunctionCode=p;function m({gen:w,validateName:T,schema:z,schemaEnv:A,opts:q},ce){q.code.es5?w.func(T,(0,s._)`${c.default.data}, ${c.default.valCxt}`,A.$async,()=>{w.code((0,s._)`"use strict"; ${y(z,q)}`),_(w,q),w.code(ce)}):w.func(T,(0,s._)`${c.default.data}, ${f(q)}`,A.$async,()=>w.code(y(z,q)).code(ce))}function f(w){return(0,s._)`{${c.default.instancePath}="", ${c.default.parentData}, ${c.default.parentDataProperty}, ${c.default.rootData}=${c.default.data}${w.dynamicRef?(0,s._)`, ${c.default.dynamicAnchors}={}`:s.nil}}={}`}function _(w,T){w.if(c.default.valCxt,()=>{w.var(c.default.instancePath,(0,s._)`${c.default.valCxt}.${c.default.instancePath}`),w.var(c.default.parentData,(0,s._)`${c.default.valCxt}.${c.default.parentData}`),w.var(c.default.parentDataProperty,(0,s._)`${c.default.valCxt}.${c.default.parentDataProperty}`),w.var(c.default.rootData,(0,s._)`${c.default.valCxt}.${c.default.rootData}`),T.dynamicRef&&w.var(c.default.dynamicAnchors,(0,s._)`${c.default.valCxt}.${c.default.dynamicAnchors}`)},()=>{w.var(c.default.instancePath,(0,s._)`""`),w.var(c.default.parentData,(0,s._)`undefined`),w.var(c.default.parentDataProperty,(0,s._)`undefined`),w.var(c.default.rootData,c.default.data),T.dynamicRef&&w.var(c.default.dynamicAnchors,(0,s._)`{}`)})}function g(w){const{schema:T,opts:z,gen:A}=w;m(w,()=>{z.$comment&&T.$comment&&Y(w),Te(w),A.let(c.default.vErrors,null),A.let(c.default.errors,0),z.unevaluated&&v(w),ue(w),K(w)})}function v(w){const{gen:T,validateName:z}=w;w.evaluated=T.const("evaluated",(0,s._)`${z}.evaluated`),T.if((0,s._)`${w.evaluated}.dynamicProps`,()=>T.assign((0,s._)`${w.evaluated}.props`,(0,s._)`undefined`)),T.if((0,s._)`${w.evaluated}.dynamicItems`,()=>T.assign((0,s._)`${w.evaluated}.items`,(0,s._)`undefined`))}function y(w,T){const z=typeof w=="object"&&w[T.schemaId];return z&&(T.code.source||T.code.process)?(0,s._)`/*# sourceURL=${z} */`:s.nil}function b(w,T){if(x(w)&&(L(w),I(w))){B(w,T);return}(0,e.boolOrEmptySchema)(w,T)}function I({schema:w,self:T}){if(typeof w=="boolean")return!w;for(const z in w)if(T.RULES.all[z])return!0;return!1}function x(w){return typeof w.schema!="boolean"}function B(w,T){const{schema:z,gen:A,opts:q}=w;q.$comment&&z.$comment&&Y(w),Z(w),Q(w);const ce=A.const("_errs",c.default.errors);ue(w,ce),A.var(T,(0,s._)`${ce} === ${c.default.errors}`)}function L(w){(0,l.checkUnknownRules)(w),me(w)}function ue(w,T){if(w.opts.jtd)return ot(w,[],!1,T);const z=(0,t.getSchemaTypes)(w.schema),A=(0,t.coerceAndCheckDataType)(w,z);ot(w,z,!A,T)}function me(w){const{schema:T,errSchemaPath:z,opts:A,self:q}=w;T.$ref&&A.ignoreKeywordsWithRef&&(0,l.schemaHasRulesButRef)(T,q.RULES)&&q.logger.warn(`$ref: keywords ignored in schema at path "${z}"`)}function Te(w){const{schema:T,opts:z}=w;T.default!==void 0&&z.useDefaults&&z.strictSchema&&(0,l.checkStrictMode)(w,"default is ignored in the schema root")}function Z(w){const T=w.schema[w.opts.schemaId];T&&(w.baseId=(0,u.resolveUrl)(w.opts.uriResolver,w.baseId,T))}function Q(w){if(w.schema.$async&&!w.schemaEnv.$async)throw new Error("async schema in sync schema")}function Y({gen:w,schemaEnv:T,schema:z,errSchemaPath:A,opts:q}){const ce=z.$comment;if(q.$comment===!0)w.code((0,s._)`${c.default.self}.logger.log(${ce})`);else if(typeof q.$comment=="function"){const De=(0,s.str)`${A}/$comment`,pt=w.scopeValue("root",{ref:T.root});w.code((0,s._)`${c.default.self}.opts.$comment(${ce}, ${De}, ${pt}.schema)`)}}function K(w){const{gen:T,schemaEnv:z,validateName:A,ValidationError:q,opts:ce}=w;z.$async?T.if((0,s._)`${c.default.errors} === 0`,()=>T.return(c.default.data),()=>T.throw((0,s._)`new ${q}(${c.default.vErrors})`)):(T.assign((0,s._)`${A}.errors`,c.default.vErrors),ce.unevaluated&&Pe(w),T.return((0,s._)`${c.default.errors} === 0`))}function Pe({gen:w,evaluated:T,props:z,items:A}){z instanceof s.Name&&w.assign((0,s._)`${T}.props`,z),A instanceof s.Name&&w.assign((0,s._)`${T}.items`,A)}function ot(w,T,z,A){const{gen:q,schema:ce,data:De,allErrors:pt,opts:He,self:Ke}=w,{RULES:Ae}=Ke;if(ce.$ref&&(He.ignoreKeywordsWithRef||!(0,l.schemaHasRulesButRef)(ce,Ae))){q.block(()=>F(w,"$ref",Ae.all.$ref.definition));return}He.jtd||Mt(w,T),q.block(()=>{for(const at of Ae.rules)nn(at);nn(Ae.post)});function nn(at){(0,r.shouldUseGroup)(ce,at)&&(at.type?(q.if((0,o.checkDataType)(at.type,De,He.strictNumbers)),it(w,at),T.length===1&&T[0]===at.type&&z&&(q.else(),(0,o.reportTypeError)(w)),q.endIf()):it(w,at),pt||q.if((0,s._)`${c.default.errors} === ${A||0}`))}}function it(w,T){const{gen:z,schema:A,opts:{useDefaults:q}}=w;q&&(0,n.assignDefaults)(w,T.type),z.block(()=>{for(const ce of T.rules)(0,r.shouldUseRule)(A,ce)&&F(w,ce.keyword,ce.definition,T.type)})}function Mt(w,T){w.schemaEnv.meta||!w.opts.strictTypes||(wt(w,T),w.opts.allowUnionTypes||C(w,T),O(w,w.dataTypes))}function wt(w,T){if(T.length){if(!w.dataTypes.length){w.dataTypes=T;return}T.forEach(z=>{P(w.dataTypes,z)||$(w,`type "${z}" not allowed by context "${w.dataTypes.join(",")}"`)}),h(w,T)}}function C(w,T){T.length>1&&!(T.length===2&&T.includes("null"))&&$(w,"use allowUnionTypes to allow union type keyword")}function O(w,T){const z=w.self.RULES.all;for(const A in z){const q=z[A];if(typeof q=="object"&&(0,r.shouldUseRule)(w.schema,q)){const{type:ce}=q.definition;ce.length&&!ce.some(De=>j(T,De))&&$(w,`missing type "${ce.join(",")}" for keyword "${A}"`)}}}function j(w,T){return w.includes(T)||T==="number"&&w.includes("integer")}function P(w,T){return w.includes(T)||T==="integer"&&w.includes("number")}function h(w,T){const z=[];for(const A of w.dataTypes)P(T,A)?z.push(A):T.includes("integer")&&A==="number"&&z.push("integer");w.dataTypes=z}function $(w,T){const z=w.schemaEnv.baseId+w.errSchemaPath;T+=` at "${z}" (strictTypes)`,(0,l.checkStrictMode)(w,T,w.opts.strictTypes)}class N{constructor(T,z,A){if((0,i.validateKeywordUsage)(T,z,A),this.gen=T.gen,this.allErrors=T.allErrors,this.keyword=A,this.data=T.data,this.schema=T.schema[A],this.$data=z.$data&&T.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,l.schemaRefOrVal)(T,this.schema,A,this.$data),this.schemaType=z.schemaType,this.parentSchema=T.schema,this.params={},this.it=T,this.def=z,this.$data)this.schemaCode=T.gen.const("vSchema",le(this.$data,T));else if(this.schemaCode=this.schemaValue,!(0,i.validSchemaType)(this.schema,z.schemaType,z.allowUndefined))throw new Error(`${A} value must be ${JSON.stringify(z.schemaType)}`);("code"in z?z.trackErrors:z.errors!==!1)&&(this.errsCount=T.gen.const("_errs",c.default.errors))}result(T,z,A){this.failResult((0,s.not)(T),z,A)}failResult(T,z,A){this.gen.if(T),A?A():this.error(),z?(this.gen.else(),z(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(T,z){this.failResult((0,s.not)(T),void 0,z)}fail(T){if(T===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(T),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(T){if(!this.$data)return this.fail(T);const{schemaCode:z}=this;this.fail((0,s._)`${z} !== undefined && (${(0,s.or)(this.invalid$data(),T)})`)}error(T,z,A){if(z){this.setParams(z),this._error(T,A),this.setParams({});return}this._error(T,A)}_error(T,z){(T?d.reportExtraError:d.reportError)(this,this.def.error,z)}$dataError(){(0,d.reportError)(this,this.def.$dataError||d.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,d.resetErrorsCount)(this.gen,this.errsCount)}ok(T){this.allErrors||this.gen.if(T)}setParams(T,z){z?Object.assign(this.params,T):this.params=T}block$data(T,z,A=s.nil){this.gen.block(()=>{this.check$data(T,A),z()})}check$data(T=s.nil,z=s.nil){if(!this.$data)return;const{gen:A,schemaCode:q,schemaType:ce,def:De}=this;A.if((0,s.or)((0,s._)`${q} === undefined`,z)),T!==s.nil&&A.assign(T,!0),(ce.length||De.validateSchema)&&(A.elseIf(this.invalid$data()),this.$dataError(),T!==s.nil&&A.assign(T,!1)),A.else()}invalid$data(){const{gen:T,schemaCode:z,schemaType:A,def:q,it:ce}=this;return(0,s.or)(De(),pt());function De(){if(A.length){if(!(z instanceof s.Name))throw new Error("ajv implementation error");const He=Array.isArray(A)?A:[A];return(0,s._)`${(0,o.checkDataTypes)(He,z,ce.opts.strictNumbers,o.DataType.Wrong)}`}return s.nil}function pt(){if(q.validateSchema){const He=T.scopeValue("validate$data",{ref:q.validateSchema});return(0,s._)`!${He}(${z})`}return s.nil}}subschema(T,z){const A=(0,a.getSubschema)(this.it,T);(0,a.extendSubschemaData)(A,this.it,T),(0,a.extendSubschemaMode)(A,T);const q={...this.it,...A,items:void 0,props:void 0};return b(q,z),q}mergeEvaluated(T,z){const{it:A,gen:q}=this;A.opts.unevaluated&&(A.props!==!0&&T.props!==void 0&&(A.props=l.mergeEvaluated.props(q,T.props,A.props,z)),A.items!==!0&&T.items!==void 0&&(A.items=l.mergeEvaluated.items(q,T.items,A.items,z)))}mergeValidEvaluated(T,z){const{it:A,gen:q}=this;if(A.opts.unevaluated&&(A.props!==!0||A.items!==!0))return q.if(z,()=>this.mergeEvaluated(T,s.Name)),!0}}Tt.KeywordCxt=N;function F(w,T,z,A){const q=new N(w,z,T);"code"in z?z.code(q,A):q.$data&&z.validate?(0,i.funcKeywordCode)(q,z):"macro"in z?(0,i.macroKeywordCode)(q,z):(z.compile||z.validate)&&(0,i.funcKeywordCode)(q,z)}const H=/^\/(?:[^~]|~0|~1)*$/,pe=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function le(w,{dataLevel:T,dataNames:z,dataPathArr:A}){let q,ce;if(w==="")return c.default.rootData;if(w[0]==="/"){if(!H.test(w))throw new Error(`Invalid JSON-pointer: ${w}`);q=w,ce=c.default.rootData}else{const Ke=pe.exec(w);if(!Ke)throw new Error(`Invalid JSON-pointer: ${w}`);const Ae=+Ke[1];if(q=Ke[2],q==="#"){if(Ae>=T)throw new Error(He("property/index",Ae));return A[T-Ae]}if(Ae>T)throw new Error(He("data",Ae));if(ce=z[T-Ae],!q)return ce}let De=ce;const pt=q.split("/");for(const Ke of pt)Ke&&(ce=(0,s._)`${ce}${(0,s.getProperty)((0,l.unescapeJsonPointer)(Ke))}`,De=(0,s._)`${De} && ${ce}`);return De;function He(Ke,Ae){return`Cannot access ${Ke} ${Ae} levels up, current level is ${T}`}}return Tt.getData=le,Tt}var Wo={},Eg;function dc(){if(Eg)return Wo;Eg=1,Object.defineProperty(Wo,"__esModule",{value:!0});class e extends Error{constructor(r){super("validation failed"),this.errors=r,this.ajv=this.validation=!0}}return Wo.default=e,Wo}var Yo={},zg;function Xo(){if(zg)return Yo;zg=1,Object.defineProperty(Yo,"__esModule",{value:!0});const e=Be;class t extends Error{constructor(o,n,i,a){super(a||`can't resolve reference ${i} from id ${n}`),this.missingRef=(0,e.resolveUrl)(o,n,i),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(o,this.missingRef))}}return Yo.default=t,Yo}var Ye={};Object.defineProperty(Ye,"__esModule",{value:!0}),Ye.resolveSchema=Ye.getCompilingSchema=Ye.resolveRef=Ye.compileSchema=Ye.SchemaEnv=void 0;const yt=se,Bw=dc(),Wt=At(),_t=Be,jg=M,Zw=Go();class Qo{constructor(t){var r;this.refs={},this.dynamicAnchors={};let o;typeof t.schema=="object"&&(o=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,_t.normalizeId)(o?.[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=o?.$async,this.refs={}}}Ye.SchemaEnv=Qo;function mc(e){const t=Dg.call(this,e);if(t)return t;const r=(0,_t.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:o,lines:n}=this.opts.code,{ownProperties:i}=this.opts,a=new yt.CodeGen(this.scope,{es5:o,lines:n,ownProperties:i});let s;e.$async&&(s=a.scopeValue("Error",{ref:Bw.default,code:(0,yt._)`require("ajv/dist/runtime/validation_error").default`}));const c=a.scopeName("validate");e.validateName=c;const u={gen:a,allErrors:this.opts.allErrors,data:Wt.default.data,parentData:Wt.default.parentData,parentDataProperty:Wt.default.parentDataProperty,dataNames:[Wt.default.data],dataPathArr:[yt.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,yt.stringify)(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:s,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:yt.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,yt._)`""`,opts:this.opts,self:this};let l;try{this._compilations.add(e),(0,Zw.validateFunctionCode)(u),a.optimize(this.opts.code.optimize);const d=a.toString();l=`${a.scopeRefs(Wt.default.scope)}return ${d}`,this.opts.code.process&&(l=this.opts.code.process(l,e));const m=new Function(`${Wt.default.self}`,`${Wt.default.scope}`,l)(this,this.scope.get());if(this.scope.value(c,{ref:m}),m.errors=null,m.schema=e.schema,m.schemaEnv=e,e.$async&&(m.$async=!0),this.opts.code.source===!0&&(m.source={validateName:c,validateCode:d,scopeValues:a._values}),this.opts.unevaluated){const{props:f,items:_}=u;m.evaluated={props:f instanceof yt.Name?void 0:f,items:_ instanceof yt.Name?void 0:_,dynamicProps:f instanceof yt.Name,dynamicItems:_ instanceof yt.Name},m.source&&(m.source.evaluated=(0,yt.stringify)(m.evaluated))}return e.validate=m,e}catch(d){throw delete e.validate,delete e.validateName,l&&this.logger.error("Error compiling schema, function code:",l),d}finally{this._compilations.delete(e)}}Ye.compileSchema=mc;function Fw(e,t,r){var o;r=(0,_t.resolveUrl)(this.opts.uriResolver,t,r);const n=e.refs[r];if(n)return n;let i=qw.call(this,e,r);if(i===void 0){const a=(o=e.localRefs)===null||o===void 0?void 0:o[r],{schemaId:s}=this.opts;a&&(i=new Qo({schema:a,schemaId:s,root:e,baseId:t}))}if(i!==void 0)return e.refs[r]=Vw.call(this,i)}Ye.resolveRef=Fw;function Vw(e){return(0,_t.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:mc.call(this,e)}function Dg(e){for(const t of this._compilations)if(Lw(t,e))return t}Ye.getCompilingSchema=Dg;function Lw(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function qw(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||ei.call(this,e,t)}function ei(e,t){const r=this.opts.uriResolver.parse(t),o=(0,_t._getFullPath)(this.opts.uriResolver,r);let n=(0,_t.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&o===n)return pc.call(this,r,e);const i=(0,_t.normalizeId)(o),a=this.refs[i]||this.schemas[i];if(typeof a=="string"){const s=ei.call(this,e,a);return typeof s?.schema!="object"?void 0:pc.call(this,r,s)}if(typeof a?.schema=="object"){if(a.validate||mc.call(this,a),i===(0,_t.normalizeId)(t)){const{schema:s}=a,{schemaId:c}=this.opts,u=s[c];return u&&(n=(0,_t.resolveUrl)(this.opts.uriResolver,n,u)),new Qo({schema:s,schemaId:c,root:e,baseId:n})}return pc.call(this,r,a)}}Ye.resolveSchema=ei;const Jw=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function pc(e,{baseId:t,schema:r,root:o}){var n;if(((n=e.fragment)===null||n===void 0?void 0:n[0])!=="/")return;for(const s of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;const c=r[(0,jg.unescapeFragment)(s)];if(c===void 0)return;r=c;const u=typeof r=="object"&&r[this.opts.schemaId];!Jw.has(s)&&u&&(t=(0,_t.resolveUrl)(this.opts.uriResolver,t,u))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,jg.schemaHasRulesButRef)(r,this.RULES)){const s=(0,_t.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=ei.call(this,o,s)}const{schemaId:a}=this.opts;if(i=i||new Qo({schema:r,schemaId:a,root:o,baseId:t}),i.schema!==i.root.schema)return i}var Hw="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",Kw="Meta-schema for $data reference (JSON AnySchema extension proposal)",Gw="object",Ww=["$data"],Yw={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},Xw=!1,Qw={$id:Hw,description:Kw,type:Gw,required:Ww,properties:Yw,additionalProperties:Xw},fc={},ti={exports:{}};const e0=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),Ag=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),hc=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),Cg=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),t0=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function Rg(e){let t="",r=0,o=0;for(o=0;o<e.length;o++)if(r=e[o].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[o];break}for(o+=1;o<e.length;o++){if(r=e[o].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[o]}return t}const n0=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function Ug(e){return e.length=0,!0}function r0(e,t,r){if(e.length){const o=Rg(e);if(o!=="")t.push(o);else return r.error=!0,!1;e.length=0}return!0}function o0(e){let t=0;const r={error:!1,address:"",zone:""},o=[],n=[];let i=!1,a=!1,s=r0;for(let c=0;c<e.length;c++){const u=e[c];if(!(u==="["||u==="]"))if(u===":"){if(i===!0&&(a=!0),!s(n,o,r))break;if(++t>7){r.error=!0;break}c>0&&e[c-1]===":"&&(i=!0),o.push(":");continue}else if(u==="%"){if(!s(n,o,r))break;s=Ug}else{n.push(u);continue}}return n.length&&(s===Ug?r.zone=n.join(""):a?o.push(n.join("")):o.push(Rg(n))),r.address=o.join(""),r}function Mg(e){if(i0(e,":")<2)return{host:e,isIPV6:!1};const t=o0(e);if(t.error)return{host:e,isIPV6:!1};{let r=t.address,o=t.address;return t.zone&&(r+="%"+t.zone,o+="%25"+t.zone),{host:r,isIPV6:!0,escapedHost:o}}}function i0(e,t){let r=0;for(let o=0;o<e.length;o++)e[o]===t&&r++;return r}function a0(e){let t=e;const r=[];let o=-1,n=0;for(;n=t.length;){if(n===1){if(t===".")break;if(t==="/"){r.push("/");break}else{r.push(t);break}}else if(n===2){if(t[0]==="."){if(t[1]===".")break;if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&(t[1]==="."||t[1]==="/")){r.push("/");break}}else if(n===3&&t==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."&&t[3]==="/"){t=t.slice(3),r.length!==0&&r.pop();continue}}if((o=t.indexOf("/",1))===-1){r.push(t);break}else r.push(t.slice(0,o)),t=t.slice(o)}return r.join("")}const s0={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},c0=/[@/?#:]/g,u0=/[@/?#]/g;function Bg(e,t){const r=t?u0:c0;return r.lastIndex=0,e.replace(r,o=>s0[o])}function l0(e,t=!1){if(e.indexOf("%")===-1)return e;let r="";for(let o=0;o<e.length;o++){if(e[o]==="%"&&o+2<e.length){const n=e.slice(o+1,o+3);if(hc(n)){const i=n.toUpperCase(),a=String.fromCharCode(parseInt(i,16));t&&Cg(a)?r+=a:r+="%"+i,o+=2;continue}}r+=e[o]}return r}function d0(e){let t="";for(let r=0;r<e.length;r++){if(e[r]==="%"&&r+2<e.length){const o=e.slice(r+1,r+3);if(hc(o)){const n=o.toUpperCase(),i=String.fromCharCode(parseInt(n,16));i!=="."&&Cg(i)?t+=i:t+="%"+n,r+=2;continue}}t0(e[r])?t+=e[r]:t+=escape(e[r])}return t}function m0(e){let t="";for(let r=0;r<e.length;r++){if(e[r]==="%"&&r+2<e.length){const o=e.slice(r+1,r+3);if(hc(o)){t+="%"+o.toUpperCase(),r+=2;continue}}t+=escape(e[r])}return t}function p0(e){const t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let r=unescape(e.host);if(!Ag(r)){const o=Mg(r);o.isIPV6===!0?r=`[${o.escapedHost}]`:r=Bg(r,!1)}t.push(r)}return(typeof e.port=="number"||typeof e.port=="string")&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0}var Zg={nonSimpleDomain:n0,recomposeAuthority:p0,reescapeHostDelimiters:Bg,normalizePercentEncoding:l0,normalizePathEncoding:d0,escapePreservingEscapes:m0,removeDotSegments:a0,isIPv4:Ag,isUUID:e0,normalizeIPv6:Mg};const{isUUID:f0}=Zg,h0=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function Fg(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S"):!1}function Vg(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function Lg(e){const t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}function g0(e){return e.secure=Fg(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function v0(e){if((e.port===(Fg(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){const[t,r]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}function y0(e,t){if(!e.path)return e.error="URN can not be parsed",e;const r=e.path.match(h0);if(r){const o=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];const n=`${o}:${t.nid||e.nid}`,i=gc(n);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function _0(e,t){if(e.nid===void 0)throw new Error("URN without nid cannot be serialized");const r=t.scheme||e.scheme||"urn",o=e.nid.toLowerCase(),n=`${r}:${t.nid||o}`,i=gc(n);i&&(e=i.serialize(e,t));const a=e,s=e.nss;return a.path=`${o||t.nid}:${s}`,t.skipEscape=!0,a}function $0(e,t){const r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!f0(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function b0(e){const t=e;return t.nss=(e.uuid||"").toLowerCase(),t}const qg={scheme:"http",domainHost:!0,parse:Vg,serialize:Lg},k0={scheme:"https",domainHost:qg.domainHost,parse:Vg,serialize:Lg},ni={scheme:"ws",domainHost:!0,parse:g0,serialize:v0},S0={scheme:"wss",domainHost:ni.domainHost,parse:ni.parse,serialize:ni.serialize},w0={scheme:"urn",parse:y0,serialize:_0,skipNormalize:!0},I0={scheme:"urn:uuid",parse:$0,serialize:b0,skipNormalize:!0},ri={http:qg,https:k0,ws:ni,wss:S0,urn:w0,"urn:uuid":I0};Object.setPrototypeOf(ri,null);function gc(e){return e&&(ri[e]||ri[e.toLowerCase()])||void 0}var O0={SCHEMES:ri,getSchemeHandler:gc};const{normalizeIPv6:T0,removeDotSegments:$r,recomposeAuthority:P0,normalizePercentEncoding:x0,normalizePathEncoding:N0,escapePreservingEscapes:E0,reescapeHostDelimiters:z0,isIPv4:j0,nonSimpleDomain:D0}=Zg,{SCHEMES:A0,getSchemeHandler:Jg}=O0;function C0(e,t){return typeof e=="string"?e=Z0(e,t):typeof e=="object"&&(e=bn(Yt(e,t),t)),e}function R0(e,t,r){const o=r?Object.assign({scheme:"null"},r):{scheme:"null"},n=Hg(bn(e,o),bn(t,o),o,!0);return o.skipEscape=!0,Yt(n,o)}function Hg(e,t,r,o){const n={};return o||(e=bn(Yt(e,r),r),t=bn(Yt(t,r),r)),r=r||{},!r.tolerant&&t.scheme?(n.scheme=t.scheme,n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=$r(t.path||""),n.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=$r(t.path||""),n.query=t.query):(t.path?(t.path[0]==="/"?n.path=$r(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?n.path="/"+t.path:e.path?n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:n.path=t.path,n.path=$r(n.path)),n.query=t.query):(n.path=e.path,t.query!==void 0?n.query=t.query:n.query=e.query),n.userinfo=e.userinfo,n.host=e.host,n.port=e.port),n.scheme=e.scheme),n.fragment=t.fragment,n}function U0(e,t,r){const o=Wg(e,r),n=Wg(t,r);return o!==void 0&&n!==void 0&&o.toLowerCase()===n.toLowerCase()}function Yt(e,t){const r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},o=Object.assign({},t),n=[],i=Jg(o.scheme||r.scheme);i&&i.serialize&&i.serialize(r,o),r.path!==void 0&&(o.skipEscape?r.path=x0(r.path):(r.path=E0(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),o.reference!=="suffix"&&r.scheme&&n.push(r.scheme,":");const a=P0(r);if(a!==void 0&&(o.reference!=="suffix"&&n.push("//"),n.push(a),r.path&&r.path[0]!=="/"&&n.push("/")),r.path!==void 0){let s=r.path;!o.absolutePath&&(!i||!i.absolutePath)&&(s=$r(s)),a===void 0&&s[0]==="/"&&s[1]==="/"&&(s="/%2F"+s.slice(2)),n.push(s)}return r.query!==void 0&&n.push("?",r.query),r.fragment!==void 0&&n.push("#",r.fragment),n.join("")}const M0=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function B0(e,t){if(t[2]!==void 0&&e.path&&e.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof e.port=="number"&&(e.port<0||e.port>65535))return"URI port is malformed."}function Kg(e,t){const r=Object.assign({},t),o={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let n=!1,i=!1;r.reference==="suffix"&&(r.scheme?e=r.scheme+":"+e:e="//"+e);const a=e.match(M0);if(a){o.scheme=a[1],o.userinfo=a[3],o.host=a[4],o.port=parseInt(a[5],10),o.path=a[6]||"",o.query=a[7],o.fragment=a[8],isNaN(o.port)&&(o.port=a[5]);const s=B0(o,a);if(s!==void 0&&(o.error=o.error||s,n=!0),o.host)if(j0(o.host)===!1){const l=T0(o.host);o.host=l.host.toLowerCase(),i=l.isIPV6}else i=!0;o.scheme===void 0&&o.userinfo===void 0&&o.host===void 0&&o.port===void 0&&o.query===void 0&&!o.path?o.reference="same-document":o.scheme===void 0?o.reference="relative":o.fragment===void 0?o.reference="absolute":o.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==o.reference&&(o.error=o.error||"URI is not a "+r.reference+" reference.");const c=Jg(r.scheme||o.scheme);if(!r.unicodeSupport&&(!c||!c.unicodeSupport)&&o.host&&(r.domainHost||c&&c.domainHost)&&i===!1&&D0(o.host))try{o.host=URL.domainToASCII(o.host.toLowerCase())}catch(u){o.error=o.error||"Host's domain name can not be converted to ASCII: "+u}if((!c||c&&!c.skipNormalize)&&(e.indexOf("%")!==-1&&(o.scheme!==void 0&&(o.scheme=unescape(o.scheme)),o.host!==void 0&&(o.host=z0(unescape(o.host),i))),o.path&&(o.path=N0(o.path)),o.fragment))try{o.fragment=encodeURI(decodeURIComponent(o.fragment))}catch{o.error=o.error||"URI malformed"}c&&c.parse&&c.parse(o,r)}else o.error=o.error||"URI can not be parsed.";return{parsed:o,malformedAuthorityOrPort:n}}function bn(e,t){return Kg(e,t).parsed}function Z0(e,t){return Gg(e,t).normalized}function Gg(e,t){const{parsed:r,malformedAuthorityOrPort:o}=Kg(e,t);return{normalized:o?e:Yt(r,t),malformedAuthorityOrPort:o}}function Wg(e,t){if(typeof e=="string"){const{normalized:r,malformedAuthorityOrPort:o}=Gg(e,t);return o?void 0:r}if(typeof e=="object")return Yt(e,t)}const vc={SCHEMES:A0,normalize:C0,resolve:R0,resolveComponent:Hg,equal:U0,serialize:Yt,parse:bn};ti.exports=vc,ti.exports.default=vc,ti.exports.fastUri=vc;var F0=ti.exports;Object.defineProperty(fc,"__esModule",{value:!0});const Yg=F0;Yg.code='require("ajv/dist/runtime/uri").default',fc.default=Yg,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=Go();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=se;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const o=dc(),n=Xo(),i=Gt,a=Ye,s=se,c=Be,u=ze,l=M,d=Qw,p=fc,m=(C,O)=>new RegExp(C,O);m.code="new RegExp";const f=["removeAdditional","useDefaults","coerceTypes"],_=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),g={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},v={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},y=200;function b(C){var O,j,P,h,$,N,F,H,pe,le,w,T,z,A,q,ce,De,pt,He,Ke,Ae,nn,at,$i,bi;const Nn=C.strict,ki=(O=C.code)===null||O===void 0?void 0:O.optimize,lu=ki===!0||ki===void 0?1:ki||0,du=(P=(j=C.code)===null||j===void 0?void 0:j.regExp)!==null&&P!==void 0?P:m,Hv=(h=C.uriResolver)!==null&&h!==void 0?h:p.default;return{strictSchema:(N=($=C.strictSchema)!==null&&$!==void 0?$:Nn)!==null&&N!==void 0?N:!0,strictNumbers:(H=(F=C.strictNumbers)!==null&&F!==void 0?F:Nn)!==null&&H!==void 0?H:!0,strictTypes:(le=(pe=C.strictTypes)!==null&&pe!==void 0?pe:Nn)!==null&&le!==void 0?le:"log",strictTuples:(T=(w=C.strictTuples)!==null&&w!==void 0?w:Nn)!==null&&T!==void 0?T:"log",strictRequired:(A=(z=C.strictRequired)!==null&&z!==void 0?z:Nn)!==null&&A!==void 0?A:!1,code:C.code?{...C.code,optimize:lu,regExp:du}:{optimize:lu,regExp:du},loopRequired:(q=C.loopRequired)!==null&&q!==void 0?q:y,loopEnum:(ce=C.loopEnum)!==null&&ce!==void 0?ce:y,meta:(De=C.meta)!==null&&De!==void 0?De:!0,messages:(pt=C.messages)!==null&&pt!==void 0?pt:!0,inlineRefs:(He=C.inlineRefs)!==null&&He!==void 0?He:!0,schemaId:(Ke=C.schemaId)!==null&&Ke!==void 0?Ke:"$id",addUsedSchema:(Ae=C.addUsedSchema)!==null&&Ae!==void 0?Ae:!0,validateSchema:(nn=C.validateSchema)!==null&&nn!==void 0?nn:!0,validateFormats:(at=C.validateFormats)!==null&&at!==void 0?at:!0,unicodeRegExp:($i=C.unicodeRegExp)!==null&&$i!==void 0?$i:!0,int32range:(bi=C.int32range)!==null&&bi!==void 0?bi:!0,uriResolver:Hv}}class I{constructor(O={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,O=this.opts={...O,...b(O)};const{es5:j,lines:P}=this.opts.code;this.scope=new s.ValueScope({scope:{},prefixes:_,es5:j,lines:P}),this.logger=Q(O.logger);const h=O.validateFormats;O.validateFormats=!1,this.RULES=(0,i.getRules)(),x.call(this,g,O,"NOT SUPPORTED"),x.call(this,v,O,"DEPRECATED","warn"),this._metaOpts=Te.call(this),O.formats&&ue.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),O.keywords&&me.call(this,O.keywords),typeof O.meta=="object"&&this.addMetaSchema(O.meta),L.call(this),O.validateFormats=h}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:O,meta:j,schemaId:P}=this.opts;let h=d;P==="id"&&(h={...d},h.id=h.$id,delete h.$id),j&&O&&this.addMetaSchema(h,h[P],!1)}defaultMeta(){const{meta:O,schemaId:j}=this.opts;return this.opts.defaultMeta=typeof O=="object"?O[j]||O:void 0}validate(O,j){let P;if(typeof O=="string"){if(P=this.getSchema(O),!P)throw new Error(`no schema with key or ref "${O}"`)}else P=this.compile(O);const h=P(j);return"$async"in P||(this.errors=P.errors),h}compile(O,j){const P=this._addSchema(O,j);return P.validate||this._compileSchemaEnv(P)}compileAsync(O,j){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:P}=this.opts;return h.call(this,O,j);async function h(le,w){await $.call(this,le.$schema);const T=this._addSchema(le,w);return T.validate||N.call(this,T)}async function $(le){le&&!this.getSchema(le)&&await h.call(this,{$ref:le},!0)}async function N(le){try{return this._compileSchemaEnv(le)}catch(w){if(!(w instanceof n.default))throw w;return F.call(this,w),await H.call(this,w.missingSchema),N.call(this,le)}}function F({missingSchema:le,missingRef:w}){if(this.refs[le])throw new Error(`AnySchema ${le} is loaded but ${w} cannot be resolved`)}async function H(le){const w=await pe.call(this,le);this.refs[le]||await $.call(this,w.$schema),this.refs[le]||this.addSchema(w,le,j)}async function pe(le){const w=this._loading[le];if(w)return w;try{return await(this._loading[le]=P(le))}finally{delete this._loading[le]}}}addSchema(O,j,P,h=this.opts.validateSchema){if(Array.isArray(O)){for(const N of O)this.addSchema(N,void 0,P,h);return this}let $;if(typeof O=="object"){const{schemaId:N}=this.opts;if($=O[N],$!==void 0&&typeof $!="string")throw new Error(`schema ${N} must be string`)}return j=(0,c.normalizeId)(j||$),this._checkUnique(j),this.schemas[j]=this._addSchema(O,P,j,h,!0),this}addMetaSchema(O,j,P=this.opts.validateSchema){return this.addSchema(O,j,!0,P),this}validateSchema(O,j){if(typeof O=="boolean")return!0;let P;if(P=O.$schema,P!==void 0&&typeof P!="string")throw new Error("$schema must be a string");if(P=P||this.opts.defaultMeta||this.defaultMeta(),!P)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const h=this.validate(P,O);if(!h&&j){const $="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error($);else throw new Error($)}return h}getSchema(O){let j;for(;typeof(j=B.call(this,O))=="string";)O=j;if(j===void 0){const{schemaId:P}=this.opts,h=new a.SchemaEnv({schema:{},schemaId:P});if(j=a.resolveSchema.call(this,h,O),!j)return;this.refs[O]=j}return j.validate||this._compileSchemaEnv(j)}removeSchema(O){if(O instanceof RegExp)return this._removeAllSchemas(this.schemas,O),this._removeAllSchemas(this.refs,O),this;switch(typeof O){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const j=B.call(this,O);return typeof j=="object"&&this._cache.delete(j.schema),delete this.schemas[O],delete this.refs[O],this}case"object":{const j=O;this._cache.delete(j);let P=O[this.opts.schemaId];return P&&(P=(0,c.normalizeId)(P),delete this.schemas[P],delete this.refs[P]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(O){for(const j of O)this.addKeyword(j);return this}addKeyword(O,j){let P;if(typeof O=="string")P=O,typeof j=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),j.keyword=P);else if(typeof O=="object"&&j===void 0){if(j=O,P=j.keyword,Array.isArray(P)&&!P.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(K.call(this,P,j),!j)return(0,l.eachItem)(P,$=>Pe.call(this,$)),this;it.call(this,j);const h={...j,type:(0,u.getJSONTypes)(j.type),schemaType:(0,u.getJSONTypes)(j.schemaType)};return(0,l.eachItem)(P,h.type.length===0?$=>Pe.call(this,$,h):$=>h.type.forEach(N=>Pe.call(this,$,h,N))),this}getKeyword(O){const j=this.RULES.all[O];return typeof j=="object"?j.definition:!!j}removeKeyword(O){const{RULES:j}=this;delete j.keywords[O],delete j.all[O];for(const P of j.rules){const h=P.rules.findIndex($=>$.keyword===O);h>=0&&P.rules.splice(h,1)}return this}addFormat(O,j){return typeof j=="string"&&(j=new RegExp(j)),this.formats[O]=j,this}errorsText(O=this.errors,{separator:j=", ",dataVar:P="data"}={}){return!O||O.length===0?"No errors":O.map(h=>`${P}${h.instancePath} ${h.message}`).reduce((h,$)=>h+j+$)}$dataMetaSchema(O,j){const P=this.RULES.all;O=JSON.parse(JSON.stringify(O));for(const h of j){const $=h.split("/").slice(1);let N=O;for(const F of $)N=N[F];for(const F in P){const H=P[F];if(typeof H!="object")continue;const{$data:pe}=H.definition,le=N[F];pe&&le&&(N[F]=wt(le))}}return O}_removeAllSchemas(O,j){for(const P in O){const h=O[P];(!j||j.test(P))&&(typeof h=="string"?delete O[P]:h&&!h.meta&&(this._cache.delete(h.schema),delete O[P]))}}_addSchema(O,j,P,h=this.opts.validateSchema,$=this.opts.addUsedSchema){let N;const{schemaId:F}=this.opts;if(typeof O=="object")N=O[F];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof O!="boolean")throw new Error("schema must be object or boolean")}let H=this._cache.get(O);if(H!==void 0)return H;P=(0,c.normalizeId)(N||P);const pe=c.getSchemaRefs.call(this,O,P);return H=new a.SchemaEnv({schema:O,schemaId:F,meta:j,baseId:P,localRefs:pe}),this._cache.set(H.schema,H),$&&!P.startsWith("#")&&(P&&this._checkUnique(P),this.refs[P]=H),h&&this.validateSchema(O,!0),H}_checkUnique(O){if(this.schemas[O]||this.refs[O])throw new Error(`schema with key or id "${O}" already exists`)}_compileSchemaEnv(O){if(O.meta?this._compileMetaSchema(O):a.compileSchema.call(this,O),!O.validate)throw new Error("ajv implementation error");return O.validate}_compileMetaSchema(O){const j=this.opts;this.opts=this._metaOpts;try{a.compileSchema.call(this,O)}finally{this.opts=j}}}I.ValidationError=o.default,I.MissingRefError=n.default,e.default=I;function x(C,O,j,P="error"){for(const h in C){const $=h;$ in O&&this.logger[P](`${j}: option ${h}. ${C[$]}`)}}function B(C){return C=(0,c.normalizeId)(C),this.schemas[C]||this.refs[C]}function L(){const C=this.opts.schemas;if(C)if(Array.isArray(C))this.addSchema(C);else for(const O in C)this.addSchema(C[O],O)}function ue(){for(const C in this.opts.formats){const O=this.opts.formats[C];O&&this.addFormat(C,O)}}function me(C){if(Array.isArray(C)){this.addVocabulary(C);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const O in C){const j=C[O];j.keyword||(j.keyword=O),this.addKeyword(j)}}function Te(){const C={...this.opts};for(const O of f)delete C[O];return C}const Z={log(){},warn(){},error(){}};function Q(C){if(C===!1)return Z;if(C===void 0)return console;if(C.log&&C.warn&&C.error)return C;throw new Error("logger must implement log, warn and error methods")}const Y=/^[a-z_$][a-z0-9_$:-]*$/i;function K(C,O){const{RULES:j}=this;if((0,l.eachItem)(C,P=>{if(j.keywords[P])throw new Error(`Keyword ${P} is already defined`);if(!Y.test(P))throw new Error(`Keyword ${P} has invalid name`)}),!!O&&O.$data&&!("code"in O||"validate"in O))throw new Error('$data keyword must have "code" or "validate" function')}function Pe(C,O,j){var P;const h=O?.post;if(j&&h)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:$}=this;let N=h?$.post:$.rules.find(({type:H})=>H===j);if(N||(N={type:j,rules:[]},$.rules.push(N)),$.keywords[C]=!0,!O)return;const F={keyword:C,definition:{...O,type:(0,u.getJSONTypes)(O.type),schemaType:(0,u.getJSONTypes)(O.schemaType)}};O.before?ot.call(this,N,F,O.before):N.rules.push(F),$.all[C]=F,(P=O.implements)===null||P===void 0||P.forEach(H=>this.addKeyword(H))}function ot(C,O,j){const P=C.rules.findIndex(h=>h.keyword===j);P>=0?C.rules.splice(P,0,O):(C.rules.push(O),this.logger.warn(`rule ${j} is not defined`))}function it(C){let{metaSchema:O}=C;O!==void 0&&(C.$data&&this.opts.$data&&(O=wt(O)),C.validateSchema=this.compile(O,!0))}const Mt={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function wt(C){return{anyOf:[C,Mt]}}})(ig);var yc={},_c={},$c={};Object.defineProperty($c,"__esModule",{value:!0});const V0={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};$c.default=V0;var Xt={};Object.defineProperty(Xt,"__esModule",{value:!0}),Xt.callRef=Xt.getValidate=void 0;const L0=Xo(),Xg=vt(),Xe=se,kn=At(),Qg=Ye,oi=M,q0={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:r,it:o}=e,{baseId:n,schemaEnv:i,validateName:a,opts:s,self:c}=o,{root:u}=i;if((r==="#"||r==="#/")&&n===u.baseId)return d();const l=Qg.resolveRef.call(c,u,n,r);if(l===void 0)throw new L0.default(o.opts.uriResolver,n,r);if(l instanceof Qg.SchemaEnv)return p(l);return m(l);function d(){if(i===u)return ii(e,a,i,i.$async);const f=t.scopeValue("root",{ref:u});return ii(e,(0,Xe._)`${f}.validate`,u,u.$async)}function p(f){const _=ev(e,f);ii(e,_,f,f.$async)}function m(f){const _=t.scopeValue("schema",s.code.source===!0?{ref:f,code:(0,Xe.stringify)(f)}:{ref:f}),g=t.name("valid"),v=e.subschema({schema:f,dataTypes:[],schemaPath:Xe.nil,topSchemaRef:_,errSchemaPath:r},g);e.mergeEvaluated(v),e.ok(g)}}};function ev(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,Xe._)`${r.scopeValue("wrapper",{ref:t})}.validate`}Xt.getValidate=ev;function ii(e,t,r,o){const{gen:n,it:i}=e,{allErrors:a,schemaEnv:s,opts:c}=i,u=c.passContext?kn.default.this:Xe.nil;o?l():d();function l(){if(!s.$async)throw new Error("async schema referenced by sync schema");const f=n.let("valid");n.try(()=>{n.code((0,Xe._)`await ${(0,Xg.callValidateCode)(e,t,u)}`),m(t),a||n.assign(f,!0)},_=>{n.if((0,Xe._)`!(${_} instanceof ${i.ValidationError})`,()=>n.throw(_)),p(_),a||n.assign(f,!1)}),e.ok(f)}function d(){e.result((0,Xg.callValidateCode)(e,t,u),()=>m(t),()=>p(t))}function p(f){const _=(0,Xe._)`${f}.errors`;n.assign(kn.default.vErrors,(0,Xe._)`${kn.default.vErrors} === null ? ${_} : ${kn.default.vErrors}.concat(${_})`),n.assign(kn.default.errors,(0,Xe._)`${kn.default.vErrors}.length`)}function m(f){var _;if(!i.opts.unevaluated)return;const g=(_=r?.validate)===null||_===void 0?void 0:_.evaluated;if(i.props!==!0)if(g&&!g.dynamicProps)g.props!==void 0&&(i.props=oi.mergeEvaluated.props(n,g.props,i.props));else{const v=n.var("props",(0,Xe._)`${f}.evaluated.props`);i.props=oi.mergeEvaluated.props(n,v,i.props,Xe.Name)}if(i.items!==!0)if(g&&!g.dynamicItems)g.items!==void 0&&(i.items=oi.mergeEvaluated.items(n,g.items,i.items));else{const v=n.var("items",(0,Xe._)`${f}.evaluated.items`);i.items=oi.mergeEvaluated.items(n,v,i.items,Xe.Name)}}}Xt.callRef=ii,Xt.default=q0,Object.defineProperty(_c,"__esModule",{value:!0});const J0=$c,H0=Xt,K0=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",J0.default,H0.default];_c.default=K0;var bc={},kc={};Object.defineProperty(kc,"__esModule",{value:!0});const ai=se,Rt=ai.operators,si={maximum:{okStr:"<=",ok:Rt.LTE,fail:Rt.GT},minimum:{okStr:">=",ok:Rt.GTE,fail:Rt.LT},exclusiveMaximum:{okStr:"<",ok:Rt.LT,fail:Rt.GTE},exclusiveMinimum:{okStr:">",ok:Rt.GT,fail:Rt.LTE}},G0={message:({keyword:e,schemaCode:t})=>(0,ai.str)`must be ${si[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,ai._)`{comparison: ${si[e].okStr}, limit: ${t}}`},W0={keyword:Object.keys(si),type:"number",schemaType:"number",$data:!0,error:G0,code(e){const{keyword:t,data:r,schemaCode:o}=e;e.fail$data((0,ai._)`${r} ${si[t].fail} ${o} || isNaN(${r})`)}};kc.default=W0;var Sc={};Object.defineProperty(Sc,"__esModule",{value:!0});const br=se,Y0={message:({schemaCode:e})=>(0,br.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,br._)`{multipleOf: ${e}}`},X0={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:Y0,code(e){const{gen:t,data:r,schemaCode:o,it:n}=e,i=n.opts.multipleOfPrecision,a=t.let("res"),s=i?(0,br._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${i}`:(0,br._)`${a} !== parseInt(${a})`;e.fail$data((0,br._)`(${o} === 0 || (${a} = ${r}/${o}, ${s}))`)}};Sc.default=X0;var wc={},Ic={};Object.defineProperty(Ic,"__esModule",{value:!0});function tv(e){const t=e.length;let r=0,o=0,n;for(;o<t;)r++,n=e.charCodeAt(o++),n>=55296&&n<=56319&&o<t&&(n=e.charCodeAt(o),(n&64512)===56320&&o++);return r}Ic.default=tv,tv.code='require("ajv/dist/runtime/ucs2length").default',Object.defineProperty(wc,"__esModule",{value:!0});const Qt=se,Q0=M,eI=Ic,tI={message({keyword:e,schemaCode:t}){const r=e==="maxLength"?"more":"fewer";return(0,Qt.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,Qt._)`{limit: ${e}}`},nI={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:tI,code(e){const{keyword:t,data:r,schemaCode:o,it:n}=e,i=t==="maxLength"?Qt.operators.GT:Qt.operators.LT,a=n.opts.unicode===!1?(0,Qt._)`${r}.length`:(0,Qt._)`${(0,Q0.useFunc)(e.gen,eI.default)}(${r})`;e.fail$data((0,Qt._)`${a} ${i} ${o}`)}};wc.default=nI;var Oc={};Object.defineProperty(Oc,"__esModule",{value:!0});const rI=vt(),oI=M,Sn=se,iI={message:({schemaCode:e})=>(0,Sn.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,Sn._)`{pattern: ${e}}`},aI={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:iI,code(e){const{gen:t,data:r,$data:o,schema:n,schemaCode:i,it:a}=e,s=a.opts.unicodeRegExp?"u":"";if(o){const{regExp:c}=a.opts.code,u=c.code==="new RegExp"?(0,Sn._)`new RegExp`:(0,oI.useFunc)(t,c),l=t.let("valid");t.try(()=>t.assign(l,(0,Sn._)`${u}(${i}, ${s}).test(${r})`),()=>t.assign(l,!1)),e.fail$data((0,Sn._)`!${l}`)}else{const c=(0,rI.usePattern)(e,n);e.fail$data((0,Sn._)`!${c}.test(${r})`)}}};Oc.default=aI;var Tc={};Object.defineProperty(Tc,"__esModule",{value:!0});const kr=se,sI={message({keyword:e,schemaCode:t}){const r=e==="maxProperties"?"more":"fewer";return(0,kr.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,kr._)`{limit: ${e}}`},cI={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:sI,code(e){const{keyword:t,data:r,schemaCode:o}=e,n=t==="maxProperties"?kr.operators.GT:kr.operators.LT;e.fail$data((0,kr._)`Object.keys(${r}).length ${n} ${o}`)}};Tc.default=cI;var Pc={};Object.defineProperty(Pc,"__esModule",{value:!0});const Sr=vt(),wr=se,uI=M,lI={message:({params:{missingProperty:e}})=>(0,wr.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,wr._)`{missingProperty: ${e}}`},dI={keyword:"required",type:"object",schemaType:"array",$data:!0,error:lI,code(e){const{gen:t,schema:r,schemaCode:o,data:n,$data:i,it:a}=e,{opts:s}=a;if(!i&&r.length===0)return;const c=r.length>=s.loopRequired;if(a.allErrors?u():l(),s.strictRequired){const m=e.parentSchema.properties,{definedProperties:f}=e.it;for(const _ of r)if(m?.[_]===void 0&&!f.has(_)){const g=a.schemaEnv.baseId+a.errSchemaPath,v=`required property "${_}" is not defined at "${g}" (strictRequired)`;(0,uI.checkStrictMode)(a,v,a.opts.strictRequired)}}function u(){if(c||i)e.block$data(wr.nil,d);else for(const m of r)(0,Sr.checkReportMissingProp)(e,m)}function l(){const m=t.let("missing");if(c||i){const f=t.let("valid",!0);e.block$data(f,()=>p(m,f)),e.ok(f)}else t.if((0,Sr.checkMissingProp)(e,r,m)),(0,Sr.reportMissingProp)(e,m),t.else()}function d(){t.forOf("prop",o,m=>{e.setParams({missingProperty:m}),t.if((0,Sr.noPropertyInData)(t,n,m,s.ownProperties),()=>e.error())})}function p(m,f){e.setParams({missingProperty:m}),t.forOf(m,o,()=>{t.assign(f,(0,Sr.propertyInData)(t,n,m,s.ownProperties)),t.if((0,wr.not)(f),()=>{e.error(),t.break()})},wr.nil)}}};Pc.default=dI;var xc={};Object.defineProperty(xc,"__esModule",{value:!0});const Ir=se,mI={message({keyword:e,schemaCode:t}){const r=e==="maxItems"?"more":"fewer";return(0,Ir.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,Ir._)`{limit: ${e}}`},pI={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:mI,code(e){const{keyword:t,data:r,schemaCode:o}=e,n=t==="maxItems"?Ir.operators.GT:Ir.operators.LT;e.fail$data((0,Ir._)`${r}.length ${n} ${o}`)}};xc.default=pI;var Nc={},Or={};Object.defineProperty(Or,"__esModule",{value:!0});const nv=Ig;nv.code='require("ajv/dist/runtime/equal").default',Or.default=nv,Object.defineProperty(Nc,"__esModule",{value:!0});const Ec=ze,Ze=se,fI=M,hI=Or,gI={message:({params:{i:e,j:t}})=>(0,Ze.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,Ze._)`{i: ${e}, j: ${t}}`},vI={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:gI,code(e){const{gen:t,data:r,$data:o,schema:n,parentSchema:i,schemaCode:a,it:s}=e;if(!o&&!n)return;const c=t.let("valid"),u=i.items?(0,Ec.getSchemaTypes)(i.items):[];e.block$data(c,l,(0,Ze._)`${a} === false`),e.ok(c);function l(){const f=t.let("i",(0,Ze._)`${r}.length`),_=t.let("j");e.setParams({i:f,j:_}),t.assign(c,!0),t.if((0,Ze._)`${f} > 1`,()=>(d()?p:m)(f,_))}function d(){return u.length>0&&!u.some(f=>f==="object"||f==="array")}function p(f,_){const g=t.name("item"),v=(0,Ec.checkDataTypes)(u,g,s.opts.strictNumbers,Ec.DataType.Wrong),y=t.const("indices",(0,Ze._)`{}`);t.for((0,Ze._)`;${f}--;`,()=>{t.let(g,(0,Ze._)`${r}[${f}]`),t.if(v,(0,Ze._)`continue`),u.length>1&&t.if((0,Ze._)`typeof ${g} == "string"`,(0,Ze._)`${g} += "_"`),t.if((0,Ze._)`typeof ${y}[${g}] == "number"`,()=>{t.assign(_,(0,Ze._)`${y}[${g}]`),e.error(),t.assign(c,!1).break()}).code((0,Ze._)`${y}[${g}] = ${f}`)})}function m(f,_){const g=(0,fI.useFunc)(t,hI.default),v=t.name("outer");t.label(v).for((0,Ze._)`;${f}--;`,()=>t.for((0,Ze._)`${_} = ${f}; ${_}--;`,()=>t.if((0,Ze._)`${g}(${r}[${f}], ${r}[${_}])`,()=>{e.error(),t.assign(c,!1).break(v)})))}}};Nc.default=vI;var zc={};Object.defineProperty(zc,"__esModule",{value:!0});const jc=se,yI=M,_I=Or,$I={message:"must be equal to constant",params:({schemaCode:e})=>(0,jc._)`{allowedValue: ${e}}`},bI={keyword:"const",$data:!0,error:$I,code(e){const{gen:t,data:r,$data:o,schemaCode:n,schema:i}=e;o||i&&typeof i=="object"?e.fail$data((0,jc._)`!${(0,yI.useFunc)(t,_I.default)}(${r}, ${n})`):e.fail((0,jc._)`${i} !== ${r}`)}};zc.default=bI;var Dc={};Object.defineProperty(Dc,"__esModule",{value:!0});const Tr=se,kI=M,SI=Or,wI={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,Tr._)`{allowedValues: ${e}}`},II={keyword:"enum",schemaType:"array",$data:!0,error:wI,code(e){const{gen:t,data:r,$data:o,schema:n,schemaCode:i,it:a}=e;if(!o&&n.length===0)throw new Error("enum must have non-empty array");const s=n.length>=a.opts.loopEnum;let c;const u=()=>c??(c=(0,kI.useFunc)(t,SI.default));let l;if(s||o)l=t.let("valid"),e.block$data(l,d);else{if(!Array.isArray(n))throw new Error("ajv implementation error");const m=t.const("vSchema",i);l=(0,Tr.or)(...n.map((f,_)=>p(m,_)))}e.pass(l);function d(){t.assign(l,!1),t.forOf("v",i,m=>t.if((0,Tr._)`${u()}(${r}, ${m})`,()=>t.assign(l,!0).break()))}function p(m,f){const _=n[f];return typeof _=="object"&&_!==null?(0,Tr._)`${u()}(${r}, ${m}[${f}])`:(0,Tr._)`${r} === ${_}`}}};Dc.default=II,Object.defineProperty(bc,"__esModule",{value:!0});const OI=kc,TI=Sc,PI=wc,xI=Oc,NI=Tc,EI=Pc,zI=xc,jI=Nc,DI=zc,AI=Dc,CI=[OI.default,TI.default,PI.default,xI.default,NI.default,EI.default,zI.default,jI.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},DI.default,AI.default];bc.default=CI;var Ac={},wn={};Object.defineProperty(wn,"__esModule",{value:!0}),wn.validateAdditionalItems=void 0;const en=se,Cc=M,RI={message:({params:{len:e}})=>(0,en.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,en._)`{limit: ${e}}`},UI={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:RI,code(e){const{parentSchema:t,it:r}=e,{items:o}=t;if(!Array.isArray(o)){(0,Cc.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}rv(e,o)}};function rv(e,t){const{gen:r,schema:o,data:n,keyword:i,it:a}=e;a.items=!0;const s=r.const("len",(0,en._)`${n}.length`);if(o===!1)e.setParams({len:t.length}),e.pass((0,en._)`${s} <= ${t.length}`);else if(typeof o=="object"&&!(0,Cc.alwaysValidSchema)(a,o)){const u=r.var("valid",(0,en._)`${s} <= ${t.length}`);r.if((0,en.not)(u),()=>c(u)),e.ok(u)}function c(u){r.forRange("i",t.length,s,l=>{e.subschema({keyword:i,dataProp:l,dataPropType:Cc.Type.Num},u),a.allErrors||r.if((0,en.not)(u),()=>r.break())})}}wn.validateAdditionalItems=rv,wn.default=UI;var Rc={},In={};Object.defineProperty(In,"__esModule",{value:!0}),In.validateTuple=void 0;const ov=se,ci=M,MI=vt(),BI={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:r}=e;if(Array.isArray(t))return iv(e,"additionalItems",t);r.items=!0,!(0,ci.alwaysValidSchema)(r,t)&&e.ok((0,MI.validateArray)(e))}};function iv(e,t,r=e.schema){const{gen:o,parentSchema:n,data:i,keyword:a,it:s}=e;l(n),s.opts.unevaluated&&r.length&&s.items!==!0&&(s.items=ci.mergeEvaluated.items(o,r.length,s.items));const c=o.name("valid"),u=o.const("len",(0,ov._)`${i}.length`);r.forEach((d,p)=>{(0,ci.alwaysValidSchema)(s,d)||(o.if((0,ov._)`${u} > ${p}`,()=>e.subschema({keyword:a,schemaProp:p,dataProp:p},c)),e.ok(c))});function l(d){const{opts:p,errSchemaPath:m}=s,f=r.length,_=f===d.minItems&&(f===d.maxItems||d[t]===!1);if(p.strictTuples&&!_){const g=`"${a}" is ${f}-tuple, but minItems or maxItems/${t} are not specified or different at path "${m}"`;(0,ci.checkStrictMode)(s,g,p.strictTuples)}}}In.validateTuple=iv,In.default=BI,Object.defineProperty(Rc,"__esModule",{value:!0});const ZI=In,FI={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,ZI.validateTuple)(e,"items")};Rc.default=FI;var Uc={};Object.defineProperty(Uc,"__esModule",{value:!0});const av=se,VI=M,LI=vt(),qI=wn,JI={message:({params:{len:e}})=>(0,av.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,av._)`{limit: ${e}}`},HI={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:JI,code(e){const{schema:t,parentSchema:r,it:o}=e,{prefixItems:n}=r;o.items=!0,!(0,VI.alwaysValidSchema)(o,t)&&(n?(0,qI.validateAdditionalItems)(e,n):e.ok((0,LI.validateArray)(e)))}};Uc.default=HI;var Mc={};Object.defineProperty(Mc,"__esModule",{value:!0});const mt=se,ui=M,KI={message:({params:{min:e,max:t}})=>t===void 0?(0,mt.str)`must contain at least ${e} valid item(s)`:(0,mt.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,mt._)`{minContains: ${e}}`:(0,mt._)`{minContains: ${e}, maxContains: ${t}}`},GI={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:KI,code(e){const{gen:t,schema:r,parentSchema:o,data:n,it:i}=e;let a,s;const{minContains:c,maxContains:u}=o;i.opts.next?(a=c===void 0?1:c,s=u):a=1;const l=t.const("len",(0,mt._)`${n}.length`);if(e.setParams({min:a,max:s}),s===void 0&&a===0){(0,ui.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(s!==void 0&&a>s){(0,ui.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,ui.alwaysValidSchema)(i,r)){let _=(0,mt._)`${l} >= ${a}`;s!==void 0&&(_=(0,mt._)`${_} && ${l} <= ${s}`),e.pass(_);return}i.items=!0;const d=t.name("valid");s===void 0&&a===1?m(d,()=>t.if(d,()=>t.break())):a===0?(t.let(d,!0),s!==void 0&&t.if((0,mt._)`${n}.length > 0`,p)):(t.let(d,!1),p()),e.result(d,()=>e.reset());function p(){const _=t.name("_valid"),g=t.let("count",0);m(_,()=>t.if(_,()=>f(g)))}function m(_,g){t.forRange("i",0,l,v=>{e.subschema({keyword:"contains",dataProp:v,dataPropType:ui.Type.Num,compositeRule:!0},_),g()})}function f(_){t.code((0,mt._)`${_}++`),s===void 0?t.if((0,mt._)`${_} >= ${a}`,()=>t.assign(d,!0).break()):(t.if((0,mt._)`${_} > ${s}`,()=>t.assign(d,!1).break()),a===1?t.assign(d,!0):t.if((0,mt._)`${_} >= ${a}`,()=>t.assign(d,!0)))}}};Mc.default=GI;var sv={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=se,r=M,o=vt();e.error={message:({params:{property:c,depsCount:u,deps:l}})=>{const d=u===1?"property":"properties";return(0,t.str)`must have ${d} ${l} when property ${c} is present`},params:({params:{property:c,depsCount:u,deps:l,missingProperty:d}})=>(0,t._)`{property: ${c},
|
|
75
|
+
missingProperty: ${d},
|
|
76
|
+
depsCount: ${u},
|
|
77
|
+
deps: ${l}}`};const n={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(c){const[u,l]=i(c);a(c,u),s(c,l)}};function i({schema:c}){const u={},l={};for(const d in c){if(d==="__proto__")continue;const p=Array.isArray(c[d])?u:l;p[d]=c[d]}return[u,l]}function a(c,u=c.schema){const{gen:l,data:d,it:p}=c;if(Object.keys(u).length===0)return;const m=l.let("missing");for(const f in u){const _=u[f];if(_.length===0)continue;const g=(0,o.propertyInData)(l,d,f,p.opts.ownProperties);c.setParams({property:f,depsCount:_.length,deps:_.join(", ")}),p.allErrors?l.if(g,()=>{for(const v of _)(0,o.checkReportMissingProp)(c,v)}):(l.if((0,t._)`${g} && (${(0,o.checkMissingProp)(c,_,m)})`),(0,o.reportMissingProp)(c,m),l.else())}}e.validatePropertyDeps=a;function s(c,u=c.schema){const{gen:l,data:d,keyword:p,it:m}=c,f=l.name("valid");for(const _ in u)(0,r.alwaysValidSchema)(m,u[_])||(l.if((0,o.propertyInData)(l,d,_,m.opts.ownProperties),()=>{const g=c.subschema({keyword:p,schemaProp:_},f);c.mergeValidEvaluated(g,f)},()=>l.var(f,!0)),c.ok(f))}e.validateSchemaDeps=s,e.default=n})(sv);var Bc={};Object.defineProperty(Bc,"__esModule",{value:!0});const cv=se,WI=M,YI={message:"property name must be valid",params:({params:e})=>(0,cv._)`{propertyName: ${e.propertyName}}`},XI={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:YI,code(e){const{gen:t,schema:r,data:o,it:n}=e;if((0,WI.alwaysValidSchema)(n,r))return;const i=t.name("valid");t.forIn("key",o,a=>{e.setParams({propertyName:a}),e.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},i),t.if((0,cv.not)(i),()=>{e.error(!0),n.allErrors||t.break()})}),e.ok(i)}};Bc.default=XI;var li={};Object.defineProperty(li,"__esModule",{value:!0});const di=vt(),$t=se,QI=At(),mi=M,eO={message:"must NOT have additional properties",params:({params:e})=>(0,$t._)`{additionalProperty: ${e.additionalProperty}}`},tO={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:eO,code(e){const{gen:t,schema:r,parentSchema:o,data:n,errsCount:i,it:a}=e;if(!i)throw new Error("ajv implementation error");const{allErrors:s,opts:c}=a;if(a.props=!0,c.removeAdditional!=="all"&&(0,mi.alwaysValidSchema)(a,r))return;const u=(0,di.allSchemaProperties)(o.properties),l=(0,di.allSchemaProperties)(o.patternProperties);d(),e.ok((0,$t._)`${i} === ${QI.default.errors}`);function d(){t.forIn("key",n,g=>{!u.length&&!l.length?f(g):t.if(p(g),()=>f(g))})}function p(g){let v;if(u.length>8){const y=(0,mi.schemaRefOrVal)(a,o.properties,"properties");v=(0,di.isOwnProperty)(t,y,g)}else u.length?v=(0,$t.or)(...u.map(y=>(0,$t._)`${g} === ${y}`)):v=$t.nil;return l.length&&(v=(0,$t.or)(v,...l.map(y=>(0,$t._)`${(0,di.usePattern)(e,y)}.test(${g})`))),(0,$t.not)(v)}function m(g){t.code((0,$t._)`delete ${n}[${g}]`)}function f(g){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){m(g);return}if(r===!1){e.setParams({additionalProperty:g}),e.error(),s||t.break();return}if(typeof r=="object"&&!(0,mi.alwaysValidSchema)(a,r)){const v=t.name("valid");c.removeAdditional==="failing"?(_(g,v,!1),t.if((0,$t.not)(v),()=>{e.reset(),m(g)})):(_(g,v),s||t.if((0,$t.not)(v),()=>t.break()))}}function _(g,v,y){const b={keyword:"additionalProperties",dataProp:g,dataPropType:mi.Type.Str};y===!1&&Object.assign(b,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(b,v)}}};li.default=tO;var Zc={};Object.defineProperty(Zc,"__esModule",{value:!0});const nO=Go(),uv=vt(),Fc=M,lv=li,rO={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,parentSchema:o,data:n,it:i}=e;i.opts.removeAdditional==="all"&&o.additionalProperties===void 0&&lv.default.code(new nO.KeywordCxt(i,lv.default,"additionalProperties"));const a=(0,uv.allSchemaProperties)(r);for(const d of a)i.definedProperties.add(d);i.opts.unevaluated&&a.length&&i.props!==!0&&(i.props=Fc.mergeEvaluated.props(t,(0,Fc.toHash)(a),i.props));const s=a.filter(d=>!(0,Fc.alwaysValidSchema)(i,r[d]));if(s.length===0)return;const c=t.name("valid");for(const d of s)u(d)?l(d):(t.if((0,uv.propertyInData)(t,n,d,i.opts.ownProperties)),l(d),i.allErrors||t.else().var(c,!0),t.endIf()),e.it.definedProperties.add(d),e.ok(c);function u(d){return i.opts.useDefaults&&!i.compositeRule&&r[d].default!==void 0}function l(d){e.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};Zc.default=rO;var Vc={};Object.defineProperty(Vc,"__esModule",{value:!0});const dv=vt(),pi=se,mv=M,pv=M,oO={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,data:o,parentSchema:n,it:i}=e,{opts:a}=i,s=(0,dv.allSchemaProperties)(r),c=s.filter(_=>(0,mv.alwaysValidSchema)(i,r[_]));if(s.length===0||c.length===s.length&&(!i.opts.unevaluated||i.props===!0))return;const u=a.strictSchema&&!a.allowMatchingProperties&&n.properties,l=t.name("valid");i.props!==!0&&!(i.props instanceof pi.Name)&&(i.props=(0,pv.evaluatedPropsToName)(t,i.props));const{props:d}=i;p();function p(){for(const _ of s)u&&m(_),i.allErrors?f(_):(t.var(l,!0),f(_),t.if(l))}function m(_){for(const g in u)new RegExp(_).test(g)&&(0,mv.checkStrictMode)(i,`property ${g} matches pattern ${_} (use allowMatchingProperties)`)}function f(_){t.forIn("key",o,g=>{t.if((0,pi._)`${(0,dv.usePattern)(e,_)}.test(${g})`,()=>{const v=c.includes(_);v||e.subschema({keyword:"patternProperties",schemaProp:_,dataProp:g,dataPropType:pv.Type.Str},l),i.opts.unevaluated&&d!==!0?t.assign((0,pi._)`${d}[${g}]`,!0):!v&&!i.allErrors&&t.if((0,pi.not)(l),()=>t.break())})})}}};Vc.default=oO;var Lc={};Object.defineProperty(Lc,"__esModule",{value:!0});const iO=M,aO={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:r,it:o}=e;if((0,iO.alwaysValidSchema)(o,r)){e.fail();return}const n=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},n),e.failResult(n,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};Lc.default=aO;var qc={};Object.defineProperty(qc,"__esModule",{value:!0});const sO=vt(),cO={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:sO.validateUnion,error:{message:"must match a schema in anyOf"}};qc.default=cO;var Jc={};Object.defineProperty(Jc,"__esModule",{value:!0});const fi=se,uO=M,lO={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,fi._)`{passingSchemas: ${e.passing}}`},dO={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:lO,code(e){const{gen:t,schema:r,parentSchema:o,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(n.opts.discriminator&&o.discriminator)return;const i=r,a=t.let("valid",!1),s=t.let("passing",null),c=t.name("_valid");e.setParams({passing:s}),t.block(u),e.result(a,()=>e.reset(),()=>e.error(!0));function u(){i.forEach((l,d)=>{let p;(0,uO.alwaysValidSchema)(n,l)?t.var(c,!0):p=e.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&t.if((0,fi._)`${c} && ${a}`).assign(a,!1).assign(s,(0,fi._)`[${s}, ${d}]`).else(),t.if(c,()=>{t.assign(a,!0),t.assign(s,d),p&&e.mergeEvaluated(p,fi.Name)})})}}};Jc.default=dO;var Hc={};Object.defineProperty(Hc,"__esModule",{value:!0});const mO=M,pO={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:r,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");const n=t.name("valid");r.forEach((i,a)=>{if((0,mO.alwaysValidSchema)(o,i))return;const s=e.subschema({keyword:"allOf",schemaProp:a},n);e.ok(n),e.mergeEvaluated(s)})}};Hc.default=pO;var Kc={};Object.defineProperty(Kc,"__esModule",{value:!0});const hi=se,fv=M,fO={message:({params:e})=>(0,hi.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,hi._)`{failingKeyword: ${e.ifClause}}`},hO={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:fO,code(e){const{gen:t,parentSchema:r,it:o}=e;r.then===void 0&&r.else===void 0&&(0,fv.checkStrictMode)(o,'"if" without "then" and "else" is ignored');const n=hv(o,"then"),i=hv(o,"else");if(!n&&!i)return;const a=t.let("valid",!0),s=t.name("_valid");if(c(),e.reset(),n&&i){const l=t.let("ifClause");e.setParams({ifClause:l}),t.if(s,u("then",l),u("else",l))}else n?t.if(s,u("then")):t.if((0,hi.not)(s),u("else"));e.pass(a,()=>e.error(!0));function c(){const l=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},s);e.mergeEvaluated(l)}function u(l,d){return()=>{const p=e.subschema({keyword:l},s);t.assign(a,s),e.mergeValidEvaluated(p,a),d?t.assign(d,(0,hi._)`${l}`):e.setParams({ifClause:l})}}}};function hv(e,t){const r=e.schema[t];return r!==void 0&&!(0,fv.alwaysValidSchema)(e,r)}Kc.default=hO;var Gc={};Object.defineProperty(Gc,"__esModule",{value:!0});const gO=M,vO={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,gO.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};Gc.default=vO,Object.defineProperty(Ac,"__esModule",{value:!0});const yO=wn,_O=Rc,$O=In,bO=Uc,kO=Mc,SO=sv,wO=Bc,IO=li,OO=Zc,TO=Vc,PO=Lc,xO=qc,NO=Jc,EO=Hc,zO=Kc,jO=Gc;function DO(e=!1){const t=[PO.default,xO.default,NO.default,EO.default,zO.default,jO.default,wO.default,IO.default,SO.default,OO.default,TO.default];return e?t.push(_O.default,bO.default):t.push(yO.default,$O.default),t.push(kO.default),t}Ac.default=DO;var Wc={},Yc={};Object.defineProperty(Yc,"__esModule",{value:!0});const xe=se,AO={message:({schemaCode:e})=>(0,xe.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,xe._)`{format: ${e}}`},CO={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:AO,code(e,t){const{gen:r,data:o,$data:n,schema:i,schemaCode:a,it:s}=e,{opts:c,errSchemaPath:u,schemaEnv:l,self:d}=s;if(!c.validateFormats)return;n?p():m();function p(){const f=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),_=r.const("fDef",(0,xe._)`${f}[${a}]`),g=r.let("fType"),v=r.let("format");r.if((0,xe._)`typeof ${_} == "object" && !(${_} instanceof RegExp)`,()=>r.assign(g,(0,xe._)`${_}.type || "string"`).assign(v,(0,xe._)`${_}.validate`),()=>r.assign(g,(0,xe._)`"string"`).assign(v,_)),e.fail$data((0,xe.or)(y(),b()));function y(){return c.strictSchema===!1?xe.nil:(0,xe._)`${a} && !${v}`}function b(){const I=l.$async?(0,xe._)`(${_}.async ? await ${v}(${o}) : ${v}(${o}))`:(0,xe._)`${v}(${o})`,x=(0,xe._)`(typeof ${v} == "function" ? ${I} : ${v}.test(${o}))`;return(0,xe._)`${v} && ${v} !== true && ${g} === ${t} && !${x}`}}function m(){const f=d.formats[i];if(!f){y();return}if(f===!0)return;const[_,g,v]=b(f);_===t&&e.pass(I());function y(){if(c.strictSchema===!1){d.logger.warn(x());return}throw new Error(x());function x(){return`unknown format "${i}" ignored in schema at path "${u}"`}}function b(x){const B=x instanceof RegExp?(0,xe.regexpCode)(x):c.code.formats?(0,xe._)`${c.code.formats}${(0,xe.getProperty)(i)}`:void 0,L=r.scopeValue("formats",{key:i,ref:x,code:B});return typeof x=="object"&&!(x instanceof RegExp)?[x.type||"string",x.validate,(0,xe._)`${L}.validate`]:["string",x,L]}function I(){if(typeof f=="object"&&!(f instanceof RegExp)&&f.async){if(!l.$async)throw new Error("async format in sync schema");return(0,xe._)`await ${v}(${o})`}return typeof g=="function"?(0,xe._)`${v}(${o})`:(0,xe._)`${v}.test(${o})`}}}};Yc.default=CO,Object.defineProperty(Wc,"__esModule",{value:!0});const RO=Yc,UO=[RO.default];Wc.default=UO;var On={};Object.defineProperty(On,"__esModule",{value:!0}),On.contentVocabulary=On.metadataVocabulary=void 0,On.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],On.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"],Object.defineProperty(yc,"__esModule",{value:!0});const MO=_c,BO=bc,ZO=Ac,FO=Wc,gv=On,VO=[MO.default,BO.default,(0,ZO.default)(),FO.default,gv.metadataVocabulary,gv.contentVocabulary];yc.default=VO;var Xc={},gi={};Object.defineProperty(gi,"__esModule",{value:!0}),gi.DiscrError=void 0;var vv;(function(e){e.Tag="tag",e.Mapping="mapping"})(vv||(gi.DiscrError=vv={})),Object.defineProperty(Xc,"__esModule",{value:!0});const Tn=se,Qc=gi,yv=Ye,LO=Xo(),qO=M,JO={message:({params:{discrError:e,tagName:t}})=>e===Qc.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,Tn._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},HO={keyword:"discriminator",type:"object",schemaType:"object",error:JO,code(e){const{gen:t,data:r,schema:o,parentSchema:n,it:i}=e,{oneOf:a}=n;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");const s=o.propertyName;if(typeof s!="string")throw new Error("discriminator: requires propertyName");if(o.mapping)throw new Error("discriminator: mapping is not supported");if(!a)throw new Error("discriminator: requires oneOf keyword");const c=t.let("valid",!1),u=t.const("tag",(0,Tn._)`${r}${(0,Tn.getProperty)(s)}`);t.if((0,Tn._)`typeof ${u} == "string"`,()=>l(),()=>e.error(!1,{discrError:Qc.DiscrError.Tag,tag:u,tagName:s})),e.ok(c);function l(){const m=p();t.if(!1);for(const f in m)t.elseIf((0,Tn._)`${u} === ${f}`),t.assign(c,d(m[f]));t.else(),e.error(!1,{discrError:Qc.DiscrError.Mapping,tag:u,tagName:s}),t.endIf()}function d(m){const f=t.name("valid"),_=e.subschema({keyword:"oneOf",schemaProp:m},f);return e.mergeEvaluated(_,Tn.Name),f}function p(){var m;const f={},_=v(n);let g=!0;for(let I=0;I<a.length;I++){let x=a[I];if(x?.$ref&&!(0,qO.schemaHasRulesButRef)(x,i.self.RULES)){const L=x.$ref;if(x=yv.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,L),x instanceof yv.SchemaEnv&&(x=x.schema),x===void 0)throw new LO.default(i.opts.uriResolver,i.baseId,L)}const B=(m=x?.properties)===null||m===void 0?void 0:m[s];if(typeof B!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${s}"`);g=g&&(_||v(x)),y(B,I)}if(!g)throw new Error(`discriminator: "${s}" must be required`);return f;function v({required:I}){return Array.isArray(I)&&I.includes(s)}function y(I,x){if(I.const)b(I.const,x);else if(I.enum)for(const B of I.enum)b(B,x);else throw new Error(`discriminator: "properties/${s}" must have "const" or "enum"`)}function b(I,x){if(typeof I!="string"||I in f)throw new Error(`discriminator: "${s}" values must be unique strings`);f[I]=x}}}};Xc.default=HO;var KO="http://json-schema.org/draft-07/schema#",GO="http://json-schema.org/draft-07/schema#",WO="Core schema meta-schema",YO={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},XO=["object","boolean"],QO={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},eT={$schema:KO,$id:GO,title:WO,definitions:YO,type:XO,properties:QO,default:!0};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const r=ig,o=yc,n=Xc,i=eT,a=["/properties"],s="http://json-schema.org/draft-07/schema";class c extends r.default{_addVocabularies(){super._addVocabularies(),o.default.forEach(f=>this.addVocabulary(f)),this.opts.discriminator&&this.addKeyword(n.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const f=this.opts.$data?this.$dataMetaSchema(i,a):i;this.addMetaSchema(f,s,!1),this.refs["http://json-schema.org/schema"]=s}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(s)?s:void 0)}}t.Ajv=c,e.exports=t=c,e.exports.Ajv=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var u=Go();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var l=se;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return l._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return l.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return l.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return l.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return l.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return l.CodeGen}});var d=dc();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return d.default}});var p=Xo();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return p.default}})})(tc,tc.exports);var _v=tc.exports,tT=og(_v),eu={exports:{}},$v={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(Z,Q){return{validate:Z,compare:Q}}e.fullFormats={date:t(i,a),time:t(c(!0),u),"date-time":t(p(!0),m),"iso-time":t(c(),l),"iso-date-time":t(p(),f),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:v,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:Te,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:b,int32:{type:"number",validate:B},int64:{type:"number",validate:L},float:{type:"number",validate:ue},double:{type:"number",validate:ue},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,a),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,u),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,m),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,l),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,f),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function r(Z){return Z%4===0&&(Z%100!==0||Z%400===0)}const o=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,n=[0,31,28,31,30,31,30,31,31,30,31,30,31];function i(Z){const Q=o.exec(Z);if(!Q)return!1;const Y=+Q[1],K=+Q[2],Pe=+Q[3];return K>=1&&K<=12&&Pe>=1&&Pe<=(K===2&&r(Y)?29:n[K])}function a(Z,Q){if(Z&&Q)return Z>Q?1:Z<Q?-1:0}const s=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function c(Z){return function(Y){const K=s.exec(Y);if(!K)return!1;const Pe=+K[1],ot=+K[2],it=+K[3],Mt=K[4],wt=K[5]==="-"?-1:1,C=+(K[6]||0),O=+(K[7]||0);if(C>23||O>59||Z&&!Mt)return!1;if(Pe<=23&&ot<=59&&it<60)return!0;const j=ot-O*wt,P=Pe-C*wt-(j<0?1:0);return(P===23||P===-1)&&(j===59||j===-1)&&it<61}}function u(Z,Q){if(!(Z&&Q))return;const Y=new Date("2020-01-01T"+Z).valueOf(),K=new Date("2020-01-01T"+Q).valueOf();if(Y&&K)return Y-K}function l(Z,Q){if(!(Z&&Q))return;const Y=s.exec(Z),K=s.exec(Q);if(Y&&K)return Z=Y[1]+Y[2]+Y[3],Q=K[1]+K[2]+K[3],Z>Q?1:Z<Q?-1:0}const d=/t|\s/i;function p(Z){const Q=c(Z);return function(K){const Pe=K.split(d);return Pe.length===2&&i(Pe[0])&&Q(Pe[1])}}function m(Z,Q){if(!(Z&&Q))return;const Y=new Date(Z).valueOf(),K=new Date(Q).valueOf();if(Y&&K)return Y-K}function f(Z,Q){if(!(Z&&Q))return;const[Y,K]=Z.split(d),[Pe,ot]=Q.split(d),it=a(Y,Pe);if(it!==void 0)return it||u(K,ot)}const _=/\/|:/,g=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function v(Z){return _.test(Z)&&g.test(Z)}const y=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function b(Z){return y.lastIndex=0,y.test(Z)}const I=-2147483648,x=2**31-1;function B(Z){return Number.isInteger(Z)&&Z<=x&&Z>=I}function L(Z){return Number.isInteger(Z)}function ue(){return!0}const me=/[^\\]\\Z/;function Te(Z){if(me.test(Z))return!1;try{return new RegExp(Z),!0}catch{return!1}}})($v);var bv={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=_v,r=se,o=r.operators,n={formatMaximum:{okStr:"<=",ok:o.LTE,fail:o.GT},formatMinimum:{okStr:">=",ok:o.GTE,fail:o.LT},formatExclusiveMaximum:{okStr:"<",ok:o.LT,fail:o.GTE},formatExclusiveMinimum:{okStr:">",ok:o.GT,fail:o.LTE}},i={message:({keyword:s,schemaCode:c})=>(0,r.str)`should be ${n[s].okStr} ${c}`,params:({keyword:s,schemaCode:c})=>(0,r._)`{comparison: ${n[s].okStr}, limit: ${c}}`};e.formatLimitDefinition={keyword:Object.keys(n),type:"string",schemaType:"string",$data:!0,error:i,code(s){const{gen:c,data:u,schemaCode:l,keyword:d,it:p}=s,{opts:m,self:f}=p;if(!m.validateFormats)return;const _=new t.KeywordCxt(p,f.RULES.all.format.definition,"format");_.$data?g():v();function g(){const b=c.scopeValue("formats",{ref:f.formats,code:m.code.formats}),I=c.const("fmt",(0,r._)`${b}[${_.schemaCode}]`);s.fail$data((0,r.or)((0,r._)`typeof ${I} != "object"`,(0,r._)`${I} instanceof RegExp`,(0,r._)`typeof ${I}.compare != "function"`,y(I)))}function v(){const b=_.schema,I=f.formats[b];if(!I||I===!0)return;if(typeof I!="object"||I instanceof RegExp||typeof I.compare!="function")throw new Error(`"${d}": format "${b}" does not define "compare" function`);const x=c.scopeValue("formats",{key:b,ref:I,code:m.code.formats?(0,r._)`${m.code.formats}${(0,r.getProperty)(b)}`:void 0});s.fail$data(y(x))}function y(b){return(0,r._)`${b}.compare(${u}, ${l}) ${n[d].fail} 0`}},dependencies:["format"]};const a=s=>(s.addKeyword(e.formatLimitDefinition),s);e.default=a})(bv),(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=$v,o=bv,n=se,i=new n.Name("fullFormats"),a=new n.Name("fastFormats"),s=(u,l={keywords:!0})=>{if(Array.isArray(l))return c(u,l,r.fullFormats,i),u;const[d,p]=l.mode==="fast"?[r.fastFormats,a]:[r.fullFormats,i],m=l.formats||r.formatNames;return c(u,m,d,p),l.keywords&&(0,o.default)(u),u};s.get=(u,l="full")=>{const p=(l==="fast"?r.fastFormats:r.fullFormats)[u];if(!p)throw new Error(`Unknown format "${u}"`);return p};function c(u,l,d,p){var m,f;(m=(f=u.opts.code).formats)!==null&&m!==void 0||(f.formats=(0,n._)`require("ajv-formats/dist/formats").${p}`);for(const _ of l)u.addFormat(_,d[_])}e.exports=t=s,Object.defineProperty(t,"__esModule",{value:!0}),t.default=s})(eu,eu.exports);var nT=eu.exports,rT=og(nT);function oT(){const e=new tT({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return rT(e),e}class iT{constructor(t){this._ajv=t??oT()}getValidator(t){const r="$id"in t&&typeof t.$id=="string"?this._ajv.getSchema(t.$id)??this._ajv.compile(t):this._ajv.compile(t);return o=>r(o)?{valid:!0,data:o,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}}class aT{constructor(t){this._server=t}requestStream(t,r,o){return this._server.requestStream(t,r,o)}createMessageStream(t,r){const o=this._server.getClientCapabilities();if((t.tools||t.toolChoice)&&!o?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(t.messages.length>0){const n=t.messages[t.messages.length-1],i=Array.isArray(n.content)?n.content:[n.content],a=i.some(l=>l.type==="tool_result"),s=t.messages.length>1?t.messages[t.messages.length-2]:void 0,c=s?Array.isArray(s.content)?s.content:[s.content]:[],u=c.some(l=>l.type==="tool_use");if(a){if(i.some(l=>l.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!u)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(u){const l=new Set(c.filter(p=>p.type==="tool_use").map(p=>p.id)),d=new Set(i.filter(p=>p.type==="tool_result").map(p=>p.toolUseId));if(l.size!==d.size||![...l].every(p=>d.has(p)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return this.requestStream({method:"sampling/createMessage",params:t},Ys,r)}elicitInputStream(t,r){const o=this._server.getClientCapabilities(),n=t.mode??"form";switch(n){case"url":{if(!o?.elicitation?.url)throw new Error("Client does not support url elicitation.");break}case"form":{if(!o?.elicitation?.form)throw new Error("Client does not support form elicitation.");break}}const i=n==="form"&&t.mode===void 0?{...t,mode:"form"}:t;return this.requestStream({method:"elicitation/create",params:i},Lo,r)}async getTask(t,r){return this._server.getTask({taskId:t},r)}async getTaskResult(t,r,o){return this._server.getTaskResult({taskId:t},r,o)}async listTasks(t,r){return this._server.listTasks(t?{cursor:t}:void 0,r)}async cancelTask(t,r){return this._server.cancelTask({taskId:t},r)}}function sT(e,t,r){if(!e)throw new Error(`${r} does not support task creation (required for ${t})`);switch(t){case"tools/call":if(!e.tools?.call)throw new Error(`${r} does not support task creation for tools/call (required for ${t})`);break}}function cT(e,t,r){if(!e)throw new Error(`${r} does not support task creation (required for ${t})`);switch(t){case"sampling/createMessage":if(!e.sampling?.createMessage)throw new Error(`${r} does not support task creation for sampling/createMessage (required for ${t})`);break;case"elicitation/create":if(!e.elicitation?.create)throw new Error(`${r} does not support task creation for elicitation/create (required for ${t})`);break}}class uT extends XS{constructor(t,r){super(r),this._serverInfo=t,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(Fo.options.map((o,n)=>[o,n])),this.isMessageIgnored=(o,n)=>{const i=this._loggingLevels.get(n);return i?this.LOG_LEVEL_SEVERITY.get(o)<this.LOG_LEVEL_SEVERITY.get(i):!1},this._capabilities=r?.capabilities??{},this._instructions=r?.instructions,this._jsonSchemaValidator=r?.jsonSchemaValidator??new iT,this.setRequestHandler(Ah,o=>this._oninitialize(o)),this.setNotificationHandler(Ch,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(Fh,async(o,n)=>{const i=n.sessionId||n.requestInfo?.headers["mcp-session-id"]||void 0,{level:a}=o.params,s=Fo.safeParse(a);return s.success&&this._loggingLevels.set(i,s.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new aT(this)}),this._experimental}registerCapabilities(t){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=QS(this._capabilities,t)}setRequestHandler(t,r){const n=lr(t)?.method;if(!n)throw new Error("Schema is missing a method literal");let i;if(St(n)){const s=n;i=s._zod?.def?.value??s.value}else{const s=n;i=s._def?.value??s.value}if(typeof i!="string")throw new Error("Schema method literal must be a string");if(i==="tools/call"){const s=async(c,u)=>{const l=ur(Zo,c);if(!l.success){const f=l.error instanceof Error?l.error.message:String(l.error);throw new J(W.InvalidParams,`Invalid tools/call request: ${f}`)}const{params:d}=l.data,p=await Promise.resolve(r(c,u));if(d.task){const f=ur(Mo,p);if(!f.success){const _=f.error instanceof Error?f.error.message:String(f.error);throw new J(W.InvalidParams,`Invalid task creation result: ${_}`)}return f.data}const m=ur(Ws,p);if(!m.success){const f=m.error instanceof Error?m.error.message:String(m.error);throw new J(W.InvalidParams,`Invalid tools/call result: ${f}`)}return m.data};return super.setRequestHandler(t,s)}return super.setRequestHandler(t,r)}assertCapabilityForMethod(t){switch(t){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${t})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${t})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${t})`);break}}assertNotificationCapability(t){switch(t){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${t})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${t})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${t})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${t})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${t})`);break}}assertRequestHandlerCapability(t){if(this._capabilities)switch(t){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${t})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${t})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${t})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${t})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${t})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Server does not support tasks capability (required for ${t})`);break}}assertTaskCapability(t){cT(this._clientCapabilities?.tasks?.requests,t,"Client")}assertTaskHandlerCapability(t){this._capabilities&&sT(this._capabilities.tasks?.requests,t,"Server")}async _oninitialize(t){const r=t.params.protocolVersion;return this._clientCapabilities=t.params.capabilities,this._clientVersion=t.params.clientInfo,{protocolVersion:Eb.includes(r)?r:Ph,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},Ps)}async createMessage(t,r){if((t.tools||t.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(t.messages.length>0){const o=t.messages[t.messages.length-1],n=Array.isArray(o.content)?o.content:[o.content],i=n.some(u=>u.type==="tool_result"),a=t.messages.length>1?t.messages[t.messages.length-2]:void 0,s=a?Array.isArray(a.content)?a.content:[a.content]:[],c=s.some(u=>u.type==="tool_use");if(i){if(n.some(u=>u.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!c)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(c){const u=new Set(s.filter(d=>d.type==="tool_use").map(d=>d.id)),l=new Set(n.filter(d=>d.type==="tool_result").map(d=>d.toolUseId));if(u.size!==l.size||![...u].every(d=>l.has(d)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return t.tools?this.request({method:"sampling/createMessage",params:t},Vh,r):this.request({method:"sampling/createMessage",params:t},Ys,r)}async elicitInput(t,r){switch(t.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");const n=t;return this.request({method:"elicitation/create",params:n},Lo,r)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");const n=t.mode==="form"?t:{...t,mode:"form"},i=await this.request({method:"elicitation/create",params:n},Lo,r);if(i.action==="accept"&&i.content&&n.requestedSchema)try{const s=this._jsonSchemaValidator.getValidator(n.requestedSchema)(i.content);if(!s.valid)throw new J(W.InvalidParams,`Elicitation response content does not match requested schema: ${s.errorMessage}`)}catch(a){throw a instanceof J?a:new J(W.InternalError,`Error validating elicitation response: ${a instanceof Error?a.message:String(a)}`)}return i}}}createElicitationCompletionNotifier(t,r){if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:t}},r)}async listRoots(t,r){return this.request({method:"roots/list",params:t},Lh,r)}async sendLoggingMessage(t,r){if(this._capabilities.logging&&!this.isMessageIgnored(t.level,r))return this.notification({method:"notifications/message",params:t})}async sendResourceUpdated(t){return this.notification({method:"notifications/resources/updated",params:t})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}}const kv=Symbol.for("mcp.completable");function Sv(e){return!!e&&typeof e=="object"&&kv in e}function lT(e){return e[kv]?.complete}var wv;(function(e){e.Completable="McpCompletable"})(wv||(wv={}));const dT=/^[A-Za-z0-9._-]{1,128}$/;function mT(e){const t=[];if(e.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(e.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${e.length})`]};if(e.includes(" ")&&t.push("Tool name contains spaces, which may cause parsing issues"),e.includes(",")&&t.push("Tool name contains commas, which may cause parsing issues"),(e.startsWith("-")||e.endsWith("-"))&&t.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts"),(e.startsWith(".")||e.endsWith("."))&&t.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts"),!dT.test(e)){const r=e.split("").filter(o=>!/[A-Za-z0-9._-]/.test(o)).filter((o,n,i)=>i.indexOf(o)===n);return t.push(`Tool name contains invalid characters: ${r.map(o=>`"${o}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:t}}return{isValid:!0,warnings:t}}function pT(e,t){if(t.length>0){console.warn(`Tool name validation warning for "${e}":`);for(const r of t)console.warn(` - ${r}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function Iv(e){const t=mT(e);return pT(e,t.warnings),t.isValid}class fT{constructor(t){this._mcpServer=t}registerToolTask(t,r,o){const n={taskSupport:"required",...r.execution};if(n.taskSupport==="forbidden")throw new Error(`Cannot register task-based tool '${t}' with taskSupport 'forbidden'. Use registerTool() instead.`);return this._mcpServer._createRegisteredTool(t,r.title,r.description,r.inputSchema,r.outputSchema,r.annotations,n,r._meta,o)}}class hT{constructor(t,r){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new uT(t,r)}get experimental(){return this._experimental||(this._experimental={tasks:new fT(this)}),this._experimental}async connect(t){return await this.server.connect(t)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(Ut(Gs)),this.server.assertCanSetRequestHandler(Ut(Zo)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(Gs,()=>({tools:Object.entries(this._registeredTools).filter(([,t])=>t.enabled).map(([t,r])=>{const o={name:t,title:r.title,description:r.description,inputSchema:(()=>{const n=dr(r.inputSchema);return n?eg(n,{strictUnions:!0,pipeStrategy:"input"}):gT})(),annotations:r.annotations,execution:r.execution,_meta:r._meta};if(r.outputSchema){const n=dr(r.outputSchema);n&&(o.outputSchema=eg(n,{strictUnions:!0,pipeStrategy:"output"}))}return o})})),this.server.setRequestHandler(Zo,async(t,r)=>{try{const o=this._registeredTools[t.params.name];if(!o)throw new J(W.InvalidParams,`Tool ${t.params.name} not found`);if(!o.enabled)throw new J(W.InvalidParams,`Tool ${t.params.name} disabled`);const n=!!t.params.task,i=o.execution?.taskSupport,a="createTask"in o.handler;if((i==="required"||i==="optional")&&!a)throw new J(W.InternalError,`Tool ${t.params.name} has taskSupport '${i}' but was not registered with registerToolTask`);if(i==="required"&&!n)throw new J(W.MethodNotFound,`Tool ${t.params.name} requires task augmentation (taskSupport: 'required')`);if(i==="optional"&&!n&&a)return await this.handleAutomaticTaskPolling(o,t,r);const s=await this.validateToolInput(o,t.params.arguments,t.params.name),c=await this.executeToolHandler(o,s,r);return n||await this.validateToolOutput(o,c,t.params.name),c}catch(o){if(o instanceof J&&o.code===W.UrlElicitationRequired)throw o;return this.createToolError(o instanceof Error?o.message:String(o))}}),this._toolHandlersInitialized=!0)}createToolError(t){return{content:[{type:"text",text:t}],isError:!0}}async validateToolInput(t,r,o){if(!t.inputSchema)return;const i=dr(t.inputSchema)??t.inputSchema,a=await Ss(i,r);if(!a.success){const s="error"in a?a.error:"Unknown error",c=ws(s);throw new J(W.InvalidParams,`Input validation error: Invalid arguments for tool ${o}: ${c}`)}return a.data}async validateToolOutput(t,r,o){if(!t.outputSchema||!("content"in r)||r.isError)return;if(!r.structuredContent)throw new J(W.InvalidParams,`Output validation error: Tool ${o} has an output schema but no structured content was provided`);const n=dr(t.outputSchema),i=await Ss(n,r.structuredContent);if(!i.success){const a="error"in i?i.error:"Unknown error",s=ws(a);throw new J(W.InvalidParams,`Output validation error: Invalid structured content for tool ${o}: ${s}`)}}async executeToolHandler(t,r,o){const n=t.handler;if("createTask"in n){if(!o.taskStore)throw new Error("No task store provided.");const a={...o,taskStore:o.taskStore};if(t.inputSchema){const s=n;return await Promise.resolve(s.createTask(r,a))}else{const s=n;return await Promise.resolve(s.createTask(a))}}if(t.inputSchema){const a=n;return await Promise.resolve(a(r,o))}else{const a=n;return await Promise.resolve(a(o))}}async handleAutomaticTaskPolling(t,r,o){if(!o.taskStore)throw new Error("No task store provided for task-capable tool.");const n=await this.validateToolInput(t,r.params.arguments,r.params.name),i=t.handler,a={...o,taskStore:o.taskStore},s=n?await Promise.resolve(i.createTask(n,a)):await Promise.resolve(i.createTask(a)),c=s.task.taskId;let u=s.task;const l=u.pollInterval??5e3;for(;u.status!=="completed"&&u.status!=="failed"&&u.status!=="cancelled";){await new Promise(p=>setTimeout(p,l));const d=await o.taskStore.getTask(c);if(!d)throw new J(W.InternalError,`Task ${c} not found during polling`);u=d}return await o.taskStore.getTaskResult(c)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(Ut(Xs)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(Xs,async t=>{switch(t.params.ref.type){case"ref/prompt":return iS(t),this.handlePromptCompletion(t,t.params.ref);case"ref/resource":return aS(t),this.handleResourceCompletion(t,t.params.ref);default:throw new J(W.InvalidParams,`Invalid completion reference: ${t.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(t,r){const o=this._registeredPrompts[r.name];if(!o)throw new J(W.InvalidParams,`Prompt ${r.name} not found`);if(!o.enabled)throw new J(W.InvalidParams,`Prompt ${r.name} disabled`);if(!o.argsSchema)return Pr;const i=lr(o.argsSchema)?.[t.params.argument.name];if(!Sv(i))return Pr;const a=lT(i);if(!a)return Pr;const s=await a(t.params.argument.value,t.params.context);return xv(s)}async handleResourceCompletion(t,r){const o=Object.values(this._registeredResourceTemplates).find(a=>a.resourceTemplate.uriTemplate.toString()===r.uri);if(!o){if(this._registeredResources[r.uri])return Pr;throw new J(W.InvalidParams,`Resource template ${t.params.ref.uri} not found`)}const n=o.resourceTemplate.completeCallback(t.params.argument.name);if(!n)return Pr;const i=await n(t.params.argument.value,t.params.context);return xv(i)}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(Ut(Ms)),this.server.assertCanSetRequestHandler(Ut(Bs)),this.server.assertCanSetRequestHandler(Ut(Fs)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(Ms,async(t,r)=>{const o=Object.entries(this._registeredResources).filter(([i,a])=>a.enabled).map(([i,a])=>({uri:i,name:a.name,...a.metadata})),n=[];for(const i of Object.values(this._registeredResourceTemplates)){if(!i.resourceTemplate.listCallback)continue;const a=await i.resourceTemplate.listCallback(r);for(const s of a.resources)n.push({...i.metadata,...s})}return{resources:[...o,...n]}}),this.server.setRequestHandler(Bs,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([r,o])=>({name:r,uriTemplate:o.resourceTemplate.uriTemplate.toString(),...o.metadata}))})),this.server.setRequestHandler(Fs,async(t,r)=>{const o=new URL(t.params.uri),n=this._registeredResources[o.toString()];if(n){if(!n.enabled)throw new J(W.InvalidParams,`Resource ${o} disabled`);return n.readCallback(o,r)}for(const i of Object.values(this._registeredResourceTemplates)){const a=i.resourceTemplate.uriTemplate.match(o.toString());if(a)return i.readCallback(o,a,r)}throw new J(W.InvalidParams,`Resource ${o} not found`)}),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(Ut(Vs)),this.server.assertCanSetRequestHandler(Ut(Ls)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(Vs,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,t])=>t.enabled).map(([t,r])=>({name:t,title:r.title,description:r.description,arguments:r.argsSchema?vT(r.argsSchema):void 0}))})),this.server.setRequestHandler(Ls,async(t,r)=>{const o=this._registeredPrompts[t.params.name];if(!o)throw new J(W.InvalidParams,`Prompt ${t.params.name} not found`);if(!o.enabled)throw new J(W.InvalidParams,`Prompt ${t.params.name} disabled`);if(o.argsSchema){const n=dr(o.argsSchema),i=await Ss(n,t.params.arguments);if(!i.success){const c="error"in i?i.error:"Unknown error",u=ws(c);throw new J(W.InvalidParams,`Invalid arguments for prompt ${t.params.name}: ${u}`)}const a=i.data,s=o.callback;return await Promise.resolve(s(a,r))}else{const n=o.callback;return await Promise.resolve(n(r))}}),this._promptHandlersInitialized=!0)}resource(t,r,...o){let n;typeof o[0]=="object"&&(n=o.shift());const i=o[0];if(typeof r=="string"){if(this._registeredResources[r])throw new Error(`Resource ${r} is already registered`);const a=this._createRegisteredResource(t,void 0,r,n,i);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),a}else{if(this._registeredResourceTemplates[t])throw new Error(`Resource template ${t} is already registered`);const a=this._createRegisteredResourceTemplate(t,void 0,r,n,i);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),a}}registerResource(t,r,o,n){if(typeof r=="string"){if(this._registeredResources[r])throw new Error(`Resource ${r} is already registered`);const i=this._createRegisteredResource(t,o.title,r,o,n);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),i}else{if(this._registeredResourceTemplates[t])throw new Error(`Resource template ${t} is already registered`);const i=this._createRegisteredResourceTemplate(t,o.title,r,o,n);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),i}}_createRegisteredResource(t,r,o,n,i){const a={name:t,title:r,metadata:n,readCallback:i,enabled:!0,disable:()=>a.update({enabled:!1}),enable:()=>a.update({enabled:!0}),remove:()=>a.update({uri:null}),update:s=>{typeof s.uri<"u"&&s.uri!==o&&(delete this._registeredResources[o],s.uri&&(this._registeredResources[s.uri]=a)),typeof s.name<"u"&&(a.name=s.name),typeof s.title<"u"&&(a.title=s.title),typeof s.metadata<"u"&&(a.metadata=s.metadata),typeof s.callback<"u"&&(a.readCallback=s.callback),typeof s.enabled<"u"&&(a.enabled=s.enabled),this.sendResourceListChanged()}};return this._registeredResources[o]=a,a}_createRegisteredResourceTemplate(t,r,o,n,i){const a={resourceTemplate:o,title:r,metadata:n,readCallback:i,enabled:!0,disable:()=>a.update({enabled:!1}),enable:()=>a.update({enabled:!0}),remove:()=>a.update({name:null}),update:u=>{typeof u.name<"u"&&u.name!==t&&(delete this._registeredResourceTemplates[t],u.name&&(this._registeredResourceTemplates[u.name]=a)),typeof u.title<"u"&&(a.title=u.title),typeof u.template<"u"&&(a.resourceTemplate=u.template),typeof u.metadata<"u"&&(a.metadata=u.metadata),typeof u.callback<"u"&&(a.readCallback=u.callback),typeof u.enabled<"u"&&(a.enabled=u.enabled),this.sendResourceListChanged()}};this._registeredResourceTemplates[t]=a;const s=o.uriTemplate.variableNames;return Array.isArray(s)&&s.some(u=>!!o.completeCallback(u))&&this.setCompletionRequestHandler(),a}_createRegisteredPrompt(t,r,o,n,i){const a={title:r,description:o,argsSchema:n===void 0?void 0:gn(n),callback:i,enabled:!0,disable:()=>a.update({enabled:!1}),enable:()=>a.update({enabled:!0}),remove:()=>a.update({name:null}),update:s=>{typeof s.name<"u"&&s.name!==t&&(delete this._registeredPrompts[t],s.name&&(this._registeredPrompts[s.name]=a)),typeof s.title<"u"&&(a.title=s.title),typeof s.description<"u"&&(a.description=s.description),typeof s.argsSchema<"u"&&(a.argsSchema=gn(s.argsSchema)),typeof s.callback<"u"&&(a.callback=s.callback),typeof s.enabled<"u"&&(a.enabled=s.enabled),this.sendPromptListChanged()}};return this._registeredPrompts[t]=a,n&&Object.values(n).some(c=>{const u=c instanceof or?c._def?.innerType:c;return Sv(u)})&&this.setCompletionRequestHandler(),a}_createRegisteredTool(t,r,o,n,i,a,s,c,u){Iv(t);const l={title:r,description:o,inputSchema:Pv(n),outputSchema:Pv(i),annotations:a,execution:s,_meta:c,handler:u,enabled:!0,disable:()=>l.update({enabled:!1}),enable:()=>l.update({enabled:!0}),remove:()=>l.update({name:null}),update:d=>{typeof d.name<"u"&&d.name!==t&&(typeof d.name=="string"&&Iv(d.name),delete this._registeredTools[t],d.name&&(this._registeredTools[d.name]=l)),typeof d.title<"u"&&(l.title=d.title),typeof d.description<"u"&&(l.description=d.description),typeof d.paramsSchema<"u"&&(l.inputSchema=gn(d.paramsSchema)),typeof d.outputSchema<"u"&&(l.outputSchema=gn(d.outputSchema)),typeof d.callback<"u"&&(l.handler=d.callback),typeof d.annotations<"u"&&(l.annotations=d.annotations),typeof d._meta<"u"&&(l._meta=d._meta),typeof d.enabled<"u"&&(l.enabled=d.enabled),this.sendToolListChanged()}};return this._registeredTools[t]=l,this.setToolRequestHandlers(),this.sendToolListChanged(),l}tool(t,...r){if(this._registeredTools[t])throw new Error(`Tool ${t} is already registered`);let o,n,i,a;if(typeof r[0]=="string"&&(o=r.shift()),r.length>1){const c=r[0];if(tu(c))n=r.shift(),r.length>1&&typeof r[0]=="object"&&r[0]!==null&&!tu(r[0])&&(a=r.shift());else if(typeof c=="object"&&c!==null){if(Object.values(c).some(u=>typeof u=="object"&&u!==null))throw new Error(`Tool ${t} expected a Zod schema or ToolAnnotations, but received an unrecognized object`);a=r.shift()}}const s=r[0];return this._createRegisteredTool(t,void 0,o,n,i,a,{taskSupport:"forbidden"},void 0,s)}registerTool(t,r,o){if(this._registeredTools[t])throw new Error(`Tool ${t} is already registered`);const{title:n,description:i,inputSchema:a,outputSchema:s,annotations:c,_meta:u}=r;return this._createRegisteredTool(t,n,i,a,s,c,{taskSupport:"forbidden"},u,o)}prompt(t,...r){if(this._registeredPrompts[t])throw new Error(`Prompt ${t} is already registered`);let o;typeof r[0]=="string"&&(o=r.shift());let n;r.length>1&&(n=r.shift());const i=r[0],a=this._createRegisteredPrompt(t,void 0,o,n,i);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),a}registerPrompt(t,r,o){if(this._registeredPrompts[t])throw new Error(`Prompt ${t} is already registered`);const{title:n,description:i,argsSchema:a}=r,s=this._createRegisteredPrompt(t,n,i,a,o);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),s}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(t,r){return this.server.sendLoggingMessage(t,r)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}}const gT={type:"object",properties:{}};function Ov(e){return e!==null&&typeof e=="object"&&"parse"in e&&typeof e.parse=="function"&&"safeParse"in e&&typeof e.safeParse=="function"}function Tv(e){return"_def"in e||"_zod"in e||Ov(e)}function tu(e){return typeof e!="object"||e===null||Tv(e)?!1:Object.keys(e).length===0?!0:Object.values(e).some(Ov)}function Pv(e){if(e){if(tu(e))return gn(e);if(!Tv(e))throw new Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");return e}}function vT(e){const t=lr(e);return t?Object.entries(t).map(([r,o])=>{const n=xb(o),i=Nb(o);return{name:r,description:n,required:!i}}):[]}function Ut(e){const r=lr(e)?.method;if(!r)throw new Error("Schema is missing a method literal");const o=Th(r);if(typeof o=="string")return o;throw new Error("Schema method literal must be a string")}function xv(e){return{completion:{values:e.slice(0,100),total:e.length,hasMore:e.length>100}}}const Pr={completion:{values:[],hasMore:!1}};class yT{append(t){this._buffer=this._buffer?Buffer.concat([this._buffer,t]):t}readMessage(){if(!this._buffer)return null;const t=this._buffer.indexOf(`
|
|
78
|
+
`);if(t===-1)return null;const r=this._buffer.toString("utf8",0,t).replace(/\r$/,"");return this._buffer=this._buffer.subarray(t+1),_T(r)}clear(){this._buffer=void 0}}function _T(e){return Rb.parse(JSON.parse(e))}function $T(e){return JSON.stringify(e)+`
|
|
79
|
+
`}class bT{constructor(t=mu.stdin,r=mu.stdout){this._stdin=t,this._stdout=r,this._readBuffer=new yT,this._started=!1,this._ondata=o=>{this._readBuffer.append(o),this.processReadBuffer()},this._onerror=o=>{this.onerror?.(o)}}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){for(;;)try{const t=this._readBuffer.readMessage();if(t===null)break;this.onmessage?.(t)}catch(t){this.onerror?.(t)}}async close(){this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.()}send(t){return new Promise(r=>{const o=$T(t);this._stdout.write(o)?r():this._stdout.once("drain",r)})}}const Pn={InputBlock:{className:"InputBlock",category:"Input",description:"Provides input values to the graph. Can be configured as an attribute (position, normal, uv, etc.), a system value (World, View, Projection matrices, etc.), or a constant/uniform value (Float, Vector2/3/4, Color3/4, Matrix).",target:"Vertex",inputs:[],outputs:[{name:"output",type:"AutoDetect"}],properties:{type:"NodeMaterialBlockConnectionPointTypes \u2014 the data type of this input (Float, Vector2, Vector3, Vector4, Color3, Color4, Matrix)",isConstant:"boolean \u2014 whether the value is baked into the shader",visibleInInspector:"boolean \u2014 whether to show this in the Inspector UI",animationType:"AnimatedInputBlockTypes \u2014 None, Time",systemValue:"NodeMaterialSystemValues \u2014 World, View, Projection, ViewProjection, WorldView, WorldViewProjection, CameraPosition, FogColor, DeltaTime, CameraParameters, MaterialAlpha",attributeName:"string \u2014 position, normal, tangent, uv, uv2, uv3, uv4, uv5, uv6, color, matricesIndices, matricesWeights, matricesIndicesExtra, matricesWeightsExtra",value:"The actual uniform value (number, Vector2, Vector3, Vector4, Color3, Color4, Matrix)",min:"number \u2014 minimum value for inspector slider",max:"number \u2014 maximum value for inspector slider"}},AddBlock:{className:"AddBlock",category:"Math",description:"Adds two values together (left + right).",target:"Neutral",inputs:[{name:"left",type:"AutoDetect"},{name:"right",type:"AutoDetect"}],outputs:[{name:"output",type:"BasedOnInput"}]},SubtractBlock:{className:"SubtractBlock",category:"Math",description:"Subtracts right from left (left - right).",target:"Neutral",inputs:[{name:"left",type:"AutoDetect"},{name:"right",type:"AutoDetect"}],outputs:[{name:"output",type:"BasedOnInput"}]},MultiplyBlock:{className:"MultiplyBlock",category:"Math",description:"Multiplies two values (left * right).",target:"Neutral",inputs:[{name:"left",type:"AutoDetect"},{name:"right",type:"AutoDetect"}],outputs:[{name:"output",type:"BasedOnInput"}]},DivideBlock:{className:"DivideBlock",category:"Math",description:"Divides left by right (left / right).",target:"Neutral",inputs:[{name:"left",type:"AutoDetect"},{name:"right",type:"AutoDetect"}],outputs:[{name:"output",type:"BasedOnInput"}]},ScaleBlock:{className:"ScaleBlock",category:"Math",description:"Multiplies an input by a float factor.",target:"Neutral",inputs:[{name:"input",type:"AutoDetect"},{name:"factor",type:"Float"}],outputs:[{name:"output",type:"BasedOnInput"}]},ModBlock:{className:"ModBlock",category:"Math",description:"Computes the modulo (left % right).",target:"Neutral",inputs:[{name:"left",type:"AutoDetect"},{name:"right",type:"AutoDetect"}],outputs:[{name:"output",type:"BasedOnInput"}]},PowBlock:{className:"PowBlock",category:"Math",description:"Raises value to a power (value ^ power).",target:"Neutral",inputs:[{name:"value",type:"AutoDetect"},{name:"power",type:"AutoDetect"}],outputs:[{name:"output",type:"BasedOnInput"}]},MinBlock:{className:"MinBlock",category:"Math",description:"Returns the minimum of two values.",target:"Neutral",inputs:[{name:"left",type:"AutoDetect"},{name:"right",type:"AutoDetect"}],outputs:[{name:"output",type:"BasedOnInput"}]},MaxBlock:{className:"MaxBlock",category:"Math",description:"Returns the maximum of two values.",target:"Neutral",inputs:[{name:"left",type:"AutoDetect"},{name:"right",type:"AutoDetect"}],outputs:[{name:"output",type:"BasedOnInput"}]},ClampBlock:{className:"ClampBlock",category:"Math",description:"Clamps a value between minimum and maximum.",target:"Neutral",inputs:[{name:"value",type:"AutoDetect"}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{minimum:"number \u2014 lower bound (default 0)",maximum:"number \u2014 upper bound (default 1)"},defaultSerializedProperties:{minimum:0,maximum:1}},StepBlock:{className:"StepBlock",category:"Math",description:"Returns 0 if value < edge, else 1. step(edge, value).",target:"Neutral",inputs:[{name:"value",type:"AutoDetect"},{name:"edge",type:"AutoDetect"}],outputs:[{name:"output",type:"BasedOnInput"}]},SmoothStepBlock:{className:"SmoothStepBlock",category:"Math",description:"Hermite interpolation between 0 and 1 when value is between edge0 and edge1.",target:"Neutral",inputs:[{name:"value",type:"AutoDetect"},{name:"edge0",type:"AutoDetect"},{name:"edge1",type:"AutoDetect"}],outputs:[{name:"output",type:"BasedOnInput"}]},LerpBlock:{className:"LerpBlock",category:"Math",description:"Linear interpolation: mix(left, right, gradient).",target:"Neutral",inputs:[{name:"left",type:"AutoDetect"},{name:"right",type:"AutoDetect"},{name:"gradient",type:"AutoDetect"}],outputs:[{name:"output",type:"BasedOnInput"}]},NLerpBlock:{className:"NLerpBlock",category:"Math",description:"Normalized linear interpolation (normalizes the result of lerp).",target:"Neutral",inputs:[{name:"left",type:"AutoDetect"},{name:"right",type:"AutoDetect"},{name:"gradient",type:"AutoDetect"}],outputs:[{name:"output",type:"BasedOnInput"}]},NegateBlock:{className:"NegateBlock",category:"Math",description:"Negates a value (-input).",target:"Neutral",inputs:[{name:"value",type:"AutoDetect"}],outputs:[{name:"output",type:"BasedOnInput"}]},OneMinusBlock:{className:"OneMinusBlock",category:"Math",description:"Computes (1 - input).",target:"Neutral",inputs:[{name:"input",type:"AutoDetect"}],outputs:[{name:"output",type:"BasedOnInput"}]},ReciprocalBlock:{className:"ReciprocalBlock",category:"Math",description:"Computes 1/input.",target:"Neutral",inputs:[{name:"input",type:"AutoDetect"}],outputs:[{name:"output",type:"BasedOnInput"}]},ArcTan2Block:{className:"ArcTan2Block",category:"Math",description:"Computes atan2(x, y).",target:"Neutral",inputs:[{name:"x",type:"AutoDetect"},{name:"y",type:"AutoDetect"}],outputs:[{name:"output",type:"Float"}]},TrigonometryBlock:{className:"TrigonometryBlock",category:"Math",description:"Performs a trig/math operation on the input. Set the 'operation' property to: Cos, Sin, Abs, Exp, Exp2, Round, Floor, Ceiling, Sqrt, Log, Tan, ArcTan, ArcCos, ArcSin, Fract, Sign, Radians, Degrees, SawToothWave, TriangleWave, SquareWave.",target:"Neutral",inputs:[{name:"input",type:"AutoDetect"}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{operation:"TrigonometryBlockOperations \u2014 Cos, Sin, Abs, Exp, Exp2, Round, Floor, Ceiling, Sqrt, Log, Tan, ArcTan, ArcCos, ArcSin, Fract, Sign, Radians, Degrees"}},CrossBlock:{className:"CrossBlock",category:"Vector",description:"Cross product of two Vector3 inputs.",target:"Neutral",inputs:[{name:"left",type:"Vector3"},{name:"right",type:"Vector3"}],outputs:[{name:"output",type:"Vector3"}]},DotBlock:{className:"DotBlock",category:"Vector",description:"Dot product of two vectors.",target:"Neutral",inputs:[{name:"left",type:"AutoDetect"},{name:"right",type:"AutoDetect"}],outputs:[{name:"output",type:"Float"}]},NormalizeBlock:{className:"NormalizeBlock",category:"Vector",description:"Normalizes a vector.",target:"Neutral",inputs:[{name:"input",type:"AutoDetect"}],outputs:[{name:"output",type:"BasedOnInput"}]},LengthBlock:{className:"LengthBlock",category:"Vector",description:"Returns the length of a vector.",target:"Neutral",inputs:[{name:"value",type:"AutoDetect"}],outputs:[{name:"output",type:"Float"}]},DistanceBlock:{className:"DistanceBlock",category:"Vector",description:"Returns the distance between two vectors.",target:"Neutral",inputs:[{name:"left",type:"AutoDetect"},{name:"right",type:"AutoDetect"}],outputs:[{name:"output",type:"Float"}]},ReflectBlock:{className:"ReflectBlock",category:"Vector",description:"Reflects an incident vector off a surface with the given normal.",target:"Neutral",inputs:[{name:"incident",type:"AutoDetect"},{name:"normal",type:"AutoDetect"}],outputs:[{name:"output",type:"BasedOnInput"}]},RefractBlock:{className:"RefractBlock",category:"Vector",description:"Computes refraction of an incident vector.",target:"Neutral",inputs:[{name:"incident",type:"AutoDetect"},{name:"normal",type:"AutoDetect"},{name:"ior",type:"Float"}],outputs:[{name:"output",type:"BasedOnInput"}]},TransformBlock:{className:"TransformBlock",category:"Vector",description:"Transforms a vector by a matrix. Commonly used to apply World, View, Projection transforms.",target:"Neutral",inputs:[{name:"vector",type:"AutoDetect"},{name:"transform",type:"Matrix"}],outputs:[{name:"output",type:"Vector4"},{name:"xyz",type:"Vector3"},{name:"w",type:"Float"}],defaultSerializedProperties:{complementZ:0,complementW:1}},VectorMergerBlock:{className:"VectorMergerBlock",category:"Vector",description:"Merges individual float/vector components into a Vector2, Vector3, or Vector4.",target:"Neutral",defaultSerializedProperties:{xSwizzle:"x",ySwizzle:"y",zSwizzle:"z",wSwizzle:"w"},inputs:[{name:"xyzw ",type:"Vector4",isOptional:!0},{name:"xyz ",type:"Vector3",isOptional:!0},{name:"xy ",type:"Vector2",isOptional:!0},{name:"zw ",type:"Vector2",isOptional:!0},{name:"x",type:"Float",isOptional:!0},{name:"y",type:"Float",isOptional:!0},{name:"z",type:"Float",isOptional:!0},{name:"w",type:"Float",isOptional:!0}],outputs:[{name:"xyzw",type:"Vector4"},{name:"xyz",type:"Vector3"},{name:"xy",type:"Vector2"},{name:"zw",type:"Vector2"}]},VectorSplitterBlock:{className:"VectorSplitterBlock",category:"Vector",description:"Splits a vector into its individual components.",target:"Neutral",inputs:[{name:"xyzw",type:"Vector4",isOptional:!0},{name:"xyz ",type:"Vector3",isOptional:!0},{name:"xy ",type:"Vector2",isOptional:!0}],outputs:[{name:"xyz",type:"Vector3"},{name:"xy",type:"Vector2"},{name:"zw",type:"Vector2"},{name:"x",type:"Float"},{name:"y",type:"Float"},{name:"z",type:"Float"},{name:"w",type:"Float"}]},ColorMergerBlock:{className:"ColorMergerBlock",category:"Color",description:"Merges R, G, B, A float components into a Color3 or Color4.",target:"Neutral",inputs:[{name:"rgb ",type:"Color3",isOptional:!0},{name:"r",type:"Float",isOptional:!0},{name:"g",type:"Float",isOptional:!0},{name:"b",type:"Float",isOptional:!0},{name:"a",type:"Float",isOptional:!0}],outputs:[{name:"rgba",type:"Color4"},{name:"rgb",type:"Color3"}]},ColorSplitterBlock:{className:"ColorSplitterBlock",category:"Color",description:"Splits a Color3/Color4 into individual R, G, B, A float components.",target:"Neutral",inputs:[{name:"rgba",type:"Color4",isOptional:!0},{name:"rgb ",type:"Color3",isOptional:!0}],outputs:[{name:"rgb",type:"Color3"},{name:"r",type:"Float"},{name:"g",type:"Float"},{name:"b",type:"Float"},{name:"a",type:"Float"}]},ColorConverterBlock:{className:"ColorConverterBlock",category:"Color",description:"Converts between RGB and HSL color spaces.",target:"Neutral",inputs:[{name:"rgb ",type:"Color3",isOptional:!0},{name:"hsl ",type:"Color3",isOptional:!0}],outputs:[{name:"rgb",type:"Color3"},{name:"hsl",type:"Color3"}]},DesaturateBlock:{className:"DesaturateBlock",category:"Color",description:"Desaturates a color by a given amount.",target:"Neutral",inputs:[{name:"color",type:"Color3"},{name:"level",type:"Float"}],outputs:[{name:"output",type:"Color3"}]},PosterizeBlock:{className:"PosterizeBlock",category:"Color",description:"Reduces the number of color levels (posterize effect).",target:"Neutral",inputs:[{name:"value",type:"AutoDetect"},{name:"steps",type:"AutoDetect"}],outputs:[{name:"output",type:"BasedOnInput"}]},ReplaceColorBlock:{className:"ReplaceColorBlock",category:"Color",description:"Replaces a color in a texture with another color within a distance range.",target:"Neutral",inputs:[{name:"value",type:"AutoDetect"},{name:"reference",type:"AutoDetect"},{name:"distance",type:"Float"},{name:"replacement",type:"AutoDetect"}],outputs:[{name:"output",type:"BasedOnInput"}]},GradientBlock:{className:"GradientBlock",category:"Color",description:"Returns a color from a gradient based on a float input (0-1).",target:"Neutral",inputs:[{name:"gradient",type:"AutoDetect"}],outputs:[{name:"output",type:"Color3"}],properties:{colorSteps:"Array of {color: Color3, step: number} \u2014 define the gradient stops"}},RemapBlock:{className:"RemapBlock",category:"Interpolation",description:"Remaps a value from one range to another.",target:"Neutral",inputs:[{name:"input",type:"AutoDetect"},{name:"sourceMin",type:"Float",isOptional:!0},{name:"sourceMax",type:"Float",isOptional:!0},{name:"targetMin",type:"Float",isOptional:!0},{name:"targetMax",type:"Float",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],defaultSerializedProperties:{sourceRange:[-1,1],targetRange:[0,1]},properties:{sourceRange:"number[] \u2014 [min, max] of source range (default [-1,1])",targetRange:"number[] \u2014 [min, max] of target range (default [0,1])"}},FresnelBlock:{className:"FresnelBlock",category:"Interpolation",description:"Computes a Fresnel term based on view direction and normal.",target:"Neutral",inputs:[{name:"worldNormal",type:"Vector4"},{name:"viewDirection",type:"Vector3"},{name:"bias",type:"Float"},{name:"power",type:"Float"}],outputs:[{name:"fresnel",type:"Float"}]},ConditionalBlock:{className:"ConditionalBlock",category:"Logic",description:"If/else conditional: outputs ifTrue or ifFalse based on comparing a and b.",target:"Neutral",inputs:[{name:"a",type:"Float"},{name:"b",type:"Float"},{name:"ifTrue",type:"AutoDetect"},{name:"ifFalse",type:"AutoDetect"}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{condition:"ConditionalBlockConditions \u2014 Equal, NotEqual, LessThan, GreaterThan, LessOrEqual, GreaterOrEqual, Xor, Or, And"}},RandomNumberBlock:{className:"RandomNumberBlock",category:"Noise",description:"Generates a random number based on a seed.",target:"Neutral",inputs:[{name:"seed",type:"AutoDetect"}],outputs:[{name:"output",type:"Float"}]},SimplexPerlin3DBlock:{className:"SimplexPerlin3DBlock",category:"Noise",description:"3D Simplex Perlin noise.",target:"Neutral",inputs:[{name:"seed",type:"Vector3"}],outputs:[{name:"output",type:"Float"}]},WorleyNoise3DBlock:{className:"WorleyNoise3DBlock",category:"Noise",description:"3D Worley (cellular) noise.",target:"Neutral",inputs:[{name:"seed",type:"Vector3"},{name:"jitter",type:"Float"}],outputs:[{name:"output",type:"Vector2"},{name:"x",type:"Float"},{name:"y",type:"Float"}]},VoronoiNoiseBlock:{className:"VoronoiNoiseBlock",category:"Noise",description:"Voronoi noise pattern.",target:"Neutral",inputs:[{name:"seed",type:"Vector2"},{name:"offset",type:"Float"},{name:"density",type:"Float"}],outputs:[{name:"output",type:"Float"},{name:"cells",type:"Float"}]},CloudBlock:{className:"CloudBlock",category:"Noise",description:"Generates cloud-like noise pattern.",target:"Neutral",inputs:[{name:"seed",type:"AutoDetect"},{name:"chaos",type:"AutoDetect",isOptional:!0},{name:"offsetX",type:"Float",isOptional:!0},{name:"offsetY",type:"Float",isOptional:!0},{name:"offsetZ",type:"Float",isOptional:!0}],outputs:[{name:"output",type:"Float"}],properties:{octaves:"number \u2014 number of octaves (default 6)"}},WaveBlock:{className:"WaveBlock",category:"Noise",description:"Generates a wave pattern. Set 'kind' to SawTooth, Square, or Triangle.",target:"Neutral",inputs:[{name:"input",type:"AutoDetect"}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{kind:"WaveBlockKind \u2014 SawTooth, Square, Triangle"}},Rotate2dBlock:{className:"Rotate2dBlock",category:"UV",description:"Rotates a 2D vector around a center point by an angle.",target:"Neutral",inputs:[{name:"input",type:"Vector2"},{name:"angle",type:"Float"}],outputs:[{name:"output",type:"Vector2"}]},PannerBlock:{className:"PannerBlock",category:"UV",description:"Pans (scrolls) a 2D input over time.",target:"Neutral",inputs:[{name:"uv",type:"AutoDetect"},{name:"time",type:"Float"},{name:"speed",type:"Vector2"}],outputs:[{name:"output",type:"Vector2"}]},NormalBlendBlock:{className:"NormalBlendBlock",category:"Misc",description:"Blends two normal maps together.",target:"Neutral",inputs:[{name:"normalMap0",type:"AutoDetect"},{name:"normalMap1",type:"AutoDetect"}],outputs:[{name:"output",type:"BasedOnInput"}]},ViewDirectionBlock:{className:"ViewDirectionBlock",category:"Misc",description:"Computes the view direction from a world position to the camera.",target:"Neutral",inputs:[{name:"worldPosition",type:"Vector4"},{name:"cameraPosition",type:"Vector3"}],outputs:[{name:"output",type:"Vector3"}]},CurveBlock:{className:"CurveBlock",category:"Misc",description:"Applies an easing curve. Set 'type' property to the curve type.",target:"Neutral",inputs:[{name:"input",type:"AutoDetect"}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{type:"CurveBlockTypes \u2014 EaseInSine, EaseOutSine, EaseInOutSine, EaseInQuad, EaseOutQuad, EaseInOutQuad, etc."}},MatrixBuilderBlock:{className:"MatrixBuilder",category:"Matrix",description:"Builds a matrix from individual row vectors.",target:"Neutral",inputs:[{name:"row0",type:"Vector4"},{name:"row1",type:"Vector4"},{name:"row2",type:"Vector4"},{name:"row3",type:"Vector4"}],outputs:[{name:"output",type:"Matrix"}]},MatrixDeterminantBlock:{className:"MatrixDeterminantBlock",category:"Matrix",description:"Computes the determinant of a matrix.",target:"Neutral",inputs:[{name:"input",type:"Matrix"}],outputs:[{name:"output",type:"Float"}]},MatrixTransposeBlock:{className:"MatrixTransposeBlock",category:"Matrix",description:"Transposes a matrix.",target:"Neutral",inputs:[{name:"input",type:"Matrix"}],outputs:[{name:"output",type:"Matrix"}]},VertexOutputBlock:{className:"VertexOutputBlock",category:"Output",description:"The vertex shader output. Connect the final transformed position here. Every material needs exactly one.",target:"Vertex",inputs:[{name:"vector",type:"Vector4"}],outputs:[]},BonesBlock:{className:"BonesBlock",category:"Vertex",description:"Adds skeleton bone transformation support to the vertex shader.",target:"Vertex",inputs:[{name:"matricesIndices",type:"Vector4"},{name:"matricesWeights",type:"Vector4"},{name:"matricesIndicesExtra",type:"Vector4",isOptional:!0},{name:"matricesWeightsExtra",type:"Vector4",isOptional:!0},{name:"world",type:"Matrix"}],outputs:[{name:"output",type:"Matrix"}]},InstancesBlock:{className:"InstancesBlock",category:"Vertex",description:"Adds instancing support.",target:"Vertex",inputs:[{name:"world0",type:"Vector4"},{name:"world1",type:"Vector4"},{name:"world2",type:"Vector4"},{name:"world3",type:"Vector4"},{name:"world",type:"Matrix"}],outputs:[{name:"output",type:"Matrix"},{name:"instanceID",type:"Float"}]},MorphTargetsBlock:{className:"MorphTargetsBlock",category:"Vertex",description:"Adds morph target animation support.",target:"Vertex",inputs:[{name:"position",type:"Vector3"},{name:"normal",type:"Vector3"},{name:"tangent",type:"Vector4",isOptional:!0},{name:"uv",type:"Vector2",isOptional:!0}],outputs:[{name:"positionOutput",type:"Vector3"},{name:"normalOutput",type:"Vector3"},{name:"tangentOutput",type:"Vector4"},{name:"uvOutput",type:"Vector2"}]},LightInformationBlock:{className:"LightInformationBlock",category:"Vertex",description:"Provides light information (direction, color, intensity) for a specific light in the scene.",target:"Vertex",inputs:[{name:"worldPosition",type:"Vector4"}],outputs:[{name:"direction",type:"Vector3"},{name:"color",type:"Color3"},{name:"intensity",type:"Float"},{name:"shadowAttenuation",type:"Float"}]},FragmentOutputBlock:{className:"FragmentOutputBlock",category:"Output",description:"The fragment shader output. Connect the final color here. Every material needs exactly one. Has 'rgb' (Color3), 'rgba' (Color4), and 'a' (Float/alpha) inputs.",target:"Fragment",inputs:[{name:"rgba",type:"Color4",isOptional:!0},{name:"rgb",type:"Color3",isOptional:!0},{name:"a",type:"Float",isOptional:!0}],outputs:[]},DiscardBlock:{className:"DiscardBlock",category:"Fragment",description:"Discards the current fragment if the value is below the cutoff.",target:"Fragment",inputs:[{name:"value",type:"Float"},{name:"cutoff",type:"Float"}],outputs:[]},ImageProcessingBlock:{className:"ImageProcessingBlock",category:"Fragment",description:"Applies image processing (tone mapping, contrast, exposure, etc.) to a color.",target:"Fragment",inputs:[{name:"color",type:"Color4"}],outputs:[{name:"output",type:"Color4"},{name:"rgb",type:"Color3"}]},PerturbNormalBlock:{className:"PerturbNormalBlock",category:"Fragment",description:"Perturbs the world normal using a normal map texture.",target:"Fragment",inputs:[{name:"worldPosition",type:"Vector4"},{name:"worldNormal",type:"Vector4"},{name:"worldTangent",type:"Vector4",isOptional:!0},{name:"uv",type:"Vector2"},{name:"normalMapColor",type:"Color3"},{name:"strength",type:"Float"},{name:"viewDirection",type:"Vector3"},{name:"TBN",type:"Object",isOptional:!0}],outputs:[{name:"output",type:"Vector4"},{name:"uvOffset",type:"Vector2"}]},FrontFacingBlock:{className:"FrontFacingBlock",category:"Fragment",description:"Returns 1.0 if the fragment is front-facing, 0.0 otherwise.",target:"Fragment",inputs:[],outputs:[{name:"output",type:"Float"}]},DerivativeBlock:{className:"DerivativeBlock",category:"Fragment",description:"Computes screen-space derivatives (dFdx, dFdy) of an input.",target:"Fragment",inputs:[{name:"input",type:"AutoDetect"}],outputs:[{name:"dx",type:"BasedOnInput"},{name:"dy",type:"BasedOnInput"}]},ScreenSpaceBlock:{className:"ScreenSpaceBlock",category:"Fragment",description:"Provides the screen-space position of the current fragment.",target:"Fragment",inputs:[{name:"vector",type:"Vector3"},{name:"worldViewProjection",type:"Matrix"}],outputs:[{name:"output",type:"Vector2"},{name:"x",type:"Float"},{name:"y",type:"Float"}]},ScreenSizeBlock:{className:"ScreenSizeBlock",category:"Fragment",description:"Provides the screen size in pixels.",target:"Fragment",inputs:[],outputs:[{name:"xy",type:"Vector2"},{name:"x",type:"Float"},{name:"y",type:"Float"}]},TwirlBlock:{className:"TwirlBlock",category:"Fragment",description:"Applies a twirl effect to UV coordinates.",target:"Fragment",inputs:[{name:"input",type:"Vector2"},{name:"strength",type:"Float"},{name:"center",type:"Vector2"},{name:"offset",type:"Vector2"}],outputs:[{name:"output",type:"Vector2"}]},FragCoordBlock:{className:"FragCoordBlock",category:"Fragment",description:"Provides the gl_FragCoord value.",target:"Fragment",inputs:[],outputs:[{name:"xy",type:"Vector2"},{name:"xyz",type:"Vector3"},{name:"xyzw",type:"Vector4"},{name:"x",type:"Float"},{name:"y",type:"Float"},{name:"z",type:"Float"},{name:"w",type:"Float"}]},ShadowMapBlock:{className:"ShadowMapBlock",category:"Fragment",description:"Generates a shadow map output.",target:"Fragment",inputs:[{name:"worldPosition",type:"Vector4"}],outputs:[{name:"output",type:"Object"},{name:"depth",type:"Float"}]},TextureBlock:{className:"TextureBlock",category:"Texture",description:"Samples a 2D texture. Provide a URL via the texture property.",target:"VertexAndFragment",inputs:[{name:"uv",type:"AutoDetect"}],outputs:[{name:"rgba",type:"Color4"},{name:"rgb",type:"Color3"},{name:"r",type:"Float"},{name:"g",type:"Float"},{name:"b",type:"Float"},{name:"a",type:"Float"},{name:"level",type:"Float"}],properties:{texture:"Texture \u2014 set via new Texture(url, scene)",convertToGammaSpace:"boolean",convertToLinearSpace:"boolean"}},ReflectionTextureBlock:{className:"ReflectionTextureBlock",category:"Texture",description:"Samples a reflection/environment texture (cubemap, equirectangular, etc.).",target:"VertexAndFragment",inputs:[{name:"position",type:"AutoDetect"},{name:"worldPosition",type:"Vector4"},{name:"worldNormal",type:"Vector4"},{name:"world",type:"Matrix"},{name:"cameraPosition",type:"Vector3"},{name:"view",type:"Matrix"}],outputs:[{name:"rgb",type:"Color3"},{name:"r",type:"Float"},{name:"g",type:"Float"},{name:"b",type:"Float"},{name:"hasTexture",type:"Float"}]},LightBlock:{className:"LightBlock",category:"Lighting",description:"Computes lighting (diffuse and specular) for a given world position and normal. Uses scene lights.",target:"VertexAndFragment",inputs:[{name:"worldPosition",type:"Vector4"},{name:"worldNormal",type:"AutoDetect"},{name:"cameraPosition",type:"Vector3"},{name:"glossiness",type:"Float",isOptional:!0},{name:"glossPower",type:"Float",isOptional:!0},{name:"diffuseColor",type:"Color3",isOptional:!0},{name:"specularColor",type:"Color3",isOptional:!0},{name:"view",type:"Matrix"}],outputs:[{name:"diffuseOutput",type:"Color3"},{name:"specularOutput",type:"Color3"},{name:"shadow",type:"Float"}]},FogBlock:{className:"FogBlock",category:"Misc",description:"Adds fog to the material output.",target:"VertexAndFragment",inputs:[{name:"worldPosition",type:"Vector4"},{name:"view",type:"Matrix"},{name:"input",type:"AutoDetect"},{name:"fogColor",type:"Color3"}],outputs:[{name:"output",type:"Color3"}]},CurrentScreenBlock:{className:"CurrentScreenBlock",category:"Texture",description:"Samples the current screen (for post-process / refraction effects).",target:"VertexAndFragment",inputs:[{name:"uv",type:"AutoDetect"}],outputs:[{name:"rgba",type:"Color4"},{name:"rgb",type:"Color3"},{name:"r",type:"Float"},{name:"g",type:"Float"},{name:"b",type:"Float"},{name:"a",type:"Float"}]},ImageSourceBlock:{className:"ImageSourceBlock",category:"Texture",description:"Provides a texture source that can be shared by multiple texture blocks.",target:"VertexAndFragment",inputs:[],outputs:[{name:"source",type:"Object"}],properties:{texture:"Texture \u2014 set via new Texture(url, scene)"}},SceneDepthBlock:{className:"SceneDepthBlock",category:"Texture",description:"Samples the scene depth texture.",target:"VertexAndFragment",inputs:[{name:"uv",type:"AutoDetect"}],outputs:[{name:"output",type:"Float"}]},PBRMetallicRoughnessBlock:{className:"PBRMetallicRoughnessBlock",category:"PBR",description:"Full PBR (Metallic-Roughness) lighting model. This is a powerful all-in-one block for physically-based rendering. Connect world position, normal, camera position, and material properties.",target:"VertexAndFragment",defaultSerializedProperties:{lightFalloff:0,useAlphaTest:!1,alphaTestCutoff:.5,useAlphaBlending:!1,useRadianceOverAlpha:!0,useSpecularOverAlpha:!0,enableSpecularAntiAliasing:!1,realTimeFiltering:!1,realTimeFilteringQuality:8,useEnergyConservation:!0,useRadianceOcclusion:!0,useHorizonOcclusion:!0,unlit:!1,forceNormalForward:!1,debugMode:0,debugLimit:-1,debugFactor:1,generateOnlyFragmentCode:!1,directIntensity:1,environmentIntensity:1,specularIntensity:1},inputs:[{name:"worldPosition",type:"Vector4"},{name:"worldNormal",type:"Vector4"},{name:"view",type:"Matrix"},{name:"cameraPosition",type:"Vector3"},{name:"perturbedNormal",type:"Vector4",isOptional:!0},{name:"baseColor",type:"Color3",isOptional:!0},{name:"metallic",type:"Float",isOptional:!0},{name:"roughness",type:"Float",isOptional:!0},{name:"ambientOcc",type:"Float",isOptional:!0},{name:"opacity",type:"Float",isOptional:!0},{name:"indexOfRefraction",type:"Float",isOptional:!0},{name:"ambientColor",type:"Color3",isOptional:!0},{name:"reflection",type:"Object",isOptional:!0},{name:"clearcoat",type:"Object",isOptional:!0},{name:"sheen",type:"Object",isOptional:!0},{name:"subsurface",type:"Object",isOptional:!0},{name:"anisotropy",type:"Object",isOptional:!0},{name:"iridescence",type:"Object",isOptional:!0}],outputs:[{name:"ambientClr",type:"Color3"},{name:"diffuseDir",type:"Color3"},{name:"specularDir",type:"Color3"},{name:"clearcoatDir",type:"Color3"},{name:"sheenDir",type:"Color3"},{name:"diffuseInd",type:"Color3"},{name:"specularInd",type:"Color3"},{name:"clearcoatInd",type:"Color3"},{name:"sheenInd",type:"Color3"},{name:"refraction",type:"Color3"},{name:"lighting",type:"Color3"},{name:"shadow",type:"Float"},{name:"alpha",type:"Float"}]},ReflectionBlock:{className:"ReflectionBlock",category:"PBR",description:"PBR reflection block \u2014 connects to PBRMetallicRoughnessBlock's reflection input.",target:"VertexAndFragment",inputs:[{name:"position",type:"AutoDetect"},{name:"world",type:"Matrix"},{name:"color",type:"Color3",isOptional:!0}],outputs:[{name:"reflection",type:"Object"}]},RefractionBlock:{className:"RefractionBlock",category:"PBR",description:"PBR refraction block \u2014 connects to PBRMetallicRoughnessBlock's subsurface.",target:"VertexAndFragment",inputs:[{name:"intensity",type:"Float",isOptional:!0},{name:"tintAtDistance",type:"Float",isOptional:!0}],outputs:[{name:"refraction",type:"Object"}]},SheenBlock:{className:"SheenBlock",category:"PBR",description:"PBR sheen block for fabric-like materials.",target:"Fragment",inputs:[{name:"intensity",type:"Float"},{name:"color",type:"Color3"},{name:"roughness",type:"Float",isOptional:!0}],outputs:[{name:"sheen",type:"Object"}]},AnisotropyBlock:{className:"AnisotropyBlock",category:"PBR",description:"PBR anisotropy block for directional reflections.",target:"Fragment",inputs:[{name:"intensity",type:"Float",isOptional:!0},{name:"direction",type:"Vector2",isOptional:!0},{name:"uv",type:"Vector2",isOptional:!0},{name:"worldTangent",type:"Vector4",isOptional:!0}],outputs:[{name:"anisotropy",type:"Object"}]},ClearCoatBlock:{className:"ClearCoatBlock",category:"PBR",description:"PBR clear coat block for an additional transparent layer (like car paint).",target:"Fragment",inputs:[{name:"intensity",type:"Float",isOptional:!0},{name:"roughness",type:"Float",isOptional:!0},{name:"indexOfRefraction",type:"Float",isOptional:!0},{name:"normalMapColor",type:"Color3",isOptional:!0},{name:"uv",type:"Vector2",isOptional:!0},{name:"tintColor",type:"Color3",isOptional:!0},{name:"tintAtDistance",type:"Float",isOptional:!0},{name:"tintThickness",type:"Float",isOptional:!0},{name:"worldTangent",type:"Vector4",isOptional:!0},{name:"TBN",type:"Object",isOptional:!0}],outputs:[{name:"clearcoat",type:"Object"}]},SubSurfaceBlock:{className:"SubSurfaceBlock",category:"PBR",description:"PBR sub-surface scattering for translucent materials (skin, wax, etc.).",target:"Fragment",inputs:[{name:"thickness",type:"Float",isOptional:!0},{name:"tintColor",type:"Color3",isOptional:!0},{name:"translucencyIntensity",type:"Float",isOptional:!0},{name:"translucencyDiffusionDist",type:"Color3",isOptional:!0},{name:"refraction",type:"Object",isOptional:!0}],outputs:[{name:"subsurface",type:"Object"}]},IridescenceBlock:{className:"IridescenceBlock",category:"PBR",description:"PBR iridescence for rainbow-like thin-film effects.",target:"Fragment",inputs:[{name:"intensity",type:"Float",isOptional:!0},{name:"indexOfRefraction",type:"Float",isOptional:!0},{name:"thickness",type:"Float",isOptional:!0}],outputs:[{name:"iridescence",type:"Object"}]},TeleportInBlock:{className:"NodeMaterialTeleportInBlock",category:"Teleport",description:"Teleport input \u2014 sends a value to a paired TeleportOutBlock without a visible connection line.",target:"Neutral",inputs:[{name:"input",type:"AutoDetect"}],outputs:[]},TeleportOutBlock:{className:"NodeMaterialTeleportOutBlock",category:"Teleport",description:"Teleport output \u2014 receives a value from a paired TeleportInBlock.",target:"Neutral",inputs:[],outputs:[{name:"output",type:"AutoDetect"}]},TriPlanarBlock:{className:"TriPlanarBlock",category:"Texture",description:"Tri-planar texture mapping \u2014 projects a texture from 3 axes to avoid UV stretching.",target:"Neutral",inputs:[{name:"position",type:"AutoDetect"},{name:"normal",type:"AutoDetect"},{name:"sharpness",type:"Float",isOptional:!0},{name:"source",type:"Object",isOptional:!0},{name:"sourceY",type:"Object",isOptional:!0}],outputs:[{name:"rgba",type:"Color4"},{name:"rgb",type:"Color3"},{name:"r",type:"Float"},{name:"g",type:"Float"},{name:"b",type:"Float"},{name:"a",type:"Float"},{name:"level",type:"Float"}]},BiPlanarBlock:{className:"BiPlanarBlock",category:"Texture",description:"Bi-planar texture mapping \u2014 projects a texture from 2 dominant axes.",target:"Neutral",inputs:[{name:"position",type:"AutoDetect"},{name:"normal",type:"AutoDetect"},{name:"sharpness",type:"Float",isOptional:!0},{name:"source",type:"Object",isOptional:!0},{name:"sourceY",type:"Object",isOptional:!0}],outputs:[{name:"rgba",type:"Color4"},{name:"rgb",type:"Color3"},{name:"r",type:"Float"},{name:"g",type:"Float"},{name:"b",type:"Float"},{name:"a",type:"Float"},{name:"level",type:"Float"}]},MeshAttributeExistsBlock:{className:"MeshAttributeExistsBlock",category:"Misc",description:"Outputs ifYes or ifNo based on whether a mesh attribute (UV, color, etc.) exists.",target:"Neutral",inputs:[{name:"ifYes",type:"AutoDetect"},{name:"ifNo",type:"AutoDetect"}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{attributeType:"MeshAttributeExistsBlockTypes \u2014 None, Normal, Tangent, VertexColor, UV1, UV2, UV3, UV4, UV5, UV6"}},ParticleTextureBlock:{className:"ParticleTextureBlock",category:"Particle",description:"Samples a particle texture.",target:"VertexAndFragment",inputs:[{name:"uv",type:"AutoDetect"}],outputs:[{name:"rgba",type:"Color4"},{name:"rgb",type:"Color3"},{name:"r",type:"Float"},{name:"g",type:"Float"},{name:"b",type:"Float"},{name:"a",type:"Float"}]},ParticleRampGradientBlock:{className:"ParticleRampGradientBlock",category:"Particle",description:"Applies a ramp gradient to particle color.",target:"Fragment",inputs:[{name:"color",type:"Color4"}],outputs:[{name:"rampColor",type:"Color4"}]},ParticleBlendMultiplyBlock:{className:"ParticleBlendMultiplyBlock",category:"Particle",description:"Applies blend-multiply to particle color.",target:"Fragment",inputs:[{name:"color",type:"Color4"},{name:"alphaTexture",type:"Float"},{name:"alphaColor",type:"Float"}],outputs:[{name:"blendColor",type:"Color4"}]},TBNBlock:{className:"TBNBlock",category:"Fragment",description:"Computes the Tangent-Bitangent-Normal (TBN) matrix for tangent-space normal mapping. Connect to PerturbNormalBlock or ClearCoatBlock TBN input.",target:"Fragment",inputs:[{name:"normal",type:"AutoDetect"},{name:"tangent",type:"Vector4"},{name:"world",type:"Matrix"}],outputs:[{name:"TBN",type:"Object"},{name:"row0",type:"Vector3"},{name:"row1",type:"Vector3"},{name:"row2",type:"Vector3"}]},HeightToNormalBlock:{className:"HeightToNormalBlock",category:"Fragment",description:"Converts a height field (Float) to a normal vector using screen-space derivatives. Output is in tangent space by default (xyz with 0.5 offset) or world space.",target:"Fragment",inputs:[{name:"input",type:"Float"},{name:"worldPosition",type:"Vector3"},{name:"worldNormal",type:"Vector3"},{name:"worldTangent",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"Vector4"},{name:"xyz",type:"Vector3"}],properties:{generateInWorldSpace:"boolean \u2014 false=tangent space (default), true=world space",automaticNormalizationNormal:"boolean \u2014 auto-normalize normal input (default true)",automaticNormalizationTangent:"boolean \u2014 auto-normalize tangent input (default true)"},defaultSerializedProperties:{generateInWorldSpace:!1,automaticNormalizationNormal:!0,automaticNormalizationTangent:!0}},MatrixSplitterBlock:{className:"MatrixSplitterBlock",category:"Matrix",description:"Splits a 4\xD74 matrix into its individual row and column vectors.",target:"Neutral",inputs:[{name:"input",type:"Matrix"}],outputs:[{name:"row0",type:"Vector4"},{name:"row1",type:"Vector4"},{name:"row2",type:"Vector4"},{name:"row3",type:"Vector4"},{name:"col0",type:"Vector4"},{name:"col1",type:"Vector4"},{name:"col2",type:"Vector4"},{name:"col3",type:"Vector4"}]},FragDepthBlock:{className:"FragDepthBlock",category:"Fragment",description:"Writes to gl_FragDepth. Provide either a direct depth float, or worldPos + viewProjection to compute depth automatically.",target:"Fragment",inputs:[{name:"depth",type:"Float",isOptional:!0},{name:"worldPos",type:"Vector4",isOptional:!0},{name:"viewProjection",type:"Matrix",isOptional:!0}],outputs:[]},AmbientOcclusionBlock:{className:"AmbientOcclusionBlock",category:"Fragment",description:"Evaluates screen-space ambient occlusion (SSAO) from a depth texture.",target:"Fragment",inputs:[{name:"source",type:"Object"},{name:"screenSize",type:"Vector2"}],outputs:[{name:"occlusion",type:"Float"}],properties:{radius:"number \u2014 SSAO radius (default 0.0001)",area:"number \u2014 SSAO area (default 0.0075)",fallOff:"number \u2014 SSAO falloff (default 0.000001)"},defaultSerializedProperties:{radius:1e-4,area:.0075,fallOff:1e-6}},ClipPlanesBlock:{className:"ClipPlanesBlock",category:"Misc",description:"Implements clip planes for the material. Connect worldPosition to enable clipping.",target:"VertexAndFragment",inputs:[{name:"worldPosition",type:"Vector4"}],outputs:[]},LoopBlock:{className:"LoopBlock",category:"Logic",description:"Wraps code in a for loop. The input value is passed through and the output is the result after all iterations. Use StorageReadBlock/StorageWriteBlock to read/write loop variables.",target:"Neutral",inputs:[{name:"input",type:"AutoDetect"},{name:"iterations",type:"Float",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"},{name:"index",type:"Float"},{name:"loopID",type:"Object"}],properties:{iterations:"number \u2014 number of loop iterations (default 4)"},defaultSerializedProperties:{iterations:4}},StorageReadBlock:{className:"StorageReadBlock",category:"Logic",description:"Reads the current iteration value from a LoopBlock. Connect the loopID output to this block.",target:"Neutral",inputs:[{name:"loopID",type:"Object"}],outputs:[{name:"value",type:"AutoDetect"}]},StorageWriteBlock:{className:"StorageWriteBlock",category:"Logic",description:"Writes a value into the loop variable inside a LoopBlock iteration.",target:"Neutral",inputs:[{name:"loopID",type:"Object"},{name:"value",type:"AutoDetect"}],outputs:[]},PrePassOutputBlock:{className:"PrePassOutputBlock",category:"Output",description:"Writes to multiple prepass render targets (depth, position, normal, reflectivity, velocity).",target:"Fragment",inputs:[{name:"viewDepth",type:"Float",isOptional:!0},{name:"screenDepth",type:"Float",isOptional:!0},{name:"worldPosition",type:"AutoDetect",isOptional:!0},{name:"localPosition",type:"AutoDetect",isOptional:!0},{name:"viewNormal",type:"AutoDetect",isOptional:!0},{name:"worldNormal",type:"AutoDetect",isOptional:!0},{name:"reflectivity",type:"AutoDetect",isOptional:!0},{name:"velocity",type:"AutoDetect",isOptional:!0},{name:"velocityLinear",type:"AutoDetect",isOptional:!0}],outputs:[]},PrePassTextureBlock:{className:"PrePassTextureBlock",category:"Input",description:"Reads from prepass render target textures (position, depth, normal, etc.).",target:"VertexAndFragment",inputs:[],outputs:[{name:"position",type:"Object"},{name:"localPosition",type:"Object"},{name:"depth",type:"Object"},{name:"screenDepth",type:"Object"},{name:"normal",type:"Object"},{name:"worldNormal",type:"Object"}]},DepthSourceBlock:{className:"DepthSourceBlock",category:"Input",description:"Provides a depth texture from the scene's depth renderer as an image source.",target:"VertexAndFragment",inputs:[],outputs:[{name:"source",type:"Object"}]},GaussianSplattingBlock:{className:"GaussianSplattingBlock",category:"GaussianSplatting",description:"Vertex computation for Gaussian Splatting rendering with spherical harmonics support.",target:"Vertex",inputs:[{name:"splatPosition",type:"Vector3"},{name:"splatScale",type:"Vector2",isOptional:!0},{name:"world",type:"Matrix"},{name:"view",type:"Matrix"},{name:"projection",type:"Matrix"}],outputs:[{name:"splatVertex",type:"Vector4"},{name:"SH",type:"Color3"}]},GaussianBlock:{className:"GaussianBlock",category:"GaussianSplatting",description:"Fragment part of Gaussian Splatting that processes splatted color values.",target:"Fragment",inputs:[{name:"splatColor",type:"Color4"}],outputs:[{name:"rgba",type:"Color4"},{name:"rgb",type:"Color3"},{name:"alpha",type:"Float"}]},SplatReaderBlock:{className:"SplatReaderBlock",category:"GaussianSplatting",description:"Reads splat data (position and color) from textures for Gaussian Splatting.",target:"Vertex",inputs:[{name:"splatIndex",type:"Float"}],outputs:[{name:"splatPosition",type:"Vector3"},{name:"splatColor",type:"Color4"}]},SmartFilterFragmentOutputBlock:{className:"SmartFilterFragmentOutputBlock",category:"Output",description:"Fragment output for the Smart Filter Editor (SFE) framework. Outputs as nmeMain() function.",target:"Fragment",inputs:[{name:"rgba",type:"Color4"}],outputs:[]},SmartFilterTextureBlock:{className:"SmartFilterTextureBlock",category:"Texture",description:"Texture block for the SFE framework. Supports compositing with optional ImageSourceBlock.",target:"VertexAndFragment",inputs:[{name:"uv",type:"Vector2"},{name:"source",type:"Object",isOptional:!0}],outputs:[{name:"rgba",type:"Color4"},{name:"rgb",type:"Color3"},{name:"r",type:"Float"},{name:"g",type:"Float"},{name:"b",type:"Float"},{name:"a",type:"Float"}],properties:{isMainInput:"boolean \u2014 whether this is the main SFE input (default false)"},defaultSerializedProperties:{isMainInput:!1}},ElbowBlock:{className:"ElbowBlock",category:"Utility",description:"Pass-through block that preserves input type. Used for visual routing in the NME editor.",target:"Neutral",inputs:[{name:"input",type:"AutoDetect"}],outputs:[{name:"output",type:"BasedOnInput"}]},NodeMaterialDebugBlock:{className:"NodeMaterialDebugBlock",category:"Debug",description:"Renders intermediate shader values for debugging. Only one should be active per material.",target:"Fragment",inputs:[{name:"debug",type:"AutoDetect"}],outputs:[],properties:{renderAlpha:"boolean \u2014 whether to render alpha channel (default false)",isActive:"boolean \u2014 whether this debug output is active (default false)"},defaultSerializedProperties:{isActive:!1,renderAlpha:!1}},CustomBlock:{className:"CustomBlock",category:"Custom",description:"User-defined block with arbitrary shader code and dynamic inputs/outputs. Configure via the 'options' property with code, functionName, target, inParameters, outParameters.",target:"Neutral",inputs:[],outputs:[],properties:{options:"Object \u2014 { code: string[], functionName: string, target: string, inParameters: Array<{name, type}>, outParameters: Array<{name, type}>, inLinkedConnectionTypes: Array }"}}};function Nv(){const e=new Map;for(const[r,o]of Object.entries(Pn)){const n=o.category;e.has(n)||e.set(n,[]),e.get(n).push(`${r}: ${o.description.split(".")[0]}`)}const t=[];for(const[r,o]of e){t.push(`
|
|
80
|
+
## ${r}`);for(const n of o)t.push(` - ${n}`)}return t.join(`
|
|
81
|
+
`)}function kT(e){return Pn[e]}const xr={};for(const e of Object.values(Pn))xr[e.className]=e;function vi(e){return e==null?!1:typeof e=="string"?e.length>0:!0}function ST(e){const t=e.isPresent??vi;if(!e.candidates.some(r=>t(r.value)))throw new Error(e.missingMessage??`Error: ${wT(e.candidates.map(r=>r.label))} must be provided.`)}function wT(e){return e.length===1?e[0]:e.length===2?`Either ${e[0]} or ${e[1]}`:`Either ${e.slice(0,-1).join(", ")}, or ${e[e.length-1]}`}function IT(e){const t=e.inlineLabel??"json",r=e.fileLabel??"jsonFile",o=e.fileDescription??"file";if(vi(e.inlineText)&&vi(e.filePath))throw new Error(`Provide either ${t} or ${r}, not both.`);if(vi(e.inlineText))return{text:e.inlineText,source:"inline"};ST({candidates:[{label:t,value:e.inlineText},{label:r,value:e.filePath}],missingMessage:`Either ${t} or ${r} must be provided.`});try{return{text:Kv(e.filePath,"utf-8"),source:"file"}}catch(n){throw new Error(`Error reading ${o}: ${n.message}`,{cause:n})}}function OT(e,t){pu(hu(e),{recursive:!0}),fu(e,t,"utf-8")}function Ev(e){const t=e.jsonLabel??"JSON";try{return JSON.parse(e.jsonText)}catch(r){if(e.includePreviewInError){const o=e.previewLength??100,n=e.jsonText.slice(0,o),i=e.jsonText.length>n.length?"...":"";throw new Error(`Invalid ${t}: ${n}${i}`,{cause:r})}throw new Error(`Invalid ${t}: parse error.`,{cause:r})}}function zv(e){return{type:"text",text:e}}function xn(e){return{content:[zv(e)]}}function Nt(e){return{content:[zv(e)],isError:!0}}function TT(e){if(!e.jsonText)return Nt(e.missingMessage);if(!e.outputFile)return xn(e.jsonText);try{return OT(e.outputFile,e.jsonText),xn(`${e.fileLabel} written to: ${e.outputFile}`)}catch(t){return Nt(`Error writing file: ${t.message}`)}}function PT(e){let t;try{t=IT({inlineText:e.json,filePath:e.jsonFile,inlineLabel:"json",fileLabel:"jsonFile",fileDescription:e.fileDescription}).text}catch(o){return Nt(o.message)}const r=e.importJson(t);return r!=="OK"?Nt(`Error: ${r}`):xn(`${e.successMessage??"Imported successfully."}
|
|
82
|
+
|
|
83
|
+
${e.describeImported()}`)}function xT(e){if(e.snippetResult.type==="unknown")return Nt(`Error: Snippet "${e.snippetId}" has an unrecognized format.`);if(e.snippetResult.type!==e.expectedType)return Nt(`Error: Snippet "${e.snippetId}" is of type "${e.snippetResult.type}", not "${e.expectedType}".`);const t=e.importJson(JSON.stringify(e.snippetResult.data));return t!=="OK"?Nt(`Error importing snippet data: ${t}`):xn(`${e.successMessage}
|
|
84
|
+
|
|
85
|
+
${e.describeImported()}`)}async function NT(e){try{return e.createResponse(await e.loadSnippet(e.snippetId))}catch(t){return Nt(`Error fetching snippet "${e.snippetId}": ${t.message}`)}}function ET(e){return e.string().optional().describe("Optional absolute file path. When provided, the JSON is written to this file and the path is returned instead of the full JSON.")}function zT(e,t){return e.string().optional().describe(t)}function jT(e,t){return e.string().optional().describe(t)}function DT(e){return e.string().describe('Snippet ID from the Babylon.js Snippet Server (e.g. "ABC123" or "ABC123#2")')}function AT(e,t){const r=typeof e=="string"?Ev({jsonText:e,jsonLabel:t}):e;if(!r||typeof r!="object"||Array.isArray(r))throw new Error(`Invalid ${t}: expected a JSON object.`);return r}function CT(e){const t=AT(e,"NME JSON");if(!Array.isArray(t.blocks))throw new Error("Invalid NME JSON: must contain a 'blocks' array.");if(!Array.isArray(t.outputNodes))throw new Error("Invalid NME JSON: must contain an 'outputNodes' array.");const r=typeof t.mode=="number"?t.mode:void 0;if(r===void 0||r===0){const o=t.blocks,n=o.some(a=>a.customType==="BABYLON.VertexOutputBlock"),i=o.some(a=>a.customType==="BABYLON.FragmentOutputBlock");if(!n)throw new Error("Invalid NME JSON: missing VertexOutputBlock.");if(!i)throw new Error("Invalid NME JSON: missing FragmentOutputBlock.")}return t}const jv="babylon-mcp-editor-session",RT="1.0",UT="127.0.0.1",Dv="localhost",MT=3001,BT=10,ZT=15e3,FT=15*6e4,yi="last-writer-wins";function VT(e,t,r=Dv){return`http://${r}:${t}/session/${e}`}function LT(){return Si.createHash("sha256").update(process.cwd()).digest("hex")}function qT(){return`${process.pid}-${Si.randomBytes(8).toString("hex")}`}class JT{constructor(t,r={}){this._server=null,this._port=0,this._keepAliveInterval=null,this._idleTimeout=null,this._sessions=new Map,this._sessionByName=new Map,this._sseClients=new Map,this._startedAt=0,this._lastActivityAt=0,this._adapter=t,this._defaultPort=r.defaultPort??MT,this._portRange=r.portRange??BT,this._host=r.host??UT,this._publicHostname=r.publicHostname??Dv,this._protocolVersion=r.protocolVersion??RT,this._keepAliveIntervalMs=r.keepAliveIntervalMs??ZT,this._idleTimeoutMs=r.idleTimeoutMs??FT,this._corsOrigin=r.corsOrigin,this._allowedOrigins=r.allowedOrigins?new Set(r.allowedOrigins):null,this._legacyDocumentRoutes=new Set((r.legacyDocumentRoutes??[]).map(o=>o.replace(/^\//,""))),this._capabilities=["sse","document-get","document-post","session-close","session-list","diagnostics","idle-timeout",yi,...r.capabilities??[]],this._statusTitle=r.statusTitle??t.serverName,this._workspaceId=r.workspaceId??LT(),this._ownerId=r.ownerId??qT()}isRunning(){return this._server!==null&&this._server.listening}async startAsync(t=this._defaultPort){if(this.isRunning())return this._port;const r=t+this._portRange-1;return this._port=await this._tryPortRangeAsync(t,r),this._startedAt=Date.now(),this._recordActivity(),this._keepAliveInterval=setInterval(()=>{for(const o of this._sseClients.values())for(const n of o)n.write(`: ping
|
|
86
|
+
|
|
87
|
+
`)},this._keepAliveIntervalMs),this._port}async stopAsync(t="Session server stopped"){this._keepAliveInterval&&(clearInterval(this._keepAliveInterval),this._keepAliveInterval=null),this._idleTimeout&&(clearTimeout(this._idleTimeout),this._idleTimeout=null);for(const r of[...this._sessions.keys()])this.closeSession(r,t);if(this._idleTimeout&&(clearTimeout(this._idleTimeout),this._idleTimeout=null),!this._server){this._port=0,this._startedAt=0,this._lastActivityAt=0;return}await new Promise((r,o)=>{this._server.close(n=>{if(this._server=null,this._port=0,this._startedAt=0,this._lastActivityAt=0,n){o(new Error(n.message));return}r()})})}createSession(t,r=this._adapter.documentKind){const o=this._getSessionKey(r,t),n=this._sessionByName.get(o);if(n){const s=this._sessions.get(n);if(s)return s}const i=Date.now(),a={id:Si.randomBytes(16).toString("hex"),kind:r,name:t,createdAt:i,updatedAt:i,revision:0};return this._sessions.set(a.id,a),this._sessionByName.set(o,a.id),this._sseClients.set(a.id,new Set),this._recordActivity(),a}getSessionIdForName(t,r=this._adapter.documentKind){return this._sessionByName.get(this._getSessionKey(r,t))}getSessionUrl(t,r=this._port){return VT(t,r,this._publicHostname)}notifySessionUpdate(t){this._sendDocumentUpdateAsync(t)}closeSession(t,r="Session closed by MCP server"){const o=this._sessions.get(t);if(!o)return!1;const n=this._sseClients.get(t);if(n){for(const i of n)i.write(`event: session-closed
|
|
88
|
+
data: ${JSON.stringify({reason:r})}
|
|
89
|
+
|
|
90
|
+
`),i.end();n.clear()}return this._sseClients.delete(t),this._sessions.delete(t),this._sessionByName.delete(this._getSessionKey(o.kind,o.name)),this._recordActivity(),!0}closeSessionForName(t,r=this._adapter.documentKind){const o=this.getSessionIdForName(t,r);return o?this.closeSession(o):!1}getPort(){return this._port}getHealth(){return{protocol:jv,protocolVersion:this._protocolVersion,serverName:this._adapter.serverName,port:this._port,host:this._host,publicHostname:this._publicHostname,documentKind:this._adapter.documentKind,running:this.isRunning(),activeSessionCount:this._sessions.size,capabilities:[...this._capabilities],conflictPolicy:yi,idleTimeoutMs:this._idleTimeoutMs,lastActivityAt:this._lastActivityAt,workspaceId:this._workspaceId,ownerId:this._ownerId}}getDiagnostics(){return{health:this.getHealth(),sessions:this._getSessionInfoList(),sseClientCount:this._getSseClientCount(),startedAt:this._startedAt,uptimeMs:this._startedAt?Date.now()-this._startedAt:0,keepAliveIntervalMs:this._keepAliveIntervalMs,idleTimeoutMs:this._idleTimeoutMs,lastActivityAt:this._lastActivityAt}}_recordActivity(){this._lastActivityAt=Date.now(),this._scheduleIdleTimeout()}_scheduleIdleTimeout(){if(this._idleTimeout&&(clearTimeout(this._idleTimeout),this._idleTimeout=null),this._idleTimeoutMs<=0||!this.isRunning())return;const t=Date.now()-this._lastActivityAt,r=Math.max(1,this._idleTimeoutMs-t),o=setTimeout(()=>{this._stopIfIdleAsync()},r);typeof o=="object"&&"unref"in o&&o.unref(),this._idleTimeout=o}async _stopIfIdleAsync(){if(!this.isRunning()||this._idleTimeoutMs<=0)return;if(Date.now()-this._lastActivityAt<this._idleTimeoutMs){this._scheduleIdleTimeout();return}await this.stopAsync("Session server stopped after idle timeout")}_getSessionKey(t,r){return`${t}:${r}`}async _tryPortRangeAsync(t,r){let o;for(let n=t;n<=r;n++)try{return await this._startOnPortAsync(n),n}catch(i){o=i}throw o??new Error(`Could not find an open port between ${t} and ${r}`)}async _startOnPortAsync(t){await new Promise((r,o)=>{const n=Gv.createServer((i,a)=>{this._handleRequestAsync(i,a)});n.once("error",i=>{o(new Error(i.message))}),n.listen(t,this._host,()=>{this._server=n,r()})})}_setCorsHeaders(t,r){const o=this._getAllowedCorsOrigin(t.headers.origin);o&&(r.setHeader("Access-Control-Allow-Origin",o),r.setHeader("Vary","Origin")),r.setHeader("Access-Control-Allow-Methods","GET, POST, OPTIONS"),r.setHeader("Access-Control-Allow-Headers","Content-Type"),r.setHeader("Access-Control-Expose-Headers","X-Mcp-Editor-Session-Revision")}_getAllowedCorsOrigin(t){if(this._corsOrigin)return this._corsOrigin;if(t)return this._allowedOrigins?this._allowedOrigins.has(t)?t:void 0:this._isLocalOrigin(t)?t:void 0}_isLocalOrigin(t){try{const r=new URL(t);return(r.protocol==="http:"||r.protocol==="https:")&&(r.hostname==="localhost"||r.hostname==="127.0.0.1"||r.hostname==="::1")}catch{return!1}}async _handleRequestAsync(t,r){if(this._setCorsHeaders(t,r),this._recordActivity(),t.method==="OPTIONS"){r.writeHead(204),r.end();return}const n=new URL(t.url??"/",`http://${this._publicHostname}:${this._port}`).pathname;if(n==="/"&&t.method==="GET"){this._handleStatus(r);return}if(n==="/health"&&t.method==="GET"){this._writeJson(r,200,this.getHealth());return}if(n==="/sessions"&&t.method==="GET"){this._writeJson(r,200,this._getSessionInfoList());return}if(n==="/diagnostics"&&t.method==="GET"){this._writeJson(r,200,this.getDiagnostics());return}const i=n.match(/^\/session\/([^/]+)(?:\/([^/]+))?$/);if(!i){this._writeText(r,404,"Not Found");return}const a=i[1],s=i[2]??"",c=this._sessions.get(a);if(!c){this._writeJson(r,404,{error:`Session "${a}" not found`});return}if(s===""&&t.method==="GET"){this._writeJson(r,200,this._createSessionInfo(c));return}if(s==="events"&&t.method==="GET"){await this._handleSseAsync(c,r);return}if(this._isDocumentRoute(s)){if(t.method==="GET"){await this._handleGetDocumentAsync(c,r);return}if(t.method==="POST"){await this._handlePostDocumentAsync(c,t,r);return}}this._writeText(r,404,"Not Found")}_handleStatus(t){const r=[this._statusTitle,"",`Protocol: ${jv} ${this._protocolVersion}`,`Document kind: ${this._adapter.documentKind}`,""];if(this._sessions.size===0)r.push("No active sessions.");else{r.push("Active sessions:");for(const o of this._sessions.values()){const n=this._sseClients.get(o.id)?.size??0;r.push(` ${o.id} -> ${o.name} (${n} subscriber${n===1?"":"s"}, revision ${o.revision})`)}}this._writeText(t,200,r.join(`
|
|
91
|
+
`))}async _handleSseAsync(t,r){r.statusCode=200,r.setHeader("Content-Type","text/event-stream"),r.setHeader("Cache-Control","no-cache"),r.setHeader("Connection","keep-alive"),r.flushHeaders();const o=this._sseClients.get(t.id);o.add(r),r.write(`: connected
|
|
92
|
+
|
|
93
|
+
`);const n=await this._adapter.getDocument(t);n&&this._writeDocumentEvent(r,n),r.on("close",()=>{o.delete(r),this._recordActivity()})}async _handleGetDocumentAsync(t,r){const o=await this._adapter.getDocument(t);if(!o){this._writeJson(r,404,{error:`Document "${t.name}" not found`});return}r.statusCode=200,r.setHeader("Content-Type","application/json; charset=utf-8"),r.setHeader("Cache-Control","no-cache"),r.setHeader("X-Mcp-Editor-Session-Revision",t.revision.toString()),r.end(o)}async _handlePostDocumentAsync(t,r,o){const n=await this._readBodyAsync(r);try{JSON.parse(n)}catch{this._writeJson(o,400,{error:"Invalid JSON"});return}const i=await this._adapter.setDocument(t,n);if(typeof i=="string"&&i.length>0){this._writeJson(o,400,{error:i});return}const a=t.revision;this._touchSession(t),o.setHeader("X-Mcp-Editor-Session-Revision",t.revision.toString()),this._writeJson(o,200,{ok:!0,previousRevision:a,revision:t.revision,conflictPolicy:yi}),await this._sendDocumentUpdateAsync(t.id,!1)}async _sendDocumentUpdateAsync(t,r=!0){const o=this._sessions.get(t);if(!o)return;this._recordActivity(),r&&this._touchSession(o);const n=this._sseClients.get(t);if(!n||n.size===0)return;const i=await this._adapter.getDocument(o);if(i)for(const a of n)this._writeDocumentEvent(a,i)}_touchSession(t){t.updatedAt=Date.now(),t.revision++}_writeDocumentEvent(t,r){const o=JSON.stringify(JSON.parse(r));t.write(`data: ${o}
|
|
94
|
+
|
|
95
|
+
`)}_isDocumentRoute(t){return t==="document"||this._legacyDocumentRoutes.has(t)}_createSessionInfo(t){const r=this._sseClients.get(t.id)?.size??0,o={sessionId:t.id,kind:t.kind,name:t.name,revision:t.revision,createdAt:t.createdAt,updatedAt:t.updatedAt,conflictPolicy:yi,subscriberCount:r,eventsUrl:`/session/${t.id}/events`,documentUrl:`/session/${t.id}/document`};for(const n of this._legacyDocumentRoutes)o[`${n}Url`]=`/session/${t.id}/${n}`;return o}_getSessionInfoList(){return[...this._sessions.values()].map(t=>this._createSessionInfo(t))}_getSseClientCount(){let t=0;for(const r of this._sseClients.values())t+=r.size;return t}async _readBodyAsync(t){const r=[];return await new Promise((o,n)=>{t.on("data",i=>r.push(i)),t.on("end",o),t.on("error",n)}),Buffer.concat(r).toString("utf-8")}_writeJson(t,r,o){t.statusCode=r,t.setHeader("Content-Type","application/json; charset=utf-8"),t.end(JSON.stringify(o))}_writeText(t,r,o){t.statusCode=r,t.setHeader("Content-Type","text/plain; charset=utf-8"),t.end(o)}}class HT{constructor(t,r={}){this._manager=null,this._sessionServer=null,this._adapter=t,this._options=r}isRunning(){return this._sessionServer?.isRunning()??!1}async startAsync(t,r){return this._manager=t,await this._getSessionServer().startAsync(r)}async stopAsync(){this._sessionServer&&await this._sessionServer.stopAsync()}createSession(t){return this._getSessionServer().createSession(t).id}getSessionIdForName(t){return this._sessionServer?.getSessionIdForName(t)}getSessionUrl(t,r){return this._getSessionServer().getSessionUrl(t,r)}notifySessionUpdate(t){this._sessionServer?.notifySessionUpdate(t)}closeSession(t){return this._sessionServer?.closeSession(t)??!1}closeSessionForName(t){return this._sessionServer?.closeSessionForName(t)??!1}getPort(){return this._sessionServer?.getPort()??0}getHealth(){return this._getSessionServer().getHealth()}getDiagnostics(){return this._getSessionServer().getDiagnostics()}_getSessionServer(){return this._sessionServer||(this._sessionServer=new JT({serverName:this._adapter.serverName,documentKind:this._adapter.documentKind,getDocument:t=>this._manager?this._adapter.getDocument(this._manager,t):void 0,setDocument:(t,r)=>this._manager?this._adapter.setDocument(this._manager,t,r):this._adapter.managerUnavailableMessage??"Document manager is not available"},this._options)),this._sessionServer}}const nu={Material:0,PostProcess:1,Particle:2,ProceduralTexture:3,GaussianSplatting:4,SFE:5},Av={Vertex:1,Fragment:2,Neutral:4,VertexAndFragment:3},je={Float:1,Int:2,Vector2:4,Vector3:8,Vector4:16,Color3:32,Color4:64,Matrix:128,Object:256,AutoDetect:1073741824,BasedOnInput:2048},Cv={World:1,View:2,Projection:3,ViewProjection:4,WorldView:5,WorldViewProjection:6,CameraPosition:7,FogColor:8,DeltaTime:9,CameraParameters:10,MaterialAlpha:11},Rv={None:0,Time:1},KT={Cos:0,Sin:1,Abs:2,Exp:3,Exp2:4,Round:5,Floor:6,Ceiling:7,Sqrt:8,Log:9,Tan:10,ArcTan:11,ArcCos:12,ArcSin:13,Fract:14,Sign:15,Radians:16,Degrees:17,Set:18},GT={Equal:0,NotEqual:1,LessThan:2,GreaterThan:3,LessOrEqual:4,GreaterOrEqual:5,Xor:6,Or:7,And:8},WT={None:0,Normal:1,Tangent:2,VertexColor:3,UV1:4,UV2:5,UV3:6,UV4:7,UV5:8,UV6:9},YT={EaseInSine:0,EaseOutSine:1,EaseInOutSine:2,EaseInQuad:3,EaseOutQuad:4,EaseInOutQuad:5,EaseInCubic:6,EaseOutCubic:7,EaseInOutCubic:8,EaseInQuart:9,EaseOutQuart:10,EaseInOutQuart:11,EaseInQuint:12,EaseOutQuint:13,EaseInOutQuint:14,EaseInExpo:15,EaseOutExpo:16,EaseInOutExpo:17,EaseInCirc:18,EaseOutCirc:19,EaseInOutCirc:20,EaseInBack:21,EaseOutBack:22,EaseInOutBack:23,EaseInElastic:24,EaseOutElastic:25,EaseInOutElastic:26},ru={TrigonometryBlock:{operation:KT},ConditionalBlock:{condition:GT},MeshAttributeExistsBlock:{attributeType:WT},CurveBlock:{curveType:YT}},ou=new Set(["position","normal","tangent","uv","uv2","uv3","uv4","uv5","uv6","color","matricesIndices","matricesWeights","matricesIndicesExtra","matricesWeightsExtra"]),Uv={pos:"position",worldpos:"position",worldposition:"position",world_position:"position",vertexposition:"position",vertex_position:"position",norm:"position",worldnormal:"normal",worldnorm:"normal",world_normal:"normal",vertexnormal:"normal",vertex_normal:"normal"};Uv.norm="normal";function Mv(e){if(typeof e!="string")return{name:String(e)};if(ou.has(e))return{name:e};const t=e.toLowerCase().replace(/[\s_-]/g,""),r=Uv[t];return r?{name:r,warning:`\u26A0 attributeName "${e}" is not a valid vertex attribute. Auto-corrected to "${r}". Valid names: ${[...ou].join(", ")}.`}:{name:e,warning:`\u26A0 attributeName "${e}" is not a recognised vertex attribute. Valid names: ${[...ou].join(", ")}. Using it anyway \u2014 this may cause shader errors.`}}const iu={Float:"scalar",Int:"scalar",Vector2:"vec2",Vector3:"vec3",Color3:"vec3",Vector4:"vec4",Color4:"vec4",Matrix:"matrix",Object:"any",AutoDetect:"any",BasedOnInput:"any"},au={};for(const[e,t]of Object.entries(je))au[t]=e;function XT(e,t){const r=e.customType?.replace("BABYLON.","");if(r==="InputBlock"){const i=e.type;return i!==void 0&&au[i]?au[i]:"AutoDetect"}const o=xr[r];return o?o.outputs.find(i=>i.name===t)?.type??"AutoDetect":"AutoDetect"}function QT(e,t){const r=e.customType?.replace("BABYLON.","");if(!r)return"AutoDetect";const o=xr[r];return o?o.inputs.find(i=>i.name===t)?.type??"AutoDetect":"AutoDetect"}function eP(e,t,r,o){const n=iu[e]??"any",i=iu[t]??"any";if(n==="any"||i==="any")return{compatible:!0};if(n===i)return{compatible:!0};if(n==="scalar")return{compatible:!0,warning:`Type promotion: ${e} \u2192 ${t} (scalar will be broadcast to fill the vector).`};const a=r.customType?.replace("BABYLON.",""),s=a?xr[a]:void 0;let c;if(s){const u=s.inputs.filter(l=>{const d=iu[l.type]??"any";return d===n||d==="any"});u.length>0&&(c=`Consider connecting to ${u.map(d=>`"${d.name}" (${d.type})`).join(", ")} instead of "${o}" (${t}).`)}return{compatible:!1,warning:`Type mismatch: output type ${e} (${n}) is not compatible with input type ${t} (${i}). This will likely cause a shader compilation error.`,suggestion:c}}class _i{_materials=new Map;_nextId=new Map;_nextX=new Map;createMaterial(t,r="Material",o){const n={ignoreAlpha:!1,maxSimultaneousLights:4,mode:nu[r]??0,forceAlphaBlending:!1,blocks:[],outputNodes:[],comment:o};return this._materials.set(t,n),this._nextId.set(t,1),this._nextX.set(t,0),n}getMaterial(t){return this._materials.get(t)}listMaterials(){return Array.from(this._materials.keys())}deleteMaterial(t){return this._nextId.delete(t),this._nextX.delete(t),this._materials.delete(t)}clearAll(){this._materials.clear(),this._nextId.clear(),this._nextX.clear()}addBlock(t,r,o,n){const i=this._materials.get(t);if(!i)return`Material "${t}" not found. Create it first.`;const a=Pn[r];if(!a)return`Unknown block type "${r}". Use list_block_types to see available blocks.`;const s=[],c=this._nextId.get(t);this._nextId.set(t,c+1);const u=Av[a.target]??Av.Neutral,l=o??`${r}_${c}`,d={customType:`BABYLON.${a.className}`,id:c,name:l,target:u,inputs:a.inputs.map(m=>({name:m.name,displayName:m.name})),outputs:a.outputs.map(m=>({name:m.name,displayName:m.name}))};if(r==="InputBlock"&&(d.mode=3,d.min=0,d.max=0,d.isBoolean=!1,d.matrixMode=0,d.isConstant=!1,d.groupInInspector="",d.convertToGammaSpace=!1,d.convertToLinearSpace=!1,d.animationType=0),a.defaultSerializedProperties)for(const[m,f]of Object.entries(a.defaultSerializedProperties))d[m]=f;if(n)for(const[m,f]of Object.entries(n))if(r==="InputBlock"&&m==="type"&&typeof f=="string")d.type=je[f]??f;else if(r==="InputBlock"&&m==="systemValue"&&typeof f=="string")d.systemValue=Cv[f]??f,d.mode=0;else if(r==="InputBlock"&&m==="animationType"&&typeof f=="string")d.animationType=Rv[f]??f;else if(r==="InputBlock"&&m==="mode"&&typeof f=="string"){const _={Uniform:0,Attribute:1,Varying:2,Undefined:3};d.mode=_[f]??f}else d[m]=f;if(r==="InputBlock"){if(d.attributeName!==void 0){const m=Mv(d.attributeName);d.attributeName=m.name,m.warning&&s.push(m.warning)}d.mode===3&&(d.attributeName!==void 0?d.mode=1:(d.systemValue,d.mode=0)),this._normaliseInputBlockValue(d),this._ensureDefaultValue(d)}(r==="VertexOutputBlock"||r==="FragmentOutputBlock")&&i.outputNodes.push(c);const p=this._nextX.get(t);if(this._nextX.set(t,p+280),i.editorData||(i.editorData={locations:[]}),i.editorData.locations.push({blockId:c,x:p,y:0}),r==="InputBlock"){d.type===void 0&&s.push(`\u26A0 InputBlock "${d.name}" has no 'type' property. Set type to one of: Float, Int, Vector2, Vector3, Vector4, Color3, Color4, Matrix. Without a type, connections will fail.`);const m=d.value!==void 0,f=d.systemValue!==void 0,_=d.attributeName!==void 0;!m&&!f&&!_&&s.push(`\u26A0 InputBlock "${d.name}" has no value, systemValue, or attributeName. It won't provide any data. Set one of: value (constant), systemValue (e.g. 'WorldViewProjection'), or attributeName (e.g. 'position', 'normal', 'uv').`)}return i.blocks.push(d),{block:d,warnings:s.length>0?s:void 0}}_normaliseInputBlockValue(t){const r=t.value;if(r==null)return;const o=t.type;if(typeof r=="number"){if(o===je.Matrix){t.value=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t.valueType="BABYLON.Matrix";return}t.valueType="number";return}if(Array.isArray(r)){t.valueType||(t.valueType=this._inferValueType(o,r.length));return}if(typeof r=="object"){const n=r;"r"in n?"a"in n?(t.value=[n.r,n.g,n.b,n.a],t.valueType="BABYLON.Color4"):(t.value=[n.r,n.g,n.b],t.valueType="BABYLON.Color3"):"x"in n&&("w"in n?(t.value=[n.x,n.y,n.z,n.w],t.valueType="BABYLON.Vector4"):"z"in n?(t.value=[n.x,n.y,n.z],t.valueType="BABYLON.Vector3"):(t.value=[n.x,n.y],t.valueType="BABYLON.Vector2"))}}_inferValueType(t,r){const o={[je.Vector2]:"BABYLON.Vector2",[je.Vector3]:"BABYLON.Vector3",[je.Vector4]:"BABYLON.Vector4",[je.Color3]:"BABYLON.Color3",[je.Color4]:"BABYLON.Color4",[je.Matrix]:"BABYLON.Matrix"};return t!==void 0&&o[t]?o[t]:{2:"BABYLON.Vector2",3:"BABYLON.Vector3",4:"BABYLON.Vector4",16:"BABYLON.Matrix"}[r]??"BABYLON.Vector3"}_ensureDefaultValue(t){if(t.value!==void 0&&t.value!==null)return;const r=t.type;if(r===void 0)return;const n={[je.Float]:{value:0,valueType:"number"},[je.Int]:{value:0,valueType:"number"},[je.Vector2]:{value:[0,0],valueType:"BABYLON.Vector2"},[je.Vector3]:{value:[0,0,0],valueType:"BABYLON.Vector3"},[je.Vector4]:{value:[0,0,0,0],valueType:"BABYLON.Vector4"},[je.Color3]:{value:[1,1,1],valueType:"BABYLON.Color3"},[je.Color4]:{value:[1,1,1,1],valueType:"BABYLON.Color4"},[je.Matrix]:{value:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],valueType:"BABYLON.Matrix"}}[r];n&&(t.value=n.value,t.valueType=n.valueType)}removeBlock(t,r){const o=this._materials.get(t);if(!o)return`Material "${t}" not found.`;const n=o.blocks.findIndex(i=>i.id===r);if(n===-1)return`Block ${r} not found.`;for(const i of o.blocks)for(const a of i.inputs)a.targetBlockId===r&&(delete a.targetBlockId,delete a.targetConnectionName);return o.blocks.splice(n,1),o.outputNodes=o.outputNodes.filter(i=>i!==r),o.editorData&&(o.editorData.locations=o.editorData.locations.filter(i=>i.blockId!==r)),"OK"}connectBlocks(t,r,o,n,i){const a=this._materials.get(t);if(!a)return`Material "${t}" not found.`;const s=a.blocks.find(f=>f.id===r);if(!s)return`Source block ${r} not found.`;const c=a.blocks.find(f=>f.id===n);if(!c)return`Target block ${n} not found.`;if(!s.outputs.find(f=>f.name===o)){const f=s.outputs.map(_=>_.name).join(", ");return`Output "${o}" not found on block ${r} ("${s.name}"). Available: ${f}`}const l=c.inputs.find(f=>f.name===i);if(!l){const f=c.inputs.map(_=>_.name).join(", ");return`Input "${i}" not found on block ${n} ("${c.name}"). Available: ${f}`}const d=XT(s,o),p=QT(c,i),m=eP(d,p,c,i);if(!m.compatible){const f=[`TYPE MISMATCH WARNING: ${m.warning}`];return m.suggestion&&f.push(m.suggestion),f.push("The connection was NOT made. Fix the types or choose a compatible input."),f.join(" ")}return l.inputName=l.name,l.targetBlockId=r,l.targetConnectionName=o,m.warning?`OK (note: ${m.warning})`:"OK"}disconnectInput(t,r,o){const n=this._materials.get(t);if(!n)return`Material "${t}" not found.`;const i=n.blocks.find(s=>s.id===r);if(!i)return`Block ${r} not found.`;const a=i.inputs.find(s=>s.name===o);return a?(delete a.inputName,delete a.targetBlockId,delete a.targetConnectionName,"OK"):`Input "${o}" not found.`}describeMaterial(t){const r=this._materials.get(t);if(!r)return`Material "${t}" not found.`;const o=[];o.push(`Material: ${t}`),o.push(`Mode: ${Object.entries(nu).find(([,n])=>n===r.mode)?.[0]??r.mode}`),o.push(`Blocks (${r.blocks.length}):`);for(const n of r.blocks){const i=n.customType.replace("BABYLON.","");if(o.push(` [${n.id}] ${n.name} (${i})`),n.inputs.length>0){for(const a of n.inputs)if(a.targetBlockId!==void 0){const s=r.blocks.find(c=>c.id===a.targetBlockId);o.push(` \u2190 ${a.name} \u2190 [${a.targetBlockId}] ${s?.name??"?"}.${a.targetConnectionName}`)}}}return o.push(`Output nodes: [${r.outputNodes.join(", ")}]`),r.comment&&o.push(`Comment: ${r.comment}`),o.join(`
|
|
96
|
+
`)}describeBlock(t,r){const o=this._materials.get(t);if(!o)return`Material "${t}" not found.`;const n=o.blocks.find(u=>u.id===r);if(!n)return`Block ${r} not found.`;const i=n.customType.replace("BABYLON.",""),a=[];a.push(`Block [${n.id}]: "${n.name}" \u2014 type ${i}`),a.push(`
|
|
97
|
+
Inputs:`);for(const u of n.inputs){const l=u.targetBlockId!==void 0?` \u2190 connected to [${u.targetBlockId}].${u.targetConnectionName}`:" (unconnected)";a.push(` \u2022 ${u.name}${l}`)}a.push(`
|
|
98
|
+
Outputs:`);for(const u of n.outputs){const l=[];for(const p of o.blocks)for(const m of p.inputs)m.targetBlockId===r&&m.targetConnectionName===u.name&&l.push(`[${p.id}] ${p.name}.${m.name}`);const d=l.length>0?` \u2192 ${l.join(", ")}`:" (unconnected)";a.push(` \u2022 ${u.name}${d}`)}const s=new Set(["customType","id","name","target","inputs","outputs"]),c=Object.entries(n).filter(([u])=>!s.has(u));if(c.length>0){a.push(`
|
|
99
|
+
Properties:`);for(const[u,l]of c)a.push(` ${u}: ${JSON.stringify(l)}`)}return a.join(`
|
|
100
|
+
`)}exportJSON(t){const r=this._materials.get(t);if(r){for(const o of r.blocks){o.customType==="BABYLON.InputBlock"&&(this._normaliseInputBlockValue(o),this._ensureDefaultValue(o));const n=o.customType.replace("BABYLON.",""),i=xr[n];if(i?.defaultSerializedProperties)for(const[s,c]of Object.entries(i.defaultSerializedProperties))o[s]===void 0&&(o[s]=c);const a=ru[n];if(a)for(const[s,c]of Object.entries(a))typeof o[s]=="string"&&(o[s]=c[o[s]]??o[s])}for(const o of r.blocks)if(o.customType==="BABYLON.RemapBlock"){if(!Array.isArray(o.sourceRange)){const n=o.sourceMin??-1,i=o.sourceMax??1;o.sourceRange=[n,i]}if(!Array.isArray(o.targetRange)){const n=o.targetMin??0,i=o.targetMax??1;o.targetRange=[n,i]}delete o.sourceMin,delete o.sourceMax,delete o.targetMin,delete o.targetMax}for(const o of r.blocks)for(const n of["texture","reflectionTexture"])if(typeof o[n]=="string"){const i=o[n];o[n]={name:i,url:i,uOffset:0,vOffset:0,uScale:1,vScale:1,uAng:0,vAng:0,wAng:0,invertY:!0,samplingMode:3,noMipmap:!1,coordinatesMode:0,coordinatesIndex:0,hasAlpha:!1,level:1}}return this._layoutGraph(r),JSON.stringify(r,null,2)}}static COL_WIDTH=340;static ROW_HEIGHT=180;_layoutGraph(t){const r=t.blocks;if(r.length===0)return;const o=new Map;for(const g of r)o.set(g.id,g);const n=new Map,i=new Map;for(const g of r)n.set(g.id,new Set),i.set(g.id,new Set);for(const g of r)for(const v of g.inputs)v.targetBlockId!==void 0&&(n.get(g.id).add(v.targetBlockId),i.get(v.targetBlockId)?.add(g.id));const a=new Map,s=[];for(const g of r){const v=g.customType.replace("BABYLON.","");(v==="VertexOutputBlock"||v==="FragmentOutputBlock")&&(a.set(g.id,0),s.push(g.id))}s.length===0&&r.length>0&&(a.set(r[r.length-1].id,0),s.push(r[r.length-1].id));let c=0;for(;c<s.length;){const g=s[c++],v=a.get(g);for(const y of n.get(g)??[]){const b=a.get(y);(b===void 0||v+1>b)&&(a.set(y,v+1),s.push(y))}}const u=Math.max(0,...a.values());for(const g of r)a.has(g.id)||a.set(g.id,u+1);const l=Math.max(0,...a.values()),d=new Map;for(const[g,v]of a)d.set(g,l-v);const p=new Map;for(const g of r){const v=d.get(g.id);p.has(v)||p.set(v,[]),p.get(v).push(g.id)}const m=[...p.keys()].sort((g,v)=>v-g),f=new Map;for(const g of m){const v=p.get(g);if(g===m[0])v.forEach((y,b)=>f.set(y,b));else{const y=new Map;for(const b of v){const I=i.get(b),x=[];for(const B of I){const L=f.get(B);L!==void 0&&x.push(L)}x.length>0?y.set(b,x.reduce((B,L)=>B+L,0)/x.length):y.set(b,9999)}v.sort((b,I)=>y.get(b)-y.get(I)),v.forEach((b,I)=>f.set(b,I))}}const _=[];for(const g of r){const v=d.get(g.id),y=f.get(g.id);_.push({blockId:g.id,x:v*_i.COL_WIDTH,y:y*_i.ROW_HEIGHT})}t.editorData?t.editorData.locations=_:t.editorData={locations:_}}importJSON(t,r){try{const o=CT(r);this._materials.set(t,o);const n=o.blocks.reduce((i,a)=>Math.max(i,a.id),0);return this._nextId.set(t,n+1),this._nextX.set(t,o.blocks.length*280),"OK"}catch(o){return o.message}}setBlockProperties(t,r,o){const n=this._materials.get(t);if(!n)return`Material "${t}" not found.`;const i=n.blocks.find(s=>s.id===r);if(!i)return`Block ${r} not found.`;const a=i.customType.replace("BABYLON.","");for(const[s,c]of Object.entries(o))if(a==="InputBlock"&&s==="type"&&typeof c=="string")i.type=je[c]??c;else if(a==="InputBlock"&&s==="systemValue"&&typeof c=="string")i.systemValue=Cv[c]??c,i.mode=0;else if(a==="InputBlock"&&s==="animationType"&&typeof c=="string")i.animationType=Rv[c]??c;else if(a==="InputBlock"&&s==="mode"&&typeof c=="string"){const u={Uniform:0,Attribute:1,Varying:2,Undefined:3};i.mode=u[c]??c}else if(typeof c=="string"&&ru[a]?.[s]){const u=ru[a][s];i[s]=u[c]??c}else i[s]=c;if(a==="InputBlock"){if(i.attributeName!==void 0){const s=Mv(i.attributeName);if(i.attributeName=s.name,s.warning)return s.warning}i.attributeName!==void 0&&(i.mode===3||i.mode===0)&&(i.mode=1),this._normaliseInputBlockValue(i),this._ensureDefaultValue(i)}return"OK"}validateMaterial(t){const r=this._materials.get(t);if(!r)return[`Material "${t}" not found.`];const o=[],n=r.blocks.some(a=>a.customType==="BABYLON.VertexOutputBlock"),i=r.blocks.some(a=>a.customType==="BABYLON.FragmentOutputBlock");r.mode===nu.Material&&(n||o.push("ERROR: Missing VertexOutputBlock \u2014 every material needs one."),i||o.push("ERROR: Missing FragmentOutputBlock \u2014 every material needs one."));for(const a of r.blocks){const s=a.customType.replace("BABYLON.",""),c=Object.values(Pn).find(u=>u.className===s);if(c)for(const u of a.inputs){const l=c.inputs.find(d=>d.name===u.name);if(u.targetBlockId===void 0&&l&&!l.isOptional){if(c.defaultSerializedProperties&&Object.keys(c.defaultSerializedProperties).length>0)continue;o.push(`WARNING: Block [${a.id}] "${a.name}" has required input "${u.name}" that is not connected.`)}}}for(const a of r.outputNodes)r.blocks.find(s=>s.id===a)||o.push(`ERROR: Output node references block ${a} which does not exist.`);for(const a of r.blocks)for(const s of a.inputs)if(s.targetBlockId!==void 0){const c=r.blocks.find(u=>u.id===s.targetBlockId);c?c.outputs.find(u=>u.name===s.targetConnectionName)||o.push(`WARNING: Block [${a.id}] "${a.name}" input "${s.name}" references output "${s.targetConnectionName}" which doesn't exist on block [${c.id}].`):o.push(`ERROR: Block [${a.id}] "${a.name}" input "${s.name}" references non-existent block ${s.targetBlockId}.`)}for(const a of r.blocks){if(a.customType!=="BABYLON.InputBlock")continue;a.type===void 0&&o.push(`ERROR: InputBlock [${a.id}] "${a.name}" has no 'type' property. Set type to: Float, Int, Vector2, Vector3, Vector4, Color3, Color4, or Matrix.`);const s=a.value!==void 0,c=a.systemValue!==void 0,u=a.attributeName!==void 0;!s&&!c&&!u&&o.push(`WARNING: InputBlock [${a.id}] "${a.name}" has no value, systemValue, or attributeName \u2014 it provides no data.`)}for(const a of r.blocks){if(a.customType==="BABYLON.VertexOutputBlock"||a.customType==="BABYLON.FragmentOutputBlock"||a.customType==="BABYLON.InputBlock")continue;const s=a.inputs.some(u=>u.targetBlockId!==void 0),c=r.blocks.some(u=>u.inputs.some(l=>l.targetBlockId===a.id));!s&&!c&&o.push(`WARNING: Block [${a.id}] "${a.name}" (${a.customType.replace("BABYLON.","")}) has no connections \u2014 it is an orphan and does nothing.`)}return o.length===0&&o.push("No issues found \u2014 graph looks valid."),o}}const tP="https://cdn.babylonjs.com",nP={havok:"havok/HavokPhysics_umd.js",ammo:"ammo/ammo.js",recast:"recast.js"},su="https://snippet.babylonjs.com";async function rP(e,t=su){let r=e.replace(/#/g,"/");r.includes("/")||(r+="/0");const o=`${t}/${r}`,n=await fetch(o);if(!n.ok)throw new Error(`Failed to fetch snippet "${e}": ${n.status} ${n.statusText}`);return await n.json()}const oP=[["nodeMaterial","nodeMaterial"],["nodeGeometry","nodeGeometry"],["nodeRenderGraph","nodeRenderGraph"],["nodeParticle","nodeParticle"],["gui","gui"],["encodedGui","gui"],["animations","animation"],["animation","animation"],["particleSystem","particleSystem"],["spriteManager","spriteManager"],["shaderMaterial","shaderMaterial"]];function iP(e){const t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r.buffer}function Bv(e){const t=new Uint8Array(iP(e));return new TextDecoder("utf-8").decode(t)}function aP(e){if(e.files&&typeof e.files=="object"&&e.v!==void 0||typeof e.code=="string")return"playground";for(const[t,r]of oP)if(t in e)return r;return"unknown"}function sP(e,t,r,o){let n;switch(t){case"gui":{typeof e.encodedGui=="string"?n=JSON.parse(Bv(e.encodedGui)):n=typeof e.gui=="string"?JSON.parse(e.gui):e.gui;break}case"animation":{typeof e.animations=="string"?n=JSON.parse(e.animations):e.animations!==void 0?n=e.animations:typeof e.animation=="string"?n=JSON.parse(e.animation):n=e.animation;break}default:{const a=e[t];n=typeof a=="string"?JSON.parse(a):a;break}}return{snippetId:r,type:t,metadata:o,data:n,load:i=>i?i(n):n}}let cu=null;async function cP(){return await import("monaco-editor/esm/vs/language/typescript/lib/typescriptServices")}async function uP(){return cu||(cu=cP().then(e=>e.typescript)),await cu}async function lP(e,t){const r=await uP();return r.transpileModule(e,{compilerOptions:{target:r.ScriptTarget.ESNext,module:r.ModuleKind.ESNext,jsx:t.endsWith(".tsx")?r.JsxEmit.ReactJSX:void 0,esModuleInterop:!1,allowJs:!0,sourceMap:!1,experimentalDecorators:!0,emitDecoratorMetadata:!1,isolatedModules:!0,strict:!1,allowUmdGlobalAccess:!0},fileName:t}).outputText}async function dP(e,t){const r={},o=[];for(const[n,i]of Object.entries(e))if(/\.tsx?$/i.test(n)){const a=n.replace(/\.tsx?$/i,".js");o.push((async()=>{r[a]=await Promise.resolve(t(i,n))})())}else r[n]=i;return await Promise.all(o),r}const Zv=["delayCreateScene","delayLoadScene","createScene","CreateScene","createscene"];function mP(e){if(e.includes("class Playground"))return"TS";if(Zv.some(o=>e.includes(o))||!e)return"JS";const t=[/\binterface\s+[A-Za-z_]\w*/m,/\benum\s+[A-Za-z_]\w*/m,/\btype\s+[A-Za-z_]\w*\s*=/m,/\bimplements\s+[A-Za-z_]/m,/\breadonly\b/m,/\bpublic\b|\bprivate\b|\bprotected\b/m,/\babstract\s+class\b/m,/\bas\s+const\b/m,/\bimport\s+type\s+/m],r=/[:]\s*[A-Za-z_$][\w$.<>,\s?\\[\]|&]*\b(?![:=])/m.test(e);return t.some(o=>o.test(e))||r?"TS":"JS"}function pP(e,t){let r=e;if(t==="JS"){const n=r.search(/(?:var|let|const|function)\s+(?:createScene|delayCreateScene|delayLoadScene|createEngine|CreateScene)\b/),i=n>0?r.slice(0,n):"";i&&(r=i.replace(/^[^\S\n]*(?:var|let|const)\s+canvas\s*=\s*document\.getElementById\s*\([^)]*\)\s*;?[^\S\n]*$/gm,"// [snippet-loader] canvas provided by host").replace(/^[^\S\n]*(?:var|let|const)\s+engine\s*=\s*new\s+BABYLON\.\w*Engine\b[^;]*;?[^\S\n]*$/gm,"// [snippet-loader] engine provided by host")+r.slice(n))}const o=t==="TS"?"Playground":Zv.find(n=>r.includes(n))??"createScene";return r+=`
|
|
101
|
+
export default ${o}
|
|
102
|
+
`,t==="JS"&&/\bfunction\s+createEngine\b|\bvar\s+createEngine\s*=|\bconst\s+createEngine\s*=|\blet\s+createEngine\s*=/.test(r)&&(r+=`
|
|
103
|
+
export { createEngine }
|
|
104
|
+
`),r}function fP(e,t,r){if(e.files&&typeof e.files=="object"&&e.v!==void 0){const c=e,u=c.entry||(c.language==="JS"?"index.js":"index.ts");return{snippetId:t,type:"playground",metadata:r,language:c.language??"JS",engineType:void 0,isMultiFile:!0,manifest:{...c,entry:u},code:c.files[u]??"",files:{...c.files}}}const o=e;let n=String(o.code??"");o.unicode&&(n=Bv(o.unicode));try{const c=JSON.parse(n);if(c&&c.files&&typeof c.files=="object"){const u=c,l=u.entry||(u.language==="JS"?"index.js":"index.ts");return{snippetId:t,type:"playground",metadata:r,language:u.language??"JS",engineType:o.engine,isMultiFile:!0,manifest:{...u,entry:l},code:u.files[l]??"",files:{...u.files}}}}catch{}const i=mP(n),a=i==="TS"?"index.ts":"index.js",s=pP(n,i);return{snippetId:t,type:"playground",metadata:r,language:i,engineType:o.engine,isMultiFile:!1,manifest:null,code:s,files:{[a]:s}}}function Fv(e,t){const r=e.split("/");r.pop();for(const o of t.split("/"))!o||o==="."||(o===".."?r.pop():r.push(o));return r.join("/")}function Vv(e,t){const r=[e,`./${e}`,`${e}.js`,`./${e}.js`,`${e}/index.js`,`./${e}/index.js`];for(const o of r)if(o in t)return o}async function hP(e,t,r){const o={},n=new Set,i={};function a(){if(i.__babylonProxy__)return i.__babylonProxy__;const m=globalThis.BABYLON,f=["const B = globalThis.BABYLON || {};","export default B;"];if(m&&typeof m=="object")for(const g of Object.keys(m))/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(g)&&f.push(`export const ${g} = B[${JSON.stringify(g)}];`);const _=URL.createObjectURL(new Blob([f.join(`
|
|
105
|
+
`)],{type:"text/javascript"}));return i.__babylonProxy__=_,_}function s(m){if(i[m])return i[m];if(m.startsWith("@babylonjs/")){const f=a();return i[m]=f,f}if(r&&m in r)return r[m]}function c(m){return/\.m?jsx?$/i.test(m)}function u(m){return`export default ${JSON.stringify(m)};
|
|
106
|
+
`}function l(m){if(o[m])return o[m];if(!(m in e))throw new Error(`Snippet file "${m}" not found in the file map. Check that the manifest entry and import specifiers reference existing files.`);if(!c(m)){const y=URL.createObjectURL(new Blob([u(e[m])],{type:"text/javascript"}));return o[m]=y,y}if(n.has(m)){const y=URL.createObjectURL(new Blob([e[m]],{type:"text/javascript"}));return o[m]=y,y}n.add(m);const f=(y,b,I,x)=>{const B=Fv(m,I),L=Vv(B,e);if(L){const ue=l(L);return`${b}${ue}${x}`}return`${b}${I}${x}`},_=(y,b,I,x)=>{const B=s(I);return B?`${b}${B}${x}`:`${b}${I}${x}`};let g=e[m];g=g.replace(/((?:from|import)\s*["'])(\.[^"']+)(["'])/g,f).replace(/(import\s*\(\s*["'])(\.[^"']+)(["']\s*\))/g,f),g=g.replace(/((?:from|import)\s*["'])([^"'./][^"']*)(["'])/g,_).replace(/(import\s*\(\s*["'])([^"'./][^"']*)(["']\s*\))/g,_);const v=URL.createObjectURL(new Blob([g],{type:"text/javascript"}));return o[m]=v,n.delete(m),v}l(t);for(const m of Object.keys(e))!o[m]&&c(m)&&l(m);const p=await import(o[t]??Object.values(o)[0]);for(const m of Object.values(o))URL.revokeObjectURL(m);for(const m of Object.values(i))URL.revokeObjectURL(m);return p}function gP(e){let t=e,r=0;const o=[],n=a=>a.split(",").map(s=>s.trim()).filter(Boolean).map(s=>{const c=/^(\w+)\s+as\s+(\w+)$/.exec(s);return c?`${c[1]}: ${c[2]}`:s}).join(", "),i=(a,s)=>{const c=JSON.stringify(s),u=a.trim();if(u.startsWith("{")){const p=u.slice(1,-1);return`const { ${n(p)} } = require(${c});`}const l=/^\*\s+as\s+(\w+)$/.exec(u);if(l)return`const ${l[1]} = require(${c});`;if(u.includes(",")){const[p,m]=u.split(/,(.+)/).map(g=>g.trim()),f=`__mod_${r++}`,_=[`const ${f} = require(${c});`,`const ${p} = (${f} && Object.prototype.hasOwnProperty.call(${f}, "default")) ? ${f}.default : ${f};`];if(m?.startsWith("{")){const g=m.slice(1,-1),v=n(g);_.push(`const { ${v} } = ${f};`)}else{const g=/^\*\s+as\s+(\w+)$/.exec(m??"");g&&_.push(`const ${g[1]} = ${f};`)}return _.join(`
|
|
107
|
+
`)}const d=`__mod_${r++}`;return`const ${d} = require(${c});
|
|
108
|
+
const ${u} = (${d} && Object.prototype.hasOwnProperty.call(${d}, "default")) ? ${d}.default : ${d};`};if(t=t.replace(/^\s*import\s+([^"'\n;]+?)\s+from\s+["']([^"']+)["']\s*;?\s*$/gm,(a,s,c)=>i(s,c)),t=t.replace(/^\s*import\s+["']([^"']+)["']\s*;?\s*$/gm,(a,s)=>`require(${JSON.stringify(s)});`),t=t.replace(/^\s*export\s+\*\s+from\s+["']([^"']+)["']\s*;?\s*$/gm,(a,s)=>`Object.assign(exports, require(${JSON.stringify(s)}));`),t=t.replace(/^\s*export\s*\{([^}]+)\}\s*from\s*["']([^"']+)["']\s*;?\s*$/gm,(a,s,c)=>{const u=`__reexp_${r++}`,l=[`const ${u} = require(${JSON.stringify(c)});`];for(const d of s.split(",")){const p=d.trim();if(!p)continue;const m=/^(\w+)\s+as\s+(\w+)$/.exec(p),f=m?m[1]:p,_=m?m[2]:p;l.push(`exports.${_} = ${u}.${f};`)}return l.join(`
|
|
109
|
+
`)}),t=t.replace(/^\s*export\s*\{([^}]+)\}\s*;?\s*$/gm,(a,s)=>{const c=[];for(const u of s.split(",")){const l=u.trim();if(!l)continue;const d=/^(\w+)\s+as\s+(\w+)$/.exec(l),p=d?d[1]:l,m=d?d[2]:l;m==="default"?c.push(`exports.default = ${p};`):c.push(`exports.${m} = ${p};`)}return c.join(`
|
|
110
|
+
`)}),t=t.replace(/\bimport\s*\(\s*(["'][^"']+["'])\s*\)/g,"Promise.resolve(require($1))"),t=t.replace(/^\s*export\s+default\s+/gm,"exports.default = "),t=t.replace(/^\s*export\s+(async\s+)?function\s+(\w+)/gm,(a,s,c)=>(o.push(c),`${s??""}function ${c}`)),t=t.replace(/^\s*export\s+class\s+(\w+)/gm,(a,s)=>(o.push(s),`class ${s}`)),t=t.replace(/^\s*export\s+(const|let|var)\s+(\w+)/gm,(a,s,c)=>(o.push(c),`${s} ${c}`)),o.length){const a=[...new Set(o)];t+=`
|
|
111
|
+
${a.map(s=>`exports.${s} = ${s};`).join(`
|
|
112
|
+
`)}
|
|
113
|
+
`}return t}function Lv(e,t,r){const o=Object.keys(e).filter(l=>/\.m?jsx?$/i.test(l)),n={},i={};for(const l of o)n[l]=gP(e[l]);const a=l=>{if(i[l])return i[l].exports;if(!/\.m?jsx?$/i.test(l))return i[l]={exports:e[l]},e[l];const d={exports:{}};i[l]=d;const p=f=>{if(f.startsWith(".")||f.startsWith("/")){const _=Fv(l,f),g=Vv(_,e);if(g)return a(g);throw new Error(`Unable to resolve script-mode module "${f}" from "${l}"`)}if(f.startsWith("@babylonjs/"))return globalThis.BABYLON??{};if(r&&f in r)throw new Error(`Script mode cannot execute external import "${f}" (${r[f]}). Use moduleFormat: "esm" or pre-bundle dependencies.`);return globalThis[f]};return new Function("require","exports","module",n[l])(p,d.exports,d),d.exports},s=a(t);for(const l of o)l in i||a(l);const c={...s??{}},u=["createScene","CreateScene","createscene","delayCreateScene","delayLoadScene","DelayCreateScene","createEngine","Playground"];for(const l of u)c[l]===void 0&&typeof globalThis[l]<"u"&&(c[l]=globalThis[l]);return c}function vP(e){let t="";/\bexport\s+default\s+class\s+Playground\b/.test(e)?t="default.CreateScene":/\bexport\s+(const|let|var|function)\s+delayCreateScene\b/.test(e)?t="delayCreateScene":/\bexport\s+(const|let|var|function)\s+delayLoadScene\b/.test(e)?t="delayLoadScene":/\bexport\s+(const|let|var|function)\s+createScene\b/.test(e)?t="createScene":/\bexport\s+(const|let|var|function)\s+CreateScene\b/.test(e)?t="CreateScene":/\bexport\s+(const|let|var|function)\s+createscene\b/.test(e)?t="createscene":/\bexport\s+default\b/.test(e)&&(t="default");const r=/\bexport\s+(const|let|var|function)\s+createEngine\b/.test(e)||/\bexport\s*\{[^}]*\bcreateEngine\b[^}]*\}\s*;?/.test(e);return{sceneFunctionName:t,createEngineFn:r?o=>{}:null,createEngineSource:r?"snippet":"default"}}function qv(e){let t=null,r="";const o=[[()=>e.default?.CreateScene,"default.CreateScene"],[()=>e.default?.DelayCreateScene,"default.DelayCreateScene"],[()=>e.Playground?.CreateScene,"Playground.CreateScene"],[()=>e.Playground?.DelayCreateScene,"Playground.DelayCreateScene"],[()=>typeof e.delayCreateScene=="function"?e.delayCreateScene:null,"delayCreateScene"],[()=>typeof e.delayLoadScene=="function"?e.delayLoadScene:null,"delayLoadScene"],[()=>typeof e.createScene=="function"?e.createScene:null,"createScene"],[()=>typeof e.CreateScene=="function"?e.CreateScene:null,"CreateScene"],[()=>typeof e.createscene=="function"?e.createscene:null,"createscene"],[()=>typeof e.default=="function"?e.default:null,"default"]];for(const[i,a]of o){const s=i();if(s){t=s,r=a;break}}let n=null;return typeof e.createEngine=="function"&&(n=e.createEngine),{createSceneFn:t,sceneFunctionName:r,createEngineFn:n}}function yP(e){return async(t,r)=>{const o=r?.antialias??!0,n=r?.engineOptions??{preserveDrawingBuffer:!0,stencil:!0},i=globalThis.BABYLON;if(!i)throw new Error("BABYLON is not available on globalThis. Ensure Babylon.js is loaded before calling createEngine.");if(e==="WebGPU"&&i.WebGPUEngine){const a=new i.WebGPUEngine(t,{antialias:o,enableAllFeatures:!0,setMaximumLimits:!0,...n});return await a.initAsync(),a}return new i.Engine(t,o,n)}}function _P(e){const t=Object.values(e).join(`
|
|
114
|
+
`);return{havok:/\bHavokPlugin\b/.test(t),ammo:/\bAmmoJSPlugin\b/.test(t),recast:/\bRecastJSPlugin\b/.test(t)}}const uu=(()=>{const e=new Set;return async t=>await new Promise((r,o)=>{if(e.has(t))return r();const n=document.createElement("script");n.src=t,n.async=!0,n.onload=()=>{e.add(t),r()},n.onerror=()=>o(new Error(`Failed to load script: ${t}`)),document.head.appendChild(n)})})();async function $P(e,t){const r=globalThis,o=t?.loadScripts===!0,n=t?.scriptUrls??{},i=(t?.baseUrl??tP).replace(/\/+$/,""),a=s=>n[s]??`${i}/${nP[s]}`;if(e.ammo){if(typeof r.Ammo!="function"&&o)try{await uu(a("ammo"))}catch{}if(typeof r.Ammo=="function")try{await r.Ammo()}catch{}}if(e.recast){if(typeof r.Recast!="function"&&o)try{await uu(a("recast"))}catch{}if(typeof r.Recast=="function")try{await r.Recast()}catch{}}if(e.havok){if(typeof r.HavokPhysics!="function"&&o)try{await uu(a("havok"))}catch{}if(typeof r.HavokPhysics=="function"&&typeof r.HK>"u")try{r.HK=await r.HavokPhysics()}catch{}}}function bP(e,t,r,o,n,i){let a=null,s;const c=e[t]??"",u=vP(c),l=async()=>(s||(r==="esm"?a=await hP(e,t,n):a=Lv(e,t,n),s=qv(a),d=s.createEngineFn?"snippet":"default",p=s.sceneFunctionName),s);let d=u.createEngineSource,p=u.sceneFunctionName;const m=async(_,g)=>{const{createEngineFn:v}=await l();return v?await v(_,g):await yP(o)(_,g)},f=async(_,g)=>{const{createSceneFn:v}=await l();if(!v)throw new Error("No createScene export found in snippet (tried: default.CreateScene, Playground.CreateScene, createScene, delayCreateScene, default).");const y=globalThis,b=y.engine,I=y.canvas,x=y.BABYLON,B=x?.Tools?.BaseUrl,L=x?.Tools?.PreprocessUrl;r==="script"&&(y.engine=_,y.canvas=g);const ue=void 0;try{let me;const Z=await v.bind(new Proxy({},{get(Q,Y){return Y==="scene"?me:Y==="engine"?_:Y==="canvas"?g:globalThis[Y]},set(Q,Y,K){return Y==="scene"?(me=K,!0):(globalThis[Y]=K,!0)}}))(_,g);return Z!=null&&(me=Z),ue?.(),me}finally{r==="script"&&(y.engine=b,y.canvas=I),x?.Tools&&(x.Tools.BaseUrl=B,x.Tools.PreprocessUrl=L)}};return r==="script"&&(a=Lv(e,t,n),s=qv(a),p=s.sceneFunctionName,d=s.createEngineFn?"snippet":"default"),{createEngine:m,createScene:f,getCreateEngineSource:()=>d,getSceneFunctionName:()=>p,initializeMetadataAsync:async()=>{r==="script"&&await l()}}}async function kP(e,t){const r=await rP(e,su);return await SP(r,e,t)}async function SP(e,t,r){const o={name:e.name??"",description:e.description??"",tags:e.tags??""},n=e.jsonPayload??e.payload??"{}";let i;try{i=JSON.parse(n)}catch{return{snippetId:t,type:"unknown",metadata:o,rawPayload:n}}const a=aP(i),s=r?.moduleFormat??"esm";switch(a){case"playground":{const c=fP(i,t,o),u=c.manifest?.entry?.replace(/\.tsx?$/i,".js")??"index.js",l=Object.keys(c.files).some(_=>/\.tsx?$/i.test(_));let d;if(l){const _=(async(g,v)=>await lP(g,v));d=await dP(c.files,_)}else d={...c.files};const p=bP(d,u,s,c.engineType,c.manifest?.imports);await p.initializeMetadataAsync();const m=_P(c.files);return{...c,jsFiles:d,executedCode:d[u]??"",moduleFormat:s,createEngine:p.createEngine,createScene:p.createScene,createEngineSource:p.getCreateEngineSource(),sceneFunctionName:p.getSceneFunctionName(),runtimeFeatures:m,initializeRuntimeAsync:async _=>await $P(m,_)}}case"unknown":return{snippetId:t,type:"unknown",metadata:o,rawPayload:i};default:return sP(i,a,t,o)}}function wP(e,t){return JSON.stringify({payload:e,name:t?.metadata?.name??"",description:t?.metadata?.description??"",tags:t?.metadata?.tags??""})}function IP(e){const t=e.type,r=typeof e.data=="string"?e.data:JSON.stringify(e.data);return JSON.stringify({[t]:r})}function OP(e){const t=e.indexOf("#");return t>=0?e.slice(0,t):e}async function TP(e,t){let r;r=IP(e);const o=wP(r,t),n=(t?.snippetUrl??su).replace(/\/+$/,""),i=t?.snippetId?OP(t.snippetId):"",a=i?`${n}/${i}`:n,s=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:o});if(!s.ok)throw new Error(`Failed to save snippet: ${s.status} ${s.statusText}`);const c=await s.json(),u=c.id,l=String(c.version??"0");let d=u;return l&&l!=="0"&&(d+="#"+l),{snippetId:d,id:u,version:l}}const we=new _i,Le=new HT({serverName:"NME MCP Session Server",documentKind:"node-material",managerUnavailableMessage:"Material manager is not available",getDocument:(e,t)=>e.exportJSON(t.name),setDocument:(e,t,r)=>{const o=e.importJSON(t.name,r);return o&&o!=="OK"?o:void 0}},{defaultPort:3001,legacyDocumentRoutes:["material"],statusTitle:"NME MCP Session Server"});function tn(e){const t=Le.getSessionIdForName(e);t&&Le.notifySessionUpdate(t)}const de=new hT({name:"babylonjs-node-material",version:"1.0.0"},{instructions:["You build Babylon.js Node Materials (shader graphs). Workflow: create_material \u2192 add blocks (InputBlock for attributes/uniforms, then processing blocks, then output blocks) \u2192 connect ports \u2192 validate_material \u2192 export_material_json.","Every material needs at minimum: position attribute \u2192 TransformBlock \u2192 VertexOutputBlock, and a FragmentOutputBlock.","Use get_block_type_info to discover a block's ports before connecting. Enum properties (e.g. TrigonometryBlock.operation) must be set by name (e.g. 'Sin'), not numeric value.","Output JSON can be loaded in the Scene MCP via add_material with type NodeMaterial, or opened in the NME web editor."].join(" ")});de.registerResource("block-catalog","nme://block-catalog",{},async e=>({contents:[{uri:e.href,mimeType:"text/markdown",text:`# NME Block Catalog
|
|
115
|
+
${Nv()}`}]})),de.registerResource("enums","nme://enums",{},async e=>({contents:[{uri:e.href,mimeType:"text/markdown",text:["# NME Enumerations Reference","","## NodeMaterialModes","Material (0), PostProcess (1), Particle (2), ProceduralTexture (3), GaussianSplatting (4), SFE (5)","","## NodeMaterialBlockConnectionPointTypes","Float (1), Int (2), Vector2 (4), Vector3 (8), Vector4 (16), Color3 (32), Color4 (64), Matrix (128), Object (256), AutoDetect (1073741824)","","## NodeMaterialSystemValues (for InputBlock)","World (1), View (2), Projection (3), ViewProjection (4), WorldView (5), WorldViewProjection (6), CameraPosition (7), FogColor (8), DeltaTime (9), CameraParameters (10), MaterialAlpha (11)","","## Common Attributes (for InputBlock)","position, normal, tangent, uv, uv2, uv3, uv4, uv5, uv6, color, matricesIndices, matricesWeights","","## TrigonometryBlockOperations","Cos, Sin, Abs, Exp, Exp2, Round, Floor, Ceiling, Sqrt, Log, Tan, ArcTan, ArcCos, ArcSin, Fract, Sign, Radians, Degrees","","## ConditionalBlockConditions","Equal, NotEqual, LessThan, GreaterThan, LessOrEqual, GreaterOrEqual, Xor, Or, And"].join(`
|
|
116
|
+
`)}]})),de.registerResource("concepts","nme://concepts",{},async e=>({contents:[{uri:e.href,mimeType:"text/markdown",text:["# Node Material Concepts","","## What is a Node Material?","A Node Material is a visual, graph-based shader builder in Babylon.js. Instead of writing","GLSL/HLSL code directly, you connect typed blocks that represent shader operations.","The graph compiles into a GPU shader program at runtime.","","## Graph Structure \u2014 Two Required Outputs","Every standard material (mode='Material') MUST have exactly these two output blocks:"," \u2022 **VertexOutputBlock** \u2014 receives the clip-space position (the final transformed vertex position)"," \u2022 **FragmentOutputBlock** \u2014 receives the final pixel color (rgb and/or rgba)","Without BOTH, the material will fail to compile.","","## InputBlock \u2014 The Most Important Block Type","InputBlock is the source of all data entering the graph. It has three modes:","","### Mode 1: Attribute (mode=1)","Reads per-vertex data from the mesh's vertex buffer."," \u2022 Set `attributeName` to one of: position, normal, tangent, uv, uv2, color, etc."," \u2022 Set `type` to the matching type: Vector3 for position/normal, Vector2 for uv, etc."," \u2022 Example: `{ type: 'Vector3', attributeName: 'position' }`","","### Mode 2: Uniform / Constant (mode=0)","Provides a constant or system-provided value."," \u2022 For **system values**: set `systemValue` (e.g. 'WorldViewProjection', 'World', 'CameraPosition')"," and set `type` to the matching type (Matrix for transforms, Vector3 for CameraPosition)."," Example: `{ type: 'Matrix', systemValue: 'WorldViewProjection' }`"," \u2022 For **custom constants**: set `type` and `value`."," Example: `{ type: 'Color3', value: { r: 0.8, g: 0.2, b: 0.2 } }`"," Example: `{ type: 'Float', value: 0.5 }`","","### \u26A0 InputBlock Gotcha","An InputBlock MUST have a `type` property. Without it, the block cannot determine","what kind of data it provides and connections will fail silently.","Additionally, every InputBlock needs at least one of:"," \u2022 `attributeName` \u2014 for mesh vertex data"," \u2022 `systemValue` \u2014 for engine-provided values (matrices, camera pos, etc.)"," \u2022 `value` \u2014 for custom constant values","An InputBlock with none of these is effectively useless.","","## The Minimal Vertex Pipeline","Every material needs to transform vertex positions from object space to clip space:","```","InputBlock(position, attribute, Vector3)"," \u2514\u2192 TransformBlock.vector","InputBlock(worldViewProjection, systemValue, Matrix)"," \u2514\u2192 TransformBlock.transform","TransformBlock.output"," \u2514\u2192 VertexOutputBlock.vector","```","This is the minimum vertex shader \u2014 it positions the mesh correctly on screen.","","## The Minimal Fragment Pipeline","At minimum, the fragment output needs an rgb (Color3) or rgba (Color4) color:","```","InputBlock(color, constant, Color3, value={r:1,g:0,b:0})"," \u2514\u2192 FragmentOutputBlock.rgb","```","","## PBR Materials \u2014 Additional Requirements","PBRMetallicRoughnessBlock needs several inputs connected:"," \u2022 **worldPosition** \u2014 from TransformBlock(position \xD7 world matrix), NOT the clip-space position"," \u2022 **worldNormal** \u2014 from TransformBlock(normal \xD7 world matrix)"," \u2022 **view** \u2014 from InputBlock(systemValue: 'View')"," \u2022 **cameraPosition** \u2014 from InputBlock(systemValue: 'CameraPosition')"," \u2022 **baseColor** \u2014 Color3 input for the material's base color"," \u2022 **metallic** \u2014 Float input (0=dielectric, 1=metal)"," \u2022 **roughness** \u2014 Float input (0=smooth/mirror, 1=rough/matte)","Then connect PBRMetallicRoughnessBlock.lighting \u2192 FragmentOutputBlock.rgb","","## Connection Rules","\u2022 Connections go from an output of one block to an input of another","\u2022 Types must be compatible (Color3\u2192Color3, Float\u2192Float, etc.)","\u2022 Some inputs accept AutoDetect and will adapt to whatever is connected","\u2022 Use describe_block or get_block_type_info to see available inputs/outputs","","## Common Mistakes","1. Forgetting VertexOutputBlock or FragmentOutputBlock \u2192 material won't compile","2. Creating InputBlock without `type` \u2192 block is broken","3. Creating InputBlock without value/systemValue/attributeName \u2192 useless block","4. Connecting position directly to VertexOutput without TransformBlock \u2192 mesh renders at origin","5. Using the wrong transform matrix (World instead of WorldViewProjection for vertex output)","6. Not connecting worldPosition/worldNormal/view/cameraPosition to PBR block \u2192 black material"].join(`
|
|
117
|
+
`)}]})),de.registerPrompt("create-pbr-material",{description:"Step-by-step instructions for building a basic PBR material"},()=>({messages:[{role:"user",content:{type:"text",text:["Create a basic PBR metallic-roughness material. Steps:","1. create_material with name 'MyPBR', mode 'Material'","2. Add InputBlock for 'position' attribute (type Vector3, attributeName 'position')","3. Add InputBlock for 'normal' attribute (type Vector3, attributeName 'normal')","4. Add InputBlock for 'worldViewProjection' system value (type Matrix, systemValue 'WorldViewProjection')","5. Add InputBlock for 'world' system value (type Matrix, systemValue 'World')","6. Add InputBlock for 'view' system value (type Matrix, systemValue 'View')","7. Add InputBlock for 'cameraPosition' system value (type Vector3, systemValue 'CameraPosition')","8. Add TransformBlock named 'worldPos' \u2014 connect world \u2192 transform, position \u2192 vector","9. Add TransformBlock named 'clipPos' \u2014 connect worldViewProjection \u2192 transform, position \u2192 vector","10. Add VertexOutputBlock \u2014 connect clipPos.output \u2192 vector","11. Add PBRMetallicRoughnessBlock \u2014 connect worldPos output \u2192 worldPosition, normal \u2192 worldNormal, etc.","12. Add InputBlock for baseColor (type Color3, value {r:0.8, g:0.2, b:0.2})","13. Add InputBlock for metallic (type Float, value 0.0)","14. Add InputBlock for roughness (type Float, value 0.5)","15. Connect baseColor, metallic, roughness to the PBR block","16. Add FragmentOutputBlock \u2014 connect PBR.lighting \u2192 rgb","17. validate_material, then export_material_json"].join(`
|
|
118
|
+
`)}}]})),de.registerPrompt("create-simple-color-material",{description:"Create the simplest possible unlit colored material"},()=>({messages:[{role:"user",content:{type:"text",text:["Create the simplest unlit material that outputs a solid color. Steps:","1. create_material 'SimpleColor'","2. Add InputBlock type Vector3, attributeName 'position', name 'position'","3. Add InputBlock type Matrix, systemValue 'WorldViewProjection', name 'wvp'","4. Add TransformBlock name 'transform' \u2014 connect wvp\u2192transform, position\u2192vector","5. Add VertexOutputBlock \u2014 connect transform.output\u2192vector","6. Add InputBlock type Color3, value {r:1, g:0, b:0}, name 'color'","7. Add FragmentOutputBlock \u2014 connect color.output\u2192rgb","8. validate_material, then export_material_json"].join(`
|
|
119
|
+
`)}}]})),de.registerPrompt("create-textured-material",{description:"Create a PBR material that samples a diffuse texture using UV coordinates"},()=>({messages:[{role:"user",content:{type:"text",text:["Create a PBR material with a diffuse texture. Steps:","1. create_material 'TexturedPBR'","2. Add InputBlock type Vector3, attributeName 'position', name 'position'","3. Add InputBlock type Matrix, systemValue 'WorldViewProjection', name 'wvp'","4. Add InputBlock type Matrix, systemValue 'World', name 'world'","5. Add InputBlock type Matrix, systemValue 'View', name 'view'","6. Add InputBlock type Vector3, systemValue 'CameraPosition', name 'cameraPosition'","7. Add InputBlock type Vector3, attributeName 'normal', name 'normal'","8. Add InputBlock type Vector2, attributeName 'uv', name 'uv'","9. Add TransformBlock 'worldPos' \u2014 connect world\u2192transform, position\u2192vector","10. Add TransformBlock 'clipPos' \u2014 connect wvp\u2192transform, position\u2192vector","11. Add VertexOutputBlock \u2014 connect clipPos.output\u2192vector","12. Add TextureBlock 'diffuseTex'","13. set_block_properties on diffuseTex: { texture: 'https://playground.babylonjs.com/textures/floor.png' }"," (A bare URL string is auto-converted to a full texture descriptor on export)","14. Connect uv.output \u2192 diffuseTex.uv","15. Add PBRMetallicRoughnessBlock 'pbr'","16. Connect worldPos.output\u2192pbr.worldPosition, normal\u2192pbr.worldNormal, view\u2192pbr.view, cameraPosition\u2192pbr.cameraPosition","17. Connect diffuseTex.rgb \u2192 pbr.baseColor","18. Add InputBlock type Float, value 0.0, name 'metallic' \u2192 pbr.metallic","19. Add InputBlock type Float, value 0.5, name 'roughness' \u2192 pbr.roughness","20. Add FragmentOutputBlock \u2014 connect pbr.lighting\u2192rgb","21. validate_material, then export_material_json"].join(`
|
|
120
|
+
`)}}]})),de.registerTool("create_material",{description:"Create a new empty Node Material graph in memory. This is always the first step.",inputSchema:{name:k().describe("Unique name for the material (e.g. 'MyPBR', 'GlowEffect')"),mode:Re(["Material","PostProcess","Particle","ProceduralTexture","GaussianSplatting","SFE"]).default("Material").describe("The material mode. Use 'Material' for standard mesh materials."),comment:k().optional().describe("An optional description of what this material does")}},async({name:e,mode:t,comment:r})=>{we.createMaterial(e,t,r);const o=await Le.startAsync(we),n=Le.createSession(e),i=Le.getSessionUrl(n,o);return{content:[{type:"text",text:`Created material "${e}" (mode: ${t}). Now add blocks with add_block, connect them with connect_blocks, then export with export_material_json.
|
|
121
|
+
|
|
122
|
+
MCP Session URL: ${i}
|
|
123
|
+
Paste this URL in the Node Material Editor's "Connect to MCP Session" panel to see live updates.`}]}}),de.registerTool("get_session_url",{description:"Get or create a live-session URL for a material. The URL can be pasted into the Node Material Editor's 'Connect to MCP Session' panel.",inputSchema:{materialName:k().describe("Name of the material")}},async({materialName:e})=>{if(!we.listMaterials().includes(e))return{content:[{type:"text",text:`Material "${e}" not found.`}],isError:!0};const r=await Le.startAsync(we),o=Le.createSession(e);return{content:[{type:"text",text:`MCP Session URL: ${Le.getSessionUrl(o,r)}
|
|
124
|
+
Paste this URL in the Node Material Editor's "Connect to MCP Session" panel to see live updates.`}]}}),de.registerTool("start_session",{description:"Start a live session for an existing material. Returns a URL that can be pasted into the Node Material Editor. If a session already exists for this material, returns the existing URL.",inputSchema:{materialName:k().describe("Name of the material")}},async({materialName:e})=>{if(!we.listMaterials().includes(e))return{content:[{type:"text",text:`Material "${e}" not found.`}],isError:!0};const r=await Le.startAsync(we),o=Le.createSession(e);return{content:[{type:"text",text:`MCP Session URL: ${Le.getSessionUrl(o,r)}
|
|
125
|
+
Paste this URL in the Node Material Editor's "Connect to MCP Session" panel to see live updates.`}]}}),de.registerTool("close_session",{description:"Close a live session for a material. Disconnects all SSE subscribers in the editor and removes the session. The material itself is NOT deleted.",inputSchema:{materialName:k().describe("Name of the material whose session to close")}},async({materialName:e})=>Le.closeSessionForName(e)?{content:[{type:"text",text:`Session for "${e}" closed. The editor will disconnect.`}]}:{content:[{type:"text",text:`No active session for "${e}".`}]}),de.registerTool("stop_session_server",{description:"Stop the live MCP editor session server started by this MCP process. This closes all active sessions, disconnects editors, and releases the port."},async()=>(await Le.stopAsync(),xn("MCP session server stopped. Any connected editors have been disconnected."))),de.registerTool("delete_material",{description:"Delete a material graph from memory. Also closes any active session for it.",inputSchema:{name:k().describe("Name of the material to delete")}},async({name:e})=>(Le.closeSessionForName(e),{content:[{type:"text",text:we.deleteMaterial(e)?`Deleted "${e}".`:`Material "${e}" not found.`}]})),de.registerTool("clear_all",{description:"Remove all material graphs from memory, resetting the server to a clean state. Also closes all active sessions."},async()=>{const e=we.listMaterials();for(const t of e)Le.closeSessionForName(t);return we.clearAll(),{content:[{type:"text",text:e.length>0?`Cleared ${e.length} material(s): ${e.join(", ")}`:"Nothing to clear \u2014 memory was already empty."}]}}),de.registerTool("list_materials",{description:"List all material graphs currently in memory."},async()=>{const e=we.listMaterials();return{content:[{type:"text",text:e.length>0?`Materials in memory:
|
|
126
|
+
${e.map(t=>` \u2022 ${t}`).join(`
|
|
127
|
+
`)}`:"No materials in memory."}]}}),de.registerTool("add_block",{description:"Add a new block to a material graph. Returns the block's id for use in connect_blocks.",inputSchema:{materialName:k().describe("Name of the material to add the block to"),blockType:k().describe("The block type from the registry (e.g. 'InputBlock', 'MultiplyBlock', 'PBRMetallicRoughnessBlock', 'TransformBlock', etc.). Use list_block_types to see all."),name:k().optional().describe("Human-friendly name for this block instance (e.g. 'myColor', 'worldMatrix')"),properties:fe(k(),ge()).optional().describe("Key-value properties to set on the block. For InputBlock: type (Float/Vector2/Vector3/Vector4/Color3/Color4/Matrix), value (the constant value), systemValue (World/View/Projection/etc.), attributeName (position/normal/uv/etc.), isConstant (boolean), animationType (None/Time), min/max (number). For TrigonometryBlock: operation (Cos/Sin/Abs/etc.). For ConditionalBlock: condition (Equal/LessThan/etc.).")}},async({materialName:e,blockType:t,name:r,properties:o})=>{const n=we.addBlock(e,t,r,o);if(typeof n=="string")return{content:[{type:"text",text:`Error: ${n}`}],isError:!0};const i=[`Added block [${n.block.id}] "${n.block.name}" (${t}). Use this id (${n.block.id}) to connect it.`];return n.warnings&&i.push("","Warnings:",...n.warnings),tn(e),{content:[{type:"text",text:i.join(`
|
|
128
|
+
`)}]}}),de.registerTool("remove_block",{description:"Remove a block from a material graph by its numeric block id. Also removes any connections to/from it. Use describe_material to find valid block ids.",inputSchema:{materialName:k().describe("Name of the material"),blockId:ie().describe("The block id to remove")}},async({materialName:e,blockId:t})=>{const r=we.removeBlock(e,t);return r==="OK"&&tn(e),{content:[{type:"text",text:r==="OK"?`Removed block ${t}.`:`Error: ${r}`}],isError:r!=="OK"}}),de.registerTool("set_block_properties",{description:"Set or update properties on an existing block. Use get_block_type_info to see available properties for the block's type. Common: for InputBlock set 'value', 'type', 'systemValue'; for TrigonometryBlock set 'operation'; for ConditionalBlock set 'condition'.",inputSchema:{materialName:k().describe("Name of the material"),blockId:ie().describe("The block id to modify"),properties:fe(k(),ge()).describe("Key-value properties to set. Use get_block_type_info to discover valid keys for a given block type.")}},async({materialName:e,blockId:t,properties:r})=>{const o=we.setBlockProperties(e,t,r);return o==="OK"&&tn(e),{content:[{type:"text",text:o==="OK"?`Updated block ${t}.`:`Error: ${o}`}],isError:o!=="OK"}}),de.registerTool("connect_blocks",{description:"Connect an output of one block to an input of another block. Data flows from source output \u2192 target input.",inputSchema:{materialName:k().describe("Name of the material"),sourceBlockId:ie().describe("Block id to connect FROM (the one with the output)"),outputName:k().describe("Name of the output on the source block (e.g. 'output', 'rgb', 'xyz')"),targetBlockId:ie().describe("Block id to connect TO (the one with the input)"),inputName:k().describe("Name of the input on the target block (e.g. 'vector', 'left', 'color')")}},async({materialName:e,sourceBlockId:t,outputName:r,targetBlockId:o,inputName:n})=>{const i=we.connectBlocks(e,t,r,o,n),a=i.startsWith("OK");return a&&tn(e),{content:[{type:"text",text:a?`Connected [${t}].${r} \u2192 [${o}].${n}${i==="OK"?"":`. ${i.slice(3)}`}`:`Error: ${i}`}],isError:!a}}),de.registerTool("disconnect_input",{description:"Disconnect an input on a block (remove the incoming connection). Use describe_block to find connected input names.",inputSchema:{materialName:k().describe("Name of the material"),blockId:ie().describe("The block id whose input to disconnect"),inputName:k().describe("Name of the input to disconnect")}},async({materialName:e,blockId:t,inputName:r})=>{const o=we.disconnectInput(e,t,r);return o==="OK"&&tn(e),{content:[{type:"text",text:o==="OK"?`Disconnected [${t}].${r}`:`Error: ${o}`}],isError:o!=="OK"}}),de.registerTool("describe_material",{description:"Get a human-readable description of the current state of a material graph, including all blocks and their connections.",inputSchema:{materialName:k().describe("Name of the material to describe")}},async({materialName:e})=>({content:[{type:"text",text:we.describeMaterial(e)}]})),de.registerTool("describe_block",{description:"Get detailed information about a specific block instance in a material, including its connections and properties.",inputSchema:{materialName:k().describe("Name of the material"),blockId:ie().describe("The block id to describe")}},async({materialName:e,blockId:t})=>({content:[{type:"text",text:we.describeBlock(e,t)}]})),de.registerTool("list_block_types",{description:"List all available NME block types, grouped by category. Use this to discover which blocks you can add.",inputSchema:{category:k().optional().describe("Optionally filter by category (Input, Math, Vector, Color, Texture, PBR, Output, etc.)")}},async({category:e})=>{if(e){const t=Object.entries(Pn).filter(([,r])=>r.category.toLowerCase()===e.toLowerCase()).map(([r,o])=>` ${r}: ${o.description.split(".")[0]}`).join(`
|
|
129
|
+
`);return{content:[{type:"text",text:t.length>0?`## ${e} Blocks
|
|
130
|
+
${t}`:`No blocks found in category "${e}".`}]}}return{content:[{type:"text",text:Nv()}]}}),de.registerTool("get_block_type_info",{description:"Get detailed info about a specific block type \u2014 its inputs, outputs, properties, and description.",inputSchema:{blockType:k().describe("The block type name (e.g. 'PBRMetallicRoughnessBlock', 'InputBlock')")}},async({blockType:e})=>{const t=kT(e);if(!t)return{content:[{type:"text",text:`Block type "${e}" not found. Use list_block_types to see available types.`}],isError:!0};const r=[];r.push(`## ${e}`),r.push(`Category: ${t.category}`),r.push(`Target: ${t.target}`),r.push(`Description: ${t.description}`),r.push(`
|
|
131
|
+
### Inputs:`),t.inputs.length===0&&r.push(" (none)");for(const o of t.inputs){const n=o.isOptional?" (optional)":" (required)";r.push(` \u2022 ${o.name}: ${o.type}${n}`)}r.push(`
|
|
132
|
+
### Outputs:`),t.outputs.length===0&&r.push(" (none)");for(const o of t.outputs)r.push(` \u2022 ${o.name}: ${o.type}`);if(t.properties){r.push(`
|
|
133
|
+
### Configurable Properties:`);for(const[o,n]of Object.entries(t.properties))r.push(` \u2022 ${o}: ${n}`)}return{content:[{type:"text",text:r.join(`
|
|
134
|
+
`)}]}}),de.registerTool("validate_material",{description:"Run validation checks on a material graph. Reports missing outputs, unconnected required inputs, and broken references.",inputSchema:{materialName:k().describe("Name of the material to validate")}},async({materialName:e})=>{const t=we.validateMaterial(e);return{content:[{type:"text",text:t.join(`
|
|
135
|
+
`)}],isError:t.some(r=>r.startsWith("ERROR"))}}),de.registerTool("export_material_json",{description:"Export the material graph as NME-compatible JSON. This JSON can be loaded in the Babylon.js Node Material Editor or via NodeMaterial.Parse() at runtime. When outputFile is provided, the JSON is written to disk and only the file path is returned (avoids large JSON payloads in the conversation context).",inputSchema:{materialName:k().describe("Name of the material to export"),outputFile:ET(Ao)}},async({materialName:e,outputFile:t})=>TT({jsonText:we.exportJSON(e),outputFile:t,missingMessage:`Material "${e}" not found.`,fileLabel:"NME JSON"})),de.registerTool("import_material_json",{description:"Import an existing NME JSON into memory for editing. You can then modify blocks, connections, etc. Provide either the inline json string OR a jsonFile path (not both).",inputSchema:{materialName:k().describe("Name to give the imported material"),json:zT(Ao,"The NME JSON string to import"),jsonFile:jT(Ao,"Absolute path to a file containing the NME JSON to import (alternative to inline json)")}},async({materialName:e,json:t,jsonFile:r})=>PT({json:t,jsonFile:r,fileDescription:"NME JSON file",importJson:o=>we.importJSON(e,o),describeImported:()=>we.describeMaterial(e)})),de.registerTool("import_from_snippet",{description:'Import a Node Material from the Babylon.js Snippet Server by its snippet ID. The snippet is fetched, validated as a nodeMaterial type, and loaded into memory for editing. Snippet IDs look like "ABC123" or "ABC123#2" (with revision).',inputSchema:{materialName:k().describe("Name to give the imported material in memory"),snippetId:DT(Ao)}},async({materialName:e,snippetId:t})=>await NT({snippetId:t,loadSnippet:async r=>await kP(r),createResponse:r=>xT({snippetId:t,snippetResult:r,expectedType:"nodeMaterial",importJson:o=>we.importJSON(e,o),describeImported:()=>we.describeMaterial(e),successMessage:`Imported snippet "${t}" as "${e}" successfully.`})})),de.registerTool("get_snippet_url",{description:"Export the material JSON and provide instructions for loading it in the Babylon.js Node Material Editor. Optionally writes the JSON to a file. The user can then load it via the NME editor's 'Load' button, or use NodeMaterial.Parse() at runtime.",inputSchema:{materialName:k().describe("Name of the material"),outputFile:k().optional().describe("Optional absolute file path to write the JSON to. If not provided, instructions are returned with inline JSON.")}},async({materialName:e,outputFile:t})=>{const r=we.exportJSON(e);if(!r)return{content:[{type:"text",text:`Material "${e}" not found.`}],isError:!0};const o=[];if(o.push(`## How to load this material in the Node Material Editor
|
|
136
|
+
`),o.push("1. Open https://nme.babylonjs.com"),o.push("2. Click the hamburger menu (\u2630) \u2192 'Load'"),o.push(`3. Select the exported JSON file or paste the JSON content
|
|
137
|
+
`),t)try{pu(hu(t),{recursive:!0}),fu(t,r,"utf-8"),o.push(`JSON written to: ${t}`)}catch(n){return{content:[{type:"text",text:`Error writing file: ${n.message}`}],isError:!0}}else o.push("Use export_material_json with an outputFile to save to disk for easier loading.");return{content:[{type:"text",text:o.join(`
|
|
138
|
+
`)}]}}),de.registerTool("add_blocks_batch",{description:"Add multiple blocks at once (processed sequentially, so earlier blocks exist before later ones). More efficient than calling add_block repeatedly. Returns all created block ids. If one block fails, the rest still proceed.",inputSchema:{materialName:k().describe("Name of the material"),blocks:ae(U({blockType:k().describe("Block type name"),blockName:k().optional().describe("Instance name for the block"),name:k().optional().describe("Instance name (alias for blockName)"),properties:fe(k(),ge()).optional().describe("Block properties")})).describe("Array of blocks to add")}},async({materialName:e,blocks:t})=>{const r=[];for(const o of t){const n=o.blockName??o.name,i=we.addBlock(e,o.blockType,n,o.properties);if(typeof i=="string")r.push(`Error adding ${o.blockType}: ${i}`);else{let a=`[${i.block.id}] ${i.block.name} (${o.blockType})`;i.warnings&&(a+=`
|
|
139
|
+
\u26A0 ${i.warnings.join(`
|
|
140
|
+
\u26A0 `)}`),r.push(a)}}return tn(e),{content:[{type:"text",text:`Added blocks:
|
|
141
|
+
${r.join(`
|
|
142
|
+
`)}`}]}}),de.registerTool("connect_blocks_batch",{description:"Connect multiple block pairs at once (processed sequentially). More efficient than calling connect_blocks repeatedly. If one connection fails, the rest still proceed.",inputSchema:{materialName:k().describe("Name of the material"),connections:ae(U({sourceBlockId:ie().describe("Block id to connect FROM (the one with the output)"),outputName:k().describe("Name of the output on the source block (e.g. 'output', 'rgb', 'xyz')"),targetBlockId:ie().describe("Block id to connect TO (the one with the input)"),inputName:k().describe("Name of the input on the target block (e.g. 'vector', 'left', 'color')")})).describe("Array of connections to make")}},async({materialName:e,connections:t})=>{const r=[];let o=!1;for(const n of t){const i=we.connectBlocks(e,n.sourceBlockId,n.outputName,n.targetBlockId,n.inputName);if(i.startsWith("OK")){const a=i==="OK"?"":` ${i.slice(3)}`;r.push(`[${n.sourceBlockId}].${n.outputName} \u2192 [${n.targetBlockId}].${n.inputName}${a}`)}else o=!0,r.push(`Error ([${n.sourceBlockId}].${n.outputName} \u2192 [${n.targetBlockId}].${n.inputName}): ${i}`)}return tn(e),{content:[{type:"text",text:`Connections:
|
|
143
|
+
${r.join(`
|
|
144
|
+
`)}`}],isError:o}}),de.registerTool("save_snippet",{description:"Save the material to the Babylon.js Snippet Server and return the snippet ID and version. The snippet can later be loaded in the Node Material Editor via its snippet ID, or fetched with import_from_snippet. To create a new revision of an existing snippet, pass the previous snippetId.",inputSchema:{materialName:k().describe("Name of the material to save"),snippetId:k().optional().describe('Optional existing snippet ID to create a new revision of (e.g. "ABC123" or "ABC123#1")'),name:k().optional().describe("Optional human-readable title for the snippet"),description:k().optional().describe("Optional description"),tags:k().optional().describe("Optional comma-separated tags")}},async({materialName:e,snippetId:t,name:r,description:o,tags:n})=>{const i=we.exportJSON(e);if(!i)return{content:[{type:"text",text:`Material "${e}" not found.`}],isError:!0};try{const a=await TP({type:"nodeMaterial",data:Ev({jsonText:i,jsonLabel:"NME JSON"})},{snippetId:t,metadata:{name:r,description:o,tags:n}});return xn(`Saved material "${e}" to snippet server.
|
|
145
|
+
|
|
146
|
+
Snippet ID: ${a.id}
|
|
147
|
+
Version: ${a.version}
|
|
148
|
+
Full ID: ${a.snippetId}
|
|
149
|
+
|
|
150
|
+
Load in NME editor: https://nme.babylonjs.com/#${a.snippetId}`)}catch(a){return Nt(`Error saving snippet: ${a.message}`)}});async function PP(){const e=new bT;await de.connect(e),console.error("Babylon.js Node Material Editor MCP Server running on stdio")}try{await PP()}catch(e){console.error("Fatal error:",e),process.exit(1)}const Jv=()=>{Le.stopAsync(),process.exit(0)};process.on("SIGINT",Jv),process.on("SIGTERM",Jv);
|
|
151
|
+
//# sourceMappingURL=nme-mcp-server.js.map
|