@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,145 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import ou from"node:process";import*as $i from"node:crypto";import*as Rv from"node:http";import{dirname as Dv}from"node:path";import{mkdirSync as Av,writeFileSync as Cv,readFileSync as Uv}from"node:fs";var iu;const au=Object.freeze({status:"aborted"});function b(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 m=l[d];m in s||(s[m]=u[m].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 su=Symbol("zod_brand");class Mt extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Tr extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(iu=globalThis).__zod_globalConfig??(iu.__zod_globalConfig={});const zn=globalThis.__zod_globalConfig;function De(e){return e&&Object.assign(zn,e),zn}function Zv(e){return e}function Mv(e){return e}function Bv(e){}function Lv(e){throw new Error("Unexpected value in exhaustive check")}function Fv(e){}function bi(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 R(e,t="|"){return e.map(r=>H(r)).join(t)}function Nr(e,t){return typeof t=="bigint"?t.toString():t}function jn(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Bt(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 cu(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 uu=Symbol("evaluating");function ie(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==uu)return o===void 0&&(o=uu,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Gv(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Tt(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function $t(...e){const t={};for(const r of e){const o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function qv(e){return $t(e._zod.def)}function Jv(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function Vv(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 Hv(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 ki(e){return JSON.stringify(e)}function lu(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Si="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function rn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const du=jn(()=>{if(zn.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Lt(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 Lt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function Kv(e){let t=0;for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}const Wv=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}`)}},Er=new Set(["string","number","symbol"]),pu=new Set(["string","number","bigint","boolean","symbol","undefined"]);function wt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ye(e,t,r){const o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function z(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 Xv(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 H(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function mu(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const fu={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]},hu={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function gu(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=$t(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 Tt(this,"shape",a),a},checks:[]});return Ye(e,i)}function vu(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=$t(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 Tt(this,"shape",a),a},checks:[]});return Ye(e,i)}function yu(e,t){if(!Lt(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=$t(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return Tt(this,"shape",i),i}});return Ye(e,n)}function _u(e,t){if(!Lt(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r=$t(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return Tt(this,"shape",o),o}});return Ye(e,r)}function $u(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=$t(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t._zod.def.shape};return Tt(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Ye(e,r)}function bu(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=$t(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 Tt(this,"shape",c),c},checks:[]});return Ye(t,a)}function ku(e,t,r){const o=$t(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 Tt(this,"shape",i),i}});return Ye(t,o)}function Ft(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 Su(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 at(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function En(e){return typeof e=="string"?e:e?.message}function Qe(e,t,r){const o=e.message?e.message:En(e.inst?._zod.def?.error?.(e))??En(t?.error?.(e))??En(r.customError?.(e))??En(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 Rr(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Dr(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Y(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 Yv(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function wu(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 Iu(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function Qv(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return wu(t+r)}function ey(e){return Iu(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function ty(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 ny(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}class ry{constructor(...t){}}var Pu=Object.freeze({__proto__:null,BIGINT_FORMAT_RANGES:hu,Class:ry,NUMBER_FORMAT_RANGES:fu,aborted:Ft,allowsEval:du,assert:Fv,assertEqual:Zv,assertIs:Bv,assertNever:Lv,assertNotEqual:Mv,assignProp:Tt,base64ToUint8Array:wu,base64urlToUint8Array:Qv,cached:jn,captureStackTrace:Si,cleanEnum:Yv,cleanRegex:zr,clone:Ye,cloneDef:qv,createTransparentProxy:Xv,defineLazy:ie,esc:ki,escapeRegex:wt,explicitlyAborted:Su,extend:yu,finalizeIssue:Qe,floatSafeRemainder:cu,getElementAtPath:Jv,getEnumValues:bi,getLengthableOrigin:Dr,getParsedType:Wv,getSizableOrigin:Rr,hexToUint8Array:ty,isObject:rn,isPlainObject:Lt,issue:on,joinValues:R,jsonStringifyReplacer:Nr,merge:$u,mergeDefs:$t,normalizeParams:z,nullish:Bt,numKeys:Kv,objectClone:Gv,omit:vu,optionalKeys:mu,parsedType:Y,partial:bu,pick:gu,prefixIssues:at,primitiveTypes:pu,promiseAllObject:Vv,propertyKeyTypes:Er,randomString:Hv,required:ku,safeExtend:_u,shallowClone:jr,slugify:lu,stringifyPrimitive:H,uint8ArrayToBase64:Iu,uint8ArrayToBase64url:ey,uint8ArrayToHex:ny,unwrapMessage:En});const xu=(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,Nr,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},wi=b("$ZodError",xu),et=b("$ZodError",xu,{Parent:Error});function Ii(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 Pi(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 Ou(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 m=u[d],p=d===u.length-1;typeof m=="string"?(l.properties??(l.properties={}),(a=l.properties)[m]??(a[m]={errors:[]}),l=l.properties[m]):(l.items??(l.items=[]),(s=l.items)[m]??(s[m]={errors:[]}),l=l.items[m]),p&&l.errors.push(t(c)),d++}}};return o(e),r}function Tu(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 Nu(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 ${Tu(o.path)}`);return t.join(`
|
|
3
|
+
`)}const Rn=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 Mt;if(a.issues.length){const s=new(n?.Err??e)(a.issues.map(c=>Qe(c,i,De())));throw Si(s,n?.callee),s}return a.value},Ar=Rn(et),Dn=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=>Qe(c,i,De())));throw Si(s,n?.callee),s}return a.value},Cr=Dn(et),An=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 Mt;return i.issues.length?{success:!1,error:new(e??wi)(i.issues.map(a=>Qe(a,n,De())))}:{success:!0,data:i.value}},Ur=An(et),Cn=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=>Qe(a,n,De())))}:{success:!0,data:i.value}},Zr=Cn(et),xi=e=>(t,r,o)=>{const n=o?{...o,direction:"backward"}:{direction:"backward"};return Rn(e)(t,r,n)},oy=xi(et),Oi=e=>(t,r,o)=>Rn(e)(t,r,o),iy=Oi(et),Ti=e=>async(t,r,o)=>{const n=o?{...o,direction:"backward"}:{direction:"backward"};return Dn(e)(t,r,n)},ay=Ti(et),Ni=e=>async(t,r,o)=>Dn(e)(t,r,o),sy=Ni(et),zi=e=>(t,r,o)=>{const n=o?{...o,direction:"backward"}:{direction:"backward"};return An(e)(t,r,n)},cy=zi(et),ji=e=>(t,r,o)=>An(e)(t,r,o),uy=ji(et),Ei=e=>async(t,r,o)=>{const n=o?{...o,direction:"backward"}:{direction:"backward"};return Cn(e)(t,r,n)},ly=Ei(et),Ri=e=>async(t,r,o)=>Cn(e)(t,r,o),dy=Ri(et),zu=/^[cC][0-9a-z]{6,}$/,ju=/^[0-9a-z]+$/,Eu=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ru=/^[0-9a-vA-V]{20}$/,Du=/^[A-Za-z0-9]{27}$/,Au=/^[a-zA-Z0-9_-]{21}$/,Cu=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,py=/^[-+]?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)?)??$/,Uu=/^([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)$/,my=an(4),fy=an(6),hy=an(7),Zu=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,gy=/^[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])?)*$/,vy=/^(([^<>()\[\]\\.,;:\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,}))$/,Mu=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,yy=Mu,_y=/^[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])?)*$/,$y="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Bu(){return new RegExp($y,"u")}const Lu=/^(?:(?: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])$/,Fu=/^(([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}|:))$/,Gu=e=>{const t=wt(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},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])\/([0-9]|[1-2][0-9]|3[0-2])$/,Ju=/^(([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])$/,Vu=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Di=/^[A-Za-z0-9_-]*$/,Hu=/^(?=.{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])?)*\.?$/,Ku=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Ai=/^https?$/,Wu=/^\+[1-9]\d{6,14}$/,Xu="(?:(?:\\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])))",Yu=new RegExp(`^${Xu}$`);function Qu(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 el(e){return new RegExp(`^${Qu(e)}$`)}function tl(e){const t=Qu({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(`^${Xu}T(?:${o})$`)}const nl=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},rl=/^-?\d+n?$/,ol=/^-?\d+$/,Ci=/^-?\d+(?:\.\d+)?$/,il=/^(?:true|false)$/i,al=/^null$/i,sl=/^undefined$/i,cl=/^[^A-Z]*$/,ul=/^[^a-z]*$/,ll=/^[0-9a-fA-F]*$/;function Un(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Zn(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}const by=/^[0-9a-fA-F]{32}$/,ky=Un(22,"=="),Sy=Zn(22),wy=/^[0-9a-fA-F]{40}$/,Iy=Un(27,"="),Py=Zn(27),xy=/^[0-9a-fA-F]{64}$/,Oy=Un(43,"="),Ty=Zn(43),Ny=/^[0-9a-fA-F]{96}$/,zy=Un(64,""),jy=Zn(64),Ey=/^[0-9a-fA-F]{128}$/,Ry=Un(86,"=="),Dy=Zn(86);var Ui=Object.freeze({__proto__:null,base64:Vu,base64url:Di,bigint:rl,boolean:il,browserEmail:_y,cidrv4:qu,cidrv6:Ju,cuid:zu,cuid2:ju,date:Yu,datetime:tl,domain:Ku,duration:Cu,e164:Wu,email:Zu,emoji:Bu,extendedDuration:py,guid:Uu,hex:ll,hostname:Hu,html5Email:gy,httpProtocol:Ai,idnEmail:yy,integer:ol,ipv4:Lu,ipv6:Fu,ksuid:Du,lowercase:cl,mac:Gu,md5_base64:ky,md5_base64url:Sy,md5_hex:by,nanoid:Au,null:al,number:Ci,rfc5322Email:vy,sha1_base64:Iy,sha1_base64url:Py,sha1_hex:wy,sha256_base64:Oy,sha256_base64url:Ty,sha256_hex:xy,sha384_base64:zy,sha384_base64url:jy,sha384_hex:Ny,sha512_base64:Ry,sha512_base64url:Dy,sha512_hex:Ey,string:nl,time:el,ulid:Eu,undefined:sl,unicodeEmail:Mu,uppercase:ul,uuid:an,uuid4:my,uuid6:fy,uuid7:hy,xid:Ru});const Ie=b("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),dl={number:"number",bigint:"bigint",object:"date"},Zi=b("$ZodCheckLessThan",(e,t)=>{Ie.init(e,t);const r=dl[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})}}),Mi=b("$ZodCheckGreaterThan",(e,t)=>{Ie.init(e,t);const r=dl[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})}}),pl=b("$ZodCheckMultipleOf",(e,t)=>{Ie.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):cu(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})}}),ml=b("$ZodCheckNumberFormat",(e,t)=>{Ie.init(e,t),t.format=t.format||"float64";const r=t.format?.includes("int"),o=r?"int":"number",[n,i]=fu[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=ol)}),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})}}),fl=b("$ZodCheckBigIntFormat",(e,t)=>{Ie.init(e,t);const[r,o]=hu[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})}}),hl=b("$ZodCheckMaxSize",(e,t)=>{var r;Ie.init(e,t),(r=e._zod.def).when??(r.when=o=>{const n=o.value;return!Bt(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:Rr(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),gl=b("$ZodCheckMinSize",(e,t)=>{var r;Ie.init(e,t),(r=e._zod.def).when??(r.when=o=>{const n=o.value;return!Bt(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:Rr(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),vl=b("$ZodCheckSizeEquals",(e,t)=>{var r;Ie.init(e,t),(r=e._zod.def).when??(r.when=o=>{const n=o.value;return!Bt(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:Rr(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})}}),yl=b("$ZodCheckMaxLength",(e,t)=>{var r;Ie.init(e,t),(r=e._zod.def).when??(r.when=o=>{const n=o.value;return!Bt(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=Dr(n);o.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),_l=b("$ZodCheckMinLength",(e,t)=>{var r;Ie.init(e,t),(r=e._zod.def).when??(r.when=o=>{const n=o.value;return!Bt(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=Dr(n);o.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),$l=b("$ZodCheckLengthEquals",(e,t)=>{var r;Ie.init(e,t),(r=e._zod.def).when??(r.when=o=>{const n=o.value;return!Bt(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=Dr(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})}}),Mn=b("$ZodCheckStringFormat",(e,t)=>{var r,o;Ie.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=()=>{})}),bl=b("$ZodCheckRegex",(e,t)=>{Mn.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})}}),kl=b("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=cl),Mn.init(e,t)}),Sl=b("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ul),Mn.init(e,t)}),wl=b("$ZodCheckIncludes",(e,t)=>{Ie.init(e,t);const r=wt(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})}}),Il=b("$ZodCheckStartsWith",(e,t)=>{Ie.init(e,t);const r=new RegExp(`^${wt(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})}}),Pl=b("$ZodCheckEndsWith",(e,t)=>{Ie.init(e,t);const r=new RegExp(`.*${wt(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 xl(e,t,r){e.issues.length&&t.issues.push(...at(r,e.issues))}const Ol=b("$ZodCheckProperty",(e,t)=>{Ie.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=>xl(n,r,t.property));xl(o,r,t.property)}}),Tl=b("$ZodCheckMimeType",(e,t)=>{Ie.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})}}),Nl=b("$ZodCheckOverwrite",(e,t)=>{Ie.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class zl{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 jl={major:4,minor:4,patch:3},ee=b("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=jl;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=Ft(a),l;for(const d of s){if(d._zod.def.when){if(Su(a)||!d._zod.def.when(a))continue}else if(u)continue;const m=a.issues.length,p=d._zod.check(a);if(p instanceof Promise&&c?.async===!1)throw new Mt;if(l||p instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await p,a.issues.length!==m&&(u||(u=Ft(a,m)))});else{if(a.issues.length===m)continue;u||(u=Ft(a,m))}}return l?l.then(()=>a):a},i=(a,s,c)=>{if(Ft(a))return a.aborted=!0,a;const u=n(s,o,c);if(u instanceof Promise){if(c.async===!1)throw new Mt;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 Mt;return c.then(u=>n(u,o,s))}return n(c,o,s)}}ie(e,"~standard",()=>({validate:n=>{try{const i=Ur(e,n);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return Zr(e,n).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),Bn=b("$ZodString",(e,t)=>{ee.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??nl(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=b("$ZodStringFormat",(e,t)=>{Mn.init(e,t),Bn.init(e,t)}),El=b("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Uu),$e.init(e,t)}),Rl=b("$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)}),Dl=b("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Zu),$e.init(e,t)}),Al=b("$ZodURL",(e,t)=>{$e.init(e,t),e._zod.check=r=>{try{const o=r.value.trim();if(!t.normalize&&t.protocol?.source===Ai.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})}}}),Cl=b("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Bu()),$e.init(e,t)}),Ul=b("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Au),$e.init(e,t)}),Zl=b("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=zu),$e.init(e,t)}),Ml=b("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=ju),$e.init(e,t)}),Bl=b("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Eu),$e.init(e,t)}),Ll=b("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Ru),$e.init(e,t)}),Fl=b("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Du),$e.init(e,t)}),Gl=b("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=tl(t)),$e.init(e,t)}),ql=b("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Yu),$e.init(e,t)}),Jl=b("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=el(t)),$e.init(e,t)}),Vl=b("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Cu),$e.init(e,t)}),Hl=b("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Lu),$e.init(e,t),e._zod.bag.format="ipv4"}),Kl=b("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Fu),$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})}}}),Wl=b("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Gu(t.delimiter)),$e.init(e,t),e._zod.bag.format="mac"}),Xl=b("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=qu),$e.init(e,t)}),Yl=b("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Ju),$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 Bi(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Ql=b("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Vu),$e.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{Bi(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function ed(e){if(!Di.test(e))return!1;const t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Bi(r)}const td=b("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Di),$e.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{ed(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),nd=b("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Wu),$e.init(e,t)});function rd(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 od=b("$ZodJWT",(e,t)=>{$e.init(e,t),e._zod.check=r=>{rd(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),id=b("$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})}}),Li=b("$ZodNumber",(e,t)=>{ee.init(e,t),e._zod.pattern=e._zod.bag.pattern??Ci,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}}),ad=b("$ZodNumberFormat",(e,t)=>{ml.init(e,t),Li.init(e,t)}),Fi=b("$ZodBoolean",(e,t)=>{ee.init(e,t),e._zod.pattern=il,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}}),Gi=b("$ZodBigInt",(e,t)=>{ee.init(e,t),e._zod.pattern=rl,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}}),sd=b("$ZodBigIntFormat",(e,t)=>{fl.init(e,t),Gi.init(e,t)}),cd=b("$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}}),ud=b("$ZodUndefined",(e,t)=>{ee.init(e,t),e._zod.pattern=sl,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}}),ld=b("$ZodNull",(e,t)=>{ee.init(e,t),e._zod.pattern=al,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}}),dd=b("$ZodAny",(e,t)=>{ee.init(e,t),e._zod.parse=r=>r}),pd=b("$ZodUnknown",(e,t)=>{ee.init(e,t),e._zod.parse=r=>r}),md=b("$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)}),fd=b("$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}}),hd=b("$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 gd(e,t,r){e.issues.length&&t.issues.push(...at(r,e.issues)),t.value[r]=e.value}const vd=b("$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=>gd(u,r,a))):gd(c,r,a)}return i.length?Promise.all(i).then(()=>r):r}});function Mr(e,t,r,o,n,i){const a=r in o;if(e.issues.length){if(n&&i&&!a)return;t.issues.push(...at(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 yd(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=mu(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function _d(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 m in t){if(m==="__proto__"||s.has(m))continue;if(u==="never"){a.push(m);continue}const p=c.run({value:t[m],issues:[]},o);p instanceof Promise?e.push(p.then(h=>Mr(h,r,m,t,l,d))):Mr(p,r,m,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 qi=b("$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=jn(()=>yd(t));ie(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 m of a.keys){const p=d[m],h=p._zod.optin==="optional",$=p._zod.optout==="optional",g=p._zod.run({value:u[m],issues:[]},c);g instanceof Promise?l.push(g.then(y=>Mr(y,s,m,u,h,$))):Mr(g,s,m,u,h,$)}return i?_d(l,u,s,c,o.value,e):l.length?Promise.all(l).then(()=>s):s}}),$d=b("$ZodObjectJIT",(e,t)=>{qi.init(e,t);const r=e._zod.parse,o=jn(()=>yd(t)),n=m=>{const p=new zl(["shape","payload","ctx"]),h=o.value,$=S=>{const P=ki(S);return`shape[${P}]._zod.run({ value: input[${P}], issues: [] }, ctx)`};p.write("const input = payload.value;");const g=Object.create(null);let y=0;for(const S of h.keys)g[S]=`key_${y++}`;p.write("const newResult = {};");for(const S of h.keys){const P=g[S],N=ki(S),B=m[S],K=B?._zod?.optin==="optional",ue=B?._zod?.optout==="optional";p.write(`const ${P} = ${$(S)};`),K&&ue?p.write(`
|
|
6
|
+
if (${P}.issues.length) {
|
|
7
|
+
if (${N} in input) {
|
|
8
|
+
payload.issues = payload.issues.concat(${P}.issues.map(iss => ({
|
|
9
|
+
...iss,
|
|
10
|
+
path: iss.path ? [${N}, ...iss.path] : [${N}]
|
|
11
|
+
})));
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if (${P}.value === undefined) {
|
|
16
|
+
if (${N} in input) {
|
|
17
|
+
newResult[${N}] = undefined;
|
|
18
|
+
}
|
|
19
|
+
} else {
|
|
20
|
+
newResult[${N}] = ${P}.value;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
`):K?p.write(`
|
|
24
|
+
if (${P}.issues.length) {
|
|
25
|
+
payload.issues = payload.issues.concat(${P}.issues.map(iss => ({
|
|
26
|
+
...iss,
|
|
27
|
+
path: iss.path ? [${N}, ...iss.path] : [${N}]
|
|
28
|
+
})));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (${P}.value === undefined) {
|
|
32
|
+
if (${N} in input) {
|
|
33
|
+
newResult[${N}] = undefined;
|
|
34
|
+
}
|
|
35
|
+
} else {
|
|
36
|
+
newResult[${N}] = ${P}.value;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
`):p.write(`
|
|
40
|
+
const ${P}_present = ${N} in input;
|
|
41
|
+
if (${P}.issues.length) {
|
|
42
|
+
payload.issues = payload.issues.concat(${P}.issues.map(iss => ({
|
|
43
|
+
...iss,
|
|
44
|
+
path: iss.path ? [${N}, ...iss.path] : [${N}]
|
|
45
|
+
})));
|
|
46
|
+
}
|
|
47
|
+
if (!${P}_present && !${P}.issues.length) {
|
|
48
|
+
payload.issues.push({
|
|
49
|
+
code: "invalid_type",
|
|
50
|
+
expected: "nonoptional",
|
|
51
|
+
input: undefined,
|
|
52
|
+
path: [${N}]
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (${P}_present) {
|
|
57
|
+
if (${P}.value === undefined) {
|
|
58
|
+
newResult[${N}] = undefined;
|
|
59
|
+
} else {
|
|
60
|
+
newResult[${N}] = ${P}.value;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
`)}p.write("payload.value = newResult;"),p.write("return payload;");const v=p.compile();return(S,P)=>v(m,S,P)};let i;const a=rn,s=!zn.jitless,u=s&&du.value,l=t.catchall;let d;e._zod.parse=(m,p)=>{d??(d=o.value);const h=m.value;return a(h)?s&&u&&p?.async===!1&&p.jitless!==!0?(i||(i=n(t.shape)),m=i(m,p),l?_d([],h,m,p,d,e):m):r(m,p):(m.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),m)}});function bd(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=>!Ft(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=>Qe(a,o,De())))}),t)}const Br=b("$ZodUnion",(e,t)=>{ee.init(e,t),ie(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),ie(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),ie(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),ie(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=>bd(s,o,e,n)):bd(a,o,e,n)}});function kd(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=>Qe(a,o,De())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t)}const Sd=b("$ZodXor",(e,t)=>{Br.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=>kd(s,o,e,n)):kd(a,o,e,n)}}),wd=b("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Br.init(e,t);const r=e._zod.parse;ie(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=jn(()=>{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)}}),Id=b("$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])=>Pd(r,c,u)):Pd(r,i,a)}});function Ji(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(Lt(e)&&Lt(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=Ji(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=Ji(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 Pd(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}),Ft(e))return e;const a=Ji(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 Vi=b("$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=xd(r,"optin"),c=xd(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(m=>{u[l]=m})):u[l]=d}if(t.rest){let l=r.length-1;const d=i.slice(r.length);for(const m of d){l++;const p=t.rest._zod.run({value:m,issues:[]},n);p instanceof Promise?a.push(p.then(h=>Od(h,o,l))):Od(p,o,l)}}return a.length?Promise.all(a).then(()=>Td(u,o,r,i,c)):Td(u,o,r,i,c)}});function xd(e,t){for(let r=e.length-1;r>=0;r--)if(e[r]._zod[t]!=="optional")return r+1;return 0}function Od(e,t,r){e.issues.length&&t.issues.push(...at(r,e.issues)),t.value[r]=e.value}function Td(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(...at(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 Nd=b("$ZodRecord",(e,t)=>{ee.init(e,t),e._zod.parse=(r,o)=>{const n=r.value;if(!Lt(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(p=>Qe(p,o,De())),input:u,path:[u],inst:e});continue}const d=l.value,m=t.valueType._zod.run({value:n[u],issues:[]},o);m instanceof Promise?i.push(m.then(p=>{p.issues.length&&r.issues.push(...at(u,p.issues)),r.value[d]=p.value})):(m.issues.length&&r.issues.push(...at(u,m.issues)),r.value[d]=m.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"&&Ci.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=>Qe(d,o,De())),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(...at(s,d.issues)),r.value[c.value]=d.value})):(l.issues.length&&r.issues.push(...at(s,l.issues)),r.value[c.value]=l.value)}}return i.length?Promise.all(i).then(()=>r):r}}),zd=b("$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])=>{jd(l,d,r,a,n,e,o)})):jd(c,u,r,a,n,e,o)}return i.length?Promise.all(i).then(()=>r):r}});function jd(e,t,r,o,n,i,a){e.issues.length&&(Er.has(typeof o)?r.issues.push(...at(o,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:n,inst:i,issues:e.issues.map(s=>Qe(s,a,De()))})),t.issues.length&&(Er.has(typeof o)?r.issues.push(...at(o,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:i,key:o,issues:t.issues.map(s=>Qe(s,a,De()))})),r.value.set(e.value,t.value)}const Ed=b("$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=>Rd(c,r))):Rd(s,r)}return i.length?Promise.all(i).then(()=>r):r}});function Rd(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}const Dd=b("$ZodEnum",(e,t)=>{ee.init(e,t);const r=bi(t.entries),o=new Set(r);e._zod.values=o,e._zod.pattern=new RegExp(`^(${r.filter(n=>Er.has(typeof n)).map(n=>typeof n=="string"?wt(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}}),Ad=b("$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"?wt(o):o?wt(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}}),Cd=b("$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}}),Ud=b("$ZodTransform",(e,t)=>{ee.init(e,t),e._zod.optin="optional",e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Tr(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 Mt;return r.value=n,r.fallback=!0,r}});function Zd(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const Hi=b("$ZodOptional",(e,t)=>{ee.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ie(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ie(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=>Zd(a,n)):Zd(i,n)}return r.value===void 0?r:t.innerType._zod.run(r,o)}}),Md=b("$ZodExactOptional",(e,t)=>{Hi.init(e,t),ie(e._zod,"values",()=>t.innerType._zod.values),ie(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),Bd=b("$ZodNullable",(e,t)=>{ee.init(e,t),ie(e._zod,"optin",()=>t.innerType._zod.optin),ie(e._zod,"optout",()=>t.innerType._zod.optout),ie(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${zr(r.source)}|null)$`):void 0}),ie(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)}),Ld=b("$ZodDefault",(e,t)=>{ee.init(e,t),e._zod.optin="optional",ie(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=>Fd(i,t)):Fd(n,t)}});function Fd(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Gd=b("$ZodPrefault",(e,t)=>{ee.init(e,t),e._zod.optin="optional",ie(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))}),qd=b("$ZodNonOptional",(e,t)=>{ee.init(e,t),ie(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=>Jd(i,e)):Jd(n,e)}});function Jd(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 Vd=b("$ZodSuccess",(e,t)=>{ee.init(e,t),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Tr("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)}}),Hd=b("$ZodCatch",(e,t)=>{ee.init(e,t),e._zod.optin="optional",ie(e._zod,"optout",()=>t.innerType._zod.optout),ie(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=>Qe(a,o,De()))},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=>Qe(i,o,De()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),Kd=b("$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)}),Ki=b("$ZodPipe",(e,t)=>{ee.init(e,t),ie(e._zod,"values",()=>t.in._zod.values),ie(e._zod,"optin",()=>t.in._zod.optin),ie(e._zod,"optout",()=>t.out._zod.optout),ie(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=>Lr(a,t.in,o)):Lr(i,t.in,o)}const n=t.in._zod.run(r,o);return n instanceof Promise?n.then(i=>Lr(i,t.out,o)):Lr(n,t.out,o)}});function Lr(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 Wi=b("$ZodCodec",(e,t)=>{ee.init(e,t),ie(e._zod,"values",()=>t.in._zod.values),ie(e._zod,"optin",()=>t.in._zod.optin),ie(e._zod,"optout",()=>t.out._zod.optout),ie(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=>Fr(a,t,o)):Fr(i,t,o)}else{const i=t.out._zod.run(r,o);return i instanceof Promise?i.then(a=>Fr(a,t,o)):Fr(i,t,o)}}});function Fr(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=>Gr(e,i,t.out,r)):Gr(e,n,t.out,r)}else{const n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(i=>Gr(e,i,t.in,r)):Gr(e,n,t.in,r)}}function Gr(e,t,r,o){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},o)}const Wd=b("$ZodPreprocess",(e,t)=>{Ki.init(e,t)}),Xd=b("$ZodReadonly",(e,t)=>{ee.init(e,t),ie(e._zod,"propValues",()=>t.innerType._zod.propValues),ie(e._zod,"values",()=>t.innerType._zod.values),ie(e._zod,"optin",()=>t.innerType?._zod?.optin),ie(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(Yd):Yd(n)}});function Yd(e){return e.value=Object.freeze(e.value),e}const Qd=b("$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||pu.has(typeof o))r.push(wt(`${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)}),ep=b("$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?Ar(e._def.input,o):o,i=Reflect.apply(r,this,n);return e._def.output?Ar(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 Cr(e._def.input,o):o,i=await Reflect.apply(r,this,n);return e._def.output?await Cr(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 Vi({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)),tp=b("$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))}),np=b("$ZodLazy",(e,t)=>{ee.init(e,t),ie(e._zod,"innerType",()=>{const r=t;return r._cachedInner||(r._cachedInner=t.getter()),r._cachedInner}),ie(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),ie(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),ie(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),ie(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,o)=>e._zod.innerType._zod.run(r,o)}),rp=b("$ZodCustom",(e,t)=>{Ie.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=>op(i,r,o,e));op(n,r,o,e)}});function op(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 Ay=()=>{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=Y(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 ${H(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: ${R(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":""}: ${R(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 Cy(){return{localeError:Ay()}}const Uy=()=>{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=Y(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 ${H(n.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${R(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":""}: ${R(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 Zy(){return{localeError:Uy()}}function ip(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 My=()=>{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=Y(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 ${H(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 ${R(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);if(a){const s=Number(n.maximum),c=ip(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=ip(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"}: ${R(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 By(){return{localeError:My()}}const Ly=()=>{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=Y(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 ${H(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 ${R(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":""}: ${R(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 Fy(){return{localeError:Ly()}}const Gy=()=>{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=Y(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 ${H(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${R(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":""}: ${R(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 qy(){return{localeError:Gy()}}const Jy=()=>{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=Y(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 ${H(n.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${R(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: ${R(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 Vy(){return{localeError:Jy()}}const Hy=()=>{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=Y(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 ${H(n.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${R(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"}: ${R(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 Ky(){return{localeError:Hy()}}const Wy=()=>{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=Y(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 ${H(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${R(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"}: ${R(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 Xy(){return{localeError:Wy()}}const Yy=()=>{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=Y(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 ${H(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 ${R(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"}: ${R(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 Qy(){return{localeError:Yy()}}const e_=()=>{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=Y(n.input),s=o[a]??a;return`Invalid input: expected ${i}, received ${s}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${H(n.values[0])}`:`Invalid option: expected one of ${R(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":""}: ${R(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 ap(){return{localeError:e_()}}const t_=()=>{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=Y(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 ${H(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${R(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":""}: ${R(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 n_(){return{localeError:t_()}}const r_=()=>{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=Y(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 ${H(n.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${R(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":""}: ${R(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 o_(){return{localeError:r_()}}const i_=()=>{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=Y(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 ${H(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 ${R(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: ${R(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 a_(){return{localeError:i_()}}const s_=()=>{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=Y(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 ${H(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${R(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"}: ${R(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 c_(){return{localeError:s_()}}const u_=()=>{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=Y(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 : ${H(n.values[0])} attendu`:`Option invalide : une valeur parmi ${R(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":""} : ${R(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 l_(){return{localeError:u_()}}const d_=()=>{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=Y(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 ${H(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${R(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":""} : ${R(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 p_(){return{localeError:d_()}}const m_=()=>{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),m=Y(u.input),p=c[m]??e[m]?.label??m;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 ${p}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${d}, \u05D4\u05EA\u05E7\u05D1\u05DC ${p}`}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 ${H(u.values[0])}`;const l=u.values.map(p=>H(p));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 h=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 ${h}`}if(u.origin==="array"||u.origin==="set"){const h=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} ${h} \u05DC\u05D4\u05DB\u05D9\u05DC ${$}`.trim()}const m=u.inclusive?"<=":"<",p=i(u.origin??"value");return l?.unit?`${l.longLabel} \u05DE\u05D3\u05D9: ${d} ${p} ${m}${u.maximum.toString()} ${l.unit}`:`${l?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${d} ${p} ${m}${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 h=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 ${h}`}if(u.origin==="array"||u.origin==="set"){const h=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} ${h} \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} ${h} \u05DC\u05D4\u05DB\u05D9\u05DC ${$}`.trim()}const m=u.inclusive?">=":">",p=i(u.origin??"value");return l?.unit?`${l.shortLabel} \u05DE\u05D3\u05D9: ${d} ${p} ${m}${u.minimum.toString()} ${l.unit}`:`${l?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${d} ${p} ${m}${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],m=d?.label??l.format,h=(d?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${m} \u05DC\u05D0 ${h}`}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"}: ${R(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 f_(){return{localeError:m_()}}const h_=()=>{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=Y(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 ${H(n.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${R(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"}: ${R(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 g_(){return{localeError:h_()}}const v_=()=>{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=Y(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 ${H(n.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${R(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":""}: ${R(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 y_(){return{localeError:v_()}}function sp(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 __=()=>{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=Y(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 ${H(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 ${R(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);if(a){const s=Number(n.maximum),c=sp(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=sp(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":""}. ${R(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 $_(){return{localeError:__()}}const b_=()=>{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=Y(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 ${H(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${R(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":""}: ${R(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 k_(){return{localeError:b_()}}const S_=()=>{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=Y(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 ${H(n.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${R(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"}: ${R(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 w_(){return{localeError:S_()}}const I_=()=>{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=Y(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 ${H(n.values[0])}`:`Opzione non valida: atteso uno tra ${R(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"}: ${R(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 P_(){return{localeError:I_()}}const x_=()=>{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=Y(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: ${H(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${R(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":""}: ${R(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 O_(){return{localeError:x_()}}const T_=()=>{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=Y(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 ${H(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 ${R(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"}: ${R(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 N_(){return{localeError:T_()}}const z_=()=>{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=Y(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 ${H(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 ${R(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 ${R(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 cp(){return{localeError:z_()}}function j_(){return cp()}const E_=()=>{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=Y(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 ${H(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${R(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: ${R(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 R_(){return{localeError:E_()}}const Ln=e=>e.charAt(0).toUpperCase()+e.slice(1);function up(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 D_=()=>{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=Y(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 ${H(n.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${R(n.values,"|")} pasirinkim\u0173`;case"too_big":{const i=o[n.origin]??n.origin,a=t(n.origin,up(Number(n.maximum)),n.inclusive??!1,"smaller");if(a?.verb)return`${Ln(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`${Ln(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,up(Number(n.minimum)),n.inclusive??!1,"bigger");if(a?.verb)return`${Ln(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`${Ln(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"}: ${R(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`${Ln(i??n.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function A_(){return{localeError:D_()}}const C_=()=>{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=Y(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 ${H(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 ${R(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"}: ${R(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 U_(){return{localeError:C_()}}const Z_=()=>{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=Y(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 ${H(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${R(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: ${R(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 M_(){return{localeError:Z_()}}const B_=()=>{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=Y(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 ${H(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${R(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":""}: ${R(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 L_(){return{localeError:B_()}}const F_=()=>{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=Y(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 ${H(n.values[0])}`:`Ugyldig valg: forventet en av ${R(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"}: ${R(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 G_(){return{localeError:F_()}}const q_=()=>{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=Y(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 ${H(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${R(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":""}: ${R(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 J_(){return{localeError:q_()}}const V_=()=>{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=Y(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 ${H(n.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${R(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"}: ${R(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 H_(){return{localeError:V_()}}const K_=()=>{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=Y(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 ${H(n.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${R(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":""}: ${R(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 W_(){return{localeError:K_()}}const X_=()=>{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=Y(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 ${H(n.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${R(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":""}: ${R(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 Y_(){return{localeError:X_()}}const Q_=()=>{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=Y(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 ${H(n.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${R(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: ${R(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 e$(){return{localeError:Q_()}}function lp(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 t$=()=>{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=Y(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 ${H(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 ${R(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);if(a){const s=Number(n.maximum),c=lp(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=lp(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":""}: ${R(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 n$(){return{localeError:t$()}}const r$=()=>{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=Y(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 ${H(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${R(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"}: ${R(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 o$(){return{localeError:r$()}}const i$=()=>{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=Y(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 ${H(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${R(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"}: ${R(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 a$(){return{localeError:i$()}}const s$=()=>{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=Y(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 ${H(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 ${R(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":""}: ${R(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 c$(){return{localeError:s$()}}const u$=()=>{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=Y(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 ${H(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 ${R(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: ${R(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 l$(){return{localeError:u$()}}const d$=()=>{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=Y(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 ${H(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${R(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":""}: ${R(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 p$(){return{localeError:d$()}}const m$=()=>{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=Y(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 ${H(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 ${R(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":""}: ${R(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 dp(){return{localeError:m$()}}function f$(){return dp()}const h$=()=>{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=Y(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: ${H(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${R(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":""}: ${R(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 g$(){return{localeError:h$()}}const v$=()=>{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=Y(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 ${H(n.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${R(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":""}: ${R(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 y$(){return{localeError:v$()}}const _$=()=>{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=Y(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 ${H(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 ${R(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: ${R(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 $$(){return{localeError:_$()}}const b$=()=>{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=Y(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 ${H(n.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${R(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): ${R(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 k$(){return{localeError:b$()}}const S$=()=>{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=Y(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 ${H(n.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${R(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${R(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 w$(){return{localeError:S$()}}const I$=()=>{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=Y(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 ${H(n.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${R(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: ${R(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 P$(){return{localeError:I$()}}var pp=Object.freeze({__proto__:null,ar:Cy,az:Zy,be:By,bg:Fy,ca:qy,cs:Vy,da:Ky,de:Xy,el:Qy,en:ap,eo:n_,es:o_,fa:a_,fi:c_,fr:l_,frCA:p_,he:f_,hr:g_,hu:y_,hy:$_,id:k_,is:w_,it:P_,ja:O_,ka:N_,kh:j_,km:cp,ko:R_,lt:A_,mk:U_,ms:M_,nl:L_,no:G_,ota:J_,pl:W_,ps:H_,pt:Y_,ro:e$,ru:n$,sl:o$,sv:a$,ta:c$,th:l$,tr:p$,ua:f$,uk:dp,ur:g$,uz:y$,vi:$$,yo:P$,zhCN:k$,zhTW:w$}),mp;const fp=Symbol("ZodOutput"),hp=Symbol("ZodInput");class gp{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 Xi(){return new gp}(mp=globalThis).__zod_globalRegistry??(mp.__zod_globalRegistry=Xi());const st=globalThis.__zod_globalRegistry;function vp(e,t){return new e({type:"string",...z(t)})}function yp(e,t){return new e({type:"string",coerce:!0,...z(t)})}function Yi(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...z(t)})}function qr(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...z(t)})}function Qi(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...z(t)})}function ea(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...z(t)})}function ta(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...z(t)})}function na(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...z(t)})}function Jr(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...z(t)})}function ra(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...z(t)})}function oa(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...z(t)})}function ia(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...z(t)})}function aa(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...z(t)})}function sa(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...z(t)})}function ca(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...z(t)})}function ua(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...z(t)})}function la(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...z(t)})}function da(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...z(t)})}function _p(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...z(t)})}function pa(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...z(t)})}function ma(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...z(t)})}function fa(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...z(t)})}function ha(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...z(t)})}function ga(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...z(t)})}function va(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...z(t)})}const $p={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function bp(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...z(t)})}function kp(e,t){return new e({type:"string",format:"date",check:"string_format",...z(t)})}function Sp(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...z(t)})}function wp(e,t){return new e({type:"string",format:"duration",check:"string_format",...z(t)})}function Ip(e,t){return new e({type:"number",checks:[],...z(t)})}function Pp(e,t){return new e({type:"number",coerce:!0,checks:[],...z(t)})}function xp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...z(t)})}function Op(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...z(t)})}function Tp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...z(t)})}function Np(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...z(t)})}function zp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...z(t)})}function jp(e,t){return new e({type:"boolean",...z(t)})}function Ep(e,t){return new e({type:"boolean",coerce:!0,...z(t)})}function Rp(e,t){return new e({type:"bigint",...z(t)})}function Dp(e,t){return new e({type:"bigint",coerce:!0,...z(t)})}function Ap(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...z(t)})}function Cp(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...z(t)})}function Up(e,t){return new e({type:"symbol",...z(t)})}function Zp(e,t){return new e({type:"undefined",...z(t)})}function Mp(e,t){return new e({type:"null",...z(t)})}function Bp(e){return new e({type:"any"})}function Lp(e){return new e({type:"unknown"})}function Fp(e,t){return new e({type:"never",...z(t)})}function Gp(e,t){return new e({type:"void",...z(t)})}function qp(e,t){return new e({type:"date",...z(t)})}function Jp(e,t){return new e({type:"date",coerce:!0,...z(t)})}function Vp(e,t){return new e({type:"nan",...z(t)})}function Nt(e,t){return new Zi({check:"less_than",...z(t),value:e,inclusive:!1})}function ct(e,t){return new Zi({check:"less_than",...z(t),value:e,inclusive:!0})}function zt(e,t){return new Mi({check:"greater_than",...z(t),value:e,inclusive:!1})}function He(e,t){return new Mi({check:"greater_than",...z(t),value:e,inclusive:!0})}function ya(e){return zt(0,e)}function _a(e){return Nt(0,e)}function $a(e){return ct(0,e)}function ba(e){return He(0,e)}function cn(e,t){return new pl({check:"multiple_of",...z(t),value:e})}function un(e,t){return new hl({check:"max_size",...z(t),maximum:e})}function jt(e,t){return new gl({check:"min_size",...z(t),minimum:e})}function Fn(e,t){return new vl({check:"size_equals",...z(t),size:e})}function Gn(e,t){return new yl({check:"max_length",...z(t),maximum:e})}function Gt(e,t){return new _l({check:"min_length",...z(t),minimum:e})}function qn(e,t){return new $l({check:"length_equals",...z(t),length:e})}function Vr(e,t){return new bl({check:"string_format",format:"regex",...z(t),pattern:e})}function Hr(e){return new kl({check:"string_format",format:"lowercase",...z(e)})}function Kr(e){return new Sl({check:"string_format",format:"uppercase",...z(e)})}function Wr(e,t){return new wl({check:"string_format",format:"includes",...z(t),includes:e})}function Xr(e,t){return new Il({check:"string_format",format:"starts_with",...z(t),prefix:e})}function Yr(e,t){return new Pl({check:"string_format",format:"ends_with",...z(t),suffix:e})}function ka(e,t,r){return new Ol({check:"property",property:e,schema:t,...z(r)})}function Qr(e,t){return new Tl({check:"mime_type",mime:e,...z(t)})}function It(e){return new Nl({check:"overwrite",tx:e})}function eo(e){return It(t=>t.normalize(e))}function to(){return It(e=>e.trim())}function no(){return It(e=>e.toLowerCase())}function ro(){return It(e=>e.toUpperCase())}function oo(){return It(e=>lu(e))}function Hp(e,t,r){return new e({type:"array",element:t,...z(r)})}function x$(e,t,r){return new e({type:"union",options:t,...z(r)})}function O$(e,t,r){return new e({type:"union",options:t,inclusive:!1,...z(r)})}function T$(e,t,r,o){return new e({type:"union",options:r,discriminator:t,...z(o)})}function N$(e,t,r){return new e({type:"intersection",left:t,right:r})}function z$(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,...z(i)})}function j$(e,t,r,o){return new e({type:"record",keyType:t,valueType:r,...z(o)})}function E$(e,t,r,o){return new e({type:"map",keyType:t,valueType:r,...z(o)})}function R$(e,t,r){return new e({type:"set",valueType:t,...z(r)})}function D$(e,t,r){const o=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new e({type:"enum",entries:o,...z(r)})}function A$(e,t,r){return new e({type:"enum",entries:t,...z(r)})}function C$(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...z(r)})}function Kp(e,t){return new e({type:"file",...z(t)})}function U$(e,t){return new e({type:"transform",transform:t})}function Z$(e,t){return new e({type:"optional",innerType:t})}function M$(e,t){return new e({type:"nullable",innerType:t})}function B$(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():jr(r)}})}function L$(e,t,r){return new e({type:"nonoptional",innerType:t,...z(r)})}function F$(e,t){return new e({type:"success",innerType:t})}function G$(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:()=>r})}function q$(e,t,r){return new e({type:"pipe",in:t,out:r})}function J$(e,t){return new e({type:"readonly",innerType:t})}function V$(e,t,r){return new e({type:"template_literal",parts:t,...z(r)})}function H$(e,t){return new e({type:"lazy",getter:t})}function K$(e,t){return new e({type:"promise",innerType:t})}function Wp(e,t,r){const o=z(r);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:t,...o})}function Xp(e,t,r){return new e({type:"custom",check:"custom",fn:t,...z(r)})}function Yp(e,t){const r=Qp(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 Qp(e,t){const r=new Ie({check:"custom",...z(t)});return r._zod.check=e,r}function em(e){const t=new Ie({check:"describe"});return t._zod.onattach=[r=>{const o=st.get(r)??{};st.add(r,{...o,description:e})}],t._zod.check=()=>{},t}function tm(e){const t=new Ie({check:"meta"});return t._zod.onattach=[r=>{const o=st.get(r)??{};st.add(r,{...o,...e})}],t._zod.check=()=>{},t}function nm(e,t){const r=z(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(p=>typeof p=="string"?p.toLowerCase():p),n=n.map(p=>typeof p=="string"?p.toLowerCase():p));const i=new Set(o),a=new Set(n),s=e.Codec??Wi,c=e.Boolean??Fi,u=e.String??Bn,l=new u({type:"string",error:r.error}),d=new c({type:"boolean",error:r.error}),m=new s({type:"pipe",in:l,out:d,transform:((p,h)=>{let $=p;return r.case!=="sensitive"&&($=$.toLowerCase()),i.has($)?!0:a.has($)?!1:(h.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...a],input:h.value,inst:m,continue:!1}),{})}),reverseTransform:((p,h)=>p===!0?o[0]||"true":n[0]||"false"),error:r.error});return m}function Jn(e,t,r,o={}){const n=z(o),i={...z(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??st,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 m=a.schema,p=t.processors[n.type];if(!p)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);p(e,t,m,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"&&Ge(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,m=e.external.uri??(h=>h);if(d)return{ref:m(d)};const p=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=p,{defId:p,ref:`${m("__shared")}#/${s}/${p}`}}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 pn(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 p=e.seen.get(d),h=p.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(h)):Object.assign(u,h),Object.assign(u,l),s._zod.parent===d)for(const g in u)g==="$ref"||g==="allOf"||g in l||delete u[g];if(h.$ref&&p.def)for(const g in u)g==="$ref"||g==="allOf"||g in p.def&&JSON.stringify(u[g])===JSON.stringify(p.def[g])&&delete u[g]}const m=s._zod.parent;if(m&&m!==d){o(m);const p=e.seen.get(m);if(p?.schema.$ref&&(u.$ref=p.schema.$ref,p.def))for(const h in u)h==="$ref"||h==="allOf"||h in p.def&&JSON.stringify(u[h])===JSON.stringify(p.def[h])&&delete u[h]}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:Vn(t,"input",e.processors),output:Vn(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function Ge(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 Ge(o.element,r);if(o.type==="set")return Ge(o.valueType,r);if(o.type==="lazy")return Ge(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 Ge(o.innerType,r);if(o.type==="intersection")return Ge(o.left,r)||Ge(o.right,r);if(o.type==="record"||o.type==="map")return Ge(o.keyType,r)||Ge(o.valueType,r);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Ge(o.in,r)||Ge(o.out,r);if(o.type==="object"){for(const n in o.shape)if(Ge(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(const n of o.options)if(Ge(n,r))return!0;return!1}if(o.type==="tuple"){for(const n of o.items)if(Ge(n,r))return!0;return!!(o.rest&&Ge(o.rest,r))}return!1}const rm=(e,t={})=>r=>{const o=ln({...r,processors:t});return _e(e,o),dn(o,e),pn(o,e)},Vn=(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),pn(a,e)},W$={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},om=(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=W$[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}))])}},im=(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),m=typeof u=="number"&&u<=(a??Number.POSITIVE_INFINITY),p=t.target==="draft-04"||t.target==="openapi-3.0";d?p?(n.minimum=l,n.exclusiveMinimum=!0):n.exclusiveMinimum=l:typeof i=="number"&&(n.minimum=i),m?p?(n.maximum=u,n.exclusiveMaximum=!0):n.exclusiveMaximum=u:typeof a=="number"&&(n.maximum=a),typeof c=="number"&&(n.multipleOf=c)},am=(e,t,r,o)=>{r.type="boolean"},sm=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},cm=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},um=(e,t,r,o)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},lm=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},dm=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},pm=(e,t,r,o)=>{r.not={}},mm=(e,t,r,o)=>{},fm=(e,t,r,o)=>{},hm=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},gm=(e,t,r,o)=>{const n=e._zod.def,i=bi(n.entries);i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),r.enum=i},vm=(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},ym=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},_m=(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},$m=(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)},bm=(e,t,r,o)=>{r.type="boolean"},km=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Sm=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},wm=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Im=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Pm=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},xm=(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"]})},Om=(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)},Sa=(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},Tm=(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},Nm=(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((m,p)=>_e(m,t,{...o,path:[...o.path,a,p]})),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)},zm=(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)}},jm=(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"}]},Em=(e,t,r,o)=>{const n=e._zod.def;_e(n.innerType,t,o);const i=t.seen.get(e);i.ref=n.innerType},Rm=(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))},Dm=(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)))},Am=(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},Cm=(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},Um=(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},Zm=(e,t,r,o)=>{const n=e._zod.def;_e(n.innerType,t,o);const i=t.seen.get(e);i.ref=n.innerType},wa=(e,t,r,o)=>{const n=e._zod.def;_e(n.innerType,t,o);const i=t.seen.get(e);i.ref=n.innerType},Mm=(e,t,r,o)=>{const n=e._zod.innerType;_e(n,t,o);const i=t.seen.get(e);i.ref=n},Ia={string:om,number:im,boolean:am,bigint:sm,symbol:cm,null:um,undefined:lm,void:dm,never:pm,any:mm,unknown:fm,date:hm,enum:gm,literal:vm,nan:ym,template_literal:_m,file:$m,success:bm,custom:km,function:Sm,transform:wm,map:Im,set:Pm,array:xm,object:Om,union:Sa,intersection:Tm,tuple:Nm,record:zm,nullable:jm,nonoptional:Em,default:Rm,prefault:Dm,catch:Am,pipe:Cm,readonly:Um,promise:Zm,optional:wa,lazy:Mm};function Pa(e,t){if("_idmap"in e){const o=e,n=ln({...t,processors:Ia}),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]=pn(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:Ia});return _e(e,r),dn(r,e),pn(r,e)}class X${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:Ia,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=pn(this.ctx,t),{"~standard":n,...i}=o;return i}}var Y$=Object.freeze({__proto__:null}),Q$=Object.freeze({__proto__:null,$ZodAny:dd,$ZodArray:vd,$ZodAsyncError:Mt,$ZodBase64:Ql,$ZodBase64URL:td,$ZodBigInt:Gi,$ZodBigIntFormat:sd,$ZodBoolean:Fi,$ZodCIDRv4:Xl,$ZodCIDRv6:Yl,$ZodCUID:Zl,$ZodCUID2:Ml,$ZodCatch:Hd,$ZodCheck:Ie,$ZodCheckBigIntFormat:fl,$ZodCheckEndsWith:Pl,$ZodCheckGreaterThan:Mi,$ZodCheckIncludes:wl,$ZodCheckLengthEquals:$l,$ZodCheckLessThan:Zi,$ZodCheckLowerCase:kl,$ZodCheckMaxLength:yl,$ZodCheckMaxSize:hl,$ZodCheckMimeType:Tl,$ZodCheckMinLength:_l,$ZodCheckMinSize:gl,$ZodCheckMultipleOf:pl,$ZodCheckNumberFormat:ml,$ZodCheckOverwrite:Nl,$ZodCheckProperty:Ol,$ZodCheckRegex:bl,$ZodCheckSizeEquals:vl,$ZodCheckStartsWith:Il,$ZodCheckStringFormat:Mn,$ZodCheckUpperCase:Sl,$ZodCodec:Wi,$ZodCustom:rp,$ZodCustomStringFormat:id,$ZodDate:hd,$ZodDefault:Ld,$ZodDiscriminatedUnion:wd,$ZodE164:nd,$ZodEmail:Dl,$ZodEmoji:Cl,$ZodEncodeError:Tr,$ZodEnum:Dd,$ZodError:wi,$ZodExactOptional:Md,$ZodFile:Cd,$ZodFunction:ep,$ZodGUID:El,$ZodIPv4:Hl,$ZodIPv6:Kl,$ZodISODate:ql,$ZodISODateTime:Gl,$ZodISODuration:Vl,$ZodISOTime:Jl,$ZodIntersection:Id,$ZodJWT:od,$ZodKSUID:Fl,$ZodLazy:np,$ZodLiteral:Ad,$ZodMAC:Wl,$ZodMap:zd,$ZodNaN:Kd,$ZodNanoID:Ul,$ZodNever:md,$ZodNonOptional:qd,$ZodNull:ld,$ZodNullable:Bd,$ZodNumber:Li,$ZodNumberFormat:ad,$ZodObject:qi,$ZodObjectJIT:$d,$ZodOptional:Hi,$ZodPipe:Ki,$ZodPrefault:Gd,$ZodPreprocess:Wd,$ZodPromise:tp,$ZodReadonly:Xd,$ZodRealError:et,$ZodRecord:Nd,$ZodRegistry:gp,$ZodSet:Ed,$ZodString:Bn,$ZodStringFormat:$e,$ZodSuccess:Vd,$ZodSymbol:cd,$ZodTemplateLiteral:Qd,$ZodTransform:Ud,$ZodTuple:Vi,$ZodType:ee,$ZodULID:Bl,$ZodURL:Al,$ZodUUID:Rl,$ZodUndefined:ud,$ZodUnion:Br,$ZodUnknown:pd,$ZodVoid:fd,$ZodXID:Ll,$ZodXor:Sd,$brand:su,$constructor:b,$input:hp,$output:fp,Doc:zl,JSONSchema:Y$,JSONSchemaGenerator:X$,NEVER:au,TimePrecision:$p,_any:Bp,_array:Hp,_base64:fa,_base64url:ha,_bigint:Rp,_boolean:jp,_catch:G$,_check:Qp,_cidrv4:pa,_cidrv6:ma,_coercedBigint:Dp,_coercedBoolean:Ep,_coercedDate:Jp,_coercedNumber:Pp,_coercedString:yp,_cuid:ia,_cuid2:aa,_custom:Wp,_date:qp,_decode:Oi,_decodeAsync:Ni,_default:B$,_discriminatedUnion:T$,_e164:ga,_email:Yi,_emoji:ra,_encode:xi,_encodeAsync:Ti,_endsWith:Yr,_enum:D$,_file:Kp,_float32:Op,_float64:Tp,_gt:zt,_gte:He,_guid:qr,_includes:Wr,_int:xp,_int32:Np,_int64:Ap,_intersection:N$,_ipv4:la,_ipv6:da,_isoDate:kp,_isoDateTime:bp,_isoDuration:wp,_isoTime:Sp,_jwt:va,_ksuid:ua,_lazy:H$,_length:qn,_literal:C$,_lowercase:Hr,_lt:Nt,_lte:ct,_mac:_p,_map:E$,_max:ct,_maxLength:Gn,_maxSize:un,_mime:Qr,_min:He,_minLength:Gt,_minSize:jt,_multipleOf:cn,_nan:Vp,_nanoid:oa,_nativeEnum:A$,_negative:_a,_never:Fp,_nonnegative:ba,_nonoptional:L$,_nonpositive:$a,_normalize:eo,_null:Mp,_nullable:M$,_number:Ip,_optional:Z$,_overwrite:It,_parse:Rn,_parseAsync:Dn,_pipe:q$,_positive:ya,_promise:K$,_property:ka,_readonly:J$,_record:j$,_refine:Xp,_regex:Vr,_safeDecode:ji,_safeDecodeAsync:Ri,_safeEncode:zi,_safeEncodeAsync:Ei,_safeParse:An,_safeParseAsync:Cn,_set:R$,_size:Fn,_slugify:oo,_startsWith:Xr,_string:vp,_stringFormat:Jn,_stringbool:nm,_success:F$,_superRefine:Yp,_symbol:Up,_templateLiteral:V$,_toLowerCase:no,_toUpperCase:ro,_transform:U$,_trim:to,_tuple:z$,_uint32:zp,_uint64:Cp,_ulid:sa,_undefined:Zp,_union:x$,_unknown:Lp,_uppercase:Kr,_url:Jr,_uuid:Qi,_uuidv4:ea,_uuidv6:ta,_uuidv7:na,_void:Gp,_xid:ca,_xor:O$,clone:Ye,config:De,createStandardJSONSchemaMethod:Vn,createToJSONSchemaMethod:rm,decode:iy,decodeAsync:sy,describe:em,encode:oy,encodeAsync:ay,extractDefs:dn,finalize:pn,flattenError:Ii,formatError:Pi,globalConfig:zn,globalRegistry:st,initializeContext:ln,isValidBase64:Bi,isValidBase64URL:ed,isValidJWT:rd,locales:pp,meta:tm,parse:Ar,parseAsync:Cr,prettifyError:Nu,process:_e,regexes:Ui,registry:Xi,safeDecode:uy,safeDecodeAsync:dy,safeEncode:cy,safeEncodeAsync:ly,safeParse:Ur,safeParseAsync:Zr,toDotPath:Tu,toJSONSchema:Pa,treeifyError:Ou,util:Pu,version:jl}),eb=Object.freeze({__proto__:null,endsWith:Yr,gt:zt,gte:He,includes:Wr,length:qn,lowercase:Hr,lt:Nt,lte:ct,maxLength:Gn,maxSize:un,mime:Qr,minLength:Gt,minSize:jt,multipleOf:cn,negative:_a,nonnegative:ba,nonpositive:$a,normalize:eo,overwrite:It,positive:ya,property:ka,regex:Vr,size:Fn,slugify:oo,startsWith:Xr,toLowerCase:no,toUpperCase:ro,trim:to,uppercase:Kr});const xa=b("ZodISODateTime",(e,t)=>{Gl.init(e,t),be.init(e,t)});function Oa(e){return bp(xa,e)}const Ta=b("ZodISODate",(e,t)=>{ql.init(e,t),be.init(e,t)});function Bm(e){return kp(Ta,e)}const Na=b("ZodISOTime",(e,t)=>{Jl.init(e,t),be.init(e,t)});function Lm(e){return Sp(Na,e)}const za=b("ZodISODuration",(e,t)=>{Vl.init(e,t),be.init(e,t)});function Fm(e){return wp(za,e)}var Gm=Object.freeze({__proto__:null,ZodISODate:Ta,ZodISODateTime:xa,ZodISODuration:za,ZodISOTime:Na,date:Bm,datetime:Oa,duration:Fm,time:Lm});const qm=(e,t)=>{wi.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Pi(e,r)},flatten:{value:r=>Ii(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Nr,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Nr,2)}},isEmpty:{get(){return e.issues.length===0}}})},tb=b("ZodError",qm),tt=b("ZodError",qm,{Parent:Error}),Jm=Rn(tt),Vm=Dn(tt),Hm=An(tt),Km=Cn(tt),Wm=xi(tt),Xm=Oi(tt),Ym=Ti(tt),Qm=Ni(tt),ef=zi(tt),tf=ji(tt),nf=Ei(tt),rf=Ri(tt),of=new WeakMap;function Hn(e,t,r){const o=Object.getPrototypeOf(e);let n=of.get(o);if(n||(n=new Set,of.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=b("ZodType",(e,t)=>(ee.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Vn(e,"input"),output:Vn(e,"output")}}),e.toJSONSchema=rm(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,o)=>Jm(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>Hm(e,r,o),e.parseAsync=async(r,o)=>Vm(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>Km(e,r,o),e.spa=e.safeParseAsync,e.encode=(r,o)=>Wm(e,r,o),e.decode=(r,o)=>Xm(e,r,o),e.encodeAsync=async(r,o)=>Ym(e,r,o),e.decodeAsync=async(r,o)=>Qm(e,r,o),e.safeEncode=(r,o)=>ef(e,r,o),e.safeDecode=(r,o)=>tf(e,r,o),e.safeEncodeAsync=async(r,o)=>nf(e,r,o),e.safeDecodeAsync=async(r,o)=>rf(e,r,o),Hn(e,"ZodType",{check(...r){const o=this.def;return this.clone($t(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 Ye(this,r,o)},brand(){return this},register(r,o){return r.add(this,o),this},refine(r,o){return this.check(ys(r,o))},superRefine(r,o){return this.check(_s(r,o))},overwrite(r){return this.check(It(r))},optional(){return we(this)},exactOptional(){return Ya(this)},nullable(){return ir(this)},nullish(){return we(ir(this))},nonoptional(r){return os(this,r)},array(){return re(this)},or(r){return ke([this,r])},and(r){return rr(this,r)},transform(r){return zo(this,To(r))},default(r){return ts(this,r)},prefault(r){return rs(this,r)},catch(r){return ss(this,r)},pipe(r){return zo(this,r)},readonly(){return ds(this)},describe(r){const o=this.clone();return st.add(o,{description:r}),o},meta(...r){if(r.length===0)return st.get(this);const o=this.clone();return st.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 st.get(e)?.description},configurable:!0}),e)),io=b("_ZodString",(e,t)=>{Bn.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(o,n,i)=>om(e,o,n);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,Hn(e,"_ZodString",{regex(...o){return this.check(Vr(...o))},includes(...o){return this.check(Wr(...o))},startsWith(...o){return this.check(Xr(...o))},endsWith(...o){return this.check(Yr(...o))},min(...o){return this.check(Gt(...o))},max(...o){return this.check(Gn(...o))},length(...o){return this.check(qn(...o))},nonempty(...o){return this.check(Gt(1,...o))},lowercase(o){return this.check(Hr(o))},uppercase(o){return this.check(Kr(o))},trim(){return this.check(to())},normalize(...o){return this.check(eo(...o))},toLowerCase(){return this.check(no())},toUpperCase(){return this.check(ro())},slugify(){return this.check(oo())}})}),Kn=b("ZodString",(e,t)=>{Bn.init(e,t),io.init(e,t),e.email=r=>e.check(Yi(ao,r)),e.url=r=>e.check(Jr(Xn,r)),e.jwt=r=>e.check(va(ko,r)),e.emoji=r=>e.check(ra(so,r)),e.guid=r=>e.check(qr(Wn,r)),e.uuid=r=>e.check(Qi(bt,r)),e.uuidv4=r=>e.check(ea(bt,r)),e.uuidv6=r=>e.check(ta(bt,r)),e.uuidv7=r=>e.check(na(bt,r)),e.nanoid=r=>e.check(oa(co,r)),e.guid=r=>e.check(qr(Wn,r)),e.cuid=r=>e.check(ia(uo,r)),e.cuid2=r=>e.check(aa(lo,r)),e.ulid=r=>e.check(sa(po,r)),e.base64=r=>e.check(fa(_o,r)),e.base64url=r=>e.check(ha($o,r)),e.xid=r=>e.check(ca(mo,r)),e.ksuid=r=>e.check(ua(fo,r)),e.ipv4=r=>e.check(la(ho,r)),e.ipv6=r=>e.check(da(go,r)),e.cidrv4=r=>e.check(pa(vo,r)),e.cidrv6=r=>e.check(ma(yo,r)),e.e164=r=>e.check(ga(bo,r)),e.datetime=r=>e.check(Oa(r)),e.date=r=>e.check(Bm(r)),e.time=r=>e.check(Lm(r)),e.duration=r=>e.check(Fm(r))});function k(e){return vp(Kn,e)}const be=b("ZodStringFormat",(e,t)=>{$e.init(e,t),io.init(e,t)}),ao=b("ZodEmail",(e,t)=>{Dl.init(e,t),be.init(e,t)});function af(e){return Yi(ao,e)}const Wn=b("ZodGUID",(e,t)=>{El.init(e,t),be.init(e,t)});function sf(e){return qr(Wn,e)}const bt=b("ZodUUID",(e,t)=>{Rl.init(e,t),be.init(e,t)});function cf(e){return Qi(bt,e)}function uf(e){return ea(bt,e)}function lf(e){return ta(bt,e)}function df(e){return na(bt,e)}const Xn=b("ZodURL",(e,t)=>{Al.init(e,t),be.init(e,t)});function pf(e){return Jr(Xn,e)}function mf(e){return Jr(Xn,{protocol:Ai,hostname:Ku,...z(e)})}const so=b("ZodEmoji",(e,t)=>{Cl.init(e,t),be.init(e,t)});function ff(e){return ra(so,e)}const co=b("ZodNanoID",(e,t)=>{Ul.init(e,t),be.init(e,t)});function hf(e){return oa(co,e)}const uo=b("ZodCUID",(e,t)=>{Zl.init(e,t),be.init(e,t)});function gf(e){return ia(uo,e)}const lo=b("ZodCUID2",(e,t)=>{Ml.init(e,t),be.init(e,t)});function vf(e){return aa(lo,e)}const po=b("ZodULID",(e,t)=>{Bl.init(e,t),be.init(e,t)});function yf(e){return sa(po,e)}const mo=b("ZodXID",(e,t)=>{Ll.init(e,t),be.init(e,t)});function _f(e){return ca(mo,e)}const fo=b("ZodKSUID",(e,t)=>{Fl.init(e,t),be.init(e,t)});function $f(e){return ua(fo,e)}const ho=b("ZodIPv4",(e,t)=>{Hl.init(e,t),be.init(e,t)});function bf(e){return la(ho,e)}const ja=b("ZodMAC",(e,t)=>{Wl.init(e,t),be.init(e,t)});function kf(e){return _p(ja,e)}const go=b("ZodIPv6",(e,t)=>{Kl.init(e,t),be.init(e,t)});function Sf(e){return da(go,e)}const vo=b("ZodCIDRv4",(e,t)=>{Xl.init(e,t),be.init(e,t)});function wf(e){return pa(vo,e)}const yo=b("ZodCIDRv6",(e,t)=>{Yl.init(e,t),be.init(e,t)});function If(e){return ma(yo,e)}const _o=b("ZodBase64",(e,t)=>{Ql.init(e,t),be.init(e,t)});function Pf(e){return fa(_o,e)}const $o=b("ZodBase64URL",(e,t)=>{td.init(e,t),be.init(e,t)});function xf(e){return ha($o,e)}const bo=b("ZodE164",(e,t)=>{nd.init(e,t),be.init(e,t)});function Of(e){return ga(bo,e)}const ko=b("ZodJWT",(e,t)=>{od.init(e,t),be.init(e,t)});function Tf(e){return va(ko,e)}const mn=b("ZodCustomStringFormat",(e,t)=>{id.init(e,t),be.init(e,t)});function Nf(e,t,r={}){return Jn(mn,e,t,r)}function zf(e){return Jn(mn,"hostname",Hu,e)}function jf(e){return Jn(mn,"hex",ll,e)}function Ef(e,t){const r=t?.enc??"hex",o=`${e}_${r}`,n=Ui[o];if(!n)throw new Error(`Unrecognized hash format: ${o}`);return Jn(mn,o,n,t)}const Yn=b("ZodNumber",(e,t)=>{Li.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(o,n,i)=>im(e,o,n),Hn(e,"ZodNumber",{gt(o,n){return this.check(zt(o,n))},gte(o,n){return this.check(He(o,n))},min(o,n){return this.check(He(o,n))},lt(o,n){return this.check(Nt(o,n))},lte(o,n){return this.check(ct(o,n))},max(o,n){return this.check(ct(o,n))},int(o){return this.check(So(o))},safe(o){return this.check(So(o))},positive(o){return this.check(zt(0,o))},nonnegative(o){return this.check(He(0,o))},negative(o){return this.check(Nt(0,o))},nonpositive(o){return this.check(ct(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 ae(e){return Ip(Yn,e)}const qt=b("ZodNumberFormat",(e,t)=>{ad.init(e,t),Yn.init(e,t)});function So(e){return xp(qt,e)}function Rf(e){return Op(qt,e)}function Df(e){return Tp(qt,e)}function Af(e){return Np(qt,e)}function Cf(e){return zp(qt,e)}const Qn=b("ZodBoolean",(e,t)=>{Fi.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>am(e,r,o)});function Ne(e){return jp(Qn,e)}const er=b("ZodBigInt",(e,t)=>{Gi.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(o,n,i)=>sm(e,o),e.gte=(o,n)=>e.check(He(o,n)),e.min=(o,n)=>e.check(He(o,n)),e.gt=(o,n)=>e.check(zt(o,n)),e.gte=(o,n)=>e.check(He(o,n)),e.min=(o,n)=>e.check(He(o,n)),e.lt=(o,n)=>e.check(Nt(o,n)),e.lte=(o,n)=>e.check(ct(o,n)),e.max=(o,n)=>e.check(ct(o,n)),e.positive=o=>e.check(zt(BigInt(0),o)),e.negative=o=>e.check(Nt(BigInt(0),o)),e.nonpositive=o=>e.check(ct(BigInt(0),o)),e.nonnegative=o=>e.check(He(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 Uf(e){return Rp(er,e)}const wo=b("ZodBigIntFormat",(e,t)=>{sd.init(e,t),er.init(e,t)});function Zf(e){return Ap(wo,e)}function Mf(e){return Cp(wo,e)}const Ea=b("ZodSymbol",(e,t)=>{cd.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>cm(e,r)});function Bf(e){return Up(Ea,e)}const Ra=b("ZodUndefined",(e,t)=>{ud.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>lm(e,r)});function Lf(e){return Zp(Ra,e)}const Da=b("ZodNull",(e,t)=>{ld.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>um(e,r,o)});function Io(e){return Mp(Da,e)}const Aa=b("ZodAny",(e,t)=>{dd.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>mm()});function Ff(){return Bp(Aa)}const Ca=b("ZodUnknown",(e,t)=>{pd.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>fm()});function fe(){return Lp(Ca)}const Ua=b("ZodNever",(e,t)=>{md.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>pm(e,r,o)});function Po(e){return Fp(Ua,e)}const Za=b("ZodVoid",(e,t)=>{fd.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>dm(e,r)});function Gf(e){return Gp(Za,e)}const xo=b("ZodDate",(e,t)=>{hd.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(o,n,i)=>hm(e,o),e.min=(o,n)=>e.check(He(o,n)),e.max=(o,n)=>e.check(ct(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 qf(e){return qp(xo,e)}const Ma=b("ZodArray",(e,t)=>{vd.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>xm(e,r,o,n),e.element=t.element,Hn(e,"ZodArray",{min(r,o){return this.check(Gt(r,o))},nonempty(r){return this.check(Gt(1,r))},max(r,o){return this.check(Gn(r,o))},length(r,o){return this.check(qn(r,o))},unwrap(){return this.element}})});function re(e,t){return Hp(Ma,e,t)}function Jf(e){const t=e._zod.def.shape;return Be(Object.keys(t))}const tr=b("ZodObject",(e,t)=>{$d.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Om(e,r,o,n),ie(e,"shape",()=>t.shape),Hn(e,"ZodObject",{keyof(){return Be(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:fe()})},loose(){return this.clone({...this._zod.def,catchall:fe()})},strict(){return this.clone({...this._zod.def,catchall:Po()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return yu(this,r)},safeExtend(r){return _u(this,r)},merge(r){return $u(this,r)},pick(r){return gu(this,r)},omit(r){return vu(this,r)},partial(...r){return bu(or,this,r[0])},required(...r){return ku(No,this,r[0])}})});function U(e,t){const r={type:"object",shape:e??{},...z(t)};return new tr(r)}function Vf(e,t){return new tr({type:"object",shape:e,catchall:Po(),...z(t)})}function Me(e,t){return new tr({type:"object",shape:e,catchall:fe(),...z(t)})}const nr=b("ZodUnion",(e,t)=>{Br.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Sa(e,r,o,n),e.options=t.options});function ke(e,t){return new nr({type:"union",options:e,...z(t)})}const Ba=b("ZodXor",(e,t)=>{nr.init(e,t),Sd.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Sa(e,r,o,n),e.options=t.options});function Hf(e,t){return new Ba({type:"union",options:e,inclusive:!1,...z(t)})}const La=b("ZodDiscriminatedUnion",(e,t)=>{nr.init(e,t),wd.init(e,t)});function Oo(e,t,r){return new La({type:"union",options:t,discriminator:e,...z(r)})}const Fa=b("ZodIntersection",(e,t)=>{Id.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Tm(e,r,o,n)});function rr(e,t){return new Fa({type:"intersection",left:e,right:t})}const Ga=b("ZodTuple",(e,t)=>{Vi.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Nm(e,r,o,n),e.rest=r=>e.clone({...e._zod.def,rest:r})});function qa(e,t,r){const o=t instanceof ee,n=o?r:t,i=o?t:null;return new Ga({type:"tuple",items:e,rest:i,...z(n)})}const fn=b("ZodRecord",(e,t)=>{Nd.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>zm(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});function ge(e,t,r){return!t||!t._zod?new fn({type:"record",keyType:k(),valueType:e,...z(t)}):new fn({type:"record",keyType:e,valueType:t,...z(r)})}function Kf(e,t,r){const o=Ye(e);return o._zod.values=void 0,new fn({type:"record",keyType:o,valueType:t,...z(r)})}function Wf(e,t,r){return new fn({type:"record",keyType:e,valueType:t,mode:"loose",...z(r)})}const Ja=b("ZodMap",(e,t)=>{zd.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Im(e,r),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(jt(...r)),e.nonempty=r=>e.check(jt(1,r)),e.max=(...r)=>e.check(un(...r)),e.size=(...r)=>e.check(Fn(...r))});function Xf(e,t,r){return new Ja({type:"map",keyType:e,valueType:t,...z(r)})}const Va=b("ZodSet",(e,t)=>{Ed.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Pm(e,r),e.min=(...r)=>e.check(jt(...r)),e.nonempty=r=>e.check(jt(1,r)),e.max=(...r)=>e.check(un(...r)),e.size=(...r)=>e.check(Fn(...r))});function Yf(e,t){return new Va({type:"set",valueType:e,...z(t)})}const hn=b("ZodEnum",(e,t)=>{Dd.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(o,n,i)=>gm(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:[],...z(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:[],...z(n),entries:i})}});function Be(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new hn({type:"enum",entries:r,...z(t)})}function Qf(e,t){return new hn({type:"enum",entries:e,...z(t)})}const Ha=b("ZodLiteral",(e,t)=>{Ad.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>vm(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 F(e,t){return new Ha({type:"literal",values:Array.isArray(e)?e:[e],...z(t)})}const Ka=b("ZodFile",(e,t)=>{Cd.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>$m(e,r,o),e.min=(r,o)=>e.check(jt(r,o)),e.max=(r,o)=>e.check(un(r,o)),e.mime=(r,o)=>e.check(Qr(Array.isArray(r)?r:[r],o))});function eh(e){return Kp(Ka,e)}const Wa=b("ZodTransform",(e,t)=>{Ud.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>wm(e,r),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Tr(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 To(e){return new Wa({type:"transform",transform:e})}const or=b("ZodOptional",(e,t)=>{Hi.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>wa(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function we(e){return new or({type:"optional",innerType:e})}const Xa=b("ZodExactOptional",(e,t)=>{Md.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>wa(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Ya(e){return new Xa({type:"optional",innerType:e})}const Qa=b("ZodNullable",(e,t)=>{Bd.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>jm(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function ir(e){return new Qa({type:"nullable",innerType:e})}function th(e){return we(ir(e))}const es=b("ZodDefault",(e,t)=>{Ld.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Rm(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ts(e,t){return new es({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():jr(t)}})}const ns=b("ZodPrefault",(e,t)=>{Gd.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Dm(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function rs(e,t){return new ns({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():jr(t)}})}const No=b("ZodNonOptional",(e,t)=>{qd.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Em(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function os(e,t){return new No({type:"nonoptional",innerType:e,...z(t)})}const is=b("ZodSuccess",(e,t)=>{Vd.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>bm(e,r,o),e.unwrap=()=>e._zod.def.innerType});function nh(e){return new is({type:"success",innerType:e})}const as=b("ZodCatch",(e,t)=>{Hd.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Am(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function ss(e,t){return new as({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const cs=b("ZodNaN",(e,t)=>{Kd.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ym(e,r)});function rh(e){return Vp(cs,e)}const ar=b("ZodPipe",(e,t)=>{Ki.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Cm(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=b("ZodCodec",(e,t)=>{ar.init(e,t),Wi.init(e,t)});function oh(e,t,r){return new sr({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}function ih(e){const t=e._zod.def;return new sr({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}const us=b("ZodPreprocess",(e,t)=>{ar.init(e,t),Wd.init(e,t)}),ls=b("ZodReadonly",(e,t)=>{Xd.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Um(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function ds(e){return new ls({type:"readonly",innerType:e})}const ps=b("ZodTemplateLiteral",(e,t)=>{Qd.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>_m(e,r,o)});function ah(e,t){return new ps({type:"template_literal",parts:e,...z(t)})}const ms=b("ZodLazy",(e,t)=>{np.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Mm(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});function fs(e){return new ms({type:"lazy",getter:e})}const hs=b("ZodPromise",(e,t)=>{tp.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Zm(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function sh(e){return new hs({type:"promise",innerType:e})}const gs=b("ZodFunction",(e,t)=>{ep.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Sm(e,r)});function jo(e){return new gs({type:"function",input:Array.isArray(e?.input)?qa(e?.input):e?.input??re(fe()),output:e?.output??fe()})}const cr=b("ZodCustom",(e,t)=>{rp.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(r,o,n)=>km(e,r)});function ch(e){const t=new Ie({check:"custom"});return t._zod.check=e,t}function vs(e,t){return Wp(cr,e??(()=>!0),t)}function ys(e,t={}){return Xp(cr,e,t)}function _s(e,t){return Yp(e,t)}const uh=em,lh=tm;function dh(e,t={}){const r=new cr({type:"custom",check:"custom",fn:o=>o instanceof e,abort:!0,...z(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 ph=(...e)=>nm({Codec:sr,Boolean:Qn,String:Kn},...e);function mh(e){const t=fs(()=>ke([k(e),ae(),Ne(),Io(),re(t),ge(k(),t)]));return t}function Eo(e,t){return new us({type:"pipe",in:To(e),out:t})}var nb=Object.freeze({__proto__:null,ZodAny:Aa,ZodArray:Ma,ZodBase64:_o,ZodBase64URL:$o,ZodBigInt:er,ZodBigIntFormat:wo,ZodBoolean:Qn,ZodCIDRv4:vo,ZodCIDRv6:yo,ZodCUID:uo,ZodCUID2:lo,ZodCatch:as,ZodCodec:sr,ZodCustom:cr,ZodCustomStringFormat:mn,ZodDate:xo,ZodDefault:es,ZodDiscriminatedUnion:La,ZodE164:bo,ZodEmail:ao,ZodEmoji:so,ZodEnum:hn,ZodExactOptional:Xa,ZodFile:Ka,ZodFunction:gs,ZodGUID:Wn,ZodIPv4:ho,ZodIPv6:go,ZodIntersection:Fa,ZodJWT:ko,ZodKSUID:fo,ZodLazy:ms,ZodLiteral:Ha,ZodMAC:ja,ZodMap:Ja,ZodNaN:cs,ZodNanoID:co,ZodNever:Ua,ZodNonOptional:No,ZodNull:Da,ZodNullable:Qa,ZodNumber:Yn,ZodNumberFormat:qt,ZodObject:tr,ZodOptional:or,ZodPipe:ar,ZodPrefault:ns,ZodPreprocess:us,ZodPromise:hs,ZodReadonly:ls,ZodRecord:fn,ZodSet:Va,ZodString:Kn,ZodStringFormat:be,ZodSuccess:is,ZodSymbol:Ea,ZodTemplateLiteral:ps,ZodTransform:Wa,ZodTuple:Ga,ZodType:ne,ZodULID:po,ZodURL:Xn,ZodUUID:bt,ZodUndefined:Ra,ZodUnion:nr,ZodUnknown:Ca,ZodVoid:Za,ZodXID:mo,ZodXor:Ba,_ZodString:io,_default:ts,_function:jo,any:Ff,array:re,base64:Pf,base64url:xf,bigint:Uf,boolean:Ne,catch:ss,check:ch,cidrv4:wf,cidrv6:If,codec:oh,cuid:gf,cuid2:vf,custom:vs,date:qf,describe:uh,discriminatedUnion:Oo,e164:Of,email:af,emoji:ff,enum:Be,exactOptional:Ya,file:eh,float32:Rf,float64:Df,function:jo,guid:sf,hash:Ef,hex:jf,hostname:zf,httpUrl:mf,instanceof:dh,int:So,int32:Af,int64:Zf,intersection:rr,invertCodec:ih,ipv4:bf,ipv6:Sf,json:mh,jwt:Tf,keyof:Jf,ksuid:$f,lazy:fs,literal:F,looseObject:Me,looseRecord:Wf,mac:kf,map:Xf,meta:lh,nan:rh,nanoid:hf,nativeEnum:Qf,never:Po,nonoptional:os,null:Io,nullable:ir,nullish:th,number:ae,object:U,optional:we,partialRecord:Kf,pipe:zo,prefault:rs,preprocess:Eo,promise:sh,readonly:ds,record:ge,refine:ys,set:Yf,strictObject:Vf,string:k,stringFormat:Nf,stringbool:ph,success:nh,superRefine:_s,symbol:Bf,templateLiteral:ah,transform:To,tuple:qa,uint32:Cf,uint64:Mf,ulid:yf,undefined:Lf,union:ke,unknown:fe,url:pf,uuid:cf,uuidv4:uf,uuidv6:lf,uuidv7:df,void:Gf,xid:_f,xor:Hf});const rb={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 ob(e){De({customError:e})}function ib(){return De().customError}var te;te||(te={});const C={...nb,...eb,iso:Gm},ab=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 sb(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 cb(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 fh(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return C.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 C.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=cb(n,t),a=Le(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 C.null();if(n.length===0)return C.never();if(n.length===1)return C.literal(n[0]);if(n.every(a=>typeof a=="string"))return C.enum(n);const i=n.map(a=>C.literal(a));return i.length<2?i[0]:C.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return C.literal(e.const);const r=e.type;if(Array.isArray(r)){const n=r.map(i=>{const a={...e,type:i};return fh(a,t)});return n.length===0?C.never():n.length===1?n[0]:C.union(n)}if(!r)return C.any();let o;switch(r){case"string":{let n=C.string();if(e.format){const i=e.format;i==="email"?n=n.check(C.email()):i==="uri"||i==="uri-reference"?n=n.check(C.url()):i==="uuid"||i==="guid"?n=n.check(C.uuid()):i==="date-time"?n=n.check(C.iso.datetime()):i==="date"?n=n.check(C.iso.date()):i==="time"?n=n.check(C.iso.time()):i==="duration"?n=n.check(C.iso.duration()):i==="ipv4"?n=n.check(C.ipv4()):i==="ipv6"?n=n.check(C.ipv6()):i==="mac"?n=n.check(C.mac()):i==="cidr"?n=n.check(C.cidrv4()):i==="cidr-v6"?n=n.check(C.cidrv6()):i==="base64"?n=n.check(C.base64()):i==="base64url"?n=n.check(C.base64url()):i==="e164"?n=n.check(C.e164()):i==="jwt"?n=n.check(C.jwt()):i==="emoji"?n=n.check(C.emoji()):i==="nanoid"?n=n.check(C.nanoid()):i==="cuid"?n=n.check(C.cuid()):i==="cuid2"?n=n.check(C.cuid2()):i==="ulid"?n=n.check(C.ulid()):i==="xid"?n=n.check(C.xid()):i==="ksuid"&&(n=n.check(C.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"?C.number().int():C.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=C.boolean();break}case"null":{o=C.null();break}case"object":{const n={},i=e.properties||{},a=new Set(e.required||[]);for(const[c,u]of Object.entries(i)){const l=Le(u,t);n[c]=a.has(c)?l:l.optional()}if(e.propertyNames){const c=Le(e.propertyNames,t),u=e.additionalProperties&&typeof e.additionalProperties=="object"?Le(e.additionalProperties,t):C.any();if(Object.keys(n).length===0){o=C.record(c,u);break}const l=C.object(n).passthrough(),d=C.looseRecord(c,u);o=C.intersection(l,d);break}if(e.patternProperties){const c=e.patternProperties,u=Object.keys(c),l=[];for(const m of u){const p=Le(c[m],t),h=C.string().regex(new RegExp(m));l.push(C.looseRecord(h,p))}const d=[];if(Object.keys(n).length>0&&d.push(C.object(n).passthrough()),d.push(...l),d.length===0)o=C.object({}).passthrough();else if(d.length===1)o=d[0];else{let m=C.intersection(d[0],d[1]);for(let p=2;p<d.length;p++)m=C.intersection(m,d[p]);o=m}break}const s=C.object(n);e.additionalProperties===!1?o=s.strict():typeof e.additionalProperties=="object"?o=s.catchall(Le(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=>Le(c,t)),s=i&&typeof i=="object"&&!Array.isArray(i)?Le(i,t):void 0;s?o=C.tuple(a).rest(s):o=C.tuple(a),typeof e.minItems=="number"&&(o=o.check(C.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(C.maxLength(e.maxItems)))}else if(Array.isArray(i)){const a=i.map(c=>Le(c,t)),s=e.additionalItems&&typeof e.additionalItems=="object"?Le(e.additionalItems,t):void 0;s?o=C.tuple(a).rest(s):o=C.tuple(a),typeof e.minItems=="number"&&(o=o.check(C.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(C.maxLength(e.maxItems)))}else if(i!==void 0){const a=Le(i,t);let s=C.array(a);typeof e.minItems=="number"&&(s=s.min(e.minItems)),typeof e.maxItems=="number"&&(s=s.max(e.maxItems)),o=s}else o=C.array(C.any());break}default:throw new Error(`Unsupported type: ${r}`)}return o}function Le(e,t){if(typeof e=="boolean")return e?C.any():C.never();let r=fh(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=>Le(u,t)),c=C.union(s);r=o?C.intersection(r,c):c}if(e.oneOf&&Array.isArray(e.oneOf)){const s=e.oneOf.map(u=>Le(u,t)),c=C.xor(s);r=o?C.intersection(r,c):c}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=o?r:C.any();else{let s=o?r:Le(e.allOf[0],t);const c=o?0:1;for(let u=c;u<e.allOf.length;u++)s=C.intersection(s,Le(e.allOf[u],t));r=s}e.nullable===!0&&t.version==="openapi-3.0"&&(r=C.nullable(r)),e.readOnly===!0&&(r=C.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))ab.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 ub(e,t){if(typeof e=="boolean")return e?C.any():C.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=sb(r,t?.defaultTarget),n=r.$defs||r.definitions||{},i={version:o,defs:n,refs:new Map,processing:new Set,rootSchema:r,registry:t?.registry??st};return Le(r,i)}function lb(e){return yp(Kn,e)}function db(e){return Pp(Yn,e)}function pb(e){return Ep(Qn,e)}function mb(e){return Dp(er,e)}function fb(e){return Jp(xo,e)}var hb=Object.freeze({__proto__:null,bigint:mb,boolean:pb,date:fb,number:db,string:lb});De(ap());var gn=Object.freeze({__proto__:null,$brand:su,$input:hp,$output:fp,NEVER:au,TimePrecision:$p,ZodAny:Aa,ZodArray:Ma,ZodBase64:_o,ZodBase64URL:$o,ZodBigInt:er,ZodBigIntFormat:wo,ZodBoolean:Qn,ZodCIDRv4:vo,ZodCIDRv6:yo,ZodCUID:uo,ZodCUID2:lo,ZodCatch:as,ZodCodec:sr,ZodCustom:cr,ZodCustomStringFormat:mn,ZodDate:xo,ZodDefault:es,ZodDiscriminatedUnion:La,ZodE164:bo,ZodEmail:ao,ZodEmoji:so,ZodEnum:hn,ZodError:tb,ZodExactOptional:Xa,ZodFile:Ka,get ZodFirstPartyTypeKind(){return te},ZodFunction:gs,ZodGUID:Wn,ZodIPv4:ho,ZodIPv6:go,ZodISODate:Ta,ZodISODateTime:xa,ZodISODuration:za,ZodISOTime:Na,ZodIntersection:Fa,ZodIssueCode:rb,ZodJWT:ko,ZodKSUID:fo,ZodLazy:ms,ZodLiteral:Ha,ZodMAC:ja,ZodMap:Ja,ZodNaN:cs,ZodNanoID:co,ZodNever:Ua,ZodNonOptional:No,ZodNull:Da,ZodNullable:Qa,ZodNumber:Yn,ZodNumberFormat:qt,ZodObject:tr,ZodOptional:or,ZodPipe:ar,ZodPrefault:ns,ZodPreprocess:us,ZodPromise:hs,ZodReadonly:ls,ZodRealError:tt,ZodRecord:fn,ZodSet:Va,ZodString:Kn,ZodStringFormat:be,ZodSuccess:is,ZodSymbol:Ea,ZodTemplateLiteral:ps,ZodTransform:Wa,ZodTuple:Ga,ZodType:ne,ZodULID:po,ZodURL:Xn,ZodUUID:bt,ZodUndefined:Ra,ZodUnion:nr,ZodUnknown:Ca,ZodVoid:Za,ZodXID:mo,ZodXor:Ba,_ZodString:io,_default:ts,_function:jo,any:Ff,array:re,base64:Pf,base64url:xf,bigint:Uf,boolean:Ne,catch:ss,check:ch,cidrv4:wf,cidrv6:If,clone:Ye,codec:oh,coerce:hb,config:De,core:Q$,cuid:gf,cuid2:vf,custom:vs,date:qf,decode:Xm,decodeAsync:Qm,describe:uh,discriminatedUnion:Oo,e164:Of,email:af,emoji:ff,encode:Wm,encodeAsync:Ym,endsWith:Yr,enum:Be,exactOptional:Ya,file:eh,flattenError:Ii,float32:Rf,float64:Df,formatError:Pi,fromJSONSchema:ub,function:jo,getErrorMap:ib,globalRegistry:st,gt:zt,gte:He,guid:sf,hash:Ef,hex:jf,hostname:zf,httpUrl:mf,includes:Wr,instanceof:dh,int:So,int32:Af,int64:Zf,intersection:rr,invertCodec:ih,ipv4:bf,ipv6:Sf,iso:Gm,json:mh,jwt:Tf,keyof:Jf,ksuid:$f,lazy:fs,length:qn,literal:F,locales:pp,looseObject:Me,looseRecord:Wf,lowercase:Hr,lt:Nt,lte:ct,mac:kf,map:Xf,maxLength:Gn,maxSize:un,meta:lh,mime:Qr,minLength:Gt,minSize:jt,multipleOf:cn,nan:rh,nanoid:hf,nativeEnum:Qf,negative:_a,never:Po,nonnegative:ba,nonoptional:os,nonpositive:$a,normalize:eo,null:Io,nullable:ir,nullish:th,number:ae,object:U,optional:we,overwrite:It,parse:Jm,parseAsync:Vm,partialRecord:Kf,pipe:zo,positive:ya,prefault:rs,preprocess:Eo,prettifyError:Nu,promise:sh,property:ka,readonly:ds,record:ge,refine:ys,regex:Vr,regexes:Ui,registry:Xi,safeDecode:tf,safeDecodeAsync:rf,safeEncode:ef,safeEncodeAsync:nf,safeParse:Hm,safeParseAsync:Km,set:Yf,setErrorMap:ob,size:Fn,slugify:oo,startsWith:Xr,strictObject:Vf,string:k,stringFormat:Nf,stringbool:ph,success:nh,superRefine:_s,symbol:Bf,templateLiteral:ah,toJSONSchema:Pa,toLowerCase:no,toUpperCase:ro,transform:To,treeifyError:Ou,trim:to,tuple:qa,uint32:Cf,uint64:Mf,ulid:yf,undefined:Lf,union:ke,unknown:fe,uppercase:Kr,url:pf,util:Pu,uuid:cf,uuidv4:uf,uuidv6:lf,uuidv7:df,void:Gf,xid:_f,xor:Hf});const gb=b("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)=>Ar(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>Ur(e,r,o),e.parseAsync=async(r,o)=>Cr(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>Zr(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)=>Ye(e,r,o),e.brand=()=>e,e.register=((r,o)=>(r.add(e,o),e)),e.apply=r=>r(e)}),vb=b("ZodMiniObject",(e,t)=>{qi.init(e,t),gb.init(e,t),ie(e,"shape",()=>t.shape)});function hh(e,t){const r={type:"object",shape:e??{},...z(t)};return new vb(r)}function kt(e){return!!e._zod}function vn(e){const t=Object.values(e);if(t.length===0)return hh({});const r=t.every(kt),o=t.every(n=>!kt(n));if(r)return hh(e);if(o)return U(e);throw new Error("Mixed Zod versions detected in object shape.")}function ur(e,t){return kt(e)?Ur(e,t):e.safeParse(t)}async function $s(e,t){return kt(e)?await Zr(e,t):await e.safeParseAsync(t)}function lr(e){if(!e)return;let t;if(kt(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 vn(e)}}if(kt(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 bs(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 yb(e){return e.description}function _b(e){if(kt(e))return e._zod?.def?.type==="optional";const t=e;return typeof e.isOptional=="function"?e.isOptional():t._def?.typeName==="ZodOptional"}function gh(e){if(kt(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 vh="2025-11-25",$b=[vh,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Jt="io.modelcontextprotocol/related-task",Ro="2.0",ze=vs(e=>e!==null&&(typeof e=="object"||typeof e=="function")),yh=ke([k(),ae().int()]),_h=k();Me({ttl:ae().optional(),pollInterval:ae().optional()});const bb=U({ttl:ae().optional()}),kb=U({taskId:k()}),ks=Me({progressToken:yh.optional(),[Jt]:kb.optional()}),nt=U({_meta:ks.optional()}),pr=nt.extend({task:bb.optional()}),Sb=e=>pr.safeParse(e).success,Ae=U({method:k(),params:nt.loose().optional()}),ut=U({_meta:ks.optional()}),lt=U({method:k(),params:ut.loose().optional()}),Ce=Me({_meta:ks.optional()}),Do=ke([k(),ae().int()]),$h=U({jsonrpc:F(Ro),id:Do,...Ae.shape}).strict(),bh=e=>$h.safeParse(e).success,kh=U({jsonrpc:F(Ro),...lt.shape}).strict(),wb=e=>kh.safeParse(e).success,Ss=U({jsonrpc:F(Ro),id:Do,result:Ce}).strict(),Ao=e=>Ss.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 ws=U({jsonrpc:F(Ro),id:Do.optional(),error:U({code:ae().int(),message:k(),data:fe().optional()})}).strict(),Ib=e=>ws.safeParse(e).success,Pb=ke([$h,kh,Ss,ws]);ke([Ss,ws]);const Is=Ce.strict(),xb=ut.extend({requestId:Do.optional(),reason:k().optional()}),Ps=lt.extend({method:F("notifications/cancelled"),params:xb}),Ob=U({src:k(),mimeType:k().optional(),sizes:re(k()).optional(),theme:Be(["light","dark"]).optional()}),mr=U({icons:re(Ob).optional()}),yn=U({name:k(),title:k().optional()}),Sh=yn.extend({...yn.shape,...mr.shape,version:k(),websiteUrl:k().optional(),description:k().optional()}),Tb=rr(U({applyDefaults:Ne().optional()}),ge(k(),fe())),Nb=Eo(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,rr(U({form:Tb.optional(),url:ze.optional()}),ge(k(),fe()).optional())),zb=Me({list:ze.optional(),cancel:ze.optional(),requests:Me({sampling:Me({createMessage:ze.optional()}).optional(),elicitation:Me({create:ze.optional()}).optional()}).optional()}),jb=Me({list:ze.optional(),cancel:ze.optional(),requests:Me({tools:Me({call:ze.optional()}).optional()}).optional()}),Eb=U({experimental:ge(k(),ze).optional(),sampling:U({context:ze.optional(),tools:ze.optional()}).optional(),elicitation:Nb.optional(),roots:U({listChanged:Ne().optional()}).optional(),tasks:zb.optional(),extensions:ge(k(),ze).optional()}),Rb=nt.extend({protocolVersion:k(),capabilities:Eb,clientInfo:Sh}),wh=Ae.extend({method:F("initialize"),params:Rb}),Db=U({experimental:ge(k(),ze).optional(),logging:ze.optional(),completions:ze.optional(),prompts:U({listChanged:Ne().optional()}).optional(),resources:U({subscribe:Ne().optional(),listChanged:Ne().optional()}).optional(),tools:U({listChanged:Ne().optional()}).optional(),tasks:jb.optional(),extensions:ge(k(),ze).optional()}),Ab=Ce.extend({protocolVersion:k(),capabilities:Db,serverInfo:Sh,instructions:k().optional()}),Ih=lt.extend({method:F("notifications/initialized"),params:ut.optional()}),xs=Ae.extend({method:F("ping"),params:nt.optional()}),Cb=U({progress:ae(),total:we(ae()),message:we(k())}),Ub=U({...ut.shape,...Cb.shape,progressToken:yh}),Os=lt.extend({method:F("notifications/progress"),params:Ub}),Zb=nt.extend({cursor:_h.optional()}),fr=Ae.extend({params:Zb.optional()}),hr=Ce.extend({nextCursor:_h.optional()}),Mb=Be(["working","input_required","completed","failed","cancelled"]),gr=U({taskId:k(),status:Mb,ttl:ke([ae(),Io()]),createdAt:k(),lastUpdatedAt:k(),pollInterval:we(ae()),statusMessage:we(k())}),Co=Ce.extend({task:gr}),Bb=ut.merge(gr),Uo=lt.extend({method:F("notifications/tasks/status"),params:Bb}),Ts=Ae.extend({method:F("tasks/get"),params:nt.extend({taskId:k()})}),Ns=Ce.merge(gr),zs=Ae.extend({method:F("tasks/result"),params:nt.extend({taskId:k()})});Ce.loose();const js=fr.extend({method:F("tasks/list")}),Es=hr.extend({tasks:re(gr)}),Rs=Ae.extend({method:F("tasks/cancel"),params:nt.extend({taskId:k()})}),Lb=Ce.merge(gr),Ph=U({uri:k(),mimeType:we(k()),_meta:ge(k(),fe()).optional()}),xh=Ph.extend({text:k()}),Ds=k().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),Oh=Ph.extend({blob:Ds}),vr=Be(["user","assistant"]),_n=U({audience:re(vr).optional(),priority:ae().min(0).max(1).optional(),lastModified:Oa({offset:!0}).optional()}),Th=U({...yn.shape,...mr.shape,uri:k(),description:we(k()),mimeType:we(k()),size:we(ae()),annotations:_n.optional(),_meta:we(Me({}))}),Fb=U({...yn.shape,...mr.shape,uriTemplate:k(),description:we(k()),mimeType:we(k()),annotations:_n.optional(),_meta:we(Me({}))}),As=fr.extend({method:F("resources/list")}),Gb=hr.extend({resources:re(Th)}),Cs=fr.extend({method:F("resources/templates/list")}),qb=hr.extend({resourceTemplates:re(Fb)}),Us=nt.extend({uri:k()}),Jb=Us,Zs=Ae.extend({method:F("resources/read"),params:Jb}),Vb=Ce.extend({contents:re(ke([xh,Oh]))}),Hb=lt.extend({method:F("notifications/resources/list_changed"),params:ut.optional()}),Kb=Us,Wb=Ae.extend({method:F("resources/subscribe"),params:Kb}),Xb=Us,Yb=Ae.extend({method:F("resources/unsubscribe"),params:Xb}),Qb=ut.extend({uri:k()}),ek=lt.extend({method:F("notifications/resources/updated"),params:Qb}),tk=U({name:k(),description:we(k()),required:we(Ne())}),nk=U({...yn.shape,...mr.shape,description:we(k()),arguments:we(re(tk)),_meta:we(Me({}))}),Ms=fr.extend({method:F("prompts/list")}),rk=hr.extend({prompts:re(nk)}),ok=nt.extend({name:k(),arguments:ge(k(),k()).optional()}),Bs=Ae.extend({method:F("prompts/get"),params:ok}),Ls=U({type:F("text"),text:k(),annotations:_n.optional(),_meta:ge(k(),fe()).optional()}),Fs=U({type:F("image"),data:Ds,mimeType:k(),annotations:_n.optional(),_meta:ge(k(),fe()).optional()}),Gs=U({type:F("audio"),data:Ds,mimeType:k(),annotations:_n.optional(),_meta:ge(k(),fe()).optional()}),ik=U({type:F("tool_use"),name:k(),id:k(),input:ge(k(),fe()),_meta:ge(k(),fe()).optional()}),ak=U({type:F("resource"),resource:ke([xh,Oh]),annotations:_n.optional(),_meta:ge(k(),fe()).optional()}),sk=Th.extend({type:F("resource_link")}),qs=ke([Ls,Fs,Gs,sk,ak]),ck=U({role:vr,content:qs}),uk=Ce.extend({description:k().optional(),messages:re(ck)}),lk=lt.extend({method:F("notifications/prompts/list_changed"),params:ut.optional()}),dk=U({title:k().optional(),readOnlyHint:Ne().optional(),destructiveHint:Ne().optional(),idempotentHint:Ne().optional(),openWorldHint:Ne().optional()}),pk=U({taskSupport:Be(["required","optional","forbidden"]).optional()}),Nh=U({...yn.shape,...mr.shape,description:k().optional(),inputSchema:U({type:F("object"),properties:ge(k(),ze).optional(),required:re(k()).optional()}).catchall(fe()),outputSchema:U({type:F("object"),properties:ge(k(),ze).optional(),required:re(k()).optional()}).catchall(fe()).optional(),annotations:dk.optional(),execution:pk.optional(),_meta:ge(k(),fe()).optional()}),Js=fr.extend({method:F("tools/list")}),mk=hr.extend({tools:re(Nh)}),Vs=Ce.extend({content:re(qs).default([]),structuredContent:ge(k(),fe()).optional(),isError:Ne().optional()});Vs.or(Ce.extend({toolResult:fe()}));const fk=pr.extend({name:k(),arguments:ge(k(),fe()).optional()}),Zo=Ae.extend({method:F("tools/call"),params:fk}),hk=lt.extend({method:F("notifications/tools/list_changed"),params:ut.optional()});U({autoRefresh:Ne().default(!0),debounceMs:ae().int().nonnegative().default(300)});const Mo=Be(["debug","info","notice","warning","error","critical","alert","emergency"]),gk=nt.extend({level:Mo}),zh=Ae.extend({method:F("logging/setLevel"),params:gk}),vk=ut.extend({level:Mo,logger:k().optional(),data:fe()}),yk=lt.extend({method:F("notifications/message"),params:vk}),_k=U({name:k().optional()}),$k=U({hints:re(_k).optional(),costPriority:ae().min(0).max(1).optional(),speedPriority:ae().min(0).max(1).optional(),intelligencePriority:ae().min(0).max(1).optional()}),bk=U({mode:Be(["auto","required","none"]).optional()}),kk=U({type:F("tool_result"),toolUseId:k().describe("The unique identifier for the corresponding tool call."),content:re(qs).default([]),structuredContent:U({}).loose().optional(),isError:Ne().optional(),_meta:ge(k(),fe()).optional()}),Sk=Oo("type",[Ls,Fs,Gs]),Bo=Oo("type",[Ls,Fs,Gs,ik,kk]),wk=U({role:vr,content:ke([Bo,re(Bo)]),_meta:ge(k(),fe()).optional()}),Ik=pr.extend({messages:re(wk),modelPreferences:$k.optional(),systemPrompt:k().optional(),includeContext:Be(["none","thisServer","allServers"]).optional(),temperature:ae().optional(),maxTokens:ae().int(),stopSequences:re(k()).optional(),metadata:ze.optional(),tools:re(Nh).optional(),toolChoice:bk.optional()}),Pk=Ae.extend({method:F("sampling/createMessage"),params:Ik}),Hs=Ce.extend({model:k(),stopReason:we(Be(["endTurn","stopSequence","maxTokens"]).or(k())),role:vr,content:Sk}),jh=Ce.extend({model:k(),stopReason:we(Be(["endTurn","stopSequence","maxTokens","toolUse"]).or(k())),role:vr,content:ke([Bo,re(Bo)])}),xk=U({type:F("boolean"),title:k().optional(),description:k().optional(),default:Ne().optional()}),Ok=U({type:F("string"),title:k().optional(),description:k().optional(),minLength:ae().optional(),maxLength:ae().optional(),format:Be(["email","uri","date","date-time"]).optional(),default:k().optional()}),Tk=U({type:Be(["number","integer"]),title:k().optional(),description:k().optional(),minimum:ae().optional(),maximum:ae().optional(),default:ae().optional()}),Nk=U({type:F("string"),title:k().optional(),description:k().optional(),enum:re(k()),default:k().optional()}),zk=U({type:F("string"),title:k().optional(),description:k().optional(),oneOf:re(U({const:k(),title:k()})),default:k().optional()}),jk=U({type:F("string"),title:k().optional(),description:k().optional(),enum:re(k()),enumNames:re(k()).optional(),default:k().optional()}),Ek=ke([Nk,zk]),Rk=U({type:F("array"),title:k().optional(),description:k().optional(),minItems:ae().optional(),maxItems:ae().optional(),items:U({type:F("string"),enum:re(k())}),default:re(k()).optional()}),Dk=U({type:F("array"),title:k().optional(),description:k().optional(),minItems:ae().optional(),maxItems:ae().optional(),items:U({anyOf:re(U({const:k(),title:k()}))}),default:re(k()).optional()}),Ak=ke([Rk,Dk]),Ck=ke([jk,Ek,Ak]),Uk=ke([Ck,xk,Ok,Tk]),Zk=pr.extend({mode:F("form").optional(),message:k(),requestedSchema:U({type:F("object"),properties:ge(k(),Uk),required:re(k()).optional()})}),Mk=pr.extend({mode:F("url"),message:k(),elicitationId:k(),url:k().url()}),Bk=ke([Zk,Mk]),Lk=Ae.extend({method:F("elicitation/create"),params:Bk}),Fk=ut.extend({elicitationId:k()}),Gk=lt.extend({method:F("notifications/elicitation/complete"),params:Fk}),Lo=Ce.extend({action:Be(["accept","decline","cancel"]),content:Eo(e=>e===null?void 0:e,ge(k(),ke([k(),ae(),Ne(),re(k())])).optional())}),qk=U({type:F("ref/resource"),uri:k()}),Jk=U({type:F("ref/prompt"),name:k()}),Vk=nt.extend({ref:ke([Jk,qk]),argument:U({name:k(),value:k()}),context:U({arguments:ge(k(),k()).optional()}).optional()}),Ks=Ae.extend({method:F("completion/complete"),params:Vk});function Hk(e){if(e.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${e.params.ref.type}`)}function Kk(e){if(e.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${e.params.ref.type}`)}const Wk=Ce.extend({completion:Me({values:re(k()).max(100),total:we(ae().int()),hasMore:we(Ne())})}),Xk=U({uri:k().startsWith("file://"),name:k().optional(),_meta:ge(k(),fe()).optional()}),Yk=Ae.extend({method:F("roots/list"),params:nt.optional()}),Eh=Ce.extend({roots:re(Xk)}),Qk=lt.extend({method:F("notifications/roots/list_changed"),params:ut.optional()});ke([xs,wh,Ks,zh,Bs,Ms,As,Cs,Zs,Wb,Yb,Zo,Js,Ts,zs,js,Rs]),ke([Ps,Os,Ih,Qk,Uo]),ke([Is,Hs,jh,Lo,Eh,Ns,Es,Co]),ke([xs,Pk,Lk,Yk,Ts,zs,js,Rs]),ke([Ps,Os,yk,ek,Hb,hk,lk,Uo,Gk]),ke([Is,Ab,Wk,uk,rk,Gb,qb,Vb,Vs,mk,Ns,Es,Co]);class q 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 eS(n.elicitations,r)}return new q(t,r,o)}}class eS extends q{constructor(t,r=`URL elicitation${t.length>1?"s":""} required`){super(W.UrlElicitationRequired,r,{elicitations:t})}get elicitations(){return this.data?.elicitations??[]}}function Vt(e){return e==="completed"||e==="failed"||e==="cancelled"}const tS=Symbol("Let zodToJsonSchema decide on which parser to use"),Rh={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"},nS=e=>typeof e=="string"?{...Rh,name:e}:{...Rh,...e},rS=e=>{const t=nS(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 Dh(e,t,r,o){o?.errorMessages&&r&&(e.errorMessage={...e.errorMessage,[t]:r})}function ve(e,t,r,o,n){e[t]=r,Dh(e,t,o,n)}const Ah=(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 Ke(e){if(e.target!=="openAi")return{};const t=[...e.basePath,e.definitionPath,e.openAiAnyTypeName];return e.flags.hasReferencedOpenAiAnyType=!0,{$ref:e.$refStrategy==="relative"?Ah(t,e.currentPath):t.join("/")}}function oS(e,t){const r={type:"array"};return e.type?._def&&e.type?._def?.typeName!==te.ZodAny&&(r.items=me(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 iS(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 aS(){return{type:"boolean"}}function Ch(e,t){return me(e.type._def,t)}const sS=(e,t)=>me(e.innerType._def,t);function Uh(e,t,r){const o=r??t.dateStrategy;if(Array.isArray(o))return{anyOf:o.map((n,i)=>Uh(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 cS(e,t)}}const cS=(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 uS(e,t){return{...me(e.innerType._def,t),default:e.defaultValue()}}function lS(e,t){return t.effectStrategy==="input"?me(e.schema._def,t):Ke(t)}function dS(e){return{type:"string",enum:Array.from(e.values)}}const pS=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function mS(e,t){const r=[me(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),me(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(pS(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 fS(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 Ws;const mt={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:()=>(Ws===void 0&&(Ws=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Ws),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 Zh(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":ft(r,"email",o.message,t);break;case"format:idn-email":ft(r,"idn-email",o.message,t);break;case"pattern:zod":qe(r,mt.email,o.message,t);break}break;case"url":ft(r,"uri",o.message,t);break;case"uuid":ft(r,"uuid",o.message,t);break;case"regex":qe(r,o.regex,o.message,t);break;case"cuid":qe(r,mt.cuid,o.message,t);break;case"cuid2":qe(r,mt.cuid2,o.message,t);break;case"startsWith":qe(r,RegExp(`^${Xs(o.value,t)}`),o.message,t);break;case"endsWith":qe(r,RegExp(`${Xs(o.value,t)}$`),o.message,t);break;case"datetime":ft(r,"date-time",o.message,t);break;case"date":ft(r,"date",o.message,t);break;case"time":ft(r,"time",o.message,t);break;case"duration":ft(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":{qe(r,RegExp(Xs(o.value,t)),o.message,t);break}case"ip":{o.version!=="v6"&&ft(r,"ipv4",o.message,t),o.version!=="v4"&&ft(r,"ipv6",o.message,t);break}case"base64url":qe(r,mt.base64url,o.message,t);break;case"jwt":qe(r,mt.jwt,o.message,t);break;case"cidr":{o.version!=="v6"&&qe(r,mt.ipv4Cidr,o.message,t),o.version!=="v4"&&qe(r,mt.ipv6Cidr,o.message,t);break}case"emoji":qe(r,mt.emoji(),o.message,t);break;case"ulid":{qe(r,mt.ulid,o.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{ft(r,"binary",o.message,t);break}case"contentEncoding:base64":{ve(r,"contentEncoding","base64",o.message,t);break}case"pattern:zod":{qe(r,mt.base64,o.message,t);break}}break}case"nanoid":qe(r,mt.nanoid,o.message,t)}return r}function Xs(e,t){return t.patternStrategy==="escape"?gS(e):e}const hS=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function gS(e){let t="";for(let r=0;r<e.length;r++)hS.has(e[r])||(t+="\\"),t+=e[r];return t}function ft(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 qe(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:Mh(t,o),...r&&o.errorMessages&&{errorMessage:{pattern:r}}})):ve(e,"pattern",Mh(t,o),r,o)}function Mh(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 Bh(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]:me(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",n]})??Ke(t)}),{}),additionalProperties:t.rejectedAdditionalProperties};const r={type:"object",additionalProperties:me(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}=Zh(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}=Ch(e.keyType._def,t);return{...r,propertyNames:n}}}return r}function vS(e,t){if(t.mapStrategy==="record")return Bh(e,t);const r=me(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||Ke(t),o=me(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||Ke(t);return{type:"array",maxItems:125,items:{type:"array",items:[r,o],minItems:2,maxItems:2}}}function yS(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 _S(e){return e.target==="openAi"?void 0:{not:Ke({...e,currentPath:[...e.currentPath,"not"]})}}function $S(e){return e.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}const Fo={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function bS(e,t){if(t.target==="openApi3")return Lh(e,t);const r=e.options instanceof Map?Array.from(e.options.values()):e.options;if(r.every(o=>o._def.typeName in Fo&&(!o._def.checks||!o._def.checks.length))){const o=r.reduce((n,i)=>{const a=Fo[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 Lh(e,t)}const Lh=(e,t)=>{const r=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((o,n)=>me(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 kS(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:Fo[e.innerType._def.typeName],nullable:!0}:{type:[Fo[e.innerType._def.typeName],"null"]};if(t.target==="openApi3"){const o=me(e.innerType._def,{...t,currentPath:[...t.currentPath]});return o&&"$ref"in o?{allOf:[o],nullable:!0}:o&&{...o,nullable:!0}}const r=me(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}function SS(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",Dh(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 wS(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=PS(c);u&&r&&(c._def.typeName==="ZodOptional"&&(c=c._def.innerType),c.isNullable()||(c=c.nullable()),u=!1);const l=me(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=IS(e,t);return a!==void 0&&(o.additionalProperties=a),o}function IS(e,t){if(e.catchall._def.typeName!=="ZodNever")return me(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 PS(e){try{return e.isOptional()}catch{return!0}}const xS=(e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return me(e.innerType._def,t);const r=me(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return r?{anyOf:[{not:Ke(t)},r]}:Ke(t)},OS=(e,t)=>{if(t.pipeStrategy==="input")return me(e.in._def,t);if(t.pipeStrategy==="output")return me(e.out._def,t);const r=me(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),o=me(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,o].filter(n=>n!==void 0)}};function TS(e,t){return me(e.type._def,t)}function NS(e,t){const o={type:"array",uniqueItems:!0,items:me(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 zS(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((r,o)=>me(r._def,{...t,currentPath:[...t.currentPath,"items",`${o}`]})).reduce((r,o)=>o===void 0?r:[...r,o],[]),additionalItems:me(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((r,o)=>me(r._def,{...t,currentPath:[...t.currentPath,"items",`${o}`]})).reduce((r,o)=>o===void 0?r:[...r,o],[])}}function jS(e){return{not:Ke(e)}}function ES(e){return Ke(e)}const RS=(e,t)=>me(e.innerType._def,t),DS=(e,t,r)=>{switch(t){case te.ZodString:return Zh(e,r);case te.ZodNumber:return SS(e,r);case te.ZodObject:return wS(e,r);case te.ZodBigInt:return iS(e,r);case te.ZodBoolean:return aS();case te.ZodDate:return Uh(e,r);case te.ZodUndefined:return jS(r);case te.ZodNull:return $S(r);case te.ZodArray:return oS(e,r);case te.ZodUnion:case te.ZodDiscriminatedUnion:return bS(e,r);case te.ZodIntersection:return mS(e,r);case te.ZodTuple:return zS(e,r);case te.ZodRecord:return Bh(e,r);case te.ZodLiteral:return fS(e,r);case te.ZodEnum:return dS(e);case te.ZodNativeEnum:return yS(e);case te.ZodNullable:return kS(e,r);case te.ZodOptional:return xS(e,r);case te.ZodMap:return vS(e,r);case te.ZodSet:return NS(e,r);case te.ZodLazy:return()=>e.getter()._def;case te.ZodPromise:return TS(e,r);case te.ZodNaN:case te.ZodNever:return _S(r);case te.ZodEffects:return lS(e,r);case te.ZodAny:return Ke(r);case te.ZodUnknown:return ES(r);case te.ZodDefault:return uS(e,r);case te.ZodBranded:return Ch(e,r);case te.ZodReadonly:return RS(e,r);case te.ZodCatch:return sS(e,r);case te.ZodPipeline:return OS(e,r);case te.ZodFunction:case te.ZodVoid:case te.ZodSymbol:return;default:return(o=>{})()}};function me(e,t,r=!1){const o=t.seen.get(e);if(t.override){const s=t.override?.(e,t,o,r);if(s!==tS)return s}if(o&&!r){const s=AS(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=DS(e,e.typeName,t),a=typeof i=="function"?me(i(),t):i;if(a&&CS(e,t,a),t.postProcess){const s=t.postProcess(a,e,t);return n.jsonSchema=a,s}return n.jsonSchema=a,a}const AS=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:Ah(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`),Ke(t)):t.$refStrategy==="seen"?Ke(t):void 0}},CS=(e,t,r)=>(e.description&&(r.description=e.description,t.markdownDescription&&(r.markdownDescription=e.description)),r),US=(e,t)=>{const r=rS(t);let o=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((c,[u,l])=>({...c,[u]:me(l._def,{...r,currentPath:[...r.basePath,r.definitionPath,u]},!0)??Ke(r)}),{}):void 0;const n=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,i=me(e._def,n===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,n]},!1)??Ke(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 ZS(e){return!e||e==="jsonSchema7"||e==="draft-7"?"draft-7":e==="jsonSchema2019-09"||e==="draft-2020-12"?"draft-2020-12":"draft-7"}function Fh(e,t){return kt(e)?Pa(e,{target:ZS(t?.target),io:t?.pipeStrategy??"input"}):US(e,{strictUnions:t?.strictUnions??!0,pipeStrategy:t?.pipeStrategy??"input"})}function Gh(e){const r=lr(e)?.method;if(!r)throw new Error("Schema is missing a method literal");const o=gh(r);if(typeof o!="string")throw new Error("Schema method literal must be a string");return o}function qh(e,t){const r=ur(e,t);if(!r.success)throw r.error;return r.data}const MS=6e4;class BS{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(Ps,r=>{this._oncancel(r)}),this.setNotificationHandler(Os,r=>{this._onprogress(r)}),this.setRequestHandler(xs,r=>({})),this._taskStore=t?.taskStore,this._taskMessageQueue=t?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Ts,async(r,o)=>{const n=await this._taskStore.getTask(r.params.taskId,o.sessionId);if(!n)throw new q(W.InvalidParams,"Failed to retrieve task: Task not found");return{...n}}),this.setRequestHandler(zs,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,m=new q(d.error.code,d.error.message,d.error.data);l(m)}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 q(W.InvalidParams,`Task not found: ${i}`);if(!Vt(a.status))return await this._waitForTaskUpdate(i,o.signal),await n();if(Vt(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(js,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 q(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 q(W.InvalidParams,`Task not found: ${r.params.taskId}`);if(Vt(n.status))throw new q(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 q(W.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...i}}catch(n){throw n instanceof q?n:new q(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),q.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),Ao(i)||Ib(i)?this._onresponse(i):bh(i)?this._onrequest(i,a):wb(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=q.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=Sb(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,m)=>{if(a.signal.aborted)throw new q(W.ConnectionClosed,"Request was cancelled");const p={...m,relatedRequestId:t.id};i&&!p.relatedTask&&(p.relatedTask={taskId:i});const h=p.relatedTask?.taskId??i;return h&&c&&await c.updateTaskStatus(h,"input_required"),await this.request(l,d,p)},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),Ao(t))o(t);else{const a=new q(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(Ao(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),Ao(t))n(t);else{const a=q.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 q?a:new q(W.InternalError,String(a))}}return}let i;try{const a=await this.request(t,Co,o);if(a.task)i=a.task.taskId,yield{type:"taskCreated",task:a.task};else throw new q(W.InternalError,"Task creation did not return a task");for(;;){const s=await this.getTask({taskId:i},o);if(yield{type:"taskStatus",task:s},Vt(s.status)){s.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:i},r,o)}:s.status==="failed"?yield{type:"error",error:new q(W.InternalError,`Task ${i} failed`)}:s.status==="cancelled"&&(yield{type:"error",error:new q(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 q?a:new q(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=v=>{l(v)};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(v){d(v);return}o?.signal?.throwIfAborted();const m=this._requestMessageId++,p={...t,jsonrpc:"2.0",id:m};o?.onprogress&&(this._progressHandlers.set(m,o.onprogress),p.params={...t.params,_meta:{...t.params?._meta||{},progressToken:m}}),s&&(p.params={...p.params,task:s}),c&&(p.params={...p.params,_meta:{...p.params?._meta||{},[Jt]:c}});const h=v=>{this._responseHandlers.delete(m),this._progressHandlers.delete(m),this._cleanupTimeout(m),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:m,reason:String(v)}},{relatedRequestId:n,resumptionToken:i,onresumptiontoken:a}).catch(P=>this._onerror(new Error(`Failed to send cancellation: ${P}`)));const S=v instanceof q?v:new q(W.RequestTimeout,String(v));l(S)};this._responseHandlers.set(m,v=>{if(!o?.signal?.aborted){if(v instanceof Error)return l(v);try{const S=ur(r,v.result);S.success?u(S.data):l(S.error)}catch(S){l(S)}}}),o?.signal?.addEventListener("abort",()=>{h(o?.signal?.reason)});const $=o?.timeout??MS,g=()=>h(q.fromError(W.RequestTimeout,"Request timed out",{timeout:$}));this._setupTimeout(m,$,o?.maxTotalTimeout,g,o?.resetTimeoutOnProgress??!1);const y=c?.taskId;if(y){const v=S=>{const P=this._responseHandlers.get(m);P?P(S):this._onerror(new Error(`Response handler missing for side-channeled request ${m}`))};this._requestResolvers.set(m,v),this._enqueueTaskMessage(y,{type:"request",message:p,timestamp:Date.now()}).catch(S=>{this._cleanupTimeout(m),l(S)})}else this._transport.send(p,{relatedRequestId:n,resumptionToken:i,onresumptiontoken:a}).catch(v=>{this._cleanupTimeout(m),l(v)})})}async getTask(t,r){return this.request({method:"tasks/get",params:t},Ns,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},Es,r)}async cancelTask(t,r){return this.request({method:"tasks/cancel",params:t},Lb,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=Gh(t);this.assertRequestHandlerCapability(o),this._requestHandlers.set(o,(n,i)=>{const a=qh(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=Gh(t);this._notificationHandlers.set(o,n=>{const i=qh(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"&&bh(n.message)){const i=n.message.id,a=this._requestResolvers.get(i);a?(a(new q(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 q(W.InvalidRequest,"Request cancelled"));return}const a=setTimeout(n,o);r.addEventListener("abort",()=>{clearTimeout(a),i(new q(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 q(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=Uo.parse({method:"notifications/tasks/status",params:s});await this.notification(c),Vt(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 q(W.InvalidParams,`Task "${n}" not found - it may have been cleaned up`);if(Vt(s.status))throw new q(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=Uo.parse({method:"notifications/tasks/status",params:c});await this.notification(u),Vt(c.status)&&this._cleanupTaskProgressHandler(n)}},listTasks:n=>o.listTasks(n,r)}}}function Jh(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function LS(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];Jh(a)&&Jh(i)?r[n]={...a,...i}:r[n]=i}return r}function Vh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ys={exports:{}},Hh={},Pt={},Ht={},Qs={},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(v){if(super(),!e.IDENTIFIER.test(v))throw new Error("CodeGen: name must be a valid identifier");this.str=v}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class o extends t{constructor(v){super(),this._items=typeof v=="string"?[v]:v}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const v=this._items[0];return v===""||v==='""'}get str(){var v;return(v=this._str)!==null&&v!==void 0?v:this._str=this._items.reduce((S,P)=>`${S}${P}`,"")}get names(){var v;return(v=this._names)!==null&&v!==void 0?v:this._names=this._items.reduce((S,P)=>(P instanceof r&&(S[P.str]=(S[P.str]||0)+1),S),{})}}e._Code=o,e.nil=new o("");function n(y,...v){const S=[y[0]];let P=0;for(;P<v.length;)s(S,v[P]),S.push(y[++P]);return new o(S)}e._=n;const i=new o("+");function a(y,...v){const S=[p(y[0])];let P=0;for(;P<v.length;)S.push(i),s(S,v[P]),S.push(i,p(y[++P]));return c(S),new o(S)}e.str=a;function s(y,v){v instanceof o?y.push(...v._items):v instanceof r?y.push(v):y.push(d(v))}e.addCodeArg=s;function c(y){let v=1;for(;v<y.length-1;){if(y[v]===i){const S=u(y[v-1],y[v+1]);if(S!==void 0){y.splice(v-1,3,S);continue}y[v++]="+"}v++}}function u(y,v){if(v==='""')return y;if(y==='""')return v;if(typeof y=="string")return v instanceof r||y[y.length-1]!=='"'?void 0:typeof v!="string"?`${y.slice(0,-1)}${v}"`:v[0]==='"'?y.slice(0,-1)+v.slice(1):void 0;if(typeof v=="string"&&v[0]==='"'&&!(y instanceof r))return`"${y}${v.slice(1)}`}function l(y,v){return v.emptyStr()?y:y.emptyStr()?v:a`${y}${v}`}e.strConcat=l;function d(y){return typeof y=="number"||typeof y=="boolean"||y===null?y:p(Array.isArray(y)?y.join(","):y)}function m(y){return new o(p(y))}e.stringify=m;function p(y){return JSON.stringify(y).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=p;function h(y){return typeof y=="string"&&e.IDENTIFIER.test(y)?new o(`.${y}`):n`[${y}]`}e.getProperty=h;function $(y){if(typeof y=="string"&&e.IDENTIFIER.test(y))return new o(`${y}`);throw new Error(`CodeGen: invalid export name: ${y}, use explicit $id name mapping`)}e.getEsmExportName=$;function g(y){return new o(y.toString())}e.regexpCode=g})(yr);var ec={};(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 m=this.toName(u),{prefix:p}=m,h=(d=l.key)!==null&&d!==void 0?d:l.ref;let $=this._values[p];if($){const v=$.get(h);if(v)return v}else $=this._values[p]=new Map;$.set(h,m);const g=this._scope[p]||(this._scope[p]=[]),y=g.length;return g[y]=l.ref,m.setValue(l,{property:p,itemIndex:y}),m}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,m=>{if(m.value===void 0)throw new Error(`CodeGen: name "${m}" has no value`);return m.value.code},l,d)}_reduceValues(u,l,d={},m){let p=t.nil;for(const h in u){const $=u[h];if(!$)continue;const g=d[h]=d[h]||new Map;$.forEach(y=>{if(g.has(y))return;g.set(y,o.Started);let v=l(y);if(v){const S=this.opts.es5?e.varKinds.var:e.varKinds.const;p=(0,t._)`${p}${S} ${y} = ${v};${this.opts._n}`}else if(v=m?.(y))p=(0,t._)`${p}${v}${this.opts._n}`;else throw new r(y);g.set(y,o.Completed)})}return p}}e.ValueScope=s})(ec),(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=ec;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=ec;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(f,_){return this}}class a extends i{constructor(f,_,T){super(),this.varKind=f,this.name=_,this.rhs=T}render({es5:f,_n:_}){const T=f?r.varKinds.var:this.varKind,L=this.rhs===void 0?"":` = ${this.rhs}`;return`${T} ${this.name}${L};`+_}optimizeNames(f,_){if(f[this.name.str])return this.rhs&&(this.rhs=V(this.rhs,f,_)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class s extends i{constructor(f,_,T){super(),this.lhs=f,this.rhs=_,this.sideEffects=T}render({_n:f}){return`${this.lhs} = ${this.rhs};`+f}optimizeNames(f,_){if(!(this.lhs instanceof t.Name&&!f[this.lhs.str]&&!this.sideEffects))return this.rhs=V(this.rhs,f,_),this}get names(){const f=this.lhs instanceof t.Name?{}:{...this.lhs.names};return X(f,this.rhs)}}class c extends s{constructor(f,_,T,L){super(f,T,L),this.op=_}render({_n:f}){return`${this.lhs} ${this.op}= ${this.rhs};`+f}}class u extends i{constructor(f){super(),this.label=f,this.names={}}render({_n:f}){return`${this.label}:`+f}}class l extends i{constructor(f){super(),this.label=f,this.names={}}render({_n:f}){return`break${this.label?` ${this.label}`:""};`+f}}class d extends i{constructor(f){super(),this.error=f}render({_n:f}){return`throw ${this.error};`+f}get names(){return this.error.names}}class m extends i{constructor(f){super(),this.code=f}render({_n:f}){return`${this.code};`+f}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(f,_){return this.code=V(this.code,f,_),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class p extends i{constructor(f=[]){super(),this.nodes=f}render(f){return this.nodes.reduce((_,T)=>_+T.render(f),"")}optimizeNodes(){const{nodes:f}=this;let _=f.length;for(;_--;){const T=f[_].optimizeNodes();Array.isArray(T)?f.splice(_,1,...T):T?f[_]=T:f.splice(_,1)}return f.length>0?this:void 0}optimizeNames(f,_){const{nodes:T}=this;let L=T.length;for(;L--;){const J=T[L];J.optimizeNames(f,_)||(Oe(f,J.names),T.splice(L,1))}return T.length>0?this:void 0}get names(){return this.nodes.reduce((f,_)=>Q(f,_.names),{})}}class h extends p{render(f){return"{"+f._n+super.render(f)+"}"+f._n}}class $ extends p{}class g extends h{}g.kind="else";class y extends h{constructor(f,_){super(_),this.condition=f}render(f){let _=`if(${this.condition})`+super.render(f);return this.else&&(_+="else "+this.else.render(f)),_}optimizeNodes(){super.optimizeNodes();const f=this.condition;if(f===!0)return this.nodes;let _=this.else;if(_){const T=_.optimizeNodes();_=this.else=Array.isArray(T)?new g(T):T}if(_)return f===!1?_ instanceof y?_:_.nodes:this.nodes.length?this:new y(rt(f),_ instanceof y?[_]:_.nodes);if(!(f===!1||!this.nodes.length))return this}optimizeNames(f,_){var T;if(this.else=(T=this.else)===null||T===void 0?void 0:T.optimizeNames(f,_),!!(super.optimizeNames(f,_)||this.else))return this.condition=V(this.condition,f,_),this}get names(){const f=super.names;return X(f,this.condition),this.else&&Q(f,this.else.names),f}}y.kind="if";class v extends h{}v.kind="for";class S extends v{constructor(f){super(),this.iteration=f}render(f){return`for(${this.iteration})`+super.render(f)}optimizeNames(f,_){if(super.optimizeNames(f,_))return this.iteration=V(this.iteration,f,_),this}get names(){return Q(super.names,this.iteration.names)}}class P extends v{constructor(f,_,T,L){super(),this.varKind=f,this.name=_,this.from=T,this.to=L}render(f){const _=f.es5?r.varKinds.var:this.varKind,{name:T,from:L,to:J}=this;return`for(${_} ${T}=${L}; ${T}<${J}; ${T}++)`+super.render(f)}get names(){const f=X(super.names,this.from);return X(f,this.to)}}class N extends v{constructor(f,_,T,L){super(),this.loop=f,this.varKind=_,this.name=T,this.iterable=L}render(f){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(f)}optimizeNames(f,_){if(super.optimizeNames(f,_))return this.iterable=V(this.iterable,f,_),this}get names(){return Q(super.names,this.iterable.names)}}class B extends h{constructor(f,_,T){super(),this.name=f,this.args=_,this.async=T}render(f){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(f)}}B.kind="func";class K extends p{render(f){return"return "+super.render(f)}}K.kind="return";class ue extends h{render(f){let _="try"+super.render(f);return this.catch&&(_+=this.catch.render(f)),this.finally&&(_+=this.finally.render(f)),_}optimizeNodes(){var f,_;return super.optimizeNodes(),(f=this.catch)===null||f===void 0||f.optimizeNodes(),(_=this.finally)===null||_===void 0||_.optimizeNodes(),this}optimizeNames(f,_){var T,L;return super.optimizeNames(f,_),(T=this.catch)===null||T===void 0||T.optimizeNames(f,_),(L=this.finally)===null||L===void 0||L.optimizeNames(f,_),this}get names(){const f=super.names;return this.catch&&Q(f,this.catch.names),this.finally&&Q(f,this.finally.names),f}}class de extends h{constructor(f){super(),this.error=f}render(f){return`catch(${this.error})`+super.render(f)}}de.kind="catch";class xe extends h{render(f){return"finally"+super.render(f)}}xe.kind="finally";class M{constructor(f,_={}){this._values={},this._blockStarts=[],this._constants={},this.opts={..._,_n:_.lines?`
|
|
71
|
+
`:""},this._extScope=f,this._scope=new r.Scope({parent:f}),this._nodes=[new $]}toString(){return this._root.render(this.opts)}name(f){return this._scope.name(f)}scopeName(f){return this._extScope.name(f)}scopeValue(f,_){const T=this._extScope.value(f,_);return(this._values[T.prefix]||(this._values[T.prefix]=new Set)).add(T),T}getScopeValue(f,_){return this._extScope.getValue(f,_)}scopeRefs(f){return this._extScope.scopeRefs(f,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(f,_,T,L){const J=this._scope.toName(_);return T!==void 0&&L&&(this._constants[J.str]=T),this._leafNode(new a(f,J,T)),J}const(f,_,T){return this._def(r.varKinds.const,f,_,T)}let(f,_,T){return this._def(r.varKinds.let,f,_,T)}var(f,_,T){return this._def(r.varKinds.var,f,_,T)}assign(f,_,T){return this._leafNode(new s(f,_,T))}add(f,_){return this._leafNode(new c(f,e.operators.ADD,_))}code(f){return typeof f=="function"?f():f!==t.nil&&this._leafNode(new m(f)),this}object(...f){const _=["{"];for(const[T,L]of f)_.length>1&&_.push(","),_.push(T),(T!==L||this.opts.es5)&&(_.push(":"),(0,t.addCodeArg)(_,L));return _.push("}"),new t._Code(_)}if(f,_,T){if(this._blockNode(new y(f)),_&&T)this.code(_).else().code(T).endIf();else if(_)this.code(_).endIf();else if(T)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(f){return this._elseNode(new y(f))}else(){return this._elseNode(new g)}endIf(){return this._endBlockNode(y,g)}_for(f,_){return this._blockNode(f),_&&this.code(_).endFor(),this}for(f,_){return this._for(new S(f),_)}forRange(f,_,T,L,J=this.opts.es5?r.varKinds.var:r.varKinds.let){const pe=this._scope.toName(f);return this._for(new P(J,pe,_,T),()=>L(pe))}forOf(f,_,T,L=r.varKinds.const){const J=this._scope.toName(f);if(this.opts.es5){const pe=_ instanceof t.Name?_:this.var("_arr",_);return this.forRange("_i",0,(0,t._)`${pe}.length`,le=>{this.var(J,(0,t._)`${pe}[${le}]`),T(J)})}return this._for(new N("of",L,J,_),()=>T(J))}forIn(f,_,T,L=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(f,(0,t._)`Object.keys(${_})`,T);const J=this._scope.toName(f);return this._for(new N("in",L,J,_),()=>T(J))}endFor(){return this._endBlockNode(v)}label(f){return this._leafNode(new u(f))}break(f){return this._leafNode(new l(f))}return(f){const _=new K;if(this._blockNode(_),this.code(f),_.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(K)}try(f,_,T){if(!_&&!T)throw new Error('CodeGen: "try" without "catch" and "finally"');const L=new ue;if(this._blockNode(L),this.code(f),_){const J=this.name("e");this._currNode=L.catch=new de(J),_(J)}return T&&(this._currNode=L.finally=new xe,this.code(T)),this._endBlockNode(de,xe)}throw(f){return this._leafNode(new d(f))}block(f,_){return this._blockStarts.push(this._nodes.length),f&&this.code(f).endBlock(_),this}endBlock(f){const _=this._blockStarts.pop();if(_===void 0)throw new Error("CodeGen: not in self-balancing block");const T=this._nodes.length-_;if(T<0||f!==void 0&&T!==f)throw new Error(`CodeGen: wrong number of nodes: ${T} vs ${f} expected`);return this._nodes.length=_,this}func(f,_=t.nil,T,L){return this._blockNode(new B(f,_,T)),L&&this.code(L).endFunc(),this}endFunc(){return this._endBlockNode(B)}optimize(f=1){for(;f-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(f){return this._currNode.nodes.push(f),this}_blockNode(f){this._currNode.nodes.push(f),this._nodes.push(f)}_endBlockNode(f,_){const T=this._currNode;if(T instanceof f||_&&T instanceof _)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${_?`${f.kind}/${_.kind}`:f.kind}"`)}_elseNode(f){const _=this._currNode;if(!(_ instanceof y))throw new Error('CodeGen: "else" without "if"');return this._currNode=_.else=f,this}get _root(){return this._nodes[0]}get _currNode(){const f=this._nodes;return f[f.length-1]}set _currNode(f){const _=this._nodes;_[_.length-1]=f}}e.CodeGen=M;function Q(O,f){for(const _ in f)O[_]=(O[_]||0)+(f[_]||0);return O}function X(O,f){return f instanceof t._CodeOrName?Q(O,f.names):O}function V(O,f,_){if(O instanceof t.Name)return T(O);if(!L(O))return O;return new t._Code(O._items.reduce((J,pe)=>(pe instanceof t.Name&&(pe=T(pe)),pe instanceof t._Code?J.push(...pe._items):J.push(pe),J),[]));function T(J){const pe=_[J.str];return pe===void 0||f[J.str]!==1?J:(delete f[J.str],pe)}function L(J){return J instanceof t._Code&&J._items.some(pe=>pe instanceof t.Name&&f[pe.str]===1&&_[pe.str]!==void 0)}}function Oe(O,f){for(const _ in f)O[_]=(O[_]||0)-(f[_]||0)}function rt(O){return typeof O=="boolean"||typeof O=="number"||O===null?!O:(0,t._)`!${E(O)}`}e.not=rt;const ot=I(e.operators.AND);function Zt(...O){return O.reduce(ot)}e.and=Zt;const St=I(e.operators.OR);function A(...O){return O.reduce(St)}e.or=A;function I(O){return(f,_)=>f===t.nil?_:_===t.nil?f:(0,t._)`${E(f)} ${O} ${E(_)}`}function E(O){return O instanceof t.Name?O:(0,t._)`(${O})`}})(se);var Z={};Object.defineProperty(Z,"__esModule",{value:!0}),Z.checkStrictMode=Z.getErrorPath=Z.Type=Z.useFunc=Z.setEvaluated=Z.evaluatedPropsToName=Z.mergeEvaluated=Z.eachItem=Z.unescapeJsonPointer=Z.escapeJsonPointer=Z.escapeFragment=Z.unescapeFragment=Z.schemaRefOrVal=Z.schemaHasRulesButRef=Z.schemaHasRules=Z.checkUnknownRules=Z.alwaysValidSchema=Z.toHash=void 0;const Se=se,FS=yr;function GS(e){const t={};for(const r of e)t[r]=!0;return t}Z.toHash=GS;function qS(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(Kh(e,t),!Wh(t,e.self.RULES.all))}Z.alwaysValidSchema=qS;function Kh(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]||tg(e,`unknown keyword: "${i}"`)}Z.checkUnknownRules=Kh;function Wh(e,t){if(typeof e=="boolean")return!e;for(const r in e)if(t[r])return!0;return!1}Z.schemaHasRules=Wh;function JS(e,t){if(typeof e=="boolean")return!e;for(const r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}Z.schemaHasRulesButRef=JS;function VS({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)}`}Z.schemaRefOrVal=VS;function HS(e){return Xh(decodeURIComponent(e))}Z.unescapeFragment=HS;function KS(e){return encodeURIComponent(tc(e))}Z.escapeFragment=KS;function tc(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}Z.escapeJsonPointer=tc;function Xh(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}Z.unescapeJsonPointer=Xh;function WS(e,t){if(Array.isArray(e))for(const r of e)t(r);else t(e)}Z.eachItem=WS;function Yh({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}}Z.mergeEvaluated={props:Yh({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} || {}`),nc(e,r,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:Qh}),items:Yh({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 Qh(e,t){if(t===!0)return e.var("props",!0);const r=e.var("props",(0,Se._)`{}`);return t!==void 0&&nc(e,r,t),r}Z.evaluatedPropsToName=Qh;function nc(e,t,r){Object.keys(r).forEach(o=>e.assign((0,Se._)`${t}${(0,Se.getProperty)(o)}`,!0))}Z.setEvaluated=nc;const eg={};function XS(e,t){return e.scopeValue("func",{ref:t,code:eg[t.code]||(eg[t.code]=new FS._Code(t.code))})}Z.useFunc=XS;var rc;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(rc||(Z.Type=rc={}));function YS(e,t,r){if(e instanceof Se.Name){const o=t===rc.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():"/"+tc(e)}Z.getErrorPath=YS;function tg(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,r===!0)throw new Error(t);e.self.logger.warn(t)}}Z.checkStrictMode=tg;var Go={},ng;function Et(){if(ng)return Go;ng=1,Object.defineProperty(Go,"__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 Go.default=t,Go}var rg;function qo(){return rg||(rg=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=Z,o=Et();e.keywordError={message:({keyword:g})=>(0,t.str)`must pass "${g}" keyword validation`},e.keyword$DataError={message:({keyword:g,schemaType:y})=>y?(0,t.str)`"${g}" keyword must be ${y} ($data)`:(0,t.str)`"${g}" keyword is invalid ($data)`};function n(g,y=e.keywordError,v,S){const{it:P}=g,{gen:N,compositeRule:B,allErrors:K}=P,ue=d(g,y,v);S??(B||K)?c(N,ue):u(P,(0,t._)`[${ue}]`)}e.reportError=n;function i(g,y=e.keywordError,v){const{it:S}=g,{gen:P,compositeRule:N,allErrors:B}=S,K=d(g,y,v);c(P,K),N||B||u(S,o.default.vErrors)}e.reportExtraError=i;function a(g,y){g.assign(o.default.errors,y),g.if((0,t._)`${o.default.vErrors} !== null`,()=>g.if(y,()=>g.assign((0,t._)`${o.default.vErrors}.length`,y),()=>g.assign(o.default.vErrors,null)))}e.resetErrorsCount=a;function s({gen:g,keyword:y,schemaValue:v,data:S,errsCount:P,it:N}){if(P===void 0)throw new Error("ajv implementation error");const B=g.name("err");g.forRange("i",P,o.default.errors,K=>{g.const(B,(0,t._)`${o.default.vErrors}[${K}]`),g.if((0,t._)`${B}.instancePath === undefined`,()=>g.assign((0,t._)`${B}.instancePath`,(0,t.strConcat)(o.default.instancePath,N.errorPath))),g.assign((0,t._)`${B}.schemaPath`,(0,t.str)`${N.errSchemaPath}/${y}`),N.opts.verbose&&(g.assign((0,t._)`${B}.schema`,v),g.assign((0,t._)`${B}.data`,S))})}e.extendErrors=s;function c(g,y){const v=g.const("err",y);g.if((0,t._)`${o.default.vErrors} === null`,()=>g.assign(o.default.vErrors,(0,t._)`[${v}]`),(0,t._)`${o.default.vErrors}.push(${v})`),g.code((0,t._)`${o.default.errors}++`)}function u(g,y){const{gen:v,validateName:S,schemaEnv:P}=g;P.$async?v.throw((0,t._)`new ${g.ValidationError}(${y})`):(v.assign((0,t._)`${S}.errors`,y),v.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,y,v){const{createErrors:S}=g.it;return S===!1?(0,t._)`{}`:m(g,y,v)}function m(g,y,v={}){const{gen:S,it:P}=g,N=[p(P,v),h(g,v)];return $(g,y,N),S.object(...N)}function p({errorPath:g},{instancePath:y}){const v=y?(0,t.str)`${g}${(0,r.getErrorPath)(y,r.Type.Str)}`:g;return[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,v)]}function h({keyword:g,it:{errSchemaPath:y}},{schemaPath:v,parentSchema:S}){let P=S?y:(0,t.str)`${y}/${g}`;return v&&(P=(0,t.str)`${P}${(0,r.getErrorPath)(v,r.Type.Str)}`),[l.schemaPath,P]}function $(g,{params:y,message:v},S){const{keyword:P,data:N,schemaValue:B,it:K}=g,{opts:ue,propertyName:de,topSchemaRef:xe,schemaPath:M}=K;S.push([l.keyword,P],[l.params,typeof y=="function"?y(g):y||(0,t._)`{}`]),ue.messages&&S.push([l.message,typeof v=="function"?v(g):v]),ue.verbose&&S.push([l.schema,B],[l.parentSchema,(0,t._)`${xe}${M}`],[o.default.data,N]),de&&S.push([l.propertyName,de])}})(Qs)),Qs}var og;function QS(){if(og)return Ht;og=1,Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.boolOrEmptySchema=Ht.topBoolOrEmptySchema=void 0;const e=qo(),t=se,r=Et(),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))}Ht.topBoolOrEmptySchema=n;function i(s,c){const{gen:u,schema:l}=s;l===!1?(u.var(c,!1),a(s)):u.var(c,!0)}Ht.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 Ht}var je={},Kt={};Object.defineProperty(Kt,"__esModule",{value:!0}),Kt.getRules=Kt.isJSONType=void 0;const ew=["string","number","integer","boolean","null","object","array"],tw=new Set(ew);function nw(e){return typeof e=="string"&&tw.has(e)}Kt.isJSONType=nw;function rw(){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:{}}}Kt.getRules=rw;var xt={},ig;function ag(){if(ig)return xt;ig=1,Object.defineProperty(xt,"__esModule",{value:!0}),xt.shouldUseRule=xt.shouldUseGroup=xt.schemaHasRulesForType=void 0;function e({schema:o,self:n},i){const a=n.RULES.types[i];return a&&a!==!0&&t(o,a)}xt.schemaHasRulesForType=e;function t(o,n){return n.rules.some(i=>r(o,i))}xt.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 xt.shouldUseRule=r,xt}Object.defineProperty(je,"__esModule",{value:!0}),je.reportTypeError=je.checkDataTypes=je.checkDataType=je.coerceAndCheckDataType=je.getJSONTypes=je.getSchemaTypes=je.DataType=void 0;const ow=Kt,iw=ag(),aw=qo(),oe=se,sg=Z;var $n;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})($n||(je.DataType=$n={}));function sw(e){const t=cg(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}je.getSchemaTypes=sw;function cg(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(ow.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}je.getJSONTypes=cg;function cw(e,t){const{gen:r,data:o,opts:n}=e,i=uw(t,n.coerceTypes),a=t.length>0&&!(i.length===0&&t.length===1&&(0,iw.schemaHasRulesForType)(e,t[0]));if(a){const s=ic(t,o,n.strictNumbers,$n.Wrong);r.if(s,()=>{i.length?lw(e,t,i):ac(e)})}return a}je.coerceAndCheckDataType=cw;const ug=new Set(["string","number","integer","boolean","null"]);function uw(e,t){return t?e.filter(r=>ug.has(r)||t==="array"&&r==="array"):[]}function lw(e,t,r){const{gen:o,data:n,opts:i}=e,a=o.let("dataType",(0,oe._)`typeof ${n}`),s=o.let("coerced",(0,oe._)`undefined`);i.coerceTypes==="array"&&o.if((0,oe._)`${a} == 'object' && Array.isArray(${n}) && ${n}.length == 1`,()=>o.assign(n,(0,oe._)`${n}[0]`).assign(a,(0,oe._)`typeof ${n}`).if(ic(t,n,i.strictNumbers),()=>o.assign(s,n))),o.if((0,oe._)`${s} !== undefined`);for(const u of r)(ug.has(u)||u==="array"&&i.coerceTypes==="array")&&c(u);o.else(),ac(e),o.endIf(),o.if((0,oe._)`${s} !== undefined`,()=>{o.assign(n,s),dw(e,s)});function c(u){switch(u){case"string":o.elseIf((0,oe._)`${a} == "number" || ${a} == "boolean"`).assign(s,(0,oe._)`"" + ${n}`).elseIf((0,oe._)`${n} === null`).assign(s,(0,oe._)`""`);return;case"number":o.elseIf((0,oe._)`${a} == "boolean" || ${n} === null
|
|
72
|
+
|| (${a} == "string" && ${n} && ${n} == +${n})`).assign(s,(0,oe._)`+${n}`);return;case"integer":o.elseIf((0,oe._)`${a} === "boolean" || ${n} === null
|
|
73
|
+
|| (${a} === "string" && ${n} && ${n} == +${n} && !(${n} % 1))`).assign(s,(0,oe._)`+${n}`);return;case"boolean":o.elseIf((0,oe._)`${n} === "false" || ${n} === 0 || ${n} === null`).assign(s,!1).elseIf((0,oe._)`${n} === "true" || ${n} === 1`).assign(s,!0);return;case"null":o.elseIf((0,oe._)`${n} === "" || ${n} === 0 || ${n} === false`),o.assign(s,null);return;case"array":o.elseIf((0,oe._)`${a} === "string" || ${a} === "number"
|
|
74
|
+
|| ${a} === "boolean" || ${n} === null`).assign(s,(0,oe._)`[${n}]`)}}}function dw({gen:e,parentData:t,parentDataProperty:r},o){e.if((0,oe._)`${t} !== undefined`,()=>e.assign((0,oe._)`${t}[${r}]`,o))}function oc(e,t,r,o=$n.Correct){const n=o===$n.Correct?oe.operators.EQ:oe.operators.NEQ;let i;switch(e){case"null":return(0,oe._)`${t} ${n} null`;case"array":i=(0,oe._)`Array.isArray(${t})`;break;case"object":i=(0,oe._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=a((0,oe._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=a();break;default:return(0,oe._)`typeof ${t} ${n} ${e}`}return o===$n.Correct?i:(0,oe.not)(i);function a(s=oe.nil){return(0,oe.and)((0,oe._)`typeof ${t} == "number"`,s,r?(0,oe._)`isFinite(${t})`:oe.nil)}}je.checkDataType=oc;function ic(e,t,r,o){if(e.length===1)return oc(e[0],t,r,o);let n;const i=(0,sg.toHash)(e);if(i.array&&i.object){const a=(0,oe._)`typeof ${t} != "object"`;n=i.null?a:(0,oe._)`!${t} || ${a}`,delete i.null,delete i.array,delete i.object}else n=oe.nil;i.number&&delete i.integer;for(const a in i)n=(0,oe.and)(n,oc(a,t,r,o));return n}je.checkDataTypes=ic;const pw={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,oe._)`{type: ${e}}`:(0,oe._)`{type: ${t}}`};function ac(e){const t=mw(e);(0,aw.reportError)(t,pw)}je.reportTypeError=ac;function mw(e){const{gen:t,data:r,schema:o}=e,n=(0,sg.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={},lg;function fw(){if(lg)return _r;lg=1,Object.defineProperty(_r,"__esModule",{value:!0}),_r.assignDefaults=void 0;const e=se,t=Z;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 m=(0,e._)`${d} === undefined`;l.useDefaults==="empty"&&(m=(0,e._)`${m} || ${d} === null || ${d} === ""`),s.if(m,(0,e._)`${d} = ${(0,e.stringify)(a)}`)}return _r}var ht={},ye={},dg;function gt(){if(dg)return ye;dg=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=Z,r=Et(),o=Z;function n(v,S){const{gen:P,data:N,it:B}=v;P.if(l(P,N,S,B.opts.ownProperties),()=>{v.setParams({missingProperty:(0,e._)`${S}`},!0),v.error()})}ye.checkReportMissingProp=n;function i({gen:v,data:S,it:{opts:P}},N,B){return(0,e.or)(...N.map(K=>(0,e.and)(l(v,S,K,P.ownProperties),(0,e._)`${B} = ${K}`)))}ye.checkMissingProp=i;function a(v,S){v.setParams({missingProperty:S},!0),v.error()}ye.reportMissingProp=a;function s(v){return v.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}ye.hasPropFunc=s;function c(v,S,P){return(0,e._)`${s(v)}.call(${S}, ${P})`}ye.isOwnProperty=c;function u(v,S,P,N){const B=(0,e._)`${S}${(0,e.getProperty)(P)} !== undefined`;return N?(0,e._)`${B} && ${c(v,S,P)}`:B}ye.propertyInData=u;function l(v,S,P,N){const B=(0,e._)`${S}${(0,e.getProperty)(P)} === undefined`;return N?(0,e.or)(B,(0,e.not)(c(v,S,P))):B}ye.noPropertyInData=l;function d(v){return v?Object.keys(v).filter(S=>S!=="__proto__"):[]}ye.allSchemaProperties=d;function m(v,S){return d(S).filter(P=>!(0,t.alwaysValidSchema)(v,S[P]))}ye.schemaProperties=m;function p({schemaCode:v,data:S,it:{gen:P,topSchemaRef:N,schemaPath:B,errorPath:K},it:ue},de,xe,M){const Q=M?(0,e._)`${v}, ${S}, ${N}${B}`:S,X=[[r.default.instancePath,(0,e.strConcat)(r.default.instancePath,K)],[r.default.parentData,ue.parentData],[r.default.parentDataProperty,ue.parentDataProperty],[r.default.rootData,r.default.rootData]];ue.opts.dynamicRef&&X.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const V=(0,e._)`${Q}, ${P.object(...X)}`;return xe!==e.nil?(0,e._)`${de}.call(${xe}, ${V})`:(0,e._)`${de}(${V})`}ye.callValidateCode=p;const h=(0,e._)`new RegExp`;function $({gen:v,it:{opts:S}},P){const N=S.unicodeRegExp?"u":"",{regExp:B}=S.code,K=B(P,N);return v.scopeValue("pattern",{key:K.toString(),ref:K,code:(0,e._)`${B.code==="new RegExp"?h:(0,o.useFunc)(v,B)}(${P}, ${N})`})}ye.usePattern=$;function g(v){const{gen:S,data:P,keyword:N,it:B}=v,K=S.name("valid");if(B.allErrors){const de=S.let("valid",!0);return ue(()=>S.assign(de,!1)),de}return S.var(K,!0),ue(()=>S.break()),K;function ue(de){const xe=S.const("len",(0,e._)`${P}.length`);S.forRange("i",0,xe,M=>{v.subschema({keyword:N,dataProp:M,dataPropType:t.Type.Num},K),S.if((0,e.not)(K),de)})}}ye.validateArray=g;function y(v){const{gen:S,schema:P,keyword:N,it:B}=v;if(!Array.isArray(P))throw new Error("ajv implementation error");if(P.some(xe=>(0,t.alwaysValidSchema)(B,xe))&&!B.opts.unevaluated)return;const ue=S.let("valid",!1),de=S.name("_valid");S.block(()=>P.forEach((xe,M)=>{const Q=v.subschema({keyword:N,schemaProp:M,compositeRule:!0},de);S.assign(ue,(0,e._)`${ue} || ${de}`),v.mergeValidEvaluated(Q,de)||S.if((0,e.not)(ue))})),v.result(ue,()=>v.reset(),()=>v.error(!0))}return ye.validateUnion=y,ye}var pg;function hw(){if(pg)return ht;pg=1,Object.defineProperty(ht,"__esModule",{value:!0}),ht.validateKeywordUsage=ht.validSchemaType=ht.funcKeywordCode=ht.macroKeywordCode=void 0;const e=se,t=Et(),r=gt(),o=qo();function n(m,p){const{gen:h,keyword:$,schema:g,parentSchema:y,it:v}=m,S=p.macro.call(v.self,g,y,v),P=u(h,$,S);v.opts.validateSchema!==!1&&v.self.validateSchema(S,!0);const N=h.name("valid");m.subschema({schema:S,schemaPath:e.nil,errSchemaPath:`${v.errSchemaPath}/${$}`,topSchemaRef:P,compositeRule:!0},N),m.pass(N,()=>m.error(!0))}ht.macroKeywordCode=n;function i(m,p){var h;const{gen:$,keyword:g,schema:y,parentSchema:v,$data:S,it:P}=m;c(P,p);const N=!S&&p.compile?p.compile.call(P.self,y,v,P):p.validate,B=u($,g,N),K=$.let("valid");m.block$data(K,ue),m.ok((h=p.valid)!==null&&h!==void 0?h:K);function ue(){if(p.errors===!1)M(),p.modifying&&a(m),Q(()=>m.error());else{const X=p.async?de():xe();p.modifying&&a(m),Q(()=>s(m,X))}}function de(){const X=$.let("ruleErrs",null);return $.try(()=>M((0,e._)`await `),V=>$.assign(K,!1).if((0,e._)`${V} instanceof ${P.ValidationError}`,()=>$.assign(X,(0,e._)`${V}.errors`),()=>$.throw(V))),X}function xe(){const X=(0,e._)`${B}.errors`;return $.assign(X,null),M(e.nil),X}function M(X=p.async?(0,e._)`await `:e.nil){const V=P.opts.passContext?t.default.this:t.default.self,Oe=!("compile"in p&&!S||p.schema===!1);$.assign(K,(0,e._)`${X}${(0,r.callValidateCode)(m,B,V,Oe)}`,p.modifying)}function Q(X){var V;$.if((0,e.not)((V=p.valid)!==null&&V!==void 0?V:K),X)}}ht.funcKeywordCode=i;function a(m){const{gen:p,data:h,it:$}=m;p.if($.parentData,()=>p.assign(h,(0,e._)`${$.parentData}[${$.parentDataProperty}]`))}function s(m,p){const{gen:h}=m;h.if((0,e._)`Array.isArray(${p})`,()=>{h.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${p} : ${t.default.vErrors}.concat(${p})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,o.extendErrors)(m)},()=>m.error())}function c({schemaEnv:m},p){if(p.async&&!m.$async)throw new Error("async keyword in sync schema")}function u(m,p,h){if(h===void 0)throw new Error(`keyword "${p}" failed to compile`);return m.scopeValue("keyword",typeof h=="function"?{ref:h}:{ref:h,code:(0,e.stringify)(h)})}function l(m,p,h=!1){return!p.length||p.some($=>$==="array"?Array.isArray(m):$==="object"?m&&typeof m=="object"&&!Array.isArray(m):typeof m==$||h&&typeof m>"u")}ht.validSchemaType=l;function d({schema:m,opts:p,self:h,errSchemaPath:$},g,y){if(Array.isArray(g.keyword)?!g.keyword.includes(y):g.keyword!==y)throw new Error("ajv implementation error");const v=g.dependencies;if(v?.some(S=>!Object.prototype.hasOwnProperty.call(m,S)))throw new Error(`parent schema must have dependencies of ${y}: ${v.join(",")}`);if(g.validateSchema&&!g.validateSchema(m[y])){const P=`keyword "${y}" value is invalid at path "${$}": `+h.errorsText(g.validateSchema.errors);if(p.validateSchema==="log")h.logger.error(P);else throw new Error(P)}}return ht.validateKeywordUsage=d,ht}var Ot={},mg;function gw(){if(mg)return Ot;mg=1,Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.extendSubschemaMode=Ot.extendSubschemaData=Ot.getSubschema=void 0;const e=se,t=Z;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 m=i.schema[a];return s===void 0?{schema:m,schemaPath:(0,e._)`${i.schemaPath}${(0,e.getProperty)(a)}`,errSchemaPath:`${i.errSchemaPath}/${a}`}:{schema:m[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')}Ot.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:m}=a;if(s!==void 0){const{errorPath:h,dataPathArr:$,opts:g}=a,y=m.let("data",(0,e._)`${a.data}${(0,e.getProperty)(s)}`,!0);p(y),i.errorPath=(0,e.str)`${h}${(0,t.getErrorPath)(s,c,g.jsPropertySyntax)}`,i.parentDataProperty=(0,e._)`${s}`,i.dataPathArr=[...$,i.parentDataProperty]}if(u!==void 0){const h=u instanceof e.Name?u:m.let("data",u,!0);p(h),d!==void 0&&(i.propertyName=d)}l&&(i.dataTypes=l);function p(h){i.data=h,i.dataLevel=a.dataLevel+1,i.dataTypes=[],a.definedProperties=new Set,i.parentData=a.data,i.dataNames=[...a.dataNames,h]}}Ot.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 Ot.extendSubschemaMode=n,Ot}var Ue={},fg=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},hg={exports:{}},Rt=hg.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(){};Jo(t,o,n,e,"",e)};Rt.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},Rt.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},Rt.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},Rt.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 Jo(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 Rt.arrayKeywords)for(var m=0;m<d.length;m++)Jo(e,t,r,d[m],n+"/"+l+"/"+m,i,n,l,o,m)}else if(l in Rt.propsKeywords){if(d&&typeof d=="object")for(var p in d)Jo(e,t,r,d[p],n+"/"+l+"/"+vw(p),i,n,l,o,p)}else(l in Rt.keywords||e.allKeys&&!(l in Rt.skipKeywords))&&Jo(e,t,r,d,n+"/"+l,i,n,l,o)}r(o,n,i,a,s,c,u)}}function vw(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}var yw=hg.exports;Object.defineProperty(Ue,"__esModule",{value:!0}),Ue.getSchemaRefs=Ue.resolveUrl=Ue.normalizeId=Ue._getFullPath=Ue.getFullPath=Ue.inlineRef=void 0;const _w=Z,$w=fg,bw=yw,kw=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Sw(e,t=!0){return typeof e=="boolean"?!0:t===!0?!sc(e):t?gg(e)<=t:!1}Ue.inlineRef=Sw;const ww=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function sc(e){for(const t in e){if(ww.has(t))return!0;const r=e[t];if(Array.isArray(r)&&r.some(sc)||typeof r=="object"&&sc(r))return!0}return!1}function gg(e){let t=0;for(const r in e){if(r==="$ref")return 1/0;if(t++,!kw.has(r)&&(typeof e[r]=="object"&&(0,_w.eachItem)(e[r],o=>t+=gg(o)),t===1/0))return 1/0}return t}function vg(e,t="",r){r!==!1&&(t=bn(t));const o=e.parse(t);return yg(e,o)}Ue.getFullPath=vg;function yg(e,t){return e.serialize(t).split("#")[0]+"#"}Ue._getFullPath=yg;const Iw=/#\/?$/;function bn(e){return e?e.replace(Iw,""):""}Ue.normalizeId=bn;function Pw(e,t,r){return r=bn(r),e.resolve(t,r)}Ue.resolveUrl=Pw;const xw=/^[a-z_][-a-z0-9._]*$/i;function Ow(e,t){if(typeof e=="boolean")return{};const{schemaId:r,uriResolver:o}=this.opts,n=bn(e[r]||t),i={"":n},a=vg(o,n,!1),s={},c=new Set;return bw(e,{allKeys:!0},(d,m,p,h)=>{if(h===void 0)return;const $=a+m;let g=i[h];typeof d[r]=="string"&&(g=y.call(this,d[r])),v.call(this,d.$anchor),v.call(this,d.$dynamicAnchor),i[m]=g;function y(S){const P=this.opts.uriResolver.resolve;if(S=bn(g?P(g,S):S),c.has(S))throw l(S);c.add(S);let N=this.refs[S];return typeof N=="string"&&(N=this.refs[N]),typeof N=="object"?u(d,N.schema,S):S!==bn($)&&(S[0]==="#"?(u(d,s[S],S),s[S]=d):this.refs[S]=$),S}function v(S){if(typeof S=="string"){if(!xw.test(S))throw new Error(`invalid anchor "${S}"`);y.call(this,`#${S}`)}}}),s;function u(d,m,p){if(m!==void 0&&!$w(d,m))throw l(p)}function l(d){return new Error(`reference "${d}" resolves to more than one schema`)}}Ue.getSchemaRefs=Ow;var _g;function Vo(){if(_g)return Pt;_g=1,Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.getData=Pt.KeywordCxt=Pt.validateFunctionCode=void 0;const e=QS(),t=je,r=ag(),o=je,n=fw(),i=hw(),a=gw(),s=se,c=Et(),u=Ue,l=Z,d=qo();function m(w){if(N(w)&&(K(w),P(w))){g(w);return}p(w,()=>(0,e.topBoolOrEmptySchema)(w))}Pt.validateFunctionCode=m;function p({gen:w,validateName:x,schema:j,schemaEnv:D,opts:G},ce){G.code.es5?w.func(x,(0,s._)`${c.default.data}, ${c.default.valCxt}`,D.$async,()=>{w.code((0,s._)`"use strict"; ${v(j,G)}`),$(w,G),w.code(ce)}):w.func(x,(0,s._)`${c.default.data}, ${h(G)}`,D.$async,()=>w.code(v(j,G)).code(ce))}function h(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,x){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}`),x.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),x.dynamicRef&&w.var(c.default.dynamicAnchors,(0,s._)`{}`)})}function g(w){const{schema:x,opts:j,gen:D}=w;p(w,()=>{j.$comment&&x.$comment&&X(w),xe(w),D.let(c.default.vErrors,null),D.let(c.default.errors,0),j.unevaluated&&y(w),ue(w),V(w)})}function y(w){const{gen:x,validateName:j}=w;w.evaluated=x.const("evaluated",(0,s._)`${j}.evaluated`),x.if((0,s._)`${w.evaluated}.dynamicProps`,()=>x.assign((0,s._)`${w.evaluated}.props`,(0,s._)`undefined`)),x.if((0,s._)`${w.evaluated}.dynamicItems`,()=>x.assign((0,s._)`${w.evaluated}.items`,(0,s._)`undefined`))}function v(w,x){const j=typeof w=="object"&&w[x.schemaId];return j&&(x.code.source||x.code.process)?(0,s._)`/*# sourceURL=${j} */`:s.nil}function S(w,x){if(N(w)&&(K(w),P(w))){B(w,x);return}(0,e.boolOrEmptySchema)(w,x)}function P({schema:w,self:x}){if(typeof w=="boolean")return!w;for(const j in w)if(x.RULES.all[j])return!0;return!1}function N(w){return typeof w.schema!="boolean"}function B(w,x){const{schema:j,gen:D,opts:G}=w;G.$comment&&j.$comment&&X(w),M(w),Q(w);const ce=D.const("_errs",c.default.errors);ue(w,ce),D.var(x,(0,s._)`${ce} === ${c.default.errors}`)}function K(w){(0,l.checkUnknownRules)(w),de(w)}function ue(w,x){if(w.opts.jtd)return rt(w,[],!1,x);const j=(0,t.getSchemaTypes)(w.schema),D=(0,t.coerceAndCheckDataType)(w,j);rt(w,j,!D,x)}function de(w){const{schema:x,errSchemaPath:j,opts:D,self:G}=w;x.$ref&&D.ignoreKeywordsWithRef&&(0,l.schemaHasRulesButRef)(x,G.RULES)&&G.logger.warn(`$ref: keywords ignored in schema at path "${j}"`)}function xe(w){const{schema:x,opts:j}=w;x.default!==void 0&&j.useDefaults&&j.strictSchema&&(0,l.checkStrictMode)(w,"default is ignored in the schema root")}function M(w){const x=w.schema[w.opts.schemaId];x&&(w.baseId=(0,u.resolveUrl)(w.opts.uriResolver,w.baseId,x))}function Q(w){if(w.schema.$async&&!w.schemaEnv.$async)throw new Error("async schema in sync schema")}function X({gen:w,schemaEnv:x,schema:j,errSchemaPath:D,opts:G}){const ce=j.$comment;if(G.$comment===!0)w.code((0,s._)`${c.default.self}.logger.log(${ce})`);else if(typeof G.$comment=="function"){const Ee=(0,s.str)`${D}/$comment`,pt=w.scopeValue("root",{ref:x.root});w.code((0,s._)`${c.default.self}.opts.$comment(${ce}, ${Ee}, ${pt}.schema)`)}}function V(w){const{gen:x,schemaEnv:j,validateName:D,ValidationError:G,opts:ce}=w;j.$async?x.if((0,s._)`${c.default.errors} === 0`,()=>x.return(c.default.data),()=>x.throw((0,s._)`new ${G}(${c.default.vErrors})`)):(x.assign((0,s._)`${D}.errors`,c.default.vErrors),ce.unevaluated&&Oe(w),x.return((0,s._)`${c.default.errors} === 0`))}function Oe({gen:w,evaluated:x,props:j,items:D}){j instanceof s.Name&&w.assign((0,s._)`${x}.props`,j),D instanceof s.Name&&w.assign((0,s._)`${x}.items`,D)}function rt(w,x,j,D){const{gen:G,schema:ce,data:Ee,allErrors:pt,opts:Je,self:Ve}=w,{RULES:Re}=Ve;if(ce.$ref&&(Je.ignoreKeywordsWithRef||!(0,l.schemaHasRulesButRef)(ce,Re))){G.block(()=>L(w,"$ref",Re.all.$ref.definition));return}Je.jtd||Zt(w,x),G.block(()=>{for(const it of Re.rules)nn(it);nn(Re.post)});function nn(it){(0,r.shouldUseGroup)(ce,it)&&(it.type?(G.if((0,o.checkDataType)(it.type,Ee,Je.strictNumbers)),ot(w,it),x.length===1&&x[0]===it.type&&j&&(G.else(),(0,o.reportTypeError)(w)),G.endIf()):ot(w,it),pt||G.if((0,s._)`${c.default.errors} === ${D||0}`))}}function ot(w,x){const{gen:j,schema:D,opts:{useDefaults:G}}=w;G&&(0,n.assignDefaults)(w,x.type),j.block(()=>{for(const ce of x.rules)(0,r.shouldUseRule)(D,ce)&&L(w,ce.keyword,ce.definition,x.type)})}function Zt(w,x){w.schemaEnv.meta||!w.opts.strictTypes||(St(w,x),w.opts.allowUnionTypes||A(w,x),I(w,w.dataTypes))}function St(w,x){if(x.length){if(!w.dataTypes.length){w.dataTypes=x;return}x.forEach(j=>{O(w.dataTypes,j)||_(w,`type "${j}" not allowed by context "${w.dataTypes.join(",")}"`)}),f(w,x)}}function A(w,x){x.length>1&&!(x.length===2&&x.includes("null"))&&_(w,"use allowUnionTypes to allow union type keyword")}function I(w,x){const j=w.self.RULES.all;for(const D in j){const G=j[D];if(typeof G=="object"&&(0,r.shouldUseRule)(w.schema,G)){const{type:ce}=G.definition;ce.length&&!ce.some(Ee=>E(x,Ee))&&_(w,`missing type "${ce.join(",")}" for keyword "${D}"`)}}}function E(w,x){return w.includes(x)||x==="number"&&w.includes("integer")}function O(w,x){return w.includes(x)||x==="integer"&&w.includes("number")}function f(w,x){const j=[];for(const D of w.dataTypes)O(x,D)?j.push(D):x.includes("integer")&&D==="number"&&j.push("integer");w.dataTypes=j}function _(w,x){const j=w.schemaEnv.baseId+w.errSchemaPath;x+=` at "${j}" (strictTypes)`,(0,l.checkStrictMode)(w,x,w.opts.strictTypes)}class T{constructor(x,j,D){if((0,i.validateKeywordUsage)(x,j,D),this.gen=x.gen,this.allErrors=x.allErrors,this.keyword=D,this.data=x.data,this.schema=x.schema[D],this.$data=j.$data&&x.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,l.schemaRefOrVal)(x,this.schema,D,this.$data),this.schemaType=j.schemaType,this.parentSchema=x.schema,this.params={},this.it=x,this.def=j,this.$data)this.schemaCode=x.gen.const("vSchema",le(this.$data,x));else if(this.schemaCode=this.schemaValue,!(0,i.validSchemaType)(this.schema,j.schemaType,j.allowUndefined))throw new Error(`${D} value must be ${JSON.stringify(j.schemaType)}`);("code"in j?j.trackErrors:j.errors!==!1)&&(this.errsCount=x.gen.const("_errs",c.default.errors))}result(x,j,D){this.failResult((0,s.not)(x),j,D)}failResult(x,j,D){this.gen.if(x),D?D():this.error(),j?(this.gen.else(),j(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(x,j){this.failResult((0,s.not)(x),void 0,j)}fail(x){if(x===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(x),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(x){if(!this.$data)return this.fail(x);const{schemaCode:j}=this;this.fail((0,s._)`${j} !== undefined && (${(0,s.or)(this.invalid$data(),x)})`)}error(x,j,D){if(j){this.setParams(j),this._error(x,D),this.setParams({});return}this._error(x,D)}_error(x,j){(x?d.reportExtraError:d.reportError)(this,this.def.error,j)}$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(x){this.allErrors||this.gen.if(x)}setParams(x,j){j?Object.assign(this.params,x):this.params=x}block$data(x,j,D=s.nil){this.gen.block(()=>{this.check$data(x,D),j()})}check$data(x=s.nil,j=s.nil){if(!this.$data)return;const{gen:D,schemaCode:G,schemaType:ce,def:Ee}=this;D.if((0,s.or)((0,s._)`${G} === undefined`,j)),x!==s.nil&&D.assign(x,!0),(ce.length||Ee.validateSchema)&&(D.elseIf(this.invalid$data()),this.$dataError(),x!==s.nil&&D.assign(x,!1)),D.else()}invalid$data(){const{gen:x,schemaCode:j,schemaType:D,def:G,it:ce}=this;return(0,s.or)(Ee(),pt());function Ee(){if(D.length){if(!(j instanceof s.Name))throw new Error("ajv implementation error");const Je=Array.isArray(D)?D:[D];return(0,s._)`${(0,o.checkDataTypes)(Je,j,ce.opts.strictNumbers,o.DataType.Wrong)}`}return s.nil}function pt(){if(G.validateSchema){const Je=x.scopeValue("validate$data",{ref:G.validateSchema});return(0,s._)`!${Je}(${j})`}return s.nil}}subschema(x,j){const D=(0,a.getSubschema)(this.it,x);(0,a.extendSubschemaData)(D,this.it,x),(0,a.extendSubschemaMode)(D,x);const G={...this.it,...D,items:void 0,props:void 0};return S(G,j),G}mergeEvaluated(x,j){const{it:D,gen:G}=this;D.opts.unevaluated&&(D.props!==!0&&x.props!==void 0&&(D.props=l.mergeEvaluated.props(G,x.props,D.props,j)),D.items!==!0&&x.items!==void 0&&(D.items=l.mergeEvaluated.items(G,x.items,D.items,j)))}mergeValidEvaluated(x,j){const{it:D,gen:G}=this;if(D.opts.unevaluated&&(D.props!==!0||D.items!==!0))return G.if(j,()=>this.mergeEvaluated(x,s.Name)),!0}}Pt.KeywordCxt=T;function L(w,x,j,D){const G=new T(w,j,x);"code"in j?j.code(G,D):G.$data&&j.validate?(0,i.funcKeywordCode)(G,j):"macro"in j?(0,i.macroKeywordCode)(G,j):(j.compile||j.validate)&&(0,i.funcKeywordCode)(G,j)}const J=/^\/(?:[^~]|~0|~1)*$/,pe=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function le(w,{dataLevel:x,dataNames:j,dataPathArr:D}){let G,ce;if(w==="")return c.default.rootData;if(w[0]==="/"){if(!J.test(w))throw new Error(`Invalid JSON-pointer: ${w}`);G=w,ce=c.default.rootData}else{const Ve=pe.exec(w);if(!Ve)throw new Error(`Invalid JSON-pointer: ${w}`);const Re=+Ve[1];if(G=Ve[2],G==="#"){if(Re>=x)throw new Error(Je("property/index",Re));return D[x-Re]}if(Re>x)throw new Error(Je("data",Re));if(ce=j[x-Re],!G)return ce}let Ee=ce;const pt=G.split("/");for(const Ve of pt)Ve&&(ce=(0,s._)`${ce}${(0,s.getProperty)((0,l.unescapeJsonPointer)(Ve))}`,Ee=(0,s._)`${Ee} && ${ce}`);return Ee;function Je(Ve,Re){return`Cannot access ${Ve} ${Re} levels up, current level is ${x}`}}return Pt.getData=le,Pt}var Ho={},$g;function cc(){if($g)return Ho;$g=1,Object.defineProperty(Ho,"__esModule",{value:!0});class e extends Error{constructor(r){super("validation failed"),this.errors=r,this.ajv=this.validation=!0}}return Ho.default=e,Ho}var Ko={},bg;function Wo(){if(bg)return Ko;bg=1,Object.defineProperty(Ko,"__esModule",{value:!0});const e=Ue;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 Ko.default=t,Ko}var We={};Object.defineProperty(We,"__esModule",{value:!0}),We.resolveSchema=We.getCompilingSchema=We.resolveRef=We.compileSchema=We.SchemaEnv=void 0;const vt=se,Tw=cc(),Wt=Et(),yt=Ue,kg=Z,Nw=Vo();class Xo{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,yt.normalizeId)(o?.[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=o?.$async,this.refs={}}}We.SchemaEnv=Xo;function uc(e){const t=Sg.call(this,e);if(t)return t;const r=(0,yt.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:o,lines:n}=this.opts.code,{ownProperties:i}=this.opts,a=new vt.CodeGen(this.scope,{es5:o,lines:n,ownProperties:i});let s;e.$async&&(s=a.scopeValue("Error",{ref:Tw.default,code:(0,vt._)`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:[vt.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,vt.stringify)(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:s,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:vt.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,vt._)`""`,opts:this.opts,self:this};let l;try{this._compilations.add(e),(0,Nw.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 p=new Function(`${Wt.default.self}`,`${Wt.default.scope}`,l)(this,this.scope.get());if(this.scope.value(c,{ref:p}),p.errors=null,p.schema=e.schema,p.schemaEnv=e,e.$async&&(p.$async=!0),this.opts.code.source===!0&&(p.source={validateName:c,validateCode:d,scopeValues:a._values}),this.opts.unevaluated){const{props:h,items:$}=u;p.evaluated={props:h instanceof vt.Name?void 0:h,items:$ instanceof vt.Name?void 0:$,dynamicProps:h instanceof vt.Name,dynamicItems:$ instanceof vt.Name},p.source&&(p.source.evaluated=(0,vt.stringify)(p.evaluated))}return e.validate=p,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)}}We.compileSchema=uc;function zw(e,t,r){var o;r=(0,yt.resolveUrl)(this.opts.uriResolver,t,r);const n=e.refs[r];if(n)return n;let i=Rw.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 Xo({schema:a,schemaId:s,root:e,baseId:t}))}if(i!==void 0)return e.refs[r]=jw.call(this,i)}We.resolveRef=zw;function jw(e){return(0,yt.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:uc.call(this,e)}function Sg(e){for(const t of this._compilations)if(Ew(t,e))return t}We.getCompilingSchema=Sg;function Ew(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function Rw(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||Yo.call(this,e,t)}function Yo(e,t){const r=this.opts.uriResolver.parse(t),o=(0,yt._getFullPath)(this.opts.uriResolver,r);let n=(0,yt.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&o===n)return lc.call(this,r,e);const i=(0,yt.normalizeId)(o),a=this.refs[i]||this.schemas[i];if(typeof a=="string"){const s=Yo.call(this,e,a);return typeof s?.schema!="object"?void 0:lc.call(this,r,s)}if(typeof a?.schema=="object"){if(a.validate||uc.call(this,a),i===(0,yt.normalizeId)(t)){const{schema:s}=a,{schemaId:c}=this.opts,u=s[c];return u&&(n=(0,yt.resolveUrl)(this.opts.uriResolver,n,u)),new Xo({schema:s,schemaId:c,root:e,baseId:n})}return lc.call(this,r,a)}}We.resolveSchema=Yo;const Dw=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function lc(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,kg.unescapeFragment)(s)];if(c===void 0)return;r=c;const u=typeof r=="object"&&r[this.opts.schemaId];!Dw.has(s)&&u&&(t=(0,yt.resolveUrl)(this.opts.uriResolver,t,u))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,kg.schemaHasRulesButRef)(r,this.RULES)){const s=(0,yt.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=Yo.call(this,o,s)}const{schemaId:a}=this.opts;if(i=i||new Xo({schema:r,schemaId:a,root:o,baseId:t}),i.schema!==i.root.schema)return i}var Aw="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",Cw="Meta-schema for $data reference (JSON AnySchema extension proposal)",Uw="object",Zw=["$data"],Mw={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},Bw=!1,Lw={$id:Aw,description:Cw,type:Uw,required:Zw,properties:Mw,additionalProperties:Bw},dc={},Qo={exports:{}};const Fw=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),wg=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),pc=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),Ig=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),Gw=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function Pg(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 qw=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function xg(e){return e.length=0,!0}function Jw(e,t,r){if(e.length){const o=Pg(e);if(o!=="")t.push(o);else return r.error=!0,!1;e.length=0}return!0}function Vw(e){let t=0;const r={error:!1,address:"",zone:""},o=[],n=[];let i=!1,a=!1,s=Jw;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=xg}else{n.push(u);continue}}return n.length&&(s===xg?r.zone=n.join(""):a?o.push(n.join("")):o.push(Pg(n))),r.address=o.join(""),r}function Og(e){if(Hw(e,":")<2)return{host:e,isIPV6:!1};const t=Vw(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 Hw(e,t){let r=0;for(let o=0;o<e.length;o++)e[o]===t&&r++;return r}function Kw(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 Ww={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},Xw=/[@/?#:]/g,Yw=/[@/?#]/g;function Tg(e,t){const r=t?Yw:Xw;return r.lastIndex=0,e.replace(r,o=>Ww[o])}function Qw(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(pc(n)){const i=n.toUpperCase(),a=String.fromCharCode(parseInt(i,16));t&&Ig(a)?r+=a:r+="%"+i,o+=2;continue}}r+=e[o]}return r}function e0(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(pc(o)){const n=o.toUpperCase(),i=String.fromCharCode(parseInt(n,16));i!=="."&&Ig(i)?t+=i:t+="%"+n,r+=2;continue}}Gw(e[r])?t+=e[r]:t+=escape(e[r])}return t}function t0(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(pc(o)){t+="%"+o.toUpperCase(),r+=2;continue}}t+=escape(e[r])}return t}function n0(e){const t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let r=unescape(e.host);if(!wg(r)){const o=Og(r);o.isIPV6===!0?r=`[${o.escapedHost}]`:r=Tg(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 Ng={nonSimpleDomain:qw,recomposeAuthority:n0,reescapeHostDelimiters:Tg,normalizePercentEncoding:Qw,normalizePathEncoding:e0,escapePreservingEscapes:t0,removeDotSegments:Kw,isIPv4:wg,isUUID:Fw,normalizeIPv6:Og};const{isUUID:r0}=Ng,o0=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function zg(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 jg(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function Eg(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 i0(e){return e.secure=zg(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function a0(e){if((e.port===(zg(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 s0(e,t){if(!e.path)return e.error="URN can not be parsed",e;const r=e.path.match(o0);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=mc(n);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function c0(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=mc(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 u0(e,t){const r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!r0(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function l0(e){const t=e;return t.nss=(e.uuid||"").toLowerCase(),t}const Rg={scheme:"http",domainHost:!0,parse:jg,serialize:Eg},d0={scheme:"https",domainHost:Rg.domainHost,parse:jg,serialize:Eg},ei={scheme:"ws",domainHost:!0,parse:i0,serialize:a0},p0={scheme:"wss",domainHost:ei.domainHost,parse:ei.parse,serialize:ei.serialize},m0={scheme:"urn",parse:s0,serialize:c0,skipNormalize:!0},f0={scheme:"urn:uuid",parse:u0,serialize:l0,skipNormalize:!0},ti={http:Rg,https:d0,ws:ei,wss:p0,urn:m0,"urn:uuid":f0};Object.setPrototypeOf(ti,null);function mc(e){return e&&(ti[e]||ti[e.toLowerCase()])||void 0}var h0={SCHEMES:ti,getSchemeHandler:mc};const{normalizeIPv6:g0,removeDotSegments:$r,recomposeAuthority:v0,normalizePercentEncoding:y0,normalizePathEncoding:_0,escapePreservingEscapes:$0,reescapeHostDelimiters:b0,isIPv4:k0,nonSimpleDomain:S0}=Ng,{SCHEMES:w0,getSchemeHandler:Dg}=h0;function I0(e,t){return typeof e=="string"?e=N0(e,t):typeof e=="object"&&(e=kn(Xt(e,t),t)),e}function P0(e,t,r){const o=r?Object.assign({scheme:"null"},r):{scheme:"null"},n=Ag(kn(e,o),kn(t,o),o,!0);return o.skipEscape=!0,Xt(n,o)}function Ag(e,t,r,o){const n={};return o||(e=kn(Xt(e,r),r),t=kn(Xt(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 x0(e,t,r){const o=Zg(e,r),n=Zg(t,r);return o!==void 0&&n!==void 0&&o.toLowerCase()===n.toLowerCase()}function Xt(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=Dg(o.scheme||r.scheme);i&&i.serialize&&i.serialize(r,o),r.path!==void 0&&(o.skipEscape?r.path=y0(r.path):(r.path=$0(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),o.reference!=="suffix"&&r.scheme&&n.push(r.scheme,":");const a=v0(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 O0=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function T0(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 Cg(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(O0);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=T0(o,a);if(s!==void 0&&(o.error=o.error||s,n=!0),o.host)if(k0(o.host)===!1){const l=g0(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=Dg(r.scheme||o.scheme);if(!r.unicodeSupport&&(!c||!c.unicodeSupport)&&o.host&&(r.domainHost||c&&c.domainHost)&&i===!1&&S0(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=b0(unescape(o.host),i))),o.path&&(o.path=_0(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 kn(e,t){return Cg(e,t).parsed}function N0(e,t){return Ug(e,t).normalized}function Ug(e,t){const{parsed:r,malformedAuthorityOrPort:o}=Cg(e,t);return{normalized:o?e:Xt(r,t),malformedAuthorityOrPort:o}}function Zg(e,t){if(typeof e=="string"){const{normalized:r,malformedAuthorityOrPort:o}=Ug(e,t);return o?void 0:r}if(typeof e=="object")return Xt(e,t)}const fc={SCHEMES:w0,normalize:I0,resolve:P0,resolveComponent:Ag,equal:x0,serialize:Xt,parse:kn};Qo.exports=fc,Qo.exports.default=fc,Qo.exports.fastUri=fc;var z0=Qo.exports;Object.defineProperty(dc,"__esModule",{value:!0});const Mg=z0;Mg.code='require("ajv/dist/runtime/uri").default',dc.default=Mg,(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=Vo();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=cc(),n=Wo(),i=Kt,a=We,s=se,c=Ue,u=je,l=Z,d=Lw,m=dc,p=(A,I)=>new RegExp(A,I);p.code="new RegExp";const h=["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."},y={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},v=200;function S(A){var I,E,O,f,_,T,L,J,pe,le,w,x,j,D,G,ce,Ee,pt,Je,Ve,Re,nn,it,vi,yi;const Nn=A.strict,_i=(I=A.code)===null||I===void 0?void 0:I.optimize,nu=_i===!0||_i===void 0?1:_i||0,ru=(O=(E=A.code)===null||E===void 0?void 0:E.regExp)!==null&&O!==void 0?O:p,Ev=(f=A.uriResolver)!==null&&f!==void 0?f:m.default;return{strictSchema:(T=(_=A.strictSchema)!==null&&_!==void 0?_:Nn)!==null&&T!==void 0?T:!0,strictNumbers:(J=(L=A.strictNumbers)!==null&&L!==void 0?L:Nn)!==null&&J!==void 0?J:!0,strictTypes:(le=(pe=A.strictTypes)!==null&&pe!==void 0?pe:Nn)!==null&&le!==void 0?le:"log",strictTuples:(x=(w=A.strictTuples)!==null&&w!==void 0?w:Nn)!==null&&x!==void 0?x:"log",strictRequired:(D=(j=A.strictRequired)!==null&&j!==void 0?j:Nn)!==null&&D!==void 0?D:!1,code:A.code?{...A.code,optimize:nu,regExp:ru}:{optimize:nu,regExp:ru},loopRequired:(G=A.loopRequired)!==null&&G!==void 0?G:v,loopEnum:(ce=A.loopEnum)!==null&&ce!==void 0?ce:v,meta:(Ee=A.meta)!==null&&Ee!==void 0?Ee:!0,messages:(pt=A.messages)!==null&&pt!==void 0?pt:!0,inlineRefs:(Je=A.inlineRefs)!==null&&Je!==void 0?Je:!0,schemaId:(Ve=A.schemaId)!==null&&Ve!==void 0?Ve:"$id",addUsedSchema:(Re=A.addUsedSchema)!==null&&Re!==void 0?Re:!0,validateSchema:(nn=A.validateSchema)!==null&&nn!==void 0?nn:!0,validateFormats:(it=A.validateFormats)!==null&&it!==void 0?it:!0,unicodeRegExp:(vi=A.unicodeRegExp)!==null&&vi!==void 0?vi:!0,int32range:(yi=A.int32range)!==null&&yi!==void 0?yi:!0,uriResolver:Ev}}class P{constructor(I={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,I=this.opts={...I,...S(I)};const{es5:E,lines:O}=this.opts.code;this.scope=new s.ValueScope({scope:{},prefixes:$,es5:E,lines:O}),this.logger=Q(I.logger);const f=I.validateFormats;I.validateFormats=!1,this.RULES=(0,i.getRules)(),N.call(this,g,I,"NOT SUPPORTED"),N.call(this,y,I,"DEPRECATED","warn"),this._metaOpts=xe.call(this),I.formats&&ue.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),I.keywords&&de.call(this,I.keywords),typeof I.meta=="object"&&this.addMetaSchema(I.meta),K.call(this),I.validateFormats=f}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:I,meta:E,schemaId:O}=this.opts;let f=d;O==="id"&&(f={...d},f.id=f.$id,delete f.$id),E&&I&&this.addMetaSchema(f,f[O],!1)}defaultMeta(){const{meta:I,schemaId:E}=this.opts;return this.opts.defaultMeta=typeof I=="object"?I[E]||I:void 0}validate(I,E){let O;if(typeof I=="string"){if(O=this.getSchema(I),!O)throw new Error(`no schema with key or ref "${I}"`)}else O=this.compile(I);const f=O(E);return"$async"in O||(this.errors=O.errors),f}compile(I,E){const O=this._addSchema(I,E);return O.validate||this._compileSchemaEnv(O)}compileAsync(I,E){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:O}=this.opts;return f.call(this,I,E);async function f(le,w){await _.call(this,le.$schema);const x=this._addSchema(le,w);return x.validate||T.call(this,x)}async function _(le){le&&!this.getSchema(le)&&await f.call(this,{$ref:le},!0)}async function T(le){try{return this._compileSchemaEnv(le)}catch(w){if(!(w instanceof n.default))throw w;return L.call(this,w),await J.call(this,w.missingSchema),T.call(this,le)}}function L({missingSchema:le,missingRef:w}){if(this.refs[le])throw new Error(`AnySchema ${le} is loaded but ${w} cannot be resolved`)}async function J(le){const w=await pe.call(this,le);this.refs[le]||await _.call(this,w.$schema),this.refs[le]||this.addSchema(w,le,E)}async function pe(le){const w=this._loading[le];if(w)return w;try{return await(this._loading[le]=O(le))}finally{delete this._loading[le]}}}addSchema(I,E,O,f=this.opts.validateSchema){if(Array.isArray(I)){for(const T of I)this.addSchema(T,void 0,O,f);return this}let _;if(typeof I=="object"){const{schemaId:T}=this.opts;if(_=I[T],_!==void 0&&typeof _!="string")throw new Error(`schema ${T} must be string`)}return E=(0,c.normalizeId)(E||_),this._checkUnique(E),this.schemas[E]=this._addSchema(I,O,E,f,!0),this}addMetaSchema(I,E,O=this.opts.validateSchema){return this.addSchema(I,E,!0,O),this}validateSchema(I,E){if(typeof I=="boolean")return!0;let O;if(O=I.$schema,O!==void 0&&typeof O!="string")throw new Error("$schema must be a string");if(O=O||this.opts.defaultMeta||this.defaultMeta(),!O)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const f=this.validate(O,I);if(!f&&E){const _="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(_);else throw new Error(_)}return f}getSchema(I){let E;for(;typeof(E=B.call(this,I))=="string";)I=E;if(E===void 0){const{schemaId:O}=this.opts,f=new a.SchemaEnv({schema:{},schemaId:O});if(E=a.resolveSchema.call(this,f,I),!E)return;this.refs[I]=E}return E.validate||this._compileSchemaEnv(E)}removeSchema(I){if(I instanceof RegExp)return this._removeAllSchemas(this.schemas,I),this._removeAllSchemas(this.refs,I),this;switch(typeof I){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const E=B.call(this,I);return typeof E=="object"&&this._cache.delete(E.schema),delete this.schemas[I],delete this.refs[I],this}case"object":{const E=I;this._cache.delete(E);let O=I[this.opts.schemaId];return O&&(O=(0,c.normalizeId)(O),delete this.schemas[O],delete this.refs[O]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(I){for(const E of I)this.addKeyword(E);return this}addKeyword(I,E){let O;if(typeof I=="string")O=I,typeof E=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),E.keyword=O);else if(typeof I=="object"&&E===void 0){if(E=I,O=E.keyword,Array.isArray(O)&&!O.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(V.call(this,O,E),!E)return(0,l.eachItem)(O,_=>Oe.call(this,_)),this;ot.call(this,E);const f={...E,type:(0,u.getJSONTypes)(E.type),schemaType:(0,u.getJSONTypes)(E.schemaType)};return(0,l.eachItem)(O,f.type.length===0?_=>Oe.call(this,_,f):_=>f.type.forEach(T=>Oe.call(this,_,f,T))),this}getKeyword(I){const E=this.RULES.all[I];return typeof E=="object"?E.definition:!!E}removeKeyword(I){const{RULES:E}=this;delete E.keywords[I],delete E.all[I];for(const O of E.rules){const f=O.rules.findIndex(_=>_.keyword===I);f>=0&&O.rules.splice(f,1)}return this}addFormat(I,E){return typeof E=="string"&&(E=new RegExp(E)),this.formats[I]=E,this}errorsText(I=this.errors,{separator:E=", ",dataVar:O="data"}={}){return!I||I.length===0?"No errors":I.map(f=>`${O}${f.instancePath} ${f.message}`).reduce((f,_)=>f+E+_)}$dataMetaSchema(I,E){const O=this.RULES.all;I=JSON.parse(JSON.stringify(I));for(const f of E){const _=f.split("/").slice(1);let T=I;for(const L of _)T=T[L];for(const L in O){const J=O[L];if(typeof J!="object")continue;const{$data:pe}=J.definition,le=T[L];pe&&le&&(T[L]=St(le))}}return I}_removeAllSchemas(I,E){for(const O in I){const f=I[O];(!E||E.test(O))&&(typeof f=="string"?delete I[O]:f&&!f.meta&&(this._cache.delete(f.schema),delete I[O]))}}_addSchema(I,E,O,f=this.opts.validateSchema,_=this.opts.addUsedSchema){let T;const{schemaId:L}=this.opts;if(typeof I=="object")T=I[L];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof I!="boolean")throw new Error("schema must be object or boolean")}let J=this._cache.get(I);if(J!==void 0)return J;O=(0,c.normalizeId)(T||O);const pe=c.getSchemaRefs.call(this,I,O);return J=new a.SchemaEnv({schema:I,schemaId:L,meta:E,baseId:O,localRefs:pe}),this._cache.set(J.schema,J),_&&!O.startsWith("#")&&(O&&this._checkUnique(O),this.refs[O]=J),f&&this.validateSchema(I,!0),J}_checkUnique(I){if(this.schemas[I]||this.refs[I])throw new Error(`schema with key or id "${I}" already exists`)}_compileSchemaEnv(I){if(I.meta?this._compileMetaSchema(I):a.compileSchema.call(this,I),!I.validate)throw new Error("ajv implementation error");return I.validate}_compileMetaSchema(I){const E=this.opts;this.opts=this._metaOpts;try{a.compileSchema.call(this,I)}finally{this.opts=E}}}P.ValidationError=o.default,P.MissingRefError=n.default,e.default=P;function N(A,I,E,O="error"){for(const f in A){const _=f;_ in I&&this.logger[O](`${E}: option ${f}. ${A[_]}`)}}function B(A){return A=(0,c.normalizeId)(A),this.schemas[A]||this.refs[A]}function K(){const A=this.opts.schemas;if(A)if(Array.isArray(A))this.addSchema(A);else for(const I in A)this.addSchema(A[I],I)}function ue(){for(const A in this.opts.formats){const I=this.opts.formats[A];I&&this.addFormat(A,I)}}function de(A){if(Array.isArray(A)){this.addVocabulary(A);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const I in A){const E=A[I];E.keyword||(E.keyword=I),this.addKeyword(E)}}function xe(){const A={...this.opts};for(const I of h)delete A[I];return A}const M={log(){},warn(){},error(){}};function Q(A){if(A===!1)return M;if(A===void 0)return console;if(A.log&&A.warn&&A.error)return A;throw new Error("logger must implement log, warn and error methods")}const X=/^[a-z_$][a-z0-9_$:-]*$/i;function V(A,I){const{RULES:E}=this;if((0,l.eachItem)(A,O=>{if(E.keywords[O])throw new Error(`Keyword ${O} is already defined`);if(!X.test(O))throw new Error(`Keyword ${O} has invalid name`)}),!!I&&I.$data&&!("code"in I||"validate"in I))throw new Error('$data keyword must have "code" or "validate" function')}function Oe(A,I,E){var O;const f=I?.post;if(E&&f)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:_}=this;let T=f?_.post:_.rules.find(({type:J})=>J===E);if(T||(T={type:E,rules:[]},_.rules.push(T)),_.keywords[A]=!0,!I)return;const L={keyword:A,definition:{...I,type:(0,u.getJSONTypes)(I.type),schemaType:(0,u.getJSONTypes)(I.schemaType)}};I.before?rt.call(this,T,L,I.before):T.rules.push(L),_.all[A]=L,(O=I.implements)===null||O===void 0||O.forEach(J=>this.addKeyword(J))}function rt(A,I,E){const O=A.rules.findIndex(f=>f.keyword===E);O>=0?A.rules.splice(O,0,I):(A.rules.push(I),this.logger.warn(`rule ${E} is not defined`))}function ot(A){let{metaSchema:I}=A;I!==void 0&&(A.$data&&this.opts.$data&&(I=St(I)),A.validateSchema=this.compile(I,!0))}const Zt={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function St(A){return{anyOf:[A,Zt]}}})(Hh);var hc={},gc={},vc={};Object.defineProperty(vc,"__esModule",{value:!0});const j0={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};vc.default=j0;var Yt={};Object.defineProperty(Yt,"__esModule",{value:!0}),Yt.callRef=Yt.getValidate=void 0;const E0=Wo(),Bg=gt(),Xe=se,Sn=Et(),Lg=We,ni=Z,R0={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=Lg.resolveRef.call(c,u,n,r);if(l===void 0)throw new E0.default(o.opts.uriResolver,n,r);if(l instanceof Lg.SchemaEnv)return m(l);return p(l);function d(){if(i===u)return ri(e,a,i,i.$async);const h=t.scopeValue("root",{ref:u});return ri(e,(0,Xe._)`${h}.validate`,u,u.$async)}function m(h){const $=Fg(e,h);ri(e,$,h,h.$async)}function p(h){const $=t.scopeValue("schema",s.code.source===!0?{ref:h,code:(0,Xe.stringify)(h)}:{ref:h}),g=t.name("valid"),y=e.subschema({schema:h,dataTypes:[],schemaPath:Xe.nil,topSchemaRef:$,errSchemaPath:r},g);e.mergeEvaluated(y),e.ok(g)}}};function Fg(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,Xe._)`${r.scopeValue("wrapper",{ref:t})}.validate`}Yt.getValidate=Fg;function ri(e,t,r,o){const{gen:n,it:i}=e,{allErrors:a,schemaEnv:s,opts:c}=i,u=c.passContext?Sn.default.this:Xe.nil;o?l():d();function l(){if(!s.$async)throw new Error("async schema referenced by sync schema");const h=n.let("valid");n.try(()=>{n.code((0,Xe._)`await ${(0,Bg.callValidateCode)(e,t,u)}`),p(t),a||n.assign(h,!0)},$=>{n.if((0,Xe._)`!(${$} instanceof ${i.ValidationError})`,()=>n.throw($)),m($),a||n.assign(h,!1)}),e.ok(h)}function d(){e.result((0,Bg.callValidateCode)(e,t,u),()=>p(t),()=>m(t))}function m(h){const $=(0,Xe._)`${h}.errors`;n.assign(Sn.default.vErrors,(0,Xe._)`${Sn.default.vErrors} === null ? ${$} : ${Sn.default.vErrors}.concat(${$})`),n.assign(Sn.default.errors,(0,Xe._)`${Sn.default.vErrors}.length`)}function p(h){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=ni.mergeEvaluated.props(n,g.props,i.props));else{const y=n.var("props",(0,Xe._)`${h}.evaluated.props`);i.props=ni.mergeEvaluated.props(n,y,i.props,Xe.Name)}if(i.items!==!0)if(g&&!g.dynamicItems)g.items!==void 0&&(i.items=ni.mergeEvaluated.items(n,g.items,i.items));else{const y=n.var("items",(0,Xe._)`${h}.evaluated.items`);i.items=ni.mergeEvaluated.items(n,y,i.items,Xe.Name)}}}Yt.callRef=ri,Yt.default=R0,Object.defineProperty(gc,"__esModule",{value:!0});const D0=vc,A0=Yt,C0=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",D0.default,A0.default];gc.default=C0;var yc={},_c={};Object.defineProperty(_c,"__esModule",{value:!0});const oi=se,Dt=oi.operators,ii={maximum:{okStr:"<=",ok:Dt.LTE,fail:Dt.GT},minimum:{okStr:">=",ok:Dt.GTE,fail:Dt.LT},exclusiveMaximum:{okStr:"<",ok:Dt.LT,fail:Dt.GTE},exclusiveMinimum:{okStr:">",ok:Dt.GT,fail:Dt.LTE}},U0={message:({keyword:e,schemaCode:t})=>(0,oi.str)`must be ${ii[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,oi._)`{comparison: ${ii[e].okStr}, limit: ${t}}`},Z0={keyword:Object.keys(ii),type:"number",schemaType:"number",$data:!0,error:U0,code(e){const{keyword:t,data:r,schemaCode:o}=e;e.fail$data((0,oi._)`${r} ${ii[t].fail} ${o} || isNaN(${r})`)}};_c.default=Z0;var $c={};Object.defineProperty($c,"__esModule",{value:!0});const br=se,M0={message:({schemaCode:e})=>(0,br.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,br._)`{multipleOf: ${e}}`},B0={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:M0,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}))`)}};$c.default=B0;var bc={},kc={};Object.defineProperty(kc,"__esModule",{value:!0});function Gg(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}kc.default=Gg,Gg.code='require("ajv/dist/runtime/ucs2length").default',Object.defineProperty(bc,"__esModule",{value:!0});const Qt=se,L0=Z,F0=kc,G0={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}}`},q0={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:G0,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,L0.useFunc)(e.gen,F0.default)}(${r})`;e.fail$data((0,Qt._)`${a} ${i} ${o}`)}};bc.default=q0;var Sc={};Object.defineProperty(Sc,"__esModule",{value:!0});const J0=gt(),V0=Z,wn=se,H0={message:({schemaCode:e})=>(0,wn.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,wn._)`{pattern: ${e}}`},K0={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:H0,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,wn._)`new RegExp`:(0,V0.useFunc)(t,c),l=t.let("valid");t.try(()=>t.assign(l,(0,wn._)`${u}(${i}, ${s}).test(${r})`),()=>t.assign(l,!1)),e.fail$data((0,wn._)`!${l}`)}else{const c=(0,J0.usePattern)(e,n);e.fail$data((0,wn._)`!${c}.test(${r})`)}}};Sc.default=K0;var wc={};Object.defineProperty(wc,"__esModule",{value:!0});const kr=se,W0={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}}`},X0={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:W0,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}`)}};wc.default=X0;var Ic={};Object.defineProperty(Ic,"__esModule",{value:!0});const Sr=gt(),wr=se,Y0=Z,Q0={message:({params:{missingProperty:e}})=>(0,wr.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,wr._)`{missingProperty: ${e}}`},eI={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Q0,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 p=e.parentSchema.properties,{definedProperties:h}=e.it;for(const $ of r)if(p?.[$]===void 0&&!h.has($)){const g=a.schemaEnv.baseId+a.errSchemaPath,y=`required property "${$}" is not defined at "${g}" (strictRequired)`;(0,Y0.checkStrictMode)(a,y,a.opts.strictRequired)}}function u(){if(c||i)e.block$data(wr.nil,d);else for(const p of r)(0,Sr.checkReportMissingProp)(e,p)}function l(){const p=t.let("missing");if(c||i){const h=t.let("valid",!0);e.block$data(h,()=>m(p,h)),e.ok(h)}else t.if((0,Sr.checkMissingProp)(e,r,p)),(0,Sr.reportMissingProp)(e,p),t.else()}function d(){t.forOf("prop",o,p=>{e.setParams({missingProperty:p}),t.if((0,Sr.noPropertyInData)(t,n,p,s.ownProperties),()=>e.error())})}function m(p,h){e.setParams({missingProperty:p}),t.forOf(p,o,()=>{t.assign(h,(0,Sr.propertyInData)(t,n,p,s.ownProperties)),t.if((0,wr.not)(h),()=>{e.error(),t.break()})},wr.nil)}}};Ic.default=eI;var Pc={};Object.defineProperty(Pc,"__esModule",{value:!0});const Ir=se,tI={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}}`},nI={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:tI,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}`)}};Pc.default=nI;var xc={},Pr={};Object.defineProperty(Pr,"__esModule",{value:!0});const qg=fg;qg.code='require("ajv/dist/runtime/equal").default',Pr.default=qg,Object.defineProperty(xc,"__esModule",{value:!0});const Oc=je,Ze=se,rI=Z,oI=Pr,iI={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}}`},aI={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:iI,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,Oc.getSchemaTypes)(i.items):[];e.block$data(c,l,(0,Ze._)`${a} === false`),e.ok(c);function l(){const h=t.let("i",(0,Ze._)`${r}.length`),$=t.let("j");e.setParams({i:h,j:$}),t.assign(c,!0),t.if((0,Ze._)`${h} > 1`,()=>(d()?m:p)(h,$))}function d(){return u.length>0&&!u.some(h=>h==="object"||h==="array")}function m(h,$){const g=t.name("item"),y=(0,Oc.checkDataTypes)(u,g,s.opts.strictNumbers,Oc.DataType.Wrong),v=t.const("indices",(0,Ze._)`{}`);t.for((0,Ze._)`;${h}--;`,()=>{t.let(g,(0,Ze._)`${r}[${h}]`),t.if(y,(0,Ze._)`continue`),u.length>1&&t.if((0,Ze._)`typeof ${g} == "string"`,(0,Ze._)`${g} += "_"`),t.if((0,Ze._)`typeof ${v}[${g}] == "number"`,()=>{t.assign($,(0,Ze._)`${v}[${g}]`),e.error(),t.assign(c,!1).break()}).code((0,Ze._)`${v}[${g}] = ${h}`)})}function p(h,$){const g=(0,rI.useFunc)(t,oI.default),y=t.name("outer");t.label(y).for((0,Ze._)`;${h}--;`,()=>t.for((0,Ze._)`${$} = ${h}; ${$}--;`,()=>t.if((0,Ze._)`${g}(${r}[${h}], ${r}[${$}])`,()=>{e.error(),t.assign(c,!1).break(y)})))}}};xc.default=aI;var Tc={};Object.defineProperty(Tc,"__esModule",{value:!0});const Nc=se,sI=Z,cI=Pr,uI={message:"must be equal to constant",params:({schemaCode:e})=>(0,Nc._)`{allowedValue: ${e}}`},lI={keyword:"const",$data:!0,error:uI,code(e){const{gen:t,data:r,$data:o,schemaCode:n,schema:i}=e;o||i&&typeof i=="object"?e.fail$data((0,Nc._)`!${(0,sI.useFunc)(t,cI.default)}(${r}, ${n})`):e.fail((0,Nc._)`${i} !== ${r}`)}};Tc.default=lI;var zc={};Object.defineProperty(zc,"__esModule",{value:!0});const xr=se,dI=Z,pI=Pr,mI={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,xr._)`{allowedValues: ${e}}`},fI={keyword:"enum",schemaType:"array",$data:!0,error:mI,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,dI.useFunc)(t,pI.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 p=t.const("vSchema",i);l=(0,xr.or)(...n.map((h,$)=>m(p,$)))}e.pass(l);function d(){t.assign(l,!1),t.forOf("v",i,p=>t.if((0,xr._)`${u()}(${r}, ${p})`,()=>t.assign(l,!0).break()))}function m(p,h){const $=n[h];return typeof $=="object"&&$!==null?(0,xr._)`${u()}(${r}, ${p}[${h}])`:(0,xr._)`${r} === ${$}`}}};zc.default=fI,Object.defineProperty(yc,"__esModule",{value:!0});const hI=_c,gI=$c,vI=bc,yI=Sc,_I=wc,$I=Ic,bI=Pc,kI=xc,SI=Tc,wI=zc,II=[hI.default,gI.default,vI.default,yI.default,_I.default,$I.default,bI.default,kI.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},SI.default,wI.default];yc.default=II;var jc={},In={};Object.defineProperty(In,"__esModule",{value:!0}),In.validateAdditionalItems=void 0;const en=se,Ec=Z,PI={message:({params:{len:e}})=>(0,en.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,en._)`{limit: ${e}}`},xI={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:PI,code(e){const{parentSchema:t,it:r}=e,{items:o}=t;if(!Array.isArray(o)){(0,Ec.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}Jg(e,o)}};function Jg(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,Ec.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:Ec.Type.Num},u),a.allErrors||r.if((0,en.not)(u),()=>r.break())})}}In.validateAdditionalItems=Jg,In.default=xI;var Rc={},Pn={};Object.defineProperty(Pn,"__esModule",{value:!0}),Pn.validateTuple=void 0;const Vg=se,ai=Z,OI=gt(),TI={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:r}=e;if(Array.isArray(t))return Hg(e,"additionalItems",t);r.items=!0,!(0,ai.alwaysValidSchema)(r,t)&&e.ok((0,OI.validateArray)(e))}};function Hg(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=ai.mergeEvaluated.items(o,r.length,s.items));const c=o.name("valid"),u=o.const("len",(0,Vg._)`${i}.length`);r.forEach((d,m)=>{(0,ai.alwaysValidSchema)(s,d)||(o.if((0,Vg._)`${u} > ${m}`,()=>e.subschema({keyword:a,schemaProp:m,dataProp:m},c)),e.ok(c))});function l(d){const{opts:m,errSchemaPath:p}=s,h=r.length,$=h===d.minItems&&(h===d.maxItems||d[t]===!1);if(m.strictTuples&&!$){const g=`"${a}" is ${h}-tuple, but minItems or maxItems/${t} are not specified or different at path "${p}"`;(0,ai.checkStrictMode)(s,g,m.strictTuples)}}}Pn.validateTuple=Hg,Pn.default=TI,Object.defineProperty(Rc,"__esModule",{value:!0});const NI=Pn,zI={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,NI.validateTuple)(e,"items")};Rc.default=zI;var Dc={};Object.defineProperty(Dc,"__esModule",{value:!0});const Kg=se,jI=Z,EI=gt(),RI=In,DI={message:({params:{len:e}})=>(0,Kg.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,Kg._)`{limit: ${e}}`},AI={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:DI,code(e){const{schema:t,parentSchema:r,it:o}=e,{prefixItems:n}=r;o.items=!0,!(0,jI.alwaysValidSchema)(o,t)&&(n?(0,RI.validateAdditionalItems)(e,n):e.ok((0,EI.validateArray)(e)))}};Dc.default=AI;var Ac={};Object.defineProperty(Ac,"__esModule",{value:!0});const dt=se,si=Z,CI={message:({params:{min:e,max:t}})=>t===void 0?(0,dt.str)`must contain at least ${e} valid item(s)`:(0,dt.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,dt._)`{minContains: ${e}}`:(0,dt._)`{minContains: ${e}, maxContains: ${t}}`},UI={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:CI,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,dt._)`${n}.length`);if(e.setParams({min:a,max:s}),s===void 0&&a===0){(0,si.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(s!==void 0&&a>s){(0,si.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,si.alwaysValidSchema)(i,r)){let $=(0,dt._)`${l} >= ${a}`;s!==void 0&&($=(0,dt._)`${$} && ${l} <= ${s}`),e.pass($);return}i.items=!0;const d=t.name("valid");s===void 0&&a===1?p(d,()=>t.if(d,()=>t.break())):a===0?(t.let(d,!0),s!==void 0&&t.if((0,dt._)`${n}.length > 0`,m)):(t.let(d,!1),m()),e.result(d,()=>e.reset());function m(){const $=t.name("_valid"),g=t.let("count",0);p($,()=>t.if($,()=>h(g)))}function p($,g){t.forRange("i",0,l,y=>{e.subschema({keyword:"contains",dataProp:y,dataPropType:si.Type.Num,compositeRule:!0},$),g()})}function h($){t.code((0,dt._)`${$}++`),s===void 0?t.if((0,dt._)`${$} >= ${a}`,()=>t.assign(d,!0).break()):(t.if((0,dt._)`${$} > ${s}`,()=>t.assign(d,!1).break()),a===1?t.assign(d,!0):t.if((0,dt._)`${$} >= ${a}`,()=>t.assign(d,!0)))}}};Ac.default=UI;var Wg={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=se,r=Z,o=gt();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 m=Array.isArray(c[d])?u:l;m[d]=c[d]}return[u,l]}function a(c,u=c.schema){const{gen:l,data:d,it:m}=c;if(Object.keys(u).length===0)return;const p=l.let("missing");for(const h in u){const $=u[h];if($.length===0)continue;const g=(0,o.propertyInData)(l,d,h,m.opts.ownProperties);c.setParams({property:h,depsCount:$.length,deps:$.join(", ")}),m.allErrors?l.if(g,()=>{for(const y of $)(0,o.checkReportMissingProp)(c,y)}):(l.if((0,t._)`${g} && (${(0,o.checkMissingProp)(c,$,p)})`),(0,o.reportMissingProp)(c,p),l.else())}}e.validatePropertyDeps=a;function s(c,u=c.schema){const{gen:l,data:d,keyword:m,it:p}=c,h=l.name("valid");for(const $ in u)(0,r.alwaysValidSchema)(p,u[$])||(l.if((0,o.propertyInData)(l,d,$,p.opts.ownProperties),()=>{const g=c.subschema({keyword:m,schemaProp:$},h);c.mergeValidEvaluated(g,h)},()=>l.var(h,!0)),c.ok(h))}e.validateSchemaDeps=s,e.default=n})(Wg);var Cc={};Object.defineProperty(Cc,"__esModule",{value:!0});const Xg=se,ZI=Z,MI={message:"property name must be valid",params:({params:e})=>(0,Xg._)`{propertyName: ${e.propertyName}}`},BI={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:MI,code(e){const{gen:t,schema:r,data:o,it:n}=e;if((0,ZI.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,Xg.not)(i),()=>{e.error(!0),n.allErrors||t.break()})}),e.ok(i)}};Cc.default=BI;var ci={};Object.defineProperty(ci,"__esModule",{value:!0});const ui=gt(),_t=se,LI=Et(),li=Z,FI={message:"must NOT have additional properties",params:({params:e})=>(0,_t._)`{additionalProperty: ${e.additionalProperty}}`},GI={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:FI,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,li.alwaysValidSchema)(a,r))return;const u=(0,ui.allSchemaProperties)(o.properties),l=(0,ui.allSchemaProperties)(o.patternProperties);d(),e.ok((0,_t._)`${i} === ${LI.default.errors}`);function d(){t.forIn("key",n,g=>{!u.length&&!l.length?h(g):t.if(m(g),()=>h(g))})}function m(g){let y;if(u.length>8){const v=(0,li.schemaRefOrVal)(a,o.properties,"properties");y=(0,ui.isOwnProperty)(t,v,g)}else u.length?y=(0,_t.or)(...u.map(v=>(0,_t._)`${g} === ${v}`)):y=_t.nil;return l.length&&(y=(0,_t.or)(y,...l.map(v=>(0,_t._)`${(0,ui.usePattern)(e,v)}.test(${g})`))),(0,_t.not)(y)}function p(g){t.code((0,_t._)`delete ${n}[${g}]`)}function h(g){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){p(g);return}if(r===!1){e.setParams({additionalProperty:g}),e.error(),s||t.break();return}if(typeof r=="object"&&!(0,li.alwaysValidSchema)(a,r)){const y=t.name("valid");c.removeAdditional==="failing"?($(g,y,!1),t.if((0,_t.not)(y),()=>{e.reset(),p(g)})):($(g,y),s||t.if((0,_t.not)(y),()=>t.break()))}}function $(g,y,v){const S={keyword:"additionalProperties",dataProp:g,dataPropType:li.Type.Str};v===!1&&Object.assign(S,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(S,y)}}};ci.default=GI;var Uc={};Object.defineProperty(Uc,"__esModule",{value:!0});const qI=Vo(),Yg=gt(),Zc=Z,Qg=ci,JI={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&&Qg.default.code(new qI.KeywordCxt(i,Qg.default,"additionalProperties"));const a=(0,Yg.allSchemaProperties)(r);for(const d of a)i.definedProperties.add(d);i.opts.unevaluated&&a.length&&i.props!==!0&&(i.props=Zc.mergeEvaluated.props(t,(0,Zc.toHash)(a),i.props));const s=a.filter(d=>!(0,Zc.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,Yg.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)}}};Uc.default=JI;var Mc={};Object.defineProperty(Mc,"__esModule",{value:!0});const ev=gt(),di=se,tv=Z,nv=Z,VI={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,ev.allSchemaProperties)(r),c=s.filter($=>(0,tv.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 di.Name)&&(i.props=(0,nv.evaluatedPropsToName)(t,i.props));const{props:d}=i;m();function m(){for(const $ of s)u&&p($),i.allErrors?h($):(t.var(l,!0),h($),t.if(l))}function p($){for(const g in u)new RegExp($).test(g)&&(0,tv.checkStrictMode)(i,`property ${g} matches pattern ${$} (use allowMatchingProperties)`)}function h($){t.forIn("key",o,g=>{t.if((0,di._)`${(0,ev.usePattern)(e,$)}.test(${g})`,()=>{const y=c.includes($);y||e.subschema({keyword:"patternProperties",schemaProp:$,dataProp:g,dataPropType:nv.Type.Str},l),i.opts.unevaluated&&d!==!0?t.assign((0,di._)`${d}[${g}]`,!0):!y&&!i.allErrors&&t.if((0,di.not)(l),()=>t.break())})})}}};Mc.default=VI;var Bc={};Object.defineProperty(Bc,"__esModule",{value:!0});const HI=Z,KI={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:r,it:o}=e;if((0,HI.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"}};Bc.default=KI;var Lc={};Object.defineProperty(Lc,"__esModule",{value:!0});const WI=gt(),XI={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:WI.validateUnion,error:{message:"must match a schema in anyOf"}};Lc.default=XI;var Fc={};Object.defineProperty(Fc,"__esModule",{value:!0});const pi=se,YI=Z,QI={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,pi._)`{passingSchemas: ${e.passing}}`},eP={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:QI,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 m;(0,YI.alwaysValidSchema)(n,l)?t.var(c,!0):m=e.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&t.if((0,pi._)`${c} && ${a}`).assign(a,!1).assign(s,(0,pi._)`[${s}, ${d}]`).else(),t.if(c,()=>{t.assign(a,!0),t.assign(s,d),m&&e.mergeEvaluated(m,pi.Name)})})}}};Fc.default=eP;var Gc={};Object.defineProperty(Gc,"__esModule",{value:!0});const tP=Z,nP={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,tP.alwaysValidSchema)(o,i))return;const s=e.subschema({keyword:"allOf",schemaProp:a},n);e.ok(n),e.mergeEvaluated(s)})}};Gc.default=nP;var qc={};Object.defineProperty(qc,"__esModule",{value:!0});const mi=se,rv=Z,rP={message:({params:e})=>(0,mi.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,mi._)`{failingKeyword: ${e.ifClause}}`},oP={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:rP,code(e){const{gen:t,parentSchema:r,it:o}=e;r.then===void 0&&r.else===void 0&&(0,rv.checkStrictMode)(o,'"if" without "then" and "else" is ignored');const n=ov(o,"then"),i=ov(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,mi.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 m=e.subschema({keyword:l},s);t.assign(a,s),e.mergeValidEvaluated(m,a),d?t.assign(d,(0,mi._)`${l}`):e.setParams({ifClause:l})}}}};function ov(e,t){const r=e.schema[t];return r!==void 0&&!(0,rv.alwaysValidSchema)(e,r)}qc.default=oP;var Jc={};Object.defineProperty(Jc,"__esModule",{value:!0});const iP=Z,aP={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,iP.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};Jc.default=aP,Object.defineProperty(jc,"__esModule",{value:!0});const sP=In,cP=Rc,uP=Pn,lP=Dc,dP=Ac,pP=Wg,mP=Cc,fP=ci,hP=Uc,gP=Mc,vP=Bc,yP=Lc,_P=Fc,$P=Gc,bP=qc,kP=Jc;function SP(e=!1){const t=[vP.default,yP.default,_P.default,$P.default,bP.default,kP.default,mP.default,fP.default,pP.default,hP.default,gP.default];return e?t.push(cP.default,lP.default):t.push(sP.default,uP.default),t.push(dP.default),t}jc.default=SP;var Vc={},Hc={};Object.defineProperty(Hc,"__esModule",{value:!0});const Te=se,wP={message:({schemaCode:e})=>(0,Te.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,Te._)`{format: ${e}}`},IP={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:wP,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?m():p();function m(){const h=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),$=r.const("fDef",(0,Te._)`${h}[${a}]`),g=r.let("fType"),y=r.let("format");r.if((0,Te._)`typeof ${$} == "object" && !(${$} instanceof RegExp)`,()=>r.assign(g,(0,Te._)`${$}.type || "string"`).assign(y,(0,Te._)`${$}.validate`),()=>r.assign(g,(0,Te._)`"string"`).assign(y,$)),e.fail$data((0,Te.or)(v(),S()));function v(){return c.strictSchema===!1?Te.nil:(0,Te._)`${a} && !${y}`}function S(){const P=l.$async?(0,Te._)`(${$}.async ? await ${y}(${o}) : ${y}(${o}))`:(0,Te._)`${y}(${o})`,N=(0,Te._)`(typeof ${y} == "function" ? ${P} : ${y}.test(${o}))`;return(0,Te._)`${y} && ${y} !== true && ${g} === ${t} && !${N}`}}function p(){const h=d.formats[i];if(!h){v();return}if(h===!0)return;const[$,g,y]=S(h);$===t&&e.pass(P());function v(){if(c.strictSchema===!1){d.logger.warn(N());return}throw new Error(N());function N(){return`unknown format "${i}" ignored in schema at path "${u}"`}}function S(N){const B=N instanceof RegExp?(0,Te.regexpCode)(N):c.code.formats?(0,Te._)`${c.code.formats}${(0,Te.getProperty)(i)}`:void 0,K=r.scopeValue("formats",{key:i,ref:N,code:B});return typeof N=="object"&&!(N instanceof RegExp)?[N.type||"string",N.validate,(0,Te._)`${K}.validate`]:["string",N,K]}function P(){if(typeof h=="object"&&!(h instanceof RegExp)&&h.async){if(!l.$async)throw new Error("async format in sync schema");return(0,Te._)`await ${y}(${o})`}return typeof g=="function"?(0,Te._)`${y}(${o})`:(0,Te._)`${y}.test(${o})`}}}};Hc.default=IP,Object.defineProperty(Vc,"__esModule",{value:!0});const PP=Hc,xP=[PP.default];Vc.default=xP;var xn={};Object.defineProperty(xn,"__esModule",{value:!0}),xn.contentVocabulary=xn.metadataVocabulary=void 0,xn.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],xn.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"],Object.defineProperty(hc,"__esModule",{value:!0});const OP=gc,TP=yc,NP=jc,zP=Vc,iv=xn,jP=[OP.default,TP.default,(0,NP.default)(),zP.default,iv.metadataVocabulary,iv.contentVocabulary];hc.default=jP;var Kc={},fi={};Object.defineProperty(fi,"__esModule",{value:!0}),fi.DiscrError=void 0;var av;(function(e){e.Tag="tag",e.Mapping="mapping"})(av||(fi.DiscrError=av={})),Object.defineProperty(Kc,"__esModule",{value:!0});const On=se,Wc=fi,sv=We,EP=Wo(),RP=Z,DP={message:({params:{discrError:e,tagName:t}})=>e===Wc.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,On._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},AP={keyword:"discriminator",type:"object",schemaType:"object",error:DP,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,On._)`${r}${(0,On.getProperty)(s)}`);t.if((0,On._)`typeof ${u} == "string"`,()=>l(),()=>e.error(!1,{discrError:Wc.DiscrError.Tag,tag:u,tagName:s})),e.ok(c);function l(){const p=m();t.if(!1);for(const h in p)t.elseIf((0,On._)`${u} === ${h}`),t.assign(c,d(p[h]));t.else(),e.error(!1,{discrError:Wc.DiscrError.Mapping,tag:u,tagName:s}),t.endIf()}function d(p){const h=t.name("valid"),$=e.subschema({keyword:"oneOf",schemaProp:p},h);return e.mergeEvaluated($,On.Name),h}function m(){var p;const h={},$=y(n);let g=!0;for(let P=0;P<a.length;P++){let N=a[P];if(N?.$ref&&!(0,RP.schemaHasRulesButRef)(N,i.self.RULES)){const K=N.$ref;if(N=sv.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,K),N instanceof sv.SchemaEnv&&(N=N.schema),N===void 0)throw new EP.default(i.opts.uriResolver,i.baseId,K)}const B=(p=N?.properties)===null||p===void 0?void 0:p[s];if(typeof B!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${s}"`);g=g&&($||y(N)),v(B,P)}if(!g)throw new Error(`discriminator: "${s}" must be required`);return h;function y({required:P}){return Array.isArray(P)&&P.includes(s)}function v(P,N){if(P.const)S(P.const,N);else if(P.enum)for(const B of P.enum)S(B,N);else throw new Error(`discriminator: "properties/${s}" must have "const" or "enum"`)}function S(P,N){if(typeof P!="string"||P in h)throw new Error(`discriminator: "${s}" values must be unique strings`);h[P]=N}}}};Kc.default=AP;var CP="http://json-schema.org/draft-07/schema#",UP="http://json-schema.org/draft-07/schema#",ZP="Core schema meta-schema",MP={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:[]}},BP=["object","boolean"],LP={$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:"#"}},FP={$schema:CP,$id:UP,title:ZP,definitions:MP,type:BP,properties:LP,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=Hh,o=hc,n=Kc,i=FP,a=["/properties"],s="http://json-schema.org/draft-07/schema";class c extends r.default{_addVocabularies(){super._addVocabularies(),o.default.forEach(h=>this.addVocabulary(h)),this.opts.discriminator&&this.addKeyword(n.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const h=this.opts.$data?this.$dataMetaSchema(i,a):i;this.addMetaSchema(h,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=Vo();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=cc();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return d.default}});var m=Wo();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return m.default}})})(Ys,Ys.exports);var cv=Ys.exports,GP=Vh(cv),Xc={exports:{}},uv={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(M,Q){return{validate:M,compare:Q}}e.fullFormats={date:t(i,a),time:t(c(!0),u),"date-time":t(m(!0),p),"iso-time":t(c(),l),"iso-date-time":t(m(),h),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:y,"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:xe,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:S,int32:{type:"number",validate:B},int64:{type:"number",validate:K},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,p),"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,h),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(M){return M%4===0&&(M%100!==0||M%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(M){const Q=o.exec(M);if(!Q)return!1;const X=+Q[1],V=+Q[2],Oe=+Q[3];return V>=1&&V<=12&&Oe>=1&&Oe<=(V===2&&r(X)?29:n[V])}function a(M,Q){if(M&&Q)return M>Q?1:M<Q?-1:0}const s=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function c(M){return function(X){const V=s.exec(X);if(!V)return!1;const Oe=+V[1],rt=+V[2],ot=+V[3],Zt=V[4],St=V[5]==="-"?-1:1,A=+(V[6]||0),I=+(V[7]||0);if(A>23||I>59||M&&!Zt)return!1;if(Oe<=23&&rt<=59&&ot<60)return!0;const E=rt-I*St,O=Oe-A*St-(E<0?1:0);return(O===23||O===-1)&&(E===59||E===-1)&&ot<61}}function u(M,Q){if(!(M&&Q))return;const X=new Date("2020-01-01T"+M).valueOf(),V=new Date("2020-01-01T"+Q).valueOf();if(X&&V)return X-V}function l(M,Q){if(!(M&&Q))return;const X=s.exec(M),V=s.exec(Q);if(X&&V)return M=X[1]+X[2]+X[3],Q=V[1]+V[2]+V[3],M>Q?1:M<Q?-1:0}const d=/t|\s/i;function m(M){const Q=c(M);return function(V){const Oe=V.split(d);return Oe.length===2&&i(Oe[0])&&Q(Oe[1])}}function p(M,Q){if(!(M&&Q))return;const X=new Date(M).valueOf(),V=new Date(Q).valueOf();if(X&&V)return X-V}function h(M,Q){if(!(M&&Q))return;const[X,V]=M.split(d),[Oe,rt]=Q.split(d),ot=a(X,Oe);if(ot!==void 0)return ot||u(V,rt)}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 y(M){return $.test(M)&&g.test(M)}const v=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function S(M){return v.lastIndex=0,v.test(M)}const P=-2147483648,N=2**31-1;function B(M){return Number.isInteger(M)&&M<=N&&M>=P}function K(M){return Number.isInteger(M)}function ue(){return!0}const de=/[^\\]\\Z/;function xe(M){if(de.test(M))return!1;try{return new RegExp(M),!0}catch{return!1}}})(uv);var lv={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=cv,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:m}=s,{opts:p,self:h}=m;if(!p.validateFormats)return;const $=new t.KeywordCxt(m,h.RULES.all.format.definition,"format");$.$data?g():y();function g(){const S=c.scopeValue("formats",{ref:h.formats,code:p.code.formats}),P=c.const("fmt",(0,r._)`${S}[${$.schemaCode}]`);s.fail$data((0,r.or)((0,r._)`typeof ${P} != "object"`,(0,r._)`${P} instanceof RegExp`,(0,r._)`typeof ${P}.compare != "function"`,v(P)))}function y(){const S=$.schema,P=h.formats[S];if(!P||P===!0)return;if(typeof P!="object"||P instanceof RegExp||typeof P.compare!="function")throw new Error(`"${d}": format "${S}" does not define "compare" function`);const N=c.scopeValue("formats",{key:S,ref:P,code:p.code.formats?(0,r._)`${p.code.formats}${(0,r.getProperty)(S)}`:void 0});s.fail$data(v(N))}function v(S){return(0,r._)`${S}.compare(${u}, ${l}) ${n[d].fail} 0`}},dependencies:["format"]};const a=s=>(s.addKeyword(e.formatLimitDefinition),s);e.default=a})(lv),(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=uv,o=lv,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,m]=l.mode==="fast"?[r.fastFormats,a]:[r.fullFormats,i],p=l.formats||r.formatNames;return c(u,p,d,m),l.keywords&&(0,o.default)(u),u};s.get=(u,l="full")=>{const m=(l==="fast"?r.fastFormats:r.fullFormats)[u];if(!m)throw new Error(`Unknown format "${u}"`);return m};function c(u,l,d,m){var p,h;(p=(h=u.opts.code).formats)!==null&&p!==void 0||(h.formats=(0,n._)`require("ajv-formats/dist/formats").${m}`);for(const $ of l)u.addFormat($,d[$])}e.exports=t=s,Object.defineProperty(t,"__esModule",{value:!0}),t.default=s})(Xc,Xc.exports);var qP=Xc.exports,JP=Vh(qP);function VP(){const e=new GP({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return JP(e),e}class HP{constructor(t){this._ajv=t??VP()}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 KP{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(m=>m.type==="tool_use").map(m=>m.id)),d=new Set(i.filter(m=>m.type==="tool_result").map(m=>m.toolUseId));if(l.size!==d.size||![...l].every(m=>d.has(m)))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},Hs,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 WP(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 XP(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 YP extends BS{constructor(t,r){super(r),this._serverInfo=t,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(Mo.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 HP,this.setRequestHandler(wh,o=>this._oninitialize(o)),this.setNotificationHandler(Ih,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(zh,async(o,n)=>{const i=n.sessionId||n.requestInfo?.headers["mcp-session-id"]||void 0,{level:a}=o.params,s=Mo.safeParse(a);return s.success&&this._loggingLevels.set(i,s.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new KP(this)}),this._experimental}registerCapabilities(t){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=LS(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(kt(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 h=l.error instanceof Error?l.error.message:String(l.error);throw new q(W.InvalidParams,`Invalid tools/call request: ${h}`)}const{params:d}=l.data,m=await Promise.resolve(r(c,u));if(d.task){const h=ur(Co,m);if(!h.success){const $=h.error instanceof Error?h.error.message:String(h.error);throw new q(W.InvalidParams,`Invalid task creation result: ${$}`)}return h.data}const p=ur(Vs,m);if(!p.success){const h=p.error instanceof Error?p.error.message:String(p.error);throw new q(W.InvalidParams,`Invalid tools/call result: ${h}`)}return p.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){XP(this._clientCapabilities?.tasks?.requests,t,"Client")}assertTaskHandlerCapability(t){this._capabilities&&WP(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:$b.includes(r)?r:vh,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"},Is)}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},jh,r):this.request({method:"sampling/createMessage",params:t},Hs,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 q(W.InvalidParams,`Elicitation response content does not match requested schema: ${s.errorMessage}`)}catch(a){throw a instanceof q?a:new q(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},Eh,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 dv=Symbol.for("mcp.completable");function pv(e){return!!e&&typeof e=="object"&&dv in e}function QP(e){return e[dv]?.complete}var mv;(function(e){e.Completable="McpCompletable"})(mv||(mv={}));const ex=/^[A-Za-z0-9._-]{1,128}$/;function tx(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"),!ex.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 nx(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 fv(e){const t=tx(e);return nx(e,t.warnings),t.isValid}class rx{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 ox{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 YP(t,r)}get experimental(){return this._experimental||(this._experimental={tasks:new rx(this)}),this._experimental}async connect(t){return await this.server.connect(t)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(At(Js)),this.server.assertCanSetRequestHandler(At(Zo)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(Js,()=>({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?Fh(n,{strictUnions:!0,pipeStrategy:"input"}):ix})(),annotations:r.annotations,execution:r.execution,_meta:r._meta};if(r.outputSchema){const n=dr(r.outputSchema);n&&(o.outputSchema=Fh(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 q(W.InvalidParams,`Tool ${t.params.name} not found`);if(!o.enabled)throw new q(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 q(W.InternalError,`Tool ${t.params.name} has taskSupport '${i}' but was not registered with registerToolTask`);if(i==="required"&&!n)throw new q(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 q&&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 $s(i,r);if(!a.success){const s="error"in a?a.error:"Unknown error",c=bs(s);throw new q(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 q(W.InvalidParams,`Output validation error: Tool ${o} has an output schema but no structured content was provided`);const n=dr(t.outputSchema),i=await $s(n,r.structuredContent);if(!i.success){const a="error"in i?i.error:"Unknown error",s=bs(a);throw new q(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(m=>setTimeout(m,l));const d=await o.taskStore.getTask(c);if(!d)throw new q(W.InternalError,`Task ${c} not found during polling`);u=d}return await o.taskStore.getTaskResult(c)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(At(Ks)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(Ks,async t=>{switch(t.params.ref.type){case"ref/prompt":return Hk(t),this.handlePromptCompletion(t,t.params.ref);case"ref/resource":return Kk(t),this.handleResourceCompletion(t,t.params.ref);default:throw new q(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 q(W.InvalidParams,`Prompt ${r.name} not found`);if(!o.enabled)throw new q(W.InvalidParams,`Prompt ${r.name} disabled`);if(!o.argsSchema)return Or;const i=lr(o.argsSchema)?.[t.params.argument.name];if(!pv(i))return Or;const a=QP(i);if(!a)return Or;const s=await a(t.params.argument.value,t.params.context);return yv(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 Or;throw new q(W.InvalidParams,`Resource template ${t.params.ref.uri} not found`)}const n=o.resourceTemplate.completeCallback(t.params.argument.name);if(!n)return Or;const i=await n(t.params.argument.value,t.params.context);return yv(i)}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(At(As)),this.server.assertCanSetRequestHandler(At(Cs)),this.server.assertCanSetRequestHandler(At(Zs)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(As,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(Cs,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([r,o])=>({name:r,uriTemplate:o.resourceTemplate.uriTemplate.toString(),...o.metadata}))})),this.server.setRequestHandler(Zs,async(t,r)=>{const o=new URL(t.params.uri),n=this._registeredResources[o.toString()];if(n){if(!n.enabled)throw new q(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 q(W.InvalidParams,`Resource ${o} not found`)}),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(At(Ms)),this.server.assertCanSetRequestHandler(At(Bs)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(Ms,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,t])=>t.enabled).map(([t,r])=>({name:t,title:r.title,description:r.description,arguments:r.argsSchema?ax(r.argsSchema):void 0}))})),this.server.setRequestHandler(Bs,async(t,r)=>{const o=this._registeredPrompts[t.params.name];if(!o)throw new q(W.InvalidParams,`Prompt ${t.params.name} not found`);if(!o.enabled)throw new q(W.InvalidParams,`Prompt ${t.params.name} disabled`);if(o.argsSchema){const n=dr(o.argsSchema),i=await $s(n,t.params.arguments);if(!i.success){const c="error"in i?i.error:"Unknown error",u=bs(c);throw new q(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:vn(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=vn(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 pv(u)})&&this.setCompletionRequestHandler(),a}_createRegisteredTool(t,r,o,n,i,a,s,c,u){fv(t);const l={title:r,description:o,inputSchema:vv(n),outputSchema:vv(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"&&fv(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=vn(d.paramsSchema)),typeof d.outputSchema<"u"&&(l.outputSchema=vn(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(Yc(c))n=r.shift(),r.length>1&&typeof r[0]=="object"&&r[0]!==null&&!Yc(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 ix={type:"object",properties:{}};function hv(e){return e!==null&&typeof e=="object"&&"parse"in e&&typeof e.parse=="function"&&"safeParse"in e&&typeof e.safeParse=="function"}function gv(e){return"_def"in e||"_zod"in e||hv(e)}function Yc(e){return typeof e!="object"||e===null||gv(e)?!1:Object.keys(e).length===0?!0:Object.values(e).some(hv)}function vv(e){if(e){if(Yc(e))return vn(e);if(!gv(e))throw new Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");return e}}function ax(e){const t=lr(e);return t?Object.entries(t).map(([r,o])=>{const n=yb(o),i=_b(o);return{name:r,description:n,required:!i}}):[]}function At(e){const r=lr(e)?.method;if(!r)throw new Error("Schema is missing a method literal");const o=gh(r);if(typeof o=="string")return o;throw new Error("Schema method literal must be a string")}function yv(e){return{completion:{values:e.slice(0,100),total:e.length,hasMore:e.length>100}}}const Or={completion:{values:[],hasMore:!1}};class sx{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),cx(r)}clear(){this._buffer=void 0}}function cx(e){return Pb.parse(JSON.parse(e))}function ux(e){return JSON.stringify(e)+`
|
|
79
|
+
`}class lx{constructor(t=ou.stdin,r=ou.stdout){this._stdin=t,this._stdout=r,this._readBuffer=new sx,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=ux(t);this._stdout.write(o)?r():this._stdout.once("drain",r)})}}function hi(e){return e==null?!1:typeof e=="string"?e.length>0:!0}function dx(e){const t=e.isPresent??hi;if(!e.candidates.some(r=>t(r.value)))throw new Error(e.missingMessage??`Error: ${px(e.candidates.map(r=>r.label))} must be provided.`)}function px(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 mx(e){const t=e.inlineLabel??"json",r=e.fileLabel??"jsonFile",o=e.fileDescription??"file";if(hi(e.inlineText)&&hi(e.filePath))throw new Error(`Provide either ${t} or ${r}, not both.`);if(hi(e.inlineText))return{text:e.inlineText,source:"inline"};dx({candidates:[{label:t,value:e.inlineText},{label:r,value:e.filePath}],missingMessage:`Either ${t} or ${r} must be provided.`});try{return{text:Uv(e.filePath,"utf-8"),source:"file"}}catch(n){throw new Error(`Error reading ${o}: ${n.message}`,{cause:n})}}function fx(e,t){Av(Dv(e),{recursive:!0}),Cv(e,t,"utf-8")}function _v(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 $v(e){return{type:"text",text:e}}function tn(e){return{content:[$v(e)]}}function Ct(e){return{content:[$v(e)],isError:!0}}function hx(e){let t;try{t=mx({inlineText:e.json,filePath:e.jsonFile,inlineLabel:"json",fileLabel:"jsonFile",fileDescription:e.fileDescription}).text}catch(r){return Ct(r.message)}try{return tn(e.createSuccessText(e.importJson(t)))}catch(r){return Ct(`Error: ${r.message}`)}}function gx(e){if(e.snippetResult.type==="unknown")return Ct(`Error: Snippet "${e.snippetId}" has an unrecognized format.`);if(e.snippetResult.type!==e.expectedType)return Ct(`Error: Snippet "${e.snippetId}" is of type "${e.snippetResult.type}", not "${e.expectedType}".`);try{return tn(e.createSuccessText(e.importJson(JSON.stringify(e.snippetResult.data))))}catch(t){return Ct(`Error: ${t.message}`)}}async function vx(e){try{return e.createResponse(await e.loadSnippet(e.snippetId))}catch(t){return Ct(`Error fetching snippet "${e.snippetId}": ${t.message}`)}}function yx(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 _x(e,t){return e.string().optional().describe(t)}function $x(e,t){return e.string().optional().describe(t)}function bx(e){return e.string().describe('Snippet ID from the Babylon.js Snippet Server (e.g. "ABC123" or "ABC123#2")')}function bv(e){return e.boolean().optional().describe("If true, replace any existing graph with the same name. Default: false.")}function kx(e,t){const r=typeof e=="string"?_v({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 Sx(e){const t=kx(e,"NRG JSON");if(t.customType!=="BABYLON.NodeRenderGraph")throw new Error(`Invalid NRG JSON: customType must be "BABYLON.NodeRenderGraph" but got "${String(t.customType)}".`);if(!Array.isArray(t.blocks))throw new Error("Invalid NRG JSON: must contain a 'blocks' array.");return t}const kv="babylon-mcp-editor-session",wx="1.0",Ix="127.0.0.1",Sv="localhost",Px=3001,xx=10,Ox=15e3,Tx=15*6e4,gi="last-writer-wins";function Nx(e,t,r=Sv){return`http://${r}:${t}/session/${e}`}function zx(){return $i.createHash("sha256").update(process.cwd()).digest("hex")}function jx(){return`${process.pid}-${$i.randomBytes(8).toString("hex")}`}class Ex{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??Px,this._portRange=r.portRange??xx,this._host=r.host??Ix,this._publicHostname=r.publicHostname??Sv,this._protocolVersion=r.protocolVersion??wx,this._keepAliveIntervalMs=r.keepAliveIntervalMs??Ox,this._idleTimeoutMs=r.idleTimeoutMs??Tx,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",gi,...r.capabilities??[]],this._statusTitle=r.statusTitle??t.serverName,this._workspaceId=r.workspaceId??zx(),this._ownerId=r.ownerId??jx()}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
|
|
80
|
+
|
|
81
|
+
`)},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:$i.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 Nx(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
|
|
82
|
+
data: ${JSON.stringify({reason:r})}
|
|
83
|
+
|
|
84
|
+
`),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:kv,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:gi,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=Rv.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: ${kv} ${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(`
|
|
85
|
+
`))}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
|
|
86
|
+
|
|
87
|
+
`);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:gi}),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}
|
|
88
|
+
|
|
89
|
+
`)}_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:gi,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 Rx{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 Ex({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 Tn={NodeRenderGraphInputBlock:{className:"NodeRenderGraphInputBlock",category:"Input",description:"Exposes an external resource to the render graph. The type is determined by `additionalConstructionParameters[0]` (a NodeRenderGraphBlockConnectionPointTypes enum value). Common type values: Texture=1, TextureDepthStencilAttachment=8, Camera=0x01000000, ObjectList=0x02000000, ShadowLight=0x00400000. Set `isExternal=true` so Babylon auto-fills the value from the scene at build time. For texture inputs you must provide `creationOptions` with size/format/samples; use the `set_block_properties` tool to set these fields after adding the block.",inputs:[],outputs:[{name:"output",type:"AutoDetect"}],properties:{isExternal:"boolean \u2013 when true Babylon.js fills the value automatically (cameras, object-lists, lights). Default: false",creationOptions:"FrameGraphTextureCreationOptions JSON \u2013 for texture inputs; defines size, format, samples, etc."},defaultAdditionalConstructionParameters:[1073741824]},NodeRenderGraphOutputBlock:{className:"NodeRenderGraphOutputBlock",category:"Output",description:"The final output block. Every render graph MUST have exactly one. Connect the last rendered texture to the `texture` port. The outputNodeId of the serialised graph must equal this block's id.",inputs:[{name:"texture",type:"Texture",isOptional:!1},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[]},NodeRenderGraphClearBlock:{className:"NodeRenderGraphClearBlock",category:"Textures",description:"Clears a colour texture and/or depth-stencil attachment to a configurable colour / depth value. Both `target` and `depth` are optional, but at least one should be connected. Outputs mirror the connected inputs so downstream blocks can use the cleared textures.",inputs:[{name:"target",type:"AutoDetect",isOptional:!0},{name:"depth",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"},{name:"outputDepth",type:"BasedOnInput"}],properties:{color:"Color4 {r,g,b,a} \u2013 clear colour (default: {r:0,g:0,b:0,a:1})",clearColor:"boolean \u2013 whether to clear the colour channel (default: true)",clearDepth:"boolean \u2013 whether to clear the depth channel (default: false)",clearStencil:"boolean \u2013 whether to clear the stencil channel (default: false)",convertColorToLinearSpace:"boolean \u2013 convert sRGB clear colour to linear space (default: false)"}},NodeRenderGraphCopyTextureBlock:{className:"NodeRenderGraphCopyTextureBlock",category:"Textures",description:"Copies (blits) one texture into another. Useful for preserving intermediate render results or preparing textures for later read-back.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect"},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}]},NodeRenderGraphGenerateMipmapsBlock:{className:"NodeRenderGraphGenerateMipmapsBlock",category:"Textures",description:"Generates all mip-map levels for a texture in-place after prior rendering has been done. Required for techniques that sample lower mip levels (e.g. bloom, reflections).",inputs:[{name:"source",type:"AutoDetect"},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}]},NodeRenderGraphObjectRendererBlock:{className:"NodeRenderGraphObjectRendererBlock",category:"Rendering",description:"Renders a list of scene objects (meshes, particles) to a colour target using a camera. This is the primary rasterisation block \u2014 almost every graph needs one. Connect a cleared colour texture to `target`, a depth attachment to `depth`, a Camera input to `camera`, and a (possibly culled) ObjectList to `objects`. Optional `shadowGenerators` port accepts a ShadowGenerator or ResourceContainer of shadow generators.",inputs:[{name:"target",type:"AutoDetect"},{name:"depth",type:"AutoDetect",isOptional:!0},{name:"camera",type:"Camera"},{name:"objects",type:"ObjectList"},{name:"dependencies",type:"AutoDetect",isOptional:!0},{name:"shadowGenerators",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"},{name:"outputDepth",type:"BasedOnInput"},{name:"objectRenderer",type:"Object"}],properties:{doNotChangeAspectRatio:"boolean \u2013 do not change the aspect ratio of the scene when rendering to RTT (default: true). Set as additionalConstructionParameters[0]",enableClusteredLights:"boolean \u2013 enable clustered light rendering (default: true). Set as additionalConstructionParameters[1]",isMainObjectRenderer:"boolean \u2013 marks this as the main object renderer; only one block should be main per graph. Babylon.js auto-assigns the first one if none is set.",depthTest:"boolean \u2013 enable depth testing (default: true)",depthWrite:"boolean \u2013 enable depth writing (default: true)",disableShadows:"boolean \u2013 disable shadow sampling (default: false)",renderParticles:"boolean \u2013 render particle systems (default: true)",renderSprites:"boolean \u2013 render sprite managers (default: true)"},defaultAdditionalConstructionParameters:[!0,!0]},NodeRenderGraphGeometryRendererBlock:{className:"NodeRenderGraphGeometryRendererBlock",category:"Rendering",description:"Renders scene geometry into a multi-render target (G-Buffer), producing typed geometry textures (view-depth, normals, albedo, reflectivity, positions, velocity, etc.). Use these outputs as inputs for deferred shading techniques such as SSR, SSAO, or custom deferred passes. The `target` port for the colour attachment is OPTIONAL for this block.",inputs:[{name:"target",type:"AutoDetect",isOptional:!0},{name:"depth",type:"AutoDetect",isOptional:!0},{name:"camera",type:"Camera"},{name:"objects",type:"ObjectList"},{name:"dependencies",type:"AutoDetect",isOptional:!0},{name:"shadowGenerators",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"},{name:"outputDepth",type:"BasedOnInput"},{name:"objectRenderer",type:"Object"},{name:"geomViewDepth",type:"TextureViewDepth"},{name:"geomNormViewDepth",type:"TextureNormalizedViewDepth"},{name:"geomScreenDepth",type:"TextureScreenDepth"},{name:"geomViewNormal",type:"TextureViewNormal"},{name:"geomWorldNormal",type:"TextureWorldNormal"},{name:"geomLocalPosition",type:"TextureLocalPosition"},{name:"geomWorldPosition",type:"TextureWorldPosition"},{name:"geomAlbedo",type:"TextureAlbedo"},{name:"geomReflectivity",type:"TextureReflectivity"},{name:"geomVelocity",type:"TextureVelocity"},{name:"geomLinearVelocity",type:"TextureLinearVelocity"}],properties:{doNotChangeAspectRatio:"boolean \u2013 do not change aspect ratio (default: true) \u2014 additionalConstructionParameters[0]",enableClusteredLights:"boolean \u2013 enable clustered lights (default: true) \u2014 additionalConstructionParameters[1]",depthTest:"boolean",depthWrite:"boolean",width:"number \u2013 G-buffer width in pixels (or percentage when sizeInPercentage=true)",height:"number \u2013 G-buffer height",sizeInPercentage:"boolean \u2013 use width/height as screen percentage (default: true)",samples:"number \u2013 MSAA sample count (default: 1)"},defaultAdditionalConstructionParameters:[!0,!0]},NodeRenderGraphUtilityLayerRendererBlock:{className:"NodeRenderGraphUtilityLayerRendererBlock",category:"Rendering",description:"Renders the Babylon.js utility layer (gizmos, helpers) on top of the main colour attachment. Used when the inspector / gizmos should appear in the final output.",inputs:[{name:"target",type:"AutoDetect"},{name:"depth",type:"AutoDetect",isOptional:!0},{name:"camera",type:"Camera"},{name:"objects",type:"ObjectList"},{name:"dependencies",type:"AutoDetect",isOptional:!0},{name:"shadowGenerators",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"},{name:"outputDepth",type:"BasedOnInput"},{name:"objectRenderer",type:"Object"}],defaultAdditionalConstructionParameters:[!0,!0]},NodeRenderGraphShadowGeneratorBlock:{className:"NodeRenderGraphShadowGeneratorBlock",category:"Rendering",description:"Generates a shadow map for a directional, spot, or point light. Connect its `output` (ShadowGenerator) to the `shadowGenerators` port of an ObjectRendererBlock so rendered objects receive shadows from this light.",inputs:[{name:"light",type:"ShadowLight"},{name:"objects",type:"ObjectList"},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"ShadowGenerator"}],properties:{mapSize:"number \u2013 shadow map resolution (default: 1024)",useExponentialShadowMap:"boolean",usePoissonSampling:"boolean",useBlurExponentialShadowMap:"boolean",useCloseExponentialShadowMap:"boolean",useBlurCloseExponentialShadowMap:"boolean",usePCSShadowMap:"boolean",useVSM:"boolean",bias:"number",normalBias:"number"}},NodeRenderGraphCascadedShadowGeneratorBlock:{className:"NodeRenderGraphCascadedShadowGeneratorBlock",category:"Rendering",description:"Generates a Cascaded Shadow Map (CSM) for a directional light. CSM provides better quality close-up shadows with a smooth fade to lower quality at distance. Connect its `output` (ShadowGenerator) to the `shadowGenerators` port of an ObjectRendererBlock.",inputs:[{name:"light",type:"ShadowLight"},{name:"objects",type:"ObjectList"},{name:"camera",type:"Camera"},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"ShadowGenerator"}],properties:{mapSize:"number \u2013 shadow map resolution per cascade (default: 1024)",numCascades:"number \u2013 number of cascades (default: 4; must be 2\u20134)",lambda:"number \u2013 0 = uniform, 1 = logarithmic split (default: 0.5)",shadowMaxZ:"number \u2013 maximum shadow distance"}},NodeRenderGraphCullObjectsBlock:{className:"NodeRenderGraphCullObjectsBlock",category:"Culling",description:"Culls an ObjectList using a camera frustum and returns a reduced ObjectList containing only the visible objects. Use this before passing objects to an ObjectRendererBlock for better performance.",inputs:[{name:"camera",type:"Camera"},{name:"objects",type:"ObjectList"},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"ObjectList"}]},NodeRenderGraphBloomPostProcessBlock:{className:"NodeRenderGraphBloomPostProcessBlock",category:"PostProcess",description:"Adds a bloom glow effect to bright areas of the source texture. Connect a rendered colour texture to `source`. Use additionalConstructionParameters=[hdr, bloomScale] to set HDR mode and scale at creation; threshold, weight, and kernel can be set via set_block_properties.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{hdr:"boolean \u2013 use HDR textures (default: false) \u2014 set via additionalConstructionParameters[0]",bloomScale:"number \u2013 scale factor (default: 0.5) \u2014 set via additionalConstructionParameters[1]",threshold:"number \u2013 brightness threshold to bloom (default: 0.9)",weight:"number \u2013 bloom intensity (default: 0.15)",kernel:"number \u2013 blur kernel size (default: 64)"},defaultAdditionalConstructionParameters:[!1,.5]},NodeRenderGraphBlurPostProcessBlock:{className:"NodeRenderGraphBlurPostProcessBlock",category:"PostProcess",description:"Applies a Gaussian blur to a texture. additionalConstructionParameters=[direction {x,y}, blockSize] control the blur direction and radius.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{kernel:"number \u2013 blur kernel size / radius"},defaultAdditionalConstructionParameters:[{x:1,y:0},1]},NodeRenderGraphFXAAPostProcessBlock:{className:"NodeRenderGraphFXAAPostProcessBlock",category:"PostProcess",description:"Applies Fast Approximate Anti-Aliasing (FXAA) to reduce jagged edges on the texture.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}]},NodeRenderGraphSharpenPostProcessBlock:{className:"NodeRenderGraphSharpenPostProcessBlock",category:"PostProcess",description:"Sharpens the image to enhance detail clarity.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{colorAmount:"number \u2013 amount of colour sharpening (0\u20131, default: 0.8)",edgeAmount:"number \u2013 edge detection strength (0\u20132, default: 0.3)"}},NodeRenderGraphChromaticAberrationPostProcessBlock:{className:"NodeRenderGraphChromaticAberrationPostProcessBlock",category:"PostProcess",description:"Simulates lens chromatic aberration by separating the colour channels slightly.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{aberrationAmount:"number \u2013 strength of aberration (default: 30)",radialIntensity:"number \u2013 how the effect grows from centre outwards (default: 1)",direction:"{x,y} \u2013 direction of channel shift (default: {x:0.707,y:0.707})",centerPosition:"{x,y} \u2013 centre of effect (default: {x:0.5,y:0.5})"}},NodeRenderGraphGrainPostProcessBlock:{className:"NodeRenderGraphGrainPostProcessBlock",category:"PostProcess",description:"Overlays animated film-grain noise on the image.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{intensity:"number \u2013 grain intensity (default: 30)",animated:"boolean \u2013 animate noise each frame (default: true)"}},NodeRenderGraphBlackAndWhitePostProcessBlock:{className:"NodeRenderGraphBlackAndWhitePostProcessBlock",category:"PostProcess",description:"Converts the image to greyscale.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{degree:"number \u2013 0 = no change, 1 = fully greyscale (default: 1)"}},NodeRenderGraphTonemapPostProcessBlock:{className:"NodeRenderGraphTonemapPostProcessBlock",category:"PostProcess",description:"Applies tone-mapping to convert HDR values to LDR for display.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{operator:"number \u2013 tone-mapping operator: Hable=0, Reinhard=1, HejiDawson=2, Photographic=3, DX11DSK=4, Linear=5, ACES=6 (default: Hable=0)",exposureAdjustment:"number \u2013 exposure multiplier (default: 1)"}},NodeRenderGraphDepthOfFieldPostProcessBlock:{className:"NodeRenderGraphDepthOfFieldPostProcessBlock",category:"PostProcess",description:"Simulates camera depth-of-field blur. Requires a `geomViewDepth` texture (from a GeometryRenderer) and a Camera. additionalConstructionParameters=[blurLevel, hdr]: blurLevel values: Low=0, Medium=1, High=2.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"geomViewDepth",type:"TextureViewDepth"},{name:"camera",type:"Camera"},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{blurLevel:"number \u2013 blur quality (0=Low, 1=Medium, 2=High) \u2014 set via additionalConstructionParameters[0]",hdr:"boolean \u2013 use HDR \u2014 set via additionalConstructionParameters[1]",focalLength:"number \u2013 focal length in mm (default: 150)",fStop:"number \u2013 f-stop / aperture (default: 1.4)",focusDistance:"number \u2013 focus distance in mm (default: 2000)",lensSize:"number \u2013 lens size (default: 50)"},defaultAdditionalConstructionParameters:[0,!1]},NodeRenderGraphSSRPostProcessBlock:{className:"NodeRenderGraphSSRPostProcessBlock",category:"PostProcess",description:"Screen-Space Reflections (SSR). Requires geometry buffers from GeometryRendererBlock: geomDepth (ScreenDepth or ViewDepth), geomNormal (WorldNormal or ViewNormal), geomReflectivity, and a Camera. Optional geomBackDepth provides better occlusion accuracy.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"camera",type:"Camera"},{name:"geomDepth",type:"AutoDetect"},{name:"geomNormal",type:"AutoDetect"},{name:"geomReflectivity",type:"TextureReflectivity"},{name:"geomBackDepth",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{maxDistance:"number \u2013 max reflection ray distance (default: 1000)",step:"number \u2013 ray marching step size (default: 1)",thickness:"number \u2013 thickness tolerance (default: 0.5)",strength:"number \u2013 reflection strength (default: 1)",maxSteps:"number \u2013 maximum ray march iterations (default: 1000)",roughnessFactor:"number",selfCollisionNumSkip:"number \u2013 steps to skip for self-collision avoidance (default: 1)"}},NodeRenderGraphSSAO2PostProcessBlock:{className:"NodeRenderGraphSSAO2PostProcessBlock",category:"PostProcess",description:"Screen-Space Ambient Occlusion v2 (SSAO2). Requires `geomViewDepth` (TextureViewDepth) and optionally `geomViewNormal` (TextureViewNormal) from a GeometryRendererBlock. additionalConstructionParameters=[ratio (number)].",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"geomViewDepth",type:"TextureViewDepth"},{name:"geomViewNormal",type:"TextureViewNormal",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{ratio:"number \u2013 render ratio (default: 0.5) \u2014 set via additionalConstructionParameters[0]",maxZ:"number \u2013 max distance for AO sampling (default: 100)",minZAspect:"number",radius:"number \u2013 sampling radius (default: 2)",totalStrength:"number \u2013 AO intensity (default: 1)",base:"number \u2013 ambient baseline (default: 0)",samples:"number \u2013 sample count (default: 8)"},defaultAdditionalConstructionParameters:[.5]},NodeRenderGraphTAAPostProcessBlock:{className:"NodeRenderGraphTAAPostProcessBlock",category:"PostProcess",description:"Temporal Anti-Aliasing (TAA). Accumulates samples across frames for smooth anti-aliasing. Requires a Camera. additionalConstructionParameters=[samples (number), factor (number)].",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"camera",type:"Camera"},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{samples:"number \u2013 number of accumulated samples (default: 8) \u2014 additionalConstructionParameters[0]",factor:"number \u2013 blend factor between current & accumulated (default: 0.05) \u2014 additionalConstructionParameters[1]"},defaultAdditionalConstructionParameters:[8,.05]},NodeRenderGraphMotionBlurPostProcessBlock:{className:"NodeRenderGraphMotionBlurPostProcessBlock",category:"PostProcess",description:"Applies motion blur based on per-pixel motion vectors. Requires `geomViewDepth` and `geomViewNormal`. Camera is also required.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"camera",type:"Camera"},{name:"geomViewDepth",type:"TextureViewDepth"},{name:"geomViewNormal",type:"TextureViewNormal"},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{motionBlurSamples:"number \u2013 number of samples (default: 32)",motionStrength:"number \u2013 overall blur strength (default: 1)"}},NodeRenderGraphImageProcessingPostProcessBlock:{className:"NodeRenderGraphImageProcessingPostProcessBlock",category:"PostProcess",description:"Applies the scene's ImageProcessingConfiguration (tone-mapping, exposure, contrast, saturation, colour grading LUT, etc.). This is the standard post-process used by the default rendering pipeline.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}]},NodeRenderGraphColorCorrectionPostProcessBlock:{className:"NodeRenderGraphColorCorrectionPostProcessBlock",category:"PostProcess",description:"Applies colour correction using a colour-lookup table (LUT) texture.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{colorTableUrl:"string \u2013 URL/path to the colour lookup table texture"}},NodeRenderGraphConvolutionPostProcessBlock:{className:"NodeRenderGraphConvolutionPostProcessBlock",category:"PostProcess",description:"Applies a convolution kernel (e.g. edge detection, emboss, sharpen) to the image.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{kernel:"number[] \u2013 flat 3\xD73 convolution kernel values (9 numbers)"}},NodeRenderGraphFilterPostProcessBlock:{className:"NodeRenderGraphFilterPostProcessBlock",category:"PostProcess",description:"Applies a colour matrix filter to transform colours. Each row of the 4\xD74 matrix maps an output RGBA channel from input RGBA.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{kernelMatrix:"Matrix (16 numbers) \u2013 4\xD74 colour transformation matrix"}},NodeRenderGraphAnaglyphPostProcessBlock:{className:"NodeRenderGraphAnaglyphPostProcessBlock",category:"PostProcess",description:"Produces an anaglyph 3D effect (red-cyan glasses). Requires two texture views (left/right eye).",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}]},NodeRenderGraphScreenSpaceCurvaturePostProcessBlock:{className:"NodeRenderGraphScreenSpaceCurvaturePostProcessBlock",category:"PostProcess",description:"Highlights surface curvature based on screen-space derivatives of normals.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{ridge:"number \u2013 ridge curvature strength (default: 1)",valley:"number \u2013 valley curvature strength (default: 1)"}},NodeRenderGraphExtractHighlightsPostProcessBlock:{className:"NodeRenderGraphExtractHighlightsPostProcessBlock",category:"PostProcess",description:"Extracts pixels above a luminance threshold. Used as an intermediate step in bloom pipelines.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{threshold:"number \u2013 luminance threshold (default: 0.9)"}},NodeRenderGraphPassPostProcessBlock:{className:"NodeRenderGraphPassPostProcessBlock",category:"PostProcess",description:"A no-op pass-through post process. Useful for routing texture connections without modification.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}]},NodeRenderGraphPassCubePostProcessBlock:{className:"NodeRenderGraphPassCubePostProcessBlock",category:"PostProcess",description:"A no-op pass-through post process for cube textures. Similar to PassPostProcessBlock but for cube map sources.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}]},NodeRenderGraphCircleOfConfusionPostProcessBlock:{className:"NodeRenderGraphCircleOfConfusionPostProcessBlock",category:"PostProcess",description:"Computes per-pixel circle-of-confusion values from depth. Used as an input to more manual depth-of-field setups. Requires `geomViewDepth` and a Camera.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"geomViewDepth",type:"TextureViewDepth"},{name:"camera",type:"Camera"},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}]},NodeRenderGraphVolumetricLightingBlock:{className:"NodeRenderGraphVolumetricLightingBlock",category:"PostProcess",description:"Renders volumetric light shafts (god rays) emanating from a single light source.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"geomViewDepth",type:"AutoDetect",isOptional:!0},{name:"camera",type:"Camera"},{name:"objects",type:"ObjectList"},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{density:"number \u2013 ray density (default: 0.7)",weight:"number \u2013 light weight per step (default: 1)",decay:"number \u2013 falloff per step (default: 0.99)",exposure:"number \u2013 final exposure (default: 1)"}},NodeRenderGraphGlowLayerBlock:{className:"NodeRenderGraphGlowLayerBlock",category:"Layers",description:"Adds a glow effect to meshes whose emissive colour is above zero. Connect the `objectRenderer` output of an ObjectRendererBlock to this block's `objectRenderer` input. additionalConstructionParameters=[ldrMerge, layerTextureRatio, layerTextureFixedSize|undefined, layerTextureType].",inputs:[{name:"target",type:"AutoDetect"},{name:"layer",type:"AutoDetect",isOptional:!0},{name:"objectRenderer",type:"Object"},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{ldrMerge:"boolean \u2013 clamp values > 1 in merge step (default: false) \u2014 additionalConstructionParameters[0]",layerTextureRatio:"number \u2013 glow texture size relative to main (default: 0.5) \u2014 additionalConstructionParameters[1]",layerTextureFixedSize:"number|undefined \u2013 fixed pixel size override \u2014 additionalConstructionParameters[2]",blurKernelSize:"number \u2013 blur spread (default: 32)",intensity:"number \u2013 glow intensity (default: 1)"},defaultAdditionalConstructionParameters:[!1,.5,void 0,0]},NodeRenderGraphHighlightLayerBlock:{className:"NodeRenderGraphHighlightLayerBlock",category:"Layers",description:"Draws a coloured outline / highlight on specific meshes. Connect the `objectRenderer` output of an ObjectRendererBlock to this block's `objectRenderer` input.",inputs:[{name:"target",type:"AutoDetect"},{name:"layer",type:"AutoDetect",isOptional:!0},{name:"objectRenderer",type:"Object"},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{blurHorizontalSize:"number \u2013 horizontal blur (default: 1)",blurVerticalSize:"number \u2013 vertical blur (default: 1)",isStroke:"boolean \u2013 render as stroke/outline instead of fill (default: false)"}},NodeRenderGraphSelectionOutlineLayerBlock:{className:"NodeRenderGraphSelectionOutlineLayerBlock",category:"Layers",description:"Draws a selection outline around the highlighted mesh. Typically used by the Babylon.js Inspector / gizmo system.",inputs:[{name:"target",type:"AutoDetect"},{name:"depth",type:"AutoDetect",isOptional:!0},{name:"camera",type:"Camera"},{name:"objects",type:"ObjectList"},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}]},NodeRenderGraphComputeShaderBlock:{className:"NodeRenderGraphComputeShaderBlock",category:"Compute",description:"Executes a custom compute shader within the frame graph. Accepts camera, shadow light, and object list dependencies. Outputs a ResourceContainer for downstream ordering.",inputs:[{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"ResourceContainer"}],properties:{shaderPath:"string | IComputeShaderPath \u2013 path or inline WGSL source of the compute shader",shaderOptions:"IComputeShaderOptions \u2013 binding mappings and compile options"},defaultAdditionalConstructionParameters:[`@compute @workgroup_size(1, 1, 1)
|
|
90
|
+
fn main() {}`,{bindingsMapping:{}}]},NodeRenderGraphIblShadowsRendererBlock:{className:"NodeRenderGraphIblShadowsRendererBlock",category:"Rendering",description:"Computes image-based lighting (IBL) shadows using voxel tracing. Requires depth, normal, position, and velocity geometry textures plus a camera and object list. Produces a shadow texture output.",inputs:[{name:"depth",type:"TextureScreenDepth"},{name:"normal",type:"TextureWorldNormal"},{name:"position",type:"TextureWorldPosition"},{name:"velocity",type:"TextureLinearVelocity"},{name:"camera",type:"Camera"},{name:"objects",type:"ObjectList"},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"Texture"}],properties:{sampleDirections:"number \u2013 tracing sample directions (1\u201316, default: varies)",coloredShadows:"boolean \u2013 whether traced shadows preserve environment color",voxelShadowOpacity:"number \u2013 opacity of voxel-traced shadows (0\u20131)",ssShadowOpacity:"number \u2013 opacity of screen-space shadows (0\u20131)",ssShadowSampleCount:"number \u2013 screen-space shadow samples (1\u201364)",ssShadowStride:"number \u2013 screen-space shadow stride (1\u201332)",ssShadowDistanceScale:"number \u2013 screen-space shadow distance scale",ssShadowThicknessScale:"number \u2013 screen-space shadow thickness scale",voxelNormalBias:"number \u2013 voxel tracing normal bias",voxelDirectionBias:"number \u2013 voxel tracing direction bias",envRotation:"number \u2013 environment rotation in radians",shadowRemanence:"number \u2013 temporal shadow remanence (0\u20131)",shadowOpacity:"number \u2013 final shadow opacity (0\u20131)",resolutionExp:"number \u2013 voxelization resolution exponent (1\u20138, resolution = 2^value)",refreshRate:"number \u2013 voxelization refresh rate (-1: manual, 0: every frame, N: skip N frames)",triPlanarVoxelization:"boolean \u2013 whether to use tri-planar voxelization"}},NodeRenderGraphResourceContainerBlock:{className:"NodeRenderGraphResourceContainerBlock",category:"Utility",description:"Groups multiple texture handles (or shadow generators) into one `ResourceContainer` output. Use its output as the `dependencies` input of other blocks to express execution ordering without a direct data-flow connection.",inputs:[{name:"input0",type:"AutoDetect",isOptional:!0},{name:"input1",type:"AutoDetect",isOptional:!0},{name:"input2",type:"AutoDetect",isOptional:!0},{name:"input3",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"ResourceContainer"}]},NodeRenderGraphElbowBlock:{className:"NodeRenderGraphElbowBlock",category:"Utility",description:"A routing (elbow / pass-through) block that lets you organise connections visually. The output type mirrors whatever is connected to the input.",inputs:[{name:"input",type:"AutoDetect"}],outputs:[{name:"output",type:"BasedOnInput"}]},NodeRenderGraphTeleportInBlock:{className:"NodeRenderGraphTeleportInBlock",category:"Utility",description:"Teleport entry-point. Connects to one or more TeleportOutBlocks to route a signal across the graph without drawing long connection wires. Must be paired with at least one TeleportOutBlock of the same name.",inputs:[{name:"input",type:"AutoDetect"}],outputs:[]},NodeRenderGraphTeleportOutBlock:{className:"NodeRenderGraphTeleportOutBlock",category:"Utility",description:"Teleport exit-point. Receives the value wired into its matching TeleportInBlock. Multiple TeleportOut blocks can share the same TeleportIn, distributing one signal to many consumers.",inputs:[],outputs:[{name:"output",type:"AutoDetect"}]},NodeRenderGraphExecuteBlock:{className:"NodeRenderGraphExecuteBlock",category:"Utility",description:"Runs a custom JavaScript callback within the frame-graph execution order. This block is for advanced use \u2014 the callback must be set at runtime in code.",inputs:[{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"AutoDetect"}]},NodeRenderGraphLightingVolumeBlock:{className:"NodeRenderGraphLightingVolumeBlock",category:"Utility",description:"Computes a lighting volume used by the volumetric lighting block for light contribution slicing.",inputs:[{name:"camera",type:"Camera"},{name:"objects",type:"ObjectList"},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"AutoDetect"}]}};function wv(){const e={};for(const[r,o]of Object.entries(Tn)){const n=o.category;e[n]=e[n]||[],e[n].push(`- **${r}**: ${o.description.split(".")[0]}`)}const t=[];for(const[r,o]of Object.entries(e))t.push(`
|
|
91
|
+
### ${r}`),t.push(...o);return t.join(`
|
|
92
|
+
`)}function Dx(e){const t=Tn[e];if(!t)return`Unknown block type "${e}". Use list_block_types to see available types.`;const r=[`## ${e}`,`**Category**: ${t.category}`,`**Description**: ${t.description}`,"","### Inputs"];if(t.inputs.length===0)r.push("_(none)_");else for(const o of t.inputs)r.push(`- \`${o.name}\` \u2014 **${o.type}**${o.isOptional?" _(optional)_":""}`);if(r.push("","### Outputs"),t.outputs.length===0)r.push("_(none)_");else for(const o of t.outputs)r.push(`- \`${o.name}\` \u2014 **${o.type}**`);if(t.properties&&Object.keys(t.properties).length>0){r.push("","### Configurable Properties");for(const[o,n]of Object.entries(t.properties))r.push(`- \`${o}\`: ${n}`)}return t.defaultAdditionalConstructionParameters!==void 0&&r.push("","### additionalConstructionParameters",`Default: \`${JSON.stringify(t.defaultAdditionalConstructionParameters)}\``,"These are embedded in the serialised block. Override them when calling add_block if needed."),r.join(`
|
|
93
|
+
`)}class Ax{_graphs=new Map;_nextId=1;create(t,r){if(this._graphs.has(t))throw new Error(`A render graph named "${t}" already exists. Choose a different name or delete the existing one first.`);const o={customType:"BABYLON.NodeRenderGraph",name:t,comment:r,blocks:[],editorData:{locations:[]}};return this._graphs.set(t,o),o}delete(t){if(!this._graphs.has(t))throw new Error(`Render graph "${t}" not found.`);this._graphs.delete(t)}clearAll(){this._graphs.clear(),this._nextId=1}list(){return[...this._graphs.keys()]}get(t){const r=this._graphs.get(t);if(!r)throw new Error(`Render graph "${t}" not found. Use create_render_graph first.`);return r}addBlock(t,r,o,n){const i=this.get(t),a=Tn[r];if(!a)throw new Error(`Unknown block type "${r}". Call list_block_types to see all available block types.`);const s=this._nextId++,c=o??r,u=n!==void 0?n:a.defaultAdditionalConstructionParameters!==void 0?a.defaultAdditionalConstructionParameters:void 0,l=a.inputs.map(p=>({name:p.name})),d=a.outputs.map(p=>({name:p.name})),m={customType:`BABYLON.${r}`,id:s,name:c,inputs:l,outputs:d};return u!==void 0&&(m.additionalConstructionParameters=u),r==="NodeRenderGraphOutputBlock"&&(i.outputNodeId=s),i.blocks.push(m),i.editorData.locations.push({blockId:s,x:(i.blocks.length-1)*220,y:100}),m}addBlocksBatch(t,r){return r.map(o=>this.addBlock(t,o.blockType,o.blockName,o.additionalConstructionParameters))}removeBlock(t,r){const o=this.get(t),n=o.blocks.findIndex(i=>i.id===r);if(n===-1)throw new Error(`Block id ${r} not found in graph "${t}".`);o.blocks.splice(n,1);for(const i of o.blocks)for(const a of i.inputs)a.targetBlockId===r&&(delete a.inputName,delete a.targetBlockId,delete a.targetConnectionName);o.outputNodeId===r&&delete o.outputNodeId,o.editorData&&(o.editorData.locations=o.editorData.locations.filter(i=>i.blockId!==r))}connect(t,r,o,n,i){const a=this.get(t),s=a.blocks.find(d=>d.id===r),c=a.blocks.find(d=>d.id===n);if(!s)throw new Error(`Source block id ${r} not found in graph "${t}".`);if(!c)throw new Error(`Target block id ${n} not found in graph "${t}".`);if(!s.outputs.find(d=>d.name===o))throw new Error(`Output port "${o}" not found on block "${s.name}" (id ${r}). Available outputs: ${s.outputs.map(d=>d.name).join(", ")||"(none)"}`);const l=c.inputs.find(d=>d.name===i);if(!l)throw new Error(`Input port "${i}" not found on block "${c.name}" (id ${n}). Available inputs: ${c.inputs.map(d=>d.name).join(", ")||"(none)"}`);l.inputName=i,l.targetBlockId=r,l.targetConnectionName=o}connectBatch(t,r){for(const o of r)this.connect(t,o.sourceBlockId,o.sourcePortName,o.targetBlockId,o.targetPortName)}disconnectInput(t,r,o){const i=this.get(t).blocks.find(s=>s.id===r);if(!i)throw new Error(`Block id ${r} not found in graph "${t}".`);const a=i.inputs.find(s=>s.name===o);if(!a)throw new Error(`Input port "${o}" not found on block id ${r}.`);if(a.targetBlockId===void 0)throw new Error(`Input port "${o}" on block id ${r} is already disconnected.`);delete a.inputName,delete a.targetBlockId,delete a.targetConnectionName}setBlockProperties(t,r,o){const i=this.get(t).blocks.find(a=>a.id===r);if(!i)throw new Error(`Block id ${r} not found in graph "${t}".`);for(const[a,s]of Object.entries(o)){if(a==="id"||a==="customType"||a==="inputs"||a==="outputs")throw new Error(`Property "${a}" is reserved and cannot be set via set_block_properties.`);if(a==="additionalConstructionParameters"&&!Array.isArray(s))throw new Error('"additionalConstructionParameters" must be an array.');i[a]=s}}describeBlock(t,r){const o=this.get(t),n=o.blocks.find(i=>i.id===r);if(!n)throw new Error(`Block id ${r} not found in graph "${t}".`);return this._formatBlock(n,o)}describeGraph(t){const r=this.get(t),o=[`# Render Graph: "${r.name}"`,r.comment?`Comment: ${r.comment}`:"",`Output block id: ${r.outputNodeId??"(not set)"}`,`Blocks (${r.blocks.length}):`,""].filter(Boolean);for(const n of r.blocks)o.push(this._formatBlock(n,r)),o.push("");return o.join(`
|
|
94
|
+
`)}_formatBlock(t,r){const o=[`**[${t.id}] ${t.name}** (${t.customType.replace("BABYLON.","")})`];if(t.inputs.length>0){o.push(" Inputs:");for(const a of t.inputs)if(a.targetBlockId!==void 0){const s=r.blocks.find(c=>c.id===a.targetBlockId);o.push(` \u2022 ${a.name} \u2190 [${a.targetBlockId}] ${s?.name??"?"}.${a.targetConnectionName}`)}else o.push(` \u2022 ${a.name} (not connected)`)}if(t.outputs.length>0){o.push(" Outputs:");for(const a of t.outputs){const s=[];for(const c of r.blocks)for(const u of c.inputs)u.targetBlockId===t.id&&u.targetConnectionName===a.name&&s.push(`[${c.id}] ${c.name}.${u.name}`);s.length>0?o.push(` \u2022 ${a.name} \u2192 ${s.join(", ")}`):o.push(` \u2022 ${a.name} (unconnected)`)}}const n=new Set(["customType","id","name","comments","visibleOnFrame","disabled","inputs","outputs"]),i=Object.keys(t).filter(a=>!n.has(a));if(i.length>0){o.push(" Properties:");for(const a of i)o.push(` ${a}: ${JSON.stringify(t[a])}`)}return o.join(`
|
|
95
|
+
`)}validate(t){const r=this.get(t),o=[];if(r.outputNodeId===void 0)o.push("ERROR: No NodeRenderGraphOutputBlock found. Add one and connect a final texture to its 'texture' input.");else{const i=r.blocks.find(a=>a.id===r.outputNodeId);if(!i)o.push(`ERROR: outputNodeId=${r.outputNodeId} does not match any block. The OutputBlock may have been removed.`);else{const a=i.inputs.find(s=>s.name==="texture");(!a||a.targetBlockId===void 0)&&o.push("ERROR: NodeRenderGraphOutputBlock is missing a connection on its 'texture' input. Connect a rendered colour texture to it.")}}for(const i of r.blocks){const a=i.customType.replace("BABYLON.",""),s=Tn[a];if(!s){o.push(`WARNING: Block "${i.name}" (id ${i.id}) has unknown type "${i.customType}". It may have been added with import_graph_json from an external source.`);continue}for(const c of s.inputs){if(c.isOptional)continue;const u=i.inputs.find(l=>l.name===c.name);(!u||u.targetBlockId===void 0)&&o.push(`WARNING: Block "${i.name}" (id ${i.id}) has a required input "${c.name}" that is not connected.`)}}const n=new Set(r.blocks.map(i=>i.id));for(const i of r.blocks)for(const a of i.inputs)a.targetBlockId!==void 0&&!n.has(a.targetBlockId)&&o.push(`ERROR: Block "${i.name}" (id ${i.id}) input "${a.name}" references missing block id ${a.targetBlockId}. Connection must be removed.`);for(const i of r.blocks)if(i.customType==="BABYLON.NodeRenderGraphInputBlock"){const a=i.additionalConstructionParameters;(!a||!Array.isArray(a)||a.length===0)&&o.push(`WARNING: InputBlock "${i.name}" (id ${i.id}) is missing additionalConstructionParameters[0] (the connection-point type). Set it via set_block_properties with key "additionalConstructionParameters". Common values: Texture=1, TextureDepthStencilAttachment=8, Camera=16777216, ObjectList=33554432.`)}return{valid:o.filter(i=>i.startsWith("ERROR")).length===0,messages:o}}exportJson(t){const r=this.get(t);return JSON.stringify(r,null,2)}importJson(t,r,o=!1){const n=Sx(r);if(this._graphs.has(t)&&!o)throw new Error(`A render graph named "${t}" already exists. Pass overwrite=true to replace it.`);n.name=t,n.customType="BABYLON.NodeRenderGraph";for(const i of n.blocks)typeof i.id=="number"&&i.id>=this._nextId&&(this._nextId=i.id+1);return this._graphs.set(t,n),n}}const Cx="https://cdn.babylonjs.com",Ux={havok:"havok/HavokPhysics_umd.js",ammo:"ammo/ammo.js",recast:"recast.js"},Qc="https://snippet.babylonjs.com";async function Zx(e,t=Qc){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 Mx=[["nodeMaterial","nodeMaterial"],["nodeGeometry","nodeGeometry"],["nodeRenderGraph","nodeRenderGraph"],["nodeParticle","nodeParticle"],["gui","gui"],["encodedGui","gui"],["animations","animation"],["animation","animation"],["particleSystem","particleSystem"],["spriteManager","spriteManager"],["shaderMaterial","shaderMaterial"]];function Bx(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 Iv(e){const t=new Uint8Array(Bx(e));return new TextDecoder("utf-8").decode(t)}function Lx(e){if(e.files&&typeof e.files=="object"&&e.v!==void 0||typeof e.code=="string")return"playground";for(const[t,r]of Mx)if(t in e)return r;return"unknown"}function Fx(e,t,r,o){let n;switch(t){case"gui":{typeof e.encodedGui=="string"?n=JSON.parse(Iv(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 eu=null;async function Gx(){return await import("monaco-editor/esm/vs/language/typescript/lib/typescriptServices")}async function qx(){return eu||(eu=Gx().then(e=>e.typescript)),await eu}async function Jx(e,t){const r=await qx();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 Vx(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 Pv=["delayCreateScene","delayLoadScene","createScene","CreateScene","createscene"];function Hx(e){if(e.includes("class Playground"))return"TS";if(Pv.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 Kx(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":Pv.find(n=>r.includes(n))??"createScene";return r+=`
|
|
96
|
+
export default ${o}
|
|
97
|
+
`,t==="JS"&&/\bfunction\s+createEngine\b|\bvar\s+createEngine\s*=|\bconst\s+createEngine\s*=|\blet\s+createEngine\s*=/.test(r)&&(r+=`
|
|
98
|
+
export { createEngine }
|
|
99
|
+
`),r}function Wx(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=Iv(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=Hx(n),a=i==="TS"?"index.ts":"index.js",s=Kx(n,i);return{snippetId:t,type:"playground",metadata:r,language:i,engineType:o.engine,isMultiFile:!1,manifest:null,code:s,files:{[a]:s}}}function xv(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 Ov(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 Xx(e,t,r){const o={},n=new Set,i={};function a(){if(i.__babylonProxy__)return i.__babylonProxy__;const p=globalThis.BABYLON,h=["const B = globalThis.BABYLON || {};","export default B;"];if(p&&typeof p=="object")for(const g of Object.keys(p))/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(g)&&h.push(`export const ${g} = B[${JSON.stringify(g)}];`);const $=URL.createObjectURL(new Blob([h.join(`
|
|
100
|
+
`)],{type:"text/javascript"}));return i.__babylonProxy__=$,$}function s(p){if(i[p])return i[p];if(p.startsWith("@babylonjs/")){const h=a();return i[p]=h,h}if(r&&p in r)return r[p]}function c(p){return/\.m?jsx?$/i.test(p)}function u(p){return`export default ${JSON.stringify(p)};
|
|
101
|
+
`}function l(p){if(o[p])return o[p];if(!(p in e))throw new Error(`Snippet file "${p}" not found in the file map. Check that the manifest entry and import specifiers reference existing files.`);if(!c(p)){const v=URL.createObjectURL(new Blob([u(e[p])],{type:"text/javascript"}));return o[p]=v,v}if(n.has(p)){const v=URL.createObjectURL(new Blob([e[p]],{type:"text/javascript"}));return o[p]=v,v}n.add(p);const h=(v,S,P,N)=>{const B=xv(p,P),K=Ov(B,e);if(K){const ue=l(K);return`${S}${ue}${N}`}return`${S}${P}${N}`},$=(v,S,P,N)=>{const B=s(P);return B?`${S}${B}${N}`:`${S}${P}${N}`};let g=e[p];g=g.replace(/((?:from|import)\s*["'])(\.[^"']+)(["'])/g,h).replace(/(import\s*\(\s*["'])(\.[^"']+)(["']\s*\))/g,h),g=g.replace(/((?:from|import)\s*["'])([^"'./][^"']*)(["'])/g,$).replace(/(import\s*\(\s*["'])([^"'./][^"']*)(["']\s*\))/g,$);const y=URL.createObjectURL(new Blob([g],{type:"text/javascript"}));return o[p]=y,n.delete(p),y}l(t);for(const p of Object.keys(e))!o[p]&&c(p)&&l(p);const m=await import(o[t]??Object.values(o)[0]);for(const p of Object.values(o))URL.revokeObjectURL(p);for(const p of Object.values(i))URL.revokeObjectURL(p);return m}function Yx(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 m=u.slice(1,-1);return`const { ${n(m)} } = require(${c});`}const l=/^\*\s+as\s+(\w+)$/.exec(u);if(l)return`const ${l[1]} = require(${c});`;if(u.includes(",")){const[m,p]=u.split(/,(.+)/).map(g=>g.trim()),h=`__mod_${r++}`,$=[`const ${h} = require(${c});`,`const ${m} = (${h} && Object.prototype.hasOwnProperty.call(${h}, "default")) ? ${h}.default : ${h};`];if(p?.startsWith("{")){const g=p.slice(1,-1),y=n(g);$.push(`const { ${y} } = ${h};`)}else{const g=/^\*\s+as\s+(\w+)$/.exec(p??"");g&&$.push(`const ${g[1]} = ${h};`)}return $.join(`
|
|
102
|
+
`)}const d=`__mod_${r++}`;return`const ${d} = require(${c});
|
|
103
|
+
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 m=d.trim();if(!m)continue;const p=/^(\w+)\s+as\s+(\w+)$/.exec(m),h=p?p[1]:m,$=p?p[2]:m;l.push(`exports.${$} = ${u}.${h};`)}return l.join(`
|
|
104
|
+
`)}),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),m=d?d[1]:l,p=d?d[2]:l;p==="default"?c.push(`exports.default = ${m};`):c.push(`exports.${p} = ${m};`)}return c.join(`
|
|
105
|
+
`)}),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+=`
|
|
106
|
+
${a.map(s=>`exports.${s} = ${s};`).join(`
|
|
107
|
+
`)}
|
|
108
|
+
`}return t}function Tv(e,t,r){const o=Object.keys(e).filter(l=>/\.m?jsx?$/i.test(l)),n={},i={};for(const l of o)n[l]=Yx(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 m=h=>{if(h.startsWith(".")||h.startsWith("/")){const $=xv(l,h),g=Ov($,e);if(g)return a(g);throw new Error(`Unable to resolve script-mode module "${h}" from "${l}"`)}if(h.startsWith("@babylonjs/"))return globalThis.BABYLON??{};if(r&&h in r)throw new Error(`Script mode cannot execute external import "${h}" (${r[h]}). Use moduleFormat: "esm" or pre-bundle dependencies.`);return globalThis[h]};return new Function("require","exports","module",n[l])(m,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 Qx(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 Nv(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 eO(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 tO(e){const t=Object.values(e).join(`
|
|
109
|
+
`);return{havok:/\bHavokPlugin\b/.test(t),ammo:/\bAmmoJSPlugin\b/.test(t),recast:/\bRecastJSPlugin\b/.test(t)}}const tu=(()=>{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 nO(e,t){const r=globalThis,o=t?.loadScripts===!0,n=t?.scriptUrls??{},i=(t?.baseUrl??Cx).replace(/\/+$/,""),a=s=>n[s]??`${i}/${Ux[s]}`;if(e.ammo){if(typeof r.Ammo!="function"&&o)try{await tu(a("ammo"))}catch{}if(typeof r.Ammo=="function")try{await r.Ammo()}catch{}}if(e.recast){if(typeof r.Recast!="function"&&o)try{await tu(a("recast"))}catch{}if(typeof r.Recast=="function")try{await r.Recast()}catch{}}if(e.havok){if(typeof r.HavokPhysics!="function"&&o)try{await tu(a("havok"))}catch{}if(typeof r.HavokPhysics=="function"&&typeof r.HK>"u")try{r.HK=await r.HavokPhysics()}catch{}}}function rO(e,t,r,o,n,i){let a=null,s;const c=e[t]??"",u=Qx(c),l=async()=>(s||(r==="esm"?a=await Xx(e,t,n):a=Tv(e,t,n),s=Nv(a),d=s.createEngineFn?"snippet":"default",m=s.sceneFunctionName),s);let d=u.createEngineSource,m=u.sceneFunctionName;const p=async($,g)=>{const{createEngineFn:y}=await l();return y?await y($,g):await eO(o)($,g)},h=async($,g)=>{const{createSceneFn:y}=await l();if(!y)throw new Error("No createScene export found in snippet (tried: default.CreateScene, Playground.CreateScene, createScene, delayCreateScene, default).");const v=globalThis,S=v.engine,P=v.canvas,N=v.BABYLON,B=N?.Tools?.BaseUrl,K=N?.Tools?.PreprocessUrl;r==="script"&&(v.engine=$,v.canvas=g);const ue=void 0;try{let de;const M=await y.bind(new Proxy({},{get(Q,X){return X==="scene"?de:X==="engine"?$:X==="canvas"?g:globalThis[X]},set(Q,X,V){return X==="scene"?(de=V,!0):(globalThis[X]=V,!0)}}))($,g);return M!=null&&(de=M),ue?.(),de}finally{r==="script"&&(v.engine=S,v.canvas=P),N?.Tools&&(N.Tools.BaseUrl=B,N.Tools.PreprocessUrl=K)}};return r==="script"&&(a=Tv(e,t,n),s=Nv(a),m=s.sceneFunctionName,d=s.createEngineFn?"snippet":"default"),{createEngine:p,createScene:h,getCreateEngineSource:()=>d,getSceneFunctionName:()=>m,initializeMetadataAsync:async()=>{r==="script"&&await l()}}}async function oO(e,t){const r=await Zx(e,Qc);return await iO(r,e,t)}async function iO(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=Lx(i),s=r?.moduleFormat??"esm";switch(a){case"playground":{const c=Wx(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,y)=>await Jx(g,y));d=await Vx(c.files,$)}else d={...c.files};const m=rO(d,u,s,c.engineType,c.manifest?.imports);await m.initializeMetadataAsync();const p=tO(c.files);return{...c,jsFiles:d,executedCode:d[u]??"",moduleFormat:s,createEngine:m.createEngine,createScene:m.createScene,createEngineSource:m.getCreateEngineSource(),sceneFunctionName:m.getSceneFunctionName(),runtimeFeatures:p,initializeRuntimeAsync:async $=>await nO(p,$)}}case"unknown":return{snippetId:t,type:"unknown",metadata:o,rawPayload:i};default:return Fx(i,a,t,o)}}function aO(e,t){return JSON.stringify({payload:e,name:t?.metadata?.name??"",description:t?.metadata?.description??"",tags:t?.metadata?.tags??""})}function sO(e){const t=e.type,r=typeof e.data=="string"?e.data:JSON.stringify(e.data);return JSON.stringify({[t]:r})}function cO(e){const t=e.indexOf("#");return t>=0?e.slice(0,t):e}async function uO(e,t){let r;r=sO(e);const o=aO(r,t),n=(t?.snippetUrl??Qc).replace(/\/+$/,""),i=t?.snippetId?cO(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 Pe=new Ax,Fe=new Rx({serverName:"NRGE MCP Session Server",documentKind:"node-render-graph",managerUnavailableMessage:"Render graph manager is not available",getDocument:(e,t)=>e.exportJson(t.name),setDocument:(e,t,r)=>{try{e.importJson(t.name,r,!0);return}catch(o){return o.message}}},{defaultPort:3001,statusTitle:"NRGE MCP Session Server"});function Ut(e){const t=Fe.getSessionIdForName(e);t&&Fe.notifySessionUpdate(t)}function zv(e,t,r=!1){const o=Pe.importJson(e,t,r);return Ut(e),o}const he=new ox({name:"babylonjs-node-render-graph",version:"1.0.0"},{instructions:["You build Babylon.js Node Render Graphs (custom render pipelines). Workflow: create_render_graph \u2192 add blocks (NodeRenderGraphInputBlock, object/geometry renderers, post-process blocks, NodeRenderGraphOutputBlock) \u2192 connect ports \u2192 validate_graph \u2192 export_graph_json.","Every render graph needs an InputBlock (provides camera/scene) and an OutputBlock (final framebuffer). Use get_block_type_info to discover ports.","Output JSON can be consumed by the Scene MCP via attach_node_render_graph."].join(" ")});he.registerResource("block-catalog","nrg://block-catalog",{},async e=>({contents:[{uri:e.href,mimeType:"text/markdown",text:`# NRG Block Catalog
|
|
110
|
+
|
|
111
|
+
${wv()}`}]})),he.registerResource("enums","nrg://enums",{},async e=>({contents:[{uri:e.href,mimeType:"text/markdown",text:["# NRG Enumerations Reference","","## NodeRenderGraphBlockConnectionPointTypes","These numeric values are used as `additionalConstructionParameters[0]` for **NodeRenderGraphInputBlock**.","","| Type name | Value (hex) | Value (decimal) | Description |","|-----------|------------|-----------------|-------------|","| Texture | 0x00000001 | 1 | Generic colour texture (RGBA) |","| TextureBackBuffer | 0x00000002 | 2 | The engine's back-buffer render target |","| TextureBackBufferDepthStencilAttachment | 0x00000004 | 4 | Depth/stencil attachment of the back buffer |","| TextureDepthStencilAttachment | 0x00000008 | 8 | Depth/stencil attachment for off-screen textures |","| TextureViewDepth | 0x00000010 | 16 | View-space depth (geometry renderer output) |","| TextureViewNormal | 0x00000020 | 32 | View-space normal (geometry renderer output) |","| TextureAlbedo | 0x00000040 | 64 | Albedo/diffuse G-buffer texture |","| TextureReflectivity | 0x00000080 | 128 | Reflectivity G-buffer texture |","| TextureWorldPosition | 0x00000100 | 256 | World-space position G-buffer texture |","| TextureVelocity | 0x00000200 | 512 | Screen-space velocity (motion vectors) |","| TextureIrradiance | 0x00000400 | 1024 | Irradiance G-buffer texture |","| TextureLinearVelocity | 0x00000800 | 2048 | Linear (camera-space) velocity |","| TextureLocalPosition | 0x00001000 | 4096 | Local/object-space position |","| TextureWorldNormal | 0x00002000 | 8192 | World-space normal |","| TextureAlbedoSqrt | 0x00004000 | 16384 | Sqrt-mapped albedo for IBL |","| ResourceContainer | 0x00100000 | 1048576 | Shared GPU resource container |","| ShadowGenerator | 0x00200000 | 2097152 | Shadow generator output |","| ShadowLight | 0x00400000 | 4194304 | Directional/spot/point light for shadow casting |","| Camera | 0x01000000 | 16777216 | Scene camera |","| ObjectList | 0x02000000 | 33554432 | List of renderable objects/meshes |","| Object | 0x80000000 | 2147483648 | Generic internal task object (e.g. ObjectRendererTask) |","| AutoDetect | 0x10000000 | 268435456 | Type is resolved automatically at build time |","| BasedOnInput | 0x20000000 | 536870912 | Output type mirrors a specific input |","","## Using InputBlock types","When adding a `NodeRenderGraphInputBlock` you must pass the connection-point type as","`additionalConstructionParameters[0]` (an integer from the table above).","","Common examples:"," \u2022 Back-buffer colour: `additionalConstructionParameters: [2]` (TextureBackBuffer)"," \u2022 Off-screen texture: `additionalConstructionParameters: [1]` (Texture)"," \u2022 Depth/stencil: `additionalConstructionParameters: [8]` (TextureDepthStencilAttachment)"," \u2022 Back-buffer depth: `additionalConstructionParameters: [4]` (TextureBackBufferDepthStencilAttachment)"," \u2022 Camera: `additionalConstructionParameters: [16777216]` (Camera)"," \u2022 Object list: `additionalConstructionParameters: [33554432]` (ObjectList)"," \u2022 Shadow light: `additionalConstructionParameters: [4194304]` (ShadowLight)","","## Key additionalConstructionParameters for other blocks","","**NodeRenderGraphObjectRendererBlock**","`[doNotChangeAspectRatio (boolean), enableClusteredLights (boolean)]`","Default: `[true, false]`","","**NodeRenderGraphGeometryRendererBlock** (same as ObjectRenderer)","Default: `[true, false]`","","**NodeRenderGraphBloomPostProcessBlock**","`[hdr (boolean), bloomScale (number)]` \u2014 hdr enables HDR pipeline; bloomScale controls texture scale.","Default: `[false, 0.5]`","","**NodeRenderGraphDepthOfFieldPostProcessBlock**","`[blurLevel (0|1|2 = Low|Medium|High), hdr (boolean)]`","Default: `[0, false]`","","**NodeRenderGraphSSRPostProcessBlock**","`[textureType (number)]` \u2014 Engine.TEXTURETYPE_UNSIGNED_BYTE=0, TEXTURETYPE_HALF_FLOAT=2.","Default: `[0]`","","**NodeRenderGraphTAAPostProcessBlock**","`[samples (number), factor (number)]` \u2014 Defaults: 8 samples, factor 1.0.","Default: `[8, 1.0]`","","**NodeRenderGraphGlowLayerBlock**","`[ldrMerge (boolean), ratio (number), fixedSize (number|undefined), type (number|undefined)]`","Default: `[false, 0.5, undefined, undefined]`"].join(`
|
|
112
|
+
`)}]})),he.registerResource("concepts","nrg://concepts",{},async e=>({contents:[{uri:e.href,mimeType:"text/markdown",text:["# Node Render Graph (NRG) Concepts","","## What is a Node Render Graph?","The Node Render Graph is Babylon.js's frame-graph-based render pipeline builder.","Instead of writing custom render loops, you connect typed blocks that represent render","operations \u2014 clearing textures, rendering objects, applying post-processes, adding layers \u2014","and Babylon.js executes them in the correct order at runtime.","","## Graph Execution Model","NRG graphs are **directed acyclic graphs** of render tasks. Data flows","**left-to-right**: source blocks produce textures/objects/cameras that downstream","blocks consume. The graph evaluates every frame.","","## Required Output Block","Every render graph MUST contain exactly **one** `NodeRenderGraphOutputBlock`.","Its `texture` input must be connected with the final rendered colour texture.","The block's `id` is stored as `outputNodeId` in the serialised JSON.","","## Block Categories","","### Input (sources of external data)"," \u2022 **NodeRenderGraphInputBlock** \u2014 exposes an external resource (texture, camera,"," object list, shadow light) as a graph input. Set `additionalConstructionParameters[0]`"," to the desired connection-point type (see nrg://enums)."," \u2022 **NodeRenderGraphOutputBlock** \u2014 the required graph sink. Connect the final"," colour texture to its `texture` input.","","### Textures (GPU texture operations)"," \u2022 **NodeRenderGraphClearBlock** \u2014 clears a texture with a solid colour /"," optional depth clear. Usually the first block that processes a texture."," \u2022 **NodeRenderGraphCopyTextureBlock** \u2014 copies one texture to another."," \u2022 **NodeRenderGraphGenerateMipmapsBlock** \u2014 generates mipmaps for sampled textures.","","### Rendering (draw calls)"," \u2022 **NodeRenderGraphObjectRendererBlock** \u2014 the standard forward-rendering block."," Needs: objectList, camera, texture (colour RT), textureDepth (depth/stencil RT)."," \u2022 **NodeRenderGraphGeometryRendererBlock** \u2014 deferred G-buffer renderer. Writes"," multiple G-buffer textures (viewDepth, viewNormal, albedo, reflectivity, ...)."," \u2022 **NodeRenderGraphShadowGeneratorBlock** \u2014 renders a shadow map for one light."," \u2022 **NodeRenderGraphCascadedShadowGeneratorBlock** \u2014 cascaded shadow-map generator."," \u2022 **NodeRenderGraphCullObjectsBlock** \u2014 culls objects to a frustum. Outputs"," separate lists for opaque / alpha-test / transparent objects.","","### Post-Process (screen-space effects applied to a texture)","All post-process blocks accept `source` (the input texture) and output `output`","(the processed texture). They also require a `camera` input.","Notable blocks: Bloom, Blur, FXAA, Sharpen, ChromaticAberration, Grain,","BlackAndWhite, Tonemap, DepthOfField, SSR, SSAO2, TAA, MotionBlur,","ImageProcessing, ColorCorrection, Convolution, Filter, Pass, and more.","","### Layers (translucent overlay passes)"," \u2022 **NodeRenderGraphGlowLayerBlock** \u2014 adds a halo-glow effect."," \u2022 **NodeRenderGraphHighlightLayerBlock** \u2014 adds coloured outlines/glow to"," specific meshes."," \u2022 **NodeRenderGraphSelectionOutlineLayerBlock** \u2014 renders an outline around"," selected objects.","","### Utility (graph helpers)"," \u2022 **NodeRenderGraphResourceContainerBlock** \u2014 groups GPU resources for sharing."," \u2022 **NodeRenderGraphElbowBlock** \u2014 re-routes a connection wire (cosmetic)."," \u2022 **NodeRenderGraphTeleportInBlock / TeleportOutBlock** \u2014 split long-distance"," wires into a named teleport pair."," \u2022 **NodeRenderGraphExecuteBlock** \u2014 runs an arbitrary custom callback inside"," the frame graph.","","## The Simplest Render Graph","```","InputBlock(BackBuffer) \u2192 ClearBlock.target \u2192 ObjectRendererBlock.texture","InputBlock(BackBufferDepth) \u2192 ObjectRendererBlock.textureDepth","InputBlock(Camera) \u2192 ObjectRendererBlock.camera","InputBlock(ObjectList) \u2192 ObjectRendererBlock.objects","ObjectRendererBlock.texture \u2192 OutputBlock.texture","```","","## Adding a Post-Process","Post-process blocks sit BETWEEN the renderer output and the OutputBlock:","```","...ObjectRendererBlock.texture \u2192 BloomBlock.source","InputBlock(Camera) \u2192 BloomBlock.camera","BloomBlock.output \u2192 OutputBlock.texture","```","","## Scene MCP Integration","After exporting NRG JSON with `export_graph_json`, pass it to the","Scene MCP server's `attach_node_render_graph` tool to apply it to a scene.","The scene MCP will store the JSON and emit the appropriate","`NodeRenderGraph.ParseAsync(...)` code in the generated scene script.","","## Common Mistakes","1. Forgetting NodeRenderGraphOutputBlock \u2014 graph cannot evaluate.","2. Not setting `additionalConstructionParameters` on InputBlock.","3. Not connecting a camera to post-process blocks.","4. Leaving ObjectRendererBlock.objects or .camera disconnected.","5. Using wrong texture types \u2014 colour targets need Texture (1) or"," TextureBackBuffer (2); depth targets need the depth-stencil types (4 or 8)."].join(`
|
|
113
|
+
`)}]})),he.registerPrompt("basic-render-graph",{description:"Step-by-step instructions for building the simplest possible render graph (clear + object renderer + output) for use with the Scene MCP."},()=>({messages:[{role:"user",content:{type:"text",text:["Build a minimal render graph that renders a scene's objects to the back-buffer.","","Steps:","1. create_render_graph name='BasicPipeline'","2. add_block blockType='NodeRenderGraphInputBlock' blockName='BackBuffer'"," additionalConstructionParameters=[2] \u2190 TextureBackBuffer","3. add_block blockType='NodeRenderGraphInputBlock' blockName='DepthBuffer'"," additionalConstructionParameters=[4] \u2190 TextureBackBufferDepthStencilAttachment","4. add_block blockType='NodeRenderGraphInputBlock' blockName='MainCamera'"," additionalConstructionParameters=[16777216] \u2190 Camera","5. add_block blockType='NodeRenderGraphInputBlock' blockName='Objects'"," additionalConstructionParameters=[33554432] \u2190 ObjectList","6. add_block blockType='NodeRenderGraphClearBlock' blockName='Clear'","7. add_block blockType='NodeRenderGraphObjectRendererBlock' blockName='Renderer'","8. add_block blockType='NodeRenderGraphOutputBlock' blockName='Output'","","Connections:","9. connect BackBuffer.output \u2192 Clear.target","10. connect Clear.output \u2192 Renderer.texture","11. connect DepthBuffer.output \u2192 Renderer.textureDepth","12. connect MainCamera.output \u2192 Renderer.camera","13. connect Objects.output \u2192 Renderer.objects","14. connect Renderer.texture \u2192 Output.texture","","15. validate_graph","16. export_graph_json","17. Optionally: pass the JSON to the Scene MCP `attach_node_render_graph` tool."].join(`
|
|
114
|
+
`)}}]})),he.registerPrompt("post-process-pipeline",{description:"Step-by-step instructions for building a render graph with Bloom and FXAA post-processes."},()=>({messages:[{role:"user",content:{type:"text",text:["Build a render graph: clear \u2192 render objects \u2192 Bloom \u2192 FXAA \u2192 output.","","1. create_render_graph name='BloomFxaaPipeline'","2-5. Add InputBlocks for BackBuffer, DepthBuffer, MainCamera, Objects (same types as basic-render-graph).","6. add_block NodeRenderGraphClearBlock 'Clear'","7. add_block NodeRenderGraphObjectRendererBlock 'Renderer'","8. add_block NodeRenderGraphBloomPostProcessBlock 'Bloom'"," additionalConstructionParameters=[false, 0.5] \u2190 hdr=false, bloomScale=0.5","9. add_block NodeRenderGraphFXAAPostProcessBlock 'FXAA'","10. add_block NodeRenderGraphOutputBlock 'Output'","","Connections:","11. BackBuffer.output \u2192 Clear.target","12. Clear.output \u2192 Renderer.texture","13. DepthBuffer.output \u2192 Renderer.textureDepth","14. MainCamera.output \u2192 Renderer.camera","15. Objects.output \u2192 Renderer.objects","16. Renderer.texture \u2192 Bloom.source","17. MainCamera.output \u2192 Bloom.camera","18. Bloom.output \u2192 FXAA.source","19. MainCamera.output \u2192 FXAA.camera","20. FXAA.output \u2192 Output.texture","","21. validate_graph","22. export_graph_json"].join(`
|
|
115
|
+
`)}}]})),he.registerTool("create_render_graph",{description:"Create a new empty Node Render Graph in memory. This is always the first step.",inputSchema:{name:k().describe("Unique name for the render graph (e.g. 'BloomPipeline', 'DeferredRenderer')"),comment:k().optional().describe("Optional description of what this pipeline does")}},async({name:e,comment:t})=>{try{Pe.create(e,t);const r=await Fe.startAsync(Pe),o=Fe.createSession(e),n=Fe.getSessionUrl(o,r);return{content:[{type:"text",text:[`Created render graph "${e}".`,"","Next steps:"," 1. Add InputBlocks for textures, camera, object list (add_block)"," 2. Add rendering/post-process/layer blocks (add_block)"," 3. Add NodeRenderGraphOutputBlock (add_block)"," 4. Wire them together (connect_blocks)"," 5. Validate (validate_graph) and export (export_graph_json)","",`MCP Session URL: ${n}`,"","Tip: read nrg://concepts for a full overview and nrg://block-catalog for all block types."].join(`
|
|
116
|
+
`)}]}}catch(r){return{content:[{type:"text",text:`Error: ${r.message}`}],isError:!0}}}),he.registerTool("get_session_url",{description:"Get or create a live-session URL for a render graph. The URL can be pasted into the Node Render Graph Editor MCP session panel.",inputSchema:{graphName:k().describe("Name of the render graph")}},async({graphName:e})=>{if(!Pe.list().includes(e))return Ct(`Render graph "${e}" not found.`);const r=await Fe.startAsync(Pe),o=Fe.createSession(e),n=Fe.getSessionUrl(o,r);return tn(`MCP Session URL: ${n}`)}),he.registerTool("start_session",{description:"Start a live session for an existing render graph. If a session already exists for this render graph, returns the existing URL.",inputSchema:{graphName:k().describe("Name of the render graph")}},async({graphName:e})=>{if(!Pe.list().includes(e))return Ct(`Render graph "${e}" not found.`);const r=await Fe.startAsync(Pe),o=Fe.createSession(e),n=Fe.getSessionUrl(o,r);return tn(`MCP Session URL: ${n}`)}),he.registerTool("close_session",{description:"Close a live session for a render graph. Disconnects all SSE subscribers in the editor and removes the session. The render graph itself is NOT deleted.",inputSchema:{graphName:k().describe("Name of the render graph whose session to close")}},async({graphName:e})=>Fe.closeSessionForName(e)?tn(`Session for "${e}" closed. The editor will disconnect.`):tn(`No active session for "${e}".`)),he.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 Fe.stopAsync(),tn("MCP session server stopped. Any connected editors have been disconnected."))),he.registerTool("delete_render_graph",{description:"Delete a render graph from memory.",inputSchema:{name:k().describe("Name of the render graph to delete")}},async({name:e})=>{try{return Fe.closeSessionForName(e),Pe.delete(e),{content:[{type:"text",text:`Deleted render graph "${e}".`}]}}catch(t){return{content:[{type:"text",text:`Error: ${t.message}`}],isError:!0}}}),he.registerTool("clear_all",{description:"Remove all render graphs from memory, resetting the server to a clean state."},async()=>{const e=Pe.list();for(const t of e)Fe.closeSessionForName(t);return Pe.clearAll(),{content:[{type:"text",text:e.length>0?`Cleared ${e.length} render graph(s): ${e.join(", ")}`:"Nothing to clear \u2014 memory was already empty."}]}}),he.registerTool("list_render_graphs",{description:"List all render graphs currently in memory."},async()=>{const e=Pe.list();return{content:[{type:"text",text:e.length>0?`Render graphs in memory:
|
|
117
|
+
${e.map(t=>` \u2022 ${t}`).join(`
|
|
118
|
+
`)}`:"No render graphs in memory."}]}}),he.registerTool("add_block",{description:["Add a block to a render graph. Returns the block's unique id, which you pass to connect_blocks.","","IMPORTANT for NodeRenderGraphInputBlock:"," You MUST supply additionalConstructionParameters=[<typeValue>] where <typeValue> is the"," integer connection-point type from nrg://enums. For example:"," \u2022 Back-buffer colour: [2] (TextureBackBuffer)"," \u2022 Off-screen texture: [1] (Texture)"," \u2022 Depth/stencil attachment: [8] (TextureDepthStencilAttachment)"," \u2022 Back-buffer depth: [4] (TextureBackBufferDepthStencilAttachment)"," \u2022 Camera: [16777216]"," \u2022 Object list: [33554432]"," \u2022 Shadow light: [4194304]"].join(`
|
|
119
|
+
`),inputSchema:{graphName:k().describe("Name of the render graph"),blockType:k().describe("Block class name WITHOUT the 'BABYLON.' prefix (e.g. 'NodeRenderGraphInputBlock', 'NodeRenderGraphClearBlock', 'NodeRenderGraphObjectRendererBlock', 'NodeRenderGraphBloomPostProcessBlock', 'NodeRenderGraphOutputBlock'). Use list_block_types for the full catalog."),blockName:k().optional().describe("Human-friendly label for this block (defaults to blockType)"),additionalConstructionParameters:re(fe()).optional().describe("Constructor arguments beyond (name, frameGraph, scene). Required for NodeRenderGraphInputBlock and several post-process blocks. See nrg://enums for values and details.")}},async({graphName:e,blockType:t,blockName:r,additionalConstructionParameters:o})=>{try{const n=Pe.addBlock(e,t,r,o);return Ut(e),{content:[{type:"text",text:[`Added block id=${n.id} name="${n.name}" type=${t}`,`Inputs: ${n.inputs.map(i=>i.name).join(", ")||"(none)"}`,`Outputs: ${n.outputs.map(i=>i.name).join(", ")||"(none)"}`,"",`Use id ${n.id} in connect_blocks / disconnect_input / set_block_properties.`].join(`
|
|
120
|
+
`)}]}}catch(n){return{content:[{type:"text",text:`Error: ${n.message}`}],isError:!0}}}),he.registerTool("add_blocks_batch",{description:"Add multiple blocks in one call. More efficient than repeated add_block calls. Returns all created block ids.",inputSchema:{graphName:k().describe("Name of the render graph"),blocks:re(U({blockType:k().describe("Block class name (without 'BABYLON.' prefix)"),blockName:k().optional().describe("Human-friendly label"),additionalConstructionParameters:re(fe()).optional().describe("Constructor args (required for InputBlock and some post-processes)")})).describe("List of blocks to add")}},async({graphName:e,blocks:t})=>{try{const r=Pe.addBlocksBatch(e,t);Ut(e);const o=r.map(n=>` id=${n.id} "${n.name}" (${n.customType.replace("BABYLON.","")}) inputs=[${n.inputs.map(i=>i.name).join(", ")}] outputs=[${n.outputs.map(i=>i.name).join(", ")}]`);return{content:[{type:"text",text:`Added ${r.length} blocks:
|
|
121
|
+
${o.join(`
|
|
122
|
+
`)}`}]}}catch(r){return{content:[{type:"text",text:`Error: ${r.message}`}],isError:!0}}}),he.registerTool("remove_block",{description:"Remove a block and all its connections from a render graph.",inputSchema:{graphName:k().describe("Name of the render graph"),blockId:ae().describe("Block id (from add_block or describe_graph output)")}},async({graphName:e,blockId:t})=>{try{return Pe.removeBlock(e,t),Ut(e),{content:[{type:"text",text:`Removed block id=${t} and all its connections.`}]}}catch(r){return{content:[{type:"text",text:`Error: ${r.message}`}],isError:!0}}}),he.registerTool("connect_blocks",{description:["Connect an output port of one block to an input port of another block.","","How to read port names:"," \u2022 Call describe_block or describe_graph to see each block's exact input and output port names."," \u2022 Call get_block_type_info to see the canonical port names defined in the catalog.","","Common connections:"," InputBlock(BackBuffer).output \u2192 ClearBlock.target"," ClearBlock.output \u2192 ObjectRendererBlock.texture"," ObjectRendererBlock.texture \u2192 BloomBlock.source"," BloomBlock.output \u2192 OutputBlock.texture"].join(`
|
|
123
|
+
`),inputSchema:{graphName:k().describe("Name of the render graph"),sourceBlockId:ae().describe("Id of the block providing the output value"),sourcePortName:k().describe("Output port name on the source block (e.g. 'output', 'texture')"),targetBlockId:ae().describe("Id of the block receiving the input"),targetPortName:k().describe("Input port name on the target block (e.g. 'target', 'source', 'camera', 'objects')")}},async({graphName:e,sourceBlockId:t,sourcePortName:r,targetBlockId:o,targetPortName:n})=>{try{return Pe.connect(e,t,r,o,n),Ut(e),{content:[{type:"text",text:`Connected: block[${t}].${r} \u2192 block[${o}].${n}`}]}}catch(i){return{content:[{type:"text",text:`Error: ${i.message}`}],isError:!0}}}),he.registerTool("connect_blocks_batch",{description:"Connect multiple block pairs in one call. More efficient than repeated connect_blocks calls.",inputSchema:{graphName:k().describe("Name of the render graph"),connections:re(U({sourceBlockId:ae().describe("Id of the source block"),sourcePortName:k().describe("Output port name on the source block"),targetBlockId:ae().describe("Id of the target block"),targetPortName:k().describe("Input port name on the target block")})).describe("List of connections to create")}},async({graphName:e,connections:t})=>{try{Pe.connectBatch(e,t),Ut(e);const r=t.map(o=>` block[${o.sourceBlockId}].${o.sourcePortName} \u2192 block[${o.targetBlockId}].${o.targetPortName}`);return{content:[{type:"text",text:`Created ${t.length} connections:
|
|
124
|
+
${r.join(`
|
|
125
|
+
`)}`}]}}catch(r){return{content:[{type:"text",text:`Error: ${r.message}`}],isError:!0}}}),he.registerTool("disconnect_input",{description:"Remove a connection from an input port of a block.",inputSchema:{graphName:k().describe("Name of the render graph"),blockId:ae().describe("Id of the block whose input should be disconnected"),inputPortName:k().describe("Name of the input port to disconnect")}},async({graphName:e,blockId:t,inputPortName:r})=>{try{return Pe.disconnectInput(e,t,r),Ut(e),{content:[{type:"text",text:`Disconnected input "${r}" on block id=${t}.`}]}}catch(o){return{content:[{type:"text",text:`Error: ${o.message}`}],isError:!0}}}),he.registerTool("set_block_properties",{description:["Set one or more properties on a block, such as custom colours, threshold values,","intensity multipliers, or constructor parameters.","","Properties become top-level keys in the block serialisation, which is how","Babylon.js reads them back at deserialization time.","","Special key:"," `additionalConstructionParameters` (array) \u2014 replaces the constructor args."," Use this to change an InputBlock's texture type after it was added.","","Examples:"," ClearBlock: { clearColor: {r:0,g:0,b:0,a:1}, clearDepth: true }"," BloomBlock: { threshold: 0.8, weight: 0.7 }"," TaaBlock: { additionalConstructionParameters: [16, 0.9] }"," GlowLayerBlock: { intensity: 1.5, blurKernelSize: 64 }"].join(`
|
|
126
|
+
`),inputSchema:{graphName:k().describe("Name of the render graph"),blockId:ae().describe("Id of the block to update"),properties:ge(k(),fe()).describe("Key-value properties to set on the block")}},async({graphName:e,blockId:t,properties:r})=>{try{Pe.setBlockProperties(e,t,r),Ut(e);const o=Object.keys(r);return{content:[{type:"text",text:`Updated block id=${t}: ${o.join(", ")}`}]}}catch(o){return{content:[{type:"text",text:`Error: ${o.message}`}],isError:!0}}}),he.registerTool("describe_block",{description:"Get a detailed description of a single block: its ports, connections, and properties.",inputSchema:{graphName:k().describe("Name of the render graph"),blockId:ae().describe("Block id to describe")}},async({graphName:e,blockId:t})=>{try{return{content:[{type:"text",text:Pe.describeBlock(e,t)}]}}catch(r){return{content:[{type:"text",text:`Error: ${r.message}`}],isError:!0}}}),he.registerTool("describe_graph",{description:"Get a full human-readable overview of a render graph: all blocks, connections, and properties.",inputSchema:{graphName:k().describe("Name of the render graph")}},async({graphName:e})=>{try{return{content:[{type:"text",text:Pe.describeGraph(e)}]}}catch(t){return{content:[{type:"text",text:`Error: ${t.message}`}],isError:!0}}}),he.registerTool("validate_graph",{description:["Validate a render graph, checking for common issues:"," \u2022 Missing NodeRenderGraphOutputBlock"," \u2022 OutputBlock.texture not connected"," \u2022 Required inputs left unconnected"," \u2022 Dangling references to deleted blocks"," \u2022 InputBlocks missing additionalConstructionParameters","","Always call this before export_graph_json."].join(`
|
|
127
|
+
`),inputSchema:{graphName:k().describe("Name of the render graph to validate")}},async({graphName:e})=>{try{const{valid:t,messages:r}=Pe.validate(e),o=t?`Graph "${e}" is valid.`:`Graph "${e}" has issues:`,n=r.length>0?`
|
|
128
|
+
|
|
129
|
+
`+r.map(i=>` \u2022 ${i}`).join(`
|
|
130
|
+
`):"";return{content:[{type:"text",text:o+n}]}}catch(t){return{content:[{type:"text",text:`Error: ${t.message}`}],isError:!0}}}),he.registerTool("export_graph_json",{description:["Export a render graph as NRGE-compatible JSON string.","","The returned JSON can be:"," \u2022 Loaded by Babylon.js via `NodeRenderGraph.ParseAsync(json, scene)`"," \u2022 Passed to the Scene MCP server's `attach_node_render_graph` tool","","Always call validate_graph before exporting to catch issues early.","","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)."].join(`
|
|
131
|
+
`),inputSchema:{graphName:k().describe("Name of the render graph to export"),outputFile:yx(gn)}},async({graphName:e,outputFile:t})=>{try{const r=Pe.exportJson(e);if(t)try{return fx(t,r),{content:[{type:"text",text:`NRG JSON written to: ${t}`}]}}catch(o){return{content:[{type:"text",text:`Error writing file: ${o.message}`}],isError:!0}}return{content:[{type:"text",text:r}]}}catch(r){return{content:[{type:"text",text:`Error: ${r.message}`}],isError:!0}}}),he.registerTool("import_graph_json",{description:["Import a render graph from an existing NRGE-compatible JSON string.","Useful for editing a previously exported or hand-authored graph.","","The graph is stored under `graphName` (overrides the JSON's internal name).","Blocks from the imported graph can then be modified with set_block_properties,","connect_blocks, etc.","","Provide either the inline json string OR a jsonFile path (not both)."].join(`
|
|
132
|
+
`),inputSchema:{graphName:k().describe("Name to assign to the imported graph in memory"),json:_x(gn,"NRGE-compatible JSON string (output of export_graph_json or NodeRenderGraph.serialize())"),jsonFile:$x(gn,"Absolute path to a file containing the NRGE JSON to import (alternative to inline json)"),overwrite:bv(gn)}},async({graphName:e,json:t,jsonFile:r,overwrite:o})=>hx({json:t,jsonFile:r,fileDescription:"NRGE JSON file",importJson:n=>zv(e,n,o??!1),createSuccessText:n=>[`Imported render graph "${e}" with ${n.blocks.length} blocks.`,`outputNodeId: ${n.outputNodeId??"(not set)"}`,"","Call describe_graph to inspect the imported structure."].join(`
|
|
133
|
+
`)})),he.registerTool("import_from_snippet",{description:'Import a Node Render Graph from the Babylon.js Snippet Server by its snippet ID. The snippet is fetched, validated as a nodeRenderGraph type, and loaded into memory for editing. Snippet IDs look like "ABC123" or "ABC123#2" (with revision).',inputSchema:{graphName:k().describe("Name to assign to the imported graph in memory"),snippetId:bx(gn),overwrite:bv(gn)}},async({graphName:e,snippetId:t,overwrite:r})=>await vx({snippetId:t,loadSnippet:async o=>await oO(o),createResponse:o=>gx({snippetId:t,snippetResult:o,expectedType:"nodeRenderGraph",importJson:n=>zv(e,n,r??!1),createSuccessText:n=>[`Imported snippet "${t}" as render graph "${e}" with ${n.blocks.length} blocks.`,`outputNodeId: ${n.outputNodeId??"(not set)"}`,"","Call describe_graph to inspect the imported structure."].join(`
|
|
134
|
+
`)})})),he.registerTool("list_block_types",{description:"List all available NRG block types, grouped by category."},async()=>({content:[{type:"text",text:wv()}]})),he.registerTool("get_block_type_info",{description:"Get detailed information about a specific NRG block type: its input/output ports, optional flags, and required additionalConstructionParameters.",inputSchema:{blockType:k().describe("Block class name WITHOUT the 'BABYLON.' prefix (e.g. 'NodeRenderGraphBloomPostProcessBlock')")}},async({blockType:e})=>{if(!Tn[e]){const r=e.toLowerCase().replace("noderendergraph",""),o=Object.keys(Tn).filter(i=>i.toLowerCase().includes(r)).slice(0,5),n=o.length>0?`
|
|
135
|
+
|
|
136
|
+
Did you mean one of: ${o.join(", ")}?`:`
|
|
137
|
+
|
|
138
|
+
Use list_block_types to browse the full catalog.`;return{content:[{type:"text",text:`Block type "${e}" not found.${n}`}],isError:!0}}return{content:[{type:"text",text:Dx(e)}]}}),he.registerTool("save_snippet",{description:"Save the render graph to the Babylon.js Snippet Server and return the snippet ID and version. The snippet can later be loaded in the Node Render Graph 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:{graphName:k().describe("Name of the render graph 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({graphName:e,snippetId:t,name:r,description:o,tags:n})=>{const i=Pe.exportJson(e);if(!i)return{content:[{type:"text",text:`Render graph "${e}" not found.`}],isError:!0};try{const a=await uO({type:"nodeRenderGraph",data:_v({jsonText:i,jsonLabel:"NRG JSON"})},{snippetId:t,metadata:{name:r,description:o,tags:n}});return{content:[{type:"text",text:`Saved render graph "${e}" to snippet server.
|
|
139
|
+
|
|
140
|
+
Snippet ID: ${a.id}
|
|
141
|
+
Version: ${a.version}
|
|
142
|
+
Full ID: ${a.snippetId}
|
|
143
|
+
|
|
144
|
+
Load in NRGE editor: https://nrge.babylonjs.com/#${a.snippetId}`}]}}catch(a){return{content:[{type:"text",text:`Error saving snippet: ${a.message}`}],isError:!0}}});const lO=new lx;await he.connect(lO),console.error("babylonjs-node-render-graph MCP server running on stdio");const jv=()=>{Fe.stopAsync(),process.exit(0)};process.on("SIGINT",jv),process.on("SIGTERM",jv);
|
|
145
|
+
//# sourceMappingURL=nrge-mcp-server.js.map
|